Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Rennie2011-02-11 12:17:22 -0500
committerMichael Rennie2011-02-11 12:17:22 -0500
commit969a3f02be8af4ab92f4f991aafdc887209b6cbf (patch)
tree0f8dcc255dfa7e2aae50bc103ceb6f3048a86ad4 /org.eclipse.core.externaltools
parent7b9df4346d5066d82b499d08791cd59144c1bab9 (diff)
downloadeclipse.platform.debug-969a3f02be8af4ab92f4f991aafdc887209b6cbf.tar.gz
eclipse.platform.debug-969a3f02be8af4ab92f4f991aafdc887209b6cbf.tar.xz
eclipse.platform.debug-969a3f02be8af4ab92f4f991aafdc887209b6cbf.zip
Bug 114563 - [launching] [builders] Ant Builder doesn't build with Target set to <default>
Diffstat (limited to 'org.eclipse.core.externaltools')
-rw-r--r--org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/BuilderCoreUtils.java62
-rw-r--r--org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolBuilder.java29
2 files changed, 52 insertions, 39 deletions
diff --git a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/BuilderCoreUtils.java b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/BuilderCoreUtils.java
index f3b7acd6d..23cf6ea65 100644
--- a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/BuilderCoreUtils.java
+++ b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/BuilderCoreUtils.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -39,6 +39,12 @@ import org.eclipse.debug.core.ILaunchManager;
public class BuilderCoreUtils {
public static final String LAUNCH_CONFIG_HANDLE = "LaunchConfigHandle"; //$NON-NLS-1$
+ /**
+ * Constant added to the build command to determine if we are doing an incremental build after a clean
+ *
+ * @since 3.7
+ */
+ public static final String INC_CLEAN = "incclean"; //$NON-NLS-1$
/**
* Constant used to find a builder using the 3.0-interim format
@@ -113,41 +119,41 @@ public class BuilderCoreUtils {
return configuration;
}
- public static void configureTriggers(ILaunchConfiguration config,
- ICommand newCommand) throws CoreException {
+ public static void configureTriggers(ILaunchConfiguration config, ICommand newCommand) throws CoreException {
newCommand.setBuilding(IncrementalProjectBuilder.FULL_BUILD, false);
- newCommand.setBuilding(IncrementalProjectBuilder.INCREMENTAL_BUILD,
- false);
+ newCommand.setBuilding(IncrementalProjectBuilder.INCREMENTAL_BUILD, false);
newCommand.setBuilding(IncrementalProjectBuilder.AUTO_BUILD, false);
newCommand.setBuilding(IncrementalProjectBuilder.CLEAN_BUILD, false);
- String buildKinds = config.getAttribute(
- IExternalToolConstants.ATTR_RUN_BUILD_KINDS, (String) null);
- int[] triggers = BuilderCoreUtils.buildTypesToArray(buildKinds);
+ Map args = newCommand.getArguments();
+ String buildKinds = config.getAttribute(IExternalToolConstants.ATTR_RUN_BUILD_KINDS, (String) null);
+ int[] triggers = buildTypesToArray(buildKinds);
+ boolean isfull = false, isinc = false;
for (int i = 0; i < triggers.length; i++) {
switch (triggers[i]) {
- case IncrementalProjectBuilder.FULL_BUILD:
- newCommand.setBuilding(IncrementalProjectBuilder.FULL_BUILD,
- true);
- break;
- case IncrementalProjectBuilder.INCREMENTAL_BUILD:
- newCommand.setBuilding(
- IncrementalProjectBuilder.INCREMENTAL_BUILD, true);
- break;
- case IncrementalProjectBuilder.AUTO_BUILD:
- newCommand.setBuilding(IncrementalProjectBuilder.AUTO_BUILD,
- true);
- break;
- case IncrementalProjectBuilder.CLEAN_BUILD:
- newCommand.setBuilding(IncrementalProjectBuilder.CLEAN_BUILD,
- true);
- break;
+ case IncrementalProjectBuilder.FULL_BUILD:
+ newCommand.setBuilding(IncrementalProjectBuilder.FULL_BUILD, true);
+ isfull = true;
+ break;
+ case IncrementalProjectBuilder.INCREMENTAL_BUILD:
+ newCommand.setBuilding(IncrementalProjectBuilder.INCREMENTAL_BUILD, true);
+ isinc = true;
+ break;
+ case IncrementalProjectBuilder.AUTO_BUILD:
+ newCommand.setBuilding(IncrementalProjectBuilder.AUTO_BUILD, true);
+ break;
+ case IncrementalProjectBuilder.CLEAN_BUILD:
+ newCommand.setBuilding(IncrementalProjectBuilder.CLEAN_BUILD, true);
+ break;
}
}
- if (!config.getAttribute(
- IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED, false)) {
+ if(!isfull && isinc) {
+ newCommand.setBuilding(IncrementalProjectBuilder.FULL_BUILD, true);
+ args.put(INC_CLEAN, Boolean.TRUE.toString());
+ newCommand.setArguments(args);
+ }
+ if (!config.getAttribute(IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED, false)) {
ILaunchConfigurationWorkingCopy copy = config.getWorkingCopy();
- copy.setAttribute(IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED,
- true);
+ copy.setAttribute(IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED, true);
copy.doSave();
}
}
diff --git a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolBuilder.java b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolBuilder.java
index 244a833f6..dd809de7f 100644
--- a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolBuilder.java
+++ b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolBuilder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -85,7 +85,7 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
}
boolean kindCompatible= commandConfiguredForKind(config, kind);
if (kindCompatible && configEnabled(config)) {
- doBuildBasedOnScope(resources, kind, config, monitor);
+ doBuildBasedOnScope(resources, kind, config, args, monitor);
}
return projectsWithinScope;
@@ -157,7 +157,7 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
return true;
}
- private void doBuildBasedOnScope(IResource[] resources, int kind, ILaunchConfiguration config, IProgressMonitor monitor) throws CoreException {
+ private void doBuildBasedOnScope(IResource[] resources, int kind, ILaunchConfiguration config, Map args, IProgressMonitor monitor) throws CoreException {
boolean buildForChange = true;
if (kind != FULL_BUILD) { //scope not applied for full builds
if (resources != null && resources.length > 0) {
@@ -166,19 +166,19 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
}
if (buildForChange) {
- launchBuild(kind, config, monitor);
+ launchBuild(kind, config, args, monitor);
}
}
- private void launchBuild(int kind, ILaunchConfiguration config, IProgressMonitor monitor) throws CoreException {
+ private void launchBuild(int kind, ILaunchConfiguration config, Map args, IProgressMonitor monitor) throws CoreException {
monitor.subTask(NLS.bind(ExternalToolsModelMessages.ExternalToolBuilder_Running__0_____1, new String[] { config.getName()}));
- buildStarted(kind);
+ buildStarted(kind, args);
// The default value for "launch in background" is true in debug core. If
// the user doesn't go through the UI, the new attribute won't be set. This means
// that existing Ant builders will try to run in the background (and likely conflict with
// each other) without migration.
- config= ExternalToolMigration.migrateRunInBackground(config);
- config.launch(ILaunchManager.RUN_MODE, monitor);
+ ILaunchConfiguration newconfig= ExternalToolMigration.migrateRunInBackground(config);
+ newconfig.launch(ILaunchManager.RUN_MODE, monitor);
buildEnded();
}
@@ -215,15 +215,22 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
/**
* Stores the currently active build kind and build project when a build begins
* @param buildKind
+ * @param args the arguments passed into the builder
*/
- private void buildStarted(int buildKind) {
+ private void buildStarted(int buildKind, Map args) {
switch (buildKind) {
case IncrementalProjectBuilder.INCREMENTAL_BUILD :
buildType = IExternalToolConstants.BUILD_TYPE_INCREMENTAL;
buildDelta = getDelta(getProject());
break;
case IncrementalProjectBuilder.FULL_BUILD :
- buildType = IExternalToolConstants.BUILD_TYPE_FULL;
+ if(args != null && args.containsKey(BuilderCoreUtils.INC_CLEAN)) {
+ buildType = IExternalToolConstants.BUILD_TYPE_INCREMENTAL;
+ buildDelta = getDelta(getProject());
+ }
+ else {
+ buildType = IExternalToolConstants.BUILD_TYPE_FULL;
+ }
break;
case IncrementalProjectBuilder.AUTO_BUILD :
buildType = IExternalToolConstants.BUILD_TYPE_AUTO;
@@ -285,6 +292,6 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
return;
}
- launchBuild(IncrementalProjectBuilder.CLEAN_BUILD, config, monitor);
+ launchBuild(IncrementalProjectBuilder.CLEAN_BUILD, config, null, monitor);
}
} \ No newline at end of file

Back to the top