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:
parent
366e74c5bc
commit
ec1f9424bb
5 changed files with 19 additions and 3 deletions
|
@ -33,7 +33,20 @@ public interface IMakeTarget {
|
||||||
String getBuildArguments();
|
String getBuildArguments();
|
||||||
void setBuildArguments(String arguments);
|
void setBuildArguments(String arguments);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the target build container.
|
||||||
|
*
|
||||||
|
* @return IContainer of where target build will be invoked.
|
||||||
|
*/
|
||||||
IContainer getContainer();
|
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;
|
void build(IProgressMonitor monitor) throws CoreException;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,14 +16,13 @@ import org.eclipse.core.resources.IProjectDescription;
|
||||||
import org.eclipse.core.resources.IProjectNature;
|
import org.eclipse.core.resources.IProjectNature;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.core.runtime.SubProgressMonitor;
|
|
||||||
|
|
||||||
public class MakeProjectNature implements IProjectNature {
|
public class MakeProjectNature implements IProjectNature {
|
||||||
|
|
||||||
public final static String NATURE_ID = MakeCorePlugin.getUniqueIdentifier() + ".makeNature"; //$NON-NLS-1$
|
public final static String NATURE_ID = MakeCorePlugin.getUniqueIdentifier() + ".makeNature"; //$NON-NLS-1$
|
||||||
private IProject fProject;
|
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();
|
IProjectDescription description = project.getDescription();
|
||||||
String[] prevNatures= description.getNatureIds();
|
String[] prevNatures= description.getNatureIds();
|
||||||
for (int i= 0; i < prevNatures.length; i++) {
|
for (int i= 0; i < prevNatures.length; i++) {
|
||||||
|
|
|
@ -8,5 +8,6 @@ MakeBuidler.Creating_Markers=Generating markers...
|
||||||
BuildInfoFactory.Missing_Builder=Missing Builder:
|
BuildInfoFactory.Missing_Builder=Missing Builder:
|
||||||
|
|
||||||
MakeTargetProvider.add_to_workspace_root=Cannot add build targets to workspace root
|
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.target_exists=Target exists
|
||||||
MakeTargetProvider.failed_initializing_targets=Failed initializing build targets
|
MakeTargetProvider.failed_initializing_targets=Failed initializing build targets
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class MakeTarget implements IMakeTarget {
|
||||||
isStopOnError = info.isStopOnError();
|
isStopOnError = info.isStopOnError();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setContainer(IContainer container) {
|
public void setContainer(IContainer container) {
|
||||||
this.container = container;
|
this.container = container;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,6 +66,9 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
|
||||||
if (container instanceof IWorkspaceRoot) {
|
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$
|
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();
|
IProject project = container.getProject();
|
||||||
ProjectTargets projectTargets = (ProjectTargets) projectMap.get(project);
|
ProjectTargets projectTargets = (ProjectTargets) projectMap.get(project);
|
||||||
if (projectTargets == null) {
|
if (projectTargets == null) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue