Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 209568 Details for
Bug 352131
[patch] Ant builder not called after a clean
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch in consideration
patch.txt (text/plain), 11.53 KB, created by
Satyam Kandula
on 2012-01-16 12:26:18 EST
(
hide
)
Description:
Patch in consideration
Filename:
MIME Type:
Creator:
Satyam Kandula
Created:
2012-01-16 12:26:18 EST
Size:
11.53 KB
patch
obsolete
>diff --git a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/IExternalToolConstants.java b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/IExternalToolConstants.java >index b276e21..6ee30fd 100644 >--- a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/IExternalToolConstants.java >+++ b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/IExternalToolConstants.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2011 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 >@@ -136,6 +136,21 @@ > public static final String ATTR_LOCATION = UI_PLUGIN_ID + ".ATTR_LOCATION"; //$NON-NLS-1$ > > /** >+ * String attribute identifying the version of the launch configuration. >+ * This can be used for migration >+ * >+ * @since 3.8 >+ */ >+ public static final String ATTR_VERSION = UI_PLUGIN_ID + ".ATTR_VERSION"; //$NON-NLS-1$ >+ >+ /** >+ * Current version of the launcher configuration >+ * >+ * @since 3.8 >+ */ >+ public static final int VERSION = 1; >+ >+ /** > * Boolean attribute indicating if the user should be prompted for > * arguments before running a tool. Default value is <code>false</code>. > * THIS ATTRIBUTE IS NOT USED. >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 d8e7d75..6e050f9 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, 2011 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 >@@ -45,6 +45,13 @@ > * @since 3.7 > */ > public static final String INC_CLEAN = "incclean"; //$NON-NLS-1$ >+ >+ /** >+ * Constant added to the build command to determine if the trigger for auto build is really requested >+ * >+ * @since 3.8 >+ */ >+ public static final String NOT_REAL_AUTO = "notrealauto";//$NON-NLS-1$ > > /** > * Constant used to find a builder using the 3.0-interim format >@@ -116,6 +123,9 @@ > } > } > } >+ if (configuration != null) { >+ configuration = ExternalToolMigration.migrateIfRequired(configuration); >+ } > return configuration; > } > >@@ -126,7 +136,7 @@ > newCommand.setBuilding(IncrementalProjectBuilder.CLEAN_BUILD, false); > String buildKinds = config.getAttribute(IExternalToolConstants.ATTR_RUN_BUILD_KINDS, (String) null); > int[] triggers = buildTypesToArray(buildKinds); >- boolean isfull = false, isinc = false; >+ boolean isfull = false, isinc = false, isauto = false; > for (int i = 0; i < triggers.length; i++) { > switch (triggers[i]) { > case IncrementalProjectBuilder.FULL_BUILD: >@@ -139,11 +149,23 @@ > break; > case IncrementalProjectBuilder.AUTO_BUILD: > newCommand.setBuilding(IncrementalProjectBuilder.AUTO_BUILD, true); >+ isauto = true; > break; > case IncrementalProjectBuilder.CLEAN_BUILD: > newCommand.setBuilding(IncrementalProjectBuilder.CLEAN_BUILD, true); > break; > } >+ } >+ if ((isfull || isinc) && !isauto) { >+ // if build automatically is turned on, AUTO_BUILD targets will be triggered >+ // for normal builds too. Hence, get a trigger for AUTO_BUILD too. >+ Map args = newCommand.getArguments(); >+ if(args == null) { >+ args = new HashMap(); >+ } >+ newCommand.setBuilding(IncrementalProjectBuilder.AUTO_BUILD, true); >+ args.put(NOT_REAL_AUTO, Boolean.TRUE.toString()); >+ newCommand.setArguments(args); > } > if(!isfull && isinc) { > Map args = newCommand.getArguments(); >@@ -157,6 +179,7 @@ > if (!config.getAttribute(IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED, false)) { > ILaunchConfigurationWorkingCopy copy = config.getWorkingCopy(); > copy.setAttribute(IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED, true); >+ copy.setAttribute(IExternalToolConstants.ATTR_VERSION, IExternalToolConstants.VERSION); > 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 dd809de..1efca3a 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, 2011 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 >@@ -70,7 +70,9 @@ > if (ExternalToolsCore.getDefault().getBundle().getState() != Bundle.ACTIVE) { > return null; > } >- >+ if (kind == IncrementalProjectBuilder.AUTO_BUILD && args.get(BuilderCoreUtils.NOT_REAL_AUTO) != null) { >+ return null; >+ } > ILaunchConfiguration config= BuilderCoreUtils.configFromBuildCommandArgs(getProject(), args, new String[1]); > if (config == null) { > throw ExternalToolsCore.newError(ExternalToolsModelMessages.ExternalToolBuilder_0, null); >@@ -281,15 +283,20 @@ > > protected void clean(IProgressMonitor monitor) throws CoreException { > ICommand command= getCommand(); >- ILaunchConfiguration config= BuilderCoreUtils.configFromBuildCommandArgs(getProject(), command.getArguments(), new String[1]); >+ String[] version = new String[1]; >+ ILaunchConfiguration config= BuilderCoreUtils.configFromBuildCommandArgs(getProject(), command.getArguments(), version); > if (!configEnabled(config)) { > return; > } > > if ((!config.getAttribute(IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED, false))) { >- //old behavior >- super.clean(monitor); >- return; >+ if (version.equals(BuilderCoreUtils.VERSION_3_0_final)) { >+ commandConfiguredForKind(config, IncrementalProjectBuilder.CLEAN_BUILD); >+ } else { >+ //old behavior >+ super.clean(monitor); >+ return; >+ } > } > > launchBuild(IncrementalProjectBuilder.CLEAN_BUILD, config, null, monitor); >diff --git a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/registry/ExternalToolMigration.java b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/registry/ExternalToolMigration.java >index a06bc87..e95cce9 100644 >--- a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/registry/ExternalToolMigration.java >+++ b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/registry/ExternalToolMigration.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 >@@ -17,6 +17,8 @@ > > import org.eclipse.core.externaltools.internal.ExternalToolsCore; > import org.eclipse.core.externaltools.internal.IExternalToolConstants; >+import org.eclipse.core.externaltools.internal.model.BuilderCoreUtils; >+import org.eclipse.core.resources.IncrementalProjectBuilder; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.debug.core.DebugPlugin; > import org.eclipse.debug.core.ILaunchConfiguration; >@@ -406,5 +408,52 @@ > } > > return varDef; >- } >+ } >+ >+ public static ILaunchConfiguration migrateIfRequired(ILaunchConfiguration configuration) { >+ try { >+ int version = configuration.getAttribute(IExternalToolConstants.ATTR_VERSION, 0); >+ if (version < IExternalToolConstants.VERSION) { >+ // migration may be required >+ String buildKinds = configuration.getAttribute(IExternalToolConstants.ATTR_RUN_BUILD_KINDS, (String) null); >+ if (buildKinds != null) { >+ int[] triggers = BuilderCoreUtils.buildTypesToArray(buildKinds); >+ boolean auto = false; >+ boolean fullOrIncr = false; >+ for (int i = 0; i < triggers.length; i++) { >+ switch (triggers[i]) { >+ case IncrementalProjectBuilder.FULL_BUILD: >+ case IncrementalProjectBuilder.INCREMENTAL_BUILD: >+ fullOrIncr = true; >+ break; >+ case IncrementalProjectBuilder.AUTO_BUILD: >+ auto = true; >+ break; >+ } >+ } >+ if (!auto && fullOrIncr) { >+ return updateConfiguration(configuration, /* configure = */true); >+ } >+ } >+ return updateConfiguration(configuration, /* configure = */false); >+ } >+ } catch (CoreException e) { >+ return configuration; >+ } >+ return configuration; >+ } >+ >+ private static ILaunchConfiguration updateConfiguration(ILaunchConfiguration configuration, boolean configure) { >+ try { >+ ILaunchConfigurationWorkingCopy workingCopy = configuration.getWorkingCopy(); >+ workingCopy.setAttribute(IExternalToolConstants.ATTR_VERSION, IExternalToolConstants.VERSION); >+ if (configure) { >+ workingCopy.setAttribute(IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED, false); >+ } >+ return workingCopy.doSave(); >+ } catch (CoreException e) { >+ ExternalToolsCore.log(ExternalToolsMigrationMessages.ExternalToolMigration_38, e); >+ } >+ return configuration; >+ } > } >diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuilderTab.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuilderTab.java >index cc6aea4..74e93bf 100644 >--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuilderTab.java >+++ b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuilderTab.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2011 IBM Corporation and others. >+ * Copyright (c) 2000, 2012 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 >@@ -308,6 +308,7 @@ > configuration.setAttribute(IExternalToolConstants.ATTR_RUN_BUILD_KINDS, buffer.toString()); > configuration.setAttribute(IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND, false); > configuration.setAttribute(IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED, true); >+ configuration.setAttribute(IExternalToolConstants.ATTR_VERSION, IExternalToolConstants.VERSION); > } > > /* (non-Javadoc)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 352131
:
199681
|
209428
| 209568