Skip to main content
summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorAndrew Gvozdev2012-07-08 16:06:19 -0400
committerAndrew Gvozdev2012-07-09 11:15:13 -0400
commitd1bb13b08c088171368f968a698c0288ada5fc23 (patch)
treeaabf96f7cd0dd2be467f7b30437b70dfb68c6c56 /build
parentb4f9e7052eb03bfa84742d9ac547d064bf7c259c (diff)
downloadorg.eclipse.cdt-d1bb13b08c088171368f968a698c0288ada5fc23.tar.gz
org.eclipse.cdt-d1bb13b08c088171368f968a698c0288ada5fc23.tar.xz
org.eclipse.cdt-d1bb13b08c088171368f968a698c0288ada5fc23.zip
Cosmetics - JavaDoc and code formatting
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentVariableProvider.java90
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/EnvironmentVariableProvider.java187
-rw-r--r--build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java23
-rw-r--r--build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/GnuCygwinConfigurationEnvironmentSupplier.java47
-rw-r--r--build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/IsGnuCygwinToolChainSupported.java13
-rw-r--r--build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/mingw/MingwEnvironmentVariableSupplier.java4
6 files changed, 161 insertions, 203 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentVariableProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentVariableProvider.java
index d2149f8fd6..4e84a94fdf 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentVariableProvider.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentVariableProvider.java
@@ -14,28 +14,25 @@ import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
/**
- *
* this interface represent the environment variable provider - the main entry-point
* to be used for querying the build environment
- *
+ *
* @since 3.0
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
-public interface IEnvironmentVariableProvider{
-
+public interface IEnvironmentVariableProvider {
/**
- *
- *
- * @return the reference to the IBuildEnvironmentVariable interface representing
+ * @return the reference to the IBuildEnvironmentVariable interface representing
* the variable of a given name
+ *
* @param variableName environment variable name
- * if environment variable names are case insensitive in the current OS,
+ * if environment variable names are case insensitive in the current OS,
* the environment variable provider will query the getVariable method of suppliers always
* passing it the uppercase variable name not depending on the case of the variableName
- * passed to the IEnvironmentVariableProvider.getVariable() method. This will prevent the
+ * passed to the IEnvironmentVariableProvider.getVariable() method. This will prevent the
* supplier from answering different values for the same variable given the names that differ
- * only by case. E.g. if the current OS does not support case sensitive variables both of the
+ * only by case. E.g. if the current OS does not support case sensitive variables both of the
* calls below:
*
* provider.getVariable("FOO",level,includeParentContexts);
@@ -48,42 +45,60 @@ public interface IEnvironmentVariableProvider{
* 2. IManagedProject to represent the managed project
* 3. IWorkspace to represent the workspace
* 4. null to represent the system environment passed to eclipse
+ *
* @deprecated use {@link IEnvironmentVariableProvider#getVariable(String, IConfiguration, boolean)} instead
*/
@Deprecated
- public IBuildEnvironmentVariable getVariable(
- String variableName, Object level, boolean includeParentLevels, boolean resolveMacros);
-
- public IEnvironmentVariable getVariable(String variableName,
- IConfiguration cfg, boolean resolveMacros);
+ public IBuildEnvironmentVariable getVariable(String variableName, Object level, boolean includeParentLevels, boolean resolveMacros);
/**
+ * Get variable for the given configuration, normally including those defined in project properties
+ * and workspace preferences.
*
- * if environment variable names are case insensitive in the current OS,
+ * See also {@code CCorePlugin.getDefault().getBuildEnvironmentManager().getVariable(String name, ICConfigurationDescription cfg, boolean resolveMacros)}
+ *
+ * @param variableName - name of the variable (not including $ sign).
+ * @param cfg - configuration or {@code null} for workspace preferences only.
+ * @param resolveMacros - if {@code true} expand macros, {@code false} otherwise.
+ * @return variable defined for the configuration or the workspace.
+ * Returns {@code null} if variable is not defined.
+ */
+ public IEnvironmentVariable getVariable(String variableName, IConfiguration cfg, boolean resolveMacros);
+
+ /**
+ * if environment variable names are case insensitive in the current OS,
* the environment variable provider will remove the duplicates of the variables if their names
* differ only by case
* @deprecated use {@link IEnvironmentVariableProvider#getVariables(IConfiguration, boolean)} instead
*
- * @return the array of IBuildEnvironmentVariable that represents the environment variables
+ * @return the array of IBuildEnvironmentVariable that represents the environment variables
*/
@Deprecated
- public IBuildEnvironmentVariable[] getVariables(
- Object level, boolean includeParentLevels, boolean resolveMacros);
-
- public IEnvironmentVariable[] getVariables(
- IConfiguration cfg, boolean resolveMacros);
+ public IBuildEnvironmentVariable[] getVariables(Object level, boolean includeParentLevels, boolean resolveMacros);
/**
+ * Get variables for the given configuration, normally including those defined in project properties
+ * and workspace preferences.
*
+ * See also {@code CCorePlugin.getDefault().getBuildEnvironmentManager().getVariables(ICConfigurationDescription cfg, boolean resolveMacros)}
+ *
+ * @param cfg - configuration or {@code null} for workspace preferences only.
+ * @param resolveMacros - if {@code true} expand macros, {@code false} otherwise.
+ * @return array of variables defined for the configuration or the workspace.
+ * Returns an empty array if no variables are defined.
+ */
+ public IEnvironmentVariable[] getVariables(IConfiguration cfg, boolean resolveMacros);
+
+ /**
* @return the String representing default system delimiter. That is the ":" for Unix-like
- * systems and the ";" for Win32 systems. This method will be used by the
- * tool-integrator provided variable supplier e.g. in order to concatenate the list of paths into the
+ * systems and the ";" for Win32 systems. This method will be used by the
+ * tool-integrator provided variable supplier e.g. in order to concatenate the list of paths into the
* environment variable, etc.
*/
public String getDefaultDelimiter();
/**
- * @return true if the OS supports case sensitive variables (Unix-like systems) or false
+ * @return true if the OS supports case sensitive variables (Unix-like systems) or false
* if it does not (Win32 systems)
*/
public boolean isVariableCaseSensitive();
@@ -97,29 +112,26 @@ public interface IEnvironmentVariableProvider{
/**
- * returns the array of String that holds the build paths of the specified type
+ * @return the array of String that holds the build paths of the specified type
+ *
* @param configuration represent the configuration for which the paths were changed
- * @param buildPathType can be set to one of the IEnvVarBuildPath.BUILDPATH _xxx
- * (the IEnvVarBuildPath will represent the build environment variables, see also
+ * @param buildPathType can be set to one of the IEnvVarBuildPath.BUILDPATH _xxx
+ * (the IEnvVarBuildPath will represent the build environment variables, see also
* the "Specifying the Includes and Library paths environment variables",
* the "envVarBuildPath schema" and the "Expected CDT/MBS code changes" sections)
*/
String[] getBuildPaths(IConfiguration configuration, int buildPathType);
/**
- *
- * adds the listener that will return notifications about the include and library paths changes.
+ * adds the listener that will return notifications about the include and library paths changes.
* The ManagedBuildManager will register the change listener and will notify all registered
- * Scanned Info Change Listeners about the include paths change.
- */
- void subscribe(
- IEnvironmentBuildPathsChangeListener listener);
+ * Scanned Info Change Listeners about the include paths change.
+ */
+ void subscribe(IEnvironmentBuildPathsChangeListener listener);
/**
- *
- * removes the include and library paths change listener
- */
- void unsubscribe(
- IEnvironmentBuildPathsChangeListener listener);
+ * removes the include and library paths change listener
+ */
+ void unsubscribe(IEnvironmentBuildPathsChangeListener listener);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/EnvironmentVariableProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/EnvironmentVariableProvider.java
index a77661eecc..a00a8fd432 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/EnvironmentVariableProvider.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/EnvironmentVariableProvider.java
@@ -35,10 +35,8 @@ import org.eclipse.cdt.utils.envvar.EnvVarOperationProcessor;
* build environment functionality to the MBS
*
* @since 3.0
- *
*/
-public class EnvironmentVariableProvider implements
- IEnvironmentVariableProvider {
+public class EnvironmentVariableProvider implements IEnvironmentVariableProvider {
// private static final QualifiedName fBuildPathVarProperty = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), "buildPathVar"); //$NON-NLS-1$
// private static final String DELIMITER_WIN32 = ";"; //$NON-NLS-1$
@@ -58,20 +56,17 @@ public class EnvironmentVariableProvider implements
* paths from environment variable values
*
* @since 3.0
- *
*/
static public class DefaultBuildPathResolver implements IBuildPathResolver {
private String fDelimiter;
- public DefaultBuildPathResolver(String delimiter){
+ public DefaultBuildPathResolver(String delimiter) {
fDelimiter = delimiter;
}
@Override
- public String[] resolveBuildPaths(int pathType, String variableName,
- String variableValue, IConfiguration configuration) {
-
- if(fDelimiter == null || "".equals(fDelimiter)) //$NON-NLS-1$
+ public String[] resolveBuildPaths(int pathType, String variableName, String variableValue, IConfiguration configuration) {
+ if (fDelimiter == null || "".equals(fDelimiter)) //$NON-NLS-1$
return new String[]{variableValue};
List<String> list = EnvVarOperationProcessor.convertToList(variableValue,fDelimiter);
@@ -80,46 +75,39 @@ public class EnvironmentVariableProvider implements
}
- protected EnvironmentVariableProvider(IEnvironmentVariableManager mngr){
+ protected EnvironmentVariableProvider(IEnvironmentVariableManager mngr) {
fMngr = mngr;
}
- public static EnvironmentVariableProvider getDefault(){
- if(fInstance == null){
+ public static EnvironmentVariableProvider getDefault() {
+ if (fInstance == null) {
fInstance = new EnvironmentVariableProvider(CCorePlugin.getDefault().getBuildEnvironmentManager());
fInstance.fBuildPathVarCheckAllowed = true;
}
return fInstance;
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider#getVariable()
- */
@Override
- public IBuildEnvironmentVariable getVariable(String variableName,
- Object level, boolean includeParentLevels, boolean resolveMacros) {
-
- if(variableName == null || "".equals(variableName)) //$NON-NLS-1$
+ public IBuildEnvironmentVariable getVariable(String variableName, Object level, boolean includeParentLevels, boolean resolveMacros) {
+ if (variableName == null || "".equals(variableName)) //$NON-NLS-1$
return null;
- if(level instanceof IConfiguration){
+ if (level instanceof IConfiguration) {
return wrap(getVariable(variableName, (IConfiguration)level, resolveMacros));
}
return null;
}
@Override
- public IEnvironmentVariable getVariable(String variableName,
- IConfiguration cfg, boolean resolveMacros){
+ public IEnvironmentVariable getVariable(String variableName, IConfiguration cfg, boolean resolveMacros) {
return getVariable(variableName, cfg, resolveMacros, true);
}
- public IEnvironmentVariable getVariable(String variableName,
- IConfiguration cfg, boolean resolveMacros, boolean checkBuildPaths){
+ public IEnvironmentVariable getVariable(String variableName, IConfiguration cfg, boolean resolveMacros, boolean checkBuildPaths) {
ICConfigurationDescription des = ManagedBuildManager.getDescriptionForConfiguration(cfg);
- if(des != null){
+ if (des != null) {
IEnvironmentVariable variable = fMngr.getVariable(variableName, des, resolveMacros);
- if(checkBuildPaths && resolveMacros && fBuildPathVarCheckAllowed)
+ if (checkBuildPaths && resolveMacros && fBuildPathVarCheckAllowed)
checkBuildPathVariable(cfg, variableName, variable);
return variable;
}
@@ -127,130 +115,109 @@ public class EnvironmentVariableProvider implements
}
@Override
- public IEnvironmentVariable[] getVariables(IConfiguration cfg, boolean resolveMacros){
+ public IEnvironmentVariable[] getVariables(IConfiguration cfg, boolean resolveMacros) {
return getVariables(cfg, resolveMacros, true);
}
- public IEnvironmentVariable[] getVariables(IConfiguration cfg, boolean resolveMacros, boolean checkBuildPaths){
+ public IEnvironmentVariable[] getVariables(IConfiguration cfg, boolean resolveMacros, boolean checkBuildPaths) {
ICConfigurationDescription des = ManagedBuildManager.getDescriptionForConfiguration(cfg);
- if(des != null){
+ if (des != null) {
IEnvironmentVariable vars[] = fMngr.getVariables(des, resolveMacros);
- if(checkBuildPaths && resolveMacros && fBuildPathVarCheckAllowed)
+ if (checkBuildPaths && resolveMacros && fBuildPathVarCheckAllowed)
checkBuildPathVariables(cfg,vars);
return vars;
}
return new IBuildEnvironmentVariable[0];
}
- public static IBuildEnvironmentVariable wrap(IEnvironmentVariable var){
- if(var == null)
+ public static IBuildEnvironmentVariable wrap(IEnvironmentVariable var) {
+ if (var == null)
return null;
- if(var instanceof IBuildEnvironmentVariable)
+ if (var instanceof IBuildEnvironmentVariable)
return (IBuildEnvironmentVariable)var;
return new BuildEnvVar(var);
}
- public static IBuildEnvironmentVariable[] wrap(IEnvironmentVariable vars[]){
- if(vars == null)
+ public static IBuildEnvironmentVariable[] wrap(IEnvironmentVariable vars[]) {
+ if (vars == null)
return null;
- if(vars instanceof IBuildEnvironmentVariable[])
+ if (vars instanceof IBuildEnvironmentVariable[])
return (IBuildEnvironmentVariable[])vars;
IBuildEnvironmentVariable[] buildVars = new IBuildEnvironmentVariable[vars.length];
- for(int i = 0; i < vars.length; i++){
+ for(int i = 0; i < vars.length; i++) {
buildVars[i] = wrap(vars[i]);
}
return buildVars;
}
-/* protected ICConfigurationDescription getDescription(IConfiguration cfg){
+/* protected ICConfigurationDescription getDescription(IConfiguration cfg) {
IProject project = cfg.getOwner().getProject();
ICProjectDescription des = CoreModel.getDefault().getProjectDescription(project, false);
- if(des != null){
+ if (des != null) {
return des.getConfigurationById(cfg.getId());
}
return null;
}
*/
- /* (non-Javadoc)
- * @see org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider#getVariables()
- */
@Override
- public IBuildEnvironmentVariable[] getVariables(Object level,
- boolean includeParentLevels, boolean resolveMacros) {
-
- if(level instanceof IConfiguration){
+ public IBuildEnvironmentVariable[] getVariables(Object level, boolean includeParentLevels, boolean resolveMacros) {
+ if (level instanceof IConfiguration) {
return wrap(getVariables((IConfiguration)level, resolveMacros));
}
return new IBuildEnvironmentVariable[0];
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider#getDefaultDelimiter()
- */
@Override
public String getDefaultDelimiter() {
return fMngr.getDefaultDelimiter();
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider#isVariableCaseSensitive()
- */
@Override
public boolean isVariableCaseSensitive() {
return fMngr.isVariableCaseSensitive();
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider#getSuppliers()
- */
@Override
public IEnvironmentVariableSupplier[] getSuppliers(Object level) {
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider#getBuildPaths()
- */
@Override
- public String[] getBuildPaths(IConfiguration configuration,
- int buildPathType) {
+ public String[] getBuildPaths(IConfiguration configuration, int buildPathType) {
ITool tools[] = configuration.getFilteredTools();
List<String> list = new ArrayList<String>();
- for(int i = 0; i < tools.length; i++){
- IEnvVarBuildPath pathDescriptors[] = tools[i].getEnvVarBuildPaths();
+ for (ITool tool : tools) {
+ IEnvVarBuildPath pathDescriptors[] = tool.getEnvVarBuildPaths();
- if(pathDescriptors == null || pathDescriptors.length == 0)
+ if (pathDescriptors == null || pathDescriptors.length == 0)
continue;
- for(int j = 0; j < pathDescriptors.length; j++){
- IEnvVarBuildPath curPathDes = pathDescriptors[j];
- if(curPathDes.getType() != buildPathType)
+ for (IEnvVarBuildPath curPathDes : pathDescriptors) {
+ if (curPathDes.getType() != buildPathType)
continue;
String vars[] = curPathDes.getVariableNames();
- if(vars == null || vars.length == 0)
+ if (vars == null || vars.length == 0)
continue;
IBuildPathResolver pathResolver = curPathDes.getBuildPathResolver();
- if(pathResolver == null){
+ if (pathResolver == null) {
String delimiter = curPathDes.getPathDelimiter();
- if(delimiter == null)
+ if (delimiter == null)
delimiter = getDefaultDelimiter();
pathResolver = new DefaultBuildPathResolver(delimiter);
}
- for(int k = 0; k < vars.length; k++){
- String varName = vars[k];
-
+ for (String varName : vars) {
IEnvironmentVariable var = getVariable(varName,configuration,true, false);
- if(var == null)
+ if (var == null)
continue;
String varValue = var.getValue();
String paths[] = pathResolver.resolveBuildPaths(buildPathType,varName,varValue,configuration);
- if(paths != null && paths.length != 0)
+ if (paths != null && paths.length != 0)
list.addAll(Arrays.asList(paths));
}
}
@@ -259,45 +226,39 @@ public class EnvironmentVariableProvider implements
return list.toArray(new String[list.size()]);
}
- /*
- * returns a list of registered listeners
+ /**
+ * @return a list of registered listeners
*/
- private List<IEnvironmentBuildPathsChangeListener> getListeners(){
- if(fListeners == null)
+ private List<IEnvironmentBuildPathsChangeListener> getListeners() {
+ if (fListeners == null)
fListeners = new ArrayList<IEnvironmentBuildPathsChangeListener>();
return fListeners;
}
- /*
+ /**
* notifies registered listeners
*/
- private void notifyListeners(IConfiguration configuration, int buildPathType){
+ private void notifyListeners(IConfiguration configuration, int buildPathType) {
List<IEnvironmentBuildPathsChangeListener> listeners = getListeners();
for (IEnvironmentBuildPathsChangeListener listener : listeners) {
listener.buildPathsChanged(configuration,buildPathType);
}
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider#subscribe()
- */
@Override
public synchronized void subscribe(IEnvironmentBuildPathsChangeListener listener) {
- if(listener == null)
+ if (listener == null)
return;
List<IEnvironmentBuildPathsChangeListener> listeners = getListeners();
- if(!listeners.contains(listener))
+ if (!listeners.contains(listener))
listeners.add(listener);
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider#unsubscribe()
- */
@Override
public synchronized void unsubscribe(IEnvironmentBuildPathsChangeListener listener) {
- if(listener == null)
+ if (listener == null)
return;
List<IEnvironmentBuildPathsChangeListener> listeners = getListeners();
@@ -305,39 +266,39 @@ public class EnvironmentVariableProvider implements
listeners.remove(listener);
}
- /*
+ /**
* performs a check of the build path variables for the given configuration
* If the build variables are changed, the notification is sent
*/
- public void checkBuildPathVariables(IConfiguration configuration){
+ public void checkBuildPathVariables(IConfiguration configuration) {
checkBuildPathVariables(configuration, getVariables(configuration ,true, false));
}
- /*
+ /**
* performs a check of the build path variables of the specified type
* for the given configuration
* If the build variables are changed, the notification is sent
*/
- public void checkBuildPathVariables(IConfiguration configuration,int buildPathType){
+ public void checkBuildPathVariables(IConfiguration configuration,int buildPathType) {
EnvVarCollector cr = new EnvVarCollector();
cr.add(getVariables(configuration, true, false));
checkBuildPathVariables(configuration,buildPathType,cr);
}
- /*
+ /**
* performs a check of the build path variables
* for the given configuration given the set of the variables
* defined for this configuration
* If the build variables are changed, the notification is sent
*/
- protected void checkBuildPathVariables(IConfiguration configuration, IEnvironmentVariable vars[]){
+ protected void checkBuildPathVariables(IConfiguration configuration, IEnvironmentVariable vars[]) {
EnvVarCollector cr = new EnvVarCollector();
cr.add(vars);
checkBuildPathVariables(configuration,IEnvVarBuildPath.BUILDPATH_INCLUDE,cr);
checkBuildPathVariables(configuration,IEnvVarBuildPath.BUILDPATH_LIBRARY,cr);
}
- /*
+ /**
* performs a check of whether the given variable is the build path variable
* and if true checks whether it is changed.
* In the case of it is changed all other build path variables are checked
@@ -345,12 +306,12 @@ public class EnvironmentVariableProvider implements
* If it is not changed, other build path variables are not checked
* In the case of the given variable is not the build path one, this method does nothing
*/
- protected void checkBuildPathVariable(IConfiguration configuration, String varName, IEnvironmentVariable var){
+ protected void checkBuildPathVariable(IConfiguration configuration, String varName, IEnvironmentVariable var) {
checkBuildPathVariable(configuration, IEnvVarBuildPath.BUILDPATH_INCLUDE, varName, var);
checkBuildPathVariable(configuration, IEnvVarBuildPath.BUILDPATH_LIBRARY, varName, var);
}
- /*
+ /**
* performs a check of whether the given variable is the build path variable
* of the specified type and if true checks whether it is changed.
* In the case of it is changed all other build path variables of that type are checked
@@ -358,11 +319,11 @@ public class EnvironmentVariableProvider implements
* If it is not changed, other build path variables are not checked
* In the case of the given variable is not the build path one, this method does nothing
*/
- protected void checkBuildPathVariable(IConfiguration configuration, int buildPathType, String varName, IEnvironmentVariable var){
+ protected void checkBuildPathVariable(IConfiguration configuration, int buildPathType, String varName, IEnvironmentVariable var) {
StoredBuildPathEnvironmentContainer buildPathVars = getStoredBuildPathVariables(buildPathType);
- if(buildPathVars == null)
+ if (buildPathVars == null)
return;
- if(buildPathVars.isVariableChanged(varName,var,configuration)){
+ if (buildPathVars.isVariableChanged(varName,var,configuration)) {
EnvVarCollector cr = new EnvVarCollector();
cr.add(getVariables(configuration, true, false));
buildPathVars.synchronize(cr,configuration);
@@ -370,44 +331,44 @@ public class EnvironmentVariableProvider implements
}
}
- /*
+ /**
* performs a check of the build path variables of the specified type
* for the given configuration given the set of the variables
* defined for this configuration.
* If the build variables are changed, the notification is sent
*/
- protected void checkBuildPathVariables(IConfiguration configuration, int buildPathType, EnvVarCollector varSet){
+ protected void checkBuildPathVariables(IConfiguration configuration, int buildPathType, EnvVarCollector varSet) {
StoredBuildPathEnvironmentContainer buildPathVars = getStoredBuildPathVariables(buildPathType);
- if(buildPathVars == null)
+ if (buildPathVars == null)
return;
- if(buildPathVars.checkBuildPathChange(varSet,configuration)){
+ if (buildPathVars.checkBuildPathChange(varSet,configuration)) {
notifyListeners(configuration, buildPathType);
}
}
- /*
+ /**
* returns the container of the build variables of the specified type
*/
- protected StoredBuildPathEnvironmentContainer getStoredBuildPathVariables(int buildPathType){
+ protected StoredBuildPathEnvironmentContainer getStoredBuildPathVariables(int buildPathType) {
return buildPathType == IEnvVarBuildPath.BUILDPATH_LIBRARY ?
getStoredLibraryBuildPathVariables() :
getStoredIncludeBuildPathVariables();
}
- /*
+ /**
* returns the container of the Include path variables
*/
- protected StoredBuildPathEnvironmentContainer getStoredIncludeBuildPathVariables(){
- if(fIncludeStoredBuildPathVariables == null)
+ protected StoredBuildPathEnvironmentContainer getStoredIncludeBuildPathVariables() {
+ if (fIncludeStoredBuildPathVariables == null)
fIncludeStoredBuildPathVariables = new StoredBuildPathEnvironmentContainer(IEnvVarBuildPath.BUILDPATH_INCLUDE);
return fIncludeStoredBuildPathVariables;
}
- /*
+ /**
* returns the container of the Library path variables
*/
- protected StoredBuildPathEnvironmentContainer getStoredLibraryBuildPathVariables(){
- if(fLibraryStoredBuildPathVariables == null)
+ protected StoredBuildPathEnvironmentContainer getStoredLibraryBuildPathVariables() {
+ if (fLibraryStoredBuildPathVariables == null)
fLibraryStoredBuildPathVariables = new StoredBuildPathEnvironmentContainer(IEnvVarBuildPath.BUILDPATH_LIBRARY);
return fLibraryStoredBuildPathVariables;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java
index 9599f41fbb..4460a4d7c7 100644
--- a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java
+++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java
@@ -63,16 +63,13 @@ public class CygwinPathResolver implements IBuildPathResolver {
private static String rootCygwin = null;
private static String etcCygwin = null;
- /* (non-Javadoc)
- * @see org.eclipse.cdt.managedbuilder.core.IBuildPathResolver#resolveBuildPaths(int, java.lang.String, java.lang.String, org.eclipse.cdt.managedbuilder.core.IConfiguration)
- */
@Override
public String[] resolveBuildPaths(int pathType, String variableName,
String variableValue, IConfiguration configuration) {
- if(!isWindows()){
+ if(!isWindows()) {
return variableValue.split(DELIMITER_UNIX);
- } else if(isMinGW(configuration)){
+ } else if(isMinGW(configuration)) {
return variableValue.split(DELIMITER_WIN);
}
@@ -92,7 +89,8 @@ public class CygwinPathResolver implements IBuildPathResolver {
}
return result;
}
- /*
+
+ /**
* returns "/etc" path in Windows format
*/
public static String getEtcPath() {
@@ -100,17 +98,17 @@ public class CygwinPathResolver implements IBuildPathResolver {
return etcCygwin;
}
- /*
+ /**
* returns "/usr/bin" path in Windows format
*/
public static String getBinPath() {
if (!checked) findPaths();
return binCygwin;
}
- /*
+
+ /**
* returns Cygwin root ("/") path in Windows format
*/
-
public static String getRootPath() {
if (!checked) findPaths();
return rootCygwin;
@@ -140,6 +138,7 @@ public class CygwinPathResolver implements IBuildPathResolver {
}
return null;
}
+
/**
* Returns the absolute path of the pattern by
* simply appending the pattern to the root
@@ -233,7 +232,7 @@ public class CygwinPathResolver implements IBuildPathResolver {
try {
IEnvironmentVariable vars[] = ManagedBuildManager.getEnvironmentVariableProvider().getVariables(cfg,true);
String env[] = new String[vars.length];
- for(int i = 0; i < env.length; i++){
+ for(int i = 0; i < env.length; i++) {
env[i] = vars[i].getName() + "="; //$NON-NLS-1$
String value = vars[i].getValue();
if(value != null)
@@ -258,10 +257,10 @@ public class CygwinPathResolver implements IBuildPathResolver {
return null;
}
- public static boolean isMinGW(IConfiguration cfg){
+ public static boolean isMinGW(IConfiguration cfg) {
String versionInfo[] = exec(GCC_VERSION_CMD, cfg);
if(versionInfo != null) {
- for(int i = 0; i < versionInfo.length; i++){
+ for(int i = 0; i < versionInfo.length; i++) {
if(versionInfo[i].indexOf(MINGW_SPECIAL) != -1)
return true;
else if(versionInfo[i].indexOf(CYGWIN_SPECIAL) != -1)
diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/GnuCygwinConfigurationEnvironmentSupplier.java b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/GnuCygwinConfigurationEnvironmentSupplier.java
index dafa734e20..ae08fcf841 100644
--- a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/GnuCygwinConfigurationEnvironmentSupplier.java
+++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/GnuCygwinConfigurationEnvironmentSupplier.java
@@ -16,13 +16,10 @@ import org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSu
import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider;
import org.eclipse.cdt.managedbuilder.internal.envvar.BuildEnvVar;
-
/**
* @noextend This class is not intended to be subclassed by clients.
*/
-public class GnuCygwinConfigurationEnvironmentSupplier implements
- IConfigurationEnvironmentVariableSupplier {
-
+public class GnuCygwinConfigurationEnvironmentSupplier implements IConfigurationEnvironmentVariableSupplier {
private static final String PATH = "PATH"; //$NON-NLS-1$
private static final String DELIMITER_UNIX = ":"; //$NON-NLS-1$
private static final String PROPERTY_DELIMITER = "path.separator"; //$NON-NLS-1$
@@ -32,53 +29,49 @@ public class GnuCygwinConfigurationEnvironmentSupplier implements
private static final String LC_ALL = "LC_ALL"; //$NON-NLS-1$
private static final String LC_MESSAGES = "LC_MESSAGES"; //$NON-NLS-1$
- /* (non-Javadoc)
- * @see org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSupplier#getVariable(java.lang.String, org.eclipse.cdt.managedbuilder.core.IConfiguration, org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider)
- */
@Override
- public IBuildEnvironmentVariable getVariable(String variableName,
- IConfiguration configuration, IEnvironmentVariableProvider provider) {
-
- if (variableName == null)
+ public IBuildEnvironmentVariable getVariable(String variableName, IConfiguration configuration, IEnvironmentVariableProvider provider) {
+ if (variableName == null) {
return null;
+ }
- if (!System.getProperty(PROPERTY_OSNAME).toLowerCase().startsWith("windows ")) //$NON-NLS-1$
+ if (!System.getProperty(PROPERTY_OSNAME).toLowerCase().startsWith("windows ")) { //$NON-NLS-1$
return null;
-
+ }
+
if (variableName.equalsIgnoreCase(PATH)) {
String p = CygwinPathResolver.getBinPath();
- if (p != null)
+ if (p != null) {
return new BuildEnvVar(PATH, p.replace('/','\\'), IBuildEnvironmentVariable.ENVVAR_PREPEND, System.getProperty(PROPERTY_DELIMITER, DELIMITER_UNIX));
+ }
} else if (variableName.equalsIgnoreCase(LANG)) {
// Workaround for not being able to select encoding for CDT console -> change codeset to Latin1
- String langValue = System.getenv(LANG);
- if (langValue == null || langValue.length() == 0)
+ String langValue = System.getenv(LANG);
+ if (langValue == null || langValue.length() == 0) {
langValue = System.getenv(LC_ALL);
- if (langValue == null || langValue.length() == 0)
+ }
+ if (langValue == null || langValue.length() == 0) {
langValue = System.getenv(LC_MESSAGES);
- if (langValue != null && langValue.length() > 0)
+ }
+ if (langValue != null && langValue.length() > 0) {
// langValue is [language[_territory][.codeset][@modifier]], i.e. "en_US.UTF-8@dict"
// we replace codeset with Latin1 as CDT console garbles UTF
// and ignore modifier which is not used by LANG
langValue = langValue.replaceFirst("([^.@]*)(\\..*)?(@.*)?", "$1.ISO-8859-1"); //$NON-NLS-1$ //$NON-NLS-2$
- else
+ } else {
langValue = "C.ISO-8859-1"; //$NON-NLS-1$
+ }
- return new BuildEnvVar(LANG, langValue);
+ return new BuildEnvVar(LANG, langValue);
}
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSupplier#getVariables(org.eclipse.cdt.managedbuilder.core.IConfiguration, org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider)
- */
@Override
- public IBuildEnvironmentVariable[] getVariables(
- IConfiguration configuration, IEnvironmentVariableProvider provider) {
-
+ public IBuildEnvironmentVariable[] getVariables(IConfiguration configuration, IEnvironmentVariableProvider provider) {
IBuildEnvironmentVariable varLang = getVariable(LANG, configuration, provider);
IBuildEnvironmentVariable varPath = getVariable(PATH, configuration, provider);
-
+
if (varPath != null) {
return new IBuildEnvironmentVariable[] {varLang, varPath};
} else {
diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/IsGnuCygwinToolChainSupported.java b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/IsGnuCygwinToolChainSupported.java
index f3c9541db4..cf7d2816c2 100644
--- a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/IsGnuCygwinToolChainSupported.java
+++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/IsGnuCygwinToolChainSupported.java
@@ -32,24 +32,17 @@ import org.osgi.framework.Version;
*
* @noextend This class is not intended to be subclassed by clients.
*/
-public class IsGnuCygwinToolChainSupported implements
- IManagedIsToolChainSupported {
-
+public class IsGnuCygwinToolChainSupported implements IManagedIsToolChainSupported {
static final String[] CHECKED_NAMES = {"gcc", "binutils", "make"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
static boolean suppChecked = false;
static boolean toolchainIsSupported = false;
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.managedbuilder.core.IManagedIsToolChainSupported#isSupported(org.eclipse.cdt.managedbuilder.core.IToolChain, org.eclipse.core.runtime.PluginVersionIdentifier, java.lang.String)
- */
/**
* @since 8.0
*/
@Override
public boolean isSupported(IToolChain toolChain, Version version, String instance) {
-
if (suppChecked) return toolchainIsSupported;
String etcCygwin = CygwinPathResolver.getEtcPath();
@@ -80,7 +73,9 @@ public class IsGnuCygwinToolChainSupported implements
String s;
while ((s = data.readLine()) != null ) {
for (int j = 0; j < CHECKED_NAMES.length; j++) {
- if (s.startsWith(CHECKED_NAMES[j])) {found[j] = true;}
+ if (s.startsWith(CHECKED_NAMES[j])) {
+ found[j] = true;
+ }
}
}
arePackagesInstalled = true;
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
index 940ca95cb5..65313653e3 100644
--- 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
@@ -25,9 +25,7 @@ import org.eclipse.core.runtime.Platform;
*
* @noextend This class is not intended to be subclassed by clients.
*/
-public class MingwEnvironmentVariableSupplier implements
- IConfigurationEnvironmentVariableSupplier {
-
+public class MingwEnvironmentVariableSupplier implements IConfigurationEnvironmentVariableSupplier {
private static boolean checked = false;
private static IPath binDir = null;

Back to the top