Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gvozdev2011-11-17 17:34:21 -0500
committerAndrew Gvozdev2011-11-17 17:34:21 -0500
commit2a1cddd71635c39ae336ba43bb89cecbfb09e21f (patch)
treec7a504d11610c16c23c34e29bba23ba0b280bb81 /build/org.eclipse.cdt.managedbuilder.core
parente47db971decd8fd15ce52984be3de50b6eaa24de (diff)
downloadorg.eclipse.cdt-2a1cddd71635c39ae336ba43bb89cecbfb09e21f.tar.gz
org.eclipse.cdt-2a1cddd71635c39ae336ba43bb89cecbfb09e21f.tar.xz
org.eclipse.cdt-2a1cddd71635c39ae336ba43bb89cecbfb09e21f.zip
auto-clean: @Override annotations + organize imports + unnecessary
casts/$NON-NLS + trailing white spaces
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.core')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/ScannerConfigNature.java28
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgDiscoveredPathManager.java88
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/PerFileSettingsCalculator.java255
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/jobs/CfgSCJobsUtil.java42
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig2/CfgScannerConfigInfoFactory2.java75
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IResourceConfiguration.java115
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IToolReference.java45
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java55
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedCProjectNature.java28
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedOptionValueHandler.java35
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ResourceChangeHandler2.java35
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IBuildEnvironmentVariable.java26
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildCommand.java8
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescription.java26
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescriptionGnuMakefileGenerator.java47
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildIOType.java23
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildResource.java59
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildStateManager.java35
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildStep.java180
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/CommandBuilder.java85
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ConfigurationBuildState.java35
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DefaultBuildDescriptionFactory.java12
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DescriptionBuilder.java64
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ProjectBuildState.java36
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/StepBuilder.java47
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildProperties.java50
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildProperty.java22
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertyManager.java42
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertyType.java8
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/AdditionalInput.java65
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BooleanExpressionApplicabilityCalculator.java56
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildObject.java26
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildObjectProperties.java22
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java3
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ConfigurationNameProvider.java7
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ConfigurationV2.java135
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/DefaultManagedConfigElement.java12
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/EnvVarBuildPath.java36
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/FolderInfo.java25
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GnuConfigurationNameProvider.java1
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilder.java3
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HoldsOptions.java174
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputOrder.java79
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java63
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java317
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedCommandLineGenerator.java31
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedCommandLineInfo.java12
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedConfigStorageElement.java30
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedMakeProject.java24
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedProject.java129
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MapStorageElement.java66
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ModificationStatus.java17
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiFileInfo.java12
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiFolderInfo.java24
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiResourceInfo.java64
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java443
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java154
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java199
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OutputType.java204
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java157
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceChangeHandler.java61
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java213
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceInfo.java127
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceInfoContainer.java35
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/SupportedProperties.java58
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java204
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/TargetPlatform.java131
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java831
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java587
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java302
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildEnvironmentContributor.java32
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildVariablesContributor.java16
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ConfigurationDataProvider.java128
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ExternalExtensionMacroSupplier.java54
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ProjectConverter.java135
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ResourcePropertyHolder.java32
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/AndExpression.java12
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckBuildPropertyExpression.java26
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckHolderExpression.java10
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckOptionExpression.java70
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckStringExpression.java34
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/FalseExpression.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/HasNatureExpression.java20
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/OrExpression.java12
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/EnvironmentVariableProvider.java89
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/ExternalExtensionEnvironmentSupplier.java36
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/MbsEnvironmentSupplier.java16
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/StoredBuildPathEnvironmentContainer.java62
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildCdtVariablesSupplierBase.java6
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildMacro.java5
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildMacroProvider.java74
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildMacroStatus.java11
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildfileMacroSubstitutor.java51
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/DefaultMacroContextInfo.java48
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/FileContextBuildMacroValues.java18
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/FileContextData.java7
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/MbsMacroSupplier.java166
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/OptionContextData.java17
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/ManagedBuildCPathEntryContainer.java5
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConfigurationModification.java46
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConflictSet.java48
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/FileInfoModification.java11
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/FolderInfoModification.java114
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ObjectSet.java18
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PathComparator.java31
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolChainModificationManager.java60
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolListMap.java55
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolListModification.java179
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IBuildMacro.java10
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator.java75
-rw-r--r--[-rwxr-xr-x]build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator2.java11
-rw-r--r--[-rwxr-xr-x]build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator2Commands.java73
-rw-r--r--[-rwxr-xr-x]build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator3.java21
-rw-r--r--[-rwxr-xr-x]build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator3Commands.java111
-rw-r--r--[-rwxr-xr-x]build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculatorPreBuild.java11
-rw-r--r--[-rwxr-xr-x]build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculatorPreBuildCommands.java84
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuLinkOutputNameProvider.java27
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java21
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/ManagedBuildGnuToolInfo.java192
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/internal/DefaultIndexerDependencyCalculator.java17
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/internal/DefaultNoDependencyCalculator.java7
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/pdomdepgen/PDOMDependencyCalculator.java24
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/pdomdepgen/PDOMDependencyGenerator.java13
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject21.java20
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProjectManager.java87
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/ExcludeResources.java35
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/MakeScannerInfo.java6
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/MakeScannerProvider.java9
128 files changed, 5330 insertions, 4025 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/ScannerConfigNature.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/ScannerConfigNature.java
index 0129f2bc4d..b34ee13ccf 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/ScannerConfigNature.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/ScannerConfigNature.java
@@ -20,18 +20,19 @@ import org.eclipse.core.runtime.CoreException;
/**
* @see IProjectNature
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
public class ScannerConfigNature implements IProjectNature {
-
+
public final static String NATURE_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".ScannerConfigNature"; //$NON-NLS-1$
private IProject fProject;
/**
* @see IProjectNature#configure
*/
+ @Override
public void configure() throws CoreException {
IProjectDescription description = getProject().getDescription();
ICommand[] commands = description.getBuildSpec();
@@ -52,13 +53,14 @@ public class ScannerConfigNature implements IProjectNature {
newCommands[commands.length] = command;
description.setBuildSpec(newCommands);
getProject().setDescription(description, null);
-
+
// set default project scanner config settings
}
/**
* @see IProjectNature#deconfigure
*/
+ @Override
public void deconfigure() throws CoreException {
IProjectDescription description = getProject().getDescription();
ICommand[] commands = description.getBuildSpec();
@@ -77,6 +79,7 @@ public class ScannerConfigNature implements IProjectNature {
/**
* @see IProjectNature#getProject
*/
+ @Override
public IProject getProject() {
return fProject;
}
@@ -84,10 +87,11 @@ public class ScannerConfigNature implements IProjectNature {
/**
* @see IProjectNature#setProject
*/
+ @Override
public void setProject(IProject project) {
fProject = project;
}
-
+
public static void addScannerConfigNature(IProject project) throws CoreException {
IProjectDescription description = project.getDescription();
if (description.hasNature(NATURE_ID))
@@ -98,9 +102,9 @@ public class ScannerConfigNature implements IProjectNature {
newIds[ids.length] = NATURE_ID;
description.setNatureIds(newIds);
project.setDescription(description, null);
-
+
}
-
+
public static void removeScannerConfigNature(IProject project) throws CoreException {
IProjectDescription description = project.getDescription();
if (!description.hasNature(NATURE_ID))
@@ -144,7 +148,7 @@ public class ScannerConfigNature implements IProjectNature {
newCommands = new ICommand[oldCommands.length + 1];
System.arraycopy(oldCommands, 0, newCommands, 0, oldCommands.length);
newCommands[oldCommands.length] = newCommand;
- }
+ }
else {
for (int i = 0; i < oldCommands.length; i++) {
if (oldCommands[i] == oldCommand) {
@@ -170,19 +174,19 @@ public class ScannerConfigNature implements IProjectNature {
// String selectedProfile = scPrefInfo.getSelectedProfileId();
// IScannerConfigBuilderInfo2 scProjInfo = ScannerConfigProfileManager.createScannerConfigBuildInfo2(
// project, selectedProfile);
-//
+//
// scProjInfo.setAutoDiscoveryEnabled(scPrefInfo.isAutoDiscoveryEnabled());
// scProjInfo.setProblemReportingEnabled(scPrefInfo.isProblemReportingEnabled());
-//
+//
// scProjInfo.setBuildOutputParserEnabled(scPrefInfo.isBuildOutputParserEnabled());
// scProjInfo.setBuildOutputFileActionEnabled(scPrefInfo.isBuildOutputFileActionEnabled());
// scProjInfo.setBuildOutputFilePath(scPrefInfo.getBuildOutputFilePath());
-//
+//
// ScannerConfigProfile profile = ScannerConfigProfileManager.getInstance().getSCProfileConfiguration(selectedProfile);
// List providerIdList = scPrefInfo.getProviderIdList();
// for (Iterator i = providerIdList.iterator(); i.hasNext();) {
// String providerId = (String) i.next();
-//
+//
// scProjInfo.setProviderOutputParserEnabled(providerId, scPrefInfo.isProviderOutputParserEnabled(providerId));
// if (profile.getScannerInfoProviderElement(providerId).getProviderKind().equals(
// ScannerConfigProfile.ScannerInfoProvider.RUN)) {
@@ -194,7 +198,7 @@ public class ScannerConfigNature implements IProjectNature {
// }
// }
// scProjInfo.save();
-//
+//
// // the last step is to add discovered paths container
// ICProject cProject = CoreModel.getDefault().create(project);
// IPathEntry[] rawPathEntries = CoreModel.getRawPathEntries(cProject);
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgDiscoveredPathManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgDiscoveredPathManager.java
index 8c6717b436..f818f42eb8 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgDiscoveredPathManager.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgDiscoveredPathManager.java
@@ -69,12 +69,12 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
public static CfgDiscoveredPathManager fInstance;
private IDiscoveredPathManager fBaseMngr;
-
+
/** Deadlock-safe mutex lock */
private ILock lock = Job.getJobManager().newLock();
private static class ContextInfo {
-
+
public ContextInfo() {
}
CfgInfoContext fInitialContext;
@@ -84,25 +84,25 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
IScannerConfigBuilderInfo2 fInfo;
boolean fIsPerFileCache;
}
-
+
public static class PathInfoCache{
private PathInfo fPathInfo;
private String fProfileId;
-
+
public PathInfo getPathInfo(){
return fPathInfo;
}
-
+
private PathInfoCache(String profileId, PathInfo pathInfo){
this.fProfileId = profileId;
this.fPathInfo = pathInfo;
}
}
-
+
private CfgDiscoveredPathManager() {
fBaseMngr = MakeCorePlugin.getDefault().getDiscoveryManager();
}
-
+
public static CfgDiscoveredPathManager getInstance(){
if(fInstance == null){
fInstance = new CfgDiscoveredPathManager();
@@ -110,23 +110,24 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
}
return fInstance;
}
-
+
public static void stop(){
if(fInstance != null)
fInstance.shutdown();
}
-
+
public void startup() {
ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
}
-
+
public void shutdown() {
ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
*/
+ @Override
public void resourceChanged(IResourceChangeEvent event) {
if (event.getSource() instanceof IWorkspace) {
IResource resource = event.getResource();
@@ -148,7 +149,8 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
public void updateCoreSettings(final IProject project, final IConfiguration cfgs[]) {
try {
IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
+ @Override
+ public void run(IProgressMonitor monitor) throws CoreException {
ManagedBuildManager.updateCoreSettings(project, cfgs, true);
}
};
@@ -181,13 +183,13 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
}
return info;
}
-
+
// private void adjustPerRcContextInfo(ContextInfo cInfo){
// cInfo.fIsFerFileCache = true;
// cInfo.fCacheContext = cInfo.fInitialContext;
// cInfo.fLoadContext = new CfgInfoContext(cInfo.fInitialContext.getConfiguration());
// }
-
+
private PathInfo resolveCacheBaseDiscoveredInfo(ContextInfo cInfo, IDiscoveredPathManager.IDiscoveredPathInfo baseInfo){
if(cInfo.fIsPerFileCache){
if(baseInfo instanceof IDiscoveredPathManager.IPerFileDiscoveredPathInfo2){
@@ -195,24 +197,24 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
}
return getCachedPathInfo(cInfo);
}
-
+
((FolderInfo)cInfo.fLoadContext.getConfiguration().getRootFolderInfo()).setContainsDiscoveredScannerInfo(true);
Map<String, String> map = baseInfo.getSymbols();
IPath paths[] = baseInfo.getIncludePaths();
-
+
PathInfo info = new PathInfo(paths, null, map, null, null);
setCachedPathInfo(cInfo, info);
return info;
}
-
+
private void resolveCachePerFileInfo(ContextInfo cInfo, IDiscoveredPathManager.IPerFileDiscoveredPathInfo2 info){
CConfigurationData data = cInfo.fLoadContext.getConfiguration().getConfigurationData();
if(data == null)
return;
-
+
PerFileSettingsCalculator calculator = new PerFileSettingsCalculator();
IRcSettingInfo[] rcInfos = calculator.getSettingInfos(cInfo.fLoadContext.getConfiguration().getOwner().getProject(), data, info, true);
-
+
CResourceData rcDatas[] = data.getResourceDatas();
Map<IPath, CResourceData> rcDataMap = new HashMap<IPath, CResourceData>();
CResourceData rcData;
@@ -220,9 +222,9 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
rcData = rcDatas[i];
rcDataMap.put(rcData.getPath(), rcData);
}
-
+
IRcSettingInfo rcInfo;
- IPath path;
+ IPath path;
boolean rootSettingFound = false;
boolean fileSettingFound = false;
for(int i = 0; i < rcInfos.length; i++){
@@ -233,14 +235,14 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
fileSettingFound = true;
else
rootSettingFound = true;
-
+
rcDataMap.remove(path);
cache(cInfo, rcInfo);
}
-
+
if(rootSettingFound && fileSettingFound)
((BuildFolderData)data.getRootFolderData()).setContainsDiscoveredScannerInfo(false);
-
+
if(!rcDataMap.isEmpty()){
CResourceData tmpRcData;
for(Iterator<CResourceData> iter = rcDataMap.values().iterator(); iter.hasNext();){
@@ -253,7 +255,7 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
}
}
}
-
+
private void cache(ContextInfo cInfo, IRcSettingInfo rcSetting){
CResourceData rcData = rcSetting.getResourceData();
clearCache(rcData);
@@ -262,12 +264,12 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
cache(cInfo, lInfos[i]);
}
}
-
+
private void cache(ContextInfo cInfo, ILangSettingInfo lInfo){
BuildLanguageData bld = (BuildLanguageData)lInfo.getLanguageData();
setCachedPathInfo(cInfo, (Configuration)bld.getConfiguration(), (Tool)bld.getTool(), bld.getInputType(), lInfo.getFilePathInfo());
}
-
+
private void clearCache(CResourceData rcData){
if(rcData.getType() == ICSettingBase.SETTING_FILE){
IFileInfo fiInfo = ((BuildFileData)rcData).getFileInfo();
@@ -279,13 +281,13 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
clearCache(tools);
}
}
-
+
private void clearCache(ITool[] tools){
for(int i = 0; i < tools.length; i++){
((Tool)tools[i]).clearAllDiscoveredInfo();
}
}
-
+
private IDiscoveredPathManager.IDiscoveredPathInfo loadPathInfo(IProject project, IConfiguration cfg, ContextInfo cInfo) throws CoreException{
IDiscoveredPathManager.IDiscoveredPathInfo info = fBaseMngr.getDiscoveredInfo(cfg.getOwner().getProject(), cInfo.fLoadContext.toInfoContext(), false);
if(!DiscoveredScannerInfoStore.getInstance().hasInfo(project, cInfo.fLoadContext.toInfoContext(), info.getSerializable())){
@@ -295,7 +297,7 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
if(buildInfo != null){
SCProfileInstance instance = ScannerConfigBuilder.build(cInfo.fLoadContext, buildInfo, 0, null, new NullProgressMonitor());
if(instance != null){
-
+
IScannerInfoCollector newC = instance.getScannerInfoCollector();
if(newC instanceof IScannerInfoCollector2
&& !(newC instanceof PerFileSICollector)){
@@ -307,7 +309,7 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
}
return info;
}
-
+
private PathInfo getCachedPathInfo(ContextInfo cInfo){
PathInfo info = getCachedPathInfo(cInfo, true, true, false);
return info;
@@ -318,7 +320,7 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
if(cInfo.fIsPerFileCache){
Configuration cfg = (Configuration)cInfo.fInitialContext.getConfiguration();
cfg.clearDiscoveredPathInfo();
-
+
IResourceInfo[] infos = cfg.getResourceInfos();
for(int i = 0; i < infos.length; i++){
IResourceInfo rcInfo = infos[i];
@@ -331,7 +333,7 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
} else {
setCachedPathInfo(cInfo, null);
}
-
+
// PathInfo info = getCachedPathInfo(cInfo, true, true, true);
}
@@ -345,7 +347,7 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
return infoCache.fPathInfo;
return null;
}
-
+
private PathInfoCache getPathInfoCache(ContextInfo cInfo, Configuration cfg, Tool tool, IInputType inType, boolean queryParent, boolean clearIfInvalid, boolean clear){
PathInfoCache info = null;
// boolean queryCfg = false;
@@ -385,14 +387,14 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
// fBaseMngr.removeDiscoveredInfo(cfg.getOwner().getProject(), cInfo.fLoadContext.toInfoContext());
}
}
-
+
return info;
}
-
+
private boolean isCacheValid(ContextInfo cInfo, PathInfoCache cache){
if(cache == null)
return true;
-
+
if(cInfo.fInfo != null){
String id = cInfo.fInfo.getSelectedProfileId();
return id.equals(cache.fProfileId);
@@ -423,26 +425,26 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
contextInfo.fIsPerFileCache = CfgScannerConfigProfileManager.isPerFileProfile(contextInfo.fInfo.getSelectedProfileId());
contextInfo.fCacheContext = contextInfo.fIsPerFileCache ? contextInfo.fInitialContext : contextInfo.fLoadContext;
}
-
+
return contextInfo;
}
-
+
private PathInfo setCachedPathInfo(ContextInfo cInfo, PathInfo info){
CfgInfoContext cacheContext = cInfo.fCacheContext;
return setCachedPathInfo(cInfo, (Configuration)cacheContext.getConfiguration(), (Tool)cacheContext.getTool(), cacheContext.getInputType(), info);
}
-
+
private PathInfo setCachedPathInfo(ContextInfo cInfo, Configuration cfg, Tool tool, IInputType inType, PathInfo info){
PathInfoCache oldInfo;
PathInfoCache cache;
if(info != null){
String id = cInfo.fInfo != null ? cInfo.fInfo.getSelectedProfileId() : null;
- cache = new PathInfoCache(id, info);
+ cache = new PathInfoCache(id, info);
} else {
cache = null;
}
-
+
if(tool != null){
if(info != null)
oldInfo = tool.setDiscoveredPathInfo(inType, cache);
@@ -464,7 +466,7 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
public void removeDiscoveredInfo(IProject project, CfgInfoContext context, boolean removeBaseCache) {
// if(context == null)
// context = ScannerConfigUtil.createContextForProject(project);
-
+
ContextInfo cInfo = getContextInfo(context);
removeCachedPathInfo(cInfo);
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/PerFileSettingsCalculator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/PerFileSettingsCalculator.java
index eded9cf510..683ea034d2 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/PerFileSettingsCalculator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/PerFileSettingsCalculator.java
@@ -39,11 +39,11 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
public class PerFileSettingsCalculator {
- private static final String[] EMPTY_STRING_ARRAY = new String[0];
+ private static final String[] EMPTY_STRING_ARRAY = new String[0];
// private static class ListIndex {
// int fIndex;
// List fList;
-//
+//
// public ListIndex(int index, List list) {
// fIndex = index;
// fList = list;
@@ -52,13 +52,13 @@ public class PerFileSettingsCalculator {
public interface IRcSettingInfo {
CResourceData getResourceData();
-
+
ILangSettingInfo[] getLangInfos();
}
-
+
public interface ILangSettingInfo {
CLanguageData getLanguageData();
-
+
PathInfo getFilePathInfo();
}
@@ -70,55 +70,59 @@ public class PerFileSettingsCalculator {
fRcData = rcData;
}
+ @Override
public ILangSettingInfo[] getLangInfos() {
if(fLangInfoList != null && fLangInfoList.size() != 0)
return fLangInfoList.toArray(new ILangSettingInfo[fLangInfoList.size()]);
return new ILangSettingInfo[0];
}
+ @Override
public CResourceData getResourceData() {
return fRcData;
}
-
+
void add(ILangSettingInfo info){
if(fLangInfoList == null)
fLangInfoList = new ArrayList<ILangSettingInfo>();
fLangInfoList.add(info);
}
}
-
+
private static class LangSettingInfo implements ILangSettingInfo {
private CLanguageData fLangData;
private PathInfo fPathInfo;
-
+
LangSettingInfo(CLanguageData langData, PathInfo info){
fLangData = langData;
fPathInfo = info;
}
+ @Override
public PathInfo getFilePathInfo() {
return fPathInfo;
}
+ @Override
public CLanguageData getLanguageData() {
return fLangData;
}
-
+
}
private static class ListIndexStore {
private int fMaxIndex;
private List<PathFilePathInfo>[] fStore;
-
+
@SuppressWarnings("unchecked")
private List<PathFilePathInfo>[] emptyStore(int size) {
return new List[size];
}
-
+
public ListIndexStore(int size){
if(size < 0)
size = 0;
-
+
fStore = emptyStore(size);
}
@@ -128,13 +132,13 @@ public class PerFileSettingsCalculator {
list = new ArrayList<PathFilePathInfo>();
fStore[index] = list;
}
-
+
if(fMaxIndex < index)
fMaxIndex = index;
-
+
list.add(value);
}
-
+
private boolean checkResize(int index){
if(index >= fStore.length){
int newSize = ++index;
@@ -147,7 +151,7 @@ public class PerFileSettingsCalculator {
}
return false;
}
-
+
public List<PathFilePathInfo>[] getLists(){
int size = fMaxIndex + 1;
List<List<PathFilePathInfo>> list = new ArrayList<List<PathFilePathInfo>>(size);
@@ -157,21 +161,21 @@ public class PerFileSettingsCalculator {
if(l != null)
list.add(l);
}
-
+
return list.toArray(emptyStore(list.size()));
}
}
-
+
private static class PathFilePathInfo {
IPath fPath;
PathInfo fInfo;
-
+
PathFilePathInfo(IPath path, PathInfo info){
fPath = path;
fInfo = info;
}
}
-
+
private static class ExtsSetSettings {
// String[] fExts;
// HashSet fExtsSet;
@@ -188,7 +192,7 @@ public class PerFileSettingsCalculator {
fBaseLangData = baseLangData;
fIsDerived = isDerived;
}
-
+
void add(ExtsSetSettings setting){
if(setting.fPathFilePathInfoMap != null){
Collection<List<PathFilePathInfo>> values = setting.fPathFilePathInfoMap.values();
@@ -199,7 +203,7 @@ public class PerFileSettingsCalculator {
}
}
}
-
+
// void updateLangData(CLanguageData lData, boolean isDerived){
// fBaseLangData = lData;
// fIsDerived = lData != null ? isDerived : false;
@@ -208,7 +212,7 @@ public class PerFileSettingsCalculator {
public void add(PathFilePathInfo pInfo){
if(fPathFilePathInfoMap == null)
fPathFilePathInfoMap = new HashMap<PathInfo, List<PathFilePathInfo>>(3);
-
+
PathInfo fileInfo = pInfo.fInfo;
List<PathFilePathInfo> list = fileInfo == fMaxMatchInfo ? fMaxMatchInfoList : fPathFilePathInfoMap.get(fileInfo);
if(list == null){
@@ -217,13 +221,13 @@ public class PerFileSettingsCalculator {
if(fMaxMatchInfo == null){
fMaxMatchInfo = fileInfo;
fMaxMatchInfoList = emptyList;
- }
+ }
// else {
// fIsMultiple = true;
// }
} else if(fMaxMatchInfoList != list){
// fIsMultiple = true;
-
+
if(fMaxMatchInfoList.size() == list.size()){
fMaxMatchInfoList = list;
fMaxMatchInfo = fileInfo;
@@ -231,36 +235,36 @@ public class PerFileSettingsCalculator {
}
list.add(pInfo);
}
-
+
public boolean isMultiple(){
return fPathFilePathInfoMap != null && fPathFilePathInfoMap.size() > 1;
}
-
+
// public PathInfo getMaxMatchPathInfo(){
// return fMaxMatchInfo;
// }
-
+
@Override
public boolean equals(Object obj) {
if(obj == this)
return true;
-
+
if(isMultiple())
return false;
-
+
if(!(obj instanceof ExtsSetSettings))
return false;
-
+
ExtsSetSettings other = (ExtsSetSettings)obj;
if(other.isMultiple())
return false;
-
+
if(!fExtsSet.equals(other.fExtsSet))
return false;
-
+
if(!CDataUtil.objectsEqual(fMaxMatchInfo, other.fMaxMatchInfo))
return false;
-
+
return true;
}
@@ -272,18 +276,18 @@ public class PerFileSettingsCalculator {
hash = super.hashCode();
else {
hash = fExtsSet.hashCode();
-
+
if(fMaxMatchInfo != null)
- hash += fMaxMatchInfo.hashCode();
+ hash += fMaxMatchInfo.hashCode();
}
-
+
fHash = hash;
}
return hash;
}
-
+
}
-
+
private static class ExtsSet {
private String[] fExts;
private HashSet<String> fExtsSet;
@@ -292,19 +296,19 @@ public class PerFileSettingsCalculator {
public ExtsSet(String[] exts){
fExts = exts == null || exts.length == 0 ? EMPTY_STRING_ARRAY : (String[])exts.clone();
}
-
+
@Override
public boolean equals(Object obj) {
if(this == obj)
return true;
-
+
if(!(obj instanceof ExtsSet))
return false;
-
+
ExtsSet other = (ExtsSet)obj;
if(fExts.length != other.fExts.length)
return false;
-
+
if(fExts.length != 0){
@SuppressWarnings("unchecked")
HashSet<String> set = (HashSet<String>)calcExtsSet().clone();
@@ -314,7 +318,7 @@ public class PerFileSettingsCalculator {
}
return true;
}
-
+
// public String[] getExtensions(){
// return fExts.clone();
// }
@@ -331,7 +335,7 @@ public class PerFileSettingsCalculator {
}
return hash;
}
-
+
private HashSet<String> calcExtsSet(){
if(fExtsSet == null)
fExtsSet = new HashSet<String>(Arrays.asList(fExts));
@@ -342,9 +346,9 @@ public class PerFileSettingsCalculator {
public String toString() {
if(fExts.length == 0)
return "<empty>"; //$NON-NLS-1$
-
+
StringBuffer buf = new StringBuffer();
-
+
for(int i = 0; i < fExts.length; i++){
if(i != 0)
buf.append(","); //$NON-NLS-1$
@@ -353,7 +357,7 @@ public class PerFileSettingsCalculator {
return buf.toString();
}
}
-
+
private static class RcSetSettings {
private CResourceData fRcData;
private HashMap<String, ExtsSetSettings> fExtToExtsSetMap;
@@ -395,13 +399,13 @@ public class PerFileSettingsCalculator {
}
return child;
}
-
+
void updateRcData(CResourceData data, boolean isDerived){
fRcData = data;
fIsDerived = data != null ? isDerived : false;
updateLangDatas();
}
-
+
private void updateLangDatas(){
if(fRcData.getType() == ICSettingBase.SETTING_FILE){
CLanguageData lData = ((CFileData)fRcData).getLanguageData();
@@ -410,9 +414,9 @@ public class PerFileSettingsCalculator {
extSetting.fBaseLangData = lData;
extSetting.fIsDerived = lData != null ? fIsDerived : false;
}
-
- if(extSetting != null ?
- fExtsSetToExtsSetSettingsMap.size() > 1
+
+ if(extSetting != null ?
+ fExtsSetToExtsSetSettingsMap.size() > 1
: fExtsSetToExtsSetSettingsMap.size() > 0){
Collection<ExtsSetSettings> values = fExtsSetToExtsSetSettingsMap.values();
for (ExtsSetSettings s : values) {
@@ -426,7 +430,7 @@ public class PerFileSettingsCalculator {
CLanguageData[] lDatas = ((CFolderData)fRcData).getLanguageDatas();
@SuppressWarnings("unchecked")
Map<ExtsSet, ExtsSetSettings> map = (HashMap<ExtsSet, ExtsSetSettings>)fExtsSetToExtsSetSettingsMap.clone();
-
+
CLanguageData lData;
for(int i = 0; i < lDatas.length; i++){
lData = lDatas[i];
@@ -436,7 +440,7 @@ public class PerFileSettingsCalculator {
extSetting.fIsDerived = this.fIsDerived;
}
}
-
+
if(map.size() != 0){
Collection<ExtsSetSettings> values = map.values();
for (ExtsSetSettings extSetting : values) {
@@ -446,28 +450,28 @@ public class PerFileSettingsCalculator {
}
}
}
-
+
public IPath getPath(){
return fContainer.getPath();
}
-
+
public RcSetSettings getParent(){
PathSettingsContainer cr = fContainer.getParentContainer();
if(cr != null)
return (RcSetSettings)cr.getValue();
return null;
}
-
+
void internalSetSettingsMap(HashMap<ExtsSet, ExtsSetSettings> map){
fExtsSetToExtsSetSettingsMap = map;
fExtToExtsSetMap = calcExtToExtSetSettingsMap(map);
}
-
+
void internalAdd(ExtsSetSettings setting){
if(fExtsSetToExtsSetSettingsMap == null){
fExtsSetToExtsSetSettingsMap = new HashMap<ExtsSet, ExtsSetSettings>();
}
-
+
ExtsSetSettings cur = fExtsSetToExtsSetSettingsMap.get(setting.fExtsSet);
if(cur != null){
cur.add(setting);
@@ -476,7 +480,7 @@ public class PerFileSettingsCalculator {
fExtToExtsSetMap = addExtsInfoToMap(setting, fExtToExtsSetMap);
}
}
-
+
void internalAddSettingsMap(HashMap<ExtsSet, ExtsSetSettings> map){
// ExtsSetSettings thisSetting;
// ExtsSet extsSet;
@@ -493,15 +497,16 @@ public class PerFileSettingsCalculator {
// }
}
}
-
+
// public boolean settingsEqual(RcSetSettings other){
// return fExtsSetToExtsSetSettingsMap.equals(other.fExtsSetToExtsSetSettingsMap);
// }
-
+
public RcSetSettings[] getChildren(final boolean includeCurrent){
final List<RcSetSettings> list = new ArrayList<RcSetSettings>();
fContainer.accept(new IPathSettingsContainerVisitor(){
+ @Override
public boolean visit(PathSettingsContainer container) {
if(includeCurrent || container != fContainer){
RcSetSettings value = (RcSetSettings)container.getValue();
@@ -509,44 +514,44 @@ public class PerFileSettingsCalculator {
}
return true;
}
-
+
});
-
+
return list.toArray(new RcSetSettings[list.size()]);
}
-
+
public boolean containsEqualMaxMatches(RcSetSettings other, boolean ignoreGenerated){
if(!ignoreGenerated && fExtsSetToExtsSetSettingsMap.size() < other.fExtsSetToExtsSetSettingsMap.size())
return false;
-
+
Set<Entry<ExtsSet, ExtsSetSettings>> entrySet = other.fExtsSetToExtsSetSettingsMap.entrySet();
for (Entry<ExtsSet, ExtsSetSettings> entry : entrySet) {
ExtsSetSettings otherSetting = entry.getValue();
if(ignoreGenerated && otherSetting.fBaseLangData == null)
continue;
-
+
ExtsSetSettings thisSetting = fExtsSetToExtsSetSettingsMap.get(entry.getKey());
if(thisSetting == null)
return false;
-
+
if(otherSetting.fMaxMatchInfo != null && !otherSetting.fMaxMatchInfo.equals(thisSetting.fMaxMatchInfo))
return false;
}
-
+
return true;
}
-
+
void removeChild(RcSetSettings setting){
IPath path = setting.fContainer.getPath();
IPath thisPath = fContainer.getPath();
if(!thisPath.isPrefixOf(path))
throw new IllegalArgumentException();
-
+
path = path.removeFirstSegments(thisPath.segmentCount());
fContainer.removeChildContainer(path);
}
}
-
+
private static HashMap<String, ExtsSetSettings> calcExtToExtSetSettingsMap(Map<ExtsSet, ExtsSetSettings> extsSetMap){
HashMap<String, ExtsSetSettings> result = null;
Collection<ExtsSetSettings> values = extsSetMap.values();
@@ -555,7 +560,7 @@ public class PerFileSettingsCalculator {
}
return result;
}
-
+
private static HashMap<String, ExtsSetSettings> addExtsInfoToMap(ExtsSetSettings setting, HashMap<String, ExtsSetSettings> map){
boolean forceAdd = false;
String[] exts = setting.fExtsSet.fExts;
@@ -573,7 +578,7 @@ public class PerFileSettingsCalculator {
}
return map;
}
-
+
private RcSetSettings createRcSetInfo (CConfigurationData data){
CFolderData rootData = data.getRootFolderData();
PathSettingsContainer container = PathSettingsContainer.createRootContainer();
@@ -581,22 +586,22 @@ public class PerFileSettingsCalculator {
rcSet.internalSetSettingsMap(createExtsSetSettingsMap(rootData));
// rcSet.fExtToExtsSetMap = new HashMap();
// rcSet.fExtsSetToExtsSetSettingsMap = new HashMap();
-
+
CResourceData[] rcDatas = data.getResourceDatas();
CResourceData rcData;
RcSetSettings curRcSet;
HashMap<ExtsSet, ExtsSetSettings> fileMap;
ExtsSetSettings fileSetting;
IPath path;
-
+
for(int i = 0; i < rcDatas.length; i++){
rcData = rcDatas[i];
if(rcData == rootData)
continue;
-
+
if(!includeRcDataInCalculation(data, rcData))
continue;
-
+
path = rcData.getPath();
curRcSet = rcSet.createChild(path, rcData, false);
if(rcData.getType() == ICSettingBase.SETTING_FILE){
@@ -608,14 +613,14 @@ public class PerFileSettingsCalculator {
curRcSet.internalSetSettingsMap(createExtsSetSettingsMap((CFolderData)rcData));
}
}
-
+
return rcSet;
}
-
+
protected boolean includeRcDataInCalculation(CConfigurationData cfgData, CResourceData rcData){
return true;
}
-
+
protected CFileData createFileData(CConfigurationData cfgData, IPath path, CFileData base) throws CoreException{
return cfgData.createFileData(path, base);
}
@@ -636,7 +641,7 @@ public class PerFileSettingsCalculator {
checkRemoveDups(rcSet);
return rcSet;
}
-
+
/*
* utility method for creating empty IRcSettingInfo
*/
@@ -646,7 +651,7 @@ public class PerFileSettingsCalculator {
addEmptyLanguageInfos(rcInfo, lDatas);
return rcInfo;
}
-
+
private static void addEmptyLanguageInfos(RcSettingInfo rcInfo, CLanguageData[] lDatas){
ArrayList<ILangSettingInfo> list = rcInfo.fLangInfoList;
if(list == null){
@@ -655,12 +660,12 @@ public class PerFileSettingsCalculator {
} else {
list.ensureCapacity(lDatas.length);
}
-
+
for(int i = 0; i < lDatas.length; i++){
list.add(new LangSettingInfo(lDatas[i], PathInfo.EMPTY_INFO));
}
}
-
+
private IRcSettingInfo[] mapFileDiscoveredInfo(IProject project, CConfigurationData data, RcSetSettings rcSet, PathFilePathInfo[] pfpis){
// IResource rc;
PathInfo pInfo;
@@ -673,7 +678,7 @@ public class PerFileSettingsCalculator {
CLanguageData lData;
ArrayList<ILangSettingInfo> tmpList;
PathFilePathInfo pfpi;
-
+
for(int i = 0; i < pfpis.length; i++){
pfpi = pfpis[i];
projRelPath = pfpi.fPath;
@@ -699,19 +704,19 @@ public class PerFileSettingsCalculator {
kinds |= ICLanguageSettingEntry.MACRO_FILE;
if(symbolMap.size() != 0)
kinds |= ICLanguageSettingEntry.MACRO;
-
+
rcInfo = null;
for(int k = 0; k < lDatas.length; k++){
lData = lDatas[k];
if((lData.getSupportedEntryKinds() & kinds) == 0)
continue;
-
+
if(rcInfo == null){
rcInfo = new RcSettingInfo(rootData);
tmpList = new ArrayList<ILangSettingInfo>(lDatas.length - k);
rcInfo.fLangInfoList = tmpList;
}
-
+
lInfo = new LangSettingInfo(lData, pInfo);
rcInfo.add(lInfo);
}
@@ -724,7 +729,7 @@ public class PerFileSettingsCalculator {
// switch(rc.getType()){
// case IResource.FILE:
// projRelPath = rc.getProjectRelativePath();
-// dataSetting = rcSet.getChild(projRelPath, false);
+// dataSetting = rcSet.getChild(projRelPath, false);
// rcData = dataSetting.fRcData;
rcData = rcSet.getChild(projRelPath, false).fRcData;
if(!rcData.getPath().equals(projRelPath)){
@@ -743,20 +748,20 @@ public class PerFileSettingsCalculator {
} catch (CoreException e) {
rcData = null;
ManagedBuilderCorePlugin.log(e);
- }
+ }
}
// if(rcData != null)
// dataSetting = rcSet.createChild(projRelPath, rcData, false);
// else
// dataSetting = null;
}
-
+
if(rcData != null){
if(rcData.getType() == ICSettingBase.SETTING_FILE){
lData = ((CFileData)rcData).getLanguageData();
} else {
lData = CDataUtil.findLanguagDataForFile(projRelPath.lastSegment(), project, (CFolderData)rcData);
-
+
}
if(lData != null){
@@ -775,7 +780,7 @@ public class PerFileSettingsCalculator {
}
return list.toArray(new RcSettingInfo[list.size()]);
}
-
+
public IRcSettingInfo[] getSettingInfos(IProject project, CConfigurationData data, IDiscoveredPathManager.IPerFileDiscoveredPathInfo2 discoveredInfo, boolean fileDataMode){
if(fileDataMode){
RcSetSettings rcSettings = createRcSetInfo(data);
@@ -785,7 +790,7 @@ public class PerFileSettingsCalculator {
RcSetSettings settings = createRcSetSettings(data, discoveredInfo);
return createInfos(data, settings);
}
-
+
private IRcSettingInfo[] createInfos(CConfigurationData data, RcSetSettings rootSetting){
RcSetSettings settings[] = rootSetting.getChildren(true);
RcSetSettings setting;
@@ -814,7 +819,7 @@ public class PerFileSettingsCalculator {
continue;
}
}
-
+
if(rcData.getType() == ICSettingBase.SETTING_FILE){
ExtsSetSettings extSetting = setting.fExtToExtsSetMap.get(getFileExt(rcData.getPath()));
if(extSetting != null){
@@ -837,17 +842,17 @@ public class PerFileSettingsCalculator {
for (ExtsSetSettings extSetting : values) {
if(extSetting.fMaxMatchInfo == null)
continue;
-
+
if(extSetting.fBaseLangData == null)
continue;
-
+
if(extSetting.fIsDerived){
throw new IllegalStateException();
}
-
-
+
+
rcInfo.add(new LangSettingInfo(extSetting.fBaseLangData, extSetting.fMaxMatchInfo));
-
+
if(extSetting.isMultiple()){
Set<Entry<PathInfo, List<PathFilePathInfo>>> entrySet = extSetting.fPathFilePathInfoMap.entrySet();
for (Entry<PathInfo, List<PathFilePathInfo>> entry : entrySet) {
@@ -874,18 +879,18 @@ public class PerFileSettingsCalculator {
}
}
// }
-
+
return resultList.toArray(new RcSettingInfo[resultList.size()]);
}
-
+
private CFolderData createFolderData(CConfigurationData cfg, CResourceData base, RcSetSettings setting) throws CoreException{
if(base.getType() == ICSettingBase.SETTING_FOLDER)
return createFolderData(cfg, setting.getPath(), (CFolderData)base);
-
+
//should not be here
throw new IllegalStateException();
}
-
+
private static void checkRemoveDups(RcSetSettings rcSet){
RcSetSettings settings[] = rcSet.getChildren(true);
RcSetSettings setting, parent;
@@ -893,21 +898,21 @@ public class PerFileSettingsCalculator {
setting = settings[i];
if(!setting.fIsDerived)
continue;
-
+
parent = setting.getParent();
if(parent == null)
continue;
-
+
if(parent.containsEqualMaxMatches(setting, true))
removeChildAddingChildSettings(parent, setting);
}
}
-
+
private static void removeChildAddingChildSettings(RcSetSettings parent, RcSetSettings child){
parent.internalAddSettingsMap(child.fExtsSetToExtsSetSettingsMap);
parent.removeChild(child);
}
-
+
private static void mapDiscoveredInfo(RcSetSettings rcSet, PathFilePathInfo[] pInfos){
PathFilePathInfo pInfo;
RcSetSettings child, parent;
@@ -929,8 +934,8 @@ public class PerFileSettingsCalculator {
child.internalSetSettingsMap(createEmptyExtSetMapCopy(parent.fExtsSetToExtsSetSettingsMap));
}
}
- }
-
+ }
+
// isDerived = child.fIsDerived;
if(pInfo.fPath.segmentCount() == 0){
@@ -947,21 +952,21 @@ public class PerFileSettingsCalculator {
}
}
}
-
+
private static void processProjectPaths(RcSetSettings rcSet, PathFilePathInfo pfpi){
Collection<ExtsSetSettings> settings = rcSet.fExtsSetToExtsSetSettingsMap.values();
for (ExtsSetSettings setting : settings) {
setting.add(pfpi);
}
}
-
+
private static String getFileExt(IPath path){
String ext = path.getFileExtension();
if(ext != null)
return ext;
return ""; //$NON-NLS-1$
}
-
+
private static HashMap<ExtsSet, ExtsSetSettings> createEmptyExtSetMapCopy(HashMap<ExtsSet, ExtsSetSettings> base){
@SuppressWarnings("unchecked")
HashMap<ExtsSet, ExtsSetSettings> map = (HashMap<ExtsSet, ExtsSetSettings>)base.clone();
@@ -974,7 +979,7 @@ public class PerFileSettingsCalculator {
}
return map;
}
-
+
private static ExtsSetSettings createExtsSetSettings(IPath path, CFileData data){
CLanguageData lData = data.getLanguageData();
if(lData != null){
@@ -983,7 +988,7 @@ public class PerFileSettingsCalculator {
}
return new ExtsSetSettings(null, new ExtsSet(EMPTY_STRING_ARRAY), false);
}
-
+
private static ExtsSetSettings createExtsSetSettings(CLanguageData lData, String exts[]){
return new ExtsSetSettings(lData, new ExtsSet(exts), false);
}
@@ -992,7 +997,7 @@ public class PerFileSettingsCalculator {
CLanguageData[] lDatas = data.getLanguageDatas();
HashMap<ExtsSet, ExtsSetSettings> map = new HashMap<ExtsSet, ExtsSetSettings>(lDatas.length);
ExtsSetSettings settings;
-
+
if(lDatas.length != 0) {
CLanguageData lData;
for( int i = 0; i < lDatas.length; i++){
@@ -1001,7 +1006,7 @@ public class PerFileSettingsCalculator {
map.put(settings.fExtsSet, settings);
}
}
-
+
return map;
}
@@ -1012,7 +1017,7 @@ public class PerFileSettingsCalculator {
ListIndexStore store = new ListIndexStore(10);
HashMap<PathInfo, PathInfo> infoMap = new HashMap<PathInfo, PathInfo>();
// LinkedHashMap result;
-
+
Set<Entry<IResource, PathInfo>> entrySet = map.entrySet();
for (Entry<IResource, PathInfo> entry : entrySet) {
rc = entry.getKey();
@@ -1023,17 +1028,17 @@ public class PerFileSettingsCalculator {
// path = path.removeFirstSegments(1);
// segCount--;
-
+
info = entry.getValue();
storedInfo = infoMap.get(info);
if(storedInfo == null){
storedInfo = info;
infoMap.put(storedInfo, storedInfo);
}
-
+
store.add(segCount, new PathFilePathInfo(path, storedInfo));
}
-
+
List<PathFilePathInfo> lists[] = store.getLists();
// result = new LinkedHashMap(map.size());
// List l;
@@ -1054,7 +1059,7 @@ public class PerFileSettingsCalculator {
for(int i = 0; i < lists.length; i++){
size += lists[i].size();
}
-
+
infos = new PathFilePathInfo[size];
int num = 0;
int listSize;
@@ -1066,7 +1071,7 @@ public class PerFileSettingsCalculator {
infos[num++] = list.get(k);
}
}
-
+
return infos;
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/jobs/CfgSCJobsUtil.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/jobs/CfgSCJobsUtil.java
index 75189bdab4..5595066b75 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/jobs/CfgSCJobsUtil.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/jobs/CfgSCJobsUtil.java
@@ -28,7 +28,7 @@ import org.eclipse.core.runtime.Platform;
/**
* Utility class for build and job related functionality
- *
+ *
* @author vhirsl
*/
public class CfgSCJobsUtil {
@@ -48,7 +48,7 @@ public class CfgSCJobsUtil {
public void set(boolean rc) {
this.rc = rc;
}
-
+
@Override
public String toString() {
return rc ? "true" : "false"; //$NON-NLS-1$ //$NON-NLS-2$
@@ -89,16 +89,18 @@ public class CfgSCJobsUtil {
if (esiProvider != null) {
ISafeRunnable runnable = new ISafeRunnable() {
- public void run() {
+ @Override
+ public void run() {
esiProvider.invokeProvider(monitor, project, context.toInfoContext(), providerId, buildInfo, collector, env);
rc.set(true);
}
-
- public void handleException(Throwable exception) {
+
+ @Override
+ public void handleException(Throwable exception) {
rc.set(false);
ManagedBuilderCorePlugin.log(exception);
}
-
+
};
Platform.run(runnable);
}
@@ -127,7 +129,7 @@ public class CfgSCJobsUtil {
// get the collector
// if(context == null)
// context = ScannerConfigUtil.createContextForProject(project);
-
+
if(profileInstance == null){
profileInstance = ScannerConfigProfileManager.getInstance().
getSCProfileInstance(project, context.toInfoContext(), buildInfo.getSelectedProfileId());
@@ -137,12 +139,14 @@ public class CfgSCJobsUtil {
final IScannerInfoCollector2 collector2 = (IScannerInfoCollector2) collector;
ISafeRunnable runnable = new ISafeRunnable() {
- public void run() throws Exception {
+ @Override
+ public void run() throws Exception {
collector2.updateScannerConfiguration(monitor);
rc.set(true);
}
-
- public void handleException(Throwable exception) {
+
+ @Override
+ public void handleException(Throwable exception) {
rc.set(false);
ManagedBuilderCorePlugin.log(exception);
}
@@ -150,7 +154,7 @@ public class CfgSCJobsUtil {
};
Platform.run(runnable);
}
-
+
return rc.get();
}
@@ -169,25 +173,27 @@ public class CfgSCJobsUtil {
if (buildInfo.isBuildOutputFileActionEnabled()) {
ISafeRunnable runnable = new ISafeRunnable() {
-
- public void run() {
+
+ @Override
+ public void run() {
esiProvider.invokeProvider(monitor, project, context.toInfoContext(), null, buildInfo, collector, env);
rc.set(true);
}
-
- public void handleException(Throwable exception) {
+
+ @Override
+ public void handleException(Throwable exception) {
rc.set(false);
ManagedBuilderCorePlugin.log(exception);
}
-
+
};
Platform.run(runnable);
}
-
+
if(rc.get())
return profileInstance;
return null;
-
+
}
/**
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig2/CfgScannerConfigInfoFactory2.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig2/CfgScannerConfigInfoFactory2.java
index 9f5b640dfb..1ef7c4dae8 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig2/CfgScannerConfigInfoFactory2.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig2/CfgScannerConfigInfoFactory2.java
@@ -37,7 +37,6 @@ import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
import org.eclipse.cdt.managedbuilder.internal.dataprovider.BuildConfigurationData;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.QualifiedName;
@@ -47,12 +46,12 @@ public class CfgScannerConfigInfoFactory2 {
private static class ContainerInfo{
int fCode;
IScannerConfigBuilderInfo2Set fContainer;
-
+
ContainerInfo(ICProjectDescription des, IScannerConfigBuilderInfo2Set container){
this.fCode = des.hashCode();
this.fContainer = container;
}
-
+
public boolean matches(ICProjectDescription des){
return des.hashCode() == fCode;
}
@@ -61,17 +60,19 @@ public class CfgScannerConfigInfoFactory2 {
private Configuration cfg;
private SoftReference<IScannerConfigBuilderInfo2Set> fContainer;
// private HashMap map;
-
+
CfgInfo(Configuration cfg){
this.cfg = cfg;
// init();
}
-
+
+ @Override
public CfgInfoContext[] getContexts() {
Map<CfgInfoContext, IScannerConfigBuilderInfo2> map = createMap();
return map.keySet().toArray(new CfgInfoContext[map.size()]);
}
+ @Override
public IScannerConfigBuilderInfo2 getInfo(CfgInfoContext context) {
return createMap().get(context);
// IScannerConfigBuilderInfo2 info = null;
@@ -83,17 +84,18 @@ public class CfgScannerConfigInfoFactory2 {
// } else {
// Tool tool = (Tool)context.getTool();
// if(tool != null)
-// info = tool.getScannerConfigInfo(context.getInputType());
+// info = tool.getScannerConfigInfo(context.getInputType());
//// else
//// info = getDefaultInfo();
// }
// return info;
}
+ @Override
public boolean isPerRcTypeDiscovery() {
return cfg.isPerRcTypeDiscovery();
}
-
+
private IScannerConfigBuilderInfo2Set getContainer() throws CoreException{
IScannerConfigBuilderInfo2Set container = fContainer != null ? fContainer.get() : null;
if(container == null){
@@ -121,13 +123,13 @@ public class CfgScannerConfigInfoFactory2 {
container = ScannerConfigProfileManager.createScannerConfigBuildInfo2Set(prefs, false);
}
}
-
+
if(fContainer == null) {
fContainer = new SoftReference<IScannerConfigBuilderInfo2Set>(container);
}
return container;
}
-
+
private Map<CfgInfoContext, IScannerConfigBuilderInfo2> createMap(){
HashMap<CfgInfoContext, IScannerConfigBuilderInfo2> map = new HashMap<CfgInfoContext, IScannerConfigBuilderInfo2>();
try{
@@ -137,16 +139,16 @@ public class CfgScannerConfigInfoFactory2 {
Map<InfoContext, IScannerConfigBuilderInfo2> baseMap = container.getInfoMap();
if(!isPerRcType){
// Discovery profile scope = configuration wide
-
+
CfgInfoContext c = new CfgInfoContext(cfg);
InfoContext baseContext = c.toInfoContext();
IScannerConfigBuilderInfo2 info = container.getInfo(baseContext);
-
+
if(info == null){
String id = cfg.getDiscoveryProfileId();
if(id == null)
id = CfgScannerConfigUtil.getFirstProfileId(cfg.getFilteredTools());
-
+
IScannerConfigBuilderInfo2 prefInfo = null;
if(!cfg.isPreference()){
IConfiguration prefCfg = ManagedBuildManager.getPreferenceConfiguration(false);
@@ -165,10 +167,10 @@ public class CfgScannerConfigInfoFactory2 {
info = container.createInfo(baseContext, prefInfo, prefInfo.getSelectedProfileId());
}
}
- map.put(new CfgInfoContext(cfg), info);
+ map.put(new CfgInfoContext(cfg), info);
} else {
// Discovery profile scope = per language
-
+
Map<CfgInfoContext, IScannerConfigBuilderInfo2> configMap = getConfigInfoMap(baseMap);
IResourceInfo[] rcInfos = cfg.getResourceInfos();
@@ -196,15 +198,15 @@ public class CfgScannerConfigInfoFactory2 {
// Scanner discovery options aren't settable on a file-per-file basis. Thus
// files with custom properties don't have a persisted entry in the config
- // info map; we create an ephemeral entry instead. We need to assign that file
- // the scanner profile that's used for non-custom files of the same
+ // info map; we create an ephemeral entry instead. We need to assign that file
+ // the scanner profile that's used for non-custom files of the same
// inputType/tool (and configuration, of course). Unfortunately, identifying
// a match is inefficient, but in practice, projects don't have tons of
// customized files. See Bug 354194
String id = null;
for (Entry<CfgInfoContext, IScannerConfigBuilderInfo2> entry : configMap.entrySet()) {
CfgInfoContext cfgInfoCxt = entry.getKey();
- if (match(cfgInfoCxt.getInputType(), context.getInputType()) &&
+ if (match(cfgInfoCxt.getInputType(), context.getInputType()) &&
match(cfgInfoCxt.getTool(), context.getTool().getSuperClass()) &&
cfgInfoCxt.getConfiguration().equals(context.getConfiguration())) {
id = entry.getValue().getSelectedProfileId();
@@ -213,7 +215,7 @@ public class CfgScannerConfigInfoFactory2 {
if (id == null) {
id = CfgScannerConfigUtil.getDefaultProfileId(context, true);
}
-
+
InfoContext baseContext = context.toInfoContext();
if(info == null){
if(id != null){
@@ -233,11 +235,11 @@ public class CfgScannerConfigInfoFactory2 {
// permanent and stagnant part of the project description. It was
// added to the container only so we could obtain an
// IScannerConfigBuilderInfo2. Now that we have the info object,
- // revert the container. See Bug 354194. Note that the permanent
- // entry for the project's root folder resource info gets created
- // by us shortly after project creation; thus we have to make an
+ // revert the container. See Bug 354194. Note that the permanent
+ // entry for the project's root folder resource info gets created
+ // by us shortly after project creation; thus we have to make an
// exception for that rcinfo.
- if (!(rcInfo instanceof IFolderInfo && rcInfo.getPath().isEmpty())) {
+ if (!(rcInfo instanceof IFolderInfo && rcInfo.getPath().isEmpty())) {
container.removeInfo(context.toInfoContext());
}
}
@@ -269,7 +271,7 @@ public class CfgScannerConfigInfoFactory2 {
}
}
}
-
+
if(!configMap.isEmpty()){
for (Entry<CfgInfoContext, IScannerConfigBuilderInfo2> entry : configMap.entrySet()) {
if(map.containsKey(entry.getKey()))
@@ -289,10 +291,10 @@ public class CfgScannerConfigInfoFactory2 {
return map;
}
-
+
private Map<CfgInfoContext, IScannerConfigBuilderInfo2> getConfigInfoMap(Map<InfoContext, IScannerConfigBuilderInfo2> baseMap){
Map<CfgInfoContext, IScannerConfigBuilderInfo2> map = new HashMap<CfgInfoContext, IScannerConfigBuilderInfo2>();
-
+
for (Entry<InfoContext, IScannerConfigBuilderInfo2> entry : baseMap.entrySet()) {
InfoContext baseContext = entry.getKey();
CfgInfoContext c = CfgInfoContext.fromInfoContext(cfg, baseContext);
@@ -305,14 +307,17 @@ public class CfgScannerConfigInfoFactory2 {
return map;
}
+ @Override
public Map<CfgInfoContext,IScannerConfigBuilderInfo2> getInfoMap() {
return createMap();
}
+ @Override
public void setPerRcTypeDiscovery(boolean on) {
cfg.setPerRcTypeDiscovery(on);
}
+ @Override
public IScannerConfigBuilderInfo2 applyInfo(CfgInfoContext context,
IScannerConfigBuilderInfo2 base) {
try {
@@ -326,7 +331,7 @@ public class CfgScannerConfigInfoFactory2 {
container.removeInfo(baseContext);
newInfo = getInfo(context);
}
-
+
return newInfo;
} catch (CoreException e) {
ManagedBuilderCorePlugin.log(e);
@@ -334,10 +339,12 @@ public class CfgScannerConfigInfoFactory2 {
return null;
}
+ @Override
public IConfiguration getConfiguration() {
return cfg;
}
+ @Override
public boolean isProfileSupported(CfgInfoContext context,
String profileId) {
if(!isPerRcTypeDiscovery())
@@ -374,7 +381,7 @@ public class CfgScannerConfigInfoFactory2 {
des.setSessionProperty(CONTAINER_INFO_PROPERTY, null);
}
}
-
+
public static void savePreference(IConfiguration cfg) throws CoreException{
ICfgScannerConfigBuilderInfo2Set container = ((Configuration)cfg).getCfgScannerConfigInfo();
if(container != null){
@@ -384,25 +391,25 @@ public class CfgScannerConfigInfoFactory2 {
}
}
}
-
+
private static boolean match(ITool t1, ITool t2){
if (t1 == null || t2 == null)
return false;
if (t1.getId().equals(t2.getId())) {
return true;
}
-
- return match(t1.getSuperClass(), t2.getSuperClass());
+
+ return match(t1.getSuperClass(), t2.getSuperClass());
}
-
+
private static boolean match(IInputType i1, IInputType i2){
if (i1 == null || i2 == null)
return false;
if (i1.getId().equals(i2.getId())) {
return true;
}
-
- return match(i1.getSuperClass(), i2.getSuperClass());
+
+ return match(i1.getSuperClass(), i2.getSuperClass());
}
-
+
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IResourceConfiguration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IResourceConfiguration.java
index 36304d7e71..f1101b84aa 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IResourceConfiguration.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IResourceConfiguration.java
@@ -13,13 +13,13 @@ package org.eclipse.cdt.managedbuilder.core;
import org.eclipse.core.resources.IResource;
/**
- * This class is a place to define build attributes of individual
- * resources that are different from the configuration as a whole. The
- * resourceConfiguration element can have multiple tool children. They
- * define the tool(s) to be used to build the specified resource. The
- * tool(s) can execute before, after, or instead of the default tool for
+ * This class is a place to define build attributes of individual
+ * resources that are different from the configuration as a whole. The
+ * resourceConfiguration element can have multiple tool children. They
+ * define the tool(s) to be used to build the specified resource. The
+ * tool(s) can execute before, after, or instead of the default tool for
* the resources (see the toolOrder attribute in the tool element).
- *
+ *
* @since 2.1
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
@@ -37,60 +37,63 @@ public interface IResourceConfiguration extends IResourceInfo {
public static final String DISABLE_RCBS_TOOL = "disable"; //$NON-NLS-1$
public static final int KIND_DISABLE_RCBS_TOOL = 4;
- //TODO: Set name and ID in the constructors to be
+ //TODO: Set name and ID in the constructors to be
// configuration-name#resource-path
-
+
/**
* Returns the configuration that is the parent of this resource configuration.
- *
+ *
* @return IConfiguration
*/
+ @Override
public IConfiguration getParent();
-
+
/**
* Returns whether the resource referenced by this element should be excluded
- * from builds of the parent configuration.
+ * from builds of the parent configuration.
* Returns <code>false</code> if the attribute was not specified.
- *
- * @return boolean
+ *
+ * @return boolean
*/
+ @Override
public boolean isExcluded();
-
+
/**
- * Returns the path of the project resource that this element references.
+ * Returns the path of the project resource that this element references.
* TODO: What is the format of the path? Absolute? Relative? Canonical?
*
- * @return String
+ * @return String
*/
public String getResourcePath();
-
+
/**
* Returns an integer constant representing the users desire for ordering the application of
* a resource custom build step tool.
*
- * @return int
+ * @return int
*/
public int getRcbsApplicability();
-
+
/**
- * Returns the list of tools currently defined for the project resource that
+ * Returns the list of tools currently defined for the project resource that
* this element references. Updates the String attribute toolsToInvoke.
*
- * @return String
+ * @return String
*/
public ITool[] getToolsToInvoke();
-
+
/**
* Sets the new value representing the users desire for ordering the application of
* a resource custom build step tool.
*/
public void setRcbsApplicability(int value);
-
+
/**
* Sets the "excluded" flag for the resource.
* If <code>true</code>, the project resource identified by the resoursePath
* attribute is excluded from the build of the parent configuration.
*/
+ @Override
public void setExclude(boolean excluded);
/**
@@ -99,34 +102,37 @@ public interface IResourceConfiguration extends IResourceInfo {
public void setResourcePath(String path);
/**
- * Returns <code>true</code> if this element has changes that need to
+ * Returns <code>true</code> if this element has changes that need to
* be saved in the project file, else <code>false</code>.
- *
- * @return boolean
+ *
+ * @return boolean
*/
+ @Override
public boolean isDirty();
-
+
/**
* Sets the element's "dirty" (have I been modified?) flag.
*/
+ @Override
public void setDirty(boolean isDirty);
/**
* Returns the list of tools associated with this resource configuration.
- *
+ *
* @return ITool[]
*/
+ @Override
public ITool[] getTools();
/**
- * Returns the tool in this resource configuration with the ID specified
- * in the argument, or <code>null</code>
- *
+ * Returns the tool in this resource configuration with the ID specified
+ * in the argument, or <code>null</code>
+ *
* @param id The ID of the requested tool
* @return ITool
*/
public ITool getTool(String id);
-
+
/**
* Removes the Tool from the Tool list and map
*/
@@ -139,83 +145,88 @@ public interface IResourceConfiguration extends IResourceInfo {
* @param Id The id for the new tool chain
* @param name The name for the new tool chain
* @param isExtensionElement Indicates whether this is an extension element or a managed project element
- *
+ *
* @return ITool
*/
public ITool createTool(ITool superClass, String Id, String name, boolean isExtensionElement);
/**
* Overrides the tool command for a tool defined in this resource configuration's tool.
- *
+ *
* @param tool The tool that will have its command modified
* @param command The command
*/
public void setToolCommand(ITool tool, String command);
-
+
/**
* Sets the value of a boolean option for this resource configuration.
- *
+ *
* @param parent The holder/parent of the option.
* @param option The option to change.
* @param value The value to apply to the option.
- *
+ *
* @return IOption The modified option. This can be the same option or a newly created option.
- *
+ *
* @since 3.0 - The type of parent has changed from ITool to IHoldsOptions.
* Code assuming ITool as type, will continue to work unchanged.
*/
- public IOption setOption(IHoldsOptions parent, IOption option, boolean value)
- throws BuildException;
+ @Override
+ public IOption setOption(IHoldsOptions parent, IOption option, boolean value)
+ throws BuildException;
/**
* Sets the value of a string option for this resource configuration.
- *
+ *
* @param parent The holder/parent of the option.
* @param option The option that will be effected by change.
* @param value The value to apply to the option.
- *
+ *
* @return IOption The modified option. This can be the same option or a newly created option.
- *
+ *
* @since 3.0 - The type of parent has changed from ITool to IHoldsOptions.
* Code assuming ITool as type, will continue to work unchanged.
*/
+ @Override
public IOption setOption(IHoldsOptions parent, IOption option, String value)
throws BuildException;
-
+
/**
* Sets the value of a list option for this resource configuration.
- *
+ *
* @param parent The holder/parent of the option.
* @param option The option to change.
* @param value The values to apply to the option.
- *
+ *
* @return IOption The modified option. This can be the same option or a newly created option.
- *
+ *
* @since 3.0 - The type of parent has changed from ITool to IHoldsOptions.
* Code assuming ITool as type, will continue to work unchanged.
*/
+ @Override
public IOption setOption(IHoldsOptions parent, IOption option, String[] value)
throws BuildException;
-
+
/**
* Returns the Eclipse project that owns the resource configuration.
- *
+ *
* @return IResource
*/
public IResource getOwner();
/**
* specifies whether the resource configuration is modified and needs rebuild
- *
+ *
* @return boolean
- */
+ */
+ @Override
public boolean needsRebuild();
/**
* sets the resource configuration rebuild state
*/
+ @Override
void setRebuildState(boolean rebuild);
-
+
void setTools(ITool[] tools);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IToolReference.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IToolReference.java
index 18a92806df..7e1a1beb46 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IToolReference.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IToolReference.java
@@ -16,22 +16,22 @@ import org.eclipse.cdt.managedbuilder.internal.core.OptionReference;
/**
* @deprecated This class was deprecated in 2.1
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
@Deprecated
public interface IToolReference extends ITool {
-
+
/**
- * Answers a reference to the option. If the reference does not exist,
- * a new reference is created.
+ * Answers a reference to the option. If the reference does not exist,
+ * a new reference is created.
*/
public OptionReference createOptionReference(IOption option);
-
+
/**
* Answers the list of option references contained in the receiver.
- *
+ *
* @return List
*/
public List<OptionReference> getOptionReferenceList();
@@ -43,30 +43,33 @@ public interface IToolReference extends ITool {
/**
* Answers <code>true</code> if the receiver ahs been modified in any way.
- *
+ *
* @return boolean
*/
+ @Override
public boolean isDirty();
-
+
/**
- * Answers <code>true</code> if the reference is a reference to the
+ * Answers <code>true</code> if the reference is a reference to the
* tool specified in the argument.
- *
+ *
* @param tool the tool that should be tested
* @return boolean
*/
public boolean references(ITool tool);
-
+
/**
* @param isDirty The value to set the dirty flag to in the receiver
*/
+ @Override
public void setDirty(boolean isDirty);
/**
* Set the tool command in the receiver to be the argument.
- *
+ *
* @return <code>true</code> if the command is changed, else <code>false</code>
*/
+ @Override
public boolean setToolCommand(String cmd);
/*
@@ -74,19 +77,19 @@ public interface IToolReference extends ITool {
* to retrieve the actual value of attributes. These routines do not go to the
* referenced Tool for a value if the ToolReference does not have a value.
*/
-
+
/**
* Answers all of the output extensions that the receiver can build.
- *
+ *
* @return String
*/
public String getRawOutputExtensions();
-
+
/**
- * Answers the argument that must be passed to a specific tool in order to
- * control the name of the output artifact. For example, the GCC compile and
- * linker use '-o', while the archiver does not.
- *
+ * Answers the argument that must be passed to a specific tool in order to
+ * control the name of the output artifact. For example, the GCC compile and
+ * linker use '-o', while the archiver does not.
+ *
* @return String
*/
public String getRawOutputFlag();
@@ -97,10 +100,10 @@ public interface IToolReference extends ITool {
* @return String
*/
public String getRawOutputPrefix();
-
+
/**
* Answers the command-line invocation defined for the receiver.
- *
+ *
* @return String
*/
public String getRawToolCommand();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
index 1c058f564a..7c3d89a536 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
@@ -143,7 +143,7 @@ import org.w3c.dom.ProcessingInstruction;
/**
* This is the main entry point for getting at the build information
* for the managed build system.
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
@@ -257,16 +257,19 @@ public class ManagedBuildManager extends AbstractCExtension {
private static Map<IProject, IManagedBuildInfo> fInfoMap = new HashMap<IProject, IManagedBuildInfo>();
private static ISorter fToolChainSorter = new ISorter(){
+ @Override
public void sort() {
resortToolChains();
}
};
private static ISorter fToolSorter = new ISorter(){
+ @Override
public void sort() {
resortTools();
}
};
private static ISorter fBuilderSorter = new ISorter(){
+ @Override
public void sort() {
resortBuilders();
}
@@ -280,6 +283,7 @@ public class ManagedBuildManager extends AbstractCExtension {
static {
getEnvironmentVariableProvider().subscribe(
fEnvironmentBuildPathsChangeListener = new IEnvironmentBuildPathsChangeListener(){
+ @Override
public void buildPathsChanged(IConfiguration configuration, int buildPathType){
// if(buildPathType == IEnvVarBuildPath.BUILDPATH_INCLUDE){
// initializePathEntries(configuration,null);
@@ -415,7 +419,7 @@ public class ManagedBuildManager extends AbstractCExtension {
public static SortedMap<String, ? extends IToolChain> getExtensionToolChainMap() {
return getExtensionToolChainMapInternal();
}
-
+
public static IToolChain[] getExtensionToolChains() {
return getExtensionToolChainMapInternal().values().toArray(new ToolChain[extensionToolChainMap.size()]);
}
@@ -440,7 +444,7 @@ public class ManagedBuildManager extends AbstractCExtension {
public static SortedMap<String, ? extends ITool> getExtensionToolMap() {
return getExtensionToolMapInternal();
}
-
+
public static ITool[] getExtensionTools() {
return getExtensionToolMapInternal().values().toArray(new Tool[extensionToolMap.size()]);
}
@@ -475,7 +479,7 @@ public class ManagedBuildManager extends AbstractCExtension {
public static SortedMap<String, ? extends IBuilder> getExtensionBuilderMap() {
return getExtensionBuilderMapInternal();
}
-
+
public static IBuilder[] getExtensionBuilders() {
return getExtensionBuilderMapInternal().values().toArray(new Builder[extensionBuilderMap.size()]);
}
@@ -563,7 +567,7 @@ public class ManagedBuildManager extends AbstractCExtension {
/**
* @return the base extension configuration from the manifest (plugin.xml)
* or {@code null} if not found.
- *
+ *
* @since 8.0
*/
public static IConfiguration getExtensionConfiguration(IConfiguration cfg) {
@@ -732,7 +736,7 @@ public class ManagedBuildManager extends AbstractCExtension {
/**
* @param resource to find the target
* @param id - ID of the target
- *
+ *
* @return the result of a best-effort search to find a target with the
* specified ID, or {@code null} if one is not found.
*/
@@ -819,7 +823,7 @@ public class ManagedBuildManager extends AbstractCExtension {
/**
* Gets the currently selected target. This is used while the project
* property pages are displayed.
- *
+ *
* @return target configuration.
*/
public static IConfiguration getSelectedConfiguration(IProject project) {
@@ -1327,6 +1331,7 @@ public class ManagedBuildManager extends AbstractCExtension {
if (shell != null) {
final String exceptionMsg = err.getMessage();
shell.getDisplay().syncExec( new Runnable() {
+ @Override
public void run() {
MessageDialog.openError(shell,
ManagedMakeMessages.getResourceString("ManagedBuildManager.error.write_failed_title"), //$NON-NLS-1$
@@ -2152,6 +2157,7 @@ public class ManagedBuildManager extends AbstractCExtension {
final Shell shell = window.getShell();
final String errMsg = ManagedMakeMessages.getFormattedString(MANIFEST_VERSION_ERROR, extension.getUniqueIdentifier());
shell.getDisplay().asyncExec( new Runnable() {
+ @Override
public void run() {
MessageDialog.openError(shell,
ManagedMakeMessages.getResourceString("ManagedBuildManager.error.manifest_load_failed_title"), //$NON-NLS-1$
@@ -3512,7 +3518,7 @@ public class ManagedBuildManager extends AbstractCExtension {
/**
* Generic routine for checking the availability of converters for the given
* Build Object.
- *
+ *
* @return true if there are converters for the given Build Object.
* Returns false if there are no converters.
*/
@@ -3647,15 +3653,15 @@ public class ManagedBuildManager extends AbstractCExtension {
return superId + "." + suffix; //$NON-NLS-1$
}
-
+
private static int isInt(String s) {
- try {
+ try {
return Integer.parseInt(s);
} catch (NumberFormatException e) {
return 0;
}
}
-
+
/**
* @return base id when the given id was generated by {@link #calculateChildId(String, String)}.
* @since 8.0
@@ -3664,7 +3670,7 @@ public class ManagedBuildManager extends AbstractCExtension {
int index = id.lastIndexOf('.');
if (index<0)
return id;
-
+
String lastSeg = id.substring(index+1,id.length());
if (isInt(lastSeg)>0) {
String baseId = id.substring(0,index);
@@ -3672,7 +3678,7 @@ public class ManagedBuildManager extends AbstractCExtension {
}
return getIdFromIdAndVersion(id);
}
-
+
/**
* @return calculated relative path given the full path to a folder and a file
*/
@@ -4494,7 +4500,7 @@ public class ManagedBuildManager extends AbstractCExtension {
/**
* Build the specified build configurations.
- *
+ *
* @param configs - configurations to build
* @param builder - builder to retrieve build arguments
* @param monitor - progress monitor
@@ -4504,10 +4510,10 @@ public class ManagedBuildManager extends AbstractCExtension {
public static void buildConfigurations(IConfiguration[] configs, IBuilder builder, IProgressMonitor monitor, boolean allBuilders) throws CoreException{
buildConfigurations(configs, builder, monitor, allBuilders, IncrementalProjectBuilder.FULL_BUILD);
}
-
+
/**
* Build the specified build configurations.
- *
+ *
* @param configs - configurations to build
* @param builder - builder to retrieve build arguments
* @param monitor - progress monitor
@@ -4517,7 +4523,7 @@ public class ManagedBuildManager extends AbstractCExtension {
* <li>{@link IncrementalProjectBuilder#CLEAN_BUILD}</li>
* <li>{@link IncrementalProjectBuilder#INCREMENTAL_BUILD}</li>
* <li>{@link IncrementalProjectBuilder#FULL_BUILD}</li>
- *
+ *
* @since 7.0
*/
public static void buildConfigurations(IConfiguration[] configs, IBuilder builder, IProgressMonitor monitor,
@@ -4558,7 +4564,7 @@ public class ManagedBuildManager extends AbstractCExtension {
/**
* Build the specified build configurations for a given project.
- *
+ *
* @param project - project the configurations belong to
* @param configs - configurations to build
* @param builder - builder to retrieve build arguments
@@ -4569,7 +4575,7 @@ public class ManagedBuildManager extends AbstractCExtension {
* <li>{@link IncrementalProjectBuilder#CLEAN_BUILD}</li>
* <li>{@link IncrementalProjectBuilder#INCREMENTAL_BUILD}</li>
* <li>{@link IncrementalProjectBuilder#FULL_BUILD}</li>
- *
+ *
* @throws CoreException
*/
private static void buildConfigurations(final IProject project, final IConfiguration[] configs,
@@ -4581,6 +4587,7 @@ public class ManagedBuildManager extends AbstractCExtension {
*
* @see org.eclipse.core.resources.IWorkspaceRunnable#run(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
int ticks = 1;
if (buildKind==IncrementalProjectBuilder.CLEAN_BUILD) {
@@ -4591,18 +4598,18 @@ public class ManagedBuildManager extends AbstractCExtension {
ticks = ticks*configs.length;
}
monitor.beginTask(project.getName(), ticks);
-
+
if (buildKind==IncrementalProjectBuilder.CLEAN_BUILD) {
// It is not possible to pass arguments to clean() method of a builder
// So we iterate setting active configuration
IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(project);
IConfiguration savedCfg = buildInfo.getDefaultConfiguration();
-
+
try {
for (IConfiguration config : configs) {
if (monitor.isCanceled())
break;
-
+
buildInfo.setDefaultConfiguration(config);
buildProject(project, null, allBuilders, buildKind, monitor);
}
@@ -4621,13 +4628,13 @@ public class ManagedBuildManager extends AbstractCExtension {
private void buildProject(IProject project, Map<String, String> args, boolean allBuilders, int buildKind, IProgressMonitor monitor)
throws CoreException {
-
+
if (allBuilders) {
ICommand[] commands = project.getDescription().getBuildSpec();
for (ICommand command : commands) {
if (monitor.isCanceled())
break;
-
+
String builderName = command.getBuilderName();
Map<String, String> newArgs = null;
if (buildKind!=IncrementalProjectBuilder.CLEAN_BUILD) {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedCProjectNature.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedCProjectNature.java
index 49bd9fcd74..ec7daee160 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedCProjectNature.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedCProjectNature.java
@@ -38,7 +38,7 @@ public class ManagedCProjectNature implements IProjectNature {
/**
* Utility method for adding a managed nature to a project.
- *
+ *
* @param project the project to add the managed nature to.
* @param monitor a progress monitor to indicate the duration of the operation, or
* <code>null</code> if progress reporting is not required.
@@ -60,12 +60,12 @@ public class ManagedCProjectNature implements IProjectNature {
Vector<ICommand> vec = new Vector<ICommand>(Arrays.asList(commands));
vec.removeElementAt(i);
vec.trimToSize();
- ICommand[] tempCommands = vec.toArray(new ICommand[commands.length-1]);
+ ICommand[] tempCommands = vec.toArray(new ICommand[commands.length-1]);
description.setBuildSpec(tempCommands);
break;
}
}
-
+
commands = description.getBuildSpec();
boolean found = false;
// See if the builder is already there
@@ -75,7 +75,7 @@ public class ManagedCProjectNature implements IProjectNature {
break;
}
}
- if (!found) {
+ if (!found) {
//add builder to project
ICommand command = description.newCommand();
command.setBuilderName(getBuilderID());
@@ -85,12 +85,12 @@ public class ManagedCProjectNature implements IProjectNature {
newCommands[0] = command;
description.setBuildSpec(newCommands);
project.setDescription(description, null);
- }
+ }
}
/**
* Utility method for adding a nature to a project.
- *
+ *
* @param project the project to add the nature to.
* @param natureId the id of the nature to assign to the project
* @param monitor a progress monitor to indicate the duration of the operation, or
@@ -109,7 +109,7 @@ public class ManagedCProjectNature implements IProjectNature {
description.setNatureIds(newNatures);
project.setDescription(description, monitor);
}
-
+
/**
* Update the Java command in the build spec (replace existing one if present,
* add one first if none).
@@ -139,7 +139,7 @@ public class ManagedCProjectNature implements IProjectNature {
description.setBuildSpec(newCommands);
return description;
}
-
+
public static ICommand getBuildSpec(IProjectDescription description, String builderID) {
ICommand[] commands = description.getBuildSpec();
for (int i = 0; i < commands.length; ++i) {
@@ -164,6 +164,7 @@ public class ManagedCProjectNature implements IProjectNature {
/* (non-Javadoc)
* @see org.eclipse.core.resources.IProjectNature#configure()
*/
+ @Override
public void configure() throws CoreException {
addManagedBuilder(project, new NullProgressMonitor());
}
@@ -171,6 +172,7 @@ public class ManagedCProjectNature implements IProjectNature {
/* (non-Javadoc)
* @see org.eclipse.core.resources.IProjectNature#deconfigure()
*/
+ @Override
public void deconfigure() throws CoreException {
// TODO remove builder from here
}
@@ -178,6 +180,7 @@ public class ManagedCProjectNature implements IProjectNature {
/* (non-Javadoc)
* @see org.eclipse.core.resources.IProjectNature#getProject()
*/
+ @Override
public IProject getProject() {
// Just return the project associated with the nature
return project;
@@ -186,10 +189,10 @@ public class ManagedCProjectNature implements IProjectNature {
/**
* Utility method to remove the managed nature from a project.
- *
+ *
* @param project to remove the managed nature from
- * @param mon progress monitor to indicate the duration of the operation, or
- * <code>null</code> if progress reporting is not required.
+ * @param mon progress monitor to indicate the duration of the operation, or
+ * <code>null</code> if progress reporting is not required.
*/
public static void removeManagedNature(IProject project, IProgressMonitor mon) throws CoreException {
removeNature(project, MNG_NATURE_ID, mon);
@@ -197,7 +200,7 @@ public class ManagedCProjectNature implements IProjectNature {
/**
* Utility method for removing a project nature from a project.
- *
+ *
* @param project the project to remove the nature from
* @param natureId the nature id to remove
* @param monitor a progress monitor to indicate the duration of the operation, or
@@ -215,6 +218,7 @@ public class ManagedCProjectNature implements IProjectNature {
/* (non-Javadoc)
* @see org.eclipse.core.resources.IProjectNature#setProject(org.eclipse.core.resources.IProject)
*/
+ @Override
public void setProject(IProject project) {
// Set the project for the nature
this.project = project;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedOptionValueHandler.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedOptionValueHandler.java
index d1d2a26161..cf081b242f 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedOptionValueHandler.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedOptionValueHandler.java
@@ -26,57 +26,58 @@ public class ManagedOptionValueHandler implements
* E N A B L E U S E A S B A S E C L A S S A N D
* D E F A U L T I M P L E M E N T A T I O N
*/
-
+
private static ManagedOptionValueHandler mbsValueHandler;
-
- protected ManagedOptionValueHandler() {
+
+ protected ManagedOptionValueHandler() {
mbsValueHandler = null;
}
-
+
public static ManagedOptionValueHandler getManagedOptionValueHandler() {
if( mbsValueHandler == null ) {
mbsValueHandler = new ManagedOptionValueHandler();
}
return mbsValueHandler;
}
-
+
/*
* D E F A U L T I M P L E M E N T A T I O N S O F I N T E R F A C E
*/
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedOptionValueHandler#handleValue(IConfiguration,IToolChain,IOption,String,int)
*/
- public boolean handleValue(IBuildObject configuration,
- IHoldsOptions holder,
+ @Override
+ public boolean handleValue(IBuildObject configuration,
+ IHoldsOptions holder,
IOption option,
String extraArgument, int event)
{
/*
- // The following is for debug purposes and thus normally commented out
+ // The following is for debug purposes and thus normally commented out
String configLabel = "???"; //$NON-NLS-1$
String holderLabel = "???"; //$NON-NLS-1$
String eventLabel = "???"; //$NON-NLS-1$
-
+
if (configuration instanceof IConfiguration) {
configLabel = "IConfiguration"; //$NON-NLS-1$
} else if (configuration instanceof IResourceConfiguration) {
configLabel = "IResourceConfiguration"; //$NON-NLS-1$
}
-
+
if (holder instanceof IToolChain) {
holderLabel = "IToolChain"; //$NON-NLS-1$
} else if (holder instanceof ITool) {
holderLabel = "ITool"; //$NON-NLS-1$
}
-
+
switch (event) {
case EVENT_OPEN: eventLabel = "EVENT_OPEN"; break; //$NON-NLS-1$
case EVENT_APPLY: eventLabel = "EVENT_APPLY"; break; //$NON-NLS-1$
case EVENT_SETDEFAULT: eventLabel = "EVENT_SETDEFAULT"; break; //$NON-NLS-1$
case EVENT_CLOSE: eventLabel = "EVENT_CLOSE"; break; //$NON-NLS-1$
}
-
+
// Print the event
System.out.println(eventLabel + "(" + //$NON-NLS-1$
configLabel + " = " + //$NON-NLS-1$
@@ -87,7 +88,7 @@ public class ManagedOptionValueHandler implements
option.getId() + ", " + //$NON-NLS-1$
"String = " + //$NON-NLS-1$
extraArgument + ")"); //$NON-NLS-1$
- */
+ */
// The event was not handled, thus return false
return false;
}
@@ -95,6 +96,7 @@ public class ManagedOptionValueHandler implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedOptionValueHandler#isDefaultValue(IConfiguration,IToolChain,IOption,String)
*/
+ @Override
public boolean isDefaultValue(IBuildObject configuration, IHoldsOptions holder, IOption option, String extraArgument) {
// Get the default Value
Object defaultValue = option.getDefaultValue();
@@ -171,8 +173,9 @@ public class ManagedOptionValueHandler implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedOptionValueHandler#isEnumValueAppropriate(IConfiguration,IToolChain,IOption,String,String)
*/
- public boolean isEnumValueAppropriate(IBuildObject configuration,
- IHoldsOptions holder,
+ @Override
+ public boolean isEnumValueAppropriate(IBuildObject configuration,
+ IHoldsOptions holder,
IOption option,
String extraArgument, String enumValue)
{
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ResourceChangeHandler2.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ResourceChangeHandler2.java
index c4197fcf38..4d92f96c5e 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ResourceChangeHandler2.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ResourceChangeHandler2.java
@@ -42,9 +42,11 @@ import org.eclipse.core.runtime.jobs.Job;
class ResourceChangeHandler2 extends ResourceChangeHandlerBase{
private class RcMoveHandler implements IResourceMoveHandler {
+ @Override
public void done() {
}
+ @Override
public void handleProjectClose(IProject project) {
sendClose(project);
try {
@@ -53,6 +55,7 @@ class ResourceChangeHandler2 extends ResourceChangeHandlerBase{
}
}
+ @Override
public boolean handleResourceMove(IResource fromRc, IResource toRc) {
switch(fromRc.getType()){
case IResource.PROJECT:
@@ -67,6 +70,7 @@ class ResourceChangeHandler2 extends ResourceChangeHandlerBase{
return false;
}
+ @Override
public boolean handleResourceRemove(IResource rc) {
switch(rc.getType()){
case IResource.PROJECT:
@@ -80,13 +84,13 @@ class ResourceChangeHandler2 extends ResourceChangeHandlerBase{
return false;
}
}
-
+
@Override
protected IResourceMoveHandler createResourceMoveHandler(
IResourceChangeEvent event) {
return new RcMoveHandler();
}
-
+
public void sendClose(IProject project){
sendClose(ManagedBuildManager.getBuildInfo(project,false));
}
@@ -96,7 +100,7 @@ class ResourceChangeHandler2 extends ResourceChangeHandlerBase{
IManagedProject managedProj = info.getManagedProject();
if (managedProj != null) {
IConfiguration cfgs[] = managedProj.getConfigurations();
-
+
for(int i = 0; i < cfgs.length; i++)
ManagedBuildManager.performValueHandlerEvent(cfgs[i], IManagedOptionValueHandler.EVENT_CLOSE, true);
}
@@ -105,11 +109,12 @@ class ResourceChangeHandler2 extends ResourceChangeHandlerBase{
private static class Visitor implements IResourceDeltaVisitor {
private Set<IProject> fProjSet;
-
+
Visitor(Set<IProject> projSet){
fProjSet = projSet;
}
+ @Override
public boolean visit(IResourceDelta delta) throws CoreException {
IResource rc = delta.getResource();
switch (rc.getType()) {
@@ -129,7 +134,7 @@ class ResourceChangeHandler2 extends ResourceChangeHandlerBase{
if(checkNaturesNeedUpdate(cachedIds, natureIds)){
if(fProjSet == null)
fProjSet = new HashSet<IProject>();
-
+
fProjSet.add(project);
break;
}
@@ -141,17 +146,17 @@ class ResourceChangeHandler2 extends ResourceChangeHandlerBase{
return false;
}
}
-
+
Set<IProject> getProjSet(){
return fProjSet;
}
-
+
}
-
+
private static boolean checkNaturesNeedUpdate(String[] oldIds, String[] newIds){
if(oldIds == null)
return true;
-
+
Set<String> oldSet = new HashSet<String>(Arrays.asList(oldIds));
Set<String> oldSetCopy = new HashSet<String>(oldSet);
Set<String> newSet = new HashSet<String>(Arrays.asList(newIds));
@@ -162,14 +167,14 @@ class ResourceChangeHandler2 extends ResourceChangeHandlerBase{
|| newSet.contains(CProjectNature.C_NATURE_ID)
|| newSet.contains(CCProjectNature.CC_NATURE_ID))
return true;
-
+
return false;
}
-
+
@Override
public void resourceChanged(IResourceChangeEvent event) {
super.resourceChanged(event);
-
+
switch(event.getType()){
case IResourceChangeEvent.POST_CHANGE:
IResourceDelta delta = event.getDelta();
@@ -191,7 +196,7 @@ class ResourceChangeHandler2 extends ResourceChangeHandlerBase{
IWorkspace wsp = ResourcesPlugin.getWorkspace();
IWorkspaceRoot root = wsp.getRoot();
-
+
Job job = new Job(ManagedMakeMessages.getString("ResourceChangeHandler2.0")){ //$NON-NLS-1$
@Override
@@ -205,9 +210,9 @@ class ResourceChangeHandler2 extends ResourceChangeHandlerBase{
}
return Status.OK_STATUS;
}
-
+
};
-
+
job.setRule(root);
job.setSystem(true);
job.schedule();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IBuildEnvironmentVariable.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IBuildEnvironmentVariable.java
index 03133b1a81..e82ec8e4ab 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IBuildEnvironmentVariable.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IBuildEnvironmentVariable.java
@@ -13,7 +13,7 @@ package org.eclipse.cdt.managedbuilder.envvar;
import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
/**
- * this interface represents the given environment variable
+ * this interface represents the given environment variable
* @since 3.0
*/
public interface IBuildEnvironmentVariable extends IEnvironmentVariable{
@@ -23,20 +23,23 @@ public interface IBuildEnvironmentVariable extends IEnvironmentVariable{
public static final int ENVVAR_APPEND = IEnvironmentVariable.ENVVAR_APPEND;
/**
- *
+ *
* @return the variable name
*/
+ @Override
public String getName();
/**
- *
+ *
* @return the variable value
*/
+ @Override
public String getValue();
/**
* @return one of the IBuildEnvironmentVariable.ENVVAR_* operation types
*/
+ @Override
public int getOperation();
/**
@@ -44,28 +47,29 @@ public interface IBuildEnvironmentVariable extends IEnvironmentVariable{
* the delimiter that is used to separate values. This information is used for the following:
*
* 1. in append and prepend operations:
- * If the variable already exists and contains some value the new
+ * If the variable already exists and contains some value the new
* value will be calculated in the following way:
* For the "prepend" operation:
* <New value> = <the value from the getValue() method><delimiter><Old value>
* For the "append" operation:
* <New value> = <Old value><delimiter><the value from the getValue() method>
- *
- * The Environment Variable Provider will also remove the duplicates of "sub-values"
- * in the resulting value.
+ *
+ * The Environment Variable Provider will also remove the duplicates of "sub-values"
+ * in the resulting value.
* For example:
- * If the current value is "string1:string2:string3", the getDelimiter() method returns ":"
+ * If the current value is "string1:string2:string3", the getDelimiter() method returns ":"
* and getValue() method returns "string4:string2" the new value will contain:
* For the "prepend" operation: "string4:string2:string1:string3"
* For the "append" operation: "string1:string3:string4:string2"
- *
- * 2. Since the environment variables are also treated as build macros the delimiter is also used
+ *
+ * 2. Since the environment variables are also treated as build macros the delimiter is also used
* by the BuildMacroProvider to determine the type of the macro used to represent the
* given environment variable. If the variable has the delimiter it is treated as the Text-List macro
* otherwise it is treated as the Text macro. (See Build Macro design for more details)
- *
+ *
* To specify that no delimiter should be used, the getDelimiter() method should
* return null or an empty string
*/
+ @Override
public String getDelimiter();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildCommand.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildCommand.java
index 4c369639fb..5a783ca54b 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildCommand.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildCommand.java
@@ -24,20 +24,21 @@ public class BuildCommand implements IBuildCommand {
private String fArgs[];
private Map<String, String> fEnv;
private IPath fCWD;
-
+
public BuildCommand(IPath cmd, String args[], Map<String, String> env, IPath cwd, BuildStep step){
fCmd = cmd;
if(args != null)
fArgs = args.clone();
if(env != null)
fEnv = new HashMap<String, String>(env);
-
+
fCWD = cwd;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildCommand#getCommand()
*/
+ @Override
public IPath getCommand() {
return fCmd;
}
@@ -45,6 +46,7 @@ public class BuildCommand implements IBuildCommand {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildCommand#getArgs()
*/
+ @Override
public String[] getArgs() {
if(fArgs != null)
return fArgs.clone();
@@ -54,6 +56,7 @@ public class BuildCommand implements IBuildCommand {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildCommand#getEnvironment()
*/
+ @Override
public Map<String, String> getEnvironment() {
if(fEnv != null)
return new HashMap<String, String>(fEnv);
@@ -63,6 +66,7 @@ public class BuildCommand implements IBuildCommand {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildCommand#getCWD()
*/
+ @Override
public IPath getCWD() {
return fCWD;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescription.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescription.java
index b760a86912..ebc71db1a4 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescription.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescription.java
@@ -12,7 +12,6 @@
package org.eclipse.cdt.managedbuilder.internal.buildmodel;
import java.net.URI;
-import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@@ -167,6 +166,7 @@ public class BuildDescription implements IBuildDescription {
fPostProcessMode = postProcess;
}
+ @Override
public boolean visit(IResourceProxy proxy) throws CoreException {
try {
if(proxy.getType() == IResource.FILE){
@@ -240,6 +240,7 @@ public class BuildDescription implements IBuildDescription {
}
+ @Override
public boolean visit(IResourceDelta delta) throws CoreException {
if(fPostProcessMode)
return postProcessVisit(delta);
@@ -294,6 +295,7 @@ public class BuildDescription implements IBuildDescription {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IStepVisitor#visit(org.eclipse.cdt.managedbuilder.builddescription.IBuildStep)
*/
+ @Override
public int visit(IBuildStep a) throws CoreException {
BuildStep action = (BuildStep)a;
BuildResource rcs[] = (BuildResource[])action.getInputResources();
@@ -692,6 +694,7 @@ public class BuildDescription implements IBuildDescription {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildDescription#getInputStep()
*/
+ @Override
public IBuildStep getInputStep() {
return fInputStep;
}
@@ -699,6 +702,7 @@ public class BuildDescription implements IBuildDescription {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildDescription#getOutputStep()
*/
+ @Override
public IBuildStep getOutputStep() {
return fOutputStep;
}
@@ -1037,7 +1041,7 @@ public class BuildDescription implements IBuildDescription {
}
/**
- * Turns a filesystem location into a URI using the project as the hint for the
+ * Turns a filesystem location into a URI using the project as the hint for the
* URI metadata.
* @param location toString() is used as the URI path
* @return URI representing the location or null
@@ -1456,6 +1460,7 @@ public class BuildDescription implements IBuildDescription {
return location;
}
+ @Override
public IBuildResource getBuildResource(IPath location) {
return getBuildResource(getURIForLocation(location));
}
@@ -1463,10 +1468,11 @@ public class BuildDescription implements IBuildDescription {
private IBuildResource getBuildResource(URI locationURI) {
return fLocationToRcMap.get(locationURI);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildDescription#getResources()
*/
+ @Override
public IBuildResource[] getResources(){
return fLocationToRcMap.values().toArray(new IBuildResource[0]);
}
@@ -1484,6 +1490,7 @@ public class BuildDescription implements IBuildDescription {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildDescription#getConfiguration()
*/
+ @Override
public IConfiguration getConfiguration() {
return fCfg;
}
@@ -1747,26 +1754,32 @@ public class BuildDescription implements IBuildDescription {
}
depCalc = new IManagedDependencyCalculator(){
+ @Override
public IPath[] getAdditionalTargets() {
return null;
}
+ @Override
public IPath[] getDependencies() {
return paths;
}
+ @Override
public IBuildObject getBuildContext() {
return bof;
}
+ @Override
public IPath getSource() {
return rc.getLocation();
}
+ @Override
public ITool getTool() {
return tool;
}
+ @Override
public IPath getTopBuildDirectory() {
return getTopBuildDirectory();
}
@@ -2172,14 +2185,17 @@ public class BuildDescription implements IBuildDescription {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildDescription#getDefaultBuildDirLocation()
*/
+ @Override
public IPath getDefaultBuildDirLocation() {
return getTopBuildDirLocation();
}
+ @Override
public URI getDefaultBuildDirLocationURI() {
return getTopBuildDirLocationURI();
}
+ @Override
public IPath getDefaultBuildDirFullPath() {
return getTopBuildDirFullPath();
}
@@ -2206,6 +2222,7 @@ public class BuildDescription implements IBuildDescription {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildDescription#getSteps()
*/
+ @Override
public IBuildStep[] getSteps() {
return fStepList.toArray(new BuildStep[fStepList.size()]);
}
@@ -2213,6 +2230,7 @@ public class BuildDescription implements IBuildDescription {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.buildmodel.IBuildDescription#findBuildResource(org.eclipse.core.resources.IResource)
*/
+ @Override
public IBuildResource getBuildResource(IResource resource){
return getBuildResource(calcResourceLocation(resource));
}
@@ -2240,7 +2258,7 @@ public class BuildDescription implements IBuildDescription {
for (IResourceInfo rcInfo : fCfg.getResourceInfos()) {
// if(rcInfo.isExcluded())
// continue;
-
+
ToolInfoHolder h = getToolInfo(rcInfo.getPath(), true);
if(rcInfo instanceof IFolderInfo){
IFolderInfo fo = (IFolderInfo)rcInfo;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescriptionGnuMakefileGenerator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescriptionGnuMakefileGenerator.java
index 69d2867147..6d1cea095c 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescriptionGnuMakefileGenerator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescriptionGnuMakefileGenerator.java
@@ -43,22 +43,23 @@ public class BuildDescriptionGnuMakefileGenerator {
private static final String EQUALS = "="; //$NON-NLS-1$
private static final String VARREF_PREFIX = "${"; //$NON-NLS-1$
private static final String VARREF_SUFFIX = "}"; //$NON-NLS-1$
-
+
private static final String DOT_DOT_SLASH = "../"; //$NON-NLS-1$
private static final String DOT_DOT_BACKSLASH = "..\\"; //$NON-NLS-1$
-
+
private IBuildDescription fDes;
-
+
private class DescriptionVisitor implements IStepVisitor {
Writer fWriter;
DescriptionVisitor(Writer writer){
fWriter = writer;
}
-
+
+ @Override
public int visit(IBuildStep step) throws CoreException {
if(step == fDes.getInputStep() || step == fDes.getOutputStep())
return VISIT_CONTINUE;
-
+
try {
write(fWriter, step);
} catch (IOException e) {
@@ -67,14 +68,14 @@ public class BuildDescriptionGnuMakefileGenerator {
return VISIT_CONTINUE;
}
}
-
+
public BuildDescriptionGnuMakefileGenerator(IBuildDescription des){
fDes = des;
}
-
+
public void store(OutputStream stream) throws CoreException{
Writer writer = createWriter(stream);
-
+
try {
writer.write(VAR_SOURCES);
writer.write(EQUALS);
@@ -96,18 +97,18 @@ public class BuildDescriptionGnuMakefileGenerator {
writeRuleHeader(writer, ALL, IN_STEP_RULE + SPACE + OUT_STEP_RULE);
writer.write(LINE_SEPARATOR);
writer.write(LINE_SEPARATOR);
-
+
write(writer, fDes.getOutputStep());
write(writer, fDes.getInputStep());
BuildDescriptionManager.accept(new DescriptionVisitor(writer), fDes, true);
-
+
writer.flush();
} catch (IOException e) {
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), ManagedMakeMessages.getString("BuildDescriptionGnuMakefileGenerator.1"), e)); //$NON-NLS-1$
}
-
+
}
protected Writer createWriter(OutputStream stream){
@@ -117,9 +118,9 @@ public class BuildDescriptionGnuMakefileGenerator {
ManagedBuilderCorePlugin.log(e1);
}
return new OutputStreamWriter(stream);
-
+
}
-
+
protected String createVarRef(String var){
return new StringBuffer().append(VARREF_PREFIX).append(var).append(VARREF_SUFFIX).toString();
}
@@ -140,26 +141,26 @@ public class BuildDescriptionGnuMakefileGenerator {
target = toString(outputs);
deps = toString(inputs);
}
-
+
writeRuleHeader(writer, target, deps);
-
+
IBuildCommand[] cmds = step.getCommands(null, null, null, true);
for(int i = 0; i < cmds.length; i++){
String cmdStr = toString(cmds[i]);
writeCommand(writer, cmdStr);
}
-
+
writer.write(LINE_SEPARATOR);
writer.write(LINE_SEPARATOR);
}
-
+
protected void writeCommand(Writer writer, String cmd) throws IOException{
writer.write(TAB);
writer.write(cmd);
writer.write(LINE_SEPARATOR);
}
-
+
protected String toString(IBuildCommand cmd){
StringBuffer buf = new StringBuffer();
buf.append(cmd.getCommand());
@@ -170,7 +171,7 @@ public class BuildDescriptionGnuMakefileGenerator {
}
return removeDotDotSlashesAndBackSlashesHack(buf.toString());
}
-
+
protected void writeRuleHeader(Writer writer, String target, String deps) throws IOException{
writer.write(target);
writer.write(TARGET_SEPARATOR);
@@ -178,18 +179,18 @@ public class BuildDescriptionGnuMakefileGenerator {
writer.write(deps);
writer.write(LINE_SEPARATOR);
}
-
+
protected String toString(IBuildResource[] rcs){
StringBuffer buf = new StringBuffer();
for(int i = 0; i < rcs.length; i++){
if(i != 0)
buf.append(SPACE);
buf.append(toString(rcs[i]));
-
+
}
return buf.toString();
}
-
+
protected String toString(IBuildResource rc){
return removeDotDotSlashesAndBackSlashesHack(BuildDescriptionManager.getRelPath(fDes.getDefaultBuildDirLocation(), rc.getLocation()).toString());
}
@@ -218,7 +219,7 @@ public class BuildDescriptionGnuMakefileGenerator {
}
return str;
}
-
+
private String removeDotDotBackslashes(String str){
int index = str.indexOf(DOT_DOT_BACKSLASH, 0);
if(index != -1){
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildIOType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildIOType.java
index fbb595244d..4ac398a5bd 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildIOType.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildIOType.java
@@ -51,10 +51,12 @@ public class BuildIOType implements IBuildIOType {
((BuildDescription)fStep.getBuildDescription()).typeCreated(this);
}
+ @Override
public IBuildResource[] getResources() {
return fResources.toArray(new BuildResource[fResources.size()]);
}
+ @Override
public IBuildStep getStep() {
return fStep;
}
@@ -66,14 +68,14 @@ public class BuildIOType implements IBuildIOType {
DbgUtil.trace("resource " + DbgUtil.resourceName(rc) + " added as " //$NON-NLS-1$ //$NON-NLS-2$
+ (fIsInput ? "input" : "output") //$NON-NLS-1$ //$NON-NLS-2$
+ " to the action " + DbgUtil.stepName(fStep)); //$NON-NLS-1$
-
+
((BuildDescription)fStep.getBuildDescription()).resourceAddedToType(this, rc);
}
-
+
public void removeResource(BuildResource rc){
fResources.remove(rc);
rc.removeFromArg(this);
-
+
if(DbgUtil.DEBUG)
DbgUtil.trace("resource " + DbgUtil.resourceName(rc) + " removed as " //$NON-NLS-1$ //$NON-NLS-2$
+ (fIsInput ? "input" : "output") //$NON-NLS-1$ //$NON-NLS-2$
@@ -82,16 +84,17 @@ public class BuildIOType implements IBuildIOType {
((BuildDescription)fStep.getBuildDescription()).resourceRemovedFromType(this, rc);
}
+ @Override
public boolean isInput() {
return fIsInput;
}
-
+
public boolean isPrimary(){
return fIsPrimary;
}
-
+
public String getLinkId(){
- if(!fIsInput && fStep.getTool() != null && /*(fLinkId == null || fLinkId.length() == 0) && */
+ if(!fIsInput && fStep.getTool() != null && /*(fLinkId == null || fLinkId.length() == 0) && */
fStep.getTool().getCustomBuildStep()){
IBuildResource rcs[] = getResources();
if(rcs.length != 0){
@@ -103,7 +106,7 @@ public class BuildIOType implements IBuildIOType {
} else {
}
}
-
+
}
return fLinkId;
}
@@ -111,14 +114,14 @@ public class BuildIOType implements IBuildIOType {
public IBuildObject getIoType(){
return fIoType;
}
-
+
BuildResource[] remove(){
BuildResource rcs[] = (BuildResource[])getResources();
-
+
for(int i = 0; i < rcs.length; i++){
removeResource(rcs[i]);
}
-
+
fStep = null;
return rcs;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildResource.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildResource.java
index aea988620e..af997d7ab4 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildResource.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildResource.java
@@ -31,7 +31,7 @@ public class BuildResource implements IBuildResource {
private BuildIOType fProducerArg;
private boolean fNeedsRebuild;
private boolean fIsRemoved;
- private IPath fFullWorkspacePath;
+ private IPath fFullWorkspacePath;
private boolean fIsProjectRc;
private BuildDescription fInfo;
private URI fLocationURI;
@@ -41,25 +41,26 @@ public class BuildResource implements IBuildResource {
}
protected BuildResource(BuildDescription info, IPath fullWorkspacePath, URI locationURI){
-
+
if(locationURI == null)
throw new IllegalArgumentException(); // must point to somewhere!
-
+
fLocationURI = locationURI;
-
+
fFullWorkspacePath = fullWorkspacePath;
fInfo = info;
-
+
fIsProjectRc = (fullWorkspacePath != null);
info.resourceCreated(this);
-
+
if(DbgUtil.DEBUG)
DbgUtil.trace("resource " + fullWorkspacePath + " created"); //$NON-NLS-1$ //$NON-NLS-2$
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildResource#getLocation()
*/
+ @Override
public IPath getLocation() {
if(fFullWorkspacePath == null) {
return new Path(fLocationURI.getPath());
@@ -69,7 +70,7 @@ public class BuildResource implements IBuildResource {
if(resource == null) {
return new Path(fLocationURI.getPath());
}
-
+
if(resource.getLocation() != null)
return resource.getLocation();
else
@@ -79,6 +80,7 @@ public class BuildResource implements IBuildResource {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildResource#getFullPath()
*/
+ @Override
public IPath getFullPath() {
return fFullWorkspacePath;
//return new Path(getLocationURI().getPath().toString());
@@ -87,6 +89,7 @@ public class BuildResource implements IBuildResource {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildResource#getProducerIOType()
*/
+ @Override
public IBuildIOType getProducerIOType() {
return fProducerArg;
}
@@ -94,6 +97,7 @@ public class BuildResource implements IBuildResource {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildResource#getDependentIOTypes()
*/
+ @Override
public IBuildIOType[] getDependentIOTypes() {
return fDepArgs.toArray(new BuildIOType[fDepArgs.size()]);
}
@@ -101,17 +105,19 @@ public class BuildResource implements IBuildResource {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildResource#needsRebuild()
*/
+ @Override
public boolean needsRebuild() {
return fNeedsRebuild;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildResource#isRemoved()
*/
+ @Override
public boolean isRemoved() {
return fIsRemoved;
}
-
+
public void setRemoved(boolean removed) {
if(DbgUtil.DEBUG){
if(removed)
@@ -121,7 +127,7 @@ public class BuildResource implements IBuildResource {
if(fIsRemoved)
fNeedsRebuild = false;
}
-
+
public void setRebuildState(boolean rebuild){
fNeedsRebuild = rebuild;
}
@@ -143,19 +149,19 @@ public class BuildResource implements IBuildResource {
String step1Name = DbgUtil.stepName(fProducerArg.getStep());
String step2Name = DbgUtil.stepName(arg.getStep());
String rcs[] = new String[]{rcName, step1Name, step2Name};
-
+
String externalizedErr = BuildModelMessages.getFormattedString("BuildResource.0", rcs); //$NON-NLS-1$
if(DbgUtil.DEBUG){
err = err + externalizedErr + "curent producer: " + DbgUtil.dumpStep(fProducerArg.getStep()) + "\n producer attempt: " + DbgUtil.dumpStep(arg.getStep()); //$NON-NLS-1$ //$NON-NLS-2$
}
-
-
+
+
throw new IllegalArgumentException(externalizedErr);
}
}
}
-
+
void removeFromArg(BuildIOType arg){
if(arg.isInput()){
fDepArgs.remove(arg);
@@ -166,43 +172,46 @@ public class BuildResource implements IBuildResource {
throw new IllegalArgumentException("Resource is not produced by this arg!!!"); //$NON-NLS-1$
}
}
-
+
+ @Override
public boolean isProjectResource() {
return fIsProjectRc;
}
-
+
BuildIOType[][] clear(){
BuildIOType types[][] = new BuildIOType[2][];
types[0] = new BuildIOType[1];
types[0][0] = fProducerArg;
BuildIOType outs[] = (BuildIOType[])getDependentIOTypes();
types[1] = outs;
-
+
if(fProducerArg != null)
fProducerArg.removeResource(this);
for(int i = 0; i < outs.length; i++){
outs[i].removeResource(this);
}
-
+
return types;
}
-
+
BuildIOType[][] remove(){
BuildIOType types[][] = clear();
-
+
if(DbgUtil.DEBUG)
DbgUtil.trace("resource " + DbgUtil.resourceName(this) + " removed"); //$NON-NLS-1$ //$NON-NLS-2$
-
+
fInfo.resourceRemoved(this);
fInfo = null;
-
+
return types;
}
-
+
+ @Override
public IBuildDescription getBuildDescription(){
return fInfo;
}
+ @Override
public IBuildStep[] getDependentSteps() {
Set<IBuildStep> set = new HashSet<IBuildStep>();
for(Iterator<BuildIOType> iter = fDepArgs.iterator(); iter.hasNext();){
@@ -211,6 +220,7 @@ public class BuildResource implements IBuildResource {
return set.toArray(new BuildStep[set.size()]);
}
+ @Override
public IBuildStep getProducerStep() {
if(fProducerArg != null)
return fProducerArg.getStep();
@@ -226,13 +236,14 @@ public class BuildResource implements IBuildResource {
buf.append("WSP|").append(fullPath); //$NON-NLS-1$
else
buf.append("FS|").append(getLocation()); //$NON-NLS-1$
-
+
return buf.toString();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.buildmodel.IBuildResource#getLocationURI()
*/
+ @Override
public URI getLocationURI() {
return fLocationURI;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildStateManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildStateManager.java
index 1128ee57a7..917a4f06a6 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildStateManager.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildStateManager.java
@@ -29,21 +29,25 @@ public class BuildStateManager {
private static final String PREFS_LOCATION = "buildState"; //$NON-NLS-1$
private static BuildStateManager fInstance;
-
+
private EventListener fListener;
-
+
private class ResourceMoveHandler implements IResourceMoveHandler {
+ @Override
public void done() {
}
+ @Override
public void handleProjectClose(IProject project) {
}
+ @Override
public boolean handleResourceMove(IResource fromRc, IResource toRc) {
return doHandleResourceRemove(fromRc);
}
+ @Override
public boolean handleResourceRemove(IResource rc) {
return doHandleResourceRemove(rc);
}
@@ -60,7 +64,7 @@ public class BuildStateManager {
return false;
}
}
-
+
private class EventListener extends ResourceChangeHandlerBase implements ICProjectDescriptionListener {
@Override
@@ -69,6 +73,7 @@ public class BuildStateManager {
//TODO: may handle resource changes as well
}
+ @Override
public void handleEvent(CProjectDescriptionEvent event) {
switch(event.getEventType()){
case CProjectDescriptionEvent.APPLIED:
@@ -78,11 +83,11 @@ public class BuildStateManager {
break;
}
}
-
+
private void processAppliedDelta(CProjectDescriptionEvent event, ICDescriptionDelta delta){
if(delta == null)
return;
-
+
IProjectBuildState pbs = null;
boolean apply = false;
switch (delta.getDeltaKind()) {
@@ -108,7 +113,7 @@ public class BuildStateManager {
default:
break;
}
-
+
if(pbs != null && apply){
setProjectBuildState(event.getProject(), pbs);
}
@@ -119,9 +124,9 @@ public class BuildStateManager {
IResourceChangeEvent event) {
return new ResourceMoveHandler();
}
-
+
}
-
+
private void removeProjectInfo(IProject project){
File f = getPrefsDir(project);
if(f.exists()){
@@ -132,22 +137,22 @@ public class BuildStateManager {
f.delete();
}
}
-
+
private BuildStateManager(){
}
-
+
public static BuildStateManager getInstance(){
if(fInstance == null)
fInstance = new BuildStateManager();
return fInstance;
}
-
+
public void startup(){
if(fListener == null){
fListener = new EventListener();
CoreModel.getDefault().getProjectDescriptionManager().addCProjectDescriptionListener(fListener, CProjectDescriptionEvent.APPLIED | CProjectDescriptionEvent.LOADED);
- ResourcesPlugin.getWorkspace().addResourceChangeListener(fListener,
- IResourceChangeEvent.POST_CHANGE
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(fListener,
+ IResourceChangeEvent.POST_CHANGE
| IResourceChangeEvent.PRE_DELETE
| IResourceChangeEvent.PRE_CLOSE);
}
@@ -167,7 +172,7 @@ public class BuildStateManager {
public void setProjectBuildState(IProject project, IProjectBuildState state){
((ProjectBuildState)state).serialize();
}
-
+
private IPath getPrefsDirPath(){
IPath path = ManagedBuilderCorePlugin.getDefault().getStateLocation();
path = path.append(PREFS_LOCATION);
@@ -179,7 +184,7 @@ public class BuildStateManager {
path = path.append(project.getName());
return path;
}
-
+
private File getPrefsDir(IProject project){
IPath path = getPrefsDirPath(project);
File file = path.toFile();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildStep.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildStep.java
index c91d170f2b..0142f707db 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildStep.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildStep.java
@@ -56,21 +56,22 @@ public class BuildStep implements IBuildStep {
private IInputType fInputType;
private ITool fLibTool;
private boolean fAssignToCalculated;
-
+
protected BuildStep(BuildDescription des, ITool tool, IInputType inputType){
fTool = tool;
fInputType = inputType;
fBuildDescription = des;
-
+
if(DbgUtil.DEBUG)
DbgUtil.trace("step " + DbgUtil.stepName(this) + " created"); //$NON-NLS-1$ //$NON-NLS-2$
-
+
des.stepCreated(this);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildStep#getInputIOTypes()
*/
+ @Override
public IBuildIOType[] getInputIOTypes() {
return fInputTypes.toArray(new BuildIOType[fInputTypes.size()]);
}
@@ -78,6 +79,7 @@ public class BuildStep implements IBuildStep {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildStep#getOutputIOTypes()
*/
+ @Override
public IBuildIOType[] getOutputIOTypes() {
return fOutputTypes.toArray(new BuildIOType[fOutputTypes.size()]);
}
@@ -85,65 +87,66 @@ public class BuildStep implements IBuildStep {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildStep#needsRebuild()
*/
+ @Override
public boolean needsRebuild() {
- if(fNeedsRebuild
+ if(fNeedsRebuild
|| (fTool != null && fTool.needsRebuild())
|| (fLibTool != null && fLibTool.needsRebuild()))
return true;
-
+
if(fBuildGroup != null && fBuildGroup.needsRebuild())
return true;
-
+
return false;
}
-
+
public void setRebuildState(boolean rebuild){
fNeedsRebuild = rebuild;
}
public BuildResource[] removeIOType(BuildIOType type) {
-
+
BuildResource rcs[] = type.remove();
-
+
if(type.isInput())
fInputTypes.remove(type);
else
fOutputTypes.remove(type);
-
+
return rcs;
}
-
+
BuildResource[][] remove(){
BuildResource[][] rcs = clear();
-
+
if(DbgUtil.DEBUG)
DbgUtil.trace("step " + DbgUtil.stepName(this) + " removed"); //$NON-NLS-1$ //$NON-NLS-2$
fBuildDescription.stepRemoved(this);
fBuildDescription = null;
-
+
return rcs;
}
-
+
BuildResource[][] clear(){
BuildResource[][] rcs = new BuildResource[2][];
rcs[0] = (BuildResource[])getInputResources();
rcs[1] = (BuildResource[])getOutputResources();
-
+
BuildIOType types[] = (BuildIOType[])getInputIOTypes();
for(int i = 0; i < types.length; i++){
removeIOType(types[i]);
}
-
+
types = (BuildIOType[])getOutputIOTypes();
for(int i = 0; i < types.length; i++){
removeIOType(types[i]);
}
-
+
return rcs;
}
-
+
public void removeResource(BuildIOType type, BuildResource rc, boolean rmTypeIfEmpty){
type.removeResource(rc);
if(rmTypeIfEmpty && type.getResources().length == 0){
@@ -159,27 +162,27 @@ public class BuildStep implements IBuildStep {
if(fBuildDescription.getOutputStep() == this)
throw new IllegalArgumentException("input step can not have outputs"); //$NON-NLS-1$
}
-
+
BuildIOType arg = new BuildIOType(this, input, primary, /*ext,*/ ioType);
if(input)
fInputTypes.add(arg);
else
fOutputTypes.add(arg);
-
+
return arg;
}
public void setTool(ITool tool){
fTool = tool;
}
-
+
public ITool getTool(){
return fTool;
}
-
+
public BuildIOType[] getPrimaryTypes(boolean input){
List<BuildIOType> types = input ? fInputTypes : fOutputTypes;
-
+
List<BuildIOType> list = new ArrayList<BuildIOType>();
for (BuildIOType arg : types) {
if(arg.isPrimary())
@@ -187,11 +190,11 @@ public class BuildStep implements IBuildStep {
}
return list.toArray(new BuildIOType[list.size()]);
}
-
+
public BuildIOType getIOTypeForType(IBuildObject ioType, boolean input){
List<BuildIOType> list = input ? fInputTypes : fOutputTypes;
-
- if(ioType != null){
+
+ if(ioType != null){
for (BuildIOType arg : list) {
if(arg.getIoType() == ioType)
return arg;
@@ -210,6 +213,7 @@ public class BuildStep implements IBuildStep {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildStep#getInputResources()
*/
+ @Override
public IBuildResource[] getInputResources() {
return getResources(true);
}
@@ -217,10 +221,11 @@ public class BuildStep implements IBuildStep {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildStep#getOutputResources()
*/
+ @Override
public IBuildResource[] getOutputResources() {
return getResources(false);
}
-
+
public IBuildResource[] getResources(boolean input){
List<BuildIOType> list = input ? fInputTypes : fOutputTypes;
Set<IBuildResource> set = new HashSet<IBuildResource>();
@@ -234,15 +239,16 @@ public class BuildStep implements IBuildStep {
return set.toArray(new BuildResource[set.size()]);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildStep#getCommands(org.eclipse.core.runtime.IPath, java.util.Map, java.util.Map, boolean)
*/
+ @Override
public IBuildCommand[] getCommands(IPath cwd, Map inputArgValues, Map outputArgValues, boolean resolveAll) {
if(cwd == null)
cwd = calcCWD();
-
+
if(fTool == null){
String step = null;
String appendToLastStep = null;
@@ -252,31 +258,31 @@ public class BuildStep implements IBuildStep {
step = fBuildDescription.getConfiguration().getPostbuildStep();
} else if(this == fBuildDescription.getCleanStep()){
step = fBuildDescription.getConfiguration().getCleanCommand();
-
+
IBuildResource[] generated = fBuildDescription.getResources(true);
if(generated.length != 0){
StringBuffer buf = new StringBuffer();
for(int i = 0; i < generated.length; i++){
buf.append(' ');
-
+
IPath rel = BuildDescriptionManager.getRelPath(cwd, generated[i].getLocation());
buf.append(rel.toString());
}
appendToLastStep = buf.toString();
}
}
-
+
if(step != null && (step = step.trim()).length() > 0){
step = resolveMacros(step, resolveAll);
if(step != null && (step = step.trim()).length() > 0){
String commands[] = step.split(";"); //$NON-NLS-1$
-
+
if(appendToLastStep != null && commands.length != 0){
commands[commands.length - 1] = commands[commands.length - 1] + appendToLastStep;
}
-
- List<IBuildCommand> list = new ArrayList<IBuildCommand>();
+
+ List<IBuildCommand> list = new ArrayList<IBuildCommand>();
for(int i = 0; i < commands.length; i++){
IBuildCommand cmds[] = createCommandsFromString(commands[i], cwd, getEnvironment());
for(int j = 0; j < cmds.length; j++){
@@ -288,10 +294,10 @@ public class BuildStep implements IBuildStep {
}
return new IBuildCommand[0];
}
-
-
+
+
performAsignToOption(cwd);
-
+
BuildResource inRc = getRcForMacros(true);
BuildResource outRc = getRcForMacros(false);
IPath inRcPath = inRc != null ? BuildDescriptionManager.getRelPath(cwd, inRc.getLocation()) : null;
@@ -302,19 +308,19 @@ public class BuildStep implements IBuildStep {
String outPrefix = fTool.getOutputPrefix();
outPrefix = resolveMacros(outPrefix, data, true);
outRcPath = rmNamePrefix(outRcPath, outPrefix);
-
- IManagedCommandLineInfo info = gen.generateCommandLineInfo(fTool,
+
+ IManagedCommandLineInfo info = gen.generateCommandLineInfo(fTool,
fTool.getToolCommand(),
- getCommandFlags(inRcPath, outRcPath, resolveAll),
- fTool.getOutputFlag(),
+ getCommandFlags(inRcPath, outRcPath, resolveAll),
+ fTool.getOutputFlag(),
outPrefix,
listToString(resourcesToStrings(cwd, getPrimaryResources(false), outPrefix), " "), //$NON-NLS-1$
- getInputResources(cwd, getPrimaryResources(true)),
+ getInputResources(cwd, getPrimaryResources(true)),
fTool.getCommandLinePattern());
return createCommandsFromString(resolveMacros(info.getCommandLine(), data, true), cwd, getEnvironment());
}
-
+
private IPath rmNamePrefix(IPath path, String prefix){
if(prefix != null && prefix.length() != 0){
String name = path.lastSegment();
@@ -325,10 +331,10 @@ public class BuildStep implements IBuildStep {
}
return path;
}
-
+
private String[] getInputResources(IPath cwd, BuildResource[] rcs) {
String[] resources = resourcesToStrings(cwd, rcs, null);
-
+
// also need to get libraries
String[] libs = null;
IOption[] opts = fTool.getOptions();
@@ -347,7 +353,7 @@ public class BuildStep implements IBuildStep {
} catch (BuildException e) {
}
}
-
+
if (libs != null) {
String[] irs = new String[resources.length + libs.length];
System.arraycopy(resources, 0, irs, 0, resources.length);
@@ -357,20 +363,20 @@ public class BuildStep implements IBuildStep {
return resources;
}
}
-
+
private IPath calcCWD(){
IPath cwd = fBuildDescription.getDefaultBuildDirLocation();
-
+
if(!cwd.isAbsolute())
cwd = fBuildDescription.getConfiguration().getOwner().getProject().getLocation().append(cwd);
-
+
return cwd;
}
protected Map<String, String> getEnvironment(){
return fBuildDescription.getEnvironment();
}
-
+
protected IBuildCommand[] createCommandsFromString(String cmd, IPath cwd, Map<String, String> env){
char arr[] = cmd.toCharArray();
char expect = 0;
@@ -379,7 +385,7 @@ public class BuildStep implements IBuildStep {
List<String> list = new ArrayList<String>();
StringBuffer buf = new StringBuffer();
for(int i = 0; i < arr.length; i++){
- char ch = arr[i];
+ char ch = arr[i];
switch(ch){
case '\'':
case '"':
@@ -411,40 +417,40 @@ public class BuildStep implements IBuildStep {
default:
buf.append(ch);
break;
-
+
}
prev = ch;
}
-
+
if(buf.length() > 0)
list.add(buf.toString());
-
+
IPath c = new Path(list.remove(0));
String[] args = list.toArray(new String[list.size()]);
-
+
return new IBuildCommand[]{new BuildCommand(c, args, env, cwd, this)};
}
-
+
private BuildResource[] getPrimaryResources(boolean input){
BuildIOType[] types = getPrimaryTypes(input);
if(types.length == 0)
types = input ? (BuildIOType[])getInputIOTypes() : (BuildIOType[])getOutputIOTypes();
List<BuildResource> list = new ArrayList<BuildResource>();
-
+
for(int i = 0; i < types.length; i++){
BuildResource [] rcs = (BuildResource[])types[i].getResources();
-
+
for(int j = 0; j < rcs.length; j++){
list.add(rcs[j]);
}
}
-
+
return list.toArray(new BuildResource[list.size()]);
}
-
+
private String[] resourcesToStrings(IPath cwd, BuildResource rcs[], String prefixToRm){
List<String> list = new ArrayList<String>(rcs.length);
-
+
for(int i = 0; i < rcs.length; i++){
IPath path = BuildDescriptionManager.getRelPath(cwd, rcs[i].getLocation());
path = rmNamePrefix(path, prefixToRm);
@@ -487,7 +493,7 @@ public class BuildStep implements IBuildStep {
private SupplierBasedCdtVariableSubstitutor createSubstitutor(IConfiguration cfg, IBuilder builder, IFileContextData fileData){
BuildMacroProvider prov = (BuildMacroProvider)ManagedBuildManager.getBuildMacroProvider();
- IMacroContextInfo info = prov.getMacroContextInfo(IBuildMacroProvider.CONTEXT_FILE, fileData);
+ IMacroContextInfo info = prov.getMacroContextInfo(IBuildMacroProvider.CONTEXT_FILE, fileData);
FileMacroExplicitSubstitutor sub = new FileMacroExplicitSubstitutor(
info,
cfg,
@@ -496,13 +502,13 @@ public class BuildStep implements IBuildStep {
return sub;
}
-
+
private String[] getCommandFlags(IPath inRcPath, IPath outRcPath, boolean resolveAll){
try {
if(resolveAll) {
IConfiguration cfg = getBuildDescription().getConfiguration();
IBuilder builder = cfg.getBuilder();
- return ((Tool)fTool).getToolCommandFlags(inRcPath, outRcPath,
+ return ((Tool)fTool).getToolCommandFlags(inRcPath, outRcPath,
createSubstitutor(cfg, builder,
new FileContextData(inRcPath, outRcPath, null, fTool)),
BuildMacroProvider.getDefault());
@@ -512,20 +518,20 @@ public class BuildStep implements IBuildStep {
}
return new String[0];
}
-
+
private String listToString(String[] list, String delimiter){
if(list == null || list.length == 0)
return new String();
StringBuffer buf = new StringBuffer(list[0]);
-
+
for(int i = 1; i < list.length; i++){
buf.append(delimiter).append(list[i]);
}
-
+
return buf.toString();
}
-
+
private BuildResource getRcForMacros(boolean input){
IBuildIOType types[] = getPrimaryTypes(input);
if(types.length != 0){
@@ -535,7 +541,7 @@ public class BuildStep implements IBuildStep {
return (BuildResource)rcs[0];
}
}
-
+
types = input ? getInputIOTypes() : getOutputIOTypes();
if(types.length != 0){
for(int i = 0; i < types.length; i++){
@@ -547,30 +553,32 @@ public class BuildStep implements IBuildStep {
return null;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildStep#isRemoved()
*/
+ @Override
public boolean isRemoved(){
return fIsRemoved;
}
-
+
public void setRemoved() {
fIsRemoved = true;
fNeedsRebuild = false;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildStep#getBuildDescription()
*/
+ @Override
public IBuildDescription getBuildDescription(){
return fBuildDescription;
}
-
+
boolean isMultiAction(){
BuildIOType args[] = getPrimaryTypes(true);
BuildIOType arg = args.length > 0 ? args[0] : null;
-
+
if(arg != null){
if(arg.getIoType() != null)
return ((IInputType)arg.getIoType()).getMultipleOfType();
@@ -578,33 +586,33 @@ public class BuildStep implements IBuildStep {
}
return false;
}
-
+
public IInputType getInputType(){
return fInputType;
}
-
+
public void setLibTool(ITool libTool){
fLibTool = libTool;
}
-
+
public ITool getLibTool(){
return fLibTool;
}
-
+
protected void performAsignToOption(IPath cwd){
if(fTool == null && !fAssignToCalculated)
return;
-
+
fAssignToCalculated = true;
IConfiguration cfg = fBuildDescription.getConfiguration();
-
+
for (BuildIOType bType : fInputTypes) {
IInputType type = (IInputType)bType.getIoType();
-
+
if(type == null)
continue;
-
+
IOption option = fTool.getOptionBySuperClassId(type.getOptionId());
IOption assignToOption = fTool.getOptionBySuperClassId(type.getAssignToOptionId());
if (assignToOption != null && option == null) {
@@ -619,7 +627,7 @@ public class BuildStep implements IBuildStep {
}
optVal += BuildDescriptionManager.getRelPath(cwd, bRcs[j].getLocation()).toOSString();
}
- ManagedBuildManager.setOption(cfg, fTool, assignToOption, optVal);
+ ManagedBuildManager.setOption(cfg, fTool, assignToOption, optVal);
} else if (
optType == IOption.STRING_LIST ||
optType == IOption.LIBRARIES ||
@@ -636,7 +644,7 @@ public class BuildStep implements IBuildStep {
optType == IOption.UNDEF_LIBRARY_PATHS ||
optType == IOption.UNDEF_LIBRARY_FILES ||
optType == IOption.UNDEF_MACRO_FILES){
- // Mote that when using the enumerated inputs, the path(s) must be translated from project relative
+ // Mote that when using the enumerated inputs, the path(s) must be translated from project relative
// to top build directory relative
String[] paths = new String[bRcs.length];
for (int j=0; j<bRcs.length; j++) {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/CommandBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/CommandBuilder.java
index f82d99f0b9..356f69259a 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/CommandBuilder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/CommandBuilder.java
@@ -30,14 +30,14 @@ import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.SubProgressMonitor;
/**
- *
+ *
* This class implements the IBuildCommand building
* To build the given command, create an instance of this class
* and invoke the build method
*
- * NOTE: This class is subject to change and discuss,
+ * NOTE: This class is subject to change and discuss,
* and is currently available in experimental mode only
- *
+ *
*/
public class CommandBuilder implements IBuildModelBuilder {
private static final String PATH_ENV = "PATH"; //$NON-NLS-1$
@@ -50,20 +50,20 @@ public class CommandBuilder implements IBuildModelBuilder {
private IBuildCommand fCmd;
private Process fProcess;
private String fErrMsg;
-
- private static final String BUILDER_MSG_HEADER = "InternalBuilder.msg.header"; //$NON-NLS-1$
- private static final String NEWLINE = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ private static final String BUILDER_MSG_HEADER = "InternalBuilder.msg.header"; //$NON-NLS-1$
+ private static final String NEWLINE = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
/*
* no need in this for now, Spawner is always used
- *
+ *
protected class SpawnerfreeLauncher extends CommandLauncher{
public Process execute(IPath commandPath, String[] args, String[] env, IPath changeToDirectory) {
try {
// add platform specific arguments (shell invocation)
fCommandArgs = constructCommandArray(commandPath.toOSString(), args);
- fProcess = Runtime.getRuntime().exec(fCommandArgs, env, changeToDirectory.toFile());
+ fProcess = Runtime.getRuntime().exec(fCommandArgs, env, changeToDirectory.toFile());
// ProcessFactory.getFactory().exec(fCommandArgs, env, changeToDirectory.toFile());
fErrorMessage = ""; //$NON-NLS-1$
} catch (IOException e) {
@@ -77,9 +77,9 @@ public class CommandBuilder implements IBuildModelBuilder {
/*
* a temporary work-around to resolve the bug#145099
* (https://bugs.eclipse.org/bugs/show_bug.cgi?id=145099)
- *
+ *
* this will be removed after fixing the bug#145737
- * (https://bugs.eclipse.org/bugs/show_bug.cgi?id=145737)
+ * (https://bugs.eclipse.org/bugs/show_bug.cgi?id=145737)
*/
private class CommandSearchLauncher extends CommandLauncher{
@@ -99,7 +99,7 @@ public class CommandBuilder implements IBuildModelBuilder {
return args;
}
-
+
@Override
protected void printCommandLine(OutputStream os) {
if (os != null) {
@@ -113,14 +113,14 @@ public class CommandBuilder implements IBuildModelBuilder {
}
}
}
-
+
protected class OutputStreamWrapper extends OutputStream {
private OutputStream fOut;
-
+
public OutputStreamWrapper(OutputStream out){
fOut = out;
}
-
+
@Override
public void write(int b) throws IOException {
fOut.write(b);
@@ -150,7 +150,7 @@ public class CommandBuilder implements IBuildModelBuilder {
public CommandBuilder(IBuildCommand cmd, IResourceRebuildStateContainer cr){
fCmd = cmd;
}
-
+
protected OutputStream wrap(OutputStream out){
return new OutputStreamWrapper(out);
}
@@ -158,13 +158,14 @@ public class CommandBuilder implements IBuildModelBuilder {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.internal.builddescription.IBuildDescriptionBuilder#build(java.io.OutputStream, java.io.OutputStream, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public int build(OutputStream out, OutputStream err,
IProgressMonitor monitor){
-
+
//TODO: should we display the command line here?
monitor.beginTask("", getNumCommands()); //$NON-NLS-1$
monitor.subTask(""/*getCommandLine()*/); //$NON-NLS-1$
-
+
ICommandLauncher launcher = createLauncher();
int status = STATUS_OK;
@@ -179,7 +180,7 @@ public class CommandBuilder implements IBuildModelBuilder {
monitor.done();
return STATUS_ERROR_LAUNCH;
}
-
+
if (fProcess != null) {
try {
// Close the input of the process since we will never write to it
@@ -187,7 +188,7 @@ public class CommandBuilder implements IBuildModelBuilder {
} catch (IOException e) {
}
}
-
+
//wrapping out and err streams to avoid their closure
int st = launcher.waitAndRead(wrap(out), wrap(err),
new SubProgressMonitor(monitor, getNumCommands()));
@@ -198,19 +199,19 @@ public class CommandBuilder implements IBuildModelBuilder {
break;
case ICommandLauncher.COMMAND_CANCELED:
status = STATUS_CANCELLED;
- fErrMsg = launcher.getErrorMessage();
+ fErrMsg = launcher.getErrorMessage();
if(DbgUtil.DEBUG)
DbgUtil.trace("command cancelled: " + fErrMsg); //$NON-NLS-1$
-
+
printMessage(fErrMsg, out);
break;
case ICommandLauncher.ILLEGAL_COMMAND:
default:
status = STATUS_ERROR_LAUNCH;
- fErrMsg = launcher.getErrorMessage();
+ fErrMsg = launcher.getErrorMessage();
if(DbgUtil.DEBUG)
DbgUtil.trace("error launching the command: " + fErrMsg); //$NON-NLS-1$
-
+
String program = fCmd.getCommand().toOSString();
String envPath = fCmd.getEnvironment().get(PATH_ENV);
if (envPath==null) {
@@ -226,32 +227,32 @@ public class CommandBuilder implements IBuildModelBuilder {
}
break;
}
-
+
monitor.done();
return status;
}
-
+
protected ICommandLauncher createLauncher() {
// if(isWindows())
// return new CommandLauncher();
return new CommandSearchLauncher();
}
-
+
public String getErrMsg(){
return fErrMsg;
}
-
+
private String[] mapToStringArray(Map<String, String> map){
if(map == null)
return null;
-
+
List<String> list = new ArrayList<String>();
-
+
Set<Entry<String, String>> entrySet = map.entrySet();
for (Entry<String, String> entry : entrySet) {
list.add(entry.getKey() + '=' + entry.getValue());
}
-
+
return list.toArray(new String[list.size()]);
}
@@ -268,7 +269,7 @@ public class CommandBuilder implements IBuildModelBuilder {
// ignore;
}
}
-
+
}
protected void printMessage(String msg, OutputStream os){
@@ -276,21 +277,21 @@ public class CommandBuilder implements IBuildModelBuilder {
msg = ManagedMakeMessages.getFormattedString(BUILDER_MSG_HEADER, msg);
printMessage(null, msg, os);
}
-
+
}
-
+
private void printErrorMessage(String msg, OutputStream os){
if (os != null) {
String errorPrefix = ManagedMakeMessages.getResourceString("ManagedMakeBuilder.error.prefix"); //$NON-NLS-1$
printMessage(errorPrefix, msg, os);
}
-
+
}
-
+
public int getNumCommands() {
return 1;
}
-
+
protected String getCommandLine() {
StringBuffer buf = new StringBuffer();
if (fCmd != null) {
@@ -310,7 +311,7 @@ public class CommandBuilder implements IBuildModelBuilder {
return command;
return searchExecutable(command, getPaths(environment));
}
-
+
private String[] getPaths(Map<String, String> env){
String pathsStr = env.get(PATH_ENV);
if(pathsStr == null){
@@ -324,23 +325,23 @@ public class CommandBuilder implements IBuildModelBuilder {
}
if(pathsStr != null){
String delimiter = getDelimiter();
-
+
return pathsStr.split(delimiter);
}
return null;
}
-
+
private String getDelimiter(){
String delimiter = System.getProperty(PROPERTY_DELIMITER);
if(delimiter == null)
delimiter = isWindows() ? DELIMITER_WINDOWS : DELIMITER_UNIX;
return delimiter;
}
-
+
private String searchExecutable(String command, String paths[]){
if(paths == null)
return null;
-
+
for(int i = 0; i < paths.length; i++){
File file = new File(paths[i], command.toString());
if(file.isFile())
@@ -348,7 +349,7 @@ public class CommandBuilder implements IBuildModelBuilder {
}
return null;
}
-
+
private boolean isWindows() {
String prop = System.getProperty(PROPERTY_OS_NAME);
return prop != null ? prop.toLowerCase().startsWith(PROPERTY_OS_VALUE) : false;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ConfigurationBuildState.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ConfigurationBuildState.java
index 95a6043cb9..12c3c8a319 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ConfigurationBuildState.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ConfigurationBuildState.java
@@ -27,34 +27,35 @@ public class ConfigurationBuildState implements IConfigurationBuildState {
private final static Integer REBUILD_STATE = new Integer(NEED_REBUILD);
private final static Integer REMOVED_STATE = new Integer(REMOVED);
private final static Integer NONE_STATE = new Integer(0);
-
+
private HashMap<Integer, Set<String>> fStateToPathListMap;
private Properties fPathToStateProps;
private String fCfgId;
private IProject fProject;
private int fState;
-
+
ConfigurationBuildState(IProject project, String cfgId){
fCfgId = cfgId;
fProject = project;
fState = NEED_REBUILD;
}
-
+
void setProject(IProject project){
fProject = project;
}
+ @Override
public IPath[] getFullPathsForState(int state) {
if(fStateToPathListMap == null)
return new IPath[0];
-
+
Set<String> set = fStateToPathListMap.get(new Integer(state));
if(set == null)
return new IPath[0];
return setToFullPaths(set);
}
-
+
private IPath[] setToFullPaths(Set<String> set){
IPath paths[] = new IPath[set.size()];
IPath path = fProject.getFullPath();
@@ -65,6 +66,7 @@ public class ConfigurationBuildState implements IConfigurationBuildState {
return paths;
}
+ @Override
public int getStateForFullPath(IPath fullPath) {
if(fPathToStateProps == null)
return 0;
@@ -78,12 +80,13 @@ public class ConfigurationBuildState implements IConfigurationBuildState {
return 0;
}
+ @Override
public void setStateForFullPath(IPath fullPath, int state) {
String str = fullPathToString(fullPath);
int cur = getStateForFullPath(fullPath);
if(cur == state)
return;
-
+
if(fPathToStateProps == null){
fPathToStateProps = new Properties();
fStateToPathListMap = new HashMap<Integer, Set<String>>();
@@ -92,7 +95,7 @@ public class ConfigurationBuildState implements IConfigurationBuildState {
Integer iState = stateToInt(strState);
if(iState == null)
throw new IllegalArgumentException();
-
+
if(cur != 0){
Set<String> set = fStateToPathListMap.get(new Integer(cur));
set.remove(str);
@@ -109,10 +112,10 @@ public class ConfigurationBuildState implements IConfigurationBuildState {
}
set.add(str);
} else {
- fPathToStateProps.remove(str);
+ fPathToStateProps.remove(str);
}
}
-
+
private String fullPathToString(IPath fullPath){
return fullPath.removeFirstSegments(1).toString();
}
@@ -134,7 +137,7 @@ public class ConfigurationBuildState implements IConfigurationBuildState {
}
list.add((String)entry.getKey());
}
-
+
//TODO: trim lists
if(map.size() != 0){
fStateToPathListMap = map;
@@ -142,7 +145,7 @@ public class ConfigurationBuildState implements IConfigurationBuildState {
}
fState = 0;
}
-
+
public void store(OutputStream oStream) throws IOException{
if(fPathToStateProps != null)
fPathToStateProps.store(oStream, ""); //$NON-NLS-1$
@@ -154,7 +157,7 @@ public class ConfigurationBuildState implements IConfigurationBuildState {
// public void store(Properties props){
// if(fStateToPathListMap == null)
// return;
-//
+//
// for(Iterator iter = fStateToPathListMap.entrySet().iterator(); iter.hasNext();){
// Map.Entry entry = (Map.Entry)iter.next();
// String propValue = stateToString((Integer)entry.getKey());
@@ -184,28 +187,32 @@ public class ConfigurationBuildState implements IConfigurationBuildState {
return state.toString();
}
+ @Override
public int getState() {
return fState;
}
+ @Override
public void setState(int state) {
fState = state;
clear();
}
-
+
private void clear(){
fPathToStateProps = null;
fStateToPathListMap = null;
}
+ @Override
public String getConfigurationId() {
return fCfgId;
}
+ @Override
public IProject getProject() {
return fProject;
}
-
+
public boolean exists(){
return fState == 0;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DefaultBuildDescriptionFactory.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DefaultBuildDescriptionFactory.java
index 117a9f4039..bde693fcea 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DefaultBuildDescriptionFactory.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DefaultBuildDescriptionFactory.java
@@ -20,7 +20,7 @@ import org.eclipse.core.runtime.CoreException;
public class DefaultBuildDescriptionFactory implements IBuildDescriptionFactory {
static private DefaultBuildDescriptionFactory fInstance;
protected DefaultBuildDescriptionFactory(){
-
+
}
public static DefaultBuildDescriptionFactory getInstance(){
@@ -28,10 +28,11 @@ public class DefaultBuildDescriptionFactory implements IBuildDescriptionFactory
fInstance = new DefaultBuildDescriptionFactory();
return fInstance;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildDescriptionFactory#createBuildDescription(org.eclipse.cdt.managedbuilder.core.IConfiguration, org.eclipse.core.resources.IResourceDelta, int)
*/
+ @Override
public IBuildDescription createBuildDescription(IConfiguration cfg, IResourceDelta delta, int flags) throws CoreException {
return createBuildDescription(cfg, null, delta, flags);
}
@@ -48,10 +49,11 @@ public class DefaultBuildDescriptionFactory implements IBuildDescriptionFactory
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildDescriptionFactory#getSupportedMethods()
*/
+ @Override
public int getSupportedMethods() {
- return BuildDescriptionManager.REMOVED
- | BuildDescriptionManager.REBUILD
- | BuildDescriptionManager.DEPFILES
+ return BuildDescriptionManager.REMOVED
+ | BuildDescriptionManager.REBUILD
+ | BuildDescriptionManager.DEPFILES
| BuildDescriptionManager.DEPS;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DescriptionBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DescriptionBuilder.java
index ea9966e500..77fb344e98 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DescriptionBuilder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DescriptionBuilder.java
@@ -28,20 +28,20 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
/**
- *
+ *
* This class implements the IBuildDescription building,
- * that is the build of the entire configuration/project
+ * that is the build of the entire configuration/project
* To perform a build, create an instance of this class
* and invoke the build method
*
- * NOTE: This class is subject to change and discuss,
+ * NOTE: This class is subject to change and discuss,
* and is currently available in experimental mode only
- *
+ *
*/
public class DescriptionBuilder implements IBuildModelBuilder {
private static final String BUILDER_MSG_HEADER = "InternalBuilder.msg.header"; //$NON-NLS-1$
private static final String BUILDER_NOTHING_TODO = "InternalBuilder.nothing.todo"; //$NON-NLS-1$
- private static final String LINE_SEPARATOR = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ private static final String LINE_SEPARATOR = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
private IBuildDescription fDes;
@@ -52,7 +52,7 @@ public class DescriptionBuilder implements IBuildModelBuilder {
private int fNumCommands = -1;
private GenDirInfo fDir;
private IResourceRebuildStateContainer fRebuildStateContainer;
-
+
private class BuildStepVisitor implements IStepVisitor{
private OutputStream fOut;
private OutputStream fErr;
@@ -71,14 +71,15 @@ public class DescriptionBuilder implements IBuildModelBuilder {
fStatus = STATUS_OK;
fBuild = build;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IStepVisitor#visit(org.eclipse.cdt.managedbuilder.builddescription.IBuildStep)
*/
+ @Override
public int visit(IBuildStep action) throws CoreException {
if(fMonitor.isCanceled())
return VISIT_STOP;
-
+
if(DbgUtil.DEBUG)
DbgUtil.trace("visiting step " + DbgUtil.stepName(action)); //$NON-NLS-1$
if(!action.isRemoved()
@@ -86,7 +87,7 @@ public class DescriptionBuilder implements IBuildModelBuilder {
if(DbgUtil.DEBUG)
DbgUtil.trace("step " + DbgUtil.stepName(action) + " needs rebuild" ); //$NON-NLS-1$ //$NON-NLS-2$
StepBuilder builder = getStepBuilder(action);//new StepBuilder(action, fCWD, fResumeOnErrs, fDir);
-
+
if(fBuild){
switch(builder.build(fOut, fErr, new SubProgressMonitor(fMonitor, builder.getNumCommands()))){
case STATUS_OK:
@@ -97,20 +98,20 @@ public class DescriptionBuilder implements IBuildModelBuilder {
case STATUS_ERROR_BUILD:
case STATUS_ERROR_LAUNCH:
default:
- fStatus = STATUS_ERROR_BUILD;
+ fStatus = STATUS_ERROR_BUILD;
break;
}
} else {
fNumCommands += builder.getNumCommands();
}
}
-
- if(fStatus != STATUS_CANCELLED
+
+ if(fStatus != STATUS_CANCELLED
&& (fResumeOnErrs || fStatus == STATUS_OK))
return VISIT_CONTINUE;
return VISIT_STOP;
}
-
+
}
public DescriptionBuilder(IBuildDescription des, IResourceRebuildStateContainer rs){
@@ -131,27 +132,28 @@ public class DescriptionBuilder implements IBuildModelBuilder {
fBuildIncrementaly = buildIncrementaly;
fResumeOnErrs = resumeOnErrs;
fDir = new GenDirInfo(fDes.getConfiguration());
-
+
if(fCWD == null)
fCWD = fDes.getDefaultBuildDirLocation();
-
+
fRebuildStateContainer = rs;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.internal.builddescription.IBuildDescriptionBuilder#build(java.io.OutputStream, java.io.OutputStream, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public int build(OutputStream out, OutputStream err,
IProgressMonitor monitor){
-
+
initRebuildStates();
int num = getNumCommands();
int status = STATUS_OK;
-
+
//TODO: should we specify some task name here?
monitor.beginTask("", num > 0 ? num : 1); //$NON-NLS-1$
monitor.subTask(""); //$NON-NLS-1$
-
+
if(num > 0){
BuildStepVisitor visitor = new BuildStepVisitor(out, err, monitor);
try {
@@ -160,12 +162,12 @@ public class DescriptionBuilder implements IBuildModelBuilder {
} catch (CoreException e) {
status = STATUS_ERROR_LAUNCH;
}
-
+
if(status == STATUS_OK)
status = visitor.fStatus;
} else {
printMessage(
- ManagedMakeMessages.getFormattedString(BUILDER_NOTHING_TODO,
+ ManagedMakeMessages.getFormattedString(BUILDER_NOTHING_TODO,
fDes.getConfiguration().getOwner().getName()),
out);
}
@@ -174,7 +176,7 @@ public class DescriptionBuilder implements IBuildModelBuilder {
if(status == STATUS_OK)
clearRebuildStates();
-
+
return status;
}
@@ -193,7 +195,7 @@ public class DescriptionBuilder implements IBuildModelBuilder {
}
return fNumCommands;
}
-
+
protected StepBuilder getStepBuilder(IBuildStep step){
StepBuilder b = fStepToStepBuilderMap.get(step);
if(b == null){
@@ -202,7 +204,7 @@ public class DescriptionBuilder implements IBuildModelBuilder {
}
return b;
}
-
+
protected void printMessage(String msg, OutputStream os){
if (os != null) {
msg = ManagedMakeMessages.getFormattedString(BUILDER_MSG_HEADER, msg) + LINE_SEPARATOR;
@@ -214,13 +216,13 @@ public class DescriptionBuilder implements IBuildModelBuilder {
}
}
}
-
+
private void initRebuildStates(){
if(fRebuildStateContainer == null)
return;
-
+
fRebuildStateContainer.setState(0);
-
+
IBuildResource[] rcs = fDes.getResources();
putAll(fRebuildStateContainer, rcs, IRebuildState.NEED_REBUILD, true);
}
@@ -228,9 +230,9 @@ public class DescriptionBuilder implements IBuildModelBuilder {
private void clearRebuildStates(){
if(fRebuildStateContainer == null)
return;
-
+
fRebuildStateContainer.setState(0);
-
+
// IBuildResource[] rcs = fDes.getResources();
// putAll(fRebuildStateContainer, rcs, IRebuildState.NEED_REBUILD, true);
}
@@ -240,15 +242,15 @@ public class DescriptionBuilder implements IBuildModelBuilder {
IBuildResource rc = rcs[i];
if(rebuildRcOnly && !rc.needsRebuild())
continue;
-
+
if(!rc.isProjectResource())
continue;
IPath fullPath = rc.getFullPath();
if(fullPath == null)
continue;
-
+
cbs.setStateForFullPath(fullPath, state);
}
}
-
+
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ProjectBuildState.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ProjectBuildState.java
index 00f399b8f0..937f164d0a 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ProjectBuildState.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ProjectBuildState.java
@@ -33,13 +33,13 @@ import org.eclipse.core.runtime.IPath;
public class ProjectBuildState implements IProjectBuildState {
private Properties fCfgIdToFileNameProps;
private Map<String, ConfigurationBuildState> fCfgIdToStateMap = new HashMap<String, ConfigurationBuildState>();
- private IProject fProject;
+ private IProject fProject;
private boolean fIsMapInfoDirty;
-
+
public ProjectBuildState(IProject project){
fProject = project;
}
-
+
void setProject(IProject project){
fProject = project;
Collection<ConfigurationBuildState> cbStates = fCfgIdToStateMap.values();
@@ -48,6 +48,7 @@ public class ProjectBuildState implements IProjectBuildState {
}
}
+ @Override
public IConfigurationBuildState getConfigurationBuildState(String id, boolean create) {
ConfigurationBuildState state = fCfgIdToStateMap.get(id);
if(state == null){
@@ -59,7 +60,7 @@ public class ProjectBuildState implements IProjectBuildState {
}
return state;
}
-
+
private ConfigurationBuildState loadState(String id, boolean create){
File file = getFileForCfg(id, create);
ConfigurationBuildState bs = new ConfigurationBuildState(fProject, id);
@@ -77,6 +78,7 @@ public class ProjectBuildState implements IProjectBuildState {
return bs;
}
+ @Override
public IConfigurationBuildState[] getConfigurationBuildStates() {
Properties props = getIdToNameProperties();
List<IConfigurationBuildState> list = new ArrayList<IConfigurationBuildState>(props.size());
@@ -90,6 +92,7 @@ public class ProjectBuildState implements IProjectBuildState {
return list.toArray(new ConfigurationBuildState[list.size()]);
}
+ @Override
public void removeConfigurationBuildState(String id) {
ConfigurationBuildState cbs = (ConfigurationBuildState)getConfigurationBuildState(id, false);
if(cbs != null){
@@ -97,17 +100,19 @@ public class ProjectBuildState implements IProjectBuildState {
}
}
+ @Override
public int getState() {
// TODO Auto-generated method stub
return 0;
}
+ @Override
public void setState(int state) {
// TODO Auto-generated method stub
}
private static final int OP_CREATE = 1;
private static final int OP_REMOVE = 2;
-
+
private String getFileName(String id, int op){
Properties props = getIdToNameProperties();
String name = props.getProperty(id);
@@ -124,26 +129,26 @@ public class ProjectBuildState implements IProjectBuildState {
}
return name;
}
-
+
private File getFileForCfg(String id, boolean create){
String name = getFileName(id, create ? OP_CREATE : 0);
if(name == null)
return null;
-
+
IPath path = BuildStateManager.getInstance().getPrefsDirPath(fProject);
path = path.append(name);
return path.toFile();
}
-
+
private void saveMapFile(){
if(fCfgIdToFileNameProps == null)
return;
-
+
File file = getMapFile();
File parent = file.getParentFile();
if(!parent.exists())
parent.mkdirs();
-
+
try {
OutputStream oStream = new FileOutputStream(file);
fCfgIdToFileNameProps.store(oStream, ""); //$NON-NLS-1$
@@ -154,7 +159,7 @@ public class ProjectBuildState implements IProjectBuildState {
ManagedBuilderCorePlugin.log(e);
}
}
-
+
private File getMapFile(){
IPath path = BuildStateManager.getInstance().getPrefsDirPath(fProject);
path = path.append(getProjFileName());
@@ -180,17 +185,18 @@ public class ProjectBuildState implements IProjectBuildState {
}
return fCfgIdToFileNameProps;
}
-
+
private String getProjFileName(){
return fProject.getName();
}
+ @Override
public IProject getProject() {
return fProject;
}
-
+
void serialize(){
-
+
Collection<ConfigurationBuildState> cbStates = fCfgIdToStateMap.values();
for (ConfigurationBuildState s : cbStates) {
String id = s.getConfigurationId();
@@ -205,7 +211,7 @@ public class ProjectBuildState implements IProjectBuildState {
File parent = file.getParentFile();
if(!parent.exists())
parent.mkdirs();
-
+
try {
FileOutputStream oStream = new FileOutputStream(file);
s.store(oStream);
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/StepBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/StepBuilder.java
index 968917bc73..d8a38cf341 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/StepBuilder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/StepBuilder.java
@@ -28,14 +28,14 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
/**
- *
+ *
* This class implements the IBuildStep building
* To build the step, create an instance of this class
* and invoke the build method
*
- * NOTE: This class is subject to change and discuss,
+ * NOTE: This class is subject to change and discuss,
* and is currently available in experimental mode only
- *
+ *
*/
public class StepBuilder implements IBuildModelBuilder {
private IBuildStep fStep;
@@ -45,7 +45,7 @@ public class StepBuilder implements IBuildModelBuilder {
private int fNumCommands = -1;
private CommandBuilder fCommandBuilders[];
private IResourceRebuildStateContainer fRebuildStateContainer;
-
+
public StepBuilder(IBuildStep step, IResourceRebuildStateContainer rs){
this(step, null, rs);
}
@@ -59,19 +59,20 @@ public class StepBuilder implements IBuildModelBuilder {
fCWD = cwd;
fDirs = dirs;
fResumeOnErrs = resumeOnErrs;
-
+
if(fDirs == null)
fDirs = new GenDirInfo(fStep.getBuildDescription().getConfiguration());
-
+
if(fCWD == null)
fCWD = fStep.getBuildDescription().getDefaultBuildDirLocation();
-
+
fRebuildStateContainer = rs;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.internal.builddescription.IBuildDescriptionBuilder#build(java.io.OutputStream, java.io.OutputStream, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public int build(OutputStream out, OutputStream err,
IProgressMonitor monitor){
@@ -83,9 +84,9 @@ public class StepBuilder implements IBuildModelBuilder {
if(bs.length > 0){
//TODO: monitor
createOutDirs(new NullProgressMonitor());
-
- for(int i = 0;
- i < bs.length
+
+ for(int i = 0;
+ i < bs.length
&& status != STATUS_CANCELLED
&& (fResumeOnErrs || status == STATUS_OK);
i++){
@@ -111,7 +112,7 @@ public class StepBuilder implements IBuildModelBuilder {
monitor.done();
return status;
}
-
+
protected int postProcess(int status, IProgressMonitor monitor){
if(status != STATUS_ERROR_LAUNCH){
refreshOutputs(monitor);
@@ -129,23 +130,23 @@ public class StepBuilder implements IBuildModelBuilder {
}
return status;
}
-
+
private void clearRebuildState(){
if(fRebuildStateContainer == null)
return;
-
+
IBuildResource[] rcs = fStep.getOutputResources();
DescriptionBuilder.putAll(fRebuildStateContainer, rcs, 0, false);
rcs = fStep.getInputResources();
DescriptionBuilder.putAll(fRebuildStateContainer, rcs, 0, false);
}
-
+
protected void refreshOutputs(IProgressMonitor monitor){
if(fStep == fStep.getBuildDescription().getInputStep())
return;
-
+
IBuildResource rcs[] = fStep.getOutputResources();
-
+
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
for(int i = 0; i < rcs.length; i++){
IPath path = rcs[i].getFullPath();
@@ -156,18 +157,18 @@ public class StepBuilder implements IBuildModelBuilder {
} catch (CoreException e) {
if(DbgUtil.DEBUG){
DbgUtil.trace("failed to refresh resource " //$NON-NLS-1$
- + file.getFullPath()
+ + file.getFullPath()
+ ", error: " + e.getLocalizedMessage()); //$NON-NLS-1$
}
}
}
}
}
-
+
protected void cleanOutputs(IProgressMonitor monitor){
if(fStep == fStep.getBuildDescription().getInputStep())
return;
-
+
IBuildResource bRcs[] = fStep.getOutputResources();
for(int i = 0; i < bRcs.length; i++){
if(!bRcs[i].isProjectResource())
@@ -180,14 +181,14 @@ public class StepBuilder implements IBuildModelBuilder {
} catch (CoreException e) {
if(DbgUtil.DEBUG){
DbgUtil.trace("failed to delete resource " //$NON-NLS-1$
- + rc.getFullPath()
+ + rc.getFullPath()
+ ", error: " + e.getLocalizedMessage()); //$NON-NLS-1$
}
}
}
}
}
-
+
protected void createOutDirs(IProgressMonitor monitor){
IBuildDescription des = fStep.getBuildDescription();
if(des != null && des.getInputStep() == fStep){
@@ -198,7 +199,7 @@ public class StepBuilder implements IBuildModelBuilder {
}
IBuildResource rcs[] = fStep.getOutputResources();
-
+
for(int i = 0; i < rcs.length; i++){
fDirs.createDir(rcs[i], monitor);
}
@@ -214,7 +215,7 @@ public class StepBuilder implements IBuildModelBuilder {
}
return fNumCommands;
}
-
+
protected CommandBuilder[] getCommandBuilders(){
if(fCommandBuilders == null){
IBuildCommand cmds[] = fStep.getCommands(fCWD, null, null, true);
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildProperties.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildProperties.java
index edd2cd967c..3b174a0de7 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildProperties.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildProperties.java
@@ -23,11 +23,11 @@ import org.eclipse.core.runtime.CoreException;
public class BuildProperties implements IBuildProperties {
private HashMap<String, IBuildProperty> fPropertiesMap = new HashMap<String, IBuildProperty>();
private ArrayList<String> fInexistentProperties;
-
+
public BuildProperties(){
-
+
}
-
+
public BuildProperties(String properties){
StringTokenizer t = new StringTokenizer(properties, BuildPropertyManager.PROPERTIES_SEPARATOR);
while(t.hasMoreTokens()){
@@ -38,15 +38,15 @@ public class BuildProperties implements IBuildProperties {
} catch (CoreException e) {
if(fInexistentProperties == null)
fInexistentProperties = new ArrayList<String>();
-
+
fInexistentProperties.add(property);
}
}
-
+
if(fInexistentProperties != null)
fInexistentProperties.trimToSize();
}
-
+
@SuppressWarnings("unchecked")
public BuildProperties(BuildProperties properties){
fPropertiesMap.putAll(properties.fPropertiesMap);
@@ -54,18 +54,21 @@ public class BuildProperties implements IBuildProperties {
fInexistentProperties = (ArrayList<String>)properties.fInexistentProperties.clone();
}
+ @Override
public IBuildProperty[] getProperties(){
return fPropertiesMap.values().toArray(new BuildProperty[fPropertiesMap.size()]);
}
-
+
+ @Override
public IBuildProperty getProperty(String id){
return fPropertiesMap.get(id);
}
-
+
void addProperty(IBuildProperty property){
fPropertiesMap.put(property.getPropertyType().getId(), property);
}
+ @Override
public IBuildProperty setProperty(String propertyId, String propertyValue) throws CoreException {
return setProperty(propertyId, propertyValue, false);
}
@@ -73,30 +76,31 @@ public class BuildProperties implements IBuildProperties {
public IBuildProperty setProperty(String propertyId, String propertyValue, boolean force) throws CoreException {
try {
IBuildProperty property = BuildPropertyManager.getInstance().createProperty(propertyId, propertyValue);
-
+
addProperty(property);
-
+
return property;
} catch (CoreException e){
if(force){
if(fInexistentProperties == null)
fInexistentProperties = new ArrayList<String>(1);
-
+
fInexistentProperties.add(BuildProperty.toString(propertyId, propertyValue));
fInexistentProperties.trimToSize();
}
throw e;
}
}
-
+
+ @Override
public IBuildProperty removeProperty(String id){
return fPropertiesMap.remove(id);
}
-
+
void removeProperty(BuildProperty property){
fPropertiesMap.remove(property.getPropertyType().getId());
}
-
+
@Override
public String toString(){
String props = toStringExistingProperties();
@@ -111,14 +115,14 @@ public class BuildProperties implements IBuildProperties {
}
return props;
}
-
+
public String toStringExistingProperties(){
- int size = fPropertiesMap.size();
+ int size = fPropertiesMap.size();
if(size == 0)
return ""; //$NON-NLS-1$
else if(size == 1)
return fPropertiesMap.values().iterator().next().toString();
-
+
StringBuffer buf = new StringBuffer();
Iterator<IBuildProperty> iter = fPropertiesMap.values().iterator();
buf.append(iter.next().toString());
@@ -134,10 +138,10 @@ public class BuildProperties implements IBuildProperties {
public Object clone() {
try {
BuildProperties clone = (BuildProperties)super.clone();
-
+
if(fInexistentProperties != null)
clone.fInexistentProperties = (ArrayList<String>)fInexistentProperties.clone();
-
+
clone.fPropertiesMap = (HashMap<String, IBuildProperty>)fPropertiesMap.clone();
/* for(Iterator iter = clone.fPropertiesMap.entrySet().iterator(); iter.hasNext();){
Map.Entry entry = (Map.Entry)iter.next();
@@ -151,11 +155,13 @@ public class BuildProperties implements IBuildProperties {
return null;
}
+ @Override
public void clear() {
fPropertiesMap.clear();
fInexistentProperties.clear();
}
+ @Override
public boolean containsValue(String propertyId, String valueId) {
IBuildProperty prop = getProperty(propertyId);
if(prop != null){
@@ -163,7 +169,7 @@ public class BuildProperties implements IBuildProperties {
}
return false;
}
-
-
-
+
+
+
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildProperty.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildProperty.java
index c63d9eec9a..a31c10b5ca 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildProperty.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildProperty.java
@@ -34,7 +34,7 @@ public class BuildProperty implements IBuildProperty{
type = SafeStringInterner.safeIntern(property);
value = null;
}
-
+
fType = BuildPropertyManager.getInstance().getPropertyType(type);
if(fType == null){
throw new CoreException(new Status(IStatus.ERROR,
@@ -43,19 +43,20 @@ public class BuildProperty implements IBuildProperty{
}
setValue(value);
}
-
+
BuildProperty(IBuildPropertyType type, String valueId) throws CoreException {
fType = type;
setValue(valueId);
}
-
+
+ @Override
public IBuildPropertyType getPropertyType(){
return fType;
}
-
+
private void setValue(String id) throws CoreException {
IBuildPropertyValue value = fType.getSupportedValue(id);
-
+
if(value == null)
throw new CoreException(new Status(IStatus.ERROR,
ManagedBuilderCorePlugin.getUniqueIdentifier(),
@@ -63,25 +64,26 @@ public class BuildProperty implements IBuildProperty{
setValue(value);
}
-
+
private void setValue(IBuildPropertyValue value){
fValue = value;
}
-
+
+ @Override
public IBuildPropertyValue getValue(){
return fValue;
}
-
+
@Override
public String toString(){
return toString(fType.toString(), fValue.toString());
}
-
+
public static String toString(String type, String value){
StringBuffer buf = new StringBuffer();
buf.append(type).append(BuildPropertyManager.PROPERTY_VALUE_SEPARATOR).append(value);
return buf.toString();
-
+
}
/* public Object clone() {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertyManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertyManager.java
index fb4614d886..407a0b6bd1 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertyManager.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertyManager.java
@@ -39,34 +39,35 @@ public class BuildPropertyManager implements IBuildPropertyManager{
static final String ATTRIBUTE_ID = "id"; //$NON-NLS-1$
private static BuildPropertyManager fInstance;
-
+
private List<IConfigurationElement> fTypeCfgElements;
private List<IConfigurationElement> fValueCfgElements;
-
+
private BuildPropertyManager(){
loadExtensions();
}
-
+
public static BuildPropertyManager getInstance(){
if(fInstance == null)
fInstance = new BuildPropertyManager();
return fInstance;
}
-
+
public BuildProperties loadPropertiesFromString(String properties){
return new BuildProperties(properties);
}
-
+
public String savePropertiesToString(BuildProperties properties){
return properties.toString();
}
private Map<String, IBuildPropertyType> fPropertyTypeMap = new HashMap<String, IBuildPropertyType>();
-
+
+ @Override
public IBuildPropertyType getPropertyType(String id){
return fPropertyTypeMap.get(id);
}
-
+
public IBuildPropertyType createPropertyType(String id, String name) throws CoreException{
IBuildPropertyType type = getPropertyType(id);
if(type != null){
@@ -88,7 +89,7 @@ public class BuildPropertyManager implements IBuildPropertyManager{
IStatus.ERROR,
ManagedBuilderCorePlugin.getUniqueIdentifier(),
BuildPropertiesMessages.getString("BuildPropertyManager.9"))); //$NON-NLS-1$
-
+
return createPropertyValue(type, id, name);
}
@@ -103,14 +104,15 @@ public class BuildPropertyManager implements IBuildPropertyManager{
value = new BuildPropertyValue(id, name);
((BuildPropertyType)type).addSupportedValue(value);
}
-
+
return value;
}
-
+
+ @Override
public IBuildPropertyType[] getPropertyTypes(){
return fPropertyTypeMap.values().toArray(new BuildPropertyType[fPropertyTypeMap.size()]);
}
-
+
public IBuildProperty createProperty(String id, String value) throws CoreException {
IBuildPropertyType type = getPropertyType(id);
if(type == null)
@@ -118,11 +120,11 @@ public class BuildPropertyManager implements IBuildPropertyManager{
IStatus.ERROR,
ManagedBuilderCorePlugin.getUniqueIdentifier(),
BuildPropertiesMessages.getString("BuildPropertyManager.11"))); //$NON-NLS-1$
-
+
BuildProperty property = new BuildProperty(type, value);
return property;
}
-
+
private boolean addConfigElement(IConfigurationElement el){
if(ELEMENT_PROPERTY_TYPE.equals(el.getName())){
getTypeElList(true).add(el);
@@ -133,7 +135,7 @@ public class BuildPropertyManager implements IBuildPropertyManager{
}
return false;
}
-
+
private List<IConfigurationElement> getTypeElList(boolean create){
if(fTypeCfgElements == null && create)
fTypeCfgElements = new ArrayList<IConfigurationElement>();
@@ -145,7 +147,7 @@ public class BuildPropertyManager implements IBuildPropertyManager{
fValueCfgElements = new ArrayList<IConfigurationElement>();
return fValueCfgElements;
}
-
+
private void loadExtensions(){
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(PROPERTIES_EXT_POINT_ID);
if( extensionPoint != null) {
@@ -157,11 +159,11 @@ public class BuildPropertyManager implements IBuildPropertyManager{
addConfigElement(els[k]);
}
}
-
+
resolveConfigElements();
}
}
-
+
private void resolveConfigElements(){
List<IConfigurationElement> typeEls = getTypeElList(false);
@@ -185,7 +187,7 @@ public class BuildPropertyManager implements IBuildPropertyManager{
}
}
-
+
private IBuildPropertyType createPropertyType(IConfigurationElement el) throws CoreException{
String id = el.getAttribute(ATTRIBUTE_ID);
if(id == null)
@@ -200,7 +202,7 @@ public class BuildPropertyManager implements IBuildPropertyManager{
return createPropertyType(id, name);
}
-
+
private IBuildPropertyValue createPropertyValue(IConfigurationElement el) throws CoreException{
String id = el.getAttribute(ATTRIBUTE_ID);
if(id == null)
@@ -218,7 +220,7 @@ public class BuildPropertyManager implements IBuildPropertyManager{
ManagedBuilderCorePlugin.getUniqueIdentifier(),
BuildPropertiesMessages.getString("BuildPropertyManager.16"))); //$NON-NLS-1$
-
+
return createPropertyValue(property, id, name);
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertyType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertyType.java
index be74a9b46f..421b24623b 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertyType.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertyType.java
@@ -19,7 +19,7 @@ import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyValue;
public class BuildPropertyType extends PropertyBase implements IBuildPropertyType{
private Map<String, BuildPropertyValue> fValuesMap = new HashMap<String, BuildPropertyValue>();
-
+
BuildPropertyType(String id, String name){
super(id, name);
}
@@ -27,11 +27,13 @@ public class BuildPropertyType extends PropertyBase implements IBuildPropertyTyp
void addSupportedValue(BuildPropertyValue value){
fValuesMap.put(value.getId(), value);
}
-
+
+ @Override
public IBuildPropertyValue[] getSupportedValues(){
return fValuesMap.values().toArray(new BuildPropertyValue[fValuesMap.size()]);
}
-
+
+ @Override
public IBuildPropertyValue getSupportedValue(String id){
return fValuesMap.get(id);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/AdditionalInput.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/AdditionalInput.java
index 15fe519739..b0ba81b5e2 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/AdditionalInput.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/AdditionalInput.java
@@ -37,11 +37,11 @@ public class AdditionalInput implements IAdditionalInput {
/*
* C O N S T R U C T O R S
*/
-
+
/**
- * This constructor is called to create an AdditionalInput defined by an extension point in
+ * This constructor is called to create an AdditionalInput defined by an extension point in
* a plugin manifest file, or returned by a dynamic element provider
- *
+ *
* @param parent The IInputType parent of this AdditionalInput
* @param element The AdditionalInput definition from the manifest file or a dynamic element
* provider
@@ -49,7 +49,7 @@ public class AdditionalInput implements IAdditionalInput {
public AdditionalInput(IInputType parent, IManagedConfigElement element) {
this.fParent = parent;
fIsExtensionAdditionalInput = true;
-
+
// setup for resolving
fResolved = false;
@@ -57,9 +57,9 @@ public class AdditionalInput implements IAdditionalInput {
}
/**
- * This constructor is called to create an AdditionalInput whose attributes and children will be
+ * This constructor is called to create an AdditionalInput whose attributes and children will be
* added by separate calls.
- *
+ *
* @param parent The parent of the an AdditionalInput
* @param isExtensionElement Indicates whether this is an extension element or a managed project element
*/
@@ -73,30 +73,30 @@ public class AdditionalInput implements IAdditionalInput {
}
/**
- * Create an <code>AdditionalInput</code> based on the specification stored in the
+ * Create an <code>AdditionalInput</code> based on the specification stored in the
* project file (.cdtbuild).
- *
- * @param parent The <code>ITool</code> the AdditionalInput will be added to.
+ *
+ * @param parent The <code>ITool</code> the AdditionalInput will be added to.
* @param element The XML element that contains the AdditionalInput settings.
*/
public AdditionalInput(IInputType parent, ICStorageElement element) {
this.fParent = parent;
fIsExtensionAdditionalInput = false;
-
+
// Initialize from the XML attributes
loadFromProject(element);
}
/**
* Create an <code>AdditionalInput</code> based upon an existing AdditionalInput.
- *
+ *
* @param parent The <code>IInputType</code> the AdditionalInput will be added to.
* @param additionalInput The existing AdditionalInput to clone.
*/
public AdditionalInput(IInputType parent, AdditionalInput additionalInput) {
this.fParent = parent;
fIsExtensionAdditionalInput = false;
-
+
// Copy the remaining attributes
if (additionalInput.fPaths != null) {
fPaths = new String(additionalInput.fPaths);
@@ -105,7 +105,7 @@ public class AdditionalInput implements IAdditionalInput {
if (additionalInput.fKind != null) {
fKind = new Integer(additionalInput.fKind.intValue());
}
-
+
setDirty(true);
setRebuildState(true);
}
@@ -113,12 +113,12 @@ public class AdditionalInput implements IAdditionalInput {
/*
* E L E M E N T A T T R I B U T E R E A D E R S A N D W R I T E R S
*/
-
+
/* (non-Javadoc)
- * Loads the AdditionalInput information from the ManagedConfigElement specified in the
+ * Loads the AdditionalInput information from the ManagedConfigElement specified in the
* argument.
- *
- * @param element Contains the AdditionalInput information
+ *
+ * @param element Contains the AdditionalInput information
*/
protected void loadFromManifest(IManagedConfigElement element) {
@@ -135,20 +135,20 @@ public class AdditionalInput implements IAdditionalInput {
fKind = new Integer(KIND_ADDITIONAL_DEPENDENCY);
}
}
-
+
/* (non-Javadoc)
- * Initialize the AdditionalInput information from the XML element
+ * Initialize the AdditionalInput information from the XML element
* specified in the argument
- *
- * @param element An XML element containing the AdditionalInput information
+ *
+ * @param element An XML element containing the AdditionalInput information
*/
protected void loadFromProject(ICStorageElement element) {
-
+
// path
if (element.getAttribute(IAdditionalInput.PATHS) != null) {
fPaths = SafeStringInterner.safeIntern(element.getAttribute(IAdditionalInput.PATHS));
}
-
+
// kind
if (element.getAttribute(IAdditionalInput.KIND) != null) {
String kindStr = element.getAttribute(IAdditionalInput.KIND);
@@ -184,12 +184,12 @@ public class AdditionalInput implements IAdditionalInput {
str = ADDITIONAL_INPUT_DEPENDENCY;
break;
default:
- str = EMPTY_STRING;
+ str = EMPTY_STRING;
break;
}
element.setAttribute(IAdditionalInput.KIND, str);
}
-
+
// I am clean now
fIsDirty = false;
}
@@ -201,6 +201,7 @@ public class AdditionalInput implements IAdditionalInput {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IAdditionalInput#getParent()
*/
+ @Override
public IInputType getParent() {
return fParent;
}
@@ -212,6 +213,7 @@ public class AdditionalInput implements IAdditionalInput {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IAdditionalInput#getPaths()
*/
+ @Override
public String[] getPaths() {
if (fPaths == null) {
return null;
@@ -223,6 +225,7 @@ public class AdditionalInput implements IAdditionalInput {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IAdditionalInput#setPaths()
*/
+ @Override
public void setPaths(String newPaths) {
if (fPaths == null && newPaths == null) return;
if (fPaths == null || newPaths == null || !(fPaths.equals(newPaths))) {
@@ -235,6 +238,7 @@ public class AdditionalInput implements IAdditionalInput {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IAdditionalInput#getKind()
*/
+ @Override
public int getKind() {
if (fKind == null) {
return KIND_ADDITIONAL_INPUT_DEPENDENCY;
@@ -245,6 +249,7 @@ public class AdditionalInput implements IAdditionalInput {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IAdditionalInput#setKind()
*/
+ @Override
public void setKind(int newKind) {
if (fKind == null || !(fKind.intValue() == newKind)) {
fKind = new Integer(newKind);
@@ -256,7 +261,7 @@ public class AdditionalInput implements IAdditionalInput {
/*
* O B J E C T S T A T E M A I N T E N A N C E
*/
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IAdditionalInput#isExtensionElement()
*/
@@ -267,6 +272,7 @@ public class AdditionalInput implements IAdditionalInput {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IAdditionalInput#isDirty()
*/
+ @Override
public boolean isDirty() {
// This shouldn't be called for an extension AdditionalInput
if (fIsExtensionAdditionalInput) return false;
@@ -276,10 +282,11 @@ public class AdditionalInput implements IAdditionalInput {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IAdditionalInput#setDirty(boolean)
*/
+ @Override
public void setDirty(boolean isDirty) {
this.fIsDirty = isDirty;
}
-
+
/* (non-Javadoc)
* Resolve the element IDs to interface references
*/
@@ -288,11 +295,11 @@ public class AdditionalInput implements IAdditionalInput {
fResolved = true;
}
}
-
+
public boolean needsRebuild(){
return fRebuildState;
}
-
+
public void setRebuildState(boolean rebuild){
if(isExtensionElement() && rebuild)
return;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BooleanExpressionApplicabilityCalculator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BooleanExpressionApplicabilityCalculator.java
index 5e48a85cd9..6cba2dd698 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BooleanExpressionApplicabilityCalculator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BooleanExpressionApplicabilityCalculator.java
@@ -38,28 +38,29 @@ public class BooleanExpressionApplicabilityCalculator implements IOptionApplicab
private OptionEnablementExpression fExpressions[];
private Map<String, Set<String>> fRefPropsMap;
-
+
public BooleanExpressionApplicabilityCalculator(IManagedConfigElement optionElement){
this(optionElement.getChildren(OptionEnablementExpression.NAME));
}
public BooleanExpressionApplicabilityCalculator(IManagedConfigElement enablementElements[]){
fExpressions = new OptionEnablementExpression[enablementElements.length];
-
+
for(int i = 0; i < enablementElements.length; i++){
fExpressions[i] = new OptionEnablementExpression(enablementElements[i]);
}
}
-
- public boolean isOptionVisible(IBuildObject configuration,
- IHoldsOptions holder,
+
+ @Override
+ public boolean isOptionVisible(IBuildObject configuration,
+ IHoldsOptions holder,
IOption option){
IResourceInfo rcInfo = rcInfoFromConfiguration(configuration);
if(rcInfo != null)
return evaluate(rcInfo, holder, option, OptionEnablementExpression.FLAG_UI_VISIBILITY);
return true;
}
-
+
public static IResourceInfo rcInfoFromConfiguration(IBuildObject configuration){
if(configuration instanceof IFolderInfo)
return (IFolderInfo)configuration;
@@ -69,7 +70,7 @@ public class BooleanExpressionApplicabilityCalculator implements IOptionApplicab
return ((IConfiguration)configuration).getRootFolderInfo();
return null;
}
-
+
public boolean isInputTypeEnabled(ITool tool, IInputType type){
return evaluate(tool.getParentResourceInfo(), tool, null, OptionEnablementExpression.FLAG_CMD_USAGE);
}
@@ -82,9 +83,10 @@ public class BooleanExpressionApplicabilityCalculator implements IOptionApplicab
ITool tool){
return evaluate(rcInfo, tool, null, OptionEnablementExpression.FLAG_CMD_USAGE);
}
-
- public boolean isOptionEnabled(IBuildObject configuration,
- IHoldsOptions holder,
+
+ @Override
+ public boolean isOptionEnabled(IBuildObject configuration,
+ IHoldsOptions holder,
IOption option){
IResourceInfo rcInfo = rcInfoFromConfiguration(configuration);
if(rcInfo != null)
@@ -92,8 +94,9 @@ public class BooleanExpressionApplicabilityCalculator implements IOptionApplicab
return true;
}
- public boolean isOptionUsedInCommandLine(IBuildObject configuration,
- IHoldsOptions holder,
+ @Override
+ public boolean isOptionUsedInCommandLine(IBuildObject configuration,
+ IHoldsOptions holder,
IOption option){
IResourceInfo rcInfo = rcInfoFromConfiguration(configuration);
if(rcInfo != null)
@@ -109,7 +112,7 @@ public class BooleanExpressionApplicabilityCalculator implements IOptionApplicab
}
return true;
}
-
+
/* public boolean performAdjustment(IBuildObject configuration,
IHoldsOptions holder, IOption option, boolean extensionAdjustment){
boolean adjusted = false;
@@ -119,9 +122,9 @@ public class BooleanExpressionApplicabilityCalculator implements IOptionApplicab
}
return adjusted;
}
-*/
- public boolean adjustOption(IResourceInfo rcInfo,
- IHoldsOptions holder,
+*/
+ public boolean adjustOption(IResourceInfo rcInfo,
+ IHoldsOptions holder,
IOption option,
boolean extensionAdjustment){
boolean adjusted = false;
@@ -130,7 +133,7 @@ public class BooleanExpressionApplicabilityCalculator implements IOptionApplicab
if(fExpressions[i].adjustOption(rcInfo, holder, option, context, extensionAdjustment))
adjusted = true;
}
-
+
if(context != null){
String unadjusted[] = context.getUnadjusted();
for(int i = 0; i < unadjusted.length; i++){
@@ -140,7 +143,7 @@ public class BooleanExpressionApplicabilityCalculator implements IOptionApplicab
return adjusted;
}
- public boolean adjustToolChain(IFolderInfo info,
+ public boolean adjustToolChain(IFolderInfo info,
IToolChain tChain,
boolean extensionAdjustment){
boolean adjusted = false;
@@ -149,7 +152,7 @@ public class BooleanExpressionApplicabilityCalculator implements IOptionApplicab
if(fExpressions[i].adjustToolChain(info, tChain, context, extensionAdjustment))
adjusted = true;
}
-
+
if(context != null){
String unadjusted[] = context.getUnadjusted();
for(int i = 0; i < unadjusted.length; i++){
@@ -160,7 +163,7 @@ public class BooleanExpressionApplicabilityCalculator implements IOptionApplicab
return adjusted;
}
- public boolean adjustTool(IResourceInfo info,
+ public boolean adjustTool(IResourceInfo info,
ITool tool,
boolean extensionAdjustment){
boolean adjusted = false;
@@ -195,14 +198,14 @@ public class BooleanExpressionApplicabilityCalculator implements IOptionApplicab
OptionEnablementExpression.adjustConfiguration(cfg, unadjusted[i], null, extensionAdjustment);
}
}
-
+
return adjusted;
}
-
+
private Map<String, Set<String>> getReferencedProperties(){
if(fRefPropsMap == null){
fRefPropsMap = new HashMap<String, Set<String>>();
-
+
for(int i = 0; i < fExpressions.length; i++){
fExpressions[i].getReferencedProperties(fRefPropsMap);
}
@@ -212,7 +215,7 @@ public class BooleanExpressionApplicabilityCalculator implements IOptionApplicab
public boolean referesProperty(String id){
Map<String, Set<String>> map = getReferencedProperties();
-
+
return map.containsKey(id);
}
@@ -223,7 +226,7 @@ public class BooleanExpressionApplicabilityCalculator implements IOptionApplicab
return set.contains(valueId);
return false;
}
-
+
public String[] getReferencedPropertyIds(){
Map<String, Set<String>> map = getReferencedProperties();
return map.keySet().toArray(new String[map.size()]);
@@ -235,11 +238,12 @@ public class BooleanExpressionApplicabilityCalculator implements IOptionApplicab
return set.toArray(new String[set.size()]);
}
+ @Override
public boolean isOptionCategoryVisible(IBuildObject configuration, IHoldsOptions optHolder,
IOptionCategory category) {
return evaluateCategory(rcInfoFromConfiguration(configuration), optHolder, category);
}
-
+
private boolean evaluateCategory(IResourceInfo rcInfo, IHoldsOptions holder, IOptionCategory category) {
for(int i = 0; i < fExpressions.length; i++){
if(!fExpressions[i].evaluate(rcInfo, holder, category))
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildObject.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildObject.java
index 40de8e7fc8..e309fb22ff 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildObject.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildObject.java
@@ -20,13 +20,14 @@ public class BuildObject implements IBuildObject {
protected String id;
protected String name;
private String baseId=null;
-
+
protected Version version = null;
protected String managedBuildRevision = null;
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IBuildObject#getId()
*/
+ @Override
public String getId() {
return id;
}
@@ -41,10 +42,11 @@ public class BuildObject implements IBuildObject {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IBuildObject#getName()
*/
+ @Override
public String getName() {
return name;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IBuildObject#setName(java.lang.String)
*/
@@ -59,17 +61,19 @@ public class BuildObject implements IBuildObject {
public String toString() {
return name;
}
-
+
/**
* @return Returns the managedBuildRevision.
*/
+ @Override
public String getManagedBuildRevision() {
return managedBuildRevision;
}
-
+
/**
* @return Returns the version.
*/
+ @Override
public Version getVersion() {
return version;
}
@@ -77,28 +81,30 @@ public class BuildObject implements IBuildObject {
/**
* @param version The version to set.
*/
+ @Override
public void setVersion(Version version) {
this.version = version;
}
/**
- * @return id of the object this class was based on. Note that this function
+ * @return id of the object this class was based on. Note that this function
* assumes that id was generated by {@link ManagedBuildManager#calculateChildId(String, String)}.
*/
+ @Override
public String getBaseId() {
if (baseId==null)
baseId = ManagedBuildManager.calculateBaseId(id);
return baseId;
}
-
+
public Version getVersionFromId() {
String versionNumber = ManagedBuildManager.getVersionFromIdAndVersion( getId());
-
+
if( versionNumber == null) {
// It means, Tool Integrator either not provided version information in 'id' or provided in wrong format,
// So get the default version based on 'managedBuildRevision' attribute.
-
+
if ( getManagedBuildRevision() != null) {
Version tmpManagedBuildRevision = new Version( getManagedBuildRevision() );
if (tmpManagedBuildRevision.equals(new Version("1.2.0")) ) //$NON-NLS-1$
@@ -119,7 +125,7 @@ public class BuildObject implements IBuildObject {
public void setManagedBuildRevision(String managedBuildRevision) {
this.managedBuildRevision = managedBuildRevision;
}
-
+
/*
* updates revision for this build object and all its children
*/
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildObjectProperties.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildObjectProperties.java
index d1cbb24980..b53a5dbf04 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildObjectProperties.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildObjectProperties.java
@@ -26,13 +26,13 @@ public class BuildObjectProperties extends BuildProperties implements
IBuildObjectProperties {
private IBuildPropertiesRestriction fRestriction;
private IBuildPropertyChangeListener fListener;
-
+
public BuildObjectProperties(IBuildPropertiesRestriction restriction, IBuildPropertyChangeListener listener) {
super();
fRestriction = restriction;
fListener = listener;
}
-
+
public BuildObjectProperties(BuildObjectProperties properties, IBuildPropertiesRestriction restriction, IBuildPropertyChangeListener listener) {
super(properties);
fRestriction = restriction;
@@ -45,22 +45,24 @@ public class BuildObjectProperties extends BuildProperties implements
fListener = listener;
}
+ @Override
public IBuildPropertyType[] getSupportedTypes() {
IBuildPropertyType types[] = BuildPropertyManager.getInstance().getPropertyTypes();
-
+
if(fRestriction != null && types.length != 0){
List<IBuildPropertyType> list = new ArrayList<IBuildPropertyType>(types.length);
for (IBuildPropertyType type : types) {
if(fRestriction.supportsType(type.getId()))
list.add(type);
}
-
+
types = list.toArray(new IBuildPropertyType[list.size()]);
}
return types;
}
+ @Override
public IBuildPropertyValue[] getSupportedValues(String typeId) {
IBuildPropertyType type = BuildPropertyManager.getInstance().getPropertyType(typeId);
if(type != null){
@@ -71,13 +73,14 @@ public class BuildObjectProperties extends BuildProperties implements
if(fRestriction.supportsValue(type.getId(), value.getId()))
list.add(value);
}
-
+
return list.toArray(new IBuildPropertyValue[list.size()]);
}
}
return new IBuildPropertyValue[0];
}
+ @Override
public boolean supportsType(String id) {
return fRestriction.supportsType(id);
// IBuildPropertyType type = BuildPropertyManager.getInstance().getPropertyType(id);
@@ -90,6 +93,7 @@ public class BuildObjectProperties extends BuildProperties implements
// return false;
}
+ @Override
public boolean supportsValue(String typeId, String valueId) {
return fRestriction.supportsValue(typeId, valueId);
// IBuildPropertyType type = BuildPropertyManager.getInstance().getPropertyType(typeId);
@@ -118,7 +122,7 @@ public class BuildObjectProperties extends BuildProperties implements
fListener.propertiesChanged();
return property;
}
-
+
IBuildProperty internalSetProperty(String propertyId, String propertyValue) throws CoreException{
return super.setProperty(propertyId, propertyValue);
}
@@ -134,24 +138,28 @@ public class BuildObjectProperties extends BuildProperties implements
// throw new CoreException(new Status(IStatus.ERROR,
// ManagedBuilderCorePlugin.getUniqueIdentifier(),
// "property value is not supported"));
-
+
IBuildProperty property = super.setProperty(propertyId, propertyValue);
fListener.propertiesChanged();
return property;
}
+ @Override
public String[] getRequiredTypeIds() {
return fRestriction.getRequiredTypeIds();
}
+ @Override
public boolean requiresType(String typeId) {
return fRestriction.requiresType(typeId);
}
+ @Override
public String[] getSupportedTypeIds() {
return fRestriction.getSupportedTypeIds();
}
+ @Override
public String[] getSupportedValueIds(String typeId) {
return fRestriction.getSupportedValueIds(typeId);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java
index 3167b768e3..e1f9d58ada 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java
@@ -253,6 +253,7 @@ public class CommonBuilder extends ACBuilder {
return fullBuildNeeded;
}
+ @Override
public boolean visit(IResourceDelta delta) throws CoreException {
IResource resource = delta.getResource();
// If the project has changed, then a build is needed and we can stop
@@ -345,6 +346,7 @@ public class CommonBuilder extends ACBuilder {
}
+ @Override
public boolean visit(IResourceDelta delta) throws CoreException {
IResource rc = delta.getResource();
@@ -1111,6 +1113,7 @@ public class CommonBuilder extends ACBuilder {
try {
ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
bInfo.fBuilder.getBuildRunner().invokeBuild(
CLEAN_BUILD,
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ConfigurationNameProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ConfigurationNameProvider.java
index 1bfc6f3e59..7770586b56 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ConfigurationNameProvider.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ConfigurationNameProvider.java
@@ -17,20 +17,21 @@ import org.eclipse.cdt.managedbuilder.core.IConfigurationNameProvider;
public class ConfigurationNameProvider implements IConfigurationNameProvider {
private static ConfigurationNameProvider configurationNameProvider;
-
+
protected ConfigurationNameProvider() {
configurationNameProvider = null;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfigurationNameProvider#getUniqueConfigurationName(org.eclipse.cdt.managedbuilder.core.IConfiguration, java.lang.String[])
*/
+ @Override
public String getNewConfigurationName(IConfiguration configuration,
String[] usedConfigurationNames) {
// TODO Auto-generated method stub
return null;
}
-
+
public static ConfigurationNameProvider getConfigurationNameProvider() {
if( configurationNameProvider == null)
configurationNameProvider = new ConfigurationNameProvider();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ConfigurationV2.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ConfigurationV2.java
index 2aec567e76..f65adbc4e3 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ConfigurationV2.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ConfigurationV2.java
@@ -49,23 +49,23 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
/**
* Build a configuration from the project manifest file.
- *
- * @param target The <code>Target</code> the configuration belongs to.
+ *
+ * @param target The <code>Target</code> the configuration belongs to.
* @param element The element from the manifest that contains the overridden configuration information.
*/
public ConfigurationV2(Target target, Element element) {
this.target = target;
-
+
// id
setId(element.getAttribute(IConfigurationV2.ID));
-
+
// hook me up
target.addConfiguration(this);
-
+
// name
if (element.hasAttribute(IConfigurationV2.NAME))
setName(element.getAttribute(IConfigurationV2.NAME));
-
+
if (element.hasAttribute(IConfigurationV2.PARENT)) {
// See if the target has a parent
ITarget targetParent = target.getParent();
@@ -77,7 +77,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
parent = null;
}
}
-
+
NodeList configElements = element.getChildNodes();
for (int i = 0; i < configElements.getLength(); ++i) {
Node configElement = configElements.item(i);
@@ -85,12 +85,12 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
new ToolReference(this, (Element)configElement);
}
}
-
+
}
/**
* Create a new configuration based on one already defined.
- *
+ *
* @param target The <code>Target</code> the receiver will be added to.
* @param parentConfig The <code>IConfigurationV2</code> to copy the settings from.
* @param id A unique ID for the configuration.
@@ -100,15 +100,15 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
this.name = parentConfig.getName();
this.target = target;
- // If this contructor is called to clone an existing
- // configuration, the parent of the parent should be stored.
+ // If this contructor is called to clone an existing
+ // configuration, the parent of the parent should be stored.
// As of 2.0, there is still one single level of inheritence to
// worry about
parent = parentConfig.getParent() == null ? parentConfig : parentConfig.getParent();
-
+
// Check that the tool and the project match
IProject project = (IProject) target.getOwner();
-
+
// Get the tool references from the target and parent
List<IToolReference> allToolRefs = new Vector<IToolReference>(target.getLocalToolReferences());
allToolRefs.addAll(((ConfigurationV2)parentConfig).getLocalToolReferences());
@@ -116,13 +116,13 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
// Make a new ToolReference based on the tool in the ref
ITool parentTool = toolRef.getTool();
ToolReference newRef = new ToolReference(this, parentTool);
-
+
// The reference may have a different command than the parent tool
- String refCmd = toolRef.getToolCommand();
+ String refCmd = toolRef.getToolCommand();
if (!refCmd.equals(parentTool.getToolCommand())) {
newRef.setToolCommand(refCmd);
}
-
+
List<OptionReference> optRefs = toolRef.getOptionReferenceList();
for (OptionReference optRef : optRefs) {
IOption opt = optRef.getOption();
@@ -158,29 +158,29 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
}
}
}
-
+
target.addConfiguration(this);
}
/**
* Create a new <code>ConfigurationV2</code> based on the specification in the plugin manifest.
- *
+ *
* @param target The <code>Target</code> the receiver will be added to.
* @param element The element from the manifest that contains the default configuration settings.
*/
public ConfigurationV2(Target target, IManagedConfigElement element) {
this.target = target;
-
+
// setup for resolving
ManagedBuildManager.putConfigElement(this, element);
resolved = false;
-
+
// id
setId(element.getAttribute(IConfigurationV2.ID));
-
+
// hook me up
target.addConfiguration(this);
-
+
// name
setName(element.getAttribute(IConfigurationV2.NAME));
@@ -192,14 +192,14 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
}
}
}
-
+
/**
* A fresh new configuration for a target.
- */
+ */
public ConfigurationV2(Target target, String id) {
this.id = id;
this.target = target;
-
+
target.addConfiguration(this);
}
@@ -213,24 +213,25 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
}
}
}
-
+
/**
* Adds a tool reference to the receiver.
*/
public void addToolReference(ToolReference toolRef) {
getLocalToolReferences().add(toolRef);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IConfigurationV2#getToolReferences()
*/
+ @Override
public IToolReference[] getToolReferences() {
List<IToolReference> list = getLocalToolReferences();
IToolReference[] tools = new IToolReference[list.size()];
list.toArray(tools);
return tools;
}
-
+
/* (non-Javadoc)
* @param option
* @return
@@ -243,12 +244,12 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
// The option reference belongs to an existing tool reference
OptionReference optionRef = (OptionReference)option;
searchRef = optionRef.getToolReference();
-
+
// That tool reference may belong to a target or to the configuration
if (searchRef.ownedByConfiguration(this))
return optionRef;
else {
- // All this means is that the tool ref does not belong to the receiver.
+ // All this means is that the tool ref does not belong to the receiver.
// The receiver may also have a reference to the tool
if ((answer = findLocalReference(searchRef)) == null) {
// Otherwise, create one and save the option setting in it
@@ -286,13 +287,14 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
return ref;
}
}
-
+
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfigurationV2#getFilteredTools(org.eclipse.core.resources.IProject)
*/
+ @Override
public ITool[] getFilteredTools(IProject project) {
ITool[] localTools = getTools();
Vector<ITool> tools = new Vector<ITool>(localTools.length);
@@ -320,15 +322,15 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
continue;
}
}
-
+
// Answer the filtered tools as an array
return tools.toArray(new ITool[tools.size()]);
}
/* (non-javadoc)
- * A safety method to avoid NPEs. It answers the tool reference list in the
+ * A safety method to avoid NPEs. It answers the tool reference list in the
* receiver. It does not look at the tool references defined in the parent.
- *
+ *
* @return List
*/
protected List<IToolReference> getLocalToolReferences() {
@@ -349,16 +351,17 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IConfigurationV2#getTools()
*/
+ @Override
public ITool[] getTools() {
ITool[] tools = parent != null
? parent.getTools()
: target.getTools();
-
+
// Validate that the tools correspond to the nature
IProject project = (IProject)target.getOwner();
if (project != null) {
List<ITool> validTools = new ArrayList<ITool>();
-
+
// The target is associated with a real project
for (int i = 0; i < tools.length; ++i) {
ITool tool = tools[i];
@@ -385,66 +388,69 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
case ITool.FILTER_BOTH:
validTools.add(tool);
break;
- }
+ }
}
// Now put the valid tools back into the array
- tools = validTools.toArray(new ITool[validTools.size()]);
+ tools = validTools.toArray(new ITool[validTools.size()]);
}
-
+
// Replace tools with local overrides
for (int i = 0; i < tools.length; ++i) {
IToolReference ref = getToolReference(tools[i]);
if (ref != null)
tools[i] = ref;
}
-
+
return tools;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfigurationV2#isDirty()
*/
+ @Override
public boolean isDirty() {
// If I need saving, just say yes
if (isDirty) return true;
-
+
// Otherwise see if any tool references need saving
List<IToolReference> localToolReferences = getLocalToolReferences();
for (IToolReference ref : localToolReferences) {
if (ref.isDirty()) return true;
}
-
+
return isDirty;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfigurationV2#needsRebuild()
*/
+ @Override
public boolean needsRebuild() {
return rebuildNeeded;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IConfigurationV2#getParent()
*/
+ @Override
public IConfigurationV2 getParent() {
return parent;
}
-
+
/* (non-javadoc)
- *
+ *
* @param tool
* @return List
*/
protected List<OptionReference> getOptionReferences(ITool tool) {
List<OptionReference> references = new ArrayList<OptionReference>();
-
+
// Get all the option references I add for this tool
IToolReference toolRef = getToolReference(tool);
if (toolRef != null) {
references.addAll(toolRef.getOptionReferenceList());
}
-
+
// See if there is anything that my parents add that I don't
if (parent != null) {
List<OptionReference> temp = ((ConfigurationV2)parent).getOptionReferences(tool);
@@ -454,13 +460,14 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
}
}
}
-
+
return references;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfigurationV2#getToolById(java.lang.String)
*/
+ @Override
public ITool getToolById(String id) {
ITool[] tools = parent != null
? parent.getTools()
@@ -486,6 +493,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IConfigurationV2#getTarget()
*/
+ @Override
public ITarget getTarget() {
return (target == null && parent != null) ? parent.getTarget() : target;
}
@@ -493,6 +501,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IConfigurationV2#getOwner()
*/
+ @Override
public IResource getOwner() {
return getTarget().getOwner();
}
@@ -500,7 +509,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
/* (non-Javadoc)
* Returns the reference for a given tool or <code>null</code> if one is not
* found.
- *
+ *
* @param tool
* @return ToolReference
*/
@@ -515,7 +524,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
return temp;
}
}
-
+
// See if the target that the receiver belongs to has a reference to the tool
ITool[] targetTools = target.getTools();
for (int index = targetTools.length - 1; index >= 0; --index) {
@@ -528,7 +537,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
}
return null;
}
-
+
public void reset(IManagedConfigElement element) {
// I just need to reset the tool references
getLocalToolReferences().clear();
@@ -548,13 +557,13 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
*/
public void serialize(Document doc, Element element) {
element.setAttribute(IConfigurationV2.ID, id);
-
+
if (name != null)
element.setAttribute(IConfigurationV2.NAME, name);
-
+
if (parent != null)
element.setAttribute(IConfigurationV2.PARENT, parent.getId());
-
+
// Serialize only the tool references defined in the configuration
List<IToolReference> localToolReferences = getLocalToolReferences();
for (IToolReference toolRef : localToolReferences) {
@@ -562,14 +571,15 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
element.appendChild(toolRefElement);
((ToolReference)toolRef).serialize(doc, toolRefElement);
}
-
+
// I am clean now
isDirty = false;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfigurationV2#setDirty(boolean)
*/
+ @Override
public void setDirty(boolean isDirty) {
// Override the dirty flag
this.isDirty = isDirty;
@@ -583,6 +593,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IConfigurationV2#setOption(org.eclipse.cdt.core.build.managed.IOption, boolean)
*/
+ @Override
public void setOption(IOption option, boolean value) throws BuildException {
// Is there a delta
if (option.getBooleanValue() != value) {
@@ -595,6 +606,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IConfigurationV2#setOption(org.eclipse.cdt.core.build.managed.IOption, java.lang.String)
*/
+ @Override
public void setOption(IOption option, String value) throws BuildException {
String oldValue;
// Check whether this is an enumerated option
@@ -602,7 +614,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
oldValue = option.getSelectedEnum();
}
else {
- oldValue = option.getStringValue();
+ oldValue = option.getStringValue();
}
if (oldValue != null && !oldValue.equals(value)) {
createOptionReference(option).setValue(value);
@@ -614,6 +626,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IConfigurationV2#setOption(org.eclipse.cdt.core.build.managed.IOption, java.lang.String[])
*/
+ @Override
public void setOption(IOption option, String[] value) throws BuildException {
// Is there a delta
String[] oldValue;
@@ -641,12 +654,13 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
createOptionReference(option).setValue(value);
isDirty = true;
rebuildNeeded = true;
- }
+ }
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfigurationV2#setRebuildState(boolean)
*/
+ @Override
public void setRebuildState(boolean rebuild) {
rebuildNeeded = rebuild;
}
@@ -654,6 +668,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfigurationV2#setToolCommand(org.eclipse.cdt.managedbuilder.core.ITool, java.lang.String)
*/
+ @Override
public void setToolCommand(ITool tool, String command) {
// Make sure the command is different
if (command != null) {
@@ -672,6 +687,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfigurationV2#setCreatedConfig(IConfiguration)
*/
+ @Override
public void setCreatedConfig(IConfiguration config) {
createdConfig = config;
}
@@ -679,8 +695,9 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfigurationV2#getCreatedConfig()
*/
+ @Override
public IConfiguration getCreatedConfig() {
return createdConfig;
}
-
+
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/DefaultManagedConfigElement.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/DefaultManagedConfigElement.java
index f74796caa8..85ef181e3d 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/DefaultManagedConfigElement.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/DefaultManagedConfigElement.java
@@ -23,15 +23,16 @@ public class DefaultManagedConfigElement implements IManagedConfigElement {
private IConfigurationElement element;
private IExtension extension;
-
+
public DefaultManagedConfigElement(IConfigurationElement element, IExtension extension) {
this.element = element;
this.extension = extension;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedConfigElement#getName()
*/
+ @Override
public String getName() {
return element.getName();
}
@@ -39,6 +40,7 @@ public class DefaultManagedConfigElement implements IManagedConfigElement {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedConfigElement#getAttribute(java.lang.String)
*/
+ @Override
public String getAttribute(String name) {
return element.getAttribute(name);
}
@@ -46,6 +48,7 @@ public class DefaultManagedConfigElement implements IManagedConfigElement {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedConfigElement#getChildren()
*/
+ @Override
public IManagedConfigElement[] getChildren() {
return convertArray(element.getChildren(), extension);
}
@@ -53,6 +56,7 @@ public class DefaultManagedConfigElement implements IManagedConfigElement {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedConfigElement#getChildren(java.lang.String)
*/
+ @Override
public IManagedConfigElement[] getChildren(String elementName) {
return convertArray(element.getChildren(elementName), extension);
}
@@ -63,11 +67,11 @@ public class DefaultManagedConfigElement implements IManagedConfigElement {
public IExtension getExtension() {
return extension;
}
-
+
public IConfigurationElement getConfigurationElement() {
return element;
}
-
+
/**
* Convenience method for converting an array of IConfigurationElements
* into an array of IManagedConfigElements.
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/EnvVarBuildPath.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/EnvVarBuildPath.java
index 298ce39ee0..2aaa38572d 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/EnvVarBuildPath.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/EnvVarBuildPath.java
@@ -22,7 +22,7 @@ import org.eclipse.core.runtime.IConfigurationElement;
public class EnvVarBuildPath implements
IEnvVarBuildPath {
-
+
private int fType;
private String fVariableNames[];
private String fPathDelimiter;
@@ -32,41 +32,42 @@ public class EnvVarBuildPath implements
/**
* Constructor to create an EnvVarBuildPath based on an element from the plugin
- * manifest.
- *
+ * manifest.
+ *
* @param element The element containing the information about the tool.
*/
public EnvVarBuildPath(ITool tool, IManagedConfigElement element) {
loadFromManifest(element);
}
-
+
/* (non-Javadoc)
- * Load the EnvVarBuildPath information from the XML element specified in the
+ * Load the EnvVarBuildPath information from the XML element specified in the
* argument
- * @param element An XML element containing the tool information
+ * @param element An XML element containing the tool information
*/
protected void loadFromManifest(IManagedConfigElement element) {
-
+
setType(convertPathTypeToInt(element.getAttribute(TYPE)));
-
+
setVariableNames(SafeStringInterner.safeIntern(element.getAttribute(LIST)));
-
+
setPathDelimiter(SafeStringInterner.safeIntern(element.getAttribute(PATH_DELIMITER)));
-
- // Store the configuration element IFF there is a build path resolver defined
- String buildPathResolver = element.getAttribute(BUILD_PATH_RESOLVER);
+
+ // Store the configuration element IFF there is a build path resolver defined
+ String buildPathResolver = element.getAttribute(BUILD_PATH_RESOLVER);
if (buildPathResolver != null && element instanceof DefaultManagedConfigElement) {
- fBuildPathResolverElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
+ fBuildPathResolverElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
}
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IEnvVarBuildPath#getType()
*/
+ @Override
public int getType() {
return fType;
}
-
+
public void setType(int type){
this.fType = type;
}
@@ -74,10 +75,11 @@ public class EnvVarBuildPath implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IEnvVarBuildPath#getVariableNames()
*/
+ @Override
public String[] getVariableNames() {
return fVariableNames;
}
-
+
public void setVariableNames(String names[]){
fVariableNames = names;
fVariableNames = SafeStringInterner.safeIntern(fVariableNames);
@@ -86,7 +88,7 @@ public class EnvVarBuildPath implements
public void setVariableNames(String names){
setVariableNames(getNamesFromString(names));
}
-
+
public String[] getNamesFromString(String names){
if(names == null)
return null;
@@ -96,6 +98,7 @@ public class EnvVarBuildPath implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IEnvVarBuildPath#getPathDelimiter()
*/
+ @Override
public String getPathDelimiter() {
return fPathDelimiter;
}
@@ -125,6 +128,7 @@ public class EnvVarBuildPath implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IEnvVarBuildPath#getBuildPathResolver()
*/
+ @Override
public IBuildPathResolver getBuildPathResolver() {
if(fBuildPathResolver == null && fBuildPathResolverElement != null){
try {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/FolderInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/FolderInfo.java
index 569e18480b..987b7c4cb3 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/FolderInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/FolderInfo.java
@@ -316,6 +316,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
return tools.toArray(new Tool[tools.size()]);
}
+ @Override
public ITool[] getFilteredTools() {
if (toolChain == null) {
return new ITool[0];
@@ -325,6 +326,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
return filterTools(localTools, manProj);
}
+ @Override
public final int getKind() {
return ICSettingBase.SETTING_FOLDER;
}
@@ -355,18 +357,22 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
toolChain.setRebuildState(false);
}
+ @Override
public IToolChain getToolChain() {
return toolChain;
}
+ @Override
public ITool[] getTools() {
return toolChain.getTools();
}
+ @Override
public ITool getTool(String id) {
return toolChain.getTool(id);
}
+ @Override
public ITool[] getToolsBySuperClassId(String id) {
return toolChain.getToolsBySuperClassId(id);
}
@@ -410,10 +416,12 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
return null;
}
+ @Override
public CFolderData getFolderData(){
return (CFolderData)getResourceData();
}
+ @Override
public CLanguageData[] getCLanguageDatas() {
List<CLanguageData> list = new ArrayList<CLanguageData>();
for(ITool t : getFilteredTools())
@@ -422,6 +430,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
return list.toArray(new BuildLanguageData[list.size()]);
}
+ @Override
public ITool getToolFromOutputExtension(String extension) {
// Treat a null argument as an empty string
String ext = extension == null ? "" : extension; //$NON-NLS-1$
@@ -435,6 +444,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
return null;
}
+ @Override
public ITool getToolFromInputExtension(String sourceExtension) {
// Get all the tools for the current config
ITool[] tools = getFilteredTools();
@@ -540,6 +550,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
public void checkPropertiesModificationCompatibility(final ITool tools[], Map<String, String> unspecifiedRequiredProps, Map<String, String> unspecifiedProps, Set<String> undefinedSet){
final ToolChain tc = (ToolChain)getToolChain();
IBuildPropertiesRestriction r = new IBuildPropertiesRestriction(){
+ @Override
public boolean supportsType(String typeId) {
if(tc.supportsType(typeId, false))
return true;
@@ -551,6 +562,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
return false;
}
+ @Override
public boolean supportsValue(String typeId, String valueId) {
if(tc.supportsValue(typeId, valueId, false))
return true;
@@ -562,6 +574,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
return false;
}
+ @Override
public String[] getRequiredTypeIds() {
List<String> list = new ArrayList<String>();
@@ -574,6 +587,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
return list.toArray(new String[list.size()]);
}
+ @Override
public String[] getSupportedTypeIds() {
List<String> list = new ArrayList<String>();
@@ -586,6 +600,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
return list.toArray(new String[list.size()]);
}
+ @Override
public String[] getSupportedValueIds(String typeId) {
List<String> list = new ArrayList<String>();
@@ -598,6 +613,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
return list.toArray(new String[list.size()]);
}
+ @Override
public boolean requiresType(String typeId) {
if(tc.requiresType(typeId, false))
return true;
@@ -641,6 +657,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
return set;
}
+ @Override
public boolean isToolChainCompatible(IToolChain tCh){
return isToolChainCompatible(toolChain, tCh);
}
@@ -672,6 +689,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
return compatible;
}
+ @Override
public IToolChain changeToolChain(IToolChain newSuperClass, String Id, String name) throws BuildException{
boolean usePrefTc = false;
if(newSuperClass == null){
@@ -898,6 +916,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
return map;
}
+ @Override
public void modifyToolChain(ITool[] removed, ITool[] added){
ToolListModificationInfo info = ToolChainModificationHelper.getModificationInfo(this, getTools(), added, removed);
info.apply();
@@ -1171,6 +1190,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
}
+ @Override
public IModificationStatus getToolChainModificationStatus(ITool[] removed, ITool[] added){
ITool[][] checked = checkDups(removed, added);
removed = checked[0];
@@ -1193,6 +1213,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
return new ModificationStatus(unspecifiedRequiredProps, unspecifiedProps, undefinedSet, conflicting, nonManagedTools);
}
+ @Override
public boolean supportsBuild(boolean managed) {
if(getRequiredUnspecifiedProperties().size() != 0)
return false;
@@ -1210,6 +1231,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
return true;
}
+ @Override
public boolean buildsFileType(String srcExt) {
// Check to see if there is a rule to build a file with this extension
ITool[] tools = getFilteredTools();
@@ -1221,6 +1243,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
return false;
}
+ @Override
public String getOutputExtension(String resourceExtension) {
String outputExtension = null;
ITool[] tools = getFilteredTools();
@@ -1233,6 +1256,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
return null;
}
+ @Override
public boolean isHeaderFile(String ext) {
// Check to see if there is a rule to build a file with this extension
IManagedProject manProj = getParent().getManagedProject();
@@ -1376,6 +1400,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
setRebuildState(true);
}
+ @Override
public boolean isSupported(){
if(toolChain != null)
return toolChain.isSupported();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GnuConfigurationNameProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GnuConfigurationNameProvider.java
index 7b24a4c091..2a4fab7a0a 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GnuConfigurationNameProvider.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GnuConfigurationNameProvider.java
@@ -19,6 +19,7 @@ public class GnuConfigurationNameProvider implements IConfigurationNameProvider
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfigurationNameProvider#getUniqueConfigurationName(org.eclipse.cdt.managedbuilder.core.IConfiguration, java.lang.String[])
*/
+ @Override
public String getNewConfigurationName(IConfiguration configuration,
String[] usedConfigurationNames) {
// TODO Auto-generated method stub
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilder.java
index 30da79450e..dea699185f 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilder.java
@@ -258,6 +258,7 @@ public class HeadlessBuilder implements IApplication {
final Map<String, String> map = BuilderFactory.createBuildArgs(configs);
IWorkspaceRunnable op = new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
ICommand[] commands = proj.getDescription().getBuildSpec();
monitor.beginTask("", commands.length); //$NON-NLS-1$
@@ -390,6 +391,7 @@ public class HeadlessBuilder implements IApplication {
return result;
}
+ @Override
public Object start(IApplicationContext context) throws Exception {
// Build result: whether projects were built successfully
boolean buildSuccessful = true;
@@ -792,6 +794,7 @@ public class HeadlessBuilder implements IApplication {
}
}
+ @Override
public void stop() {
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HoldsOptions.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HoldsOptions.java
index d5dc41705a..c7bd60b56a 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HoldsOptions.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HoldsOptions.java
@@ -37,20 +37,20 @@ import org.eclipse.core.runtime.Status;
/**
* Implements the functionality that is needed to hold options and option
- * categories. In CDT 3.0, the functionality has been moved from ITool and
+ * categories. In CDT 3.0, the functionality has been moved from ITool and
* Tool to this class.
- *
+ *
* This class is intended to be used as base class for all MBS grammar
* elements that can hold Options and Option Categories. These are currently
- * Tool and ToolChain.
- *
- * Note that the member <code>superClass</code> must be shared with the
- * derived class. This requires to wrap this member by access functions
+ * Tool and ToolChain.
+ *
+ * Note that the member <code>superClass</code> must be shared with the
+ * derived class. This requires to wrap this member by access functions
* in the derived class or frequent casts, because the type of <code>superClass</code>
- * in <code>HoldsOptions</code> must be <code>IHoldOptions</code>. Further
+ * in <code>HoldsOptions</code> must be <code>IHoldOptions</code>. Further
* note that the member <code>resolved</code> must inherit the value of its
* derived class. This achieved through the constructor.
- *
+ *
* @since 3.0
*/
public abstract class HoldsOptions extends BuildObject implements IHoldsOptions, IBuildPropertiesRestriction, IBuildPropertyChangeListener {
@@ -69,33 +69,33 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
// Miscellaneous
private boolean isDirty = false;
private boolean rebuildState;
-
+
/*
* C O N S T R U C T O R S
*/
-
+
@SuppressWarnings("unused")
private HoldsOptions() {
// prevent accidental construction of class without setting up
// resolved
}
-
+
protected HoldsOptions(boolean resolved) {
this.resolved = resolved;
}
-
+
/**
* Copies children of <code>HoldsOptions</code>. Helper function for
* derived constructors.
- *
- * @param source The children of the source will be cloned and added
+ *
+ * @param source The children of the source will be cloned and added
* to the class itself.
*/
protected void copyChildren(HoldsOptions source) {
// Note: This function ignores OptionCategories since they should not be
// found on an non-extension tools
-
+
boolean copyIds = id.equals(source.id);
if (source.optionMap != null) {
for (Option option : source.getOptionCollection()) {
@@ -113,22 +113,22 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
addOption(newOption);
}
}
-
+
if(copyIds){
isDirty = source.isDirty;
rebuildState = source.rebuildState;
}
}
-
+
void copyNonoverriddenSettings(HoldsOptions ho){
if (ho.optionMap == null || ho.optionMap.size() == 0)
return;
-
+
IOption options[] = getOptions();
for(int i = 0; i < options.length; i++){
if(!options[i].getParent().equals(ho))
continue;
-
+
Option option = (Option)options[i];
int nnn = ManagedBuildManager.getRandomNumber();
String subId;
@@ -145,16 +145,16 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
}
}
-
+
/*
* E L E M E N T A T T R I B U T E R E A D E R S A N D W R I T E R S
*/
/**
* Load child element from XML element if it is of the correct type
- *
+ *
* @param element which is loaded as child only iff it is of the correct type
- * @return true when a child has been loaded, false otherwise
+ * @return true when a child has been loaded, false otherwise
*/
protected boolean loadChild(ICStorageElement element) {
if (element.getName().equals(IHoldsOptions.OPTION)) {
@@ -170,9 +170,9 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
/**
* Load child element from configuration element if it is of the correct type
- *
+ *
* @param element which is loaded as child only iff it is of the correct type
- * @return true when a child has been loaded, false otherwise
+ * @return true when a child has been loaded, false otherwise
*/
protected boolean loadChild(IManagedConfigElement element) {
if (element.getName().equals(IHoldsOptions.OPTION)) {
@@ -185,11 +185,11 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
}
return false;
}
-
+
/**
* Persist the tool to the XML storage element. Intended to be called by derived
* class only, thus do not handle exceptions.
- *
+ *
* @param element where to serialize the tool
*/
protected void serialize(ICStorageElement element) throws BuildException {
@@ -199,21 +199,22 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
((OptionCategory)optCat).serialize(optCatElement);
}
}
-
+
Collection<Option> optionElements = getOptionCollection();
for (Option option : optionElements) {
ICStorageElement optionElement = element.createChild(OPTION);
option.serialize(optionElement);
}
}
-
+
/*
* M E T H O D S M O V E D F R O M I T O O L I N 3 . 0
*/
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#createOption(IOption, String, String, boolean)
*/
+ @Override
public IOption createOption(IOption superClass, String Id, String name, boolean isExtensionElement) {
Option option = new Option(this, superClass, Id, name, isExtensionElement);
addOption(option);
@@ -223,10 +224,11 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
}
return option;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#createOptions(IHoldsOptions)
*/
+ @Override
public void createOptions(IHoldsOptions superClass) {
for (Option optionChild : ((HoldsOptions)superClass).getOptionCollection()) {
int nnn = ManagedBuildManager.getRandomNumber();
@@ -234,27 +236,29 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
createOption(optionChild, subId, optionChild.getName(), false);
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#removeOption(IOption)
*/
+ @Override
public void removeOption(IOption option) {
if(option.getParent() != this)
return;
// throw new IllegalArgumentException();
-
+
getOptionMap().remove(option.getId());
setDirty(true);
setRebuildState(true);
-
+
if(!isExtensionElement()){
NotificationManager.getInstance().optionRemoved(getParentResourceInfo(), this, option);
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#getOptions()
*/
+ @Override
public IOption[] getOptions() {
IOption[] options = null;
// Merge our options with our superclass' options.
@@ -288,7 +292,7 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
IOption[] newOptions = new IOption[options.length + 1];
for (int k = 0; k < options.length; k++) {
newOptions[k] = options[k];
- }
+ }
newOptions[j] = ourOpt;
options = newOptions;
}
@@ -313,7 +317,7 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
newOptions[j] = options[i];
j++;
}
- }
+ }
options = newOptions;
}
return options;
@@ -322,6 +326,7 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#getOption(java.lang.String)
*/
+ @Override
public IOption getOption(String id) {
return getOptionById(id);
}
@@ -329,6 +334,7 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#getOptionById(java.lang.String)
*/
+ @Override
public IOption getOptionById(String id) {
IOption opt = getOptionMap().get(id);
if (opt == null) {
@@ -343,9 +349,10 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
/* (non-Javadoc)
* org.eclipse.cdt.managedbuilder.core.IHoldsOptions#getOptionBySuperClassId(java.lang.String)
*/
+ @Override
public IOption getOptionBySuperClassId(String optionId) {
if (optionId == null) return null;
-
+
// Look for an option with this ID, or an option with a superclass with this id
IOption[] options = getOptions();
for (IOption targetOption : options) {
@@ -353,17 +360,18 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
do {
if (optionId.equals(option.getId())) {
return targetOption.isValid() ? targetOption : null;
- }
+ }
option = option.getSuperClass();
} while (option != null);
}
-
+
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#getChildCategories()
*/
+ @Override
public IOptionCategory[] getChildCategories() {
IOptionCategory[] superCats = EMPTY_CATEGORIES;
IOptionCategory[] ourCats = EMPTY_CATEGORIES;
@@ -390,7 +398,7 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
// Nothing found, return EMPTY_CATEGORIES
return EMPTY_CATEGORIES;
}
-
+
/*
* M E T H O D S M O V E D F R O M T O O L I N 3 . 0
*/
@@ -404,13 +412,13 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
}
return categoryIds;
}
-
+
public void addChildCategory(IOptionCategory category) {
if (childOptionCategories == null)
childOptionCategories = new ArrayList<IOptionCategory>();
childOptionCategories.add(category);
}
-
+
public void addOption(Option option) {
getOptionMap().put(option.getId(), option);
}
@@ -423,7 +431,7 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
}
return categoryMap;
}
-
+
/**
* Memory-safe way to access the list of options
*/
@@ -433,7 +441,7 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
return optionMap.values();
else return Collections.emptyList();
}
-
+
/**
* Memory-safe way to access the list of IDs to options
*/
@@ -447,6 +455,7 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
/* (non-Javadoc)
* org.eclipse.cdt.managedbuilder.core.IHoldsOptions#addOptionCategory()
*/
+ @Override
public void addOptionCategory(IOptionCategory category) {
// To preserve the order of the categories, record the ids in the order they are read
getCategoryIds().add(category.getId());
@@ -457,6 +466,7 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
/* (non-Javadoc)
* org.eclipse.cdt.managedbuilder.core.IHoldsOptions#getOptionCategory()
*/
+ @Override
public IOptionCategory getOptionCategory(String id) {
IOptionCategory cat = getCategoryMap().get(id);
if (cat == null && superClass != null) {
@@ -464,25 +474,25 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
return superClass.getOptionCategory(id);
}
return cat;
- }
-
+ }
+
/*
* O B J E C T S T A T E M A I N T E N A N C E
*/
-
+
/**
* Implements isDirty() for children of HoldsOptions. Intended to be
* called by derived class.
*/
protected boolean isDirty() {
// If I need saving, just say yes
- if (isDirty)
+ if (isDirty)
return true;
-
+
for (Option option : getOptionCollection())
- if (option.isDirty())
+ if (option.isDirty())
return true;
-
+
return isDirty;
}
@@ -499,7 +509,7 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
option.setDirty(false);
}
}
-
+
/**
* Resolve the element IDs to interface references. Intended to be
* called by derived class.
@@ -522,12 +532,13 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
((OptionCategory)current).resolveReferences();
}
}
- }
+ }
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#getOptionToSet(org.eclipse.cdt.managedbuilder.core.IOption, boolean)
*/
+ @Override
public IOption getOptionToSet(IOption option, boolean adjustExtension) throws BuildException{
IOption setOption = null;
// start changes
@@ -539,14 +550,14 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
if (op == null) {
ManagedBuilderCorePlugin.log(
new Status(
- IStatus.ERROR,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
- IStatus.OK,
+ IStatus.ERROR,
+ ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ IStatus.OK,
"Cannot get OptionToSet for option " + //$NON-NLS-1$
option.getId() + " @ holder " + //$NON-NLS-1$
option.getOptionHolder().getId() + "\nI'm holder " + //$NON-NLS-1$
getId(),
- null)
+ null)
);
} else
option = op;
@@ -554,10 +565,10 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
option = op;
}
// end changes
-
+
if(adjustExtension){
for(; option != null && !option.isExtensionElement(); option=option.getSuperClass()){}
-
+
if(option != null){
IHoldsOptions holder = option.getOptionHolder();
if(holder == this)
@@ -572,7 +583,7 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
String version = ManagedBuildManager.getVersionFromIdAndVersion(newSuperClass.getId());
String baseId = ManagedBuildManager.getIdFromIdAndVersion(newSuperClass.getId());
if ( version != null) {
- subId = baseId + ".adjusted." + new Integer(ManagedBuildManager.getRandomNumber()) + "_" + version; //$NON-NLS-1$ //$NON-NLS-2$
+ subId = baseId + ".adjusted." + new Integer(ManagedBuildManager.getRandomNumber()) + "_" + version; //$NON-NLS-1$ //$NON-NLS-2$
} else {
subId = baseId + ".adjusted." + new Integer(ManagedBuildManager.getRandomNumber()); //$NON-NLS-1$
}
@@ -589,11 +600,11 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
for(;
newSuperClass != null && !newSuperClass.isExtensionElement();
newSuperClass = newSuperClass.getSuperClass()){}
-
+
if (((Option)newSuperClass).wasOptRef()) {
newSuperClass = newSuperClass.getSuperClass();
}
-
+
if(((Option)newSuperClass).isAdjustedExtension()){
newSuperClass = newSuperClass.getSuperClass();
}
@@ -606,17 +617,18 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
}
return setOption;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#needsRebuild()
*/
+ @Override
public boolean needsRebuild() {
if(rebuildState)
return true;
-
+
// Otherwise see if any options need saving
for (Option option : getOptionCollection())
- if (option.needsRebuild())
+ if (option.needsRebuild())
return true;
// Bug 318331 If the parent needs a rebuild, then we do too as we may inherit options from our superClass...
@@ -629,9 +641,10 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#setRebuildState(boolean)
*/
+ @Override
public void setRebuildState(boolean rebuild) {
rebuildState = rebuild;
-
+
// Propagate "false" to the children
if (!rebuildState)
for (Option option : getOptionCollection())
@@ -639,27 +652,29 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
option.setRebuildState(false);
}
+ @Override
public void propertiesChanged() {
if(isExtensionElement())
return;
adjustOptions(false);
}
-
+
public void adjustOptions(boolean extensions){
IOption options[] = getOptions();
-
+
for (IOption opt : options) {
if (opt.isExtensionElement()) {
Option option = (Option)opt;
- BooleanExpressionApplicabilityCalculator calc =
+ BooleanExpressionApplicabilityCalculator calc =
option.getBooleanExpressionCalculator(extensions);
-
+
if(calc != null)
calc.adjustOption(getParentResourceInfo(),this,option, extensions);
}
}
}
+ @Override
public boolean supportsType(String type) {
IOption options[] = getOptions();
boolean supports = false;
@@ -677,6 +692,7 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
return supportsType(type.getId());
}
+ @Override
public boolean supportsValue(String type, String value){
IOption options[] = getOptions();
boolean supports = false;
@@ -694,11 +710,12 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
IBuildPropertyValue value) {
return supportsValue(type.getId(), value.getId());
}
-
- public abstract boolean isExtensionElement();
-
+
+ public abstract boolean isExtensionElement();
+
protected abstract IResourceInfo getParentResourceInfo();
+ @Override
public String[] getRequiredTypeIds() {
List<String> list = new ArrayList<String>();
for(IOption op : getOptions())
@@ -706,6 +723,7 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
return list.toArray(new String[list.size()]);
}
+ @Override
public String[] getSupportedTypeIds() {
List<String> list = new ArrayList<String>();
for(IOption op : getOptions())
@@ -713,6 +731,7 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
return list.toArray(new String[list.size()]);
}
+ @Override
public String[] getSupportedValueIds(String typeId) {
List<String> list = new ArrayList<String>();
for(IOption op : getOptions())
@@ -720,6 +739,7 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
return list.toArray(new String[list.size()]);
}
+ @Override
public boolean requiresType(String typeId) {
IOption options[] = getOptions();
boolean requires = false;
@@ -732,17 +752,17 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
}
return requires;
}
-
+
boolean hasCustomSettings(){
if(superClass == null)
return true;
-
+
if(optionMap != null && optionMap.size() != 0){
for(Option option : getOptionCollection())
if(option.hasCustomSettings())
return true;
}
-
+
return false;
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputOrder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputOrder.java
index c9b4b7bddd..92706f009e 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputOrder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputOrder.java
@@ -29,16 +29,16 @@ public class InputOrder implements IInputOrder {
private boolean fIsExtensionInputOrder = false;
private boolean fIsDirty = false;
private boolean fResolved = true;
- private boolean fRebuildState;
+ private boolean fRebuildState;
/*
* C O N S T R U C T O R S
*/
-
+
/**
- * This constructor is called to create an InputOrder defined by an extension point in
+ * This constructor is called to create an InputOrder defined by an extension point in
* a plugin manifest file, or returned by a dynamic element provider
- *
+ *
* @param parent The IInputType parent of this InputOrder
* @param element The InputOrder definition from the manifest file or a dynamic element
* provider
@@ -46,7 +46,7 @@ public class InputOrder implements IInputOrder {
public InputOrder(IInputType parent, IManagedConfigElement element) {
this.fParent = parent;
fIsExtensionInputOrder = true;
-
+
// setup for resolving
fResolved = false;
@@ -54,9 +54,9 @@ public class InputOrder implements IInputOrder {
}
/**
- * This constructor is called to create an InputOrder whose attributes and children will be
+ * This constructor is called to create an InputOrder whose attributes and children will be
* added by separate calls.
- *
+ *
* @param parent The parent of the an InputOrder
* @param isExtensionElement Indicates whether this is an extension element or a managed project element
*/
@@ -69,30 +69,30 @@ public class InputOrder implements IInputOrder {
}
/**
- * Create an <code>InputOrder</code> based on the specification stored in the
+ * Create an <code>InputOrder</code> based on the specification stored in the
* project file (.cdtbuild).
- *
- * @param parent The <code>ITool</code> the InputOrder will be added to.
+ *
+ * @param parent The <code>ITool</code> the InputOrder will be added to.
* @param element The XML element that contains the InputOrder settings.
*/
public InputOrder(IInputType parent, ICStorageElement element) {
this.fParent = parent;
fIsExtensionInputOrder = false;
-
+
// Initialize from the XML attributes
loadFromProject(element);
}
/**
* Create an <code>InputOrder</code> based upon an existing InputOrder.
- *
+ *
* @param parent The <code>IInputType</code> the InputOrder will be added to.
* @param inputOrder The existing InputOrder to clone.
*/
public InputOrder(IInputType parent, InputOrder inputOrder) {
this.fParent = parent;
fIsExtensionInputOrder = false;
-
+
// Copy the remaining attributes
if (inputOrder.fPath != null) {
fPath = new String(inputOrder.fPath);
@@ -105,7 +105,7 @@ public class InputOrder implements IInputOrder {
if (inputOrder.fExcluded != null) {
fExcluded = new Boolean(inputOrder.fExcluded.booleanValue());
}
-
+
setDirty(true);
setRebuildState(true);
}
@@ -113,46 +113,46 @@ public class InputOrder implements IInputOrder {
/*
* E L E M E N T A T T R I B U T E R E A D E R S A N D W R I T E R S
*/
-
+
/* (non-Javadoc)
- * Loads the InputOrder information from the ManagedConfigElement specified in the
+ * Loads the InputOrder information from the ManagedConfigElement specified in the
* argument.
- *
- * @param element Contains the InputOrder information
+ *
+ * @param element Contains the InputOrder information
*/
protected void loadFromManifest(IManagedConfigElement element) {
// path
- fPath = SafeStringInterner.safeIntern(element.getAttribute(IInputOrder.PATH));
+ fPath = SafeStringInterner.safeIntern(element.getAttribute(IInputOrder.PATH));
// order
- fOrder = SafeStringInterner.safeIntern(element.getAttribute(IInputOrder.ORDER));
-
+ fOrder = SafeStringInterner.safeIntern(element.getAttribute(IInputOrder.ORDER));
+
// excluded
String isEx = element.getAttribute(IInputOrder.EXCLUDED);
if (isEx != null){
fExcluded = new Boolean("true".equals(isEx)); //$NON-NLS-1$
}
}
-
+
/* (non-Javadoc)
- * Initialize the InputOrder information from the XML element
+ * Initialize the InputOrder information from the XML element
* specified in the argument
- *
- * @param element An XML element containing the InputOrder information
+ *
+ * @param element An XML element containing the InputOrder information
*/
protected void loadFromProject(ICStorageElement element) {
-
+
// path
if (element.getAttribute(IInputOrder.PATH) != null) {
fPath = SafeStringInterner.safeIntern(element.getAttribute(IInputOrder.PATH));
}
-
+
// order
if (element.getAttribute(IInputOrder.ORDER) != null) {
fOrder = SafeStringInterner.safeIntern(element.getAttribute(IInputOrder.ORDER));
}
-
+
// excluded
if (element.getAttribute(IInputOrder.EXCLUDED) != null) {
String isEx = element.getAttribute(IInputOrder.EXCLUDED);
@@ -174,11 +174,11 @@ public class InputOrder implements IInputOrder {
if (fOrder != null) {
element.setAttribute(IInputOrder.ORDER, fOrder);
}
-
+
if (fExcluded != null) {
element.setAttribute(IInputOrder.EXCLUDED, fExcluded.toString());
}
-
+
// I am clean now
fIsDirty = false;
}
@@ -190,6 +190,7 @@ public class InputOrder implements IInputOrder {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputOrder#getParent()
*/
+ @Override
public IInputType getParent() {
return fParent;
}
@@ -201,6 +202,7 @@ public class InputOrder implements IInputOrder {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputOrder#getPsth()
*/
+ @Override
public String getPath() {
return fPath;
}
@@ -208,6 +210,7 @@ public class InputOrder implements IInputOrder {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputOrder#setPath()
*/
+ @Override
public void setPath(String newPath) {
if (fPath == null && newPath == null) return;
if (fPath == null || newPath == null || !(fPath.equals(newPath))) {
@@ -220,6 +223,7 @@ public class InputOrder implements IInputOrder {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputOrder#getOrder()
*/
+ @Override
public String getOrder() {
return fOrder;
}
@@ -227,6 +231,7 @@ public class InputOrder implements IInputOrder {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputOrder#setOrder()
*/
+ @Override
public void setOrder(String newOrder) {
if (fOrder == null && newOrder == null) return;
if (fOrder == null || newOrder == null || !(fOrder.equals(newOrder))) {
@@ -239,6 +244,7 @@ public class InputOrder implements IInputOrder {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputOrder#getExcluded()
*/
+ @Override
public boolean getExcluded() {
return fExcluded.booleanValue();
}
@@ -246,6 +252,7 @@ public class InputOrder implements IInputOrder {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputOrder#setExcluded()
*/
+ @Override
public void setExcluded(boolean b) {
if (fExcluded == null || !(b == fExcluded.booleanValue())) {
fExcluded = new Boolean(b);
@@ -258,7 +265,7 @@ public class InputOrder implements IInputOrder {
/*
* O B J E C T S T A T E M A I N T E N A N C E
*/
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IInputOrder#isExtensionElement()
*/
@@ -269,6 +276,7 @@ public class InputOrder implements IInputOrder {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IInputOrder#isDirty()
*/
+ @Override
public boolean isDirty() {
// This shouldn't be called for an extension InputOrder
if (fIsExtensionInputOrder) return false;
@@ -278,10 +286,11 @@ public class InputOrder implements IInputOrder {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IInputOrder#setDirty(boolean)
*/
+ @Override
public void setDirty(boolean isDirty) {
this.fIsDirty = isDirty;
}
-
+
/* (non-Javadoc)
* Resolve the element IDs to interface references
*/
@@ -290,15 +299,15 @@ public class InputOrder implements IInputOrder {
fResolved = true;
}
}
-
+
public boolean needsRebuild(){
return fRebuildState;
}
-
+
public void setRebuildState(boolean rebuild){
if(isExtensionElement() && rebuild)
return;
-
+
fRebuildState = rebuild;
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java
index ed604f39d2..7932e7b2f3 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java
@@ -42,9 +42,9 @@ import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
-import org.osgi.framework.Version;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.core.runtime.content.IContentTypeManager;
+import org.osgi.framework.Version;
public class InputType extends BuildObject implements IInputType {
@@ -731,6 +731,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#getParent()
*/
+ @Override
public ITool getParent() {
return parent;
}
@@ -738,6 +739,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#createInputOrder()
*/
+ @Override
public IInputOrder createInputOrder(String path) {
InputOrder inputOrder = new InputOrder(this, false);
inputOrder.setPath(path);
@@ -749,6 +751,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#getInputOrders()
*/
+ @Override
public IInputOrder[] getInputOrders() {
return getInputOrderList().toArray(new IInputOrder[0]);
}
@@ -756,6 +759,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#getInputOrder()
*/
+ @Override
public IInputOrder getInputOrder(String path) {
// TODO Convert both paths to absolute?
for (InputOrder io : getInputOrderList()) {
@@ -769,6 +773,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#removeInputOrder()
*/
+ @Override
public void removeInputOrder(String path) {
IInputOrder order = getInputOrder(path);
if (order != null) removeInputOrder(order);
@@ -777,6 +782,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#removeInputOrder()
*/
+ @Override
public void removeInputOrder(IInputOrder element) {
getInputOrderList().remove(element);
setDirty(true);
@@ -785,6 +791,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#createAdditionalInput()
*/
+ @Override
public IAdditionalInput createAdditionalInput(String paths) {
AdditionalInput addlInput = new AdditionalInput(this, false);
addlInput.setPaths(paths);
@@ -803,6 +810,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#getAdditionalInputs()
*/
+ @Override
public IAdditionalInput[] getAdditionalInputs() {
return getAdditionalInputList().toArray(new IAdditionalInput[0]);
}
@@ -810,6 +818,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#getAdditionalInput()
*/
+ @Override
public IAdditionalInput getAdditionalInput(String paths) {
// TODO Convert both paths to absolute?
// Must match all strings
@@ -834,6 +843,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#removeAdditionalInput()
*/
+ @Override
public void removeAdditionalInput(String path) {
IAdditionalInput input = getAdditionalInput(path);
if (input != null) removeAdditionalInput(input);
@@ -842,6 +852,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#removeAdditionalInput()
*/
+ @Override
public void removeAdditionalInput(IAdditionalInput element) {
getAdditionalInputList().remove(element);
setDirty(true);
@@ -850,6 +861,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#getAdditionalDependencies()
*/
+ @Override
public IPath[] getAdditionalDependencies() {
List<IPath> deps = new ArrayList<IPath>();
for (AdditionalInput additionalInput : getAdditionalInputList()) {
@@ -872,6 +884,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#getAdditionalResources()
*/
+ @Override
public IPath[] getAdditionalResources() {
List<IPath> ins = new ArrayList<IPath>();
for (AdditionalInput additionalInput : getAdditionalInputList()) {
@@ -919,6 +932,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IInputType#getSuperClass()
*/
+ @Override
public IInputType getSuperClass() {
return superClass;
}
@@ -934,6 +948,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#getBuildVariable()
*/
+ @Override
public String getBuildVariable() {
if (buildVariable == null) {
// If I have a superClass, ask it
@@ -949,6 +964,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#setBuildVariable()
*/
+ @Override
public void setBuildVariable(String variableName) {
if (variableName == null && buildVariable == null) return;
if (buildVariable == null || variableName == null || !(variableName.equals(buildVariable))) {
@@ -961,6 +977,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#getDependencyContentType()
*/
+ @Override
public IContentType getDependencyContentType() {
if (dependencyContentType == null) {
if (superClass != null) {
@@ -975,6 +992,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#setDependencyContentType()
*/
+ @Override
public void setDependencyContentType(IContentType type) {
if (dependencyContentType != type) {
dependencyContentType = type;
@@ -991,6 +1009,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#getDependencyExtensionsAttribute()
*/
+ @Override
public String[] getDependencyExtensionsAttribute() {
if (dependencyExtensions == null || dependencyExtensions.size() == 0) {
// If I have a superClass, ask it
@@ -1008,6 +1027,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#setDependencyExtensionsAttribute()
*/
+ @Override
public void setDependencyExtensionsAttribute(String extensions) {
getDependencyExtensionsList().clear();
if (extensions != null) {
@@ -1023,6 +1043,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#getDependencyExtensions()
*/
+ @Override
public String[] getDependencyExtensions(ITool tool) {
// Use content type if specified and registered with Eclipse
IContentType type = getDependencyContentType();
@@ -1057,6 +1078,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#isDependencyExtension()
*/
+ @Override
public boolean isDependencyExtension(ITool tool, String ext) {
String[] exts = getDependencyExtensions(tool);
for (String depExt : exts) {
@@ -1075,6 +1097,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#getDependencyGenerator()
*/
+ @Override
public IManagedDependencyGeneratorType getDependencyGenerator() {
if (dependencyGenerator != null) {
return dependencyGenerator;
@@ -1115,6 +1138,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#getMultipleOfType()
*/
+ @Override
public boolean getMultipleOfType() {
if (multipleOfType == null) {
if (superClass != null) {
@@ -1129,6 +1153,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#setMultipleOfType()
*/
+ @Override
public void setMultipleOfType(boolean b) {
if (multipleOfType == null || !(b == multipleOfType.booleanValue())) {
multipleOfType = new Boolean(b);
@@ -1140,6 +1165,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#getPrimaryInput()
*/
+ @Override
public boolean getPrimaryInput() {
if (primaryInput == null) {
if (superClass != null) {
@@ -1154,6 +1180,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#setMultipleOfType()
*/
+ @Override
public void setPrimaryInput(boolean b) {
if (primaryInput == null || !(b == primaryInput.booleanValue())) {
primaryInput = new Boolean(b);
@@ -1165,6 +1192,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#getOptionId()
*/
+ @Override
public String getOptionId() {
if (optionId == null) {
if (superClass != null) {
@@ -1179,6 +1207,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#setOptionId()
*/
+ @Override
public void setOptionId(String id) {
if (id == null && optionId == null) return;
if (id == null || optionId == null || !(optionId.equals(id))) {
@@ -1191,6 +1220,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#getAssignToOptionId()
*/
+ @Override
public String getAssignToOptionId() {
if (assignToOptionId == null) {
if (superClass != null) {
@@ -1205,6 +1235,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#setAssignToOptionId()
*/
+ @Override
public void setAssignToOptionId(String id) {
if (id == null && assignToOptionId == null) return;
if (id == null || assignToOptionId == null || !(assignToOptionId.equals(id))) {
@@ -1217,6 +1248,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#getSourceContentType()
*/
+ @Override
public IContentType getSourceContentType() {
IContentType[] types = getSourceContentTypes();
@@ -1226,6 +1258,7 @@ public class InputType extends BuildObject implements IInputType {
return null;
}
+ @Override
public IContentType[] getSourceContentTypes() {
if (sourceContentTypes == null) {
if (superClass != null) {
@@ -1237,6 +1270,7 @@ public class InputType extends BuildObject implements IInputType {
return sourceContentTypes.clone();
}
+ @Override
public IContentType[] getHeaderContentTypes() {
if (headerContentTypes == null) {
if (superClass != null) {
@@ -1248,6 +1282,7 @@ public class InputType extends BuildObject implements IInputType {
return headerContentTypes.clone();
}
+ @Override
public String[] getHeaderExtensionsAttribute() {
if (headerExtensions == null) {
if (superClass != null) {
@@ -1261,6 +1296,7 @@ public class InputType extends BuildObject implements IInputType {
+ @Override
public String[] getHeaderContentTypeIds() {
if (headerContentTypeIds == null) {
if (superClass != null) {
@@ -1272,6 +1308,7 @@ public class InputType extends BuildObject implements IInputType {
return headerContentTypeIds.clone();
}
+ @Override
public String[] getSourceContentTypeIds() {
if (sourceContentTypeIds == null) {
if (superClass != null) {
@@ -1283,6 +1320,7 @@ public class InputType extends BuildObject implements IInputType {
return sourceContentTypeIds.clone();
}
+ @Override
public void setHeaderContentTypeIds(String[] ids) {
if(!Arrays.equals(headerContentTypeIds, ids)){
headerContentTypeIds = ids != null ?
@@ -1293,6 +1331,7 @@ public class InputType extends BuildObject implements IInputType {
}
}
+ @Override
public void setHeaderExtensionsAttribute(String[] extensions) {
if(!Arrays.equals(headerExtensions, extensions)){
headerExtensions = extensions != null ?
@@ -1303,6 +1342,7 @@ public class InputType extends BuildObject implements IInputType {
}
}
+ @Override
public void setSourceContentTypeIds(String[] ids) {
if(!Arrays.equals(sourceContentTypeIds, ids)){
sourceContentTypeIds = ids != null ?
@@ -1313,6 +1353,7 @@ public class InputType extends BuildObject implements IInputType {
}
}
+ @Override
public void setSourceExtensionsAttribute(String[] extensions) {
if(!Arrays.equals(inputExtensions, extensions)){
inputExtensions = extensions != null ?
@@ -1326,6 +1367,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#setSourceContentType()
*/
+ @Override
public void setSourceContentType(IContentType type) {
if(type == null){
if(sourceContentTypes != null){
@@ -1372,6 +1414,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#getSourceExtensionsAttribute()
*/
+ @Override
public String[] getSourceExtensionsAttribute() {
if( inputExtensions == null ) {
// If I have a superClass, ask it
@@ -1387,6 +1430,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#setSourceExtensionsAttribute()
*/
+ @Override
public void setSourceExtensionsAttribute(String extensions) {
if(extensions == null){
if(inputExtensions != null){
@@ -1413,6 +1457,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#getSourceExtensions()
*/
+ @Override
public String[] getSourceExtensions(ITool tool) {
return getSourceExtensions(tool, ((Tool)tool).getProject());
// // Use content type if specified and registered with Eclipse
@@ -1443,6 +1488,7 @@ public class InputType extends BuildObject implements IInputType {
}
+ @Override
public String[] getHeaderExtensions(ITool tool) {
IContentType types[] = getHeaderContentTypes();
if (types.length != 0) {
@@ -1458,6 +1504,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IInputType#isSourceExtension()
*/
+ @Override
public boolean isSourceExtension(ITool tool, String ext) {
return isSourceExtension(tool, ext, ((Tool)tool).getProject());
}
@@ -1477,6 +1524,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IInputType#isExtensionElement()
*/
+ @Override
public boolean isExtensionElement() {
return isExtensionInputType;
}
@@ -1484,6 +1532,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IInputType#isDirty()
*/
+ @Override
public boolean isDirty() {
// This shouldn't be called for an extension InputType
if (isExtensionInputType) return false;
@@ -1502,6 +1551,7 @@ public class InputType extends BuildObject implements IInputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IInputType#setDirty(boolean)
*/
+ @Override
public void setDirty(boolean isDirty) {
this.isDirty = isDirty;
// Propagate "false" to the children
@@ -1687,6 +1737,7 @@ public class InputType extends BuildObject implements IInputType {
return languageName;
}
+ @Override
public String getLanguageId(ITool tool){
IResourceInfo rcInfo = getRcInfo(tool);
String langId = this.languageId;
@@ -1712,6 +1763,7 @@ public class InputType extends BuildObject implements IInputType {
return langId;
}
+ @Override
public String getLanguageName(ITool tool){
IResourceInfo rcInfo = getRcInfo(tool);
String langName = this.languageName;
@@ -1770,6 +1822,7 @@ public class InputType extends BuildObject implements IInputType {
return langName;
}
+ @Override
public String getDiscoveryProfileId(ITool tool) {
String id = getDiscoveryProfileIdAttribute();
if(id == null){
@@ -1791,10 +1844,12 @@ public class InputType extends BuildObject implements IInputType {
return buildInfoDicsoveryProfileId;
}
+ @Override
public void setLanguageIdAttribute(String id) {
languageId = id;
}
+ @Override
public void setLanguageNameAttribute(String name) {
languageName = name;
}
@@ -1826,7 +1881,7 @@ public class InputType extends BuildObject implements IInputType {
if (superClass!=null && superClass instanceof InputType)
return ((InputType)superClass).hasScannerConfigSettings();
-
+
return false;
}
@@ -1834,10 +1889,10 @@ public class InputType extends BuildObject implements IInputType {
//TODO:
return false;
}
-
+
/**
* The intention is cosmetic - to make debugging easier.
- *
+ *
* @see org.eclipse.cdt.managedbuilder.internal.core.BuildObject#toString()
*/
@Override
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
index 36d0496e8d..3dd1f0ea0a 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
@@ -86,10 +86,10 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
private List<ITarget> targetList;
@Deprecated
private Map<String, ITarget> targetMap;
-
+
private volatile boolean isReadOnly = false;
private volatile boolean bIsContainerInited = false;
-
+
/**
* Basic constructor used when the project is brand new.
@@ -102,14 +102,14 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
isDirty = false;
rebuildNeeded = true;
}
-
+
/**
- * Reads the build information from the project file and creates the
+ * Reads the build information from the project file and creates the
* internal representation of the build settings for the project.
*/
public ManagedBuildInfo(IResource owner, ICStorageElement element, boolean loadConfigs, String managedBuildRevision) {
this(owner);
-
+
// Recreate the managed build project element and its children
ICStorageElement projNodes[] = element.getChildren();
// TODO: There should only be 1?
@@ -123,13 +123,14 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
// Switch the rebuild off since this is an existing project
rebuildNeeded = false;
-
+
version = managedBuildRevision;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#setManagedProject(IManagedProject)
*/
+ @Override
public void setManagedProject(IManagedProject managedProject) {
this.managedProject = managedProject;
//setDirty(true); - It is primarily up to the ManagedProject to maintain the dirty state
@@ -138,6 +139,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getManagedProject()
*/
+ @Override
public IManagedProject getManagedProject() {
return managedProject;
}
@@ -145,25 +147,28 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#buildsFileType(java.lang.String)
*/
+ @Override
public boolean buildsFileType(String srcExt) {
return getDefaultConfiguration().buildsFileType(srcExt);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#getBuildArtifactExtension()
*/
+ @Override
public String getBuildArtifactExtension() {
String ext = new String();
IConfiguration config = getDefaultConfiguration();
if (config != null) {
ext = config.getArtifactExtension();
- }
+ }
return ext;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getBuildArtifactName()
*/
+ @Override
public String getBuildArtifactName() {
// Get the default configuration and use its value
String name = new String();
@@ -177,6 +182,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getCleanCommand()
*/
+ @Override
public String getCleanCommand() {
// Get from the model
String command = new String();
@@ -190,6 +196,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getConfigurationName()
*/
+ @Override
public String getConfigurationName() {
// Return the human-readable name of the default configuration
IConfiguration config = getDefaultConfiguration();
@@ -199,6 +206,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getConfigurationNames()
*/
+ @Override
public String[] getConfigurationNames() {
ArrayList<String> configNames = new ArrayList<String>();
IConfiguration[] configs = managedProject.getConfigurations();
@@ -217,6 +225,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getDefaultConfiguration()
*/
+ @Override
public IConfiguration getDefaultConfiguration() {
// Get the default config associated with the project
/* if (defaultConfig == null) {
@@ -243,17 +252,17 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
return defaultConfig;
*/
IConfiguration activeCfg = findExistingDefaultConfiguration(null);
-
+
if(activeCfg == null){
IConfiguration cfgs[] = managedProject.getConfigurations();
if(cfgs.length != 0)
activeCfg = cfgs[0];
}
-
+
return activeCfg;
-
+
}
-
+
private IConfiguration findExistingDefaultConfiguration(ICProjectDescription des) {
if(des == null)
des = CoreModel.getDefault().getProjectDescription(getOwner().getProject(), false);
@@ -262,22 +271,24 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
ICConfigurationDescription cfgDes = des.getActiveConfiguration();
activeCfg = managedProject.getConfiguration(cfgDes.getId());
}
-
+
return activeCfg;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IScannerInfo#getDefinedSymbols()
*/
+ @Override
public Map<String, String> getDefinedSymbols() {
// Return the defined symbols for the default configuration
HashMap<String, String> symbols = getMacroPathEntries();
- return symbols;
+ return symbols;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#getDependencyGenerator(java.lang.String)
*/
+ @Override
public IManagedDependencyGeneratorType getDependencyGenerator(String sourceExtension) {
// Find the tool and ask the Managed Build Manager for its dep generator
try {
@@ -292,14 +303,14 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
} catch (NullPointerException e) {
return null;
}
-
+
return null;
}
-
+
/* (non-Javadoc)
- * Helper method to extract a list of valid tools that are filtered by the
+ * Helper method to extract a list of valid tools that are filtered by the
* project nature.
- *
+ *
* @return
*/
private ITool[] getFilteredTools() {
@@ -307,17 +318,19 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
IConfiguration config = getDefaultConfiguration();
return config.getFilteredTools();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getFlagsForSource(java.lang.String)
*/
+ @Override
public String getFlagsForSource(String extension) {
return getToolFlagsForSource(extension,null,null);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#getToolFlagsForSource(java.lang.String, org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath)
*/
+ @Override
public String getToolFlagsForSource(String extension, IPath inputLocation, IPath outputLocation){
// Get all the tools for the current config
ITool[] tools = getFilteredTools();
@@ -337,6 +350,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getFlagsForConfiguration(java.lang.String)
*/
+ @Override
public String getFlagsForConfiguration(String extension) {
return getToolFlagsForConfiguration(extension, null, null);
}
@@ -344,10 +358,11 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#getToolFlagsForConfiguration(java.lang.String, org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath)
*/
+ @Override
public String getToolFlagsForConfiguration(String extension, IPath inputLocation, IPath outputLocation){
// Treat null extensions as an empty string
String ext = extension == null ? new String() : extension;
-
+
// Get all the tools for the current config
ITool[] tools = getFilteredTools();
for (int index = 0; index < tools.length; index++) {
@@ -376,30 +391,32 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
if (include.isSystemInclude()) {
IPath entryPath = include.getFullIncludePath();
paths.add(entryPath.toString());
- }
+ }
}
}
} catch (CModelException e) {
- // Just return an empty array
+ // Just return an empty array
paths.clear();
return paths;
}
}
return paths;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IScannerInfo#getIncludePaths()
*/
+ @Override
public String[] getIncludePaths() {
// Return the include paths for the default configuration
ArrayList<String> paths = getIncludePathEntries();
- return paths.toArray(new String[paths.size()]);
+ return paths.toArray(new String[paths.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getLibsForConfiguration(java.lang.String)
*/
+ @Override
public String[] getLibsForConfiguration(String extension) {
return getDefaultConfiguration().getLibs(extension);
}
@@ -420,7 +437,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
macros.clear();
return macros;
}
-
+
}
return macros;
}
@@ -428,12 +445,13 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getMakeArguments()
*/
+ @Override
public String getBuildArguments() {
if (getDefaultConfiguration() != null) {
IToolChain toolChain = getDefaultConfiguration().getToolChain();
IBuilder builder = toolChain.getBuilder();
if (builder != null) {
- return builder.getArguments();
+ return builder.getArguments();
}
}
return new String("-k"); //$NON-NLS-1$
@@ -442,12 +460,13 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getMakeCommand()
*/
+ @Override
public String getBuildCommand() {
if (getDefaultConfiguration() != null) {
IToolChain toolChain = getDefaultConfiguration().getToolChain();
IBuilder builder = toolChain.getBuilder();
if (builder != null) {
- return builder.getCommand();
+ return builder.getCommand();
}
}
return new String("make"); //$NON-NLS-1$
@@ -455,9 +474,10 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getPrebuildStep()
*/
+ @Override
public String getPrebuildStep() {
// Get the default configuration and use its value
String name = new String();
@@ -470,9 +490,10 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getPostbuildStep()
*/
+ @Override
public String getPostbuildStep() {
// Get the default configuration and use its value
String name = new String();
@@ -485,9 +506,10 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getPreannouncebuildStep()
*/
+ @Override
public String getPreannouncebuildStep() {
// Get the default configuration and use its value
String name = new String();
@@ -500,9 +522,10 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getPostannouncebuildStep()
*/
+ @Override
public String getPostannouncebuildStep() {
// Get the default configuration and use its value
String name = new String();
@@ -515,18 +538,20 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getOutputExtension(java.lang.String)
*/
+ @Override
public String getOutputExtension(String resourceExtension) {
return getDefaultConfiguration().getOutputExtension(resourceExtension);
}
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getOutputFlag()
*/
+ @Override
public String getOutputFlag(String outputExt) {
return getDefaultConfiguration().getOutputFlag(outputExt);
}
@@ -534,6 +559,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getOutputPrefix(java.lang.String)
*/
+ @Override
public String getOutputPrefix(String outputExtension) {
return getDefaultConfiguration().getOutputPrefix(outputExtension);
}
@@ -544,10 +570,11 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
public IResource getOwner() {
return owner;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getToolForSource(java.lang.String)
*/
+ @Override
public String getToolForSource(String sourceExtension) {
// Get all the tools for the current config
ITool[] tools = getFilteredTools();
@@ -563,6 +590,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getToolForConfiguration(java.lang.String)
*/
+ @Override
public String getToolForConfiguration(String extension) {
// Treat a null argument as an empty string
String ext = extension == null ? new String() : extension;
@@ -580,6 +608,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getToolFromInputExtension(java.lang.String)
*/
+ @Override
public ITool getToolFromInputExtension(String sourceExtension) {
IConfiguration config = getDefaultConfiguration();
return config.getToolFromInputExtension(sourceExtension);
@@ -588,25 +617,28 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getToolFromOutputExtension(java.lang.String)
*/
+ @Override
public ITool getToolFromOutputExtension(String extension) {
IConfiguration config = getDefaultConfiguration();
return config.getToolFromOutputExtension(extension);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#generateCommandLineInfo(java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String[])
*/
+ @Override
public IManagedCommandLineInfo generateCommandLineInfo(
String sourceExtension, String[] flags, String outputFlag,
String outputPrefix, String outputName, String[] inputResources) {
- return generateToolCommandLineInfo( sourceExtension, flags,
+ return generateToolCommandLineInfo( sourceExtension, flags,
outputFlag, outputPrefix, outputName, inputResources, null, null );
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#generateToolCommandLineInfo(java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String[], org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath)
*/
- public IManagedCommandLineInfo generateToolCommandLineInfo( String sourceExtension, String[] flags,
+ @Override
+ public IManagedCommandLineInfo generateToolCommandLineInfo( String sourceExtension, String[] flags,
String outputFlag, String outputPrefix, String outputName, String[] inputResources, IPath inputLocation, IPath outputLocation ){
return getDefaultConfiguration().generateToolCommandLineInfo(sourceExtension, flags, outputFlag, outputPrefix, outputName, inputResources, inputLocation, outputLocation);
}
@@ -614,6 +646,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#getUserObjectsForConfiguration(java.lang.String)
*/
+ @Override
public String[] getUserObjectsForConfiguration(String extension) {
return getDefaultConfiguration().getUserObjects(extension);
}
@@ -621,12 +654,13 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#getVersion()
*/
+ @Override
public String getVersion() {
return version;
}
/* (non-Javadoc)
- *
+ *
*/
public void initializePathEntries() {
if (!isValid()) return;
@@ -636,41 +670,45 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
} catch (CModelException e) {
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#isDirty()
*/
+ @Override
public boolean isDirty() {
// If the info has been flagged dirty, answer true
if (isDirty) {
return true;
}
-
+
// Check if the project is dirty
if (managedProject != null) {
return managedProject.isDirty();
}
return false;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#isValid()
*/
+ @Override
public boolean isValid() {
// If the info has been flagged as valid, answer true
return isValid;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#isReadOnly()
*/
+ @Override
public boolean isReadOnly(){
return isReadOnly;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#isHeaderFile(java.lang.String)
*/
+ @Override
public boolean isHeaderFile(String ext) {
// Check to see if there is a rule to build a file with this extension
IConfiguration config = getDefaultConfiguration();
@@ -678,27 +716,28 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
}
/**
- *
+ *
* @return boolean
*/
public boolean isContainerInited() {
return bIsContainerInited;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#needsRebuild()
*/
+ @Override
public boolean needsRebuild() {
if (rebuildNeeded) return true;
- if (getDefaultConfiguration() != null) {
+ if (getDefaultConfiguration() != null) {
return getDefaultConfiguration().needsRebuild();
}
return false;
}
-
+
/* (non-Javadoc)
- *
+ *
*/
/* private void persistDefaultConfiguration() {
// Persist the default configuration
@@ -710,9 +749,9 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
// Too bad
}
}
-*/
+*/
/**
- * Write the contents of the build model to the persistent store
+ * Write the contents of the build model to the persistent store
* specified in the argument.
* @deprecated as of CDT 7.0
*/
@@ -737,8 +776,8 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
}
// persistDefaultTarget();
}
-
-
+
+
// Remember the default configuration
// persistDefaultConfiguration();
@@ -749,9 +788,10 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#setDefaultConfiguration(org.eclipse.cdt.core.build.managed.IConfiguration)
*/
+ @Override
public void setDefaultConfiguration(IConfiguration configuration) {
// TODO: This is probably wrong. I'll bet we don't handle the case where all configs are deleted...
- // But, at least, our UI does not allow the last config to be deleted.
+ // But, at least, our UI does not allow the last config to be deleted.
// Sanity
if (configuration == null || configuration.isExtensionElement()) return;
@@ -761,7 +801,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
} catch (CoreException e1) {
ManagedBuilderCorePlugin.log(e1);
}
-
+
if (!configuration.equals(findExistingDefaultConfiguration(des))) {
IProject project = owner.getProject();
if(des == null)
@@ -775,7 +815,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
} catch (CoreException e) {
}
}
-
+
if(activeCfgDes != null){
des.setActiveConfiguration(activeCfgDes);
} else {
@@ -783,7 +823,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
}
}
}
-
+
if(des != null){
try {
BuildSettingsUtil.checkApplyDescription(owner.getProject(), des);
@@ -796,6 +836,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#setDefaultConfiguration(java.lang.String)
*/
+ @Override
public boolean setDefaultConfiguration(String configName) {
if (configName != null) {
// Look for the configuration with the same name as the argument
@@ -814,6 +855,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#setDirty(boolean)
*/
+ @Override
public void setDirty(boolean isDirty) {
// Reset the dirty status here
// and in the managed project
@@ -826,6 +868,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#setValid(boolean)
*/
+ @Override
public void setValid(boolean isValid) {
// Reset the valid status
this.isValid = isValid;
@@ -834,6 +877,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#setReadOnly(boolean)
*/
+ @Override
public void setReadOnly(boolean readOnly){
if(!readOnly && isReadOnly)
setDirty(true);
@@ -843,6 +887,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#setRebuildState(boolean)
*/
+ @Override
public void setRebuildState(boolean rebuild) {
// TODO: Is the appropriate? Should the rebuild state be stored in the project file?
// and in the managed project
@@ -896,13 +941,15 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getSelectedConfiguration()
*/
+ @Override
public IConfiguration getSelectedConfiguration() {
return selectedConfig;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#setSelectedConfiguration(org.eclipse.cdt.core.build.managed.IConfiguration)
*/
+ @Override
public void setSelectedConfiguration(IConfiguration config) {
selectedConfig = config;
}
@@ -911,28 +958,31 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
* Note: "Target" routines are only currently applicable when loading a CDT 2.0
* or earlier managed build project file (.cdtbuild)
*/
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#addTarget(org.eclipse.cdt.core.build.managed.ITarget)
*/
+ @Override
@Deprecated
public void addTarget(ITarget target) {
getTargetMap().put(target.getId(), target);
getTargets().add(target);
setDirty(true);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#removeTarget(java.lang.String)
*/
+ @Override
@Deprecated
public void removeTarget(String id) {
getTargets().remove(getTarget(id));
getTargetMap().remove(id);
setDirty(true);
-
+
}
-
+
+ @Override
@Deprecated
public ITarget getTarget(String id) {
return getTargetMap().get(id);
@@ -940,7 +990,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/* (non-Javadoc)
* Safe accessor.
- *
+ *
* @return Returns the map of IDs to ITargets.
*/
@Deprecated
@@ -955,26 +1005,27 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getTargets(org.eclipse.cdt.core.build.managed.IConfiguration)
* @deprecated
*/
+ @Override
@Deprecated
public List<ITarget> getTargets() {
if (targetList == null) {
targetList = new ArrayList<ITarget>();
}
- return targetList;
+ return targetList;
}
-
+
private String getCWD() {
String cwd = ""; //$NON-NLS-1$
IBuildEnvironmentVariable cwdvar = ManagedBuildManager.getEnvironmentVariableProvider().getVariable("CWD", getDefaultConfiguration(), false, true); //$NON-NLS-1$
if (cwdvar != null) { cwd = cwdvar.getValue().replace('\\','/'); }
return cwd;
}
-
+
/**
*/
private List<String> processPath(List<String> list, String path, int context, Object obj) {
final String EMPTY = ""; //$NON-NLS-1$
- if (path != null) {
+ if (path != null) {
if (context != 0) {
try {
String paths[] = ManagedBuildManager.getBuildMacroProvider().resolveStringListValue(path, EMPTY, " ", context, obj); //$NON-NLS-1$
@@ -989,7 +1040,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
IPath platformPath = optionPathConverter
.convertToPlatformLocation(paths[i], null, null);
paths[i] = platformPath.toOSString();
- }
+ }
}
list.add(checkPath(paths[i]));
}
@@ -1002,7 +1053,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
}
return list;
}
-
+
private IOptionPathConverter getPathConverter(IBuildObject buildObject) {
IOptionPathConverter converter = null ;
if (buildObject instanceof ITool) {
@@ -1021,7 +1072,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
if (p.length()> 1 && p.startsWith(QUOTE) && p.endsWith(QUOTE)) {
p = p.substring(1, p.length()-1);
}
-
+
if ( ".".equals(p) ) { //$NON-NLS-1$
String cwd = getCWD();
if (cwd.length()>0) { p = cwd; }
@@ -1031,7 +1082,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
if (cwd.length()>0) { p = cwd + "/" + p; } //$NON-NLS-1$
}
return p;
-
+
}
/**
@@ -1042,11 +1093,11 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
List<IPathEntry> entries = new ArrayList<IPathEntry>();
int i=0;
IPathEntry[] a = getManagedBuildValues(IPathEntry.CDT_INCLUDE);
- if (a != null) { for (i=0; i<a.length; i++) entries.add(a[i]); }
+ if (a != null) { for (i=0; i<a.length; i++) entries.add(a[i]); }
a = getManagedBuildValues(IPathEntry.CDT_LIBRARY);
- if (a != null) { for (i=0; i<a.length; i++) entries.add(a[i]); }
+ if (a != null) { for (i=0; i<a.length; i++) entries.add(a[i]); }
a = getManagedBuildValues(IPathEntry.CDT_MACRO);
- if (a != null) { for (i=0; i<a.length; i++) entries.add(a[i]); }
+ if (a != null) { for (i=0; i<a.length; i++) entries.add(a[i]); }
return entries.toArray(new IPathEntry[entries.size()]);
}
@@ -1058,65 +1109,65 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
List<IPathEntry> entries = new ArrayList<IPathEntry>();
int i=0;
IPathEntry[] a = getManagedBuildBuiltIns(IPathEntry.CDT_INCLUDE);
- if (a != null) { for (i=0; i<a.length; i++) entries.add(a[i]); }
+ if (a != null) { for (i=0; i<a.length; i++) entries.add(a[i]); }
a = getManagedBuildBuiltIns(IPathEntry.CDT_LIBRARY);
- if (a != null) { for (i=0; i<a.length; i++) entries.add(a[i]); }
+ if (a != null) { for (i=0; i<a.length; i++) entries.add(a[i]); }
a = getManagedBuildBuiltIns(IPathEntry.CDT_MACRO);
- if (a != null) { for (i=0; i<a.length; i++) entries.add(a[i]); }
+ if (a != null) { for (i=0; i<a.length; i++) entries.add(a[i]); }
return entries.toArray(new IPathEntry[entries.size()]);
}
-
+
public IPathEntry[] getManagedBuildValues(int entryType) {
// obtain option values
List<IPathEntry> entries = getOptionValues(entryType, false);
-
- // for includes, get env variables values; useless for other entry types
+
+ // for includes, get env variables values; useless for other entry types
if (entryType == IPathEntry.CDT_INCLUDE) {
IEnvironmentVariableProvider env = ManagedBuildManager.getEnvironmentVariableProvider();
entries = addIncludes(entries, env.getBuildPaths(getDefaultConfiguration(), IEnvVarBuildPath.BUILDPATH_INCLUDE), Path.EMPTY, 0, null);
- }
+ }
return entries.toArray(new IPathEntry[entries.size()]);
}
-
+
public IPathEntry[] getManagedBuildBuiltIns(int entryType) {
List<IPathEntry> entries = getOptionValues(entryType, true);
- return entries.toArray(new IPathEntry[entries.size()]);
+ return entries.toArray(new IPathEntry[entries.size()]);
}
-
+
/**
- *
- * @param entryType - data type to be scanned for
- * @param builtIns - return either values or built-in's
- * @return list of strings which contains all found values
+ *
+ * @param entryType - data type to be scanned for
+ * @param builtIns - return either values or built-in's
+ * @return list of strings which contains all found values
*/
private List<IPathEntry> getOptionValues(int entryType, boolean builtIns) {
- List<IPathEntry> entries = new ArrayList<IPathEntry>();
+ List<IPathEntry> entries = new ArrayList<IPathEntry>();
IConfiguration cfg = getDefaultConfiguration();
-
+
// process config toolchain's options
entries = readToolsOptions(
- entryType,
- entries,
- builtIns,
+ entryType,
+ entries,
+ builtIns,
cfg);
-
-
+
+
// code below (obtaining of resource config values)
// is now commented because resource-related include
// paths are displayed by UI together with config-
// related includes, so paths are duplicated in
// project's "includes" folder.
- //
- // Uncomment following code after UI problem fix.
-/*
+ //
+ // Uncomment following code after UI problem fix.
+/*
// process resource configurations
IResourceConfiguration[] rescfgs = cfg.getResourceConfigurations();
if (rescfgs != null) {
for (int i=0; i<rescfgs.length; i++) {
entries = readToolsOptions(
- entryType,
- entries,
- builtIns,
+ entryType,
+ entries,
+ builtIns,
rescfgs[i]);
}
}
@@ -1125,11 +1176,11 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
}
/**
- *
- * @param entryType - data type: include | library | symbols
+ *
+ * @param entryType - data type: include | library | symbols
* @param entries - list to be affected
- * @param builtIns - whether get actual values or builtins
- * @param obj - object to be processed (ResCfg | Cfg)
+ * @param builtIns - whether get actual values or builtins
+ * @param obj - object to be processed (ResCfg | Cfg)
*/
private List<IPathEntry> readToolsOptions(int entryType, List<IPathEntry> entries, boolean builtIns, IBuildObject obj) {
ITool[] t = null;
@@ -1138,45 +1189,45 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
// check that entryType is correct
if (entryType != IPathEntry.CDT_INCLUDE &&
//TODO: we need to implement the proper CDT_LIBRARY handling
-//calculating the CDT_LIBRARY entries from the managed build
+//calculating the CDT_LIBRARY entries from the managed build
//options is disabled for now, we need to define a new option type
//that will represent library paths
//see bug# 100844
// entryType != IPathEntry.CDT_LIBRARY &&
entryType != IPathEntry.CDT_MACRO) { return entries; }
-
+
// calculate parameters depending of object type
if (obj instanceof IResourceConfiguration) {
resPath = new Path(((IResourceConfiguration)obj).getResourcePath()).removeFirstSegments(1);
t = ((IResourceConfiguration)obj).getToolsToInvoke();
} else if (obj instanceof IConfiguration) {
t = ((IConfiguration)obj).getFilteredTools();
- } else { return entries; } // wrong object passed
+ } else { return entries; } // wrong object passed
if (t == null) { return entries; }
-
+
// process all tools and all their options
for (int i=0; i<t.length; i++) {
IOption[] op = t[i].getOptions();
for (int j=0; j<op.length; j++) {
-
+
// check to see if the option has an applicability calculator
IOptionApplicability applicabilityCalculator = op[j].getApplicabilityCalculator();
if (applicabilityCalculator != null &&
!applicabilityCalculator.isOptionUsedInCommandLine(obj, t[i], op[j])) continue;
-
+
try {
- if (entryType == IPathEntry.CDT_INCLUDE &&
- op[j].getValueType() == IOption.INCLUDE_PATH)
+ if (entryType == IPathEntry.CDT_INCLUDE &&
+ op[j].getValueType() == IOption.INCLUDE_PATH)
{
- OptionContextData ocd = new OptionContextData(op[j], t[i]);
+ OptionContextData ocd = new OptionContextData(op[j], t[i]);
addIncludes(entries, builtIns ? op[j].getBuiltIns() : op[j].getIncludePaths(), resPath, IBuildMacroProvider.CONTEXT_OPTION, ocd);
- } else if (entryType == IPathEntry.CDT_LIBRARY &&
- op[j].getValueType() == IOption.LIBRARIES)
+ } else if (entryType == IPathEntry.CDT_LIBRARY &&
+ op[j].getValueType() == IOption.LIBRARIES)
{
- OptionContextData ocd = new OptionContextData(op[j], t[i]);
+ OptionContextData ocd = new OptionContextData(op[j], t[i]);
addLibraries(entries, builtIns ? op[j].getBuiltIns() : op[j].getLibraries(), resPath, IBuildMacroProvider.CONTEXT_OPTION, ocd);
- } else if (entryType == IPathEntry.CDT_MACRO &&
- op[j].getValueType() == IOption.PREPROCESSOR_SYMBOLS)
+ } else if (entryType == IPathEntry.CDT_MACRO &&
+ op[j].getValueType() == IOption.PREPROCESSOR_SYMBOLS)
{
OptionContextData ocd = new OptionContextData(op[j], t[i]);
addSymbols(entries, builtIns ? op[j].getBuiltIns() : op[j].getDefinedSymbols(), resPath, IBuildMacroProvider.CONTEXT_OPTION, ocd);
@@ -1186,18 +1237,18 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
}
return entries;
}
-
+
protected List<IPathEntry> addIncludes(List<IPathEntry> entries, String[] values, IPath resPath, int context ,Object obj) {
return addPaths(entries, values, resPath, context, obj, IPathEntry.CDT_INCLUDE);
}
-
+
protected List<IPathEntry> addPaths(List<IPathEntry> entries, String[] values, IPath resPath, int context ,Object obj, int type){
if (values != null && values.length > 0) {
List<String> list = new ArrayList<String>();
for (int k=0; k<values.length; k++) {
processPath(list, values[k], context, obj);
}
-
+
Iterator<String> iter = list.iterator();
while(iter.hasNext()){
IPathEntry entry = null;
@@ -1214,11 +1265,11 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
}
return entries;
}
-
+
protected List<IPathEntry> addLibraries(List<IPathEntry> entries, String[] values, IPath resPath, int context, Object obj) {
return addPaths(entries, values, resPath, context, obj, IPathEntry.CDT_LIBRARY);
}
-
+
protected List<IPathEntry> addSymbols(List<IPathEntry> entries, String[] values, IPath resPath, int context, Object obj) {
if (values == null) return entries;
for (int i=0; i<values.length; i++) {
@@ -1230,14 +1281,14 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
createMacroEntry(entries, res[k], resPath);
}
} catch (BuildMacroException e) {
- }
+ }
}
return entries;
}
-
+
private List<IPathEntry> createMacroEntry(List<IPathEntry> entries, String val, IPath resPath){
- if (val != null && val.length() != 0){
-
+ if (val != null && val.length() != 0){
+
String[] tokens = val.split("="); //$NON-NLS-1$
String key = tokens[0].trim();
String value = (tokens.length > 1) ? tokens[1].trim() : new String();
@@ -1246,8 +1297,8 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
Iterator<IPathEntry> entryIter = entries.listIterator();
while (entryIter.hasNext()) {
IPathEntry entry = entryIter.next();
- if (entry.getEntryKind() == IPathEntry.CDT_MACRO) {
- if (((IMacroEntry)entry).getMacroName().equals(key) &&
+ if (entry.getEntryKind() == IPathEntry.CDT_MACRO) {
+ if (((IMacroEntry)entry).getMacroName().equals(key) &&
((IMacroEntry)entry).getMacroValue().equals(value)) {
add = false;
break;
@@ -1258,7 +1309,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
}
return entries;
}
-
+
public void updateRevision(String revision){
if(managedProject != null)
((ManagedProject)managedProject).updateManagedBuildRevision(revision);
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedCommandLineGenerator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedCommandLineGenerator.java
index 12b39c9f5e..04e1524729 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedCommandLineGenerator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedCommandLineGenerator.java
@@ -33,30 +33,30 @@ public class ManagedCommandLineGenerator implements
public final String WILDCARD = "%"; //$NON-NLS-1$
public final String UNDERLINE = "_"; //$NON-NLS-1$
public final String EMPTY = ""; //$NON-NLS-1$
-
+
public final String VAR_FIRST_CHAR = "$"; //$NON-NLS-1$
public final char VAR_SECOND_CHAR = '{';
public final String VAR_FINAL_CHAR = "}"; //$NON-NLS-1$
public final String CLASS_PROPERTY_PREFIX = "get"; //$NON-NLS-1$
-
+
public final String CMD_LINE_PRM_NAME = "COMMAND"; //$NON-NLS-1$
public final String FLAGS_PRM_NAME = "FLAGS"; //$NON-NLS-1$
public final String OUTPUT_FLAG_PRM_NAME = "OUTPUT_FLAG"; //$NON-NLS-1$
public final String OUTPUT_PREFIX_PRM_NAME = "OUTPUT_PREFIX"; //$NON-NLS-1$
public final String OUTPUT_PRM_NAME = "OUTPUT"; //$NON-NLS-1$
public final String INPUTS_PRM_NAME = "INPUTS"; //$NON-NLS-1$
-
+
private static ManagedCommandLineGenerator cmdLineGen;
-
- protected ManagedCommandLineGenerator() {
+
+ protected ManagedCommandLineGenerator() {
cmdLineGen = null;
}
-
+
public static ManagedCommandLineGenerator getCommandLineGenerator() {
if( cmdLineGen == null ) cmdLineGen = new ManagedCommandLineGenerator();
return cmdLineGen;
}
-
+
private String makeVariable(String variableName) {
return "${"+variableName+"}"; //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -64,18 +64,19 @@ public class ManagedCommandLineGenerator implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedCommandLineGenerator#getCommandLineInfo(org.eclipse.cdt.managedbuilder.core.ITool, java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String[], java.lang.String)
*/
+ @Override
public IManagedCommandLineInfo generateCommandLineInfo(ITool tool,
String commandName, String[] flags, String outputFlag,
- String outputPrefix, String outputName,
- String[] inputResources, String commandLinePattern)
+ String outputPrefix, String outputName,
+ String[] inputResources, String commandLinePattern)
{
if( commandLinePattern == null || commandLinePattern.length() <= 0 )
commandLinePattern = Tool.DEFAULT_PATTERN;
-
+
// if the output name isn't a variable then quote it
if(outputName.length()>0 && outputName.indexOf("$(") != 0) //$NON-NLS-1$
outputName = DOUBLE_QUOTE + outputName + DOUBLE_QUOTE;
-
+
String inputsStr=""; //$NON-NLS-1$
if (inputResources!=null) {
for (String inp : inputResources) {
@@ -89,9 +90,9 @@ public class ManagedCommandLineGenerator implements
}
inputsStr = inputsStr.trim();
}
-
+
String flagsStr = stringArrayToString(flags);
-
+
String command = commandLinePattern;
command = command.replace(makeVariable(CMD_LINE_PRM_NAME), commandName);
@@ -100,7 +101,7 @@ public class ManagedCommandLineGenerator implements
command = command.replace(makeVariable(OUTPUT_PREFIX_PRM_NAME), outputPrefix);
command = command.replace(makeVariable(OUTPUT_PRM_NAME), outputName);
command = command.replace(makeVariable(INPUTS_PRM_NAME), inputsStr);
-
+
command = command.replace(makeVariable(CMD_LINE_PRM_NAME.toLowerCase()), commandName);
command = command.replace(makeVariable(FLAGS_PRM_NAME.toLowerCase()), flagsStr);
command = command.replace(makeVariable(OUTPUT_FLAG_PRM_NAME.toLowerCase()), outputFlag);
@@ -111,7 +112,7 @@ public class ManagedCommandLineGenerator implements
return new ManagedCommandLineInfo(command.trim(), commandLinePattern, commandName, stringArrayToString(flags),
outputFlag, outputPrefix, outputName, stringArrayToString(inputResources));
}
-
+
private String stringArrayToString( String[] array ) {
if( array == null || array.length <= 0 ) return new String();
StringBuffer sb = new StringBuffer();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedCommandLineInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedCommandLineInfo.java
index 8b32bcbec3..15d45938bb 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedCommandLineInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedCommandLineInfo.java
@@ -23,8 +23,8 @@ public class ManagedCommandLineInfo implements
private String outputPrefix;
private String outputName;
private String inputResources;
-
- public ManagedCommandLineInfo( String commandLine, String commandLinePattern, String commandName, String flags, String outputFlag,
+
+ public ManagedCommandLineInfo( String commandLine, String commandLinePattern, String commandName, String flags, String outputFlag,
String outputPrefix, String outputName, String inputResources) {
this.commandLine = commandLine;
this.commandLinePattern = commandLinePattern;
@@ -39,6 +39,7 @@ public class ManagedCommandLineInfo implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedCommandLineInfo#getCommandLine()
*/
+ @Override
public String getCommandLine() {
return this.commandLine;
}
@@ -46,6 +47,7 @@ public class ManagedCommandLineInfo implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedCommandLineInfo#getCommandLinePattern()
*/
+ @Override
public String getCommandLinePattern() {
return this.commandLinePattern;
}
@@ -53,6 +55,7 @@ public class ManagedCommandLineInfo implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedCommandLineInfo#getCommandName()
*/
+ @Override
public String getCommandName() {
return this.commandName;
}
@@ -60,6 +63,7 @@ public class ManagedCommandLineInfo implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedCommandLineInfo#getFlags()
*/
+ @Override
public String getFlags() {
return this.flags;
}
@@ -67,6 +71,7 @@ public class ManagedCommandLineInfo implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedCommandLineInfo#getOutputFlag()
*/
+ @Override
public String getOutputFlag() {
return this.outputFlag;
}
@@ -74,6 +79,7 @@ public class ManagedCommandLineInfo implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedCommandLineInfo#getOutputPrefix()
*/
+ @Override
public String getOutputPrefix() {
return this.outputPrefix;
}
@@ -81,6 +87,7 @@ public class ManagedCommandLineInfo implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedCommandLineInfo#getOutputName()
*/
+ @Override
public String getOutput() {
return this.outputName;
}
@@ -88,6 +95,7 @@ public class ManagedCommandLineInfo implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedCommandLineInfo#getInputResources()
*/
+ @Override
public String getInputs() {
return this.inputResources;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedConfigStorageElement.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedConfigStorageElement.java
index 1678ecd66d..59358c6748 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedConfigStorageElement.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedConfigStorageElement.java
@@ -33,37 +33,43 @@ public class ManagedConfigStorageElement implements ICStorageElement {
fParent = parent;
}
+ @Override
public void clear() {
throw new WriteAccessException();
}
+ @Override
public ICStorageElement createChild(String name) {
throw new WriteAccessException();
}
+ @Override
public String getAttribute(String name) {
return fElement.getAttribute(name);
}
-
+
+ @Override
public boolean hasAttribute(String name) {
return fElement.getAttribute(name) != null;
}
+ @Override
public ICStorageElement[] getChildren() {
List<IManagedConfigElement> list = getChildList(true);
return list.toArray(new ManagedConfigStorageElement[list.size()]);
}
-
+
private List<IManagedConfigElement> getChildList(boolean create){
if(fChildList == null && create){
IManagedConfigElement children[] = fElement.getChildren();
-
+
fChildList = new ArrayList<IManagedConfigElement>(children.length);
fChildList.addAll(Arrays.asList(children));
}
return fChildList;
}
-
+
+ @Override
public ICStorageElement[] getChildrenByName(String name) {
List<ICStorageElement> children = new ArrayList<ICStorageElement>();
for (ICStorageElement child : getChildren())
@@ -71,52 +77,64 @@ public class ManagedConfigStorageElement implements ICStorageElement {
children.add(child);
return children.toArray(new ICStorageElement[children.size()]);
}
-
+
+ @Override
public boolean hasChildren() {
return getChildList(true).isEmpty();
}
+ @Override
public String getName() {
return fElement.getName();
}
+ @Override
public ICStorageElement getParent() {
return fParent;
}
+ @Override
public String getValue() {
return null;
}
+ @Override
public ICStorageElement importChild(ICStorageElement el)
throws UnsupportedOperationException {
throw new WriteAccessException();
}
+ @Override
public void removeAttribute(String name) {
throw new WriteAccessException();
}
+ @Override
public void removeChild(ICStorageElement el) {
throw new WriteAccessException();
}
+ @Override
public void setAttribute(String name, String value) {
throw new WriteAccessException();
}
+ @Override
public void setValue(String value) {
throw new WriteAccessException();
}
+ @Override
public String[] getAttributeNames() {
throw new UnsupportedOperationException();
}
-
+
+ @Override
public ICStorageElement createCopy() throws UnsupportedOperationException, CoreException {
throw new UnsupportedOperationException();
}
+ @Override
public boolean equals(ICStorageElement other) {
throw new UnsupportedOperationException();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedMakeProject.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedMakeProject.java
index 34308d4b87..1d55dffa16 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedMakeProject.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedMakeProject.java
@@ -28,15 +28,15 @@ import org.eclipse.core.runtime.Preferences;
/**
* @deprecated This class is obsolete but it is there just in case it might be used with old style projects.
- *
+ *
* @since 2.0
*/
@Deprecated
public class ManagedMakeProject implements ICOwner {
/**
- * Zero-argument constructor to fulfill the contract for
- * implementation classes supplied via an extension point
+ * Zero-argument constructor to fulfill the contract for
+ * implementation classes supplied via an extension point
*/
public ManagedMakeProject() {
super();
@@ -45,37 +45,39 @@ public class ManagedMakeProject implements ICOwner {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.ICOwner#configure(org.eclipse.cdt.core.ICDescriptor)
*/
+ @Override
public void configure(ICDescriptor cproject) throws CoreException {
cproject.remove(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID);
cproject.remove(CCorePlugin.BUILDER_MODEL_ID);
cproject.remove(CCorePlugin.BINARY_PARSER_UNIQ_ID);
-
+
// updateIndexers(cproject);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.ICOwner#update(org.eclipse.cdt.core.ICDescriptor, java.lang.String)
*/
+ @Override
public void update(ICDescriptor cproject, String extensionID) throws CoreException {
/* if (extensionID.equals(CCorePlugin.BINARY_PARSER_UNIQ_ID)) {
updateBinaryParsers(cproject);
}
-
+
if (extensionID.equals(CCorePlugin.INDEXER_UNIQ_ID)) {
updateIndexers(cproject);
}
*/
}
-
+
private void updateBinaryParsers(ICDescriptor cDescriptor) throws CoreException {
IManagedBuildInfo buildInfo = null;
String[] ids = null;
IProject project = cDescriptor.getProject();
- // If we cannot get the build information, it may be due to the fact that the
+ // If we cannot get the build information, it may be due to the fact that the
// build information is yet to be created, due to a synchronization issue
// Don't do anything now to the binary parsers because there is nothing meaningful to do.
- // This routine should be invoked later, when the required build information is available
+ // This routine should be invoked later, when the required build information is available
if (!ManagedBuildManager.canGetBuildInfo(project)) return;
buildInfo = ManagedBuildManager.getBuildInfo(project);
@@ -97,7 +99,7 @@ public class ManagedMakeProject implements ICOwner {
}
}
}
-
+
cDescriptor.remove(CCorePlugin.BINARY_PARSER_UNIQ_ID);
if (ids != null) {
for (int i = 0; i < ids.length; i++) {
@@ -105,7 +107,7 @@ public class ManagedMakeProject implements ICOwner {
}
}
}
-
+
private void updateIndexers(ICDescriptor cDescriptor) throws CoreException {
cDescriptor.remove(CCorePlugin.INDEXER_UNIQ_ID);
Preferences corePrefs = CCorePlugin.getDefault().getPluginPreferences();
@@ -117,7 +119,7 @@ public class ManagedMakeProject implements ICOwner {
}
}
}
-
+
private String[] parseStringToArray(String syms) {
if (syms != null && syms.length() > 0) {
StringTokenizer tok = new StringTokenizer(syms, ";"); //$NON-NLS-1$
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedProject.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedProject.java
index 9f32ebb09b..bfc17dee22 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedProject.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedProject.java
@@ -39,7 +39,7 @@ import org.eclipse.core.runtime.CoreException;
import org.osgi.framework.Version;
public class ManagedProject extends BuildObject implements IManagedProject, IBuildPropertiesRestriction, IBuildPropertyChangeListener {
-
+
// Parent and children
private IProjectType projectType;
private String projectTypeId;
@@ -54,7 +54,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
// private StorableMacros userDefinedMacros;
//holds user-defined environment
// private StorableEnvironment userDefinedEnvironment;
-
+
private BuildObjectProperties buildProperties;
/*
@@ -63,23 +63,23 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
/* (non-Javadoc)
* Sets the Eclipse project that owns the Managed Project
- *
+ *
* @param owner
*/
protected ManagedProject(IResource owner) {
this.owner = owner;
}
-
+
/**
- * Create a project instance from the project-type specified in the argument,
+ * Create a project instance from the project-type specified in the argument,
* that is owned by the specified Eclipse project.
- *
+ *
* @param owner the Eclipse project that owns the Managed Project
*/
public ManagedProject(IResource owner, IProjectType projectType) {
// Make the owner of the ProjectType the project resource
this(owner);
-
+
// Copy the parent's identity
this.projectType = projectType;
int id = ManagedBuildManager.getRandomNumber();
@@ -87,7 +87,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
setName(projectType.getName());
setManagedBuildRevision(projectType.getManagedBuildRevision());
-
+
// Hook me up
IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(owner);
buildInfo.setManagedProject(this);
@@ -97,7 +97,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
public ManagedProject(ICProjectDescription des) {
// Make the owner of the ProjectType the project resource
this(des.getProject());
-
+
// Copy the parent's identity
// this.projectType = projectType;
int id = ManagedBuildManager.getRandomNumber();
@@ -105,7 +105,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
setName(des.getName());
// setManagedBuildRevision(projectType.getManagedBuildRevision());
-
+
// Hook me up
// IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(owner);
// buildInfo.setManagedProject(this);
@@ -114,23 +114,23 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
/**
* Create the project instance from project file.
- *
+ *
* @param managedBuildRevision the fileVersion of Managed Build System
*/
public ManagedProject(ManagedBuildInfo buildInfo, ICStorageElement element, boolean loadConfigs, String managedBuildRevision) {
this(buildInfo.getOwner());
-
+
setManagedBuildRevision(managedBuildRevision);
-
+
// Initialize from the XML attributes
if (loadFromProject(element)) {
-
+
// check for migration support.
boolean isSupportAvailable = projectType != null ? projectType.checkForMigrationSupport() : true;
if (isSupportAvailable == false) {
setValid(false);
}
-
+
if(loadConfigs){
// Load children
StorableCdtVariables vars = null;
@@ -141,9 +141,9 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
} else if (configElement.getName().equals("macros")) { //$NON-NLS-1$
vars = new StorableCdtVariables(configElement, false);
}
-
+
}
-
+
if(vars != null){
for (Configuration cfg : getConfigurationCollection()) {
((ToolChain)cfg.getToolChain()).addProjectVariables(vars);
@@ -153,7 +153,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
} else {
setValid(false);
}
-
+
// hook me up
buildInfo.setManagedProject(this);
}
@@ -161,12 +161,12 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
/*
* E L E M E N T A T T R I B U T E R E A D E R S A N D W R I T E R S
*/
-
+
/* (non-Javadoc)
- * Initialize the project information from the XML element
+ * Initialize the project information from the XML element
* specified in the argument
- *
- * @param element An XML element containing the project information
+ *
+ * @param element An XML element containing the project information
*/
protected boolean loadFromProject(ICStorageElement element) {
// note: id and name are unique, so don't intern them
@@ -177,7 +177,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
if (element.getAttribute(IBuildObject.NAME) != null) {
setName(element.getAttribute(IBuildObject.NAME));
}
-
+
// projectType
projectTypeId = element.getAttribute(PROJECTTYPE);
if (projectTypeId != null && projectTypeId.length() > 0) {
@@ -186,7 +186,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
return false;
}
}
-
+
String props = element.getAttribute(BUILD_PROPERTIES);
if(props != null && props.length() != 0)
buildProperties = new BuildObjectProperties(props, this, this);
@@ -195,7 +195,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
if(artType != null){
if(buildProperties == null)
buildProperties = new BuildObjectProperties(this, this);
-
+
try {
buildProperties.setProperty(ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID, artType, true);
} catch (CoreException e) {
@@ -208,7 +208,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
public void serializeProjectInfo(ICStorageElement element) {
element.setAttribute(IBuildObject.ID, id);
-
+
if (name != null) {
element.setAttribute(IBuildObject.NAME, name);
}
@@ -216,7 +216,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
if (projectType != null) {
element.setAttribute(PROJECTTYPE, projectType.getId());
}
-
+
// I am clean now
isDirty = false;
}
@@ -226,7 +226,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
*/
public void serialize(ICStorageElement element, boolean saveChildren) {
serializeProjectInfo(element);
-
+
if(saveChildren){
for (Configuration cfg : getConfigurationCollection()) {
ICStorageElement configElement = element.createChild(IConfiguration.CONFIGURATION_ELEMENT_NAME);
@@ -234,14 +234,14 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
}
}
// Serialize my children
-
+
// //serialize user-defined macros
// if(userDefinedMacros != null){
// Element macrosElement = doc.createElement(StorableMacros.MACROS_ELEMENT_NAME);
// element.appendChild(macrosElement);
// userDefinedMacros.serialize(doc,macrosElement);
// }
-//
+//
// if(userDefinedEnvironment != null){
// EnvironmentVariableProvider.fUserSupplier.storeEnvironment(this,true);
// }
@@ -257,6 +257,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedProject#getOwner()
*/
+ @Override
public IResource getOwner() {
return owner;
}
@@ -264,6 +265,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedProject#updateOwner(org.eclipse.core.resources.IResource)
*/
+ @Override
public void updateOwner(IResource resource) {
if (!resource.equals(owner)) {
// Set the owner correctly
@@ -274,6 +276,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedProject#getProjectType()
*/
+ @Override
public IProjectType getProjectType() {
return projectType;
}
@@ -281,6 +284,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedProject#createConfiguration(org.eclipse.cdt.core.build.managed.IConfiguration)
*/
+ @Override
public IConfiguration createConfiguration(IConfiguration parent, String id) {
Configuration config = new Configuration(this, (Configuration)parent, id, false, false, false);
ManagedBuildManager.performValueHandlerEvent(config, IManagedOptionValueHandler.EVENT_OPEN);
@@ -290,6 +294,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedProject#createConfigurationClone(org.eclipse.cdt.core.build.managed.IConfiguration)
*/
+ @Override
public IConfiguration createConfigurationClone(IConfiguration parent, String id) {
Configuration config = new Configuration(this, (Configuration)parent, id, true, false, false);
// Inform all options in the configuration and all its resource configurations
@@ -300,25 +305,28 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedProject#getConfiguration()
*/
+ @Override
public IConfiguration getConfiguration(String id) {
return configMap.get(id);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedProject#getConfigurations()
*/
+ @Override
public IConfiguration[] getConfigurations() {
synchronized (configMap) {
return configMap.values().toArray(new IConfiguration[configMap.size()]);
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedProject#removeConfiguration(java.lang.String)
*/
+ @Override
public void removeConfiguration(String id) {
final String removeId = id;
-
+
//handle the case of temporary configuration
if(!configMap.containsKey(id))
return;
@@ -350,8 +358,8 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
// }
// }
// ((IProject)proj).build(IncrementalProjectBuilder.CLEAN_BUILD, monitor);
-//
-// ManagedBuildManager.performValueHandlerEvent(config,
+//
+// ManagedBuildManager.performValueHandlerEvent(config,
// IManagedOptionValueHandler.EVENT_CLOSE);
// PropertyManager.getInstance().clearProperties(config);
//// getConfigurationList().remove(config);
@@ -359,7 +367,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
//
// if (info != null) {
// if (!isCurrent) {
-// info.setDefaultConfiguration(currentConfig);
+// info.setDefaultConfiguration(currentConfig);
// } else {
// // If the current default config is the one being removed, reset the default config
// String[] configs = info.getConfigurationNames();
@@ -382,25 +390,25 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
/* (non-Javadoc)
* Adds the Configuration to the Configuration list and map
- *
+ *
* @param Tool
*/
public void addConfiguration(Configuration configuration) {
if(!configuration.isTemporary())
configMap.put(configuration.getId(), configuration);
}
-
+
/** (non-Javadoc)
* Safe accessor for the list of configurations.
- *
+ *
* @return List containing the configurations
*/
private Collection<Configuration> getConfigurationCollection() {
synchronized (configMap) {
- return new ArrayList<Configuration>(configMap.values());
+ return new ArrayList<Configuration>(configMap.values());
}
}
-
+
/*
* M O D E L A T T R I B U T E A C C E S S O R S
*/
@@ -412,10 +420,11 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedProject#(getDefaultArtifactName)
*/
+ @Override
public String getDefaultArtifactName(){
return "${ProjName}"; //$NON-NLS-1$
}
-
+
/* (non-Javadoc)
* Resolve the element IDs to interface references
*/
@@ -429,7 +438,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
return false;
}
}
-
+
// call resolve references on any children
for (Configuration cfg : getConfigurationCollection())
cfg.resolveReferences();
@@ -440,10 +449,11 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedProject#isDirty()
*/
+ @Override
public boolean isDirty() {
// If I need saving, just say yes
if (isDirty) return true;
-
+
//check whether the project - specific macros are dirty
// if(userDefinedMacros != null && userDefinedMacros.isDirty())
// return true;
@@ -451,19 +461,20 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
//check whether the project - specific environment is dirty
// if(userDefinedEnvironment != null && userDefinedEnvironment.isDirty())
// return true;
-
-
+
+
// Otherwise see if any configurations need saving
for (IConfiguration cfg : getConfigurationCollection())
- if (cfg.isDirty())
+ if (cfg.isDirty())
return true;
-
+
return isDirty;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedProject#setDirty(boolean)
*/
+ @Override
public void setDirty(boolean isDirty) {
this.isDirty = isDirty;
// Propagate "false" to the children
@@ -475,6 +486,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedProject#isValid()
*/
+ @Override
public boolean isValid() {
// TODO: In the future, children could also have a "valid" state that should be checked
return isValid;
@@ -483,6 +495,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedProject#setValid(boolean)
*/
+ @Override
public void setValid(boolean isValid) {
// TODO: In the future, children could also have a "valid" state...
this.isValid = isValid;
@@ -500,7 +513,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
}
return version;
}
-
+
@Override
public void setVersion(Version version) {
// Do nothing
@@ -543,13 +556,14 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
} else {
projectTypeId = this.projectType.getId();
}
- }
+ }
}
-
+
public void applyConfiguration(Configuration cfg){
cfg.applyToManagedProject(this);
}
-
+
+ @Override
public IBuildObjectProperties getBuildProperties() {
if(buildProperties == null){
BuildObjectProperties parentProps = findBuildProperties();
@@ -560,7 +574,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
}
return buildProperties;
}
-
+
private BuildObjectProperties findBuildProperties(){
if(buildProperties == null){
if(projectType != null){
@@ -571,6 +585,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
return buildProperties;
}
+ @Override
public void propertiesChanged() {
IConfiguration cfgs[] = getConfigurations();
for (IConfiguration cfg : cfgs) {
@@ -587,6 +602,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
return supportsValue(type.getId(), value.getId());
}
+ @Override
public boolean supportsType(String typeId) {
IConfiguration cfgs[] = getConfigurations();
for (IConfiguration cfg : cfgs) {
@@ -596,6 +612,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
return false;
}
+ @Override
public boolean supportsValue(String typeId, String valueId) {
IConfiguration cfgs[] = getConfigurations();
for (IConfiguration cfg : cfgs) {
@@ -604,7 +621,8 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
}
return false;
}
-
+
+ @Override
public String[] getRequiredTypeIds() {
List<String> result = new ArrayList<String>();
IConfiguration cfgs[] = getConfigurations();
@@ -614,6 +632,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
return result.toArray(new String[result.size()]);
}
+ @Override
public String[] getSupportedTypeIds() {
List<String> result = new ArrayList<String>();
IConfiguration cfgs[] = getConfigurations();
@@ -623,6 +642,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
return result.toArray(new String[result.size()]);
}
+ @Override
public String[] getSupportedValueIds(String typeId) {
List<String> result = new ArrayList<String>();
IConfiguration cfgs[] = getConfigurations();
@@ -632,6 +652,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
return result.toArray(new String[result.size()]);
}
+ @Override
public boolean requiresType(String typeId) {
IConfiguration cfgs[] = getConfigurations();
for (IConfiguration cfg : cfgs) {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MapStorageElement.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MapStorageElement.java
index ac593b6907..968dde722e 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MapStorageElement.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MapStorageElement.java
@@ -45,7 +45,7 @@ public class MapStorageElement implements ICStorageElement {
fValue = map.get(getMapKey(VALUE_KEY));
fMap = new HashMap<String, String>(map);
fParent = parent;
-
+
String children = map.get(getMapKey(CHILDREN_KEY));
if(children != null){
List<String> childrenStrList = decodeList(children);
@@ -59,15 +59,15 @@ public class MapStorageElement implements ICStorageElement {
}
}
}
-
+
protected MapStorageElement createChildElement(Map<String, String> childMap){
return new MapStorageElement(childMap, this);
}
-
+
protected String getMapKey(String name){
return name;
}
-
+
public Map<String, String> toStringMap(){
@SuppressWarnings("unchecked")
Map<String, String> map = (Map<String, String>)fMap.clone();
@@ -75,12 +75,12 @@ public class MapStorageElement implements ICStorageElement {
map.put(getMapKey(NAME_KEY), fName);
else
map.remove(getMapKey(NAME_KEY));
-
+
if(fValue != null)
map.put(getMapKey(VALUE_KEY), fValue);
else
map.remove(getMapKey(VALUE_KEY));
-
+
int size = fChildren.size();
if(size != 0){
List<String> childrenStrList = new ArrayList<String>(size);
@@ -90,49 +90,55 @@ public class MapStorageElement implements ICStorageElement {
String str = encodeMap(childStrMap);
childrenStrList.add(str);
}
-
+
String childrenStr = encodeList(childrenStrList);
map.put(getMapKey(CHILDREN_KEY), childrenStr);
} else {
map.remove(getMapKey(CHILDREN_KEY));
}
-
+
return map;
}
-
+
protected boolean isSystemKey(String key){
return key.indexOf('?') == 0 && key.lastIndexOf('?') == key.length() - 1;
}
+ @Override
public void clear() {
fMap.clear();
}
+ @Override
public ICStorageElement createChild(String name) {
MapStorageElement child = createChildElement(name);
fChildren.add(child);
return child;
}
-
+
protected MapStorageElement createChildElement(String name){
- return new MapStorageElement(name, this);
+ return new MapStorageElement(name, this);
}
+ @Override
public String getAttribute(String name) {
Object o = fMap.get(getMapKey(name));
if(o instanceof String)
return (String)o;
return null;
}
-
+
+ @Override
public boolean hasAttribute(String name) {
return fMap.containsKey(getMapKey(name));
}
+ @Override
public ICStorageElement[] getChildren() {
return fChildren.toArray(new MapStorageElement[fChildren.size()]);
}
-
+
+ @Override
public ICStorageElement[] getChildrenByName(String name) {
List<ICStorageElement> children = new ArrayList<ICStorageElement>();
for (ICStorageElement child : fChildren)
@@ -140,38 +146,44 @@ public class MapStorageElement implements ICStorageElement {
children.add(child);
return new ICStorageElement[children.size()];
}
-
+
+ @Override
public boolean hasChildren() {
return !fChildren.isEmpty();
}
+ @Override
public String getName() {
return fName;
}
+ @Override
public ICStorageElement getParent() {
return fParent;
}
+ @Override
public void removeChild(ICStorageElement child){
fChildren.remove(child);
if(child instanceof MapStorageElement){
((MapStorageElement)child).removed();
}
}
-
+
private void removed() {
fParent = null;
}
+ @Override
public void removeAttribute(String name) {
fMap.remove(getMapKey(name));
}
+ @Override
public void setAttribute(String name, String value) {
fMap.put(getMapKey(name), value);
}
-
+
public static HashMap<String, String> decodeMap(String value) {
List<String> list = decodeList(value);
HashMap<String, String> map = new HashMap<String, String>();
@@ -193,11 +205,11 @@ public class MapStorageElement implements ICStorageElement {
}
map.put(SafeStringInterner.safeIntern(line.substring(0, lndx)), SafeStringInterner.safeIntern(line.substring(lndx + 1)));
}
-
+
return map;
}
-
+
public static List<String> decodeList(String value) {
List<String> list = new ArrayList<String>();
if (value != null) {
@@ -209,7 +221,7 @@ public class MapStorageElement implements ICStorageElement {
int ndx = 0;
while (ndx < envStr.length()) {
if (escapeChars.indexOf(envStr.charAt(ndx)) != -1) {
- if (envStr.charAt(ndx - 1) == escapeChar) {
+ if (envStr.charAt(ndx - 1) == escapeChar) {
// escaped '|' - remove '\' and continue on.
envStr.deleteCharAt(ndx - 1);
if (ndx == envStr.length()) {
@@ -243,7 +255,7 @@ public class MapStorageElement implements ICStorageElement {
}
return list;
}
-
+
public static String encodeMap(Map<String, String> values) {
Iterator<Entry<String, String>> entries = values.entrySet().iterator();
StringBuffer str = new StringBuffer();
@@ -256,7 +268,7 @@ public class MapStorageElement implements ICStorageElement {
}
return str.toString();
}
-
+
public static String encodeList(List<String> values) {
StringBuffer str = new StringBuffer();
Iterator<String> entries = values.iterator();
@@ -279,20 +291,24 @@ public class MapStorageElement implements ICStorageElement {
return str.toString();
}
+ @Override
public String getValue() {
return fValue;
}
+ @Override
public void setValue(String value) {
fValue = value;
}
+ @Override
public ICStorageElement importChild(ICStorageElement el)
throws UnsupportedOperationException {
// TODO
throw new UnsupportedOperationException();
}
+ @Override
public String[] getAttributeNames() {
List<String> list = new ArrayList<String>(fMap.size());
Set<Entry<String, String>> entrySet = fMap.entrySet();
@@ -302,14 +318,16 @@ public class MapStorageElement implements ICStorageElement {
list.add(key);
}
}
-
+
return list.toArray(new String[list.size()]);
}
-
+
+ @Override
public ICStorageElement createCopy() throws UnsupportedOperationException, CoreException {
throw new UnsupportedOperationException();
}
-
+
+ @Override
public boolean equals(ICStorageElement other) {
throw new UnsupportedOperationException();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ModificationStatus.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ModificationStatus.java
index c1aefe518a..736665874f 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ModificationStatus.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ModificationStatus.java
@@ -29,7 +29,7 @@ public class ModificationStatus extends Status implements IModificationStatus {
private ITool[] fNonManagedBuildTools;
public static final ModificationStatus OK = new ModificationStatus(IStatus.OK, "", null); //$NON-NLS-1$
-
+
ModificationStatus(String msg){
this(msg, null);
}
@@ -59,7 +59,7 @@ public class ModificationStatus extends Status implements IModificationStatus {
flags |= REQUIRED_PROPS_NOT_SUPPORTED | PROPS_NOT_DEFINED;
severity = IStatus.ERROR;
}
-
+
if(unsupportedProps != null && unsupportedProps.size() != 0){
fUnsupportedProperties.putAll(unsupportedProps);
flags |= PROPS_NOT_SUPPORTED;
@@ -97,28 +97,32 @@ public class ModificationStatus extends Status implements IModificationStatus {
if(flags != 0){
setCode(flags);
}
-
+
if(severity != IStatus.OK){
setSeverity(severity);
}
-
+
}
-
+
+ @Override
@SuppressWarnings("unchecked")
public Map<String, String> getUnsupportedProperties(){
return (HashMap<String, String>)fUnsupportedProperties.clone();
}
+ @Override
@SuppressWarnings("unchecked")
public Map<String, String> getUnsupportedRequiredProperties(){
return (HashMap<String, String>)fUnsupportedRequiredProperties.clone();
}
+ @Override
@SuppressWarnings("unchecked")
public Set<String> getUndefinedProperties(){
return (HashSet<String>)fUndefinedProperties.clone();
}
+ @Override
public ITool[][] getToolsConflicts(){
ITool[][] copy = new ITool[fToolConflicts.length][];
for(int i = 0; i < fToolConflicts.length; i++){
@@ -126,7 +130,8 @@ public class ModificationStatus extends Status implements IModificationStatus {
}
return copy;
}
-
+
+ @Override
public ITool[] getNonManagedBuildTools(){
return fNonManagedBuildTools.clone();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiFileInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiFileInfo.java
index 2119a5357b..99a0e91cea 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiFileInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiFileInfo.java
@@ -30,6 +30,7 @@ public class MultiFileInfo extends MultiResourceInfo implements IFileInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IFileInfo#getFileData()
*/
+ @Override
public CFileData getFileData() {
return ((IFileInfo)fRis[curr]).getFileData();
}
@@ -37,6 +38,7 @@ public class MultiFileInfo extends MultiResourceInfo implements IFileInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#createTool(org.eclipse.cdt.managedbuilder.core.ITool, java.lang.String, java.lang.String, boolean)
*/
+ @Override
public ITool createTool(ITool superClass, String Id, String name,
boolean isExtensionElement) {
ITool t = null;
@@ -52,6 +54,7 @@ public class MultiFileInfo extends MultiResourceInfo implements IFileInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#getOwner()
*/
+ @Override
public IResource getOwner() {
return ((IFileInfo)fRis[curr]).getOwner();
}
@@ -59,6 +62,7 @@ public class MultiFileInfo extends MultiResourceInfo implements IFileInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#getRcbsApplicability()
*/
+ @Override
public int getRcbsApplicability() {
return ((IFileInfo)fRis[curr]).getRcbsApplicability();
}
@@ -66,6 +70,7 @@ public class MultiFileInfo extends MultiResourceInfo implements IFileInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#getResourcePath()
*/
+ @Override
public String getResourcePath() {
return ((IFileInfo)fRis[curr]).getResourcePath();
}
@@ -73,6 +78,7 @@ public class MultiFileInfo extends MultiResourceInfo implements IFileInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#getTool(java.lang.String)
*/
+ @Override
public ITool getTool(String id) {
return ((IFileInfo)fRis[curr]).getTool(id);
}
@@ -80,6 +86,7 @@ public class MultiFileInfo extends MultiResourceInfo implements IFileInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#getToolsToInvoke()
*/
+ @Override
public ITool[] getToolsToInvoke() {
return ((IFileInfo)fRis[curr]).getToolsToInvoke();
}
@@ -87,6 +94,7 @@ public class MultiFileInfo extends MultiResourceInfo implements IFileInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#removeTool(org.eclipse.cdt.managedbuilder.core.ITool)
*/
+ @Override
public void removeTool(ITool tool) {
System.out.println("MultiFileInfo.removeTool() does not work OK !"); //$NON-NLS-1$
for (IResourceInfo ri : fRis) {
@@ -100,6 +108,7 @@ public class MultiFileInfo extends MultiResourceInfo implements IFileInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#setRcbsApplicability(int)
*/
+ @Override
public void setRcbsApplicability(int value) {
for (IResourceInfo ri : fRis) {
if (ri instanceof IFileInfo) {
@@ -112,6 +121,7 @@ public class MultiFileInfo extends MultiResourceInfo implements IFileInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#setResourcePath(java.lang.String)
*/
+ @Override
public void setResourcePath(String path) {
for (IResourceInfo ri : fRis) {
if (ri instanceof IFileInfo) {
@@ -124,6 +134,7 @@ public class MultiFileInfo extends MultiResourceInfo implements IFileInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#setToolCommand(org.eclipse.cdt.managedbuilder.core.ITool, java.lang.String)
*/
+ @Override
public void setToolCommand(ITool tool, String command) {
System.out.println("MultiFileInfo.setToolCommand() does not work OK !"); //$NON-NLS-1$
for (IResourceInfo ri : fRis) {
@@ -137,6 +148,7 @@ public class MultiFileInfo extends MultiResourceInfo implements IFileInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#setTools(org.eclipse.cdt.managedbuilder.core.ITool[])
*/
+ @Override
public void setTools(ITool[] tools) {
for (IResourceInfo ri : fRis) {
if (ri instanceof IFileInfo) {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiFolderInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiFolderInfo.java
index e70cb5f970..711c0637f4 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiFolderInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiFolderInfo.java
@@ -21,8 +21,8 @@ import org.eclipse.cdt.managedbuilder.core.IToolChain;
/**
* This class holds a number of IFolderInfo objects
- * delonging to different configurations when they
- * are edited simultaneously.
+ * delonging to different configurations when they
+ * are edited simultaneously.
*/
public class MultiFolderInfo extends MultiResourceInfo implements IFolderInfo {
@@ -30,7 +30,8 @@ public class MultiFolderInfo extends MultiResourceInfo implements IFolderInfo {
super(ris, p);
fRis = ris;
}
-
+
+ @Override
public boolean buildsFileType(String srcExt) {
for (int i=0; i<fRis.length; i++)
if (! ((IFolderInfo)fRis[i]).buildsFileType(srcExt))
@@ -38,6 +39,7 @@ public class MultiFolderInfo extends MultiResourceInfo implements IFolderInfo {
return true;
}
+ @Override
public IToolChain changeToolChain(IToolChain newSuperClass, String Id,
String name) throws BuildException {
IToolChain t = null;
@@ -46,51 +48,63 @@ public class MultiFolderInfo extends MultiResourceInfo implements IFolderInfo {
return t;
}
+ @Override
public ITool[] getFilteredTools() {
return ((IFolderInfo)fRis[curr]).getFilteredTools();
}
+ @Override
public CFolderData getFolderData() {
return ((IFolderInfo)fRis[curr]).getFolderData();
}
+ @Override
public String getOutputExtension(String resourceExtension) {
return ((IFolderInfo)fRis[curr]).getOutputExtension(resourceExtension);
}
+ @Override
public ITool getTool(String id) {
return ((IFolderInfo)fRis[curr]).getTool(id);
}
+ @Override
public IToolChain getToolChain() {
- return ((IFolderInfo)fRis[curr]).getToolChain();
+ return ((IFolderInfo)fRis[curr]).getToolChain();
}
+ @Override
public IModificationStatus getToolChainModificationStatus(ITool[] removed,
ITool[] added) {
- return ((IFolderInfo)fRis[curr]).getToolChainModificationStatus(removed, added);
+ return ((IFolderInfo)fRis[curr]).getToolChainModificationStatus(removed, added);
}
+ @Override
public ITool getToolFromInputExtension(String sourceExtension) {
return ((IFolderInfo)fRis[curr]).getToolFromInputExtension(sourceExtension);
}
+ @Override
public ITool getToolFromOutputExtension(String extension) {
return ((IFolderInfo)fRis[curr]).getToolFromOutputExtension(extension);
}
+ @Override
public ITool[] getToolsBySuperClassId(String id) {
return ((IFolderInfo)fRis[curr]).getToolsBySuperClassId(id);
}
+ @Override
public boolean isHeaderFile(String ext) {
return ((IFolderInfo)fRis[curr]).isHeaderFile(ext);
}
+ @Override
public boolean isToolChainCompatible(IToolChain ch) {
return ((IFolderInfo)fRis[curr]).isToolChainCompatible(ch);
}
+ @Override
public void modifyToolChain(ITool[] removed, ITool[] added)
throws BuildException {
((IFolderInfo)fRis[curr]).modifyToolChain(removed, added);
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiResourceInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiResourceInfo.java
index 9c692f1bd1..4b1b6edbeb 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiResourceInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiResourceInfo.java
@@ -38,11 +38,11 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
private static final int MODE_OSV = 3;
private static final int MODE_CMDLINE = 4;
private static final int MODE_COMMAND = 5;
-
+
protected IResourceInfo[] fRis = null;
protected int curr = 0;
IConfiguration parent = null;
-
+
public MultiResourceInfo(IResourceInfo[] ris, IConfiguration _parent) {
fRis = ris;
parent = _parent;
@@ -56,10 +56,11 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
}
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#canExclude(boolean)
*/
+ @Override
public boolean canExclude(boolean exclude) {
for (int i=0; i<fRis.length; i++)
if (! fRis[i].canExclude(exclude))
@@ -70,6 +71,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#getCLanguageDatas()
*/
+ @Override
public CLanguageData[] getCLanguageDatas() {
return fRis[curr].getCLanguageDatas();
}
@@ -77,6 +79,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#getKind()
*/
+ @Override
public int getKind() {
return fRis[curr].getKind();
}
@@ -84,6 +87,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#getParent()
*/
+ @Override
public IConfiguration getParent() {
return parent;
}
@@ -91,6 +95,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#getPath()
*/
+ @Override
public IPath getPath() {
return fRis[curr].getPath();
}
@@ -98,6 +103,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#getResourceData()
*/
+ @Override
public CResourceData getResourceData() {
if (DEBUG)
System.out.println("Strange call: MultiResourceInfo.getResourceData()"); //$NON-NLS-1$
@@ -107,6 +113,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#getTools()
*/
+ @Override
public ITool[] getTools() {
return fRis[curr].getTools();
}
@@ -114,6 +121,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#isDirty()
*/
+ @Override
public boolean isDirty() {
for (int i=0; i<fRis.length; i++)
if (fRis[i].isDirty())
@@ -124,6 +132,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#isExcluded()
*/
+ @Override
public boolean isExcluded() {
for (int i=0; i<fRis.length; i++)
if (fRis[i].isExcluded())
@@ -134,6 +143,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#isExtensionElement()
*/
+ @Override
public boolean isExtensionElement() {
for (int i=0; i<fRis.length; i++)
if (fRis[i].isExtensionElement())
@@ -144,6 +154,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#isSupported()
*/
+ @Override
public boolean isSupported() {
for (int i=0; i<fRis.length; i++)
if (fRis[i].isSupported())
@@ -154,6 +165,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#isValid()
*/
+ @Override
public boolean isValid() {
for (int i=0; i<fRis.length; i++)
if (!fRis[i].isValid())
@@ -164,6 +176,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#needsRebuild()
*/
+ @Override
public boolean needsRebuild() {
for (int i=0; i<fRis.length; i++)
if (fRis[i].needsRebuild())
@@ -174,6 +187,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#setDirty(boolean)
*/
+ @Override
public void setDirty(boolean dirty) {
for (int i=0; i<fRis.length; i++)
fRis[i].setDirty(dirty);
@@ -182,6 +196,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#setExclude(boolean)
*/
+ @Override
public void setExclude(boolean excluded) {
for (int i=0; i<fRis.length; i++)
fRis[i].setExclude(excluded);
@@ -195,21 +210,21 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
}
return s;
}
-
+
public void setToolsCommand(ITool tool, String s) {
- setTool(tool, s, MODE_COMMAND);
+ setTool(tool, s, MODE_COMMAND);
}
-
+
public void setCommandLinePattern(ITool tool, String s) {
setTool(tool, s, MODE_CMDLINE);
}
-
+
private void setTool(ITool tool, String s, int mode) {
String ext = tool.getDefaultInputExtension();
for (int i=0; i<fRis.length; i++) {
ITool[] ts = fRis[i].getTools();
for (int j=0; j<ts.length; j++) {
- if (ext != null &&
+ if (ext != null &&
! ext.equals(ts[j].getDefaultInputExtension()))
continue;
switch (mode) {
@@ -219,16 +234,16 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
case MODE_CMDLINE:
ts[j].setCommandLinePattern(s);
break;
- }
+ }
}
}
}
-
- private IOption setOption(IHoldsOptions parent, IOption option, Object value, int mode)
+
+ private IOption setOption(IHoldsOptions parent, IOption option, Object value, int mode)
throws BuildException {
IOption op = null;
String ext = parent instanceof ITool ? ((ITool)parent).getDefaultInputExtension() : null;
-
+
String sid = getSuperClassId(option);
for (int i=0; i<fRis.length; i++) {
IHoldsOptions[] hos;
@@ -241,22 +256,22 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
throw new BuildException(ManagedMakeMessages.getString("MultiResourceInfo.MultiResourceInfo.UnhandledIHoldsOptionsType")); //$NON-NLS-1$
for (int j=0; j<hos.length; j++) {
- if (ext != null &&
+ if (ext != null &&
! ext.equals(((ITool)hos[j]).getDefaultInputExtension()))
continue;
IOption op2 = hos[j].getOptionBySuperClassId(sid);
if (op2 != null) {
switch (mode) {
- case MODE_BOOL:
+ case MODE_BOOL:
op = fRis[i].setOption(hos[j], op2, ((Boolean)value).booleanValue());
break;
- case MODE_STR:
+ case MODE_STR:
op = fRis[i].setOption(hos[j], op2, (String)value);
break;
- case MODE_SAR:
+ case MODE_SAR:
op = fRis[i].setOption(hos[j], op2, (String[])value);
break;
- case MODE_OSV:
+ case MODE_OSV:
op = fRis[i].setOption(hos[j], op2, (OptionStringValue[])value);
break;
}
@@ -265,10 +280,11 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
}
return op;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#setOption(org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption, boolean)
*/
+ @Override
public IOption setOption(IHoldsOptions parent, IOption option, boolean value)
throws BuildException {
return setOption(parent, option, new Boolean(value), MODE_BOOL);
@@ -277,6 +293,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#setOption(org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption, java.lang.String)
*/
+ @Override
public IOption setOption(IHoldsOptions parent, IOption option, String value)
throws BuildException {
return setOption(parent, option, value, MODE_STR);
@@ -285,6 +302,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#setOption(org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption, java.lang.String[])
*/
+ @Override
public IOption setOption(IHoldsOptions parent, IOption option,
String[] value) throws BuildException {
return setOption(parent, option, value, MODE_SAR);
@@ -293,6 +311,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#setOption(org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption, org.eclipse.cdt.managedbuilder.core.OptionStringValue[])
*/
+ @Override
public IOption setOption(IHoldsOptions parent, IOption option,
OptionStringValue[] value) throws BuildException {
return setOption(parent, option, value, MODE_OSV);
@@ -301,6 +320,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#setPath(org.eclipse.core.runtime.IPath)
*/
+ @Override
public void setPath(IPath path) {
for (int i=0; i<fRis.length; i++)
fRis[i].setPath(path);
@@ -309,6 +329,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#setRebuildState(boolean)
*/
+ @Override
public void setRebuildState(boolean rebuild) {
for (int i=0; i<fRis.length; i++)
fRis[i].setRebuildState(rebuild);
@@ -317,6 +338,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceInfo#supportsBuild(boolean)
*/
+ @Override
public boolean supportsBuild(boolean managed) {
return fRis[curr].supportsBuild(managed);
}
@@ -324,6 +346,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getBaseId()
*/
+ @Override
public String getBaseId() {
return fRis[curr].getBaseId();
}
@@ -331,6 +354,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getId()
*/
+ @Override
public String getId() {
return fRis[curr].getId();
}
@@ -338,6 +362,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getManagedBuildRevision()
*/
+ @Override
public String getManagedBuildRevision() {
return fRis[curr].getManagedBuildRevision();
}
@@ -345,6 +370,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getName()
*/
+ @Override
public String getName() {
return fRis[curr].getName();
}
@@ -352,6 +378,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getVersion()
*/
+ @Override
public Version getVersion() {
return fRis[curr].getVersion();
}
@@ -359,6 +386,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#setVersion(org.eclipse.core.runtime.PluginVersionIdentifier)
*/
+ @Override
public void setVersion(Version version) {
for (int i=0; i<fRis.length; i++)
fRis[i].setVersion(version);
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java
index 72f42e2402..711e3c60c3 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java
@@ -4,7 +4,7 @@
* 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 - Initial API and implementation
* ARM Ltd. - basic tooltip support
@@ -81,7 +81,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
private Integer resourceFilter;
private IConfigurationElement valueHandlerElement = null;
private IManagedOptionValueHandler valueHandler = null;
- private String valueHandlerExtraArgument;
+ private String valueHandlerExtraArgument;
private String fieldEditorId;
private String fieldEditorExtraArgument;
private IConfigurationElement applicabilityCalculatorElement = null;
@@ -92,7 +92,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
private boolean isDirty = false;
private boolean resolved = true;
private boolean verified = false;
- private boolean isValid = true; /** False for options which are invalid. getOption()
+ private boolean isValid = true; /** False for options which are invalid. getOption()
* routines will ignore invalid options. */
private boolean wasOptRef = false; /** True for options which are created because of an
* MBS 2.0 model OptionReference element
@@ -101,9 +101,9 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
private boolean rebuildState;
/**
- * This constructor is called to create an option defined by an extension point in
+ * This constructor is called to create an option defined by an extension point in
* a plugin manifest file, or returned by a dynamic element provider
- *
+ *
* @param parent The IHoldsOptions parent of this option, or <code>null</code> if
* defined at the top level
* @param element The option definition from the manifest file or a dynamic element
@@ -112,23 +112,23 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
public Option(IHoldsOptions parent, IManagedConfigElement element) {
this.holder = parent;
isExtensionOption = true;
-
+
// setup for resolving
resolved = false;
loadFromManifest(element);
-
+
// Hook me up to the Managed Build Manager
ManagedBuildManager.addExtensionOption(this);
}
/**
- * This constructor is called to create an Option whose attributes and children will be
+ * This constructor is called to create an Option whose attributes and children will be
* added by separate calls.
- *
+ *
* @param parent - the parent of the option, if any
* @param superClass - the superClass, if any
- * @param Id - the id for the new option
+ * @param Id - the id for the new option
* @param name - the name for the new option
* @param isExtensionElement - indicates whether this is an extension element or a managed project element
*/
@@ -151,24 +151,24 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
}
/**
- * Create an <code>Option</code> based on the specification stored in the
+ * Create an <code>Option</code> based on the specification stored in the
* project file (.cdtbuild).
- *
- * @param parent The <code>IHoldsOptions</code> the option will be added to.
+ *
+ * @param parent The <code>IHoldsOptions</code> the option will be added to.
* @param element The XML element that contains the option settings.
*/
public Option(IHoldsOptions parent, ICStorageElement element) {
this.holder = parent;
isExtensionOption = false;
-
+
// Initialize from the XML attributes
loadFromProject(element);
}
/**
* Create an <code>Option</code> based upon an existing option.
- *
- * @param parent The <code>IHoldsOptions</code> the option will be added to.
+ *
+ * @param parent The <code>IHoldsOptions</code> the option will be added to.
* @param Id New ID for the option.
* @param name New name for the option.
* @param option The existing option to clone, except for the above fields.
@@ -184,7 +184,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
setName(name);
isExtensionOption = false;
boolean copyIds = Id.equals(option.id);
-
+
// Copy the remaining attributes
if (option.unusedChildren != null) {
unusedChildren = new String(option.unusedChildren);
@@ -290,24 +290,24 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
applicabilityCalculatorElement = option.applicabilityCalculatorElement;
applicabilityCalculator = option.applicabilityCalculator;
-
+
booleanExpressionCalculator = option.booleanExpressionCalculator;
if (option.valueHandlerElement != null) {
- valueHandlerElement = option.valueHandlerElement;
+ valueHandlerElement = option.valueHandlerElement;
valueHandler = option.valueHandler;
}
if (option.valueHandlerExtraArgument != null) {
valueHandlerExtraArgument = new String(option.valueHandlerExtraArgument);
- }
-
+ }
+
if (option.fieldEditorId != null) {
- fieldEditorId = option.fieldEditorId;
+ fieldEditorId = option.fieldEditorId;
}
if (option.fieldEditorExtraArgument != null) {
fieldEditorExtraArgument = new String(option.fieldEditorExtraArgument);
- }
-
+ }
+
if(copyIds){
isDirty = option.isDirty;
rebuildState = option.rebuildState;
@@ -320,28 +320,28 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/*
* E L E M E N T A T T R I B U T E R E A D E R S A N D W R I T E R S
*/
-
+
/* (non-Javadoc)
- * Loads the option information from the ManagedConfigElement specified in the
+ * Loads the option information from the ManagedConfigElement specified in the
* argument.
- *
- * @param element Contains the option information
+ *
+ * @param element Contains the option information
*/
protected void loadFromManifest(IManagedConfigElement element) {
ManagedBuildManager.putConfigElement(this, element);
-
+
// id
setId(SafeStringInterner.safeIntern(element.getAttribute(IBuildObject.ID)));
-
+
// Get the name
setName(SafeStringInterner.safeIntern(element.getAttribute(IBuildObject.NAME)));
-
+
// superClass
superClassId = SafeStringInterner.safeIntern(element.getAttribute(IProjectType.SUPERCLASS));
// Get the unused children, if any
- unusedChildren = SafeStringInterner.safeIntern(element.getAttribute(IProjectType.UNUSED_CHILDREN));
-
+ unusedChildren = SafeStringInterner.safeIntern(element.getAttribute(IProjectType.UNUSED_CHILDREN));
+
// isAbstract
String isAbs = element.getAttribute(IProjectType.IS_ABSTRACT);
if (isAbs != null){
@@ -350,22 +350,22 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
// Get the command defined for the option
command = SafeStringInterner.safeIntern(element.getAttribute(COMMAND));
-
+
// Get the command-generator, if any
- String commandGeneratorStr = element.getAttribute(COMMAND_GENERATOR);
+ String commandGeneratorStr = element.getAttribute(COMMAND_GENERATOR);
if (commandGeneratorStr != null && element instanceof DefaultManagedConfigElement) {
- commandGeneratorElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
+ commandGeneratorElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
}
// Get the command defined for a Boolean option when the value is False
commandFalse = SafeStringInterner.safeIntern(element.getAttribute(COMMAND_FALSE));
-
+
// Get the tooltip for the option
tip = SafeStringInterner.safeIntern(element.getAttribute(TOOL_TIP));
-
+
// Get the contextID for the option
contextId = SafeStringInterner.safeIntern(element.getAttribute(CONTEXT_ID));
-
+
// Options hold different types of values
String valueTypeStr = element.getAttribute(VALUE_TYPE);
if (valueTypeStr != null) {
@@ -373,9 +373,9 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
}
// Note: The value and defaultValue attributes are loaded in the resolveReferences routine.
- // This is because we need to have the value-type, and this may be defined in a
+ // This is because we need to have the value-type, and this may be defined in a
// superClass that is not yet loaded.
-
+
// Determine if there needs to be a browse button
String browseTypeStr = element.getAttribute(BROWSE_TYPE);
if (browseTypeStr == null) {
@@ -394,15 +394,15 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
// Get the browseFilterPath attribute
this.browseFilterPath = SafeStringInterner.safeIntern(element.getAttribute(BROWSE_FILTER_PATH));
-
+
// Get the browseFilterExtensions attribute
String browseFilterExtensionsStr = element.getAttribute(BROWSE_FILTER_EXTENSIONS);
if (browseFilterExtensionsStr != null) {
this.browseFilterExtensions = SafeStringInterner.safeIntern(browseFilterExtensionsStr.split("\\s*,\\s*")); //$NON-NLS-1$
}
-
+
categoryId = SafeStringInterner.safeIntern(element.getAttribute(CATEGORY));
-
+
// Get the resourceFilter attribute
String resFilterStr = element.getAttribute(RESOURCE_FILTER);
if (resFilterStr == null) {
@@ -418,42 +418,42 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
} else if (resFilterStr.equals(PROJECT)) {
resourceFilter = new Integer(FILTER_PROJECT);
}
-
+
//get enablements
IManagedConfigElement enablements[] = element.getChildren(OptionEnablementExpression.NAME);
if(enablements.length > 0)
booleanExpressionCalculator = new BooleanExpressionApplicabilityCalculator(enablements);
// get the applicability calculator, if any
- String applicabilityCalculatorStr = element.getAttribute(APPLICABILITY_CALCULATOR);
+ String applicabilityCalculatorStr = element.getAttribute(APPLICABILITY_CALCULATOR);
if (applicabilityCalculatorStr != null && element instanceof DefaultManagedConfigElement) {
- applicabilityCalculatorElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
+ applicabilityCalculatorElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
} else {
applicabilityCalculator = booleanExpressionCalculator;
}
// valueHandler
- // Store the configuration element IFF there is a value handler defined
- String valueHandler = element.getAttribute(VALUE_HANDLER);
+ // Store the configuration element IFF there is a value handler defined
+ String valueHandler = element.getAttribute(VALUE_HANDLER);
if (valueHandler != null && element instanceof DefaultManagedConfigElement) {
- valueHandlerElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
+ valueHandlerElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
}
// valueHandlerExtraArgument
valueHandlerExtraArgument = SafeStringInterner.safeIntern(element.getAttribute(VALUE_HANDLER_EXTRA_ARGUMENT));
// fieldEditor and optional argument
- fieldEditorId = element.getAttribute(FIELD_EDITOR_ID);
+ fieldEditorId = element.getAttribute(FIELD_EDITOR_ID);
fieldEditorExtraArgument = element.getAttribute(FIELD_EDITOR_EXTRA_ARGUMENT);
}
-
+
/* (non-Javadoc)
- * Initialize the option information from the XML element
+ * Initialize the option information from the XML element
* specified in the argument
- *
- * @param element An XML element containing the option information
+ *
+ * @param element An XML element containing the option information
*/
protected void loadFromProject(ICStorageElement element) {
-
+
// id (unique, don't intern)
setId(element.getAttribute(IBuildObject.ID));
@@ -461,7 +461,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
if (element.getAttribute(IBuildObject.NAME) != null) {
setName(SafeStringInterner.safeIntern(element.getAttribute(IBuildObject.NAME)));
}
-
+
// superClass
superClassId = SafeStringInterner.safeIntern(element.getAttribute(IProjectType.SUPERCLASS));
if (superClassId != null && superClassId.length() > 0) {
@@ -473,9 +473,9 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
// Get the unused children, if any
if (element.getAttribute(IProjectType.UNUSED_CHILDREN) != null) {
- unusedChildren = SafeStringInterner.safeIntern(element.getAttribute(IProjectType.UNUSED_CHILDREN));
+ unusedChildren = SafeStringInterner.safeIntern(element.getAttribute(IProjectType.UNUSED_CHILDREN));
}
-
+
// isAbstract
if (element.getAttribute(IProjectType.IS_ABSTRACT) != null) {
String isAbs = element.getAttribute(IProjectType.IS_ABSTRACT);
@@ -488,31 +488,31 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
if (element.getAttribute(COMMAND) != null) {
command = SafeStringInterner.safeIntern(element.getAttribute(COMMAND));
}
-
+
// Get the command defined for a Boolean option when the value is False
if (element.getAttribute(COMMAND_FALSE) != null) {
commandFalse = SafeStringInterner.safeIntern(element.getAttribute(COMMAND_FALSE));
}
-
+
// Get the tooltip for the option
if (element.getAttribute(TOOL_TIP) != null) {
tip = SafeStringInterner.safeIntern(element.getAttribute(TOOL_TIP));
}
-
+
// Get the contextID for the option
if (element.getAttribute(CONTEXT_ID) != null) {
contextId = SafeStringInterner.safeIntern(element.getAttribute(CONTEXT_ID));
}
-
+
// Options hold different types of values
if (element.getAttribute(VALUE_TYPE) != null) {
String valueTypeStr = element.getAttribute(VALUE_TYPE);
valueType = new Integer(ValueTypeStrToInt(valueTypeStr));
}
-
+
// Now get the actual value based upon value-type
try {
- int valType = getValueType();
+ int valType = getValueType();
switch (valType) {
case BOOLEAN:
// Convert the string to a boolean
@@ -539,7 +539,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
if (element.getAttribute(DEFAULT_VALUE) != null) {
defaultValue = SafeStringInterner.safeIntern(element.getAttribute(DEFAULT_VALUE));
}
-
+
// Do we have enumeratedOptionValue children? If so, load them
// to define the valid values and the default value.
ICStorageElement configElements[] = element.getChildren();
@@ -585,7 +585,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
case UNDEF_LIBRARY_PATHS:
case UNDEF_LIBRARY_FILES:
case UNDEF_MACRO_FILES:
- // Note: These string-list options do not load either the "value" or
+ // Note: These string-list options do not load either the "value" or
// "defaultValue" attributes. Instead, the ListOptionValue children
// are loaded in the value field.
List<OptionStringValue> vList = null;
@@ -596,7 +596,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
vList = new ArrayList<OptionStringValue>();
if (biList==null)
biList = new ArrayList<OptionStringValue>();
-
+
ICStorageElement veNode = configElements[i];
if (veNode.getName().equals(LIST_VALUE)) {
OptionStringValue ve = new OptionStringValue(veNode);
@@ -614,7 +614,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
builtIns = biList;
else
builtIns = null;
-
+
break;
default :
break;
@@ -634,7 +634,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
// which they should be
browseType = null;
} else if (browseTypeStr.equals(NONE)) {
- browseType = new Integer(BROWSE_NONE);
+ browseType = new Integer(BROWSE_NONE);
} else if (browseTypeStr.equals(FILE)) {
browseType = new Integer(BROWSE_FILE);
} else if (browseTypeStr.equals(DIR)) {
@@ -661,7 +661,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
category = holder.getOptionCategory(categoryId);
}
}
-
+
// Get the resourceFilter attribute
if (element.getAttribute(RESOURCE_FILTER) != null) {
String resFilterStr = element.getAttribute(RESOURCE_FILTER);
@@ -672,21 +672,21 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
// which they should be
resourceFilter = null;
} else if (resFilterStr.equals(ALL)) {
- resourceFilter = new Integer(FILTER_ALL);
+ resourceFilter = new Integer(FILTER_ALL);
} else if (resFilterStr.equals(FILE)) {
resourceFilter = new Integer(FILTER_FILE);
} else if (resFilterStr.equals(PROJECT)) {
resourceFilter = new Integer(FILTER_PROJECT);
}
}
-
+
// Note: valueHandlerElement and VALUE_HANDLER are not restored,
// as they are not saved. See note in serialize().
-
+
// valueHandlerExtraArgument
if (element.getAttribute(VALUE_HANDLER_EXTRA_ARGUMENT) != null) {
valueHandlerExtraArgument = SafeStringInterner.safeIntern(element.getAttribute(VALUE_HANDLER_EXTRA_ARGUMENT));
- }
+ }
}
private int ValueTypeStrToInt(String valueTypeStr) {
@@ -735,7 +735,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/**
* Persist the option to the {@link ICStorageElement}.
- *
+ *
* @param element - storage element to persist the option
*/
public void serialize(ICStorageElement element) throws BuildException {
@@ -745,7 +745,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
element.setAttribute(IProjectType.SUPERCLASS, superClassId);
element.setAttribute(IBuildObject.ID, id);
-
+
if (name != null) {
element.setAttribute(IBuildObject.NAME, name);
}
@@ -753,23 +753,23 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
if (unusedChildren != null) {
element.setAttribute(IProjectType.UNUSED_CHILDREN, unusedChildren);
}
-
+
if (isAbstract != null) {
element.setAttribute(IProjectType.IS_ABSTRACT, isAbstract.toString());
}
-
+
if (command != null) {
element.setAttribute(COMMAND, command);
}
-
+
if (commandFalse != null) {
element.setAttribute(COMMAND_FALSE, commandFalse);
}
-
+
if (tip != null) {
element.setAttribute(TOOL_TIP, tip);
}
-
+
if (contextId != null) {
element.setAttribute(CONTEXT_ID, contextId);
}
@@ -900,12 +900,12 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
break;
default:
// TODO; is this a problem...
- str = EMPTY_STRING;
+ str = EMPTY_STRING;
break;
}
element.setAttribute(VALUE_TYPE, str);
}
-
+
// browse type
if (browseType != null) {
String str;
@@ -920,17 +920,17 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
str = DIR;
break;
default:
- str = EMPTY_STRING;
+ str = EMPTY_STRING;
break;
}
element.setAttribute(BROWSE_TYPE, str);
}
-
+
// browse filter path
if (browseFilterPath != null) {
element.setAttribute(BROWSE_FILTER_PATH, browseFilterPath);
}
-
+
// browse filter extensions
if (browseFilterExtensions != null) {
StringBuilder sb = new StringBuilder();
@@ -939,11 +939,11 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
}
element.setAttribute(BROWSE_FILTER_EXTENSIONS, sb.toString());
}
-
+
if (categoryId != null) {
element.setAttribute(CATEGORY, categoryId);
}
-
+
// resource filter
if (resourceFilter != null) {
String str;
@@ -958,7 +958,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
str = PROJECT;
break;
default:
- str = EMPTY_STRING;
+ str = EMPTY_STRING;
break;
}
element.setAttribute(RESOURCE_FILTER, str);
@@ -969,24 +969,25 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
if (applicabilityCalculatorElement != null) {
// TODO: issue warning?
}
-
+
// Note: a value handler cannot be specified in a project file because
// an IConfigurationElement is needed to load it!
if (valueHandlerElement != null) {
- // TODO: Issue warning? Stuck with behavior of this elsewhere in
+ // TODO: Issue warning? Stuck with behavior of this elsewhere in
// CDT, e.g. the implementation of Tool
- }
+ }
if (valueHandlerExtraArgument != null) {
element.setAttribute(VALUE_HANDLER_EXTRA_ARGUMENT, valueHandlerExtraArgument);
}
-
+
// I am clean now
isDirty = false;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getOptionContextData(org.eclipse.cdt.managedbuilder.core.IHoldsOptions)
*/
+ @Override
public IOptionContextData getOptionContextData(IHoldsOptions holder) {
return new OptionContextData(this, holder);
}
@@ -998,6 +999,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getParent()
*/
+ @Override
public IBuildObject getParent() {
return holder;
}
@@ -1005,6 +1007,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getOptionHolder()
*/
+ @Override
public IHoldsOptions getOptionHolder() {
// Do not take superclasses into account
return holder;
@@ -1017,6 +1020,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getSuperClass()
*/
+ @Override
public IOption getSuperClass() {
return superClass;
}
@@ -1028,10 +1032,11 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
public String getName() {
return (name == null && superClass != null) ? superClass.getName() : name;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getApplicableValues()
*/
+ @Override
public String[] getApplicableValues() {
// Does this option instance have the list of values?
if (enumList == null) {
@@ -1053,14 +1058,16 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
return enumNames;
}
}
-
+
+ @Override
public boolean getBooleanValue() {
return ((Boolean)getValue()).booleanValue();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getBrowseType()
*/
+ @Override
public int getBrowseType() {
if (browseType == null) {
if (superClass != null) {
@@ -1071,10 +1078,11 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
}
return browseType.intValue();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getBrowseFilterPath()
*/
+ @Override
public String getBrowseFilterPath() {
if (browseFilterPath == null) {
if (superClass != null) {
@@ -1089,6 +1097,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getBrowseFilterExtensions()
*/
+ @Override
public String[] getBrowseFilterExtensions() {
if (browseFilterExtensions == null) {
if (superClass != null) {
@@ -1103,6 +1112,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getResourceFilter()
*/
+ @Override
public int getResourceFilter() {
if (resourceFilter == null) {
if (superClass != null) {
@@ -1117,7 +1127,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.managedbuilder.core.IOption#getApplicabilityCalculatorElement()
*/
public IConfigurationElement getApplicabilityCalculatorElement() {
@@ -1132,9 +1142,10 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.managedbuilder.core.IOption#getApplicabilityCalculator()
*/
+ @Override
public IOptionApplicability getApplicabilityCalculator() {
if (applicabilityCalculator == null) {
if (applicabilityCalculatorElement != null) {
@@ -1152,27 +1163,28 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
return applicabilityCalculator;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getBuiltIns()
*/
+ @Override
public String[] getBuiltIns() {
// Return the list of built-ins as an array
List<OptionStringValue> list = getExactBuiltinsList();
List<String> valueList = listValueListToValueList(list);
-
+
if(valueList == null)
return EMPTY_STRING_ARRAY;
return valueList.toArray(new String[valueList.size()]);
}
-
+
public List<OptionStringValue> getExactBuiltinsList() {
// Return the list of built-ins as an array
if (builtIns == null) {
if (superClass != null) {
return ((Option)superClass).getExactBuiltinsList();
} else {
- return null;
+ return null;
}
}
@@ -1182,6 +1194,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getCategory()
*/
+ @Override
public IOptionCategory getCategory() {
if (category == null) {
if (superClass != null) {
@@ -1189,24 +1202,25 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
} else {
if (getOptionHolder() instanceof ITool) {
return ((ITool)getOptionHolder()).getTopOptionCategory();
- } else {
+ } else {
return null;
}
- }
+ }
}
- return category;
+ return category;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getCommand()
*/
+ @Override
public String getCommand() {
if (command == null) {
if (superClass != null) {
return superClass.getCommand();
} else {
return EMPTY_STRING;
- }
+ }
}
return command;
}
@@ -1214,6 +1228,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getCommandGenerator()
*/
+ @Override
public IOptionCommandGenerator getCommandGenerator() {
if (commandGenerator == null) {
if (commandGeneratorElement != null) {
@@ -1233,24 +1248,26 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
return commandGenerator;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getCommandFalse()
*/
+ @Override
public String getCommandFalse() {
if (commandFalse == null) {
if (superClass != null) {
return superClass.getCommandFalse();
} else {
return EMPTY_STRING;
- }
+ }
}
return commandFalse;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getToolTip()
*/
+ @Override
public String getToolTip() {
if (tip == null) {
if (superClass != null) {
@@ -1264,6 +1281,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getContextId()
*/
+ @Override
public String getContextId() {
if (contextId == null) {
if (superClass != null) {
@@ -1277,6 +1295,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getDefinedSymbols()
*/
+ @Override
public String[] getDefinedSymbols() throws BuildException {
if (getValueType() != PREPROCESSOR_SYMBOLS) {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
@@ -1294,6 +1313,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getEnumCommand(java.lang.String)
*/
+ @Override
public String getEnumCommand(String id) throws BuildException {
// Sanity
if (id == null) return EMPTY_STRING;
@@ -1304,12 +1324,12 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
return superClass.getEnumCommand(id);
} else {
return EMPTY_STRING;
- }
+ }
}
if (getValueType() != ENUMERATED) {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
-
+
// First check for the command in ID->command map
String cmd = getEnumCommandMap().get(id);
if (cmd == null) {
@@ -1330,6 +1350,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getEnumName(java.lang.String)
*/
+ @Override
public String getEnumName(String id) throws BuildException {
// Sanity
if (id == null) return EMPTY_STRING;
@@ -1340,12 +1361,12 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
return superClass.getEnumName(id);
} else {
return EMPTY_STRING;
- }
+ }
}
if (getValueType() != ENUMERATED) {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
-
+
// First check for the command in ID->name map
String name = getEnumNameMap().get(id);
if (name == null) {
@@ -1359,8 +1380,8 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* A memory-safe accessor to the map of enumerated option value IDs to the commands
* that a tool understands.
- *
- * @return a Map of enumerated option value IDs to actual commands that are passed
+ *
+ * @return a Map of enumerated option value IDs to actual commands that are passed
* to a tool on the command line.
*/
private Map<String, String> getEnumCommandMap() {
@@ -1369,10 +1390,11 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
}
return enumCommands;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getEnumeratedId(java.lang.String)
*/
+ @Override
public String getEnumeratedId(String name) throws BuildException {
if (name == null) return null;
@@ -1382,7 +1404,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
return superClass.getEnumeratedId(name);
} else {
return EMPTY_STRING;
- }
+ }
}
if (getValueType() != ENUMERATED) {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
@@ -1399,7 +1421,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
}
/* (non-Javadoc)
- *
+ *
* @return a Map of enumerated option value IDs to the selection displayed to the user.
*/
private Map<String, String> getEnumNameMap() {
@@ -1408,10 +1430,11 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
}
return enumNames;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getIncludePaths()
*/
+ @Override
public String[] getIncludePaths() throws BuildException {
if (getValueType() != INCLUDE_PATH) {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
@@ -1429,6 +1452,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getLibraries()
*/
+ @Override
public String[] getLibraries() throws BuildException {
if (getValueType() != LIBRARIES) {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
@@ -1446,6 +1470,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getLibraryFiles()
*/
+ @Override
public String[] getLibraryFiles() throws BuildException {
if (getValueType() != LIBRARY_FILES) {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
@@ -1463,6 +1488,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getLibraryPaths()
*/
+ @Override
public String[] getLibraryPaths() throws BuildException {
if (getValueType() != LIBRARY_PATHS) {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
@@ -1476,10 +1502,11 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
return v.toArray(new String[v.size()]);
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getDefaultEnumValue()
*/
+ @Override
public String getSelectedEnum() throws BuildException {
if (getValueType() != ENUMERATED) {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
@@ -1490,6 +1517,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getStringListValue()
*/
+ @Override
public String[] getStringListValue() throws BuildException {
if (getValueType() != STRING_LIST) {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
@@ -1507,6 +1535,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getStringValue()
*/
+ @Override
public String getStringValue() throws BuildException {
if (getValueType() != STRING && getValueType() != ENUMERATED) {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
@@ -1517,6 +1546,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getUserObjects()
*/
+ @Override
public String[] getUserObjects() throws BuildException {
if (getValueType() != OBJECTS) {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
@@ -1535,13 +1565,14 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getValueType()
*/
+ @Override
public int getValueType() throws BuildException {
if (valueType == null) {
if (superClass != null) {
return superClass.getValueType();
} else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$;
- }
+ }
}
return valueType.intValue();
}
@@ -1549,6 +1580,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* Gets the value, applying appropriate defaults if necessary.
*/
+ @Override
public Object getValue() {
/*
* In order to determine the current value of an option, perform the following steps until a value is found:
@@ -1568,7 +1600,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
if (val == null) {
int valType;
try {
- valType = getValueType();
+ valType = getValueType();
} catch (BuildException e) {
return EMPTY_STRING;
}
@@ -1601,14 +1633,14 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
val = new ArrayList<String>();
break;
default:
- val = EMPTY_STRING;
+ val = EMPTY_STRING;
break;
}
}
}
return val;
}
-
+
public Object getExactValue() {
/*
* In order to determine the current value of an option, perform the following steps until a value is found:
@@ -1628,7 +1660,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
if (val == null) {
int valType;
try {
- valType = getValueType();
+ valType = getValueType();
} catch (BuildException e) {
return EMPTY_STRING;
}
@@ -1661,7 +1693,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
val = new ArrayList<OptionStringValue>();
break;
default:
- val = EMPTY_STRING;
+ val = EMPTY_STRING;
break;
}
}
@@ -1695,7 +1727,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
private List<String> listValueListToValueList(List<OptionStringValue> list){
if(list == null)
return null;
-
+
List<String> valueList = new ArrayList<String>(list.size());
for(int i = 0; i < list.size(); i++){
OptionStringValue el = list.get(i);
@@ -1703,11 +1735,11 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
}
return valueList;
}
-
+
private List<OptionStringValue> valueListToListValueList(List<String> list, boolean builtIn){
if(list == null)
return null;
-
+
List<OptionStringValue> lvList = new ArrayList<OptionStringValue>(list.size());
for(int i = 0; i < list.size(); i++){
String v = list.get(i);
@@ -1720,6 +1752,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* Gets the raw default value.
*/
+ @Override
public Object getDefaultValue() {
Object ev = getExactDefaultValue();
if(ev instanceof List<?>) {
@@ -1729,7 +1762,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
}
return ev;
}
-
+
public Object getExactDefaultValue() {
// Note: string-list options do not have a default value
if (defaultValue == null) {
@@ -1743,6 +1776,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setValue(Object)
*/
+ @Override
public void setDefaultValue(Object v) {
if(v instanceof List<?>) {
@SuppressWarnings("unchecked")
@@ -1756,10 +1790,11 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
rebuildState = true;
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setCategory(org.eclipse.cdt.managedbuilder.core.IOptionCategory)
*/
+ @Override
public void setCategory(IOptionCategory category) {
if (this.category != category) {
this.category = category;
@@ -1778,6 +1813,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setCommand(String)
*/
+ @Override
public void setCommand(String cmd) {
if (cmd == null && command == null) return;
if (cmd == null || command == null || !cmd.equals(command)) {
@@ -1792,6 +1828,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setCommandFalse(String)
*/
+ @Override
public void setCommandFalse(String cmd) {
if (cmd == null && commandFalse == null) return;
if (cmd == null || commandFalse == null || !cmd.equals(commandFalse)) {
@@ -1806,34 +1843,37 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setToolTip(String)
*/
+ @Override
public void setToolTip(String tooltip) {
if (tooltip == null && tip == null) return;
if (tooltip == null || tip == null || !tooltip.equals(tip)) {
tip = tooltip;
if(!isExtensionElement()){
- isDirty = true;
+ isDirty = true;
rebuildState = true;
}
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setContextId(String)
*/
+ @Override
public void setContextId(String id) {
if (id == null && contextId == null) return;
if (id == null || contextId == null || !id.equals(contextId)) {
contextId = id;
if(!isExtensionElement()){
- isDirty = true;
+ isDirty = true;
rebuildState = true;
}
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setResourceFilter(int)
*/
+ @Override
public void setResourceFilter(int filter) {
if (resourceFilter == null || !(filter == resourceFilter.intValue())) {
resourceFilter = new Integer(filter);
@@ -1843,10 +1883,11 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
}
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setBrowseType(int)
*/
+ @Override
public void setBrowseType(int type) {
if (browseType == null || !(type == browseType.intValue())) {
browseType = new Integer(type);
@@ -1860,6 +1901,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setBrowseFilterPath(java.lang.String)
*/
+ @Override
public void setBrowseFilterPath(String path) {
if (browseFilterPath == null || !(browseFilterPath.equals(path))) {
browseFilterPath = path;
@@ -1873,6 +1915,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setBrowseFilterExtensions(java.lang.String[])
*/
+ @Override
public void setBrowseFilterExtensions(String[] extensions) {
if (browseFilterExtensions == null || !(browseFilterExtensions.equals(extensions))) {
browseFilterExtensions = extensions;
@@ -1886,6 +1929,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setValue(boolean)
*/
+ @Override
public void setValue(boolean value) throws BuildException {
if (/*!isExtensionElement() && */getValueType() == BOOLEAN){
this.value = new Boolean(value);
@@ -1902,8 +1946,9 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setValue(String)
*/
+ @Override
public void setValue(String value) throws BuildException {
- // Note that we can still set the human-readable value here
+ // Note that we can still set the human-readable value here
if (/*!isExtensionElement() && */(getValueType() == STRING || getValueType() == ENUMERATED)) {
this.value = value;
} else {
@@ -1914,13 +1959,14 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
rebuildState = true;
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setValue(String [])
*/
+ @Override
public void setValue(String [] value) throws BuildException {
- if (/*!isExtensionElement() && */
+ if (/*!isExtensionElement() && */
(getValueType() == STRING_LIST
|| getValueType() == INCLUDE_PATH
|| getValueType() == PREPROCESSOR_SYMBOLS
@@ -1953,7 +1999,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
}
public void setValue(OptionStringValue [] value) throws BuildException {
- if (/*!isExtensionElement() && */
+ if (/*!isExtensionElement() && */
(getValueType() == STRING_LIST
|| getValueType() == INCLUDE_PATH
|| getValueType() == PREPROCESSOR_SYMBOLS
@@ -1988,6 +2034,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setValue(Object)
*/
+ @Override
public void setValue(Object v) {
if(v instanceof List<?>) {
@SuppressWarnings("unchecked")
@@ -2005,6 +2052,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setValueType()
*/
+ @Override
public void setValueType(int type) {
// TODO: Verify that this is a valid type
if (valueType == null || valueType.intValue() != type) {
@@ -2027,7 +2075,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
}
return valueHandlerElement;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setValueHandlerElement(IConfigurationElement)
*/
@@ -2038,10 +2086,11 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
rebuildState = true;
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getValueHandler()
*/
+ @Override
public IManagedOptionValueHandler getValueHandler() {
if (valueHandler != null) {
return valueHandler;
@@ -2063,17 +2112,18 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
// If no handler is provided, then use the default handler
return ManagedOptionValueHandler.getManagedOptionValueHandler();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getValueHandlerExtraArgument())
*/
+ @Override
public String getValueHandlerExtraArgument() {
if (valueHandlerExtraArgument == null) {
if (superClass != null) {
return superClass.getValueHandlerExtraArgument();
} else {
return EMPTY_STRING;
- }
+ }
}
return valueHandlerExtraArgument;
}
@@ -2081,9 +2131,10 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setValueHandlerExtraArgument(String))
*/
+ @Override
public void setValueHandlerExtraArgument(String extraArgument) {
if (extraArgument == null && valueHandlerExtraArgument == null) return;
- if (extraArgument == null ||
+ if (extraArgument == null ||
valueHandlerExtraArgument == null ||
!extraArgument.equals(valueHandlerExtraArgument)) {
valueHandlerExtraArgument = extraArgument;
@@ -2097,6 +2148,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getFieldEditorId()
*/
+ @Override
public String getFieldEditorId() {
if (fieldEditorId == null) {
if (superClass != null) {
@@ -2109,13 +2161,14 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getFieldEditorExtraArgument()
*/
+ @Override
public String getFieldEditorExtraArgument() {
if (fieldEditorExtraArgument == null) {
if (superClass != null) {
return superClass.getFieldEditorExtraArgument();
} else {
return null;
- }
+ }
}
return fieldEditorExtraArgument;
}
@@ -2123,9 +2176,10 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setFieldEditorExtraArgument(java.lang.String)
*/
+ @Override
public void setFieldEditorExtraArgument(String extraArgument) {
if (extraArgument == null && fieldEditorExtraArgument == null) return;
- if (extraArgument == null ||
+ if (extraArgument == null ||
fieldEditorExtraArgument == null ||
!extraArgument.equals(fieldEditorExtraArgument)) {
fieldEditorExtraArgument = extraArgument;
@@ -2136,14 +2190,15 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
}
}
-
+
/*
* O B J E C T S T A T E M A I N T E N A N C E
*/
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#isExtensionElement()
*/
+ @Override
public boolean isExtensionElement() {
return isExtensionOption;
}
@@ -2179,7 +2234,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
getId());
} else {
// All of our superclasses must be resolved in order to call
- // getValueType below.
+ // getValueType below.
((Option)superClass).resolveReferences();
}
}
@@ -2219,7 +2274,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
case ENUMERATED:
value = element.getAttribute(VALUE);
defaultValue = element.getAttribute(DEFAULT_VALUE);
-
+
// Do we have enumeratedOptionValue children? If so, load them
// to define the valid values and the default value.
IManagedConfigElement[] enumElements = element.getChildren(ENUM_VALUE);
@@ -2236,7 +2291,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
getEnumNameMap().put(optId, SafeStringInterner.safeIntern(enumElements[i].getAttribute(NAME)));
Boolean isDefault = new Boolean(enumElements[i].getAttribute(IS_DEFAULT));
if (isDefault.booleanValue()) {
- defaultValue = optId;
+ defaultValue = optId;
}
}
break;
@@ -2255,7 +2310,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
case UNDEF_LIBRARY_PATHS:
case UNDEF_LIBRARY_FILES:
case UNDEF_MACRO_FILES:
- // Note: These string-list options do not load either the "value" or
+ // Note: These string-list options do not load either the "value" or
// "defaultValue" attributes. Instead, the ListOptionValue children
// are loaded in the value field.
List<OptionStringValue> vList = null;
@@ -2283,7 +2338,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
}
}
}
-
+
/**
* @return Returns the managedBuildRevision.
*/
@@ -2300,7 +2355,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* For now implement this method just as a utility to make code
* within the Option class cleaner.
- * TODO: In future we may want to move this to IOption
+ * TODO: In future we may want to move this to IOption
*/
protected boolean isAbstract() {
if (isAbstract != null) {
@@ -2309,7 +2364,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
return false; // Note: no inheritance from superClass
}
}
-
+
/**
* Verifies whether the option is valid and handles
* any errors for the option. The following errors
@@ -2319,7 +2374,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
* (b) Options that are children of a ToolChain must
* NEVER have a resourceFilter of "file".
* If an error occurs, the option is set to being invalid.
- *
+ *
* @pre All references have been resolved.
*/
private void verify() {
@@ -2330,10 +2385,10 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
// Check for error (a)
if (getCategory() == null) {
ManagedBuildManager.optionValidError(ManagedBuildManager.ERROR_CATEGORY, getId());
- // Object becomes invalid
+ // Object becomes invalid
isValid = false;
}
- // Check for error (b). Not specifying an attribute is OK.
+ // Check for error (b). Not specifying an attribute is OK.
// Do not use getResourceFilter as it does not allow
// differentiating between "all" and no attribute specified.
if ( resourceFilter != null )
@@ -2344,7 +2399,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
// specified. Thus do not produce an error. We can argue that "all"
// means all valid resource configurations.
ManagedBuildManager.optionValidError(ManagedBuildManager.ERROR_FILTER, getId());
- // Object becomes invalid
+ // Object becomes invalid
isValid = false;
}
}
@@ -2354,9 +2409,10 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#isValid()
*/
+ @Override
public boolean isValid() {
// We use a lazy scheme to check whether the option is valid.
- // Note that by default an option is valid. verify() is only called if
+ // Note that by default an option is valid. verify() is only called if
// the option has been resolved. This gets us around having to deal with
// ordering problems during a resolve, or introducing another global
// stage to verify the configuration after a resolve.
@@ -2364,11 +2420,11 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
// detected on load, but only when a particular grammar element
// is used, say in the GUI.
if (verified == false && resolved == true) {
- verify();
+ verify();
}
return isValid;
}
-
+
/**
* @return Returns true if this Option was created from an MBS 2.0 model
* OptionReference element.
@@ -2380,7 +2436,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
public void setWasOptRef(boolean was) {
wasOptRef = was;
}
-
+
/**
* @return Returns the version.
*/
@@ -2393,12 +2449,12 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
}
return version;
}
-
+
@Override
public void setVersion(Version version) {
// Do nothing
}
-
+
public BooleanExpressionApplicabilityCalculator getBooleanExpressionCalculator(boolean isExtensionAdjustment){
if(booleanExpressionCalculator == null && !isExtensionAdjustment){
if(superClass != null){
@@ -2407,7 +2463,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
}
return booleanExpressionCalculator;
}
-
+
public boolean isAdjustedExtension(){
return isUdjusted;
}
@@ -2424,10 +2480,10 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
} else {
superClassId = this.superClass.getId();
}
-
+
if(!isExtensionElement())
setDirty(true);
- }
+ }
}
public boolean needsRebuild() {
@@ -2440,59 +2496,64 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
rebuildState = rebuild;
}
-
+
public boolean matches(IOption option){
try {
if(option.getValueType() != getValueType())
return false;
-
+
if(!option.getName().equals(getName()))
return false;
} catch (BuildException e) {
return false;
}
-
+
return true;
}
+ @Override
public String[] getRequiredTypeIds() {
return new String[0];
}
+ @Override
public String[] getSupportedTypeIds() {
String referenced[] = null;
BooleanExpressionApplicabilityCalculator calc = getBooleanExpressionCalculator(false);
-
+
if(calc != null){
referenced = calc.getReferencedPropertyIds();
- }
-
+ }
+
if(referenced == null)
referenced = new String[0];
return referenced;
}
+ @Override
public String[] getSupportedValueIds(String typeId) {
String referenced[] = null;
BooleanExpressionApplicabilityCalculator calc = getBooleanExpressionCalculator(false);
-
+
if(calc != null){
referenced = calc.getReferencedValueIds(typeId);
- }
-
+ }
+
if(referenced == null)
referenced = new String[0];
return referenced;
}
+ @Override
public boolean requiresType(String typeId) {
return false;
}
+ @Override
public boolean supportsType(String id) {
boolean supports = false;
BooleanExpressionApplicabilityCalculator calc = getBooleanExpressionCalculator(false);
-
+
if(calc != null){
if(calc.referesProperty(id)){
supports = true;
@@ -2501,10 +2562,11 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
return supports;
}
+ @Override
public boolean supportsValue(String typeId, String valueId) {
boolean supports = false;
BooleanExpressionApplicabilityCalculator calc = getBooleanExpressionCalculator(false);
-
+
if(calc != null){
if(calc.referesPropertyValue(typeId, valueId)){
supports = true;
@@ -2513,6 +2575,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
return supports;
}
+ @Override
public String[] getBasicStringListValue() throws BuildException {
if (getBasicValueType() != STRING_LIST) {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
@@ -2522,10 +2585,11 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
if (v == null) {
return EMPTY_STRING_ARRAY;
}
-
+
return v.toArray(new String[v.size()]);
}
-
+
+ @Override
public OptionStringValue[] getBasicStringListValueElements() throws BuildException {
if (getBasicValueType() != STRING_LIST) {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
@@ -2535,11 +2599,12 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
if (v == null) {
return EMPTY_LV_ARRAY;
}
-
+
return v.toArray(new OptionStringValue[v.size()]);
}
+ @Override
public int getBasicValueType() throws BuildException {
switch(getValueType()){
case IOption.BOOLEAN:
@@ -2556,14 +2621,14 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
public boolean hasCustomSettings(){
if(superClass == null)
return true;
-
+
if(value != null && !value.equals(superClass.getValue())){
return true;
}
-
+
return false;
}
-
+
public static int getOppositeType(int type){
switch(type){
case INCLUDE_PATH:
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java
index d3110c78ed..eac628e826 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java
@@ -38,7 +38,7 @@ import org.eclipse.core.runtime.Path;
import org.osgi.framework.Version;
/**
- *
+ *
*/
public class OptionCategory extends BuildObject implements IOptionCategory {
@@ -52,18 +52,18 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
private IOptionCategory owner; // The logical Option Category parent
private String ownerId;
private URL iconPathURL;
-
+
private IConfigurationElement applicabilityCalculatorElement = null;
private IOptionCategoryApplicability applicabilityCalculator = null;
private BooleanExpressionApplicabilityCalculator booleanExpressionCalculator = null;
public static final String APPLICABILITY_CALCULATOR = "applicabilityCalculator"; //$NON-NLS-1$
-
+
// Miscellaneous
private boolean isExtensionOptionCategory = false;
private boolean isDirty = false;
private boolean resolved = true;
-
+
/*
* C O N S T R U C T O R S
*/
@@ -71,11 +71,11 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
public OptionCategory(IOptionCategory owner) {
this.owner = owner;
}
-
+
/**
- * This constructor is called to create an option category defined by an extension point in
+ * This constructor is called to create an option category defined by an extension point in
* a plugin manifest file, or returned by a dynamic element provider
- *
+ *
* @param parent The IHoldsOptions parent of this category, or <code>null</code> if
* defined at the top level
* @param element The category definition from the manifest file or a dynamic element
@@ -89,28 +89,28 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
resolved = false;
loadFromManifest(element);
-
+
// Hook me up to the Managed Build Manager
ManagedBuildManager.addExtensionOptionCategory(this);
-
+
// Add the category to the parent
parent.addOptionCategory(this);
}
/**
- * Create an <codeOptionCategory</code> based on the specification stored in the
+ * Create an <codeOptionCategory</code> based on the specification stored in the
* project file (.cdtbuild).
- *
- * @param parent The <code>IHoldsOptions</code> object the OptionCategory will be added to.
+ *
+ * @param parent The <code>IHoldsOptions</code> object the OptionCategory will be added to.
* @param element The XML element that contains the OptionCategory settings.
*/
public OptionCategory(IHoldsOptions parent, ICStorageElement element) {
this.holder = parent;
isExtensionOptionCategory = false;
-
+
// Initialize from the XML attributes
loadFromProject(element);
-
+
// Add the category to the parent
parent.addOptionCategory(this);
}
@@ -121,13 +121,13 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
public void loadFromManifest(IManagedConfigElement element) {
ManagedBuildManager.putConfigElement(this, element);
-
+
// id
setId(SafeStringInterner.safeIntern(element.getAttribute(IOptionCategory.ID)));
-
+
// name
setName(SafeStringInterner.safeIntern(element.getAttribute(IOptionCategory.NAME)));
-
+
// owner
ownerId = SafeStringInterner.safeIntern(element.getAttribute(IOptionCategory.OWNER));
@@ -137,29 +137,29 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
String icon = element.getAttribute(IOptionCategory.ICON);
iconPathURL = ManagedBuildManager.getURLInBuildDefinitions( (DefaultManagedConfigElement)element, new Path(icon) );
}
-
+
//get enablements
IManagedConfigElement enablements[] = element.getChildren(OptionEnablementExpression.NAME);
if(enablements.length > 0)
booleanExpressionCalculator = new BooleanExpressionApplicabilityCalculator(enablements);
// get the applicability calculator, if any
- String applicabilityCalculatorStr = element.getAttribute(APPLICABILITY_CALCULATOR);
+ String applicabilityCalculatorStr = element.getAttribute(APPLICABILITY_CALCULATOR);
if (applicabilityCalculatorStr != null && element instanceof DefaultManagedConfigElement) {
- applicabilityCalculatorElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
+ applicabilityCalculatorElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
} else {
applicabilityCalculator = booleanExpressionCalculator;
}
}
-
+
/* (non-Javadoc)
- * Initialize the OptionCategory information from the XML element
+ * Initialize the OptionCategory information from the XML element
* specified in the argument
- *
- * @param element An XML element containing the OptionCategory information
+ *
+ * @param element An XML element containing the OptionCategory information
*/
protected void loadFromProject(ICStorageElement element) {
-
+
// id (unique, do not intern)
setId(element.getAttribute(IBuildObject.ID));
@@ -167,7 +167,7 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
if (element.getAttribute(IBuildObject.NAME) != null) {
setName(SafeStringInterner.safeIntern(element.getAttribute(IBuildObject.NAME)));
}
-
+
// owner
if (element.getAttribute(IOptionCategory.OWNER) != null) {
ownerId = SafeStringInterner.safeIntern(element.getAttribute(IOptionCategory.OWNER));
@@ -176,8 +176,8 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
owner = holder.getOptionCategory(ownerId);
} else {
owner = getNullOptionCategory();
- }
-
+ }
+
// icon - was saved as URL in string form
if (element.getAttribute(IOptionCategory.ICON) != null) {
String iconPath = element.getAttribute(IOptionCategory.ICON);
@@ -189,7 +189,7 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
iconPathURL = null;
}
}
-
+
// Hook me in
if (owner == null)
((HoldsOptions)holder).addChildCategory(this);
@@ -214,30 +214,31 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
*/
public void serialize(ICStorageElement element) {
element.setAttribute(IBuildObject.ID, id);
-
+
if (name != null) {
element.setAttribute(IBuildObject.NAME, name);
}
if (owner != null)
element.setAttribute(IOptionCategory.OWNER, owner.getId());
-
+
if (iconPathURL != null) {
// Save as URL in string form
element.setAttribute(IOptionCategory.ICON, iconPathURL.toString());
}
-
+
// I am clean now
isDirty = false;
}
-
+
/*
* P A R E N T A N D C H I L D H A N D L I N G
*/
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOptionCategory#getChildCategories()
*/
+ @Override
public IOptionCategory[] getChildCategories() {
if (children != null)
return children.toArray(new IOptionCategory[children.size()]);
@@ -250,19 +251,21 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
children = new ArrayList<OptionCategory>();
children.add(category);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOptionCategory#getOptions()
*/
+ @Override
public Object[][] getOptions(IConfiguration configuration, IHoldsOptions optionHolder) {
IHoldsOptions[] optionHolders = new IHoldsOptions[1];
optionHolders[0] = optionHolder;
return getOptions(optionHolders, FILTER_PROJECT);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOptionCategory#getOptions()
*/
+ @Override
public Object[][] getOptions(IConfiguration configuration) {
IHoldsOptions[] optionHolders = null;
if (configuration != null) {
@@ -284,6 +287,7 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOptionCategory#getOptions()
*/
+ @Override
public Object[][] getOptions(IResourceInfo resinfo, IHoldsOptions optionHolder) {
IHoldsOptions[] optionHolders = new IHoldsOptions[1];
optionHolders[0] = optionHolder;
@@ -294,10 +298,11 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
isRoot = ((MultiResourceInfo)resinfo).isRoot();
return getOptions(optionHolders, isRoot ? FILTER_PROJECT : FILTER_FILE);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOptionCategory#getOptions()
*/
+ @Override
public Object[][] getOptions(IResourceConfiguration resConfig) {
IHoldsOptions[] optionHolders = null;
if (resConfig != null) {
@@ -305,10 +310,10 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
if (optionHolder instanceof ITool) {
optionHolders = resConfig.getTools();
} else if (optionHolder instanceof IToolChain) {
- // Resource configurations do not support categories that are children
- // of toolchains. The reason for this is that options in such categories
+ // Resource configurations do not support categories that are children
+ // of toolchains. The reason for this is that options in such categories
// are intended to be global. Thus return nothing.
- // TODO: Remove this restriction in future?
+ // TODO: Remove this restriction in future?
optionHolders = new IHoldsOptions[1];
optionHolders[0] = null;
}
@@ -317,15 +322,15 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
}
return getOptions(optionHolders, FILTER_FILE);
}
-
+
private IHoldsOptions getOptionHoldersSuperClass(IHoldsOptions optionHolder) {
- if (optionHolder instanceof ITool)
+ if (optionHolder instanceof ITool)
return ((ITool)optionHolder).getSuperClass();
- else if (optionHolder instanceof IToolChain)
+ else if (optionHolder instanceof IToolChain)
return ((IToolChain)optionHolder).getSuperClass();
return null;
}
-
+
private Object[][] getOptions(IHoldsOptions[] optionHolders, int filterValue) {
IHoldsOptions catHolder = getOptionHolder();
IHoldsOptions optionHolder = null;
@@ -347,7 +352,7 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
if (optionHolder == null) {
optionHolder = catHolder;
}
-
+
// Get all of the tool's options and see which ones are part of
// this category.
IOption[] allOptions = optionHolder.getOptions();
@@ -356,13 +361,13 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
for (int i = 0; i < allOptions.length; ++i) {
IOption option = allOptions[i];
if (option.getCategory().equals(this)) {
-
+
// Check whether this option can be displayed for a specific resource type.
if( (option.getResourceFilter() == FILTER_ALL) || (option.getResourceFilter() == filterValue) ) {
myOptions[index] = new Object[2];
myOptions[index][0] = optionHolder;
myOptions[index][1] = option;
- index++;
+ index++;
}
}
}
@@ -376,6 +381,7 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOptionCategory#getOwner()
*/
+ @Override
public IOptionCategory getOwner() {
return owner;
}
@@ -383,6 +389,7 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOptionCategory#getOptionHolder()
*/
+ @Override
public IHoldsOptions getOptionHolder() {
// This will stop at the parent's top category
if (owner != null)
@@ -393,6 +400,7 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOptionCategory#getTool()
*/
+ @Override
public ITool getTool() {
// This will stop at the tool's top category
IHoldsOptions parent = owner.getOptionHolder();
@@ -406,14 +414,15 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOptionCategory#getIconPath()
*/
+ @Override
public URL getIconPath() {
return iconPathURL;
}
-
+
/*
* O B J E C T S T A T E M A I N T E N A N C E
*/
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOptionCategory#isExtensionElement()
*/
@@ -424,6 +433,7 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOptionCategory#isDirty()
*/
+ @Override
public boolean isDirty() {
// This shouldn't be called for an extension OptionCategory
if (isExtensionOptionCategory) return false;
@@ -433,6 +443,7 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IIOptionCategory#setDirty(boolean)
*/
+ @Override
public void setDirty(boolean isDirty) {
this.isDirty = isDirty;
}
@@ -446,7 +457,7 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
if (owner == null) {
if (holder instanceof IOptionCategory) {
// Report error, only if the parent is a tool and thus also
- // an option category.
+ // an option category.
ManagedBuildManager.outputResolveError(
"owner", //$NON-NLS-1$
ownerId,
@@ -455,7 +466,7 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
error = true;
} else if ( false == holder.getId().equals(ownerId) ) {
// Report error, if the holder ID does not match the owner's ID.
- ManagedBuildManager.outputResolveError(
+ ManagedBuildManager.outputResolveError(
"owner", //$NON-NLS-1$
ownerId,
"optionCategory", //$NON-NLS-1$
@@ -467,7 +478,7 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
if (owner == null) {
owner = getNullOptionCategory();
}
-
+
// Hook me in
if (owner == null && error == false)
((HoldsOptions)holder).addChildCategory(this);
@@ -503,50 +514,50 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
}
return version;
}
-
+
@Override
public void setVersion(Version version) {
// Do nothing
}
/**
- * Creates a name that uniquely identifies a category. The match name is
- * a concatenation of the tool and categories, e.g. Tool->Cat1->Cat2
+ * Creates a name that uniquely identifies a category. The match name is
+ * a concatenation of the tool and categories, e.g. Tool->Cat1->Cat2
* maps onto the string "Tool|Cat1|Cat2|"
- *
- * @param catOrTool category or tool for which to build the match name
+ *
+ * @param catOrTool category or tool for which to build the match name
* @return match name
*/
static public String makeMatchName(IBuildObject catOrTool) {
String catName = EMPTY_STRING;
-
+
// Build the match name.
do {
catName = catOrTool.getName() + "|" + catName; //$NON-NLS-1$
if (catOrTool instanceof ITool) break;
else if (catOrTool instanceof IOptionCategory) {
- catOrTool = ((IOptionCategory)catOrTool).getOwner();
- } else
+ catOrTool = ((IOptionCategory)catOrTool).getOwner();
+ } else
break;
} while (catOrTool != null);
-
+
return catName;
}
-
+
/**
* Finds an option category from an array of categories by comparing against
- * a match name. The match name is a concatenation of the tool and categories,
+ * a match name. The match name is a concatenation of the tool and categories,
* e.g. Tool->Cat1->Cat2 maps onto the string "Tool|Cat1|Cat2|"
- *
- * @param matchName an identifier to search
- * @param cats as returned by getChildCategories(), i.e. non-flattened
+ *
+ * @param matchName an identifier to search
+ * @param cats as returned by getChildCategories(), i.e. non-flattened
* @return category or tool, if found and null otherwise
*/
static public Object findOptionCategoryByMatchName(String matchName, IOptionCategory[] cats) {
Object primary = null;
-
+
for (int j=0; j<cats.length; j++) {
- IBuildObject catOrTool = cats[j];
+ IBuildObject catOrTool = cats[j];
// Build the match name
String catName = makeMatchName(catOrTool);
// Check whether the name matches
@@ -562,12 +573,13 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
}
return primary;
}
-
+
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.managedbuilder.core.IOptionCategory#getApplicabilityCalculator()
*/
+ @Override
public IOptionCategoryApplicability getApplicabilityCalculator() {
if (applicabilityCalculator == null) {
if (applicabilityCalculatorElement != null) {
@@ -579,7 +591,7 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
ManagedBuilderCorePlugin.log(e);
}
}
- }
+ }
return applicabilityCalculator;
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
index 2abea630b3..e26d2cf9e2 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
@@ -39,8 +39,8 @@ import org.w3c.dom.NodeList;
/**
* An <code>OptionReference</code> plays two roles in the managed build model.
- * It is used to store overridden option values in a toolchain specification at
- * the level of a <code>Configuration</code> and it stores user option settings
+ * It is used to store overridden option values in a toolchain specification at
+ * the level of a <code>Configuration</code> and it stores user option settings
* between sessions.
*/
public class OptionReference implements IOption {
@@ -48,7 +48,7 @@ public class OptionReference implements IOption {
// List of built-in values a tool defines
private List<String> builtIns;
// Used for all option references that override the command
- // Note: This is not currently used - don't start using it because
+ // Note: This is not currently used - don't start using it because
// it is not handled in converting from the CDT 2.0 object model
private String command;
// The option this reference overrides
@@ -60,7 +60,7 @@ public class OptionReference implements IOption {
private boolean resolved = true;
/**
- * This constructor will be called when the receiver is created from
+ * This constructor will be called when the receiver is created from
* the settings found in an extension point.
*/
public OptionReference(ToolReference owner, IManagedConfigElement element) {
@@ -69,20 +69,20 @@ public class OptionReference implements IOption {
resolved = false;
this.owner = owner;
-
+
owner.addOptionReference(this);
}
/**
- * Constructor called when the option reference is created from an
+ * Constructor called when the option reference is created from an
* existing <code>IOption</code>
*/
public OptionReference(ToolReference owner, IOption option) {
this.owner = owner;
this.option = option;
-
- // Until the option reference is changed, all values will be extracted from original option
+
+ // Until the option reference is changed, all values will be extracted from original option
owner.addOptionReference(this);
}
@@ -97,18 +97,18 @@ public class OptionReference implements IOption {
// Something bad happened
option = null;
}
-
+
// Bail now if there's no option for the reference
if (option == null) {
return;
}
-
+
int optValType;
try {
- optValType = option.getValueType();
+ optValType = option.getValueType();
} catch (BuildException e) {return;}
-
- // Hook the reference up
+
+ // Hook the reference up
owner.addOptionReference(this);
// value
@@ -120,7 +120,7 @@ public class OptionReference implements IOption {
case ENUMERATED:
// Pre-2.0 the value was the string for the UI
// Post-2.0 it is the ID of the enumerated option
- value = element.getAttribute(DEFAULT_VALUE);
+ value = element.getAttribute(DEFAULT_VALUE);
break;
case STRING_LIST:
case INCLUDE_PATH:
@@ -155,12 +155,12 @@ public class OptionReference implements IOption {
}
}
-
+
public void resolveReferences() {
if (!resolved) {
resolved = true;
IManagedConfigElement element = ManagedBuildManager.getConfigElement(this);
-
+
// resolve parent (recursively) before calling methods on it.
option = owner.getTool().getOptionById(element.getAttribute(ID));
if (option == null) {
@@ -173,14 +173,14 @@ public class OptionReference implements IOption {
} else if (option instanceof OptionReference) {
((OptionReference)option).resolveReferences();
}
-
+
// Note: The "value" loaded here when the optionReference is read from the manifest file.
// This because the "valueType" is only known once the option reference is resolved.
int optValType;
try {
- optValType = option.getValueType();
+ optValType = option.getValueType();
} catch (BuildException e) {return;}
-
+
// value
switch (optValType) {
case BOOLEAN:
@@ -227,21 +227,21 @@ public class OptionReference implements IOption {
}
}
}
-
+
/**
* Persist receiver to project file.
*/
public void serialize(Document doc, Element element) {
element.setAttribute(ID, option.getId());
-
+
int optValType;
try {
- optValType = option.getValueType();
+ optValType = option.getValueType();
} catch (BuildException e) {
// TODO: Issue an error message
return;
}
-
+
// value
switch (optValType) {
case BOOLEAN:
@@ -286,10 +286,11 @@ public class OptionReference implements IOption {
break;
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getOptionContextData(org.eclipse.cdt.managedbuilder.core.IHoldsOptions)
*/
+ @Override
public IOptionContextData getOptionContextData(IHoldsOptions holder) {
return option.getOptionContextData(holder);
}
@@ -297,6 +298,7 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getApplicableValues()
*/
+ @Override
public String[] getApplicableValues() {
return option.getApplicableValues();
}
@@ -304,6 +306,7 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getCategory()
*/
+ @Override
public IOptionCategory getCategory() {
return option.getCategory();
}
@@ -311,6 +314,7 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getCommand()
*/
+ @Override
public String getCommand() {
return option.getCommand();
}
@@ -318,6 +322,7 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getCommandGenerator()
*/
+ @Override
public IOptionCommandGenerator getCommandGenerator() {
return option.getCommandGenerator();
}
@@ -325,20 +330,23 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getCommandFalse()
*/
+ @Override
public String getCommandFalse() {
return option.getCommandFalse();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getToolTip()
*/
+ @Override
public String getToolTip() {
return option.getToolTip();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getContextID()
*/
+ @Override
public String getContextId() {
return option.getContextId();
}
@@ -346,6 +354,7 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getDefinedSymbols()
*/
+ @Override
public String[] getDefinedSymbols() throws BuildException {
if (value == null)
return option.getDefinedSymbols();
@@ -361,6 +370,7 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getEnumCommand(java.lang.String)
*/
+ @Override
public String getEnumCommand(String id) {
if (!resolved) {
resolveReferences();
@@ -377,6 +387,7 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getEnumName(java.lang.String)
*/
+ @Override
public String getEnumName(String id) {
if (!resolved) {
resolveReferences();
@@ -386,37 +397,40 @@ public class OptionReference implements IOption {
String name = option.getEnumName(id);
return name;
} catch (BuildException e) {}
- }
+ }
return new String();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getEnumeratedId(java.lang.String)
*/
+ @Override
public String getEnumeratedId(String name) {
if (!resolved) {
resolveReferences();
}
if (option != null) {
try {
- String id = option.getEnumeratedId(name);
+ String id = option.getEnumeratedId(name);
return id;
} catch (BuildException e) {}
}
return new String();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IBuildObject#getId()
*/
+ @Override
public String getId() {
// A reference has the same id as the option it references
return option.getId();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IBuildObject#getBaseId()
*/
+ @Override
public String getBaseId() {
// A reference has the same id as the option it references
return option.getBaseId();
@@ -425,6 +439,7 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getIncludePaths()
*/
+ @Override
public String[] getIncludePaths() throws BuildException {
if (value == null)
return option.getIncludePaths();
@@ -440,6 +455,7 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getLibraries()
*/
+ @Override
public String[] getLibraries() throws BuildException {
if (value == null)
return option.getLibraries();
@@ -455,6 +471,7 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getLibraryFiles()
*/
+ @Override
public String[] getLibraryFiles() throws BuildException {
if (value == null)
return option.getLibraryFiles();
@@ -470,6 +487,7 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getLibraryPaths()
*/
+ @Override
public String[] getLibraryPaths() throws BuildException {
if (value == null)
return option.getLibraryPaths();
@@ -481,10 +499,11 @@ public class OptionReference implements IOption {
else
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IBuildObject#getName()
*/
+ @Override
public String getName() {
// A reference has the same name as the option it references
return option.getName();
@@ -493,10 +512,11 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getBooleanValue()
*/
+ @Override
public boolean getBooleanValue() throws BuildException {
if (value == null){
return option.getBooleanValue();
- }
+ }
else if (getValueType() == BOOLEAN) {
Boolean bool = (Boolean) value;
return bool.booleanValue();
@@ -504,10 +524,11 @@ public class OptionReference implements IOption {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getBrowseType()
*/
+ @Override
public int getBrowseType() {
return option.getBrowseType();
}
@@ -515,6 +536,7 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getBrowseFilterPath()
*/
+ @Override
public String getBrowseFilterPath() {
return option.getBrowseFilterPath();
}
@@ -522,6 +544,7 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getBrowseFilterExtensions()
*/
+ @Override
public String[] getBrowseFilterExtensions() {
return option.getBrowseFilterExtensions();
}
@@ -532,10 +555,11 @@ public class OptionReference implements IOption {
}
return builtIns;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getBuiltIns()
*/
+ @Override
public String[] getBuiltIns() {
List<String> answer = new ArrayList<String>();
if (builtIns != null) {
@@ -564,10 +588,11 @@ public class OptionReference implements IOption {
}
return option;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getSelectedEnum()
*/
+ @Override
public String getSelectedEnum() throws BuildException {
// A reference to an enumerated option stores the ID of the selected enum in its value
if (value == null) {
@@ -584,6 +609,7 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getStringListValue()
*/
+ @Override
public String[] getStringListValue() throws BuildException {
if (value == null)
return option.getStringListValue();
@@ -599,6 +625,7 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getStringValue()
*/
+ @Override
public String getStringValue() throws BuildException {
if (value == null)
return option.getStringValue();
@@ -611,6 +638,7 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getParent()
*/
+ @Override
public IBuildObject getParent() {
return owner;
}
@@ -618,22 +646,24 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getOptionHolder()
*/
+ @Override
public IHoldsOptions getOptionHolder() {
return owner;
}
-
+
/**
* Answers the tool reference that contains the receiver.
- *
+ *
* @return ToolReference
*/
public ToolReference getToolReference() {
return owner;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getUserObjects()
*/
+ @Override
public String[] getUserObjects() throws BuildException {
if (value == null)
return option.getDefinedSymbols();
@@ -649,24 +679,26 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getValueType()
*/
+ @Override
public int getValueType() {
int optValType;
try {
- optValType = option.getValueType();
+ optValType = option.getValueType();
} catch (BuildException e) {return -1;}
-
+
return optValType;
}
/* (non-Javadoc)
* Returns the raw value.
*/
+ @Override
public Object getValue() {
return value;
}
-
+
/**
- * Answers <code>true</code> if the receiver is a reference to the
+ * Answers <code>true</code> if the receiver is a reference to the
* <code>IOption</code> specified in the argument, esle answers <code>false</code>.
*/
public boolean references(IOption target) {
@@ -683,10 +715,11 @@ public class OptionReference implements IOption {
}
/**
- * Sets the boolean value of the receiver to the value specified in the argument.
+ * Sets the boolean value of the receiver to the value specified in the argument.
* If the receive is not a reference to a boolean option, method will throw an
* exception.
*/
+ @Override
public void setValue(boolean value) throws BuildException {
if (getValueType() == BOOLEAN)
this.value = new Boolean(value);
@@ -694,20 +727,22 @@ public class OptionReference implements IOption {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
+ @Override
public void setValue(String value) throws BuildException {
- // Note that we can still set the human-readable value here
+ // Note that we can still set the human-readable value here
if (getValueType() == STRING || getValueType() == ENUMERATED) {
this.value = value;
} else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
}
-
+
/**
* Sets the value of the receiver to be an array of items.
- *
+ *
* @param value An array of strings to place in the option reference.
*/
+ @Override
public void setValue(String [] value) throws BuildException {
if (getValueType() == STRING_LIST
|| getValueType() == INCLUDE_PATH
@@ -725,7 +760,7 @@ public class OptionReference implements IOption {
|| getValueType() == UNDEF_LIBRARY_FILES
|| getValueType() == UNDEF_MACRO_FILES
) {
- // Just replace what the option reference is holding onto
+ // Just replace what the option reference is holding onto
this.value = new ArrayList<String>(Arrays.asList(value));
}
else
@@ -737,15 +772,15 @@ public class OptionReference implements IOption {
*/
@Override
public String toString() {
- String answer = new String();
+ String answer = new String();
if (option != null) {
- answer += "Reference to " + option.getName(); //$NON-NLS-1$
+ answer += "Reference to " + option.getName(); //$NON-NLS-1$
}
-
+
if (answer.length() > 0) {
return answer;
} else {
- return super.toString();
+ return super.toString();
}
}
@@ -753,10 +788,11 @@ public class OptionReference implements IOption {
* The following methods are here in order to implement the new ITool methods.
* They should never be called.
*/
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#isExtensionElement()
*/
+ @Override
public boolean isExtensionElement() {
return false;
}
@@ -764,6 +800,7 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* Sets the raw value.
*/
+ @Override
public void setValue(Object v) {
value = v;
}
@@ -771,12 +808,14 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#setValueType()
*/
+ @Override
public void setValueType(int type) {
}
-
+
/* (non-Javadoc)
* Returns the raw default value.
*/
+ @Override
public Object getDefaultValue() {
return value;
}
@@ -784,28 +823,32 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#setValue(Object)
*/
+ @Override
public void setDefaultValue(Object v) {
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getSuperClass()
*/
+ @Override
public IOption getSuperClass() {
return null;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getResourceFilter()
*/
+ @Override
public int getResourceFilter() {
return FILTER_ALL;
}
-
+
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.managedbuilder.core.IOption#getApplicabilityCalculator()
*/
+ @Override
public IOptionApplicability getApplicabilityCalculator() {
return option.getApplicabilityCalculator();
}
@@ -813,35 +856,41 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setResourceFilter(int)
*/
+ @Override
public void setResourceFilter(int filter) {
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setBrowseType(int)
*/
+ @Override
public void setBrowseType(int type) {
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setBrowseFilterPath(java.lang.String)
*/
+ @Override
public void setBrowseFilterPath(String path) {
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setBrowseFilterExtensions(java.lang.String[])
*/
+ @Override
public void setBrowseFilterExtensions(String[] extensions) {
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#setCategory(org.eclipse.cdt.core.build.managed.IOptionCategory)
*/
+ @Override
public void setCategory(IOptionCategory category) {
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#setCommand(String)
*/
+ @Override
public void setCommand(String cmd) {
if (cmd == null && command == null) return;
if (cmd == null || command == null || !cmd.equals(command)) {
@@ -852,56 +901,64 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#setCommandFalse(String)
*/
+ @Override
public void setCommandFalse(String cmd) {
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#setToolTip(String)
*/
+ @Override
public void setToolTip(String tooltip) {
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#setContextId(String)
*/
+ @Override
public void setContextId(String contextId) {
}
-
+
+ @Override
public Version getVersion() {
return option.getVersion();
}
+ @Override
public void setVersion(Version version) {
option.setVersion(version);
}
+ @Override
public String getManagedBuildRevision() {
return option.getManagedBuildRevision();
- }
-
+ }
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getValueHandlerElement()
*/
public IConfigurationElement getValueHandlerElement() {
return null;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#setValueHandlerElement(IConfigurationElement)
*/
public void setValueHandlerElement(IConfigurationElement element) {
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getValueHandler()
*/
+ @Override
public IManagedOptionValueHandler getValueHandler() {
return null;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getValueHandlerExtraArgument())
*/
+ @Override
public String getValueHandlerExtraArgument() {
return null;
}
@@ -909,12 +966,14 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setValueHandlerExtraArgument(String))
*/
+ @Override
public void setValueHandlerExtraArgument(String extraArgument) {
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getFieldEditorId()
*/
+ @Override
public String getFieldEditorId() {
return null;
}
@@ -922,6 +981,7 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#getFieldEditorExtraArgument()
*/
+ @Override
public String getFieldEditorExtraArgument() {
return null;
}
@@ -929,16 +989,19 @@ public class OptionReference implements IOption {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#setFieldEditorExtraArgument(java.lang.String)
*/
+ @Override
public void setFieldEditorExtraArgument(String extraArgument) {
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOption#isValid()
*/
+ @Override
public boolean isValid() {
return option.isValid();
}
+ @Override
public String[] getBasicStringListValue() throws BuildException {
if (getBasicValueType() != STRING_LIST) {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
@@ -948,10 +1011,11 @@ public class OptionReference implements IOption {
if (v == null) {
return new String[0];
}
-
+
return v.toArray(new String[v.size()]);
}
+ @Override
public int getBasicValueType() throws BuildException {
switch(getValueType()){
case IOption.BOOLEAN:
@@ -965,6 +1029,7 @@ public class OptionReference implements IOption {
}
}
+ @Override
public OptionStringValue[] getBasicStringListValueElements()
throws BuildException {
String[] str = getBasicStringListValue();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OutputType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OutputType.java
index bf1f751360..3c8ca9403b 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OutputType.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OutputType.java
@@ -26,9 +26,9 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Platform;
-import org.osgi.framework.Version;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.core.runtime.content.IContentTypeManager;
+import org.osgi.framework.Version;
public class OutputType extends BuildObject implements IOutputType {
@@ -55,7 +55,7 @@ public class OutputType extends BuildObject implements IOutputType {
private String namePattern;
private IConfigurationElement nameProviderElement = null;
private IManagedOutputNameProvider nameProvider = null;
-
+
private BooleanExpressionApplicabilityCalculator booleanExpressionCalculator;
// Miscellaneous
@@ -67,11 +67,11 @@ public class OutputType extends BuildObject implements IOutputType {
/*
* C O N S T R U C T O R S
*/
-
+
/**
- * This constructor is called to create an OutputType defined by an extension point in
+ * This constructor is called to create an OutputType defined by an extension point in
* a plugin manifest file, or returned by a dynamic element provider
- *
+ *
* @param parent The ITool parent of this OutputType
* @param element The OutputType definition from the manifest file or a dynamic element
* provider
@@ -79,12 +79,12 @@ public class OutputType extends BuildObject implements IOutputType {
public OutputType(ITool parent, IManagedConfigElement element) {
this.parent = parent;
isExtensionOutputType = true;
-
+
// setup for resolving
resolved = false;
loadFromManifest(element);
-
+
IManagedConfigElement enablements[] = element.getChildren(OptionEnablementExpression.NAME);
if(enablements.length > 0)
booleanExpressionCalculator = new BooleanExpressionApplicabilityCalculator(enablements);
@@ -94,9 +94,9 @@ public class OutputType extends BuildObject implements IOutputType {
}
/**
- * This constructor is called to create an OutputType whose attributes will be
+ * This constructor is called to create an OutputType whose attributes will be
* set by separate calls.
- *
+ *
* @param parent The parent of the an OutputType
* @param superClass The superClass, if any
* @param Id The id for the new OutputType
@@ -122,23 +122,23 @@ public class OutputType extends BuildObject implements IOutputType {
}
/**
- * Create an <code>OutputType</code> based on the specification stored in the
+ * Create an <code>OutputType</code> based on the specification stored in the
* project file (.cdtbuild).
- *
- * @param parent The <code>ITool</code> the OutputType will be added to.
+ *
+ * @param parent The <code>ITool</code> the OutputType will be added to.
* @param element The XML element that contains the OutputType settings.
*/
public OutputType(ITool parent, ICStorageElement element) {
this.parent = parent;
isExtensionOutputType = false;
-
+
// Initialize from the XML attributes
loadFromProject(element);
}
/**
* Create an <code>OutputType</code> based upon an existing OutputType.
- *
+ *
* @param parent The <code>ITool</code> the OutputType will be added to.
* @param Id The identifier of the new OutputType
* @param name The name of the new OutputType
@@ -156,7 +156,7 @@ public class OutputType extends BuildObject implements IOutputType {
setName(name);
isExtensionOutputType = false;
boolean copyIds = Id.equals(outputType.id);
-
+
// Copy the remaining attributes
if (outputType.outputContentTypeId != null) {
outputContentTypeId = new String(outputType.outputContentTypeId);
@@ -191,9 +191,9 @@ public class OutputType extends BuildObject implements IOutputType {
namePattern = new String(outputType.namePattern);
}
- nameProviderElement = outputType.nameProviderElement;
- nameProvider = outputType.nameProvider;
-
+ nameProviderElement = outputType.nameProviderElement;
+ nameProvider = outputType.nameProvider;
+
if(copyIds) {
isDirty = outputType.isDirty;
rebuildState = outputType.rebuildState;
@@ -206,76 +206,76 @@ public class OutputType extends BuildObject implements IOutputType {
/*
* E L E M E N T A T T R I B U T E R E A D E R S A N D W R I T E R S
*/
-
+
/* (non-Javadoc)
- * Loads the OutputType information from the ManagedConfigElement specified in the
+ * Loads the OutputType information from the ManagedConfigElement specified in the
* argument.
- *
- * @param element Contains the OutputType information
+ *
+ * @param element Contains the OutputType information
*/
protected void loadFromManifest(IManagedConfigElement element) {
ManagedBuildManager.putConfigElement(this, element);
-
+
// id
setId(SafeStringInterner.safeIntern(element.getAttribute(IBuildObject.ID)));
-
+
// Get the name
setName(SafeStringInterner.safeIntern(element.getAttribute(IBuildObject.NAME)));
-
+
// superClass
superClassId = SafeStringInterner.safeIntern(element.getAttribute(IProjectType.SUPERCLASS));
-
+
// outputContentType
- outputContentTypeId = SafeStringInterner.safeIntern(element.getAttribute(IOutputType.OUTPUT_CONTENT_TYPE));
-
+ outputContentTypeId = SafeStringInterner.safeIntern(element.getAttribute(IOutputType.OUTPUT_CONTENT_TYPE));
+
// outputs
outputs = SafeStringInterner.safeIntern(element.getAttribute(IOutputType.OUTPUTS));
-
+
// option
- optionId = SafeStringInterner.safeIntern(element.getAttribute(IOutputType.OPTION));
-
+ optionId = SafeStringInterner.safeIntern(element.getAttribute(IOutputType.OPTION));
+
// multipleOfType
String isMOT = element.getAttribute(IOutputType.MULTIPLE_OF_TYPE);
if (isMOT != null){
multipleOfType = new Boolean("true".equals(isMOT)); //$NON-NLS-1$
}
-
+
// primaryInputType
primaryInputTypeId = SafeStringInterner.safeIntern(element.getAttribute(IOutputType.PRIMARY_INPUT_TYPE));
-
+
// primaryOutput
String isPO = element.getAttribute(IOutputType.PRIMARY_OUTPUT);
if (isPO != null){
primaryOutput = new Boolean("true".equals(isPO)); //$NON-NLS-1$
}
-
+
// outputPrefix
outputPrefix = SafeStringInterner.safeIntern(element.getAttribute(IOutputType.OUTPUT_PREFIX));
-
+
// outputNames
outputNames = SafeStringInterner.safeIntern(element.getAttribute(IOutputType.OUTPUT_NAMES));
-
+
// namePattern
namePattern = SafeStringInterner.safeIntern(element.getAttribute(IOutputType.NAME_PATTERN));
-
+
// buildVariable
- buildVariable = SafeStringInterner.safeIntern(element.getAttribute(IOutputType.BUILD_VARIABLE));
+ buildVariable = SafeStringInterner.safeIntern(element.getAttribute(IOutputType.BUILD_VARIABLE));
- // Store the configuration element IFF there is a name provider defined
- String nameProvider = element.getAttribute(IOutputType.NAME_PROVIDER);
+ // Store the configuration element IFF there is a name provider defined
+ String nameProvider = element.getAttribute(IOutputType.NAME_PROVIDER);
if (nameProvider != null && element instanceof DefaultManagedConfigElement) {
- nameProviderElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
+ nameProviderElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
}
}
-
+
/* (non-Javadoc)
- * Initialize the OutputType information from the XML element
+ * Initialize the OutputType information from the XML element
* specified in the argument
- *
- * @param element An XML element containing the OutputType information
+ *
+ * @param element An XML element containing the OutputType information
*/
protected void loadFromProject(ICStorageElement element) {
-
+
// id (unique, do not intern)
setId(element.getAttribute(IBuildObject.ID));
@@ -283,7 +283,7 @@ public class OutputType extends BuildObject implements IOutputType {
if (element.getAttribute(IBuildObject.NAME) != null) {
setName(SafeStringInterner.safeIntern(element.getAttribute(IBuildObject.NAME)));
}
-
+
// superClass
superClassId = SafeStringInterner.safeIntern(element.getAttribute(IProjectType.SUPERCLASS));
if (superClassId != null && superClassId.length() > 0) {
@@ -292,22 +292,22 @@ public class OutputType extends BuildObject implements IOutputType {
// TODO: Report error
}
}
-
+
// outputContentType
if (element.getAttribute(IOutputType.OUTPUT_CONTENT_TYPE) != null) {
- outputContentTypeId = SafeStringInterner.safeIntern(element.getAttribute(IOutputType.OUTPUT_CONTENT_TYPE));
+ outputContentTypeId = SafeStringInterner.safeIntern(element.getAttribute(IOutputType.OUTPUT_CONTENT_TYPE));
}
-
+
// outputs
if (element.getAttribute(IOutputType.OUTPUTS) != null) {
- outputs = SafeStringInterner.safeIntern(element.getAttribute(IOutputType.OUTPUTS));
+ outputs = SafeStringInterner.safeIntern(element.getAttribute(IOutputType.OUTPUTS));
}
-
+
// option
if (element.getAttribute(IOutputType.OPTION) != null) {
optionId = SafeStringInterner.safeIntern(element.getAttribute(IOutputType.OPTION));
}
-
+
// multipleOfType
if (element.getAttribute(IOutputType.MULTIPLE_OF_TYPE) != null) {
String isMOT = element.getAttribute(IOutputType.MULTIPLE_OF_TYPE);
@@ -315,13 +315,13 @@ public class OutputType extends BuildObject implements IOutputType {
multipleOfType = new Boolean("true".equals(isMOT)); //$NON-NLS-1$
}
}
-
+
// primaryInputType
if (element.getAttribute(IOutputType.PRIMARY_INPUT_TYPE) != null) {
primaryInputTypeId = SafeStringInterner.safeIntern(element.getAttribute(IOutputType.PRIMARY_INPUT_TYPE));
primaryInputType = parent.getInputTypeById(primaryInputTypeId);
}
-
+
// primaryOutput
if (element.getAttribute(IOutputType.PRIMARY_OUTPUT) != null) {
String isPO = element.getAttribute(IOutputType.PRIMARY_OUTPUT);
@@ -329,27 +329,27 @@ public class OutputType extends BuildObject implements IOutputType {
primaryOutput = new Boolean("true".equals(isPO)); //$NON-NLS-1$
}
}
-
+
// outputPrefix
if (element.getAttribute(IOutputType.OUTPUT_PREFIX) != null) {
outputPrefix = SafeStringInterner.safeIntern(element.getAttribute(IOutputType.OUTPUT_PREFIX));
}
-
+
// outputNames
if (element.getAttribute(IOutputType.OUTPUT_NAMES) != null) {
outputNames = SafeStringInterner.safeIntern(element.getAttribute(IOutputType.OUTPUT_NAMES));
}
-
+
// namePattern
if (element.getAttribute(IOutputType.NAME_PATTERN) != null) {
namePattern = SafeStringInterner.safeIntern(element.getAttribute(IOutputType.NAME_PATTERN));
}
-
+
// buildVariable
if (element.getAttribute(IOutputType.BUILD_VARIABLE) != null) {
buildVariable = SafeStringInterner.safeIntern(element.getAttribute(IOutputType.BUILD_VARIABLE));
}
-
+
// Note: Name Provider cannot be specified in a project file because
// an IConfigurationElement is needed to load it!
if (element.getAttribute(IOutputType.NAME_PROVIDER) != null) {
@@ -363,9 +363,9 @@ public class OutputType extends BuildObject implements IOutputType {
public void serialize(ICStorageElement element) {
if (superClass != null)
element.setAttribute(IProjectType.SUPERCLASS, superClass.getId());
-
+
element.setAttribute(IBuildObject.ID, id);
-
+
if (name != null) {
element.setAttribute(IBuildObject.NAME, name);
}
@@ -377,31 +377,31 @@ public class OutputType extends BuildObject implements IOutputType {
if (outputs != null) {
element.setAttribute(IOutputType.OUTPUTS, outputs);
}
-
+
if (optionId != null) {
element.setAttribute(IOutputType.OPTION, optionId);
}
-
+
if (multipleOfType != null) {
element.setAttribute(IOutputType.MULTIPLE_OF_TYPE, multipleOfType.toString());
}
-
+
if (primaryInputTypeId != null) {
element.setAttribute(IOutputType.PRIMARY_INPUT_TYPE, primaryInputTypeId);
}
-
+
if (primaryOutput != null) {
element.setAttribute(IOutputType.PRIMARY_OUTPUT, primaryOutput.toString());
}
-
+
if (outputPrefix != null) {
element.setAttribute(IOutputType.OUTPUT_PREFIX, outputPrefix);
}
-
+
if (outputNames != null) {
element.setAttribute(IOutputType.OUTPUT_NAMES, outputNames);
}
-
+
if (namePattern != null) {
element.setAttribute(IOutputType.NAME_PATTERN, namePattern);
}
@@ -415,7 +415,7 @@ public class OutputType extends BuildObject implements IOutputType {
if (nameProviderElement != null) {
// TODO: issue warning?
}
-
+
// I am clean now
isDirty = false;
}
@@ -427,6 +427,7 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOutputType#getParent()
*/
+ @Override
public ITool getParent() {
return parent;
}
@@ -438,6 +439,7 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOutputType#getSuperClass()
*/
+ @Override
public IOutputType getSuperClass() {
return superClass;
}
@@ -453,6 +455,7 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOutputType#getBuildVariable()
*/
+ @Override
public String getBuildVariable() {
if (buildVariable == null) {
// If I have a superClass, ask it
@@ -466,7 +469,7 @@ public class OutputType extends BuildObject implements IOutputType {
}
String defaultName = name.toUpperCase();
defaultName = defaultName.replaceAll("\\W", "_"); //$NON-NLS-1$ //$NON-NLS-2$
- defaultName += "_OUTPUTS"; //$NON-NLS-1$
+ defaultName += "_OUTPUTS"; //$NON-NLS-1$
return defaultName;
}
}
@@ -476,6 +479,7 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOutputType#setBuildVariable()
*/
+ @Override
public void setBuildVariable(String variableName) {
if (variableName == null && buildVariable == null) return;
if (buildVariable == null || variableName == null || !(variableName.equals(buildVariable))) {
@@ -488,6 +492,7 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOutputType#getMultipleOfType()
*/
+ @Override
public boolean getMultipleOfType() {
if (multipleOfType == null) {
if (superClass != null) {
@@ -502,6 +507,7 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOuputType#setMultipleOfType()
*/
+ @Override
public void setMultipleOfType(boolean b) {
if (multipleOfType == null || !(b == multipleOfType.booleanValue())) {
multipleOfType = new Boolean(b);
@@ -513,6 +519,7 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOuputType#getNamePattern()
*/
+ @Override
public String getNamePattern() {
if (namePattern == null) {
// If I have a superClass, ask it
@@ -528,6 +535,7 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOuputType#setNamePattern()
*/
+ @Override
public void setNamePattern(String pattern) {
if (pattern == null && namePattern == null) return;
if (namePattern == null || pattern == null || !(pattern.equals(namePattern))) {
@@ -561,6 +569,7 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOuputType#setNameProviderElement()
*/
+ @Override
public IManagedOutputNameProvider getNameProvider() {
if (nameProvider != null) {
return nameProvider;
@@ -580,20 +589,22 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOuputType#getOptionId()
*/
+ @Override
public String getOptionId() {
if (optionId == null) {
if (superClass != null) {
return superClass.getOptionId();
} else {
return null;
- }
+ }
}
- return optionId;
+ return optionId;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOuputType#setOptionId()
*/
+ @Override
public void setOptionId(String id) {
if (id == null && optionId == null) return;
if (id == null || optionId == null || !(optionId.equals(id))) {
@@ -606,13 +617,14 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOuputType#getOutputContentType()
*/
+ @Override
public IContentType getOutputContentType() {
if (outputContentType == null) {
if (superClass != null) {
return superClass.getOutputContentType();
} else {
return null;
- }
+ }
}
return outputContentType;
}
@@ -620,11 +632,12 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOuputType#setOutputContentType()
*/
+ @Override
public void setOutputContentType(IContentType type) {
if (outputContentType != type) {
outputContentType = type;
if (outputContentType != null) {
- outputContentTypeId = outputContentType.getId();
+ outputContentTypeId = outputContentType.getId();
} else {
outputContentTypeId = null;
}
@@ -636,6 +649,7 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOuputType#getOutputExtensionsAttribute()
*/
+ @Override
public String[] getOutputExtensionsAttribute() {
if (outputs == null) {
if (superClass != null) {
@@ -650,6 +664,7 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOuputType#setOutputExtensionsAttribute()
*/
+ @Override
public void setOutputExtensionsAttribute(String exts) {
if (exts == null && outputs == null) return;
if (outputs == null || exts == null || !(exts.equals(outputs))) {
@@ -671,6 +686,7 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOuputType#getOutputExtensions()
*/
+ @Override
public String[] getOutputExtensions(ITool tool) {
return getOutputExtensions(tool, ((Tool)tool).getProject());
}
@@ -678,6 +694,7 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOutputType#isOutputExtension()
*/
+ @Override
public boolean isOutputExtension(ITool tool, String ext) {
String[] exts = getOutputExtensions(tool);
if (exts != null) {
@@ -691,6 +708,7 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOuputType#getOutputPrefix()
*/
+ @Override
public String getOutputPrefix() {
if (outputPrefix == null) {
// If I have a superClass, ask it
@@ -706,6 +724,7 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOuputType#setOutputPrefix()
*/
+ @Override
public void setOutputPrefix(String prefix) {
if (prefix == null && outputPrefix == null) return;
if (outputPrefix == null || prefix == null || !(prefix.equals(outputPrefix))) {
@@ -718,6 +737,7 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOuputType#getOutputNames()
*/
+ @Override
public String[] getOutputNames() {
if (outputNames == null) {
// If I have a superClass, ask it
@@ -735,6 +755,7 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOuputType#setOutputNames()
*/
+ @Override
public void setOutputNames(String names) {
if (names == null && outputNames == null) return;
if (outputNames == null || names == null || !(names.equals(outputNames))) {
@@ -747,6 +768,7 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOuputType#getPrimaryInputType()
*/
+ @Override
public IInputType getPrimaryInputType() {
IInputType ret = primaryInputType;
if (ret == null) {
@@ -755,7 +777,7 @@ public class OutputType extends BuildObject implements IOutputType {
}
if (ret == null) {
ret = getParent().getPrimaryInputType();
- }
+ }
}
return ret;
}
@@ -763,11 +785,12 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOuputType#setPrimaryInputType()
*/
+ @Override
public void setPrimaryInputType(IInputType type) {
if (primaryInputType != type) {
primaryInputType = type;
if (primaryInputType != null) {
- primaryInputTypeId = primaryInputType.getId();
+ primaryInputTypeId = primaryInputType.getId();
} else {
primaryInputTypeId = null;
}
@@ -779,6 +802,7 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOuputType#getPrimaryOutput()
*/
+ @Override
public boolean getPrimaryOutput() {
if (primaryOutput == null) {
if (superClass != null) {
@@ -793,6 +817,7 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOuputType#setPrimaryOutput()
*/
+ @Override
public void setPrimaryOutput(boolean b) {
if (primaryOutput == null || !(b == primaryOutput.booleanValue())) {
primaryOutput = new Boolean(b);
@@ -804,10 +829,11 @@ public class OutputType extends BuildObject implements IOutputType {
/*
* O B J E C T S T A T E M A I N T E N A N C E
*/
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOutputType#isExtensionElement()
*/
+ @Override
public boolean isExtensionElement() {
return isExtensionOutputType;
}
@@ -815,6 +841,7 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOutputType#isDirty()
*/
+ @Override
public boolean isDirty() {
// This shouldn't be called for an extension OutputType
if (isExtensionOutputType) return false;
@@ -824,10 +851,11 @@ public class OutputType extends BuildObject implements IOutputType {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IOutputType#setDirty(boolean)
*/
+ @Override
public void setDirty(boolean isDirty) {
this.isDirty = isDirty;
}
-
+
/* (non-Javadoc)
* Resolve the element IDs to interface references
*/
@@ -846,7 +874,7 @@ public class OutputType extends BuildObject implements IOutputType {
getId());
}
}
-
+
// Resolve content types
IContentTypeManager manager = Platform.getContentTypeManager();
if (outputContentTypeId != null && outputContentTypeId.length() > 0) {
@@ -859,7 +887,7 @@ public class OutputType extends BuildObject implements IOutputType {
}
}
}
-
+
/**
* @return Returns the managedBuildRevision.
*/
@@ -885,23 +913,23 @@ public class OutputType extends BuildObject implements IOutputType {
}
return version;
}
-
+
@Override
public void setVersion(Version version) {
// Do nothing
}
-
+
public boolean needsRebuild(){
return rebuildState;
}
-
+
public void setRebuildState(boolean rebuild){
if(isExtensionElement() && rebuild)
return;
rebuildState = rebuild;
}
-
+
public BooleanExpressionApplicabilityCalculator getBooleanExpressionCalculator(){
if(booleanExpressionCalculator == null){
if(superClass != null){
@@ -910,15 +938,15 @@ public class OutputType extends BuildObject implements IOutputType {
}
return booleanExpressionCalculator;
}
-
+
public boolean isEnabled(ITool tool) {
if(tool.isExtensionElement())
return true;
-
+
BooleanExpressionApplicabilityCalculator calc = getBooleanExpressionCalculator();
if(calc == null)
return true;
-
+
return calc.isOutputTypeEnabled(tool, this);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java
index 2aa7cfa3fe..297bc92093 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java
@@ -41,10 +41,10 @@ import org.osgi.framework.Version;
public class ProjectType extends BuildObject implements IProjectType, IBuildPropertiesRestriction, IBuildPropertyChangeListener {
-
+
private static final String EMPTY_STRING = new String();
//private static final IConfiguration[] emptyConfigs = new IConfiguration[0];
-
+
// Superclass
private IProjectType superClass;
private String superClassId;
@@ -64,7 +64,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
private IProjectEnvironmentVariableSupplier environmentVariableSupplier = null;
private IConfigurationElement buildMacroSupplierElement = null;
private IProjectBuildMacroSupplier buildMacroSupplier = null;
-
+
BuildObjectProperties buildProperties;
@@ -72,13 +72,13 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
private boolean resolved = true;
private IConfigurationElement previousMbsVersionConversionElement;
private IConfigurationElement currentMbsVersionConversionElement;
-
+
/*
* C O N S T R U C T O R S
*/
/**
- * This constructor is called to create a projectType defined by an extension point in
+ * This constructor is called to create a projectType defined by an extension point in
* a plugin manifest file.
*/
public ProjectType(IManagedConfigElement element, String managedBuildRevision) {
@@ -86,18 +86,18 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
resolved = false;
setManagedBuildRevision(managedBuildRevision);
-
+
loadFromManifest(element);
-
+
// Hook me up to the Managed Build Manager
ManagedBuildManager.addExtensionProjectType(this);
// Load the configuration children
IManagedConfigElement[] configs = element.getChildren(IConfiguration.CONFIGURATION_ELEMENT_NAME);
-
+
String [] usedConfigNames = new String[configs.length];
IConfigurationNameProvider configurationNameProvder = getConfigurationNameProvider();
-
+
if ( configurationNameProvder != null ) {
// Tool Integrator provided 'ConfigurationNameProvider' class
// to get configuration names dynamically based architecture, os, toolchain version etc.
@@ -115,9 +115,9 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
}
/**
- * This constructor is called to create a project type whose attributes and children will be
+ * This constructor is called to create a project type whose attributes and children will be
* added by separate calls.
- *
+ *
* @param superClass The superClass, if any
* @param Id The id for the new project type
* @param managedBuildRevision The name for the new project type
@@ -132,10 +132,10 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
}
setId(Id);
setName(name);
-
+
setManagedBuildRevision(managedBuildRevision);
setVersion(getVersionFromId());
-
+
// Hook me up to the Managed Build Manager
ManagedBuildManager.addExtensionProjectType(this);
}
@@ -143,27 +143,27 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
/*
* E L E M E N T A T T R I B U T E R E A D E R S A N D W R I T E R S
*/
-
+
/**
- * Load the project-type information from the XML element specified in the
+ * Load the project-type information from the XML element specified in the
* argument
- * @param element An XML element containing the project type information
+ * @param element An XML element containing the project type information
*/
protected void loadFromManifest(IManagedConfigElement element) {
ManagedBuildManager.putConfigElement(this, element);
-
+
// id
setId(SafeStringInterner.safeIntern(element.getAttribute(ID)));
-
+
// Get the name
setName(SafeStringInterner.safeIntern(element.getAttribute(NAME)));
-
+
// version
setVersion(getVersionFromId());
-
+
// superClass
superClassId = SafeStringInterner.safeIntern(element.getAttribute(SUPERCLASS));
-
+
String props = SafeStringInterner.safeIntern(element.getAttribute(BUILD_PROPERTIES));
if(props != null)
buildProperties = new BuildObjectProperties(props, this, this);
@@ -172,18 +172,18 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
if(artType != null){
if(buildProperties == null)
buildProperties = new BuildObjectProperties(this, this);
-
+
try {
buildProperties.setProperty(ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID, artType, true);
} catch (CoreException e) {
ManagedBuilderCorePlugin.log(e);
}
}
-
+
// Get the unused children, if any
- unusedChildren = SafeStringInterner.safeIntern(element.getAttribute(UNUSED_CHILDREN));
-
+ unusedChildren = SafeStringInterner.safeIntern(element.getAttribute(UNUSED_CHILDREN));
+
// isAbstract
String isAbs = element.getAttribute(IS_ABSTRACT);
if (isAbs != null){
@@ -195,20 +195,20 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
if (isTestStr != null){
isTest = new Boolean("true".equals(isTestStr)); //$NON-NLS-1$
}
-
- // Store the configuration element IFF there is a configuration name provider defined
+
+ // Store the configuration element IFF there is a configuration name provider defined
if (element.getAttribute(CONFIGURATION_NAME_PROVIDER) != null && element instanceof DefaultManagedConfigElement) {
- configurationNameProviderElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
+ configurationNameProviderElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
}
-
+
// Get the environmentVariableSupplier configuration element
- String environmentVariableSupplier = element.getAttribute(PROJECT_ENVIRONMENT_SUPPLIER);
+ String environmentVariableSupplier = element.getAttribute(PROJECT_ENVIRONMENT_SUPPLIER);
if(environmentVariableSupplier != null && element instanceof DefaultManagedConfigElement){
environmentVariableSupplierElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
}
// Get the buildMacroSupplier configuration element
- String buildMacroSupplier = element.getAttribute(PROJECT_MACRO_SUPPLIER);
+ String buildMacroSupplier = element.getAttribute(PROJECT_MACRO_SUPPLIER);
if(buildMacroSupplier != null && element instanceof DefaultManagedConfigElement){
buildMacroSupplierElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
}
@@ -224,6 +224,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IProjectType#createConfiguration(org.eclipse.cdt.core.build.managed.IConfiguration)
*/
+ @Override
public IConfiguration createConfiguration(IConfiguration parent, String id, String name) {
Configuration config = new Configuration(this, parent, id, name);
// ManagedBuildManager.performValueHandlerEvent(config, IManagedOptionValueHandler.EVENT_OPEN);
@@ -233,21 +234,24 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IProjectType#getConfiguration()
*/
+ @Override
public IConfiguration getConfiguration(String id) {
return getConfigurationMap().get(id);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IProjectType#getConfigurations()
*/
+ @Override
public IConfiguration[] getConfigurations() {
IConfiguration[] configs = getConfigurationList().toArray(new IConfiguration[0]);
return configs;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IProjectType#removeConfiguration(java.lang.String)
*/
+ @Override
public void removeConfiguration(String id) {
// Remove the specified configuration from the list and map
Iterator<Configuration> iter = getConfigurationList().listIterator();
@@ -260,7 +264,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
}
}
}
-
+
/**
* Adds the Configuration to the Configuration list and map
*/
@@ -270,10 +274,10 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
getConfigurationMap().put(configuration.getId(), configuration);
}
}
-
+
/**
* Safe accessor for the list of configurations.
- *
+ *
* @return List containing the configurations
*/
private List<Configuration> getConfigurationList() {
@@ -282,7 +286,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
}
return configList;
}
-
+
/**
* Safe accessor for the map of configuration ids to configurations
*/
@@ -312,6 +316,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
return name;
}
+ @Override
public String getNameAttribute() {
// If I am unnamed, see if I can inherit one from my parent
if (name == null) {
@@ -328,6 +333,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IProjectType#getSuperClass()
*/
+ @Override
public IProjectType getSuperClass() {
return superClass;
}
@@ -335,6 +341,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IProjectType#isAbstract()
*/
+ @Override
public boolean isAbstract() {
if (isAbstract != null) {
return isAbstract.booleanValue();
@@ -346,16 +353,18 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IProjectType#unusedChildren()
*/
+ @Override
public String getUnusedChildren() {
if (unusedChildren != null) {
return unusedChildren;
} else
return EMPTY_STRING; // Note: no inheritance from superClass
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IProjectType#isTestProjectType()
*/
+ @Override
public boolean isTestProjectType() {
if (isTest == null) {
// If I have a superClass, ask it
@@ -371,6 +380,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
/**
* Sets the isAbstract attribute
*/
+ @Override
public void setIsAbstract(boolean b) {
isAbstract = new Boolean(b);
}
@@ -385,7 +395,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
/*
* O B J E C T S T A T E M A I N T E N A N C E
*/
-
+
/**
* Resolve the element IDs to interface references
*/
@@ -404,15 +414,15 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
getId());
}
}
-
+
// Add configurations from our superClass that are not overridden here
if (superClass != null) {
((ProjectType)superClass).resolveReferences();
IConfiguration[] superConfigs = superClass.getConfigurations();
for (int i = 0; i < superConfigs.length; i++) {
String superId = superConfigs[i].getId();
-
- check: {
+
+ check: {
IConfiguration[] currentConfigs = getConfigurations();
for (int j = 0; j < currentConfigs.length; j++) {
IConfiguration config = currentConfigs[j];
@@ -423,7 +433,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
}
addConfiguration((Configuration)superConfigs[i]);
} // end check
-
+
}
}
@@ -438,6 +448,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IProjectType#isSupported()
*/
+ @Override
public boolean isSupported(){
List<Configuration> configurationList = getConfigurationList();
for (Configuration current : configurationList) {
@@ -446,7 +457,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
}
return false;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IProjectType#getConfigurationNameProviderElement()
*/
@@ -459,24 +470,25 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
}
return configurationNameProviderElement;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IProjectType#setConfigurationNameProviderElement(IConfigurationElement)
*/
-
+
public void setConfigurationNameProviderElement(IConfigurationElement configurationElement) {
configurationNameProviderElement = configurationElement;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IProjectType#getConfigurationNameProvider()
*/
+ @Override
public IConfigurationNameProvider getConfigurationNameProvider() {
-
+
if (configurationNameProvider != null) {
return configurationNameProvider;
}
-
+
IConfigurationElement element = getConfigurationNameProviderElement();
if (element != null) {
try {
@@ -488,10 +500,10 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
}
return null;
}
-
+
/**
- * Returns the plugin.xml element of the projectEnvironmentSupplier extension or <code>null</code> if none.
- *
+ * Returns the plugin.xml element of the projectEnvironmentSupplier extension or <code>null</code> if none.
+ *
* @return IConfigurationElement
*/
public IConfigurationElement getEnvironmentVariableSupplierElement(){
@@ -503,10 +515,11 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
return environmentVariableSupplierElement;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IProjectType#getEnvironmentVariableSupplier()
*/
+ @Override
public IProjectEnvironmentVariableSupplier getEnvironmentVariableSupplier(){
if (environmentVariableSupplier != null) {
return environmentVariableSupplier;
@@ -524,8 +537,8 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
}
/**
- * Returns the plugin.xml element of the projectMacroSupplier extension or <code>null</code> if none.
- *
+ * Returns the plugin.xml element of the projectMacroSupplier extension or <code>null</code> if none.
+ *
* @return IConfigurationElement
*/
public IConfigurationElement getBuildMacroSupplierElement(){
@@ -537,10 +550,11 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
return buildMacroSupplierElement;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IProjectType#getBuildMacroSupplier()
*/
+ @Override
public IProjectBuildMacroSupplier getBuildMacroSupplier(){
if (buildMacroSupplier != null) {
return buildMacroSupplier;
@@ -556,8 +570,9 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
}
return null;
}
-
-
+
+
+ @Override
public String getConvertToId() {
if (convertToId == null) {
// If I have a superClass, ask it
@@ -570,23 +585,25 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
return convertToId;
}
-
+
+ @Override
public void setConvertToId(String convertToId) {
if (convertToId == null && this.convertToId == null) return;
if (convertToId == null || this.convertToId == null || !convertToId.equals(this.convertToId)) {
- this.convertToId = convertToId;
+ this.convertToId = convertToId;
}
return;
}
-
+
/*
* This function checks for migration support for the projectType while
* loading the project. If migration support is needed, looks for the available
* converters and adds them to the list.
*/
+ @Override
public boolean checkForMigrationSupport() {
-
+
String convertToId = getConvertToId();
if ((convertToId == null) || (convertToId.equals(""))) { //$NON-NLS-1$
// It means there is no 'convertToId' attribute available and
@@ -655,7 +672,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
// If control comes here, it means 'Tool Integrator' specified
// 'convertToId' attribute in toolchain definition file, but
// has not provided any converter. So, make the project is invalid
-
+
return false;
}
@@ -667,7 +684,8 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
public IConfigurationElement getCurrentMbsVersionConversionElement() {
return currentMbsVersionConversionElement;
}
-
+
+ @Override
public IBuildObjectProperties getBuildProperties() {
if(buildProperties == null){
BuildObjectProperties parentProps = findBuildProperties();
@@ -678,7 +696,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
}
return buildProperties;
}
-
+
BuildObjectProperties findBuildProperties(){
if(buildProperties == null){
if(superClass != null){
@@ -689,6 +707,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
return buildProperties;
}
+ @Override
public void propertiesChanged() {
List<Configuration> list = getConfigurationList();
for(int i = 0; i < list.size(); i++){
@@ -705,6 +724,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
return supportsValue(type.getId(), value.getId());
}
+ @Override
public boolean supportsType(String typeId) {
List<Configuration> list = getConfigurationList();
for(int i = 0; i < list.size(); i++){
@@ -714,6 +734,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
return false;
}
+ @Override
public boolean supportsValue(String typeId, String valueId) {
List<Configuration> list = getConfigurationList();
for(int i = 0; i < list.size(); i++){
@@ -723,6 +744,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
return false;
}
+ @Override
public String[] getRequiredTypeIds() {
List<String> result = new ArrayList<String>();
List<Configuration> list = getConfigurationList();
@@ -732,6 +754,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
return result.toArray(new String[result.size()]);
}
+ @Override
public String[] getSupportedTypeIds() {
List<String> result = new ArrayList<String>();
List<Configuration> list = getConfigurationList();
@@ -741,6 +764,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
return result.toArray(new String[result.size()]);
}
+ @Override
public String[] getSupportedValueIds(String typeId) {
List<String> result = new ArrayList<String>();
List<Configuration> list = getConfigurationList();
@@ -750,6 +774,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
return result.toArray(new String[result.size()]);
}
+ @Override
public boolean requiresType(String typeId) {
List<Configuration> list = getConfigurationList();
for(int i = 0; i < list.size(); i++){
@@ -759,6 +784,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
return false;
}
+ @Override
public IBuildPropertyValue getBuildArtefactType() {
IBuildObjectProperties props = findBuildProperties();
if(props != null){
@@ -769,6 +795,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
return null;
}
+ @Override
public boolean isSystemObject() {
return isTestProjectType() || getConvertToId().length() != 0;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceChangeHandler.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceChangeHandler.java
index 084f21e9c1..4a643f77be 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceChangeHandler.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceChangeHandler.java
@@ -48,7 +48,7 @@ import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.jobs.MultiRule;
public class ResourceChangeHandler implements IResourceChangeListener, ISaveParticipant {
-
+
private Map<IProject, IManagedBuildInfo> fRmProjectToBuildInfoMap = new HashMap<IProject, IManagedBuildInfo>();
private class ResourceConfigurationChecker implements IResourceDeltaVisitor{
@@ -60,15 +60,16 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
public ResourceConfigurationChecker(IResourceDelta rootDelta){
fRootDelta = rootDelta;
}
-
+
public IProject[] getModifiedProjects(){
return fModifiedProjects.toArray(new IProject[fModifiedProjects.size()]);
}
+ @Override
public boolean visit(IResourceDelta delta) throws CoreException {
IResource dResource = delta.getResource();
- int rcType = dResource.getType();
-
+ int rcType = dResource.getType();
+
if(rcType == IResource.PROJECT || rcType == IResource.FOLDER){
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IProject project = null;
@@ -145,7 +146,7 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
}
return true; // visit the children
}
-
+
private IPath substituteProject(IPath path, String projectName){
return new Path(projectName).makeAbsolute().append(path.removeFirstSegments(1));
}
@@ -161,14 +162,14 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
if(fromMakeGen == null || fromMakeGen.isGeneratedResource(root.getFile(substituteProject(fromPath,fromProject.getName()))))
return;
-
+
IManagedBuildInfo fromInfo = ManagedBuildManager.getBuildInfo(fromProject);
IProject toProject = root.findMember(toPath.uptoSegment(1)).getProject();
- IManagedBuildInfo toInfo = toProject != null ?
+ IManagedBuildInfo toInfo = toProject != null ?
ManagedBuildManager.getBuildInfo(toProject) :
null;
- IManagedBuilderMakefileGenerator toMakeGen = toProject != null ?
+ IManagedBuilderMakefileGenerator toMakeGen = toProject != null ?
getInitializedGenerator(toProject) :
null;
if(toMakeGen != null && toMakeGen.isGeneratedResource(root.getFile(toPath)))
@@ -189,22 +190,22 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
fModifiedProjects.add(fromProject);
}
}
-
+
private void handleDeleteFile(IPath path){
IProject project = findModifiedProject(path.segment(0));
if(project != null){
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
- if(info != null
+ if(info != null
&& removeResourceConfigurations(info,path))
fModifiedProjects.add(project);
}
}
-
+
//finds the project geven the initial project name
//That is:
// if the project of a given name was renamed returns the renamed project
// if the project of a given name was removed returns null
- // if the project of a given name was neither renamed or removed
+ // if the project of a given name was neither renamed or removed
// returns the project of that name or null if the project does not exist
//
private IProject findModifiedProject(final String oldProjectName){
@@ -229,6 +230,7 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
final IProject project[] = new IProject[1];
try {
fRootDelta.accept(new IResourceDeltaVisitor() {
+ @Override
public boolean visit(IResourceDelta delta) throws CoreException {
IResource dResource = delta.getResource();
int rcType = dResource.getType();
@@ -268,7 +270,7 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
// Determine if we can access the build info before actually trying
// If not, don't try, to avoid putting up a dialog box warning the user
if (!ManagedBuildManager.canGetBuildInfo(project)) return null;
-
+
IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(project);
if (buildInfo != null){
IConfiguration defaultCfg = buildInfo.getDefaultConfiguration();
@@ -296,7 +298,7 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
IManagedProject managedProj = info.getManagedProject();
if (managedProj != null) {
IConfiguration cfgs[] = managedProj.getConfigurations();
-
+
for(int i = 0; i < cfgs.length; i++)
ManagedBuildManager.performValueHandlerEvent(cfgs[i], IManagedOptionValueHandler.EVENT_CLOSE, true);
}
@@ -304,19 +306,20 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
}
/*
- * I R e s o u r c e C h a n g e L i s t e n e r
+ * I R e s o u r c e C h a n g e L i s t e n e r
*/
/* (non-Javadoc)
- *
+ *
* Handle the renaming and deletion of project resources
* This is necessary in order to update ResourceConfigurations and AdditionalInputs
- *
+ *
* @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
*/
+ @Override
public void resourceChanged(IResourceChangeEvent event) {
if (event.getSource() instanceof IWorkspace) {
-
+
switch (event.getType()) {
case IResourceChangeEvent.PRE_CLOSE:
IResource proj = event.getResource();
@@ -345,10 +348,10 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
try {
ResourceConfigurationChecker rcChecker = new ResourceConfigurationChecker(resDelta);
resDelta.accept(rcChecker);
-
- //saving info for the modified projects
+
+ //saving info for the modified projects
initInfoSerialization(rcChecker.getModifiedProjects());
-
+
} catch (CoreException e) {
ManagedBuilderCorePlugin.log(e);
}
@@ -358,7 +361,7 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
}
}
}
-
+
private void initInfoSerialization(final IProject projects[]){
if(projects.length == 0)
return;
@@ -389,7 +392,7 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
}
};
savingJob.setRule(buildInfoSaveRule);
-
+
savingJob.schedule();
}
@@ -409,7 +412,7 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
}
return changed;
}
-
+
private boolean removeResourceConfigurations(IManagedBuildInfo info, IPath path){
boolean changed = false;
IManagedProject mngProj = info.getManagedProject();
@@ -424,7 +427,7 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
}
return changed;
}
-
+
private boolean updateResourceConfiguration(IConfiguration config, IPath oldPath, IPath newPath){
IResourceConfiguration rcCfg = config.getResourceConfiguration(oldPath.toString());
if(rcCfg != null && !oldPath.equals(newPath)){
@@ -437,7 +440,7 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
}
return false;
}
-
+
private boolean removeResourceConfiguration(IConfiguration config, IPath path){
IResourceConfiguration rcCfg = config.getResourceConfiguration(path.toString());
if(rcCfg != null){
@@ -449,12 +452,13 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
}
/*
- * I S a v e P a r t i c i p a n t
+ * I S a v e P a r t i c i p a n t
*/
/* (non-Javadoc)
* @see org.eclipse.core.resources.ISaveParticipant#saving(org.eclipse.core.resources.ISaveContext)
*/
+ @Override
public void saving(ISaveContext context) throws CoreException {
PropertyManager.getInstance().serialize();
@@ -465,18 +469,21 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
/* (non-Javadoc)
* @see org.eclipse.core.resources.ISaveParticipant#doneSaving(org.eclipse.core.resources.ISaveContext)
*/
+ @Override
public void doneSaving(ISaveContext context) {
}
/* (non-Javadoc)
* @see org.eclipse.core.resources.ISaveParticipant#prepareToSave(org.eclipse.core.resources.ISaveContext)
*/
+ @Override
public void prepareToSave(ISaveContext context) throws CoreException {
}
/* (non-Javadoc)
* @see org.eclipse.core.resources.ISaveParticipant#rollback(org.eclipse.core.resources.ISaveContext)
*/
+ @Override
public void rollback(ISaveContext context) {
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java
index 62fc3a8410..fdc1962125 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java
@@ -57,29 +57,29 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
// Miscellaneous
private boolean isExtensionResourceConfig = false;
private boolean resolved = true;
-
+
/*
* C O N S T R U C T O R S
*/
-
+
/**
- * This constructor is called to create a resource configuration defined by an
+ * This constructor is called to create a resource configuration defined by an
* extension point in a plugin manifest file, or returned by a dynamic element provider
- *
+ *
* @param parent The IConfiguration parent of this resource configuration
- * @param element The resource configuration definition from the manifest file
+ * @param element The resource configuration definition from the manifest file
* or a dynamic element provider
*/
public ResourceConfiguration(IConfiguration parent, IManagedConfigElement element, String managedBuildRevision) {
super(parent, element, true);
isExtensionResourceConfig = true;
-
+
// setup for resolving
resolved = false;
setManagedBuildRevision(managedBuildRevision);
loadFromManifest(element);
-
+
// Hook me up to the Managed Build Manager
ManagedBuildManager.addExtensionResourceConfiguration(this);
@@ -90,22 +90,22 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
getToolList().add(toolChild);
getToolMap().put(toolChild.getId(), toolChild);
}
-
+
setDirty(false);
}
/**
- * Create a <code>ResourceConfiguration</code> based on the specification stored in the
+ * Create a <code>ResourceConfiguration</code> based on the specification stored in the
* project file (.cdtbuild).
- *
- * @param parent The <code>IConfiguration</code> the resource configuration will be added to.
+ *
+ * @param parent The <code>IConfiguration</code> the resource configuration will be added to.
* @param element The XML element that contains the resource configuration settings.
*/
public ResourceConfiguration(IConfiguration parent, ICStorageElement element, String managedBuildRevision) {
super(parent, element, true);
isExtensionResourceConfig = false;
setResourceData(new BuildFileData(this));
-
+
setManagedBuildRevision(managedBuildRevision);
// Initialize from the XML attributes
loadFromProject(element);
@@ -119,30 +119,30 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
addTool(tool);
}
}
-
+
String rebuild = PropertyManager.getInstance().getProperty(this, REBUILD_STATE);
if(rebuild == null || Boolean.valueOf(rebuild).booleanValue())
setRebuildState(true);
setDirty(false);
}
-
+
public ResourceConfiguration(FolderInfo folderInfo, ITool baseTool, String id, String resourceName, IPath path){
super(folderInfo, path, id, resourceName);
// setParentFolder(folderInfo);
// setParentFolderId(folderInfo.getId());
-
+
isExtensionResourceConfig = folderInfo.isExtensionElement();
if(!isExtensionResourceConfig)
setResourceData(new BuildFileData(this));
-
+
if ( folderInfo.getParent() != null)
setManagedBuildRevision(folderInfo.getParent().getManagedBuildRevision());
-
+
setDirty(false);
toolsToInvoke = EMPTY_STRING;
rcbsApplicability = new Integer(KIND_DISABLE_RCBS_TOOL);
-
-
+
+
// Get file extension.
String extString = path.getFileExtension();
if(baseTool != null){
@@ -158,9 +158,9 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
break;
}
}
-
+
if(baseTool != null){
- subId = ManagedBuildManager.calculateChildId(baseTool.getId(), null);
+ subId = ManagedBuildManager.calculateChildId(baseTool.getId(), null);
createTool(baseTool, subId, baseTool.getName(), false);
setRebuildState(true);
}
@@ -168,14 +168,14 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
/**
* Create a new resource configuration based on one already defined.
- *
- * @param cfg The <code>IConfiguration</code> the resource configuration will be added to.
+ *
+ * @param cfg The <code>IConfiguration</code> the resource configuration will be added to.
* @param cloneConfig The <code>ResourceConfiguration</code> to copy the settings from.
* @param id A unique ID for the new resource configuration.
*/
public ResourceConfiguration(IConfiguration cfg, ResourceConfiguration cloneConfig, String id, Map<IPath, Map<String, String>> superClassIdMap, boolean cloneChildren) {
super(cfg, cloneConfig, id);
-
+
isExtensionResourceConfig = cfg.isExtensionElement();
if(!cloneConfig.isExtensionResourceConfig)
cloneChildren = true;
@@ -184,7 +184,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
setResourceData(new BuildFileData(this));
setManagedBuildRevision(cloneConfig.getManagedBuildRevision());
-
+
// Copy the remaining attributes
if (cloneConfig.toolsToInvoke != null) {
toolsToInvoke = new String(cloneConfig.toolsToInvoke);
@@ -192,14 +192,14 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
if (cloneConfig.rcbsApplicability != null) {
rcbsApplicability = new Integer(cloneConfig.rcbsApplicability.intValue());
}
-
+
boolean copyIds = cloneChildren && id.equals(cloneConfig.id);
// Clone the resource configuration's tool children
if (cloneConfig.toolList != null) {
for (ITool toolChild : cloneConfig.getToolList()) {
String subId = null;
String subName;
-
+
Map<String, String> curIdMap = superClassIdMap.get(cloneConfig.getPath());
ITool extTool = ManagedBuildManager.getExtensionTool(toolChild);
if(curIdMap != null){
@@ -207,9 +207,9 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
subId = curIdMap.get(extTool.getId());
}
}
-
+
subName = toolChild.getName();
-
+
if(subId == null){
if (extTool != null) {
subId = copyIds ? toolChild.getId() : ManagedBuildManager.calculateChildId(
@@ -225,10 +225,10 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
}
// The superclass for the cloned tool is not the same as the one from the tool being cloned.
- // The superclasses reside in different configurations.
+ // The superclasses reside in different configurations.
ITool toolSuperClass = null;
String superId = null;
- // Search for the tool in this configuration that has the same grand-superClass as the
+ // Search for the tool in this configuration that has the same grand-superClass as the
// tool being cloned
ITool otherSuperTool = toolChild.getSuperClass();
if(otherSuperTool != null){
@@ -270,12 +270,12 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
// if(baseFo instanceof IFileInfo)
// baseFo = cfg.getResourceInfo(path.removeLastSegments(1), false);
// tCh = ((IFolderInfo)baseFo).getToolChain();
-//
+//
// }
// ITool[] tools = tCh.getTools();
// for (int i=0; i<tools.length; i++) {
// ITool configTool = tools[i];
-// if (toolChild.getSuperClass() != null
+// if (toolChild.getSuperClass() != null
// && configTool.getSuperClass() == toolChild.getSuperClass().getSuperClass())
// {
// toolSuperClass = configTool;
@@ -289,13 +289,13 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
Tool newTool = null;
if(toolSuperClass != null)
newTool = new Tool(this, toolSuperClass, subId, subName, (Tool)toolChild);
- else
+ else
newTool = new Tool(this, superId, subId, subName, (Tool)toolChild);
addTool(newTool);
}
}
-
+
if(copyIds){
isDirty = cloneConfig.isDirty;
needsRebuild = cloneConfig.needsRebuild;
@@ -307,17 +307,17 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
public ResourceConfiguration(ResourceConfiguration baseInfo, IPath path, String id, String name) {
super(baseInfo, path, id, name);
-
+
isExtensionResourceConfig = false;
setResourceData(new BuildFileData(this));
setManagedBuildRevision(baseInfo.getManagedBuildRevision());
-
+
// Copy the remaining attributes
toolsToInvoke = baseInfo.toolsToInvoke;
-
+
rcbsApplicability = new Integer(KIND_DISABLE_RCBS_TOOL);
-
+
// Clone the resource configuration's tool children
if (baseInfo.toolList != null) {
for (ITool toolChild : baseInfo.getToolList()) {
@@ -338,12 +338,12 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
/*
* E L E M E N T A T T R I B U T E R E A D E R S A N D W R I T E R S
*/
-
+
/* (non-Javadoc)
- * Loads the resource configuration information from the ManagedConfigElement
+ * Loads the resource configuration information from the ManagedConfigElement
* specified in the argument.
- *
- * @param element Contains the resource configuration information
+ *
+ * @param element Contains the resource configuration information
*/
protected void loadFromManifest(IManagedConfigElement element) {
ManagedBuildManager.putConfigElement(this, element);
@@ -363,12 +363,12 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
rcbsApplicability = new Integer(KIND_APPLY_RCBS_TOOL_AS_OVERRIDE);
}
}
-
+
/* (non-Javadoc)
- * Initialize the resource configuration information from the XML element
+ * Initialize the resource configuration information from the XML element
* specified in the argument
- *
- * @param element An XML element containing the resource configuration information
+ *
+ * @param element An XML element containing the resource configuration information
*/
protected void loadFromProject(ICStorageElement element) {
// toolsToInvoke
@@ -417,19 +417,19 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
str = DISABLE_RCBS_TOOL;
break;
default:
- str = DISABLE_RCBS_TOOL;
+ str = DISABLE_RCBS_TOOL;
break;
}
element.setAttribute(IResourceConfiguration.RCBS_APPLICABILITY, str);
}
-
+
// Serialize my children
List<ITool> toolElements = getToolList();
for (ITool tool : toolElements) {
ICStorageElement toolElement = element.createChild(ITool.TOOL_ELEMENT_NAME);
((Tool)tool).serialize(toolElement);
}
-
+
// I am clean now
setDirty(false);
}
@@ -438,16 +438,17 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
* P A R E N T A N D C H I L D H A N D L I N G
*/
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IResourceConfiguration#getTools()
*/
+ @Override
public ITool[] getTools() {
List<ITool> toolList = getToolList();
ITool[] tools = new ITool[toolList.size()];
int i = 0;
for (ITool tool : toolList) {
- tools[i++] = tool;
+ tools[i++] = tool;
}
return tools;
}
@@ -455,14 +456,15 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#getTool(java.lang.String)
*/
+ @Override
public ITool getTool(String id) {
Tool tool = (Tool)getToolMap().get(id);
return tool;
}
-
+
/* (non-Javadoc)
* Safe accessor for the list of tools.
- *
+ *
* @return List containing the tools
*/
private List<ITool> getToolList() {
@@ -471,10 +473,10 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
}
return toolList;
}
-
+
/* (non-Javadoc)
* Safe accessor for the map of tool ids to tools
- *
+ *
* @return
*/
private Map<String, ITool> getToolMap() {
@@ -486,7 +488,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
/* (non-Javadoc)
* Adds the Tool to the Tool list and map
- *
+ *
* @param Tool
*/
public void addTool(Tool tool) {
@@ -497,9 +499,10 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
/* (non-Javadoc)
* Removes the Tool from the Tool list and map
- *
+ *
* @param Tool
*/
+ @Override
public void removeTool(ITool tool) {
getToolList().remove(tool);
getToolMap().remove(tool);
@@ -513,15 +516,17 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#getResourcePath()
*/
+ @Override
public String getResourcePath() {
IPath path = getParent().getOwner().getProject().getFullPath();
path = path.append(getPath());
return path.toString();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#getRcbsApplicability()
*/
+ @Override
public int getRcbsApplicability() {
/*
* rcbsApplicability is an integer constant that represents how the user wants to
@@ -538,6 +543,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#getToolsToInvoke()
*/
+ @Override
public ITool[] getToolsToInvoke() {
/*
* toolsToInvoke is an ordered list of tool ids for the currently defined tools in
@@ -562,7 +568,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
* Update the current state of the toolsToInvoke attribute.
* Build and return an ITool[] for consumers.
*/
-
+
/*
* If no tools are currently defined, return a zero lengh array of ITool.
*/
@@ -571,7 +577,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
tools = new ITool[0];
return tools;
}
-
+
/*
* See if there is an rcbs tool defined. There should only be one at most.
*/
@@ -675,10 +681,11 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
return tools;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#getRcbsApplicability()
*/
+ @Override
public void setRcbsApplicability(int newValue) {
/*
* rcbsApplicability is an integer constant that represents how the user wants to
@@ -696,6 +703,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#setResourcePath()
*/
+ @Override
public void setResourcePath(String path) {
if( path == null)
return;
@@ -706,7 +714,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
/*
* O B J E C T S T A T E M A I N T E N A N C E
*/
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#isExtensionElement()
*/
@@ -721,16 +729,16 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
public boolean isDirty() {
// This shouldn't be called for an extension tool-chain
if (isExtensionResourceConfig) return false;
-
+
// If I need saving, just say yes
if (super.isDirty())
return true;
-
+
// Otherwise see if any tools need saving
for (ITool toolChild : getToolList()) {
if (toolChild.isDirty()) return true;
}
-
+
return false;
}
@@ -740,7 +748,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
@Override
public void setDirty(boolean isDirty) {
if (isExtensionResourceConfig) return;
-
+
super.setDirty(isDirty);
// Propagate "false" to the children
@@ -750,7 +758,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
}
}
}
-
+
/* (non-Javadoc)
* Resolve the element IDs to interface references
*/
@@ -765,20 +773,21 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
}
}
}
-
+
+ @Override
public ITool createTool(ITool superClass, String id, String name, boolean isExtensionElement) {
Tool tool = new Tool(this, superClass, id, name, isExtensionElement);
addTool(tool);
setDirty(true);
return tool;
}
-
+
public void reset() {
// We just need to remove all Options
ITool[] tools = getTools();
// Send out the event to notify the options that they are about to be removed
// ManagedBuildManager.performValueHandlerEvent(this, IManagedOptionValueHandler.EVENT_CLOSE);
- // Remove the configurations
+ // Remove the configurations
for (int i = 0; i < tools.length; i++) {
ITool tool = tools[i];
IOption[] opts = tool.getOptions();
@@ -792,11 +801,12 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#setToolCommand(org.eclipse.cdt.managedbuilder.core.ITool, java.lang.String)
*/
+ @Override
public void setToolCommand(ITool tool, String command) {
// TODO: Do we need to verify that the tool is part of the configuration?
tool.setToolCommand(command);
}
-
+
// private IBuildObject getHoldersParent(IOption option) {
// IHoldsOptions holder = option.getOptionHolder();
// if (holder instanceof ITool) {
@@ -806,11 +816,12 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
// }
// return null;
// }
-
+
+ @Override
public IResource getOwner() {
return getParent().getOwner();
}
-
+
/**
* @return Returns the version.
*/
@@ -823,7 +834,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
}
return version;
}
-
+
@Override
public void setVersion(Version version) {
// Do nothing
@@ -835,12 +846,12 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
@Override
public void updateManagedBuildRevision(String revision){
super.updateManagedBuildRevision(revision);
-
+
for (ITool tool : getToolList()) {
((Tool)tool).updateManagedBuildRevision(revision);
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#needsRebuild()
*/
@@ -848,7 +859,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
public boolean needsRebuild() {
if(super.needsRebuild())
return true;
-
+
ITool tools[] = getToolsToInvoke();
for(int i = 0; i < tools.length; i++){
if(tools[i].needsRebuild())
@@ -865,12 +876,12 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
public void setRebuildState(boolean rebuild) {
if(isExtensionResourceConfiguration() && rebuild)
return;
-
+
if(needsRebuild() != rebuild){
super.setRebuildState(rebuild);
saveRebuildState();
}
-
+
if(!rebuild){
ITool tools[] = getToolsToInvoke();
for(int i = 0; i < tools.length; i++){
@@ -879,19 +890,22 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
}
}
-
+
private void saveRebuildState(){
PropertyManager.getInstance().setProperty(this, REBUILD_STATE, Boolean.toString(needsRebuild()));
}
+ @Override
public final int getKind() {
return ICSettingBase.SETTING_FILE;
}
-
+
+ @Override
public CFileData getFileData(){
return (CFileData)getResourceData();
}
-
+
+ @Override
public CLanguageData[] getCLanguageDatas() {
ITool tools[] = getTools/*ToInvoke*/();
List<CLanguageData> list = new ArrayList<CLanguageData>();
@@ -909,7 +923,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
ITool baseTool = null;
for(int i = 0; i < tools.length; i++){
ITool tool = tools[i];
- ITool superTool = tool.getSuperClass();
+ ITool superTool = tool.getSuperClass();
if(superTool != null){
baseTool = superTool;
if(!superTool.isExtensionElement()){
@@ -917,7 +931,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
}
}
}
-
+
IToolChain baseTc = null;
if(baseTool != null){
IBuildObject parent = baseTool.getParent();
@@ -927,7 +941,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
baseTc = ((ResourceConfiguration)parent).getBaseToolChain();
}
}
-
+
return baseTc;
}
@@ -935,14 +949,15 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
public boolean isExtensionElement() {
return isExtensionResourceConfig;
}
-
+
+ @Override
public boolean supportsBuild(boolean managed) {
ITool tools[] = getToolsToInvoke();
for(int i = 0; i < tools.length; i++){
if(!tools[i].supportsBuild(managed))
return false;
}
-
+
return true;
}
@@ -979,28 +994,29 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
ITool otherTool = ((FolderInfo)parentRc).getToolFromInputExtension(ext);
if(otherTool == null)
return true;
-
+
ITool[] tti = getToolsToInvoke();
if(tti.length != 1)
return true;
-
+
return ((Tool)tti[0]).hasCustomSettings((Tool)otherTool);
}
ITool[] tools = getTools();
ITool[] otherTools = ((IFileInfo)parentRc).getTools();
if(tools.length != otherTools.length)
return true;
-
+
for(int i = 0; i < tools.length; i++){
Tool tool = (Tool)tools[i];
Tool otherTool = (Tool)otherTools[i];
if(tool.hasCustomSettings(otherTool))
return true;
}
-
+
return false;
}
-
+
+ @Override
public void setTools(ITool[] tools){
ToolListModificationInfo info = getToolListModificationInfo(tools);
info.apply();
@@ -1015,19 +1031,20 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
void applyToolsInternal(ITool[] resultingTools, ToolListModificationInfo info) {
List<ITool> list = getToolList();
Map<String, ITool> map = getToolMap();
-
+
list.clear();
map.clear();
-
+
list.addAll(Arrays.asList(resultingTools));
for(int i = 0; i < resultingTools.length; i++){
ITool tool = resultingTools[i];
map.put(tool.getId(), tool);
}
-
+
setRebuildState(true);
}
-
+
+ @Override
public boolean isSupported(){
IFolderInfo foInfo = getParentFolderInfo();
if(foInfo == null){
@@ -1036,7 +1053,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
foInfo = cfg.getRootFolderInfo();
}
}
-
+
if(foInfo != null)
return foInfo.isSupported();
return false;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceInfo.java
index 298c53c63a..05a6262181 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceInfo.java
@@ -67,7 +67,7 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo
isDirty = true;
}
}
-
+
public boolean isRoot(){
return path.segmentCount() == 0;
}
@@ -87,7 +87,7 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo
setId(id);
setName(name);
path = normalizePath(path);
-
+
this.path = path;
needsRebuild = true;
isDirty = true;
@@ -99,7 +99,7 @@ public abstract cl