Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Recoskie2008-01-25 14:43:02 -0500
committerChris Recoskie2008-01-25 14:43:02 -0500
commit97415bc7e15d76fa1fcf0b82d0ccbeba9b541eae (patch)
tree2162de302601562316bda12d8829bdd7fee269c0
parentacfec1ee8214f11e0b1767189be5d80f8661d7ba (diff)
downloadorg.eclipse.cdt-97415bc7e15d76fa1fcf0b82d0ccbeba9b541eae.tar.gz
org.eclipse.cdt-97415bc7e15d76fa1fcf0b82d0ccbeba9b541eae.tar.xz
org.eclipse.cdt-97415bc7e15d76fa1fcf0b82d0ccbeba9b541eae.zip
adding variable resolver so that compiler root location is resolved for scanner config in standard make projects
-rw-r--r--xlc/org.eclipse.cdt.managedbuilder.xlc.core/META-INF/MANIFEST.MF3
-rw-r--r--xlc/org.eclipse.cdt.managedbuilder.xlc.ui/plugin.properties2
-rw-r--r--xlc/org.eclipse.cdt.managedbuilder.xlc.ui/plugin.xml9
-rw-r--r--xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/variables/DynamicVariableResolver.java35
4 files changed, 47 insertions, 2 deletions
diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.core/META-INF/MANIFEST.MF b/xlc/org.eclipse.cdt.managedbuilder.xlc.core/META-INF/MANIFEST.MF
index 071a974c7c..0496514a26 100644
--- a/xlc/org.eclipse.cdt.managedbuilder.xlc.core/META-INF/MANIFEST.MF
+++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.core/META-INF/MANIFEST.MF
@@ -11,7 +11,6 @@ Require-Bundle: org.eclipse.cdt.managedbuilder.core,
org.eclipse.cdt.core,
org.eclipse.cdt.make.xlc.core,
org.eclipse.cdt.make.core,
- org.eclipse.ui,
- org.eclipse.core.variables
+ org.eclipse.ui
Eclipse-LazyStart: true
Bundle-Activator: org.eclipse.cdt.managedbuilder.xlc.core.XLCCorePlugin
diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/plugin.properties b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/plugin.properties
index 09ad04e0ea..ccd22ca5f1 100644
--- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/plugin.properties
+++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/plugin.properties
@@ -11,6 +11,8 @@
pluginName = XL C/C++ Managed Build UI Plugin
providerName = Eclipse.org
+variableName = XL C/C++ Compiler Root Location
+
#Build model names
TargetName.xlc.exe=Executable (XL C/C++)
TargetName.xlc.so=Shared Library (XL C/C++)
diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/plugin.xml b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/plugin.xml
index c5aeed4d6a..c6512f7534 100644
--- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/plugin.xml
+++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/plugin.xml
@@ -3161,6 +3161,15 @@
</projectType>
</wizardPage>
</extension>
+ <extension
+ point="org.eclipse.core.variables.dynamicVariables">
+ <variable
+ description="%variableDescription"
+ name="XL_compiler_root"
+ resolver="org.eclipse.cdt.managedbuilder.xlc.ui.variables.DynamicVariableResolver"
+ supportsArgument="false">
+ </variable>
+ </extension>
</plugin>
diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/variables/DynamicVariableResolver.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/variables/DynamicVariableResolver.java
new file mode 100644
index 0000000000..4522d1ab62
--- /dev/null
+++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/variables/DynamicVariableResolver.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.managedbuilder.xlc.ui.variables;
+
+import org.eclipse.cdt.managedbuilder.xlc.ui.XLCUIPlugin;
+import org.eclipse.cdt.managedbuilder.xlc.ui.preferences.PreferenceConstants;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.variables.IDynamicVariable;
+import org.eclipse.core.variables.IDynamicVariableResolver;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+/**
+ * @author crecoskie
+ *
+ */
+public class DynamicVariableResolver implements IDynamicVariableResolver {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.variables.IDynamicVariableResolver#resolveValue(org.eclipse.core.variables.IDynamicVariable, java.lang.String)
+ */
+ public String resolveValue(IDynamicVariable variable, String argument)
+ throws CoreException {
+ IPreferenceStore prefStore = XLCUIPlugin.getDefault().getPreferenceStore();
+ return prefStore.getString(PreferenceConstants.P_XL_COMPILER_ROOT);
+ }
+
+}

Back to the top