Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Swanson2003-05-06 17:52:12 -0400
committerDarin Swanson2003-05-06 17:52:12 -0400
commit6e932578291928683f2d4126547852999d930bae (patch)
treebeef60ce5231fc8f0c4ea65bbc19793280d4f48f /org.eclipse.ui.externaltools
parentea167eafe8b41e2b086a9834cb2391e14509e946 (diff)
downloadeclipse.platform.debug-6e932578291928683f2d4126547852999d930bae.tar.gz
eclipse.platform.debug-6e932578291928683f2d4126547852999d930bae.tar.xz
eclipse.platform.debug-6e932578291928683f2d4126547852999d930bae.zip
Bug 25337 - External Builder Configuration
Diffstat (limited to 'org.eclipse.ui.externaltools')
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuilderTab.java6
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsUtil.java28
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolBuilder.java2
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolConstants.java8
-rw-r--r--org.eclipse.ui.externaltools/plugin.xml6
5 files changed, 43 insertions, 7 deletions
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 dbcae9a19..65569f8b9 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
@@ -125,7 +125,7 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab impl
String buildScope= null;
try {
buildKindString= configuration.getAttribute(IExternalToolConstants.ATTR_RUN_BUILD_KINDS, ""); //$NON-NLS-1$
- buildScope= configuration.getAttribute(IExternalToolConstants.ATTR_REFRESH_SCOPE, (String)null);
+ buildScope= configuration.getAttribute(IExternalToolConstants.ATTR_BUILD_SCOPE, (String)null);
} catch (CoreException e) {
}
@@ -174,9 +174,9 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab impl
if (workingSetButton.getSelection()) {
String variableTag= VariableUtil.buildVariableTag("working_set", workingSetComponent.getVariableValue()); //$NON-NLS-1$
- configuration.setAttribute(IExternalToolConstants.ATTR_REFRESH_SCOPE, variableTag);
+ configuration.setAttribute(IExternalToolConstants.ATTR_BUILD_SCOPE, variableTag);
} else {
- configuration.setAttribute(IExternalToolConstants.ATTR_REFRESH_SCOPE, (String)null);
+ configuration.setAttribute(IExternalToolConstants.ATTR_BUILD_SCOPE, (String)null);
}
}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsUtil.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsUtil.java
index d9128e0f3..77012af7c 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsUtil.java
+++ b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsUtil.java
@@ -258,7 +258,7 @@ public class ExternalToolsUtil {
* @throws CoreException if an exception occurrs while refreshing resources
*/
public static void refreshResources(ILaunchConfiguration configuration, ExpandVariableContext context, IProgressMonitor monitor) throws CoreException {
- IResource[] resources= getResourcesForScope(configuration, context, monitor);
+ IResource[] resources= getResourcesForRefreshScope(configuration, context, monitor);
if (resources == null || resources.length == 0){
return;
}
@@ -294,19 +294,41 @@ public class ExternalToolsUtil {
}
/**
- * Returns the collection of resources as specified by the given launch configuration.
+ * Returns the collection of resources for the refresh scope as specified by the given launch configuration.
*
* @param configuration launch configuration
* @param context context used to expand variables
* @param monitor progress monitor
* @throws CoreException if an exception occurs while refreshing resources
*/
- public static IResource[] getResourcesForScope(ILaunchConfiguration configuration, ExpandVariableContext context, IProgressMonitor monitor) throws CoreException {
+ public static IResource[] getResourcesForRefreshScope(ILaunchConfiguration configuration, ExpandVariableContext context, IProgressMonitor monitor) throws CoreException {
String scope = getRefreshScope(configuration);
if (scope == null) {
return null;
}
+ return getResourcesForScope(configuration, context, monitor, scope);
+ }
+
+ /**
+ * Returns the collection of resources for the build scope as specified by the given launch configuration.
+ *
+ * @param configuration launch configuration
+ * @param context context used to expand variables
+ * @param monitor progress monitor
+ * @throws CoreException if an exception occurs while refreshing resources
+ */
+ public static IResource[] getResourcesForBuildScope(ILaunchConfiguration configuration, ExpandVariableContext context, IProgressMonitor monitor) throws CoreException {
+ String scope = configuration.getAttribute(IExternalToolConstants.ATTR_BUILD_SCOPE, (String) null);
+ if (scope == null) {
+ return null;
+ }
+
+ return getResourcesForScope(configuration, context, monitor, scope);
+
+ }
+
+ private static IResource[] getResourcesForScope(ILaunchConfiguration configuration, ExpandVariableContext context, IProgressMonitor monitor, String scope) throws CoreException {
VariableUtil.VariableDefinition varDef = VariableUtil.extractVariableTag(scope, 0);
if (varDef.start == -1 || varDef.end == -1 || varDef.name == null) {
String msg = MessageFormat.format(ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsUtil.invalidRefreshVarFormat"), new Object[] { configuration.getName()}); //$NON-NLS-1$
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolBuilder.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolBuilder.java
index dd93e172b..45f6e0868 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolBuilder.java
+++ b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolBuilder.java
@@ -64,7 +64,7 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
return null;
}
- IResource[] resources= ExternalToolsUtil.getResourcesForScope(config, ExternalToolsUtil.getVariableContext(), monitor);
+ IResource[] resources= ExternalToolsUtil.getResourcesForBuildScope(config, ExternalToolsUtil.getVariableContext(), monitor);
boolean buildForChange= true;
if (resources != null && resources.length > 0) {
buildForChange= buildScopeIndicatesBuild(resources);
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolConstants.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolConstants.java
index cd124994b..67a6a8d72 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolConstants.java
+++ b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolConstants.java
@@ -170,6 +170,14 @@ public interface IExternalToolConstants {
public static final String ATTR_REFRESH_SCOPE = PLUGIN_ID + ".ATTR_REFRESH_SCOPE"; //$NON-NLS-1$
/**
+ * String attribute identifying the scope of resources that should trigger an
+ * external tool to run. Default value is <code>null</code>
+ * indicating that the builder will be triggered for all changes.
+ */
+ public static final String ATTR_BUILD_SCOPE = PLUGIN_ID + ".ATTR_BUILD_SCOPE"; //$NON-NLS-1$
+
+
+ /**
* String attribute containing an array of build kinds for which an
* external tool builder should be run.
*/
diff --git a/org.eclipse.ui.externaltools/plugin.xml b/org.eclipse.ui.externaltools/plugin.xml
index c288138d5..4b1262faa 100644
--- a/org.eclipse.ui.externaltools/plugin.xml
+++ b/org.eclipse.ui.externaltools/plugin.xml
@@ -234,6 +234,12 @@
<launchConfigurationComparator
id = "org.eclipse.ui.externaltools.workingSetComparator"
class = "org.eclipse.ui.externaltools.internal.launchConfigurations.WorkingSetComparator"
+ attribute = "org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE"/>
+ </extension>
+ <extension point = "org.eclipse.debug.core.launchConfigurationComparators">
+ <launchConfigurationComparator
+ id = "org.eclipse.ui.externaltools.workingSetComparator"
+ class = "org.eclipse.ui.externaltools.internal.launchConfigurations.WorkingSetComparator"
attribute = "org.eclipse.ui.externaltools.ATTR_REFRESH_SCOPE"/>
</extension>
</plugin>

Back to the top