1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-01 21:35:40 +02:00

new make target provider/make target/listener/event

This commit is contained in:
David Inglis 2003-08-19 02:21:49 +00:00
parent 4471c53d81
commit 2bb372a867
13 changed files with 200 additions and 26 deletions

View file

@ -1,6 +1,5 @@
package org.eclipse.cdt.make.core;
/********************************************************************** /**********************************************************************
* Copyright (c) 2002,2003 Rational Software Corporation and others. * Copyright (c) 2002,2003 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0 * are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -8,8 +7,8 @@ package org.eclipse.cdt.make.core;
* *
* Contributors: * Contributors:
* QNX Software Systems - Initial API and implementation * QNX Software Systems - Initial API and implementation
* IBM Rational Software - Initial API and implementation
***********************************************************************/ ***********************************************************************/
package org.eclipse.cdt.make.core;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;

View file

@ -0,0 +1,24 @@
/**********************************************************************
* Copyright (c) 2002,2003 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.make.core;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.runtime.IPath;
public interface IMakeTarget {
IMakeTargetProvider getProvider();
String getName();
IContainer getContainer();
boolean isStopOnError();
boolean isDefaultBuildCmd();
IPath getBuildCommand();
String getBuildArguments();
}

View file

@ -0,0 +1,16 @@
/**********************************************************************
* Copyright (c) 2002,2003 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.make.core;
public interface IMakeTargetListener {
void targetChanged(MakeTargetEvent event);
}

View file

@ -0,0 +1,24 @@
/**********************************************************************
* Copyright (c) 2002,2003 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.make.core;
import org.eclipse.core.resources.IContainer;
public interface IMakeTargetProvider {
IMakeTarget[] getTargets();
IMakeTarget[] getTargets(IContainer container);
IMakeBuilderInfo getBuilderInfo(IMakeTarget target);
void addListener(IMakeTargetListener listener);
void removeListener(IMakeTargetListener listener);
}

View file

@ -1,6 +1,5 @@
package org.eclipse.cdt.make.core;
/********************************************************************** /**********************************************************************
* Copyright (c) 2002,2003 Rational Software Corporation and others. * Copyright (c) 2002,2003 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0 * are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -8,8 +7,8 @@ package org.eclipse.cdt.make.core;
* *
* Contributors: * Contributors:
* QNX Software Systems - Initial API and implementation * QNX Software Systems - Initial API and implementation
* IBM Rational Software - Initial API and implementation
***********************************************************************/ ***********************************************************************/
package org.eclipse.cdt.make.core;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;

View file

@ -1,6 +1,5 @@
package org.eclipse.cdt.make.core;
/********************************************************************** /**********************************************************************
* Copyright (c) 2002,2003 Rational Software Corporation and others. * Copyright (c) 2002,2003 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0 * are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -8,8 +7,8 @@ package org.eclipse.cdt.make.core;
* *
* Contributors: * Contributors:
* QNX Software Systems - Initial API and implementation * QNX Software Systems - Initial API and implementation
* IBM Rational Software - Initial API and implementation
***********************************************************************/ ***********************************************************************/
package org.eclipse.cdt.make.core;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.Map; import java.util.Map;
@ -18,6 +17,7 @@ import java.util.ResourceBundle;
import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.make.internal.core.BuildInfoFactory; import org.eclipse.cdt.make.internal.core.BuildInfoFactory;
import org.eclipse.cdt.make.internal.core.MakeTargetProvider;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPluginDescriptor; import org.eclipse.core.runtime.IPluginDescriptor;
@ -29,6 +29,7 @@ import org.eclipse.core.runtime.Preferences;
* The main plugin class to be used in the desktop. * The main plugin class to be used in the desktop.
*/ */
public class MakeCorePlugin extends Plugin { public class MakeCorePlugin extends Plugin {
private IMakeTargetProvider fTargetProvider;
public static final String OLD_BUILDER_ID = "org.eclipse.cdt.core.cbuilder"; //$NON-NLS-1$ public static final String OLD_BUILDER_ID = "org.eclipse.cdt.core.cbuilder"; //$NON-NLS-1$
//The shared instance. //The shared instance.
private static MakeCorePlugin plugin; private static MakeCorePlugin plugin;
@ -118,4 +119,11 @@ public class MakeCorePlugin extends Plugin {
public static IMakeBuilderInfo create(Map args, String builderID) { public static IMakeBuilderInfo create(Map args, String builderID) {
return BuildInfoFactory.create(args, builderID); return BuildInfoFactory.create(args, builderID);
} }
public IMakeTargetProvider getTargetProvider() {
if ( fTargetProvider == null) {
fTargetProvider = new MakeTargetProvider();
}
return fTargetProvider;
}
} }

View file

@ -1,6 +1,5 @@
package org.eclipse.cdt.make.core;
/********************************************************************** /**********************************************************************
* Copyright (c) 2002,2003 Rational Software Corporation and others. * Copyright (c) 2002,2003 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0 * are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -8,8 +7,8 @@ package org.eclipse.cdt.make.core;
* *
* Contributors: * Contributors:
* QNX Software Systems - Initial API and implementation * QNX Software Systems - Initial API and implementation
* IBM Rational Software - Initial API and implementation
***********************************************************************/ ***********************************************************************/
package org.eclipse.cdt.make.core;
import org.eclipse.core.resources.ICommand; import org.eclipse.core.resources.ICommand;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;

View file

@ -1,9 +1,13 @@
/* /**********************************************************************
* Created on Aug 14, 2003 * Copyright (c) 2002,2003 QNX Software Systems and others.
* * All rights reserved. This program and the accompanying materials
* To change the template for this generated file go to * are made available under the terms of the Common Public License v1.0
* Window>Preferences>Java>Code Generation>Code and Comments * which accompanies this distribution, and is available at
*/ * http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.make.core; package org.eclipse.cdt.make.core;
import java.util.ArrayList; import java.util.ArrayList;

View file

@ -1,6 +1,5 @@
package org.eclipse.cdt.make.core;
/********************************************************************** /**********************************************************************
* Copyright (c) 2002,2003 Rational Software Corporation and others. * Copyright (c) 2002,2003 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0 * are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -8,8 +7,8 @@ package org.eclipse.cdt.make.core;
* *
* Contributors: * Contributors:
* QNX Software Systems - Initial API and implementation * QNX Software Systems - Initial API and implementation
* IBM Rational Software - Initial API and implementation
***********************************************************************/ ***********************************************************************/
package org.eclipse.cdt.make.core;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;

View file

@ -0,0 +1,39 @@
/**********************************************************************
* Copyright (c) 2002,2003 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.make.core;
import java.util.EventObject;
public class MakeTargetEvent extends EventObject {
public final int TARGET_ADD = 1;
public final int TARGET_CHANGED = 2;
public final int TARGET_REMOVED = 3;
IMakeTarget target;
int type;
/**
* @param source
*/
public MakeTargetEvent(Object source, int type, IMakeTarget target) {
super(source);
this.type = type;
this.target = target;
}
public int getType() {
return type;
}
public IMakeTarget getTarget() {
return target;
}
}

View file

@ -1,6 +1,5 @@
package org.eclipse.cdt.make.internal.core;
/********************************************************************** /**********************************************************************
* Copyright (c) 2002,2003 Rational Software Corporation and others. * Copyright (c) 2002,2003 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0 * are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -8,8 +7,8 @@ package org.eclipse.cdt.make.internal.core;
* *
* Contributors: * Contributors:
* QNX Software Systems - Initial API and implementation * QNX Software Systems - Initial API and implementation
* IBM Rational Software - Initial API and implementation
***********************************************************************/ ***********************************************************************/
package org.eclipse.cdt.make.internal.core;
import java.util.Map; import java.util.Map;

View file

@ -1,6 +1,5 @@
package org.eclipse.cdt.make.internal.core;
/********************************************************************** /**********************************************************************
* Copyright (c) 2002,2003 Rational Software Corporation and others. * Copyright (c) 2002,2003 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0 * are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -9,6 +8,7 @@ package org.eclipse.cdt.make.internal.core;
* Contributors: * Contributors:
* QNX Software Systems - Initial API and implementation * QNX Software Systems - Initial API and implementation
***********************************************************************/ ***********************************************************************/
package org.eclipse.cdt.make.internal.core;
import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.ICDescriptor; import org.eclipse.cdt.core.ICDescriptor;

View file

@ -0,0 +1,64 @@
/**********************************************************************
* Copyright (c) 2002,2003 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.make.internal.core;
import org.eclipse.cdt.make.core.IMakeBuilderInfo;
import org.eclipse.cdt.make.core.IMakeTarget;
import org.eclipse.cdt.make.core.IMakeTargetListener;
import org.eclipse.cdt.make.core.IMakeTargetProvider;
import org.eclipse.core.resources.IContainer;
public class MakeTargetProvider implements IMakeTargetProvider {
public MakeTargetProvider() {
}
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.IMakeTargetProvider#getTargets()
*/
public IMakeTarget[] getTargets() {
// dinglis-TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.IMakeTargetProvider#getTargets(org.eclipse.core.resources.IContainer)
*/
public IMakeTarget[] getTargets(IContainer container) {
// dinglis-TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.IMakeTargetProvider#getBuilderInfo(org.eclipse.cdt.make.core.IMakeTarget)
*/
public IMakeBuilderInfo getBuilderInfo(IMakeTarget target) {
// dinglis-TODO Auto-generated method stub
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.IMakeTargetProvider#addListener(org.eclipse.cdt.make.core.IMakeTargetListener)
*/
public void addListener(IMakeTargetListener listener) {
// dinglis-TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.make.core.IMakeTargetProvider#removeListener(org.eclipse.cdt.make.core.IMakeTargetListener)
*/
public void removeListener(IMakeTargetListener listener) {
// dinglis-TODO Auto-generated method stub
}
}