Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Schaefer2007-02-22 05:22:55 +0000
committerDoug Schaefer2007-02-22 05:22:55 +0000
commit5a07244d6d9a979df44c34c84a0ecf8e1c2465ad (patch)
treef1a10396a682b144109be8aa8f9eadca466f1627 /build/org.eclipse.cdt.managedbuilder.gnu.ui/src
parentc60e1cf2ade0961a14728fb16405b9c604a0b2ee (diff)
downloadorg.eclipse.cdt-5a07244d6d9a979df44c34c84a0ecf8e1c2465ad.tar.gz
org.eclipse.cdt-5a07244d6d9a979df44c34c84a0ecf8e1c2465ad.tar.xz
org.eclipse.cdt-5a07244d6d9a979df44c34c84a0ecf8e1c2465ad.zip
Migrated the MinGW integration into the managedbuilder.gnu plugin. Also fixed up some of the strings in the UI.
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.gnu.ui/src')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/mingw/MingwEnvironmentVariableSupplier.java86
1 files changed, 86 insertions, 0 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/mingw/MingwEnvironmentVariableSupplier.java b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/mingw/MingwEnvironmentVariableSupplier.java
new file mode 100644
index 00000000000..ce0cd9ff9e8
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/mingw/MingwEnvironmentVariableSupplier.java
@@ -0,0 +1,86 @@
+/**********************************************************************
+ * Copyright (c) 2006 QNX Software Systems 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:
+ * QNX Software Systems - Initial API and implementation
+ **********************************************************************/
+
+package org.eclipse.cdt.managedbuilder.gnu.mingw;
+
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.envvar.IBuildEnvironmentVariable;
+import org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSupplier;
+import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider;
+import org.eclipse.cdt.utils.WindowsRegistry;
+import org.eclipse.core.runtime.Platform;
+
+/**
+ * @author Doug Schaefer
+ *
+ */
+public class MingwEnvironmentVariableSupplier implements
+ IConfigurationEnvironmentVariableSupplier {
+
+ private static class MingwBuildEnvironmentVariable implements IBuildEnvironmentVariable {
+ private final String name;
+ private final String value;
+ private final int operation;
+
+ public MingwBuildEnvironmentVariable(String name, String value, int operation) {
+ this.name = name;
+ this.value = value;
+ this.operation = operation;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public int getOperation() {
+ return operation;
+ }
+
+ public String getDelimiter() {
+ return ";";
+ }
+ }
+
+ private final IBuildEnvironmentVariable path;
+
+ public MingwEnvironmentVariableSupplier() {
+ String bin = "C:/MinGW/bin";
+
+ // TODO try finding MinGW in either of:
+ // HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MinGW, InstallLocation
+ // or using:
+ // String bin = Platform.getInstallLocation().getURL().getFile().substring(1)
+ // + "mingw/bin";
+
+ path = new MingwBuildEnvironmentVariable(
+ "PATH",
+ bin,
+ IBuildEnvironmentVariable.ENVVAR_PREPEND);
+ }
+
+ public IBuildEnvironmentVariable getVariable(String variableName,
+ IConfiguration configuration, IEnvironmentVariableProvider provider) {
+ if (variableName.equals(path.getName()))
+ return path;
+ else
+ return null;
+ }
+
+ public IBuildEnvironmentVariable[] getVariables(
+ IConfiguration configuration, IEnvironmentVariableProvider provider) {
+ return new IBuildEnvironmentVariable[] { path };
+ }
+
+}

Back to the top