1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

added support for temporary targets

This commit is contained in:
David Inglis 2003-09-24 14:20:21 +00:00
parent 366e74c5bc
commit ec1f9424bb
5 changed files with 19 additions and 3 deletions

View file

@ -33,7 +33,20 @@ public interface IMakeTarget {
String getBuildArguments();
void setBuildArguments(String arguments);
/**
* Get the target build container.
*
* @return IContainer of where target build will be invoked.
*/
IContainer getContainer();
/**
* Make this target temporary on the container, this target will not be persisted,
* and may not be added to the IMakeTargetManager.
* @param container
*/
void setContainer(IContainer container);
void build(IProgressMonitor monitor) throws CoreException;
}

View file

@ -16,14 +16,13 @@ import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IProjectNature;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
public class MakeProjectNature implements IProjectNature {
public final static String NATURE_ID = MakeCorePlugin.getUniqueIdentifier() + ".makeNature"; //$NON-NLS-1$
private IProject fProject;
public static void addNature(IProject project, SubProgressMonitor monitor) throws CoreException {
public static void addNature(IProject project, IProgressMonitor monitor) throws CoreException {
IProjectDescription description = project.getDescription();
String[] prevNatures= description.getNatureIds();
for (int i= 0; i < prevNatures.length; i++) {

View file

@ -8,5 +8,6 @@ MakeBuidler.Creating_Markers=Generating markers...
BuildInfoFactory.Missing_Builder=Missing Builder:
MakeTargetProvider.add_to_workspace_root=Cannot add build targets to workspace root
MakeTargetProvider.add_temporary_target=Cannot add temporart Target to manager.
MakeTargetProvider.target_exists=Target exists
MakeTargetProvider.failed_initializing_targets=Failed initializing build targets

View file

@ -44,7 +44,7 @@ public class MakeTarget implements IMakeTarget {
isStopOnError = info.isStopOnError();
}
void setContainer(IContainer container) {
public void setContainer(IContainer container) {
this.container = container;
}

View file

@ -66,6 +66,9 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
if (container instanceof IWorkspaceRoot) {
throw new CoreException(new Status(IStatus.ERROR, MakeCorePlugin.getUniqueIdentifier(), -1, MakeCorePlugin.getResourceString("MakeTargetManager.add_to_workspace_root"), null)); //$NON-NLS-1$
}
if ( target.getContainer() != null) {
throw new CoreException(new Status(IStatus.ERROR, MakeCorePlugin.getUniqueIdentifier(), -1, MakeCorePlugin.getResourceString("MakeTargetManager.add_temporary_target"), null)); //$NON-NLS-1$
}
IProject project = container.getProject();
ProjectTargets projectTargets = (ProjectTargets) projectMap.get(project);
if (projectTargets == null) {