Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonah Graham2018-11-20 16:20:42 +0000
committerJonah Graham2018-11-22 21:47:02 +0000
commit170e654b4796bad1453ae85a427b97317d67a69a (patch)
tree6ca9b8a8fedd5fd25f97eb79c408312e256ff981 /build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse
parent35996a5c5ca5c254959ba48241eaada6dbf8628d (diff)
downloadorg.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.tar.gz
org.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.tar.xz
org.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.zip
Bug 540373: Cleanup: Format & Remove trailing whitespace
This was done by selecting all projects in Eclipse then Source -> Clean Up... -> choosing: - Format source code - Remove trailing white spaces on all lines and completing the wizard Change-Id: I63685372c6bcc67719bcf145123bcb72e5b00394
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/CfgInfoContext.java158
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/ICfgScannerConfigBuilderInfo2Set.java15
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/ScannerConfigBuilder.java112
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/ScannerConfigNature.java135
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgDiscoveredPathManager.java312
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgScannerConfigUtil.java181
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/PerFileSettingsCalculator.java616
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/jobs/CfgSCJobsUtil.java330
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig2/CfgScannerConfigInfoFactory2.java201
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig2/CfgScannerConfigProfileManager.java20
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/BuildDescriptionManager.java194
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildCommand.java16
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildDescription.java24
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildDescriptionFactory.java24
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildIOType.java14
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildResource.java52
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildStep.java27
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IStepVisitor.java8
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IBuildProperties.java18
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IBuildProperty.java3
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IBuildPropertyManager.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IBuildPropertyType.java3
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IBuildPropertyValue.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IPropertyBase.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/AbstractBuildRunner.java6
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/BuildListComparator.java45
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ExternalBuildRunner.java98
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IAdditionalInput.java38
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildObject.java5
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildObjectProperties.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildPathResolver.java1
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildPropertiesRestriction.java9
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuilder.java202
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java131
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfigurationNameProvider.java7
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfigurationV2.java81
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConvertManagedBuildObject.java1
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IEnvVarBuildPath.java23
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IFileInfo.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IFolderInfo.java52
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IHoldsOptions.java104
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IInputOrder.java46
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IInputType.java237
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildDefinitionsStartup.java11
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java277
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedCommandLineGenerator.java5
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedCommandLineInfo.java16
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedConfigElement.java12
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedConfigElementProvider.java11
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedIsToolChainSupported.java4
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedOptionValueHandler.java30
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedOutputNameProvider.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedProject.java84
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IModificationStatus.java15
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IMultiConfiguration.java34
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOption.java42
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionApplicability.java33
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionCategory.java55
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionCategoryApplicability.java17
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionCommandGenerator.java12
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionDefaultValueGenerator.java6
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionPathConverter.java6
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOutputType.java160
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IProjectType.java126
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IResourceConfiguration.java22
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IResourceInfo.java80
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITarget.java144
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITargetPlatform.java78
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java446
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IToolChain.java35
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/InternalBuildRunner.java57
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java2248
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java165
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedCProjectNature.java32
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedOptionValueHandler.java137
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/OptionStringValue.java91
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ResourceChangeHandler2.java57
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IBuildEnvironmentVariable.java4
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IConfigurationEnvironmentVariableSupplier.java4
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentBuildPathsChangeListener.java11
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentVariableProvider.java5
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentVariableSupplier.java10
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IProjectEnvironmentVariableSupplier.java33
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildCommand.java10
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescription.java1359
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescriptionGnuMakefileGenerator.java58
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildGroup.java10
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildIOType.java70
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildModelMessages.java5
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildMultiStatus.java4
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildProcessManager.java52
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildResource.java82
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildStateManager.java68
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildStep.java40
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/CommandBuilder.java17
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ConfigurationBuildState.java113
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DbgUtil.java115
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DefaultBuildDescriptionFactory.java19
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DescriptionBuilder.java98
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/FileMacroExplicitSubstitutor.java24
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/GenDirInfo.java35
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/IBuildModelBuilder.java19
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/IConfigurationBuildState.java3
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/IProjectBuildState.java4
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/IRebuildState.java4
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/IResourceRebuildStateContainer.java4
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ParallelBuilder.java182
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ProcessLauncher.java55
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ProjectBuildState.java61
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/StepBuilder.java95
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildProperties.java78
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertiesMessages.java3
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildProperty.java40
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertyManager.java112
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertyType.java11
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertyValue.java3
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/PropertyBase.java30
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/AdditionalInput.java83
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BooleanExpressionApplicabilityCalculator.java144
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildDbgUtil.java24
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildObject.java34
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildObjectProperties.java80
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildSettingsUtil.java156
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java1613
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuilderFactory.java298
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/CommonBuilder.java697
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java1388
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ConfigurationNameProvider.java5
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ConfigurationV2.java201
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ConverterInfo.java35
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/DbgUtilBase.java18
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/DefaultManagedConfigElement.java4
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/EnvVarBuildPath.java30
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/FolderInfo.java804
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java565
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GnuConfigurationNameProvider.java3
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilder.java180
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilderExternalSettingsProvider.java6
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HoldsOptions.java251
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/IMatchKeyProvider.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/IRealBuildObjectAssociation.java8
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ISettingsChangeListener.java1
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputOrder.java26
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/InputType.java406
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java411
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedCommandLineGenerator.java65
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedCommandLineInfo.java7
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedConfigStorageElement.java12
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedMakeMessages.java4
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedMakeProject.java18
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedProject.java280
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MapStorageElement.java78
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MatchKey.java72
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ModificationStatus.java53
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiConfiguration.java288
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiFileInfo.java27
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiFolderInfo.java41
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiResourceInfo.java95
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/NotificationManager.java32
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java402
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionCategory.java86
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java137
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionalBuildProperties.java39
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OutputType.java108
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ProjectType.java247
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PropertyManager.java421
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceChangeHandler.java307
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceConfiguration.java341
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceInfo.java192
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceInfoContainer.java50
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/SettingsChangeEvent.java8
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/SourcePath.java16
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/SupportedProperties.java130
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java139
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/TargetPlatform.java49
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java1411
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java822
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChainModificationHelper.java233
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolInfo.java146
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolListModificationInfo.java148
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java306
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildBuildData.java30
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildConfigurationData.java70
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildEntryStorage.java143
-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/BuildFileData.java35
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildFolderData.java39
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildLanguageData.java284
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildSystemSpecificVariableSubstitutor.java34
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildTargetPlatformData.java3
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildVariablesContributor.java99
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ConfigurationDataProvider.java253
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/DataProviderMessages.java5
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ExternalExtensionMacroSupplier.java163
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/PathInfo.java71
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ProfileInfoProvider.java102
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ProjectConverter.java492
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ResourcePropertyHolder.java40
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/AdjustmentContext.java81
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/AndExpression.java19
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckBuildPropertyExpression.java102
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckHolderExpression.java28
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckOptionExpression.java370
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckStringExpression.java66
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CompositeExpression.java44
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/FalseExpression.java9
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/HasNatureExpression.java6
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/IBooleanExpression.java9
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/NotExpression.java14
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/OptionEnablementExpression.java443
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/OrExpression.java19
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/BuildEnvVar.java14
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/EnvironmentVariableManagerToolChain.java42
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/EnvironmentVariableProvider.java83
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/ExternalExtensionEnvironmentSupplier.java93
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/MbsEnvironmentSupplier.java52
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/StoredBuildPathEnvironmentContainer.java186
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/GCCBuiltinSpecsDetectorCygwin.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/GCCBuiltinSpecsDetectorMinGW.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/MBSLanguageSettingsProvider.java40
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildCdtVariablesSupplierBase.java17
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildMacroProvider.java238
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildMacroStatus.java27
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildfileMacroSubstitutor.java188
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/CoreMacrosSupplier.java8
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/DefaultMacroContextInfo.java227
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/ExplicitFileMacroCollector.java57
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/FileContextBuildMacroValues.java51
-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/IMacroContextInfo.java8
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/IMacroContextInfoProvider.java1
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/MbsMacroSupplier.java755
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/OptionContextData.java66
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultGCCScannerInfoCollector.java8
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultGnuWinScannerInfoCollector.java82
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/ManagedBuildCPathEntryContainer.java127
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/ManagedBuildPathEntryContainerInitializer.java17
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/ManagedGCCScannerInfoConsoleParser.java25
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConfigurationModification.java56
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConflictSet.java62
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/DbgTcmUtil.java43
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/FileInfoModification.java31
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/FolderInfoModification.java206
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/IObjectSet.java7
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/Messages.java3
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ObjectSet.java8
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ObjectSetList.java11
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ObjectTypeBasedStorage.java71
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PathComparator.java52
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PerTypeMapStorage.java22
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PerTypeSetStorage.java38
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/TcModificationUtil.java642
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolChainModificationManager.java116
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolListMap.java198
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolListModification.java348
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/ConflictDefinitionElement.java3
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/MatchObjectElement.java162
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/MatchObjectList.java6
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/ObjectSetListBasedDefinition.java10
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/RulesManager.java221
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuildCommandParser.java49
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java118
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractLanguageSettingsOutputScanner.java69
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuildCommandParser.java9
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuiltinSpecsDetector.java45
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/ToolchainBuiltinSpecsDetector.java9
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/BuildMacroException.java122
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IBuildMacro.java20
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IBuildMacroProvider.java150
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IBuildMacroStatus.java12
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IBuildMacroSupplier.java25
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IConfigurationBuildMacroSupplier.java34
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IFileContextBuildMacroValues.java10
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IFileContextData.java10
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IOptionContextData.java26
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IProjectBuildMacroSupplier.java33
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IReservedMacroNameSupplier.java5
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedBuilderMakefileGenerator.java79
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedBuilderMakefileGenerator2.java5
-rwxr-xr-xbuild/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyCalculator.java54
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyCommands.java134
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyGenerator.java5
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyGenerator2.java132
-rwxr-xr-xbuild/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyGeneratorType.java72
-rwxr-xr-xbuild/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyInfo.java9
-rwxr-xr-xbuild/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyPreBuild.java108
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator.java208
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator2.java12
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator2Commands.java78
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator3.java14
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator3Commands.java162
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculatorPreBuild.java17
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculatorPreBuildCommands.java142
-rwxr-xr-xbuild/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuDependencyGroupInfo.java11
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuLinkOutputNameProvider.java74
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java1809
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/IManagedBuildGnuToolInfo.java72
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/ManagedBuildGnuToolInfo.java446
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/internal/DefaultIndexerDependencyCalculator.java62
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/pdomdepgen/PDOMDependencyCalculator.java10
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/pdomdepgen/PDOMDependencyGenerator.java15
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/ConverterMessages.java22
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject12.java740
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject20.java325
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject21.java81
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject30.java54
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject31.java64
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProjectManager.java214
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/scannerconfig/IManagedScannerInfoCollector.java25
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/CompatibilityStatus.java42
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IApplicableModification.java3
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IConfigurationModification.java16
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IConflict.java9
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IFolderInfoModification.java8
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IModificationOperation.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IToolChainModificationManager.java10
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IToolListModification.java14
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IToolModification.java14
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/CreateProjectProgressMonitor.java10
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/ProjectCreatedActions.java56
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/AddLanguageSettingsProvider.java7
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/AppendToMBSStringListOptionValues.java34
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/AppendToMBSStringOptionValue.java19
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/CreateIncludeFolder.java7
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/ExcludeResources.java28
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/GenerateMakefileWithBuildDescription.java17
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/NewManagedProject.java27
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/SetMBSBooleanOptionValue.java21
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/SetMBSStringListOptionValues.java19
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/SetMBSStringOptionValue.java22
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/IMakeBuilderInfo.java6
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/IMakeCommonBuildInfo.java10
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/MakeScannerInfo.java1
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/MakeScannerProvider.java16
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/internal/core/MakeMessages.java13
335 files changed, 19623 insertions, 19995 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/CfgInfoContext.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/CfgInfoContext.java
index 541334d947e..a0bb1931280 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/CfgInfoContext.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/CfgInfoContext.java
@@ -29,7 +29,7 @@ import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.content.IContentType;
-public final class CfgInfoContext{
+public final class CfgInfoContext {
private static final String DELIMITER = ";"; //$NON-NLS-1$
private static final int NULL_OBJ_CODE = 29;
private Configuration fCfg;
@@ -38,71 +38,71 @@ public final class CfgInfoContext{
private IInputType fInType;
private InfoContext fContext;
- public CfgInfoContext(IResourceInfo rcInfo, ITool tool, IInputType inType){
+ public CfgInfoContext(IResourceInfo rcInfo, ITool tool, IInputType inType) {
this(rcInfo, tool, inType, null);
}
- private CfgInfoContext(IResourceInfo rcInfo, ITool tool, IInputType inType, InfoContext baseContext){
+ private CfgInfoContext(IResourceInfo rcInfo, ITool tool, IInputType inType, InfoContext baseContext) {
this.fRcInfo = rcInfo;
this.fTool = tool;
this.fInType = inType;
- this.fCfg = (Configuration)fRcInfo.getParent();
+ this.fCfg = (Configuration) fRcInfo.getParent();
this.fContext = baseContext;
}
- public CfgInfoContext(IConfiguration cfg){
+ public CfgInfoContext(IConfiguration cfg) {
this(cfg, null);
}
- private CfgInfoContext(IConfiguration cfg, InfoContext baseContext){
- this.fCfg = (Configuration)cfg;
+ private CfgInfoContext(IConfiguration cfg, InfoContext baseContext) {
+ this.fCfg = (Configuration) cfg;
this.fContext = baseContext;
}
-
- public IConfiguration getConfiguration(){
+
+ public IConfiguration getConfiguration() {
return fCfg;
}
-
- public IResourceInfo getResourceInfo(){
+
+ public IResourceInfo getResourceInfo() {
return fRcInfo;
}
-
- public ITool getTool(){
+
+ public ITool getTool() {
return fTool;
}
-
- public IInputType getInputType(){
+
+ public IInputType getInputType() {
return fInType;
}
-
- public InfoContext toInfoContext(){
- if(fContext == null){
+
+ public InfoContext toInfoContext() {
+ if (fContext == null) {
IProject project = fCfg.isPreference() ? null : fCfg.getOwner().getProject();
StringBuilder buf = new StringBuilder();
buf.append(fCfg.getId());
- if(fRcInfo != null){
+ if (fRcInfo != null) {
buf.append(DELIMITER);
buf.append(fRcInfo.getId());
}
-
- if(fTool != null){
+
+ if (fTool != null) {
buf.append(DELIMITER);
buf.append(fTool.getId());
}
-
- if(fInType != null){
+
+ if (fInType != null) {
buf.append(DELIMITER);
buf.append(fInType.getId());
}
-
+
ILanguage language = null;
- if (fInType!=null) {
+ if (fInType != null) {
IContentType contentType = fInType.getSourceContentType();
- if (contentType!=null) {
+ if (contentType != null) {
language = LanguageManager.getInstance().getLanguage(contentType);
}
}
-
+
String instanceId = buf.toString();
fContext = new InfoContext(project, instanceId, language);
}
@@ -111,34 +111,34 @@ public final class CfgInfoContext{
public static CfgInfoContext fromInfoContext(ICProjectDescription des, InfoContext context) {
IProject project = context.getProject();
- if(project == null)
+ if (project == null)
return null;
-
+
String instanceId = context.getInstanceId();
- if(instanceId.length() == 0)
+ if (instanceId.length() == 0)
return null;
-
+
String[] ids = CDataUtil.stringToArray(instanceId, DELIMITER);
String cfgId = ids[0];
ICConfigurationDescription cfgDes = des.getConfigurationById(cfgId);
- if(cfgDes == null)
+ if (cfgDes == null)
return null;
-
+
IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(cfgDes);
- if(cfg == null)
+ if (cfg == null)
return null;
-
+
return doCreate(cfg, ids, context);
}
-
- private static CfgInfoContext doCreate(IConfiguration cfg, String[] ids, InfoContext context){
+
+ private static CfgInfoContext doCreate(IConfiguration cfg, String[] ids, InfoContext context) {
String rcInfoId = null, toolId = null, inTypeId = null;
IResourceInfo rcInfo = null;
ITool tool = null;
IInputType inType = null;
-
- switch(ids.length){
+
+ switch (ids.length) {
case 4:
inTypeId = ids[3];
case 3:
@@ -146,27 +146,27 @@ public final class CfgInfoContext{
case 2:
rcInfoId = ids[1];
}
-
- if(rcInfoId != null){
- rcInfo = (IResourceInfo)find(cfg.getResourceInfos(), rcInfoId);
- if(rcInfo == null){
+
+ if (rcInfoId != null) {
+ rcInfo = (IResourceInfo) find(cfg.getResourceInfos(), rcInfoId);
+ if (rcInfo == null) {
return null;
}
}
-
- if(toolId != null){
- tool = (ITool)find(rcInfo.getTools(), toolId);
- if(tool == null)
+
+ if (toolId != null) {
+ tool = (ITool) find(rcInfo.getTools(), toolId);
+ if (tool == null)
return null;
}
-
- if(inTypeId != null){
- inType = (IInputType)find(tool.getInputTypes(), inTypeId);
- if(inType == null)
+
+ if (inTypeId != null) {
+ inType = (IInputType) find(tool.getInputTypes(), inTypeId);
+ if (inType == null)
return null;
}
-
- if(rcInfo != null)
+
+ if (rcInfo != null)
return new CfgInfoContext(rcInfo, tool, inType, context);
return new CfgInfoContext(cfg, context);
@@ -174,48 +174,48 @@ public final class CfgInfoContext{
public static CfgInfoContext fromInfoContext(IConfiguration cfg, InfoContext context) {
IProject project = context.getProject();
- if(project == null)
+ if (project == null)
return null;
-
+
String instanceId = context.getInstanceId();
- if(instanceId.length() == 0)
+ if (instanceId.length() == 0)
return null;
-
+
String[] ids = CDataUtil.stringToArray(instanceId, DELIMITER);
String cfgId = ids[0];
- if(!cfgId.equals(cfg.getId()))
+ if (!cfgId.equals(cfg.getId()))
return null;
return doCreate(cfg, ids, context);
}
-
- private static IBuildObject find(IBuildObject objs[], String id){
- for(int i = 0; i < objs.length; i++){
- if(objs[i].getId().equals(id))
+
+ private static IBuildObject find(IBuildObject objs[], String id) {
+ for (int i = 0; i < objs.length; i++) {
+ if (objs[i].getId().equals(id))
return objs[i];
}
return null;
}
-
+
@Override
public boolean equals(Object obj) {
- if(this == obj)
+ if (this == obj)
return true;
-
- if(!(obj instanceof CfgInfoContext))
+
+ if (!(obj instanceof CfgInfoContext))
return false;
-
- CfgInfoContext other = (CfgInfoContext)obj;
- if(!checkBuildObjects(other.fCfg, fCfg))
+
+ CfgInfoContext other = (CfgInfoContext) obj;
+ if (!checkBuildObjects(other.fCfg, fCfg))
return false;
- if(!checkBuildObjects(other.fRcInfo, fRcInfo))
+ if (!checkBuildObjects(other.fRcInfo, fRcInfo))
return false;
- if(!checkBuildObjects(other.fTool, fTool))
+ if (!checkBuildObjects(other.fTool, fTool))
return false;
- if(!checkBuildObjects(other.fInType, fInType))
+ if (!checkBuildObjects(other.fInType, fInType))
return false;
return true;
@@ -229,17 +229,17 @@ public final class CfgInfoContext{
code += getCode(fInType);
return code;
}
-
- private boolean checkBuildObjects(IBuildObject bo1, IBuildObject bo2){
- if(bo1 == null)
+
+ private boolean checkBuildObjects(IBuildObject bo1, IBuildObject bo2) {
+ if (bo1 == null)
return bo2 == null;
- if(bo2 == null)
+ if (bo2 == null)
return false;
return bo1.getId().equals(bo2.getId());
}
-
- private int getCode(IBuildObject bo){
- if(bo == null)
+
+ private int getCode(IBuildObject bo) {
+ if (bo == null)
return NULL_OBJ_CODE;
return bo.getId().hashCode();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/ICfgScannerConfigBuilderInfo2Set.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/ICfgScannerConfigBuilderInfo2Set.java
index e5f02bb984f..550bc5468b1 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/ICfgScannerConfigBuilderInfo2Set.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/ICfgScannerConfigBuilderInfo2Set.java
@@ -19,25 +19,24 @@ import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo2;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.core.runtime.CoreException;
-
/**
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ICfgScannerConfigBuilderInfo2Set {
boolean isPerRcTypeDiscovery();
-
+
void setPerRcTypeDiscovery(boolean on);
-
+
Map<CfgInfoContext, IScannerConfigBuilderInfo2> getInfoMap();
-
+
CfgInfoContext[] getContexts();
-
+
IScannerConfigBuilderInfo2 getInfo(CfgInfoContext context);
-
+
IScannerConfigBuilderInfo2 applyInfo(CfgInfoContext context, IScannerConfigBuilderInfo2 base) throws CoreException;
-
+
IConfiguration getConfiguration();
-
+
boolean isProfileSupported(CfgInfoContext context, String profileId);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/ScannerConfigBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/ScannerConfigBuilder.java
index 49b2e42b63c..a50489169a5 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/ScannerConfigBuilder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/ScannerConfigBuilder.java
@@ -80,7 +80,8 @@ public class ScannerConfigBuilder extends ACBuilder {
* @see IncrementalProjectBuilder#build
*/
@Override
- protected IProject [] build(int kind, @SuppressWarnings("rawtypes") Map args, IProgressMonitor monitor) throws CoreException {
+ protected IProject[] build(int kind, @SuppressWarnings("rawtypes") Map args, IProgressMonitor monitor)
+ throws CoreException {
if (DEBUG_EVENTS) {
@SuppressWarnings("unchecked")
Map<String, String> argsMap = args;
@@ -88,38 +89,38 @@ public class ScannerConfigBuilder extends ACBuilder {
}
// If auto discovery is disabled, do nothing
-// boolean autodiscoveryEnabled;
-// boolean autodiscoveryEnabled2;
-// IScannerConfigBuilderInfo2 buildInfo2 = null;
-// IConfiguration cfg = ScannerConfigUtil.getActiveConfiguration(getProject());
+ // boolean autodiscoveryEnabled;
+ // boolean autodiscoveryEnabled2;
+ // IScannerConfigBuilderInfo2 buildInfo2 = null;
+ // IConfiguration cfg = ScannerConfigUtil.getActiveConfiguration(getProject());
IManagedBuildInfo bInfo = ManagedBuildManager.getBuildInfo(getProject());
- if(bInfo != null){
+ if (bInfo != null) {
IConfiguration cfgs[] = bInfo.getManagedProject().getConfigurations();
- if(cfgs.length != 0){
- if(!needAllConfigBuild()){
+ if (cfgs.length != 0) {
+ if (!needAllConfigBuild()) {
ICProjectDescription des = CoreModel.getDefault().getProjectDescription(getProject(), false);
IConfiguration cfg = null;
- if(des != null){
+ if (des != null) {
ICConfigurationDescription settingCfgDes = des.getDefaultSettingConfiguration();
- if(settingCfgDes != null){
- for(int i = 0; i < cfgs.length; i++){
- if(settingCfgDes.getId().equals(cfgs[i].getId())){
+ if (settingCfgDes != null) {
+ for (int i = 0; i < cfgs.length; i++) {
+ if (settingCfgDes.getId().equals(cfgs[i].getId())) {
cfg = cfgs[i];
break;
}
}
}
}
- if(cfg != null){
- cfgs = new IConfiguration[]{cfg};
+ if (cfg != null) {
+ cfgs = new IConfiguration[] { cfg };
} else {
cfgs = new IConfiguration[0];
}
}
int numWork = cfgs.length;
- if(numWork > 0){
+ if (numWork > 0) {
monitor.beginTask(MakeMessages.getString("ScannerConfigBuilder.Invoking_Builder"), numWork); //$NON-NLS-1$
- for(int i = 0; i < cfgs.length; i++){
+ for (int i = 0; i < cfgs.length; i++) {
build(cfgs[i], 0, new SubProgressMonitor(monitor, 1));
}
}
@@ -128,12 +129,11 @@ public class ScannerConfigBuilder extends ACBuilder {
CfgDiscoveredPathManager.getInstance().updateCoreSettings(getProject(), cfgs);
}
-
return getProject().getReferencedProjects();
}
- public static void build(IConfiguration cfg, int flags, IProgressMonitor monitor){
- if(cfg != null){
+ public static void build(IConfiguration cfg, int flags, IProgressMonitor monitor) {
+ if (cfg != null) {
// IScannerConfigBuilderInfo buildInfo = MakeCorePlugin.createScannerConfigBuildInfo(getProject(), BUILDER_ID);
// autodiscoveryEnabled = buildInfo.isAutoDiscoveryEnabled();
//
@@ -143,41 +143,41 @@ public class ScannerConfigBuilder extends ACBuilder {
// getProject().getName());
// ScannerInfoCollector.getInstance().updateScannerConfiguration(getProject(), new SubProgressMonitor(monitor, 100));
// }
- ICfgScannerConfigBuilderInfo2Set info = CfgScannerConfigProfileManager.getCfgScannerConfigBuildInfo(cfg);
- IProject project = cfg.getOwner().getProject();
- Map<CfgInfoContext, IScannerConfigBuilderInfo2> infoMap = info.getInfoMap();
- int num = infoMap.size();
- if(num != 0){
- Properties envProps = calcEnvironment(cfg);
- monitor.beginTask(MakeMessages.getString("ScannerConfigBuilder.Invoking_Builder"), num); //$NON-NLS-1$
- for (Entry<CfgInfoContext, IScannerConfigBuilderInfo2> entry : infoMap.entrySet()) {
- try {
- CfgInfoContext c = entry.getKey();
- IScannerConfigBuilderInfo2 buildInfo2 = entry.getValue();
- build(c, buildInfo2, (flags & (~PERFORM_CORE_UPDATE)), envProps, new SubProgressMonitor(monitor, 1));
- } catch (CoreException e){
- // builder not installed or disabled
- // autodiscoveryEnabled = false;
- // autodiscoveryEnabled2 = false;
- ManagedBuilderCorePlugin.log(e);
- }
- }
- }
- if((flags & PERFORM_CORE_UPDATE) != 0)
- CfgDiscoveredPathManager.getInstance().updateCoreSettings(project, new IConfiguration[]{cfg});
+ ICfgScannerConfigBuilderInfo2Set info = CfgScannerConfigProfileManager.getCfgScannerConfigBuildInfo(cfg);
+ IProject project = cfg.getOwner().getProject();
+ Map<CfgInfoContext, IScannerConfigBuilderInfo2> infoMap = info.getInfoMap();
+ int num = infoMap.size();
+ if (num != 0) {
+ Properties envProps = calcEnvironment(cfg);
+ monitor.beginTask(MakeMessages.getString("ScannerConfigBuilder.Invoking_Builder"), num); //$NON-NLS-1$
+ for (Entry<CfgInfoContext, IScannerConfigBuilderInfo2> entry : infoMap.entrySet()) {
+ try {
+ CfgInfoContext c = entry.getKey();
+ IScannerConfigBuilderInfo2 buildInfo2 = entry.getValue();
+ build(c, buildInfo2, (flags & (~PERFORM_CORE_UPDATE)), envProps,
+ new SubProgressMonitor(monitor, 1));
+ } catch (CoreException e) {
+ // builder not installed or disabled
+ // autodiscoveryEnabled = false;
+ // autodiscoveryEnabled2 = false;
+ ManagedBuilderCorePlugin.log(e);
+ }
}
+ }
+ if ((flags & PERFORM_CORE_UPDATE) != 0)
+ CfgDiscoveredPathManager.getInstance().updateCoreSettings(project, new IConfiguration[] { cfg });
+ }
}
- private static Properties calcEnvironment(IConfiguration cfg){
+ private static Properties calcEnvironment(IConfiguration cfg) {
Properties envProps = new Properties();
ICConfigurationDescription cfgDes = ManagedBuildManager.getDescriptionForConfiguration(cfg);
IEnvironmentVariableManager mngr = CCorePlugin.getDefault().getBuildEnvironmentManager();
IEnvironmentVariable[] vars = mngr.getVariables(cfgDes, true);
- for(int i = 0; i < vars.length; i++) {
- if (vars[i] != null
- && vars[i].getName() != null) {
+ for (int i = 0; i < vars.length; i++) {
+ if (vars[i] != null && vars[i].getName() != null) {
String value = vars[i].getValue();
envProps.setProperty(vars[i].getName(), value == null ? "" : value); //$NON-NLS-1$
}
@@ -186,9 +186,11 @@ public class ScannerConfigBuilder extends ACBuilder {
return envProps;
}
- public static SCProfileInstance build(CfgInfoContext context, IScannerConfigBuilderInfo2 buildInfo2, int flags, Properties env, IProgressMonitor monitor) throws CoreException{
+ public static SCProfileInstance build(CfgInfoContext context, IScannerConfigBuilderInfo2 buildInfo2, int flags,
+ Properties env, IProgressMonitor monitor) throws CoreException {
IConfiguration cfg = context.getConfiguration();
- if (ScannerDiscoveryLegacySupport.isLegacyScannerDiscoveryOn(ManagedBuildManager.getDescriptionForConfiguration(cfg))) {
+ if (ScannerDiscoveryLegacySupport
+ .isLegacyScannerDiscoveryOn(ManagedBuildManager.getDescriptionForConfiguration(cfg))) {
IProject project = cfg.getOwner().getProject();
boolean autodiscoveryEnabled2 = buildInfo2.isAutoDiscoveryEnabled();
@@ -197,27 +199,29 @@ public class ScannerConfigBuilder extends ACBuilder {
monitor.subTask(MakeMessages.getString("ScannerConfigBuilder.Invoking_Builder") + //$NON-NLS-1$
project.getName());
- if(env == null)
+ if (env == null)
env = calcEnvironment(cfg);
// get scanner info from all external providers
- SCProfileInstance instance = ScannerConfigProfileManager.getInstance().
- getSCProfileInstance(project, context.toInfoContext(), buildInfo2.getSelectedProfileId());
+ SCProfileInstance instance = ScannerConfigProfileManager.getInstance().getSCProfileInstance(project,
+ context.toInfoContext(), buildInfo2.getSelectedProfileId());
// if there are any providers call job to pull scanner info
if ((flags & SKIP_SI_DISCOVERY) == 0) {
if ((instance == null) || !buildInfo2.getProviderIdList().isEmpty())
- instance = CfgSCJobsUtil.getProviderScannerInfo(project, context, instance, buildInfo2, env, new SubProgressMonitor(monitor, 70));
+ instance = CfgSCJobsUtil.getProviderScannerInfo(project, context, instance, buildInfo2, env,
+ new SubProgressMonitor(monitor, 70));
}
// update and persist scanner configuration
- CfgSCJobsUtil.updateScannerConfiguration(project, context, instance, buildInfo2, new SubProgressMonitor(monitor, 30));
+ CfgSCJobsUtil.updateScannerConfiguration(project, context, instance, buildInfo2,
+ new SubProgressMonitor(monitor, 30));
// Remove the previous discovered path info to ensure it get's regenerated.
// TODO we should really only do this if the information has changed
CfgDiscoveredPathManager.getInstance().removeDiscoveredInfo(project, context, false);
- if((flags & PERFORM_CORE_UPDATE) != 0)
- CfgDiscoveredPathManager.getInstance().updateCoreSettings(project, new IConfiguration[]{cfg});
+ if ((flags & PERFORM_CORE_UPDATE) != 0)
+ CfgDiscoveredPathManager.getInstance().updateCoreSettings(project, new IConfiguration[] { cfg });
return instance;
}
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 6a2bc9a3435..aed3b5fe8df 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
@@ -83,7 +83,7 @@ public class ScannerConfigNature implements IProjectNature {
* @see IProjectNature#getProject
*/
@Override
- public IProject getProject() {
+ public IProject getProject() {
return fProject;
}
@@ -91,7 +91,7 @@ public class ScannerConfigNature implements IProjectNature {
* @see IProjectNature#setProject
*/
@Override
- public void setProject(IProject project) {
+ public void setProject(IProject project) {
fProject = project;
}
@@ -151,8 +151,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 {
+ } else {
for (int i = 0; i < oldCommands.length; i++) {
if (oldCommands[i] == oldCommand) {
oldCommands[i] = newCommand;
@@ -170,69 +169,69 @@ public class ScannerConfigNature implements IProjectNature {
/**
* @param project
*/
-//FIXME public static void initializeDiscoveryOptions(IProject project) {
-// try {
-// IScannerConfigBuilderInfo2 scPrefInfo = ScannerConfigProfileManager.createScannerConfigBuildInfo2(
-// ManagedBuilderCorePlugin.getDefault().getPluginPreferences(), false);
-// 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)) {
-// scProjInfo.setProviderRunCommand(providerId, scPrefInfo.getProviderRunCommand(providerId));
-// scProjInfo.setProviderRunArguments(providerId, scPrefInfo.getProviderRunArguments(providerId));
-// }
-// else {
-// scProjInfo.setProviderOpenFilePath(providerId, scPrefInfo.getProviderOpenFilePath(providerId));
-// }
-// }
-// scProjInfo.save();
-//
-// // the last step is to add discovered paths container
-// ICProject cProject = CoreModel.getDefault().create(project);
-// IPathEntry[] rawPathEntries = CoreModel.getRawPathEntries(cProject);
-// boolean found = false;
-// for (int i = 0; i < rawPathEntries.length; i++) {
-// if (rawPathEntries[i].getEntryKind() == IPathEntry.CDT_CONTAINER) {
-// IContainerEntry container = (IContainerEntry) rawPathEntries[i];
-// if (container.getPath().equals(DiscoveredPathContainer.CONTAINER_ID)) {
-// found = true;
-// break;
-// }
-// }
-// }
-// if (!found) {
-// IPathEntry[] newRawPathEntries = new IPathEntry[rawPathEntries.length + 1];
-// System.arraycopy(rawPathEntries, 0, newRawPathEntries, 0, rawPathEntries.length);
-// newRawPathEntries[rawPathEntries.length] = CoreModel.newContainerEntry(DiscoveredPathContainer.CONTAINER_ID);
-// CoreModel.setRawPathEntries(cProject, newRawPathEntries, null);
-// }
-//// if (profile.getProfileScope().equals(ScannerConfigScope.PROJECT_SCOPE)) {
-//// CoreModel.setPathEntryContainer(new ICProject[]{cProject},
-//// new DiscoveredPathContainer(project), null);
-//// }
-//// else { // file scope
-//// CoreModel.setPathEntryContainer(new ICProject[]{cProject},
-//// new PerFileDiscoveredPathContainer(project), null);
-//// }
-// }
-// catch (CoreException e) {
-// ManagedBuilderCorePlugin.log(e);
-// }
-// }
+ //FIXME public static void initializeDiscoveryOptions(IProject project) {
+ // try {
+ // IScannerConfigBuilderInfo2 scPrefInfo = ScannerConfigProfileManager.createScannerConfigBuildInfo2(
+ // ManagedBuilderCorePlugin.getDefault().getPluginPreferences(), false);
+ // 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)) {
+ // scProjInfo.setProviderRunCommand(providerId, scPrefInfo.getProviderRunCommand(providerId));
+ // scProjInfo.setProviderRunArguments(providerId, scPrefInfo.getProviderRunArguments(providerId));
+ // }
+ // else {
+ // scProjInfo.setProviderOpenFilePath(providerId, scPrefInfo.getProviderOpenFilePath(providerId));
+ // }
+ // }
+ // scProjInfo.save();
+ //
+ // // the last step is to add discovered paths container
+ // ICProject cProject = CoreModel.getDefault().create(project);
+ // IPathEntry[] rawPathEntries = CoreModel.getRawPathEntries(cProject);
+ // boolean found = false;
+ // for (int i = 0; i < rawPathEntries.length; i++) {
+ // if (rawPathEntries[i].getEntryKind() == IPathEntry.CDT_CONTAINER) {
+ // IContainerEntry container = (IContainerEntry) rawPathEntries[i];
+ // if (container.getPath().equals(DiscoveredPathContainer.CONTAINER_ID)) {
+ // found = true;
+ // break;
+ // }
+ // }
+ // }
+ // if (!found) {
+ // IPathEntry[] newRawPathEntries = new IPathEntry[rawPathEntries.length + 1];
+ // System.arraycopy(rawPathEntries, 0, newRawPathEntries, 0, rawPathEntries.length);
+ // newRawPathEntries[rawPathEntries.length] = CoreModel.newContainerEntry(DiscoveredPathContainer.CONTAINER_ID);
+ // CoreModel.setRawPathEntries(cProject, newRawPathEntries, null);
+ // }
+ //// if (profile.getProfileScope().equals(ScannerConfigScope.PROJECT_SCOPE)) {
+ //// CoreModel.setPathEntryContainer(new ICProject[]{cProject},
+ //// new DiscoveredPathContainer(project), null);
+ //// }
+ //// else { // file scope
+ //// CoreModel.setPathEntryContainer(new ICProject[]{cProject},
+ //// new PerFileDiscoveredPathContainer(project), null);
+ //// }
+ // }
+ // catch (CoreException e) {
+ // ManagedBuilderCorePlugin.log(e);
+ // }
+ // }
}
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 034ea603010..748dcdfe0ff 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
@@ -66,7 +66,6 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.jobs.ILock;
import org.eclipse.core.runtime.jobs.Job;
-
public class CfgDiscoveredPathManager implements IResourceChangeListener {
public static CfgDiscoveredPathManager fInstance;
@@ -80,6 +79,7 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
public ContextInfo() {
}
+
CfgInfoContext fInitialContext;
CfgInfoContext fCacheContext;
CfgInfoContext fLoadContext;
@@ -88,34 +88,34 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
boolean fIsPerFileCache;
}
- public static class PathInfoCache{
+ public static class PathInfoCache {
private PathInfo fPathInfo;
private String fProfileId;
- public PathInfo getPathInfo(){
+ public PathInfo getPathInfo() {
return fPathInfo;
}
- private PathInfoCache(String profileId, PathInfo pathInfo){
+ private PathInfoCache(String profileId, PathInfo pathInfo) {
this.fProfileId = profileId;
this.fPathInfo = pathInfo;
}
}
private CfgDiscoveredPathManager() {
- fBaseMngr = MakeCorePlugin.getDefault().getDiscoveryManager();
+ fBaseMngr = MakeCorePlugin.getDefault().getDiscoveryManager();
}
- public static CfgDiscoveredPathManager getInstance(){
- if(fInstance == null){
+ public static CfgDiscoveredPathManager getInstance() {
+ if (fInstance == null) {
fInstance = new CfgDiscoveredPathManager();
fInstance.startup();
}
return fInstance;
}
- public static void stop(){
- if(fInstance != null)
+ public static void stop() {
+ if (fInstance != null)
fInstance.shutdown();
}
@@ -136,48 +136,46 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
IResource resource = event.getResource();
switch (event.getType()) {
- case IResourceChangeEvent.POST_CHANGE :
-// DiscoveredScannerInfoStore.getInstance().updateScannerConfigStore(event.getDelta());
- break;
- case IResourceChangeEvent.PRE_DELETE :
- case IResourceChangeEvent.PRE_CLOSE :
- if (resource.getType() == IResource.PROJECT) {
-// fDiscoveredMap.remove(resource);
- }
- break;
+ case IResourceChangeEvent.POST_CHANGE:
+ // DiscoveredScannerInfoStore.getInstance().updateScannerConfigStore(event.getDelta());
+ break;
+ case IResourceChangeEvent.PRE_DELETE:
+ case IResourceChangeEvent.PRE_CLOSE:
+ if (resource.getType() == IResource.PROJECT) {
+ // fDiscoveredMap.remove(resource);
+ }
+ break;
}
}
}
public void updateCoreSettings(final IProject project, final IConfiguration cfgs[]) {
- try {
- IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
- @Override
+ try {
+ IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
- ManagedBuildManager.updateCoreSettings(project, cfgs, true);
- }
- };
- CoreModel.run(runnable, null);
- }
- catch (CoreException e) {
- ManagedBuilderCorePlugin.log(e);
- }
+ ManagedBuildManager.updateCoreSettings(project, cfgs, true);
+ }
+ };
+ CoreModel.run(runnable, null);
+ } catch (CoreException e) {
+ ManagedBuilderCorePlugin.log(e);
+ }
}
-
- public PathInfo getDiscoveredInfo(IProject project,
- CfgInfoContext context) throws CoreException {
+ public PathInfo getDiscoveredInfo(IProject project, CfgInfoContext context) throws CoreException {
ContextInfo cInfo = getContextInfo(context);
- PathInfo info = getCachedPathInfo(cInfo);
+ PathInfo info = getCachedPathInfo(cInfo);
if (info == null) {
try {
lock.acquire();
info = getCachedPathInfo(cInfo);
- if(info == null){
- IDiscoveredPathManager.IDiscoveredPathInfo baseInfo = loadPathInfo(project, context.getConfiguration(), cInfo);
+ if (info == null) {
+ IDiscoveredPathManager.IDiscoveredPathInfo baseInfo = loadPathInfo(project,
+ context.getConfiguration(), cInfo);
info = resolveCacheBaseDiscoveredInfo(cInfo, baseInfo);
}
} finally {
@@ -187,21 +185,22 @@ 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){
- resolveCachePerFileInfo(cInfo, (IDiscoveredPathManager.IPerFileDiscoveredPathInfo2)baseInfo);
+ // 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) {
+ resolveCachePerFileInfo(cInfo, (IDiscoveredPathManager.IPerFileDiscoveredPathInfo2) baseInfo);
}
return getCachedPathInfo(cInfo);
}
- ((FolderInfo)cInfo.fLoadContext.getConfiguration().getRootFolderInfo()).setContainsDiscoveredScannerInfo(true);
+ ((FolderInfo) cInfo.fLoadContext.getConfiguration().getRootFolderInfo()).setContainsDiscoveredScannerInfo(true);
Map<String, String> map = baseInfo.getSymbols();
IPath paths[] = baseInfo.getIncludePaths();
@@ -210,18 +209,19 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
return info;
}
- private void resolveCachePerFileInfo(ContextInfo cInfo, IDiscoveredPathManager.IPerFileDiscoveredPathInfo2 info){
+ private void resolveCachePerFileInfo(ContextInfo cInfo, IDiscoveredPathManager.IPerFileDiscoveredPathInfo2 info) {
CConfigurationData data = cInfo.fLoadContext.getConfiguration().getConfigurationData();
- if(data == null)
+ if (data == null)
return;
PerFileSettingsCalculator calculator = new PerFileSettingsCalculator();
- IRcSettingInfo[] rcInfos = calculator.getSettingInfos(cInfo.fLoadContext.getConfiguration().getOwner().getProject(), data, info, true);
+ 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;
- for(int i = 0; i < rcDatas.length; i++){
+ for (int i = 0; i < rcDatas.length; i++) {
rcData = rcDatas[i];
rcDataMap.put(rcData.getPath(), rcData);
}
@@ -230,11 +230,11 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
IPath path;
boolean rootSettingFound = false;
boolean fileSettingFound = false;
- for(int i = 0; i < rcInfos.length; i++){
+ for (int i = 0; i < rcInfos.length; i++) {
rcInfo = rcInfos[i];
rcData = rcInfo.getResourceData();
path = rcData.getPath();
- if(path.segmentCount() != 0)
+ if (path.segmentCount() != 0)
fileSettingFound = true;
else
rootSettingFound = true;
@@ -243,15 +243,15 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
cache(cInfo, rcInfo);
}
- if(rootSettingFound && fileSettingFound)
- ((BuildFolderData)data.getRootFolderData()).setContainsDiscoveredScannerInfo(false);
+ if (rootSettingFound && fileSettingFound)
+ ((BuildFolderData) data.getRootFolderData()).setContainsDiscoveredScannerInfo(false);
- if(!rcDataMap.isEmpty()){
+ if (!rcDataMap.isEmpty()) {
CResourceData tmpRcData;
- for(Iterator<CResourceData> iter = rcDataMap.values().iterator(); iter.hasNext();){
+ for (Iterator<CResourceData> iter = rcDataMap.values().iterator(); iter.hasNext();) {
tmpRcData = iter.next();
- if(tmpRcData.getPath().segmentCount() == 0 && tmpRcData.getType() == ICSettingBase.SETTING_FOLDER){
- cache(cInfo, PerFileSettingsCalculator.createEmptyRcSettingInfo((CFolderData)tmpRcData));
+ if (tmpRcData.getPath().segmentCount() == 0 && tmpRcData.getType() == ICSettingBase.SETTING_FOLDER) {
+ cache(cInfo, PerFileSettingsCalculator.createEmptyRcSettingInfo((CFolderData) tmpRcData));
} else {
clearCache(tmpRcData);
}
@@ -259,77 +259,81 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
}
}
- private void cache(ContextInfo cInfo, IRcSettingInfo rcSetting){
+ private void cache(ContextInfo cInfo, IRcSettingInfo rcSetting) {
CResourceData rcData = rcSetting.getResourceData();
clearCache(rcData);
ILangSettingInfo lInfos[] = rcSetting.getLangInfos();
- for(int i = 0; i < lInfos.length; i++){
+ for (int i = 0; i < lInfos.length; i++) {
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 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();
+ private void clearCache(CResourceData rcData) {
+ if (rcData.getType() == ICSettingBase.SETTING_FILE) {
+ IFileInfo fiInfo = ((BuildFileData) rcData).getFileInfo();
ITool tools[] = fiInfo.getTools();
clearCache(tools);
} else {
- IFolderInfo foInfo = ((BuildFolderData)rcData).getFolderInfo();
+ IFolderInfo foInfo = ((BuildFolderData) rcData).getFolderInfo();
ITool[] tools = foInfo.getTools();
clearCache(tools);
}
}
- private void clearCache(ITool[] tools){
- for(int i = 0; i < tools.length; i++){
- ((Tool)tools[i]).clearAllDiscoveredInfo();
+ 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())){
-// setCachedPathInfo(context, info);
+ 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())) {
+ // setCachedPathInfo(context, info);
ICfgScannerConfigBuilderInfo2Set container = cInfo.fCfgInfo;
IScannerConfigBuilderInfo2 buildInfo = container.getInfo(cInfo.fLoadContext);
- 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)){
- info = ((IScannerInfoCollector2)newC).createPathInfoObject();
-// setCachedPathInfo(context, info);
- }
- }
+ 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)) {
+ info = ((IScannerInfoCollector2) newC).createPathInfoObject();
+ // setCachedPathInfo(context, info);
+ }
+ }
}
}
return info;
}
- private PathInfo getCachedPathInfo(ContextInfo cInfo){
- PathInfo info = getCachedPathInfo(cInfo, true, true, false);
- return info;
+ private PathInfo getCachedPathInfo(ContextInfo cInfo) {
+ PathInfo info = getCachedPathInfo(cInfo, true, true, false);
+ return info;
}
- private void removeCachedPathInfo(ContextInfo cInfo){
-// ICfgScannerConfigBuilderInfo2Set cfgInfo = cInfo.fCfgInfo;
- if(cInfo.fIsPerFileCache){
- Configuration cfg = (Configuration)cInfo.fInitialContext.getConfiguration();
+ private void removeCachedPathInfo(ContextInfo cInfo) {
+ // ICfgScannerConfigBuilderInfo2Set cfgInfo = cInfo.fCfgInfo;
+ if (cInfo.fIsPerFileCache) {
+ Configuration cfg = (Configuration) cInfo.fInitialContext.getConfiguration();
cfg.clearDiscoveredPathInfo();
IResourceInfo[] infos = cfg.getResourceInfos();
- for(int i = 0; i < infos.length; i++){
+ for (int i = 0; i < infos.length; i++) {
IResourceInfo rcInfo = infos[i];
ITool[] tools = rcInfo.getTools();
- for(int k = 0; k < tools.length; k++){
- Tool tool = (Tool)tools[k];
+ for (int k = 0; k < tools.length; k++) {
+ Tool tool = (Tool) tools[k];
tool.clearAllDiscoveredPathInfo();
}
}
@@ -337,47 +341,52 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
setCachedPathInfo(cInfo, null);
}
-// PathInfo info = getCachedPathInfo(cInfo, true, true, true);
+ // PathInfo info = getCachedPathInfo(cInfo, true, true, true);
}
- private PathInfo getCachedPathInfo(ContextInfo cInfo, boolean queryParent, boolean clearIfInvalid, boolean clear){
- return getCachedPathInfo(cInfo, (Configuration)cInfo.fCacheContext.getConfiguration(), (Tool)cInfo.fCacheContext.getTool(), cInfo.fCacheContext.getInputType(), queryParent, clearIfInvalid, clear);
+ private PathInfo getCachedPathInfo(ContextInfo cInfo, boolean queryParent, boolean clearIfInvalid, boolean clear) {
+ return getCachedPathInfo(cInfo, (Configuration) cInfo.fCacheContext.getConfiguration(),
+ (Tool) cInfo.fCacheContext.getTool(), cInfo.fCacheContext.getInputType(), queryParent, clearIfInvalid,
+ clear);
}
- private PathInfo getCachedPathInfo(ContextInfo cInfo, Configuration cfg, Tool tool, IInputType inType, boolean queryParent, boolean clearIfInvalid, boolean clear){
+ private PathInfo getCachedPathInfo(ContextInfo cInfo, Configuration cfg, Tool tool, IInputType inType,
+ boolean queryParent, boolean clearIfInvalid, boolean clear) {
PathInfoCache infoCache = getPathInfoCache(cInfo, cfg, tool, inType, queryParent, clearIfInvalid, clear);
- if(infoCache != null && isCacheValid(cInfo, infoCache))
+ if (infoCache != null && isCacheValid(cInfo, infoCache))
return infoCache.fPathInfo;
return null;
}
- private PathInfoCache getPathInfoCache(ContextInfo cInfo, Configuration cfg, Tool tool, IInputType inType, boolean queryParent, boolean clearIfInvalid, boolean clear){
+ private PathInfoCache getPathInfoCache(ContextInfo cInfo, Configuration cfg, Tool tool, IInputType inType,
+ boolean queryParent, boolean clearIfInvalid, boolean clear) {
PathInfoCache info = null;
-// boolean queryCfg = false;
- if(tool != null){
+ // boolean queryCfg = false;
+ if (tool != null) {
info = tool.getDiscoveredPathInfo(inType);
- if(info != null){
- if(clear || (clearIfInvalid && !isCacheValid(cInfo, info))){
+ if (info != null) {
+ if (clear || (clearIfInvalid && !isCacheValid(cInfo, info))) {
tool.clearDiscoveredPathInfo(inType);
-// fBaseMngr.removeDiscoveredInfo(cfg.getOwner().getProject(), cInfo.fLoadContext.toInfoContext());
+ // fBaseMngr.removeDiscoveredInfo(cfg.getOwner().getProject(), cInfo.fLoadContext.toInfoContext());
}
- } else if(queryParent){
-// IResourceInfo rcInfo = tool.getParentResourceInfo();
+ } else if (queryParent) {
+ // IResourceInfo rcInfo = tool.getParentResourceInfo();
ITool superTool = tool.getSuperClass();
- if(superTool!=null && !superTool.isExtensionElement()){
- if(inType != null){
+ if (superTool != null && !superTool.isExtensionElement()) {
+ if (inType != null) {
IInputType superInType = null;
String exts[] = inType.getSourceExtensions(tool);
- for(int i = 0; i < exts.length; i++){
+ for (int i = 0; i < exts.length; i++) {
superInType = superTool.getInputType(exts[i]);
- if(superInType != null)
+ if (superInType != null)
break;
}
- if(superInType != null){
- info = getPathInfoCache(cInfo, cfg, (Tool)superTool, superInType, true, clearIfInvalid, clear);
+ if (superInType != null) {
+ info = getPathInfoCache(cInfo, cfg, (Tool) superTool, superInType, true, clearIfInvalid,
+ clear);
}
} else {
- info = getPathInfoCache(cInfo, cfg, (Tool)superTool, null, true, clearIfInvalid, clear);
+ info = getPathInfoCache(cInfo, cfg, (Tool) superTool, null, true, clearIfInvalid, clear);
}
} else {
info = getPathInfoCache(cInfo, cfg, null, null, true, clearIfInvalid, clear);
@@ -385,39 +394,39 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
}
} else {
info = cfg.getDiscoveredPathInfo();
- if(clear || (clearIfInvalid && !isCacheValid(cInfo, info))){
+ if (clear || (clearIfInvalid && !isCacheValid(cInfo, info))) {
cfg.clearDiscoveredPathInfo();
-// fBaseMngr.removeDiscoveredInfo(cfg.getOwner().getProject(), cInfo.fLoadContext.toInfoContext());
+ // fBaseMngr.removeDiscoveredInfo(cfg.getOwner().getProject(), cInfo.fLoadContext.toInfoContext());
}
}
return info;
}
- private boolean isCacheValid(ContextInfo cInfo, PathInfoCache cache){
- if(cache == null)
+ private boolean isCacheValid(ContextInfo cInfo, PathInfoCache cache) {
+ if (cache == null)
return true;
- if(cInfo.fInfo != null){
+ if (cInfo.fInfo != null) {
String id = cInfo.fInfo.getSelectedProfileId();
return id.equals(cache.fProfileId);
}
return false;
}
- private ContextInfo getContextInfo(CfgInfoContext context){
+ private ContextInfo getContextInfo(CfgInfoContext context) {
return getContextInfo(context, null);
}
- private ContextInfo getContextInfo(CfgInfoContext context, ICfgScannerConfigBuilderInfo2Set cfgInfo){
- if(cfgInfo == null)
+ private ContextInfo getContextInfo(CfgInfoContext context, ICfgScannerConfigBuilderInfo2Set cfgInfo) {
+ if (cfgInfo == null)
cfgInfo = CfgScannerConfigProfileManager.getCfgScannerConfigBuildInfo(context.getConfiguration());
boolean isPerRcType = cfgInfo.isPerRcTypeDiscovery();
ContextInfo contextInfo = new ContextInfo();
contextInfo.fInitialContext = context;
contextInfo.fCfgInfo = cfgInfo;
- if(isPerRcType){
+ if (isPerRcType) {
contextInfo.fLoadContext = CfgScannerConfigUtil.adjustPerRcTypeContext(contextInfo.fInitialContext);
contextInfo.fCacheContext = contextInfo.fLoadContext;
contextInfo.fIsPerFileCache = false;
@@ -425,41 +434,44 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
} else {
contextInfo.fLoadContext = new CfgInfoContext(context.getConfiguration());
contextInfo.fInfo = cfgInfo.getInfo(contextInfo.fLoadContext);
- contextInfo.fIsPerFileCache = CfgScannerConfigProfileManager.isPerFileProfile(contextInfo.fInfo.getSelectedProfileId());
- contextInfo.fCacheContext = contextInfo.fIsPerFileCache ? contextInfo.fInitialContext : contextInfo.fLoadContext;
+ contextInfo.fIsPerFileCache = CfgScannerConfigProfileManager
+ .isPerFileProfile(contextInfo.fInfo.getSelectedProfileId());
+ contextInfo.fCacheContext = contextInfo.fIsPerFileCache ? contextInfo.fInitialContext
+ : contextInfo.fLoadContext;
}
- return contextInfo;
+ return contextInfo;
}
- private PathInfo setCachedPathInfo(ContextInfo cInfo, PathInfo info){
+ private PathInfo setCachedPathInfo(ContextInfo cInfo, PathInfo info) {
CfgInfoContext cacheContext = cInfo.fCacheContext;
- return setCachedPathInfo(cInfo, (Configuration)cacheContext.getConfiguration(), (Tool)cacheContext.getTool(), cacheContext.getInputType(), info);
+ 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){
+ private PathInfo setCachedPathInfo(ContextInfo cInfo, Configuration cfg, Tool tool, IInputType inType,
+ PathInfo info) {
PathInfoCache oldInfo;
PathInfoCache cache;
- if(info != null){
+ 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);
- else
- oldInfo = tool.clearDiscoveredPathInfo(inType);
- } else {
- if(info != null)
- oldInfo = cfg.setDiscoveredPathInfo(cache);
- else
- oldInfo = cfg.clearDiscoveredPathInfo();
- }
- return oldInfo != null ? oldInfo.fPathInfo : null;
+ if (tool != null) {
+ if (info != null)
+ oldInfo = tool.setDiscoveredPathInfo(inType, cache);
+ else
+ oldInfo = tool.clearDiscoveredPathInfo(inType);
+ } else {
+ if (info != null)
+ oldInfo = cfg.setDiscoveredPathInfo(cache);
+ else
+ oldInfo = cfg.clearDiscoveredPathInfo();
+ }
+ return oldInfo != null ? oldInfo.fPathInfo : null;
}
public void removeDiscoveredInfo(IProject project, CfgInfoContext context) {
@@ -467,14 +479,14 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
}
public void removeDiscoveredInfo(IProject project, CfgInfoContext context, boolean removeBaseCache) {
-// if(context == null)
-// context = ScannerConfigUtil.createContextForProject(project);
+ // if(context == null)
+ // context = ScannerConfigUtil.createContextForProject(project);
ContextInfo cInfo = getContextInfo(context);
- removeCachedPathInfo(cInfo);
+ removeCachedPathInfo(cInfo);
- if(removeBaseCache)
- fBaseMngr.removeDiscoveredInfo(project, cInfo.fLoadContext.toInfoContext());
+ if (removeBaseCache)
+ fBaseMngr.removeDiscoveredInfo(project, cInfo.fLoadContext.toInfoContext());
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgScannerConfigUtil.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgScannerConfigUtil.java
index b4035c5523e..609d72722b3 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgScannerConfigUtil.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgScannerConfigUtil.java
@@ -33,116 +33,115 @@ import org.eclipse.core.runtime.Assert;
import com.ibm.icu.text.MessageFormat;
public class CfgScannerConfigUtil {
- public static CfgInfoContext adjustPerRcTypeContext(CfgInfoContext context){
- if(((Configuration)context.getConfiguration()).isPreference())
+ public static CfgInfoContext adjustPerRcTypeContext(CfgInfoContext context) {
+ if (((Configuration) context.getConfiguration()).isPreference())
return context;
- Tool tool = (Tool)context.getTool();
- IResourceInfo rcInfo = context.getResourceInfo();
- IInputType inType = context.getInputType();
- boolean adjust = false;
- CfgInfoContext newContext = context;
-
- if(tool != null){
- if(inType != null){
- if(!tool.hasScannerConfigSettings(inType)){
-// tool = null;
- inType = null;
- adjust = true;
- }
- }
- if(inType == null){
- if(!tool.hasScannerConfigSettings(null)){
- tool = null;
- adjust = true;
- }
- }
- }
- if(tool == null){
- if(inType != null){
- inType = null;
- adjust = true;
- }
-
- if(rcInfo != null){
- ToolChain tc = getToolChain(rcInfo);
-
- if(tc != null){
- if(!tc.hasScannerConfigSettings()){
- adjust = true;
- rcInfo = null;
- }
- }
- }
- }
-// } else {
-// if(tool != null){
-// tool = null;
-// adjust = true;
-// }
-// if(rcInfo != null){
-// rcInfo = null;
-// adjust = true;
-// }
-// if(inType != null){
-// inType = null;
-// adjust = true;
-// }
-// }
-
- if(adjust){
- if(rcInfo == null)
- newContext = new CfgInfoContext(context.getConfiguration());
- else
- newContext = new CfgInfoContext(rcInfo, tool, inType);
- }
-
- return newContext;
+ Tool tool = (Tool) context.getTool();
+ IResourceInfo rcInfo = context.getResourceInfo();
+ IInputType inType = context.getInputType();
+ boolean adjust = false;
+ CfgInfoContext newContext = context;
+
+ if (tool != null) {
+ if (inType != null) {
+ if (!tool.hasScannerConfigSettings(inType)) {
+ // tool = null;
+ inType = null;
+ adjust = true;
+ }
+ }
+ if (inType == null) {
+ if (!tool.hasScannerConfigSettings(null)) {
+ tool = null;
+ adjust = true;
+ }
+ }
+ }
+ if (tool == null) {
+ if (inType != null) {
+ inType = null;
+ adjust = true;
+ }
+
+ if (rcInfo != null) {
+ ToolChain tc = getToolChain(rcInfo);
+
+ if (tc != null) {
+ if (!tc.hasScannerConfigSettings()) {
+ adjust = true;
+ rcInfo = null;
+ }
+ }
+ }
+ }
+ // } else {
+ // if(tool != null){
+ // tool = null;
+ // adjust = true;
+ // }
+ // if(rcInfo != null){
+ // rcInfo = null;
+ // adjust = true;
+ // }
+ // if(inType != null){
+ // inType = null;
+ // adjust = true;
+ // }
+ // }
+
+ if (adjust) {
+ if (rcInfo == null)
+ newContext = new CfgInfoContext(context.getConfiguration());
+ else
+ newContext = new CfgInfoContext(rcInfo, tool, inType);
+ }
+
+ return newContext;
}
- private static ToolChain getToolChain(IResourceInfo rcInfo){
- return rcInfo instanceof FolderInfo ?
- (ToolChain)((FolderInfo)rcInfo).getToolChain()
- : (ToolChain)((ResourceConfiguration)rcInfo).getBaseToolChain();
+ private static ToolChain getToolChain(IResourceInfo rcInfo) {
+ return rcInfo instanceof FolderInfo ? (ToolChain) ((FolderInfo) rcInfo).getToolChain()
+ : (ToolChain) ((ResourceConfiguration) rcInfo).getBaseToolChain();
}
- public static String getDefaultProfileId(CfgInfoContext context, boolean searchFirstIfNone){
+ public static String getDefaultProfileId(CfgInfoContext context, boolean searchFirstIfNone) {
String id = null;
- if(context.getInputType() != null)
+ if (context.getInputType() != null)
id = context.getInputType().getDiscoveryProfileId(context.getTool());
- if(id == null && context.getTool() != null)
- id = ((Tool)context.getTool()).getDiscoveryProfileId();
- if(id == null && context.getResourceInfo() != null){
+ if (id == null && context.getTool() != null)
+ id = ((Tool) context.getTool()).getDiscoveryProfileId();
+ if (id == null && context.getResourceInfo() != null) {
ToolChain tCh = getToolChain(context.getResourceInfo());
- if(tCh != null)
+ if (tCh != null)
id = tCh.getScannerConfigDiscoveryProfileId();
}
- if(id == null){
- id = ((Configuration)context.getConfiguration()).getDiscoveryProfileId();
+ if (id == null) {
+ id = ((Configuration) context.getConfiguration()).getDiscoveryProfileId();
}
- if(id == null && searchFirstIfNone){
+ if (id == null && searchFirstIfNone) {
id = getFirstProfileId(context.getConfiguration().getFilteredTools());
}
return id;
}
- public static String getFirstProfileId(ITool[] tools){
+ public static String getFirstProfileId(ITool[] tools) {
String id = null;
- for(int i = 0; i < tools.length; i++){
+ for (int i = 0; i < tools.length; i++) {
ITool tool = tools[i];
IInputType[] types = tool.getInputTypes();
- if(types.length != 0){
- for(int k = 0; k < types.length; k++){
+ if (types.length != 0) {
+ for (int k = 0; k < types.length; k++) {
id = types[k].getDiscoveryProfileId(tool);
- if(id != null)
+ if (id != null)
break;
}
} else {
- id = ((Tool)tool).getDiscoveryProfileId();
+ id = ((Tool) tool).getDiscoveryProfileId();
}
- if(id != null)
+ if (id != null)
break;
}
@@ -161,7 +160,7 @@ public class CfgScannerConfigUtil {
Set<String> profiles = new TreeSet<String>();
- if (toolchain!=null) {
+ if (toolchain != null) {
String toolchainProfileId = null;
if (toolchain instanceof ToolChain) {
// still allow a user a choice to select any legacy profiles
@@ -169,7 +168,7 @@ public class CfgScannerConfigUtil {
} else {
toolchainProfileId = toolchain.getScannerConfigDiscoveryProfileId();
}
- if (toolchainProfileId!=null && toolchainProfileId.length()>0) {
+ if (toolchainProfileId != null && toolchainProfileId.length() > 0) {
profiles.add(toolchainProfileId);
}
ITool[] tools = toolchain.getTools();
@@ -177,7 +176,7 @@ public class CfgScannerConfigUtil {
profiles.addAll(getAllScannerDiscoveryProfileIds(tool));
}
IToolChain superClass = toolchain.getSuperClass();
- if (superClass!=null) {
+ if (superClass != null) {
profiles.addAll(getAllScannerDiscoveryProfileIds(superClass));
}
}
@@ -196,7 +195,7 @@ public class CfgScannerConfigUtil {
public static Set<String> getAllScannerDiscoveryProfileIds(ITool tool) {
Assert.isNotNull(tool);
- if ( ! (tool instanceof Tool) ) {
+ if (!(tool instanceof Tool)) {
String msg = MessageFormat.format(ManagedMakeMessages.getString("CfgScannerConfigUtil_ErrorNotSupported"), //$NON-NLS-1$
new Object[] { Tool.class.getName() });
throw new UnsupportedOperationException(msg);
@@ -211,7 +210,7 @@ public class CfgScannerConfigUtil {
}
ITool superClass = tool.getSuperClass();
- if (superClass!=null) {
+ if (superClass != null) {
profiles.addAll(getAllScannerDiscoveryProfileIds(superClass));
}
return profiles;
@@ -228,7 +227,7 @@ public class CfgScannerConfigUtil {
private static Set<String> getAllScannerDiscoveryProfileIds(IInputType inputType) {
Assert.isNotNull(inputType);
- if ( ! (inputType instanceof InputType) ) {
+ if (!(inputType instanceof InputType)) {
String msg = MessageFormat.format(ManagedMakeMessages.getString("CfgScannerConfigUtil_ErrorNotSupported"), //$NON-NLS-1$
new Object[] { InputType.class.getName() });
throw new UnsupportedOperationException(msg);
@@ -237,14 +236,14 @@ public class CfgScannerConfigUtil {
Set<String> profiles = new TreeSet<String>();
String attribute = ((InputType) inputType).getLegacyDiscoveryProfileIdAttribute();
- if (attribute!=null) {
+ if (attribute != null) {
// FIXME: temporary; we should add new method to IInputType instead of that
for (String profileId : attribute.split("\\|")) { //$NON-NLS-1$
profiles.add(profileId);
}
}
IInputType superClass = inputType.getSuperClass();
- if (superClass!=null) {
+ if (superClass != null) {
profiles.addAll(getAllScannerDiscoveryProfileIds(superClass));
}
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 9a8e455d75c..a20e8e9137c 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
@@ -42,16 +42,16 @@ 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 class ListIndex {
-// int fIndex;
-// List fList;
-//
-// public ListIndex(int index, List list) {
-// fIndex = index;
-// fList = list;
-// }
-//}
+ 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;
+ // }
+ //}
public interface IRcSettingInfo {
CResourceData getResourceData();
@@ -65,17 +65,17 @@ public class PerFileSettingsCalculator {
PathInfo getFilePathInfo();
}
- private static class RcSettingInfo implements IRcSettingInfo{
+ private static class RcSettingInfo implements IRcSettingInfo {
private ArrayList<ILangSettingInfo> fLangInfoList;
private CResourceData fRcData;
- RcSettingInfo(CResourceData rcData){
+ RcSettingInfo(CResourceData rcData) {
fRcData = rcData;
}
@Override
public ILangSettingInfo[] getLangInfos() {
- if(fLangInfoList != null && fLangInfoList.size() != 0)
+ if (fLangInfoList != null && fLangInfoList.size() != 0)
return fLangInfoList.toArray(new ILangSettingInfo[fLangInfoList.size()]);
return new ILangSettingInfo[0];
}
@@ -85,8 +85,8 @@ public class PerFileSettingsCalculator {
return fRcData;
}
- void add(ILangSettingInfo info){
- if(fLangInfoList == null)
+ void add(ILangSettingInfo info) {
+ if (fLangInfoList == null)
fLangInfoList = new ArrayList<ILangSettingInfo>();
fLangInfoList.add(info);
}
@@ -96,7 +96,7 @@ public class PerFileSettingsCalculator {
private CLanguageData fLangData;
private PathInfo fPathInfo;
- LangSettingInfo(CLanguageData langData, PathInfo info){
+ LangSettingInfo(CLanguageData langData, PathInfo info) {
fLangData = langData;
fPathInfo = info;
}
@@ -122,31 +122,31 @@ public class PerFileSettingsCalculator {
return new List[size];
}
- public ListIndexStore(int size){
- if(size < 0)
+ public ListIndexStore(int size) {
+ if (size < 0)
size = 0;
fStore = emptyStore(size);
}
- public void add(int index, PathFilePathInfo value){
+ public void add(int index, PathFilePathInfo value) {
List<PathFilePathInfo> list = checkResize(index) ? new ArrayList<PathFilePathInfo>() : fStore[index];
- if(list == null){
+ if (list == null) {
list = new ArrayList<PathFilePathInfo>();
fStore[index] = list;
}
- if(fMaxIndex < index)
+ if (fMaxIndex < index)
fMaxIndex = index;
list.add(value);
}
- private boolean checkResize(int index){
- if(index >= fStore.length){
+ private boolean checkResize(int index) {
+ if (index >= fStore.length) {
int newSize = ++index;
List<PathFilePathInfo> resized[] = emptyStore(newSize);
- if(fStore != null && fStore.length != 0){
+ if (fStore != null && fStore.length != 0) {
System.arraycopy(fStore, 0, resized, 0, fStore.length);
}
fStore = resized;
@@ -155,13 +155,13 @@ public class PerFileSettingsCalculator {
return false;
}
- public List<PathFilePathInfo>[] getLists(){
+ public List<PathFilePathInfo>[] getLists() {
int size = fMaxIndex + 1;
List<List<PathFilePathInfo>> list = new ArrayList<List<PathFilePathInfo>>(size);
List<PathFilePathInfo> l;
- for(int i = 0; i < size; i++){
+ for (int i = 0; i < size; i++) {
l = fStore[i];
- if(l != null)
+ if (l != null)
list.add(l);
}
@@ -173,15 +173,15 @@ public class PerFileSettingsCalculator {
IPath fPath;
PathInfo fInfo;
- PathFilePathInfo(IPath path, PathInfo info){
+ PathFilePathInfo(IPath path, PathInfo info) {
fPath = path;
fInfo = info;
}
}
private static class ExtsSetSettings {
-// String[] fExts;
-// HashSet fExtsSet;
+ // String[] fExts;
+ // HashSet fExtsSet;
private ExtsSet fExtsSet;
Map<PathInfo, List<PathFilePathInfo>> fPathFilePathInfoMap;
CLanguageData fBaseLangData;
@@ -196,8 +196,8 @@ public class PerFileSettingsCalculator {
fIsDerived = isDerived;
}
- void add(ExtsSetSettings setting){
- if(setting.fPathFilePathInfoMap != null){
+ void add(ExtsSetSettings setting) {
+ if (setting.fPathFilePathInfoMap != null) {
Collection<List<PathFilePathInfo>> values = setting.fPathFilePathInfoMap.values();
for (List<PathFilePathInfo> list : values) {
for (PathFilePathInfo pInfo : list) {
@@ -207,31 +207,32 @@ public class PerFileSettingsCalculator {
}
}
-// void updateLangData(CLanguageData lData, boolean isDerived){
-// fBaseLangData = lData;
-// fIsDerived = lData != null ? isDerived : false;
-// }
+ // void updateLangData(CLanguageData lData, boolean isDerived){
+ // fBaseLangData = lData;
+ // fIsDerived = lData != null ? isDerived : false;
+ // }
- public void add(PathFilePathInfo pInfo){
- if(fPathFilePathInfoMap == null)
+ 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){
+ List<PathFilePathInfo> list = fileInfo == fMaxMatchInfo ? fMaxMatchInfoList
+ : fPathFilePathInfoMap.get(fileInfo);
+ if (list == null) {
List<PathFilePathInfo> emptyList = new ArrayList<PathFilePathInfo>();
fPathFilePathInfoMap.put(fileInfo, emptyList);
- if(fMaxMatchInfo == null){
+ if (fMaxMatchInfo == null) {
fMaxMatchInfo = fileInfo;
fMaxMatchInfoList = emptyList;
}
-// else {
-// fIsMultiple = true;
-// }
- } else if(fMaxMatchInfoList != list){
-// fIsMultiple = true;
+ // else {
+ // fIsMultiple = true;
+ // }
+ } else if (fMaxMatchInfoList != list) {
+ // fIsMultiple = true;
- if(fMaxMatchInfoList.size() == list.size()){
+ if (fMaxMatchInfoList.size() == list.size()) {
fMaxMatchInfoList = list;
fMaxMatchInfo = fileInfo;
}
@@ -239,33 +240,33 @@ public class PerFileSettingsCalculator {
list.add(pInfo);
}
- public boolean isMultiple(){
+ public boolean isMultiple() {
return fPathFilePathInfoMap != null && fPathFilePathInfoMap.size() > 1;
}
-// public PathInfo getMaxMatchPathInfo(){
-// return fMaxMatchInfo;
-// }
+ // public PathInfo getMaxMatchPathInfo(){
+ // return fMaxMatchInfo;
+ // }
@Override
public boolean equals(Object obj) {
- if(obj == this)
+ if (obj == this)
return true;
- if(isMultiple())
+ if (isMultiple())
return false;
- if(!(obj instanceof ExtsSetSettings))
+ if (!(obj instanceof ExtsSetSettings))
return false;
- ExtsSetSettings other = (ExtsSetSettings)obj;
- if(other.isMultiple())
+ ExtsSetSettings other = (ExtsSetSettings) obj;
+ if (other.isMultiple())
return false;
- if(!fExtsSet.equals(other.fExtsSet))
+ if (!fExtsSet.equals(other.fExtsSet))
return false;
- if(!CDataUtil.objectsEqual(fMaxMatchInfo, other.fMaxMatchInfo))
+ if (!CDataUtil.objectsEqual(fMaxMatchInfo, other.fMaxMatchInfo))
return false;
return true;
@@ -274,13 +275,13 @@ public class PerFileSettingsCalculator {
@Override
public int hashCode() {
int hash = fHash;
- if(hash == 0){
- if(isMultiple())
+ if (hash == 0) {
+ if (isMultiple())
hash = super.hashCode();
else {
hash = fExtsSet.hashCode();
- if(fMaxMatchInfo != null)
+ if (fMaxMatchInfo != null)
hash += fMaxMatchInfo.hashCode();
}
@@ -296,42 +297,42 @@ public class PerFileSettingsCalculator {
private HashSet<String> fExtsSet;
private int fHash;
- public ExtsSet(String[] exts){
- fExts = exts == null || exts.length == 0 ? EMPTY_STRING_ARRAY : (String[])exts.clone();
+ 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)
+ if (this == obj)
return true;
- if(!(obj instanceof ExtsSet))
+ if (!(obj instanceof ExtsSet))
return false;
- ExtsSet other = (ExtsSet)obj;
- if(fExts.length != other.fExts.length)
+ ExtsSet other = (ExtsSet) obj;
+ if (fExts.length != other.fExts.length)
return false;
- if(fExts.length != 0){
+ if (fExts.length != 0) {
@SuppressWarnings("unchecked")
- HashSet<String> set = (HashSet<String>)calcExtsSet().clone();
+ HashSet<String> set = (HashSet<String>) calcExtsSet().clone();
set.removeAll(other.calcExtsSet());
- if(set.size() != 0)
+ if (set.size() != 0)
return false;
}
return true;
}
-// public String[] getExtensions(){
-// return fExts.clone();
-// }
+ // public String[] getExtensions(){
+ // return fExts.clone();
+ // }
@Override
public int hashCode() {
int hash = fHash;
- if(hash == 0){
+ if (hash == 0) {
hash = 47;
- for(int i = 0; i < fExts.length; i++){
+ for (int i = 0; i < fExts.length; i++) {
hash += fExts[i].hashCode();
}
fHash = hash;
@@ -339,21 +340,21 @@ public class PerFileSettingsCalculator {
return hash;
}
- private HashSet<String> calcExtsSet(){
- if(fExtsSet == null)
+ private HashSet<String> calcExtsSet() {
+ if (fExtsSet == null)
fExtsSet = new HashSet<String>(Arrays.asList(fExts));
return fExtsSet;
}
@Override
public String toString() {
- if(fExts.length == 0)
+ if (fExts.length == 0)
return "<empty>"; //$NON-NLS-1$
StringBuilder buf = new StringBuilder();
- for(int i = 0; i < fExts.length; i++){
- if(i != 0)
+ for (int i = 0; i < fExts.length; i++) {
+ if (i != 0)
buf.append(","); //$NON-NLS-1$
buf.append(fExts[i]);
}
@@ -368,83 +369,83 @@ public class PerFileSettingsCalculator {
private PathSettingsContainer fContainer;
private boolean fIsDerived;
- RcSetSettings(PathSettingsContainer cr, CResourceData rcData, boolean isDerived){
+ RcSetSettings(PathSettingsContainer cr, CResourceData rcData, boolean isDerived) {
this.fContainer = cr;
this.fRcData = rcData;
this.fIsDerived = isDerived;
cr.setValue(this);
}
- public RcSetSettings getChild(IPath path, boolean exactPath){
+ public RcSetSettings getChild(IPath path, boolean exactPath) {
PathSettingsContainer cr = fContainer.getChildContainer(path, false, exactPath);
- if(cr != null)
- return (RcSetSettings)cr.getValue();
+ if (cr != null)
+ return (RcSetSettings) cr.getValue();
return null;
}
- public RcSetSettings getChild(IPath path){
+ public RcSetSettings getChild(IPath path) {
PathSettingsContainer cr = fContainer.getChildContainer(path, false, true);
- if(cr != null)
- return (RcSetSettings)cr.getValue();
+ if (cr != null)
+ return (RcSetSettings) cr.getValue();
return null;
}
-// public CResourceData getResourceData() {
-// return fRcData;
-// }
+ // public CResourceData getResourceData() {
+ // return fRcData;
+ // }
- public RcSetSettings createChild(IPath path, CResourceData data, boolean isDerived){
+ public RcSetSettings createChild(IPath path, CResourceData data, boolean isDerived) {
PathSettingsContainer cr = fContainer.getChildContainer(path, true, true);
- RcSetSettings child = (RcSetSettings)cr.getValue();
- if(child == null){
+ RcSetSettings child = (RcSetSettings) cr.getValue();
+ if (child == null) {
child = new RcSetSettings(cr, data, isDerived);
-// cr.setValue(child);
+ // cr.setValue(child);
}
return child;
}
- void updateRcData(CResourceData data, boolean isDerived){
+ 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();
+ private void updateLangDatas() {
+ if (fRcData.getType() == ICSettingBase.SETTING_FILE) {
+ CLanguageData lData = ((CFileData) fRcData).getLanguageData();
ExtsSetSettings extSetting = fExtToExtsSetMap.get(getFileExt(fRcData.getPath()));
- if(extSetting != null){
+ if (extSetting != null) {
extSetting.fBaseLangData = lData;
extSetting.fIsDerived = lData != null ? fIsDerived : false;
}
- if(extSetting != null ?
- fExtsSetToExtsSetSettingsMap.size() > 1
- : fExtsSetToExtsSetSettingsMap.size() > 0){
+ if (extSetting != null ? fExtsSetToExtsSetSettingsMap.size() > 1
+ : fExtsSetToExtsSetSettingsMap.size() > 0) {
Collection<ExtsSetSettings> values = fExtsSetToExtsSetSettingsMap.values();
for (ExtsSetSettings s : values) {
- if(s != extSetting){
+ if (s != extSetting) {
s.fBaseLangData = null;
s.fIsDerived = false;
}
}
}
} else {
- CLanguageData[] lDatas = ((CFolderData)fRcData).getLanguageDatas();
+ CLanguageData[] lDatas = ((CFolderData) fRcData).getLanguageDatas();
@SuppressWarnings("unchecked")
- Map<ExtsSet, ExtsSetSettings> map = (HashMap<ExtsSet, ExtsSetSettings>)fExtsSetToExtsSetSettingsMap.clone();
+ Map<ExtsSet, ExtsSetSettings> map = (HashMap<ExtsSet, ExtsSetSettings>) fExtsSetToExtsSetSettingsMap
+ .clone();
CLanguageData lData;
- for(int i = 0; i < lDatas.length; i++){
+ for (int i = 0; i < lDatas.length; i++) {
lData = lDatas[i];
ExtsSetSettings extSetting = map.remove(new ExtsSet(lData.getSourceExtensions()));
- if(extSetting != null){
+ if (extSetting != null) {
extSetting.fBaseLangData = lData;
extSetting.fIsDerived = this.fIsDerived;
}
}
- if(map.size() != 0){
+ if (map.size() != 0) {
Collection<ExtsSetSettings> values = map.values();
for (ExtsSetSettings extSetting : values) {
extSetting.fBaseLangData = null;
@@ -454,29 +455,29 @@ public class PerFileSettingsCalculator {
}
}
- public IPath getPath(){
+ public IPath getPath() {
return fContainer.getPath();
}
- public RcSetSettings getParent(){
+ public RcSetSettings getParent() {
PathSettingsContainer cr = fContainer.getParentContainer();
- if(cr != null)
- return (RcSetSettings)cr.getValue();
+ if (cr != null)
+ return (RcSetSettings) cr.getValue();
return null;
}
- void internalSetSettingsMap(HashMap<ExtsSet, ExtsSetSettings> map){
+ void internalSetSettingsMap(HashMap<ExtsSet, ExtsSetSettings> map) {
fExtsSetToExtsSetSettingsMap = map;
fExtToExtsSetMap = calcExtToExtSetSettingsMap(map);
}
- void internalAdd(ExtsSetSettings setting){
- if(fExtsSetToExtsSetSettingsMap == null){
+ void internalAdd(ExtsSetSettings setting) {
+ if (fExtsSetToExtsSetSettingsMap == null) {
fExtsSetToExtsSetSettingsMap = new HashMap<ExtsSet, ExtsSetSettings>();
}
ExtsSetSettings cur = fExtsSetToExtsSetSettingsMap.get(setting.fExtsSet);
- if(cur != null){
+ if (cur != null) {
cur.add(setting);
} else {
fExtsSetToExtsSetSettingsMap.put(setting.fExtsSet, setting);
@@ -484,35 +485,35 @@ public class PerFileSettingsCalculator {
}
}
- void internalAddSettingsMap(HashMap<ExtsSet, ExtsSetSettings> map){
-// ExtsSetSettings thisSetting;
-// ExtsSet extsSet;
+ void internalAddSettingsMap(HashMap<ExtsSet, ExtsSetSettings> map) {
+ // ExtsSetSettings thisSetting;
+ // ExtsSet extsSet;
Collection<ExtsSetSettings> values = map.values();
for (ExtsSetSettings setting : values) {
internalAdd(setting);
-// extsSet = setting.fExtsSet;
-// thisSetting = (ExtsSetSettings)fExtsSetToExtsSetSettingsMap.get(extsSet);
-// if(thisSetting != null){
-// thisSetting.add(setting);
-// } else {
-// fExtsSetToExtsSetSettingsMap.put(extsSet, setting);
-// fExtToExtsSetMap = addExtsInfoToMap(setting, fExtToExtsSetMap);
-// }
+ // extsSet = setting.fExtsSet;
+ // thisSetting = (ExtsSetSettings)fExtsSetToExtsSetSettingsMap.get(extsSet);
+ // if(thisSetting != null){
+ // thisSetting.add(setting);
+ // } else {
+ // fExtsSetToExtsSetSettingsMap.put(extsSet, setting);
+ // fExtToExtsSetMap = addExtsInfoToMap(setting, fExtToExtsSetMap);
+ // }
}
}
-// public boolean settingsEqual(RcSetSettings other){
-// return fExtsSetToExtsSetSettingsMap.equals(other.fExtsSetToExtsSetSettingsMap);
-// }
+ // public boolean settingsEqual(RcSetSettings other){
+ // return fExtsSetToExtsSetSettingsMap.equals(other.fExtsSetToExtsSetSettingsMap);
+ // }
- public RcSetSettings[] getChildren(final boolean includeCurrent){
+ public RcSetSettings[] getChildren(final boolean includeCurrent) {
final List<RcSetSettings> list = new ArrayList<RcSetSettings>();
- fContainer.accept(new IPathSettingsContainerVisitor(){
+ fContainer.accept(new IPathSettingsContainerVisitor() {
@Override
public boolean visit(PathSettingsContainer container) {
- if(includeCurrent || container != fContainer){
- RcSetSettings value = (RcSetSettings)container.getValue();
+ if (includeCurrent || container != fContainer) {
+ RcSetSettings value = (RcSetSettings) container.getValue();
list.add(value);
}
return true;
@@ -523,31 +524,31 @@ public class PerFileSettingsCalculator {
return list.toArray(new RcSetSettings[list.size()]);
}
- public boolean containsEqualMaxMatches(RcSetSettings other, boolean ignoreGenerated){
- if(!ignoreGenerated && fExtsSetToExtsSetSettingsMap.size() < other.fExtsSetToExtsSetSettingsMap.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)
+ if (ignoreGenerated && otherSetting.fBaseLangData == null)
continue;
ExtsSetSettings thisSetting = fExtsSetToExtsSetSettingsMap.get(entry.getKey());
- if(thisSetting == null)
+ if (thisSetting == null)
return false;
- if(otherSetting.fMaxMatchInfo != null && !otherSetting.fMaxMatchInfo.equals(thisSetting.fMaxMatchInfo))
+ if (otherSetting.fMaxMatchInfo != null && !otherSetting.fMaxMatchInfo.equals(thisSetting.fMaxMatchInfo))
return false;
}
return true;
}
- void removeChild(RcSetSettings setting){
+ void removeChild(RcSetSettings setting) {
IPath path = setting.fContainer.getPath();
IPath thisPath = fContainer.getPath();
- if(!thisPath.isPrefixOf(path))
+ if (!thisPath.isPrefixOf(path))
throw new IllegalArgumentException();
path = path.removeFirstSegments(thisPath.segmentCount());
@@ -555,7 +556,8 @@ public class PerFileSettingsCalculator {
}
}
- private static HashMap<String, ExtsSetSettings> calcExtToExtSetSettingsMap(Map<ExtsSet, ExtsSetSettings> extsSetMap){
+ private static HashMap<String, ExtsSetSettings> calcExtToExtSetSettingsMap(
+ Map<ExtsSet, ExtsSetSettings> extsSetMap) {
HashMap<String, ExtsSetSettings> result = null;
Collection<ExtsSetSettings> values = extsSetMap.values();
for (ExtsSetSettings setting : values) {
@@ -564,31 +566,32 @@ public class PerFileSettingsCalculator {
return result;
}
- private static HashMap<String, ExtsSetSettings> addExtsInfoToMap(ExtsSetSettings setting, HashMap<String, ExtsSetSettings> map){
+ private static HashMap<String, ExtsSetSettings> addExtsInfoToMap(ExtsSetSettings setting,
+ HashMap<String, ExtsSetSettings> map) {
boolean forceAdd = false;
String[] exts = setting.fExtsSet.fExts;
String ext;
- if(map == null){
+ if (map == null) {
map = new HashMap<String, ExtsSetSettings>();
forceAdd = true;
}
- for(int i = 0; i < exts.length; i++){
+ for (int i = 0; i < exts.length; i++) {
ext = exts[i];
- if(forceAdd || !map.containsKey(ext)){
+ if (forceAdd || !map.containsKey(ext)) {
map.put(ext, setting);
}
}
return map;
}
- private RcSetSettings createRcSetInfo (CConfigurationData data){
+ private RcSetSettings createRcSetInfo(CConfigurationData data) {
CFolderData rootData = data.getRootFolderData();
PathSettingsContainer container = PathSettingsContainer.createRootContainer();
RcSetSettings rcSet = new RcSetSettings(container, rootData, false);
rcSet.internalSetSettingsMap(createExtsSetSettingsMap(rootData));
-// rcSet.fExtToExtsSetMap = new HashMap();
-// rcSet.fExtsSetToExtsSetSettingsMap = new HashMap();
+ // rcSet.fExtToExtsSetMap = new HashMap();
+ // rcSet.fExtsSetToExtsSetSettingsMap = new HashMap();
CResourceData[] rcDatas = data.getResourceDatas();
CResourceData rcData;
@@ -597,46 +600,49 @@ public class PerFileSettingsCalculator {
ExtsSetSettings fileSetting;
IPath path;
- for(int i = 0; i < rcDatas.length; i++){
+ for (int i = 0; i < rcDatas.length; i++) {
rcData = rcDatas[i];
- if(rcData == rootData)
+ if (rcData == rootData)
continue;
- if(!includeRcDataInCalculation(data, rcData))
+ if (!includeRcDataInCalculation(data, rcData))
continue;
path = rcData.getPath();
curRcSet = rcSet.createChild(path, rcData, false);
- if(rcData.getType() == ICSettingBase.SETTING_FILE){
+ if (rcData.getType() == ICSettingBase.SETTING_FILE) {
fileMap = new HashMap<ExtsSet, ExtsSetSettings>(1);
- fileSetting = createExtsSetSettings(path, (CFileData)rcData);
+ fileSetting = createExtsSetSettings(path, (CFileData) rcData);
fileMap.put(fileSetting.fExtsSet, fileSetting);
curRcSet.internalSetSettingsMap(fileMap);
} else {
- curRcSet.internalSetSettingsMap(createExtsSetSettingsMap((CFolderData)rcData));
+ curRcSet.internalSetSettingsMap(createExtsSetSettingsMap((CFolderData) rcData));
}
}
return rcSet;
}
- protected boolean includeRcDataInCalculation(CConfigurationData cfgData, CResourceData rcData){
+ protected boolean includeRcDataInCalculation(CConfigurationData cfgData, CResourceData rcData) {
return true;
}
- protected CFileData createFileData(CConfigurationData cfgData, IPath path, CFileData base) throws CoreException{
+ protected CFileData createFileData(CConfigurationData cfgData, IPath path, CFileData base) throws CoreException {
return cfgData.createFileData(path, base);
}
- protected CFileData createFileData(CConfigurationData cfgData, IPath path, CFolderData base, CLanguageData langBase) throws CoreException{
+ protected CFileData createFileData(CConfigurationData cfgData, IPath path, CFolderData base, CLanguageData langBase)
+ throws CoreException {
return cfgData.createFileData(path, base, langBase);
}
- protected CFolderData createFolderData(CConfigurationData cfgData, IPath path, CFolderData base) throws CoreException{
+ protected CFolderData createFolderData(CConfigurationData cfgData, IPath path, CFolderData base)
+ throws CoreException {
return cfgData.createFolderData(path, base);
}
- private RcSetSettings createRcSetSettings(CConfigurationData data, IDiscoveredPathManager.IPerFileDiscoveredPathInfo2 discoveredInfo){
+ private RcSetSettings createRcSetSettings(CConfigurationData data,
+ IDiscoveredPathManager.IPerFileDiscoveredPathInfo2 discoveredInfo) {
RcSetSettings rcSet = createRcSetInfo(data);
Map<IResource, PathInfo> map = discoveredInfo.getPathInfoMap();
PathFilePathInfo pInfos[] = createOrderedInfo(map);
@@ -648,33 +654,34 @@ public class PerFileSettingsCalculator {
/*
* utility method for creating empty IRcSettingInfo
*/
- public static IRcSettingInfo createEmptyRcSettingInfo(CFolderData data){
+ public static IRcSettingInfo createEmptyRcSettingInfo(CFolderData data) {
RcSettingInfo rcInfo = new RcSettingInfo(data);
CLanguageData[] lDatas = data.getLanguageDatas();
addEmptyLanguageInfos(rcInfo, lDatas);
return rcInfo;
}
- private static void addEmptyLanguageInfos(RcSettingInfo rcInfo, CLanguageData[] lDatas){
+ private static void addEmptyLanguageInfos(RcSettingInfo rcInfo, CLanguageData[] lDatas) {
ArrayList<ILangSettingInfo> list = rcInfo.fLangInfoList;
- if(list == null){
+ if (list == null) {
list = new ArrayList<ILangSettingInfo>(lDatas.length);
rcInfo.fLangInfoList = list;
} else {
list.ensureCapacity(lDatas.length);
}
- for(int i = 0; i < lDatas.length; i++){
+ 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;
+ private IRcSettingInfo[] mapFileDiscoveredInfo(IProject project, CConfigurationData data, RcSetSettings rcSet,
+ PathFilePathInfo[] pfpis) {
+ // IResource rc;
PathInfo pInfo;
IPath projRelPath;
CResourceData rcData;
-// RcSetSettings dataSetting;
+ // RcSetSettings dataSetting;
List<IRcSettingInfo> list = new ArrayList<IRcSettingInfo>(pfpis.length);
RcSettingInfo rcInfo;
LangSettingInfo lInfo;
@@ -682,15 +689,15 @@ public class PerFileSettingsCalculator {
ArrayList<ILangSettingInfo> tmpList;
PathFilePathInfo pfpi;
- for(int i = 0; i < pfpis.length; i++){
+ for (int i = 0; i < pfpis.length; i++) {
pfpi = pfpis[i];
projRelPath = pfpi.fPath;
pInfo = pfpi.fInfo;
- if(pInfo.isEmpty())
+ if (pInfo.isEmpty())
continue;
- if(projRelPath.segmentCount() == 0){
- CFolderData rootData = (CFolderData)rcSet.fRcData;
+ if (projRelPath.segmentCount() == 0) {
+ CFolderData rootData = (CFolderData) rcSet.fRcData;
CLanguageData lDatas[] = rootData.getLanguageDatas();
IPath[] incPaths = pInfo.getIncludePaths();
IPath[] quotedIncPaths = pInfo.getQuoteIncludePaths();
@@ -699,22 +706,22 @@ public class PerFileSettingsCalculator {
Map<String, String> symbolMap = pInfo.getSymbols();
int kinds = 0;
- if(incPaths.length != 0 || quotedIncPaths.length != 0)
+ if (incPaths.length != 0 || quotedIncPaths.length != 0)
kinds |= ICLanguageSettingEntry.INCLUDE_PATH;
- if(incFiles.length != 0)
+ if (incFiles.length != 0)
kinds |= ICLanguageSettingEntry.INCLUDE_FILE;
- if(macroFiles.length != 0)
+ if (macroFiles.length != 0)
kinds |= ICLanguageSettingEntry.MACRO_FILE;
- if(symbolMap.size() != 0)
+ if (symbolMap.size() != 0)
kinds |= ICLanguageSettingEntry.MACRO;
rcInfo = null;
- for(int k = 0; k < lDatas.length; k++){
+ for (int k = 0; k < lDatas.length; k++) {
lData = lDatas[k];
- if((lData.getSupportedEntryKinds() & kinds) == 0)
+ if ((lData.getSupportedEntryKinds() & kinds) == 0)
continue;
- if(rcInfo == null){
+ if (rcInfo == null) {
rcInfo = new RcSettingInfo(rootData);
tmpList = new ArrayList<ILangSettingInfo>(lDatas.length - k);
rcInfo.fLangInfoList = tmpList;
@@ -724,68 +731,69 @@ public class PerFileSettingsCalculator {
rcInfo.add(lInfo);
}
- if(rcInfo != null)
+ if (rcInfo != null)
list.add(rcInfo);
continue;
}
-// switch(rc.getType()){
-// case IResource.FILE:
-// projRelPath = rc.getProjectRelativePath();
-// dataSetting = rcSet.getChild(projRelPath, false);
-// rcData = dataSetting.fRcData;
- rcData = rcSet.getChild(projRelPath, false).fRcData;
- if(!rcData.getPath().equals(projRelPath)){
- if(rcData.getType() == ICSettingBase.SETTING_FOLDER){
- CFolderData foData = (CFolderData)rcData;
- lData = CDataUtil.findLanguagDataForFile(projRelPath.lastSegment(), project, (CFolderData)rcData);
- try {
- rcData = createFileData(data, projRelPath, foData, lData);
- } catch (CoreException e) {
- rcData = null;
- ManagedBuilderCorePlugin.log(e);
- }
- } else {
- try {
- rcData = createFileData(data, projRelPath, (CFileData)rcData);
- } catch (CoreException e) {
- rcData = null;
- ManagedBuilderCorePlugin.log(e);
- }
+ // switch(rc.getType()){
+ // case IResource.FILE:
+ // projRelPath = rc.getProjectRelativePath();
+ // dataSetting = rcSet.getChild(projRelPath, false);
+ // rcData = dataSetting.fRcData;
+ rcData = rcSet.getChild(projRelPath, false).fRcData;
+ if (!rcData.getPath().equals(projRelPath)) {
+ if (rcData.getType() == ICSettingBase.SETTING_FOLDER) {
+ CFolderData foData = (CFolderData) rcData;
+ lData = CDataUtil.findLanguagDataForFile(projRelPath.lastSegment(), project, (CFolderData) rcData);
+ try {
+ rcData = createFileData(data, projRelPath, foData, lData);
+ } catch (CoreException e) {
+ rcData = null;
+ ManagedBuilderCorePlugin.log(e);
+ }
+ } else {
+ try {
+ rcData = createFileData(data, projRelPath, (CFileData) rcData);
+ } catch (CoreException e) {
+ rcData = null;
+ ManagedBuilderCorePlugin.log(e);
}
-// if(rcData != null)
-// dataSetting = rcSet.createChild(projRelPath, rcData, false);
-// else
-// dataSetting = null;
}
+ // 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 (rcData != null) {
+ if (rcData.getType() == ICSettingBase.SETTING_FILE) {
+ lData = ((CFileData) rcData).getLanguageData();
+ } else {
+ lData = CDataUtil.findLanguagDataForFile(projRelPath.lastSegment(), project, (CFolderData) rcData);
- if(lData != null){
- rcInfo = new RcSettingInfo(rcData);
- lInfo = new LangSettingInfo(lData, pInfo);
- tmpList = new ArrayList<ILangSettingInfo>(1);
- tmpList.add(lInfo);
- rcInfo.fLangInfoList = tmpList;
- list.add(rcInfo);
- }
+ }
+ if (lData != null) {
+ rcInfo = new RcSettingInfo(rcData);
+ lInfo = new LangSettingInfo(lData, pInfo);
+ tmpList = new ArrayList<ILangSettingInfo>(1);
+ tmpList.add(lInfo);
+ rcInfo.fLangInfoList = tmpList;
+ list.add(rcInfo);
}
-// break;
-// }
+ }
+
+ // break;
+ // }
}
return list.toArray(new RcSettingInfo[list.size()]);
}
- public IRcSettingInfo[] getSettingInfos(IProject project, CConfigurationData data, IDiscoveredPathManager.IPerFileDiscoveredPathInfo2 discoveredInfo, boolean fileDataMode){
- if(fileDataMode){
+ public IRcSettingInfo[] getSettingInfos(IProject project, CConfigurationData data,
+ IDiscoveredPathManager.IPerFileDiscoveredPathInfo2 discoveredInfo, boolean fileDataMode) {
+ if (fileDataMode) {
RcSetSettings rcSettings = createRcSetInfo(data);
PathFilePathInfo pInfos[] = createOrderedInfo(discoveredInfo.getPathInfoMap());
return mapFileDiscoveredInfo(project, data, rcSettings, pInfos);
@@ -794,7 +802,7 @@ public class PerFileSettingsCalculator {
return createInfos(data, settings);
}
- private IRcSettingInfo[] createInfos(CConfigurationData data, RcSetSettings rootSetting){
+ private IRcSettingInfo[] createInfos(CConfigurationData data, RcSetSettings rootSetting) {
RcSetSettings settings[] = rootSetting.getChildren(true);
RcSetSettings setting;
CResourceData rcData;
@@ -802,20 +810,20 @@ public class PerFileSettingsCalculator {
LangSettingInfo langInfo;
RcSettingInfo rcInfo;
PathInfo pathInfo;
- for(int i = 0; i < settings.length; i++){
+ for (int i = 0; i < settings.length; i++) {
setting = settings[i];
rcData = setting.fRcData;
- if(rcData == null)
+ if (rcData == null)
continue;
- if(setting.fIsDerived){
-// rcData = null;
+ if (setting.fIsDerived) {
+ // rcData = null;
try {
rcData = createFolderData(data, rcData, setting);
} catch (CoreException e) {
rcData = null;
ManagedBuilderCorePlugin.log(e);
}
- if(rcData != null){
+ if (rcData != null) {
setting.updateRcData(rcData, false);
} else {
//TODO:
@@ -823,11 +831,11 @@ public class PerFileSettingsCalculator {
}
}
- if(rcData.getType() == ICSettingBase.SETTING_FILE){
+ if (rcData.getType() == ICSettingBase.SETTING_FILE) {
ExtsSetSettings extSetting = setting.fExtToExtsSetMap.get(getFileExt(rcData.getPath()));
- if(extSetting != null){
+ if (extSetting != null) {
pathInfo = extSetting.fMaxMatchInfo;
- if(pathInfo != null){
+ if (pathInfo != null) {
langInfo = new LangSettingInfo(extSetting.fBaseLangData, pathInfo);
rcInfo = new RcSettingInfo(rcData);
rcInfo.fLangInfoList = new ArrayList<ILangSettingInfo>(1);
@@ -836,37 +844,38 @@ public class PerFileSettingsCalculator {
}
}
} else {
- if(setting.fExtsSetToExtsSetSettingsMap.size() != 0 ){
+ if (setting.fExtsSetToExtsSetSettingsMap.size() != 0) {
rcInfo = new RcSettingInfo(rcData);
rcInfo.fLangInfoList = new ArrayList<ILangSettingInfo>(setting.fExtsSetToExtsSetSettingsMap.size());
resultList.add(rcInfo);
Collection<ExtsSetSettings> values = setting.fExtsSetToExtsSetSettingsMap.values();
for (ExtsSetSettings extSetting : values) {
- if(extSetting.fMaxMatchInfo == null)
+ if (extSetting.fMaxMatchInfo == null)
continue;
- if(extSetting.fBaseLangData == null)
+ if (extSetting.fBaseLangData == null)
continue;
- if(extSetting.fIsDerived){
+ 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();
+ if (extSetting.isMultiple()) {
+ Set<Entry<PathInfo, List<PathFilePathInfo>>> entrySet = extSetting.fPathFilePathInfoMap
+ .entrySet();
for (Entry<PathInfo, List<PathFilePathInfo>> entry : entrySet) {
- if(entry.getKey().equals(extSetting.fMaxMatchInfo))
+ if (entry.getKey().equals(extSetting.fMaxMatchInfo))
continue;
List<PathFilePathInfo> piList = entry.getValue();
for (PathFilePathInfo pi : piList) {
try {
- CFileData fiData = createFileData(data, pi.fPath, (CFolderData)rcData, extSetting.fBaseLangData);
+ CFileData fiData = createFileData(data, pi.fPath, (CFolderData) rcData,
+ extSetting.fBaseLangData);
CLanguageData fiLangData = fiData.getLanguageData();
- if(fiLangData != null){
+ if (fiLangData != null) {
RcSettingInfo fiInfo = new RcSettingInfo(fiData);
fiInfo.add(new LangSettingInfo(fiLangData, pi.fInfo));
resultList.add(fiInfo);
@@ -881,57 +890,58 @@ 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);
+ 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){
+ private static void checkRemoveDups(RcSetSettings rcSet) {
RcSetSettings settings[] = rcSet.getChildren(true);
RcSetSettings setting, parent;
- for(int i = 0; i < settings.length; i++){
+ for (int i = 0; i < settings.length; i++) {
setting = settings[i];
- if(!setting.fIsDerived)
+ if (!setting.fIsDerived)
continue;
parent = setting.getParent();
- if(parent == null)
+ if (parent == null)
continue;
- if(parent.containsEqualMaxMatches(setting, true))
+ if (parent.containsEqualMaxMatches(setting, true))
removeChildAddingChildSettings(parent, setting);
}
}
- private static void removeChildAddingChildSettings(RcSetSettings parent, RcSetSettings child){
+ private static void removeChildAddingChildSettings(RcSetSettings parent, RcSetSettings child) {
parent.internalAddSettingsMap(child.fExtsSetToExtsSetSettingsMap);
parent.removeChild(child);
}
- private static void mapDiscoveredInfo(RcSetSettings rcSet, PathFilePathInfo[] pInfos){
+ private static void mapDiscoveredInfo(RcSetSettings rcSet, PathFilePathInfo[] pInfos) {
PathFilePathInfo pInfo;
RcSetSettings child, parent;
String ext;
ExtsSetSettings extsSet;
-// boolean isDerived;
+ // boolean isDerived;
IPath dirPath;
- for(int i = 0; i < pInfos.length; i++){
+ for (int i = 0; i < pInfos.length; i++) {
pInfo = pInfos[i];
child = rcSet.getChild(pInfo.fPath);
- if(child == null) {
+ if (child == null) {
dirPath = pInfo.fPath.removeLastSegments(1);
child = rcSet.getChild(dirPath);
- if(child == null){
+ if (child == null) {
child = rcSet.createChild(dirPath, null, true);
- if(child.fExtToExtsSetMap == null){
+ if (child.fExtToExtsSetMap == null) {
parent = child.getParent();
child.fRcData = parent.fRcData;
child.internalSetSettingsMap(createEmptyExtSetMapCopy(parent.fExtsSetToExtsSetSettingsMap));
@@ -939,40 +949,40 @@ public class PerFileSettingsCalculator {
}
}
-// isDerived = child.fIsDerived;
+ // isDerived = child.fIsDerived;
- if(pInfo.fPath.segmentCount() == 0){
+ if (pInfo.fPath.segmentCount() == 0) {
processProjectPaths(child, pInfo);
} else {
ext = getFileExt(pInfo.fPath);
extsSet = child.fExtToExtsSetMap.get(ext);
- if(extsSet == null){
- extsSet = new ExtsSetSettings(null, new ExtsSet(new String[]{ext}), false);
+ if (extsSet == null) {
+ extsSet = new ExtsSetSettings(null, new ExtsSet(new String[] { ext }), false);
child.internalAdd(extsSet);
-// child.fExtToExtsSetMap.put(ext, extsSet);
+ // child.fExtToExtsSetMap.put(ext, extsSet);
}
extsSet.add(pInfo);
}
}
}
- private static void processProjectPaths(RcSetSettings rcSet, PathFilePathInfo pfpi){
+ 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){
+ private static String getFileExt(IPath path) {
String ext = path.getFileExtension();
- if(ext != null)
+ if (ext != null)
return ext;
return ""; //$NON-NLS-1$
}
- private static HashMap<ExtsSet, ExtsSetSettings> createEmptyExtSetMapCopy(HashMap<ExtsSet, ExtsSetSettings> base){
+ private static HashMap<ExtsSet, ExtsSetSettings> createEmptyExtSetMapCopy(HashMap<ExtsSet, ExtsSetSettings> base) {
@SuppressWarnings("unchecked")
- HashMap<ExtsSet, ExtsSetSettings> map = (HashMap<ExtsSet, ExtsSetSettings>)base.clone();
+ HashMap<ExtsSet, ExtsSetSettings> map = (HashMap<ExtsSet, ExtsSetSettings>) base.clone();
ExtsSetSettings extsSet;
Set<Entry<ExtsSet, ExtsSetSettings>> entrySet = map.entrySet();
for (Entry<ExtsSet, ExtsSetSettings> entry : entrySet) {
@@ -983,58 +993,58 @@ public class PerFileSettingsCalculator {
return map;
}
- private static ExtsSetSettings createExtsSetSettings(IPath path, CFileData data){
+ private static ExtsSetSettings createExtsSetSettings(IPath path, CFileData data) {
CLanguageData lData = data.getLanguageData();
- if(lData != null){
+ if (lData != null) {
String ext = getFileExt(path);
- return createExtsSetSettings(lData, new String[]{ext});
+ return createExtsSetSettings(lData, new String[] { ext });
}
return new ExtsSetSettings(null, new ExtsSet(EMPTY_STRING_ARRAY), false);
}
- private static ExtsSetSettings createExtsSetSettings(CLanguageData lData, String exts[]){
+ private static ExtsSetSettings createExtsSetSettings(CLanguageData lData, String exts[]) {
return new ExtsSetSettings(lData, new ExtsSet(exts), false);
}
- private static HashMap<ExtsSet, ExtsSetSettings> createExtsSetSettingsMap(CFolderData data){
+ private static HashMap<ExtsSet, ExtsSetSettings> createExtsSetSettingsMap(CFolderData data) {
CLanguageData[] lDatas = data.getLanguageDatas();
HashMap<ExtsSet, ExtsSetSettings> map = new HashMap<ExtsSet, ExtsSetSettings>(lDatas.length);
ExtsSetSettings settings;
- if(lDatas.length != 0) {
+ if (lDatas.length != 0) {
CLanguageData lData;
- for( int i = 0; i < lDatas.length; i++){
+ for (int i = 0; i < lDatas.length; i++) {
lData = lDatas[i];
- settings = createExtsSetSettings(lData, lData.getSourceExtensions());
- map.put(settings.fExtsSet, settings);
+ settings = createExtsSetSettings(lData, lData.getSourceExtensions());
+ map.put(settings.fExtsSet, settings);
}
}
return map;
}
- private static PathFilePathInfo[] createOrderedInfo(Map<IResource, PathInfo> map){
+ private static PathFilePathInfo[] createOrderedInfo(Map<IResource, PathInfo> map) {
IResource rc;
IPath path;
PathInfo info, storedInfo;
ListIndexStore store = new ListIndexStore(10);
HashMap<PathInfo, PathInfo> infoMap = new HashMap<PathInfo, PathInfo>();
-// LinkedHashMap result;
+ // LinkedHashMap result;
Set<Entry<IResource, PathInfo>> entrySet = map.entrySet();
for (Entry<IResource, PathInfo> entry : entrySet) {
rc = entry.getKey();
path = rc.getProjectRelativePath();
int segCount = path.segmentCount();
-// if(segCount < 1)
-// continue;
+ // if(segCount < 1)
+ // continue;
-// path = path.removeFirstSegments(1);
-// segCount--;
+ // path = path.removeFirstSegments(1);
+ // segCount--;
info = entry.getValue();
storedInfo = infoMap.get(info);
- if(storedInfo == null){
+ if (storedInfo == null) {
storedInfo = info;
infoMap.put(storedInfo, storedInfo);
}
@@ -1043,23 +1053,23 @@ public class PerFileSettingsCalculator {
}
List<PathFilePathInfo> lists[] = store.getLists();
-// result = new LinkedHashMap(map.size());
-// List l;
-// int lSize;
-// PathFilePathInfo pfpi;
-// for(int i = 0; i < lists.length; i++){
-// l = lists[i];
-// lSize = l.size();
-// if(lSize != 0){
-// for(int k = 0; k < lSize; k++){
-// pfpi = (PathFilePathInfo)l.get(k);
-// result.put(pfpi.fPath, pfpi.fInfo);
-// }
-// }
-// }
+ // result = new LinkedHashMap(map.size());
+ // List l;
+ // int lSize;
+ // PathFilePathInfo pfpi;
+ // for(int i = 0; i < lists.length; i++){
+ // l = lists[i];
+ // lSize = l.size();
+ // if(lSize != 0){
+ // for(int k = 0; k < lSize; k++){
+ // pfpi = (PathFilePathInfo)l.get(k);
+ // result.put(pfpi.fPath, pfpi.fInfo);
+ // }
+ // }
+ // }
int size = 0;
PathFilePathInfo infos[];
- for(int i = 0; i < lists.length; i++){
+ for (int i = 0; i < lists.length; i++) {
size += lists[i].size();
}
@@ -1067,10 +1077,10 @@ public class PerFileSettingsCalculator {
int num = 0;
int listSize;
List<PathFilePathInfo> list;
- for(int i = 0; i < lists.length; i++){
+ for (int i = 0; i < lists.length; i++) {
list = lists[i];
listSize = list.size();
- for(int k = 0; k < listSize; k++){
+ for (int k = 0; k < listSize; k++) {
infos[num++] = list.get(k);
}
}
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 e2605a26015..c818cbd7831 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
@@ -35,182 +35,176 @@ import org.eclipse.core.runtime.Platform;
* @author vhirsl
*/
public class CfgSCJobsUtil {
- private static class RC {
- public RC(boolean init) {
- rc = init;
- }
- /**
- * @return Returns the rc.
- */
- public boolean get() {
- return rc;
- }
- /**
- * @param rc The rc to set.
- */
- public void set(boolean rc) {
- this.rc = rc;
- }
-
- @Override
- public String toString() {
- return rc ? "true" : "false"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- private boolean rc;
- }
- /*uncomment
- public static boolean getProviderScannerInfo(final IProject project,
- final IScannerConfigBuilderInfo2 buildInfo,
- final IProgressMonitor monitor) {
- return getProviderScannerInfo(project, null, buildInfo, monitor);
- }
- */
-
- /**
- * Call ESI providers to get scanner info
- */
- public static SCProfileInstance getProviderScannerInfo(final IProject project,
- final CfgInfoContext context,
- SCProfileInstance profileInstance,
- final IScannerConfigBuilderInfo2 buildInfo,
- final Properties env,
- final IProgressMonitor monitor) {
- final RC rc = new RC(false);
- // get the collector
- if(profileInstance == null){
- profileInstance = ScannerConfigProfileManager.getInstance().
- getSCProfileInstance(project, context.toInfoContext(), buildInfo.getSelectedProfileId());
- }
- final IScannerInfoCollector collector = profileInstance.getScannerInfoCollector();
-
- List<String> providerIds = buildInfo.getProviderIdList();
- for (int i = 0; i < providerIds.size(); ++i) {
- final String providerId = providerIds.get(i);
- if (buildInfo.isProviderOutputParserEnabled(providerId)) {
- final IExternalScannerInfoProvider esiProvider = profileInstance.
- createExternalScannerInfoProvider(providerId);
- if (esiProvider != null) {
- ISafeRunnable runnable = new ISafeRunnable() {
-
- @Override
+ private static class RC {
+ public RC(boolean init) {
+ rc = init;
+ }
+
+ /**
+ * @return Returns the rc.
+ */
+ public boolean get() {
+ return rc;
+ }
+
+ /**
+ * @param rc The rc to set.
+ */
+ public void set(boolean rc) {
+ this.rc = rc;
+ }
+
+ @Override
+ public String toString() {
+ return rc ? "true" : "false"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ private boolean rc;
+ }
+ /*uncomment
+ public static boolean getProviderScannerInfo(final IProject project,
+ final IScannerConfigBuilderInfo2 buildInfo,
+ final IProgressMonitor monitor) {
+ return getProviderScannerInfo(project, null, buildInfo, monitor);
+ }
+ */
+
+ /**
+ * Call ESI providers to get scanner info
+ */
+ public static SCProfileInstance getProviderScannerInfo(final IProject project, final CfgInfoContext context,
+ SCProfileInstance profileInstance, final IScannerConfigBuilderInfo2 buildInfo, final Properties env,
+ final IProgressMonitor monitor) {
+ final RC rc = new RC(false);
+ // get the collector
+ if (profileInstance == null) {
+ profileInstance = ScannerConfigProfileManager.getInstance().getSCProfileInstance(project,
+ context.toInfoContext(), buildInfo.getSelectedProfileId());
+ }
+ final IScannerInfoCollector collector = profileInstance.getScannerInfoCollector();
+
+ List<String> providerIds = buildInfo.getProviderIdList();
+ for (int i = 0; i < providerIds.size(); ++i) {
+ final String providerId = providerIds.get(i);
+ if (buildInfo.isProviderOutputParserEnabled(providerId)) {
+ final IExternalScannerInfoProvider esiProvider = profileInstance
+ .createExternalScannerInfoProvider(providerId);
+ if (esiProvider != null) {
+ ISafeRunnable runnable = new ISafeRunnable() {
+
+ @Override
public void run() {
- esiProvider.invokeProvider(monitor, project, context.toInfoContext(), providerId, buildInfo, collector, env);
- rc.set(true);
- }
+ esiProvider.invokeProvider(monitor, project, context.toInfoContext(), providerId, buildInfo,
+ collector, env);
+ rc.set(true);
+ }
- @Override
+ @Override
public void handleException(Throwable exception) {
- rc.set(false);
- ManagedBuilderCorePlugin.log(exception);
- }
-
- };
- Platform.run(runnable);
- }
- }
- }
- if(rc.get())
- return profileInstance;
- return null;
- }
-
- public static boolean updateScannerConfiguration(IProject project,
- IScannerConfigBuilderInfo2 buildInfo,
- final IProgressMonitor monitor) {
- return updateScannerConfiguration(project, null, null, buildInfo, monitor);
- }
-
- /**
- * Update and persist scanner configuration
- */
- public static boolean updateScannerConfiguration(IProject project,
- CfgInfoContext context,
- SCProfileInstance profileInstance,
- IScannerConfigBuilderInfo2 buildInfo,
- final IProgressMonitor monitor) {
- final RC rc = new RC(false);
- // get the collector
-// if(context == null)
-// context = ScannerConfigUtil.createContextForProject(project);
-
- if(profileInstance == null){
- profileInstance = ScannerConfigProfileManager.getInstance().
- getSCProfileInstance(project, context.toInfoContext(), buildInfo.getSelectedProfileId());
- }
- IScannerInfoCollector collector = profileInstance.getScannerInfoCollector();
- if (collector instanceof IScannerInfoCollector2) {
- final IScannerInfoCollector2 collector2 = (IScannerInfoCollector2) collector;
- ISafeRunnable runnable = new ISafeRunnable() {
-
- @Override
+ rc.set(false);
+ ManagedBuilderCorePlugin.log(exception);
+ }
+
+ };
+ Platform.run(runnable);
+ }
+ }
+ }
+ if (rc.get())
+ return profileInstance;
+ return null;
+ }
+
+ public static boolean updateScannerConfiguration(IProject project, IScannerConfigBuilderInfo2 buildInfo,
+ final IProgressMonitor monitor) {
+ return updateScannerConfiguration(project, null, null, buildInfo, monitor);
+ }
+
+ /**
+ * Update and persist scanner configuration
+ */
+ public static boolean updateScannerConfiguration(IProject project, CfgInfoContext context,
+ SCProfileInstance profileInstance, IScannerConfigBuilderInfo2 buildInfo, final IProgressMonitor monitor) {
+ final RC rc = new RC(false);
+ // get the collector
+ // if(context == null)
+ // context = ScannerConfigUtil.createContextForProject(project);
+
+ if (profileInstance == null) {
+ profileInstance = ScannerConfigProfileManager.getInstance().getSCProfileInstance(project,
+ context.toInfoContext(), buildInfo.getSelectedProfileId());
+ }
+ IScannerInfoCollector collector = profileInstance.getScannerInfoCollector();
+ if (collector instanceof IScannerInfoCollector2) {
+ final IScannerInfoCollector2 collector2 = (IScannerInfoCollector2) collector;
+ ISafeRunnable runnable = new ISafeRunnable() {
+
+ @Override
public void run() throws Exception {
- collector2.updateScannerConfiguration(monitor);
- rc.set(true);
- }
+ collector2.updateScannerConfiguration(monitor);
+ rc.set(true);
+ }
- @Override
+ @Override
public void handleException(Throwable exception) {
- rc.set(false);
- ManagedBuilderCorePlugin.log(exception);
- }
-
- };
- Platform.run(runnable);
- }
-
- return rc.get();
- }
-
- public static SCProfileInstance readBuildOutputFile(final IProject project,
- final CfgInfoContext context,
- final IScannerConfigBuilderInfo2 buildInfo,
- final Properties env,
- final IProgressMonitor monitor) {
- final RC rc = new RC(false);
- // get the collector
- SCProfileInstance profileInstance = ScannerConfigProfileManager.getInstance().
- getSCProfileInstance(project, context.toInfoContext(), buildInfo.getSelectedProfileId());
- final IScannerInfoCollector collector = profileInstance.getScannerInfoCollector();
- final IExternalScannerInfoProvider esiProvider = profileInstance.
- createBuildOutputProvider();
-
- if (buildInfo.isBuildOutputFileActionEnabled()) {
- ISafeRunnable runnable = new ISafeRunnable() {
-
- @Override
+ rc.set(false);
+ ManagedBuilderCorePlugin.log(exception);
+ }
+
+ };
+ Platform.run(runnable);
+ }
+
+ return rc.get();
+ }
+
+ public static SCProfileInstance readBuildOutputFile(final IProject project, final CfgInfoContext context,
+ final IScannerConfigBuilderInfo2 buildInfo, final Properties env, final IProgressMonitor monitor) {
+ final RC rc = new RC(false);
+ // get the collector
+ SCProfileInstance profileInstance = ScannerConfigProfileManager.getInstance().getSCProfileInstance(project,
+ context.toInfoContext(), buildInfo.getSelectedProfileId());
+ final IScannerInfoCollector collector = profileInstance.getScannerInfoCollector();
+ final IExternalScannerInfoProvider esiProvider = profileInstance.createBuildOutputProvider();
+
+ if (buildInfo.isBuildOutputFileActionEnabled()) {
+ ISafeRunnable runnable = new ISafeRunnable() {
+
+ @Override
public void run() {
- esiProvider.invokeProvider(monitor, project, context.toInfoContext(), null, buildInfo, collector, env);
- rc.set(true);
- }
+ esiProvider.invokeProvider(monitor, project, context.toInfoContext(), null, buildInfo, collector,
+ env);
+ rc.set(true);
+ }
- @Override
+ @Override
public void handleException(Throwable exception) {
- rc.set(false);
- ManagedBuilderCorePlugin.log(exception);
- }
-
- };
- Platform.run(runnable);
- }
-
- if(rc.get())
- return profileInstance;
- return null;
-
- }
-
- /**
- * @param project
- * @param buildInfo
- * @param monitor
- * @return
- */
- /*uncomment
- public static boolean readBuildOutputFile(final IProject project,
- final IScannerConfigBuilderInfo2 buildInfo,
- final IProgressMonitor monitor) {
- return readBuildOutputFile(project, null, buildInfo, monitor);
- }
- */
+ rc.set(false);
+ ManagedBuilderCorePlugin.log(exception);
+ }
+
+ };
+ Platform.run(runnable);
+ }
+
+ if (rc.get())
+ return profileInstance;
+ return null;
+
+ }
+
+ /**
+ * @param project
+ * @param buildInfo
+ * @param monitor
+ * @return
+ */
+ /*uncomment
+ public static boolean readBuildOutputFile(final IProject project,
+ final IScannerConfigBuilderInfo2 buildInfo,
+ final IProgressMonitor monitor) {
+ return readBuildOutputFile(project, null, buildInfo, monitor);
+ }
+ */
}
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 e6cd1b58e11..15adfbb3530 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
@@ -45,29 +45,31 @@ import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.QualifiedName;
public class CfgScannerConfigInfoFactory2 {
- private static final QualifiedName CONTAINER_INFO_PROPERTY = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), "ScannerConfigBuilderInfo2Container"); //$NON-NLS-1$
+ private static final QualifiedName CONTAINER_INFO_PROPERTY = new QualifiedName(
+ ManagedBuilderCorePlugin.getUniqueIdentifier(), "ScannerConfigBuilderInfo2Container"); //$NON-NLS-1$
- private static class ContainerInfo{
+ private static class ContainerInfo {
int fCode;
IScannerConfigBuilderInfo2Set fContainer;
- ContainerInfo(ICProjectDescription des, IScannerConfigBuilderInfo2Set container){
+ ContainerInfo(ICProjectDescription des, IScannerConfigBuilderInfo2Set container) {
this.fCode = des.hashCode();
this.fContainer = container;
}
- public boolean matches(ICProjectDescription des){
+ public boolean matches(ICProjectDescription des) {
return des.hashCode() == fCode;
}
}
+
private static class CfgInfo implements ICfgScannerConfigBuilderInfo2Set {
private Configuration cfg;
private SoftReference<IScannerConfigBuilderInfo2Set> fContainer;
-// private HashMap map;
+ // private HashMap map;
- CfgInfo(Configuration cfg){
+ CfgInfo(Configuration cfg) {
this.cfg = cfg;
-// init();
+ // init();
}
@Override
@@ -79,20 +81,20 @@ public class CfgScannerConfigInfoFactory2 {
@Override
public IScannerConfigBuilderInfo2 getInfo(CfgInfoContext context) {
return createMap().get(context);
-// IScannerConfigBuilderInfo2 info = null;
-// if(!isPerRcTypeDiscovery()){
-// info = cfg.getScannerConfigInfo();
-// if(info == null){
-// info = ScannerConfigInfoFactory2.create(cfg, ManagedBuilderCorePlugin.getDefault().getPluginPreferences());
-// }
-// } else {
-// Tool tool = (Tool)context.getTool();
-// if(tool != null)
-// info = tool.getScannerConfigInfo(context.getInputType());
-//// else
-//// info = getDefaultInfo();
-// }
-// return info;
+ // IScannerConfigBuilderInfo2 info = null;
+ // if(!isPerRcTypeDiscovery()){
+ // info = cfg.getScannerConfigInfo();
+ // if(info == null){
+ // info = ScannerConfigInfoFactory2.create(cfg, ManagedBuilderCorePlugin.getDefault().getPluginPreferences());
+ // }
+ // } else {
+ // Tool tool = (Tool)context.getTool();
+ // if(tool != null)
+ // info = tool.getScannerConfigInfo(context.getInputType());
+ //// else
+ //// info = getDefaultInfo();
+ // }
+ // return info;
}
@Override
@@ -100,27 +102,29 @@ public class CfgScannerConfigInfoFactory2 {
return cfg.isPerRcTypeDiscovery();
}
- private IScannerConfigBuilderInfo2Set getContainer() throws CoreException{
+ private IScannerConfigBuilderInfo2Set getContainer() throws CoreException {
IScannerConfigBuilderInfo2Set container = fContainer != null ? fContainer.get() : null;
- if(container == null){
- if(!cfg.isPreference()){
+ if (container == null) {
+ if (!cfg.isPreference()) {
ICConfigurationDescription cfgDes = ManagedBuildManager.getDescriptionForConfiguration(cfg);
- if(cfgDes != null){
+ if (cfgDes != null) {
ICProjectDescription projDes = cfgDes.getProjectDescription();
- if(projDes != null){
- ContainerInfo cInfo = (ContainerInfo)projDes.getSessionProperty(CONTAINER_INFO_PROPERTY);
- if(cInfo != null && cInfo.matches(projDes)){
+ if (projDes != null) {
+ ContainerInfo cInfo = (ContainerInfo) projDes.getSessionProperty(CONTAINER_INFO_PROPERTY);
+ if (cInfo != null && cInfo.matches(projDes)) {
container = cInfo.fContainer;
} else {
- container = ScannerConfigProfileManager.createScannerConfigBuildInfo2Set(cfg.getOwner().getProject());
+ container = ScannerConfigProfileManager
+ .createScannerConfigBuildInfo2Set(cfg.getOwner().getProject());
cInfo = new ContainerInfo(projDes, container);
projDes.setSessionProperty(CONTAINER_INFO_PROPERTY, cInfo);
}
}
}
- if(container == null){
- container = ScannerConfigProfileManager.createScannerConfigBuildInfo2Set(cfg.getOwner().getProject());
+ if (container == null) {
+ container = ScannerConfigProfileManager
+ .createScannerConfigBuildInfo2Set(cfg.getOwner().getProject());
}
} else {
Preferences prefs = MakeCorePlugin.getDefault().getPluginPreferences();
@@ -128,44 +132,44 @@ public class CfgScannerConfigInfoFactory2 {
}
}
- if(fContainer == null) {
+ if (fContainer == null) {
fContainer = new SoftReference<IScannerConfigBuilderInfo2Set>(container);
}
return container;
}
- private Map<CfgInfoContext, IScannerConfigBuilderInfo2> createMap(){
+ private Map<CfgInfoContext, IScannerConfigBuilderInfo2> createMap() {
HashMap<CfgInfoContext, IScannerConfigBuilderInfo2> map = new HashMap<CfgInfoContext, IScannerConfigBuilderInfo2>();
- try{
+ try {
IScannerConfigBuilderInfo2Set container = getContainer();
boolean isPerRcType = cfg.isPerRcTypeDiscovery();
Map<InfoContext, IScannerConfigBuilderInfo2> baseMap = container.getInfoMap();
- if(!isPerRcType){
+ if (!isPerRcType) {
// Discovery profile scope = configuration wide
CfgInfoContext c = new CfgInfoContext(cfg);
InfoContext baseContext = c.toInfoContext();
IScannerConfigBuilderInfo2 info = container.getInfo(baseContext);
- if(info == null){
+ if (info == null) {
String id = cfg.getDiscoveryProfileId();
- if(id == null)
+ if (id == null)
id = CfgScannerConfigUtil.getFirstProfileId(cfg.getFilteredTools());
IScannerConfigBuilderInfo2 prefInfo = null;
- if(!cfg.isPreference()){
+ if (!cfg.isPreference()) {
IConfiguration prefCfg = ManagedBuildManager.getPreferenceConfiguration(false);
ICfgScannerConfigBuilderInfo2Set prefContainer = create(prefCfg);
prefInfo = prefContainer.getInfo(new CfgInfoContext(prefCfg));
}
- if(prefInfo == null){
- if(id != null)
+ if (prefInfo == null) {
+ if (id != null)
info = container.createInfo(baseContext, id);
else
info = container.createInfo(baseContext);
} else {
- if(id != null)
+ if (id != null)
info = container.createInfo(baseContext, prefInfo, id);
else
info = container.createInfo(baseContext, prefInfo, prefInfo.getSelectedProfileId());
@@ -180,23 +184,25 @@ public class CfgScannerConfigInfoFactory2 {
IResourceInfo[] rcInfos = cfg.getResourceInfos();
for (IResourceInfo rcInfo : rcInfos) {
ITool tools[];
- if(rcInfo instanceof IFolderInfo) {
- tools = ((IFolderInfo)rcInfo).getFilteredTools();
+ if (rcInfo instanceof IFolderInfo) {
+ tools = ((IFolderInfo) rcInfo).getFilteredTools();
} else {
- tools = ((IFileInfo)rcInfo).getToolsToInvoke();
+ tools = ((IFileInfo) rcInfo).getToolsToInvoke();
}
for (ITool tool : tools) {
IInputType types[] = tool.getInputTypes();
- if(types.length != 0){
+ if (types.length != 0) {
for (IInputType inputType : types) {
CfgInfoContext context = new CfgInfoContext(rcInfo, tool, inputType);
context = CfgScannerConfigUtil.adjustPerRcTypeContext(context);
- if(context != null && context.getResourceInfo() != null){
+ if (context != null && context.getResourceInfo() != null) {
IScannerConfigBuilderInfo2 info = configMap.get(context);
- if(info == null && !inputType.isExtensionElement() && inputType.getSuperClass() != null){
- CfgInfoContext superContext = new CfgInfoContext(rcInfo, tool, inputType.getSuperClass());
+ if (info == null && !inputType.isExtensionElement()
+ && inputType.getSuperClass() != null) {
+ CfgInfoContext superContext = new CfgInfoContext(rcInfo, tool,
+ inputType.getSuperClass());
superContext = CfgScannerConfigUtil.adjustPerRcTypeContext(superContext);
- if(superContext != null && superContext.getResourceInfo() != null){
+ if (superContext != null && superContext.getResourceInfo() != null) {
info = configMap.get(superContext);
}
@@ -208,32 +214,37 @@ public class CfgScannerConfigInfoFactory2 {
// 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()) {
+ for (Entry<CfgInfoContext, IScannerConfigBuilderInfo2> entry : configMap
+ .entrySet()) {
CfgInfoContext cfgInfoCxt = entry.getKey();
- if (match(cfgInfoCxt.getInputType(), context.getInputType()) &&
- match(cfgInfoCxt.getTool(), context.getTool().getSuperClass()) &&
- cfgInfoCxt.getConfiguration().equals(context.getConfiguration())) {
+ if (match(cfgInfoCxt.getInputType(), context.getInputType())
+ && match(cfgInfoCxt.getTool(),
+ context.getTool().getSuperClass())
+ && cfgInfoCxt.getConfiguration()
+ .equals(context.getConfiguration())) {
id = entry.getValue().getSelectedProfileId();
}
}
if (id == null) {
// Language Settings Providers are meant to replace legacy scanner discovery
// so do not try to find default profile
- ICConfigurationDescription cfgDescription = ManagedBuildManager.getDescriptionForConfiguration(cfg);
- if (ScannerDiscoveryLegacySupport.isLegacyScannerDiscoveryOn(cfgDescription)) {
+ ICConfigurationDescription cfgDescription = ManagedBuildManager
+ .getDescriptionForConfiguration(cfg);
+ if (ScannerDiscoveryLegacySupport
+ .isLegacyScannerDiscoveryOn(cfgDescription)) {
id = CfgScannerConfigUtil.getDefaultProfileId(context, true);
}
}
InfoContext baseContext = context.toInfoContext();
- if(info == null){
- if(id != null){
+ if (info == null) {
+ if (id != null) {
info = container.createInfo(baseContext, id);
} else {
info = container.createInfo(baseContext);
}
} else {
- if(id != null){
+ if (id != null) {
info = container.createInfo(baseContext, info, id);
} else {
info = container.createInfo(baseContext, info);
@@ -252,28 +263,28 @@ public class CfgScannerConfigInfoFactory2 {
container.removeInfo(context.toInfoContext());
}
}
- if(info != null){
+ if (info != null) {
map.put(context, info);
}
}
}
} else {
- if(cfg.isPreference())
+ if (cfg.isPreference())
continue;
CfgInfoContext context = new CfgInfoContext(rcInfo, tool, null);
context = CfgScannerConfigUtil.adjustPerRcTypeContext(context);
- if(context != null && context.getResourceInfo() != null){
+ if (context != null && context.getResourceInfo() != null) {
IScannerConfigBuilderInfo2 info = configMap.get(context);
- if(info == null){
+ if (info == null) {
String id = CfgScannerConfigUtil.getDefaultProfileId(context, true);
InfoContext baseContext = context.toInfoContext();
- if(id != null){
+ if (id != null) {
info = container.createInfo(baseContext, id);
} else {
info = container.createInfo(baseContext);
}
}
- if(info != null){
+ if (info != null) {
map.put(context, info);
}
}
@@ -281,33 +292,34 @@ public class CfgScannerConfigInfoFactory2 {
}
}
- if(!configMap.isEmpty()){
+ if (!configMap.isEmpty()) {
for (Entry<CfgInfoContext, IScannerConfigBuilderInfo2> entry : configMap.entrySet()) {
- if(map.containsKey(entry.getKey()))
+ if (map.containsKey(entry.getKey()))
continue;
CfgInfoContext c = entry.getKey();
- if(c.getResourceInfo() != null || c.getTool() != null || c.getInputType() != null){
+ if (c.getResourceInfo() != null || c.getTool() != null || c.getInputType() != null) {
InfoContext baseC = c.toInfoContext();
- if(!baseC.isDefaultContext())
+ if (!baseC.isDefaultContext())
container.removeInfo(baseC);
}
}
}
}
- } catch (CoreException e){
+ } catch (CoreException e) {
ManagedBuilderCorePlugin.log(e);
}
return map;
}
- private Map<CfgInfoContext, IScannerConfigBuilderInfo2> getConfigInfoMap(Map<InfoContext, IScannerConfigBuilderInfo2> baseMap){
+ 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);
- if(c != null){
+ if (c != null) {
IScannerConfigBuilderInfo2 info = entry.getValue();
map.put(c, info);
}
@@ -317,7 +329,7 @@ public class CfgScannerConfigInfoFactory2 {
}
@Override
- public Map<CfgInfoContext,IScannerConfigBuilderInfo2> getInfoMap() {
+ public Map<CfgInfoContext, IScannerConfigBuilderInfo2> getInfoMap() {
return createMap();
}
@@ -327,16 +339,15 @@ public class CfgScannerConfigInfoFactory2 {
}
@Override
- public IScannerConfigBuilderInfo2 applyInfo(CfgInfoContext context,
- IScannerConfigBuilderInfo2 base) {
+ public IScannerConfigBuilderInfo2 applyInfo(CfgInfoContext context, IScannerConfigBuilderInfo2 base) {
try {
IScannerConfigBuilderInfo2 newInfo;
IScannerConfigBuilderInfo2Set container = getContainer();
InfoContext baseContext = context.toInfoContext();
- if(base != null){
+ if (base != null) {
newInfo = container.createInfo(baseContext, base);
} else {
- if(!baseContext.isDefaultContext())
+ if (!baseContext.isDefaultContext())
container.removeInfo(baseContext);
newInfo = getInfo(context);
}
@@ -354,35 +365,35 @@ public class CfgScannerConfigInfoFactory2 {
}
@Override
- public boolean isProfileSupported(CfgInfoContext context,
- String profileId) {
- if(!isPerRcTypeDiscovery())
+ public boolean isProfileSupported(CfgInfoContext context, String profileId) {
+ if (!isPerRcTypeDiscovery())
return true;
return CfgScannerConfigProfileManager.isPerFileProfile(profileId);
}
}
- public static ICfgScannerConfigBuilderInfo2Set create(IConfiguration cfg){
- Configuration c = (Configuration)cfg;
+ public static ICfgScannerConfigBuilderInfo2Set create(IConfiguration cfg) {
+ Configuration c = (Configuration) cfg;
ICfgScannerConfigBuilderInfo2Set container = c.getCfgScannerConfigInfo();
- if(container == null){
+ if (container == null) {
container = new CfgInfo(c);
c.setCfgScannerConfigInfo(container);
}
return container;
}
- public static void save(BuildConfigurationData data, ICProjectDescription des, ICProjectDescription baseDescription, boolean force) throws CoreException{
- ContainerInfo info = (ContainerInfo)des.getSessionProperty(CONTAINER_INFO_PROPERTY);
- if(info != null){
- if(info.matches(baseDescription)){
+ public static void save(BuildConfigurationData data, ICProjectDescription des, ICProjectDescription baseDescription,
+ boolean force) throws CoreException {
+ ContainerInfo info = (ContainerInfo) des.getSessionProperty(CONTAINER_INFO_PROPERTY);
+ if (info != null) {
+ if (info.matches(baseDescription)) {
IScannerConfigBuilderInfo2Set baseContainer = info.fContainer;
baseContainer.save();
}
des.setSessionProperty(CONTAINER_INFO_PROPERTY, null);
- } else if (force){
- Configuration cfg = (Configuration)data.getConfiguration();
+ } else if (force) {
+ Configuration cfg = (Configuration) data.getConfiguration();
CfgInfo cfgInfo = new CfgInfo(cfg);
cfg.setCfgScannerConfigInfo(cfgInfo);
cfgInfo.getInfoMap();
@@ -391,17 +402,17 @@ public class CfgScannerConfigInfoFactory2 {
}
}
- public static void savePreference(IConfiguration cfg) throws CoreException{
- ICfgScannerConfigBuilderInfo2Set container = ((Configuration)cfg).getCfgScannerConfigInfo();
- if(container != null){
- IScannerConfigBuilderInfo2Set baseContainer = ((CfgInfo)container).getContainer();
- if(baseContainer != null){
+ public static void savePreference(IConfiguration cfg) throws CoreException {
+ ICfgScannerConfigBuilderInfo2Set container = ((Configuration) cfg).getCfgScannerConfigInfo();
+ if (container != null) {
+ IScannerConfigBuilderInfo2Set baseContainer = ((CfgInfo) container).getContainer();
+ if (baseContainer != null) {
baseContainer.save();
}
}
}
- private static boolean match(ITool t1, ITool t2){
+ private static boolean match(ITool t1, ITool t2) {
if (t1 == null || t2 == null)
return false;
if (t1.getId().equals(t2.getId())) {
@@ -411,7 +422,7 @@ public class CfgScannerConfigInfoFactory2 {
return match(t1.getSuperClass(), t2.getSuperClass());
}
- private static boolean match(IInputType i1, IInputType i2){
+ private static boolean match(IInputType i1, IInputType i2) {
if (i1 == null || i2 == null)
return false;
if (i1.getId().equals(i2.getId())) {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig2/CfgScannerConfigProfileManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig2/CfgScannerConfigProfileManager.java
index dcbff40a72a..3b0d567d1dd 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig2/CfgScannerConfigProfileManager.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig2/CfgScannerConfigProfileManager.java
@@ -25,25 +25,25 @@ import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.core.resources.IProject;
public class CfgScannerConfigProfileManager {
-
- public static ICfgScannerConfigBuilderInfo2Set getCfgScannerConfigBuildInfo(IConfiguration cfg){
+
+ public static ICfgScannerConfigBuilderInfo2Set getCfgScannerConfigBuildInfo(IConfiguration cfg) {
return CfgScannerConfigInfoFactory2.create(cfg);
}
-
- public static boolean isPerFileProfile(String profileId){
+
+ public static boolean isPerFileProfile(String profileId) {
ScannerConfigProfile profile = ScannerConfigProfileManager.getInstance().getSCProfileConfiguration(profileId);
ScannerConfigScope scope = profile.getProfileScope();
- return scope!=null && scope.equals(ScannerConfigScope.FILE_SCOPE);
+ return scope != null && scope.equals(ScannerConfigScope.FILE_SCOPE);
}
-
- public static InfoContext createDefaultContext(IProject project){
+
+ public static InfoContext createDefaultContext(IProject project) {
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
IConfiguration cfg = null;
- if(info != null && info.isValid()){
+ if (info != null && info.isValid()) {
cfg = info.getDefaultConfiguration();
}
-
- if(cfg != null)
+
+ if (cfg != null)
return new CfgInfoContext(cfg).toInfoContext();
return new InfoContext(project);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/BuildDescriptionManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/BuildDescriptionManager.java
index d3b27a13653..3468c7ded31 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/BuildDescriptionManager.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/BuildDescriptionManager.java
@@ -36,10 +36,10 @@ import org.eclipse.core.runtime.Path;
/**
*
* This class represents the build description manager
- * The build description manager is the entry point
+ * The build description manager is the entry point
* for all build description-related operations
*
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
@@ -48,12 +48,12 @@ public class BuildDescriptionManager {
* include information on removed resources into the build model
*/
public static final int REMOVED = 1;
-
+
/**
* include the rebuild state information into the build model
*/
public static final int REBUILD = 1 << 1;
-
+
/**
* include dependencies information into the build model.
* the method to be used for calculation is determined by the manager
@@ -64,16 +64,16 @@ public class BuildDescriptionManager {
* include the dependency file (.d) information in the build model.
*/
public static final int DEPFILES = 1 << 3;
-
+
private Set<IBuildStep> fVisitedSteps = new HashSet<IBuildStep>();
private boolean fUp;
private IBuildDescription fInfo;
- private BuildDescriptionManager(boolean up, IBuildDescription info){
+ private BuildDescriptionManager(boolean up, IBuildDescription info) {
fUp = up;
fInfo = info;
}
-
+
/**
* creates the build description
* @param cfg the build configuration for which the description is to be
@@ -82,238 +82,232 @@ public class BuildDescriptionManager {
* @param flags specifies how the build description should be generated
* and what information it should contain.
* Can contain the following flags:
- * BuildDescriptionManager.REBUILD,
+ * BuildDescriptionManager.REBUILD,
* BuildDescriptionManager.REMOVED,
* BuildDescriptionManager.DEPS,
- * BuildDescriptionManager.DEPFILES
- *
- * @see BuildDescriptionManager#REBUILD
+ * BuildDescriptionManager.DEPFILES
+ *
+ * @see BuildDescriptionManager#REBUILD
* @see BuildDescriptionManager#REMOVED
* @see BuildDescriptionManager#DEPS
* @see BuildDescriptionManager#DEPFILES
* @return IBuildDescription
* @throws CoreException if the build description creation fails
*/
- static public IBuildDescription createBuildDescription(IConfiguration cfg,
- IResourceDelta delta,
- int flags) throws CoreException {
+ static public IBuildDescription createBuildDescription(IConfiguration cfg, IResourceDelta delta, int flags)
+ throws CoreException {
return DefaultBuildDescriptionFactory.getInstance().createBuildDescription(cfg, delta, flags);
}
/**
* @noreference This method is not intended to be referenced by clients.
*/
- static public IBuildDescription createBuildDescription(IConfiguration cfg,
- IConfigurationBuildState bs,
- IResourceDelta delta,
- int flags) throws CoreException {
+ static public IBuildDescription createBuildDescription(IConfiguration cfg, IConfigurationBuildState bs,
+ IResourceDelta delta, int flags) throws CoreException {
return DefaultBuildDescriptionFactory.getInstance().createBuildDescription(cfg, bs, delta, flags);
}
-
+
/**
* runs though all steps in build description in the dependency order
* and notifies the visitor callback
* the order in which steps are enumerated depends on the "up" argument
- *
+ *
* @param visitor represents the visitor callback
* @param des represents the build description
* @param up specifies the order in which build steps are to be enumerated
- * if true, enumeration will be performed starting from the input step and
- * ending with the output state. Otherwise enumeration will be performed
- * in the reversed order
- *
+ * if true, enumeration will be performed starting from the input step and
+ * ending with the output state. Otherwise enumeration will be performed
+ * in the reversed order
+ *
* @throws CoreException if the operation fails
*/
static public void accept(IStepVisitor visitor, IBuildDescription des, boolean up) throws CoreException {
BuildDescriptionManager util = new BuildDescriptionManager(up, des);
-
+
util.doAccept(visitor);
}
-
- private void doAccept(IStepVisitor visitor) throws CoreException{
+
+ private void doAccept(IStepVisitor visitor) throws CoreException {
IBuildStep action = fUp ? fInfo.getInputStep() : fInfo.getOutputStep();
doAccept(visitor, action, true);
}
- private boolean doAccept(IStepVisitor visitor, IBuildStep action, boolean doNext) throws CoreException{
+ private boolean doAccept(IStepVisitor visitor, IBuildStep action, boolean doNext) throws CoreException {
IBuildStep[] actions = getSteps(action, fUp);
boolean proceed = true;
-
- for(int i = 0; i < actions.length; i++){
- if(!fVisitedSteps.contains(actions[i])){
- if(!doAccept(visitor, actions[i], false)){
+
+ for (int i = 0; i < actions.length; i++) {
+ if (!fVisitedSteps.contains(actions[i])) {
+ if (!doAccept(visitor, actions[i], false)) {
proceed = false;
break;
}
}
}
-
- if(proceed && !fVisitedSteps.contains(action)){
+
+ if (proceed && !fVisitedSteps.contains(action)) {
proceed = visitor.visit(action) == IStepVisitor.VISIT_CONTINUE;
fVisitedSteps.add(action);
}
-
- if(doNext && proceed){
+
+ if (doNext && proceed) {
IBuildStep[] nextActions = getSteps(action, !fUp);
- for(int i = 0; i < nextActions.length; i++){
- if(!fVisitedSteps.contains(nextActions[i])){
- if(!doAccept(visitor, nextActions[i], true)){
+ for (int i = 0; i < nextActions.length; i++) {
+ if (!fVisitedSteps.contains(nextActions[i])) {
+ if (!doAccept(visitor, nextActions[i], true)) {
proceed = false;
break;
}
}
}
}
-
+
return proceed;
}
- public static IBuildStep[] getSteps(IBuildStep step, boolean input){
+ public static IBuildStep[] getSteps(IBuildStep step, boolean input) {
Set<IBuildStep> set = new HashSet<IBuildStep>();
-
- IBuildIOType args[] = input ?
- step.getInputIOTypes() :
- step.getOutputIOTypes();
-
- for(int i = 0; i < args.length; i++){
+
+ IBuildIOType args[] = input ? step.getInputIOTypes() : step.getOutputIOTypes();
+
+ for (int i = 0; i < args.length; i++) {
IBuildResource rcs[] = args[i].getResources();
- for(int j = 0; j < rcs.length; j++){
- if(input){
+ for (int j = 0; j < rcs.length; j++) {
+ if (input) {
IBuildIOType arg = rcs[j].getProducerIOType();
- if(arg != null && arg.getStep() != null)
+ if (arg != null && arg.getStep() != null)
set.add(arg.getStep());
} else {
IBuildIOType depArgs[] = rcs[j].getDependentIOTypes();
- for(int k = 0; k < depArgs.length; k++){
+ for (int k = 0; k < depArgs.length; k++) {
IBuildIOType arg = depArgs[k];
- if(arg != null && arg.getStep() != null)
+ if (arg != null && arg.getStep() != null)
set.add(arg.getStep());
}
}
}
}
-
+
return set.toArray(new IBuildStep[set.size()]);
}
- public static IBuildResource[] filterGeneratedBuildResources(IBuildResource rc[], int rcState){
+ public static IBuildResource[] filterGeneratedBuildResources(IBuildResource rc[], int rcState) {
List<IBuildResource> list = new ArrayList<IBuildResource>();
-
+
addBuildResources(rc, list, rcState);
return list.toArray(new IBuildResource[list.size()]);
}
- private static void addBuildResources(IBuildResource rcs[], List<IBuildResource> list, int rcState){
- if(rcs.length == 0)
+ private static void addBuildResources(IBuildResource rcs[], List<IBuildResource> list, int rcState) {
+ if (rcs.length == 0)
return;
IBuildStep inputAction = rcs[0].getBuildDescription().getInputStep();
- if(DbgUtil.DEBUG)
- DbgUtil.trace(">>found resources to clean:"); //$NON-NLS-1$
+ if (DbgUtil.DEBUG)
+ DbgUtil.trace(">>found resources to clean:"); //$NON-NLS-1$
- for(int i = 0; i < rcs.length; i++){
+ for (int i = 0; i < rcs.length; i++) {
IBuildResource buildRc = rcs[i];
IPath path = buildRc.getFullPath();
- if(path != null
+ if (path != null
&& ((checkFlags(rcState, REBUILD) && buildRc.needsRebuild())
|| (checkFlags(rcState, REMOVED) && buildRc.isRemoved()))
- && buildRc.getProducerIOType() != null
- && buildRc.getProducerIOType().getStep() != inputAction
- && buildRc.isProjectResource()){
+ && buildRc.getProducerIOType() != null && buildRc.getProducerIOType().getStep() != inputAction
+ && buildRc.isProjectResource()) {
- if(DbgUtil.DEBUG)
+ if (DbgUtil.DEBUG)
DbgUtil.trace(path.toString());
list.add(buildRc);
}
}
- if(DbgUtil.DEBUG)
- DbgUtil.trace("<<"); //$NON-NLS-1$
+ if (DbgUtil.DEBUG)
+ DbgUtil.trace("<<"); //$NON-NLS-1$
}
-
- private static boolean checkFlags(int var, int flags){
+
+ private static boolean checkFlags(int var, int flags) {
return (var & flags) == flags;
}
/**
* returns the project resource for the given build resource or null
* if the project does not contain the build resource
- *
+ *
* @param bRc build resource
* @return IResource
*/
- public static IResource findResourceForBuildResource(IBuildResource bRc){
+ public static IResource findResourceForBuildResource(IBuildResource bRc) {
IPath path = bRc.getFullPath();
- if(path != null){
+ if (path != null) {
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
return root.findMember(path);
}
-
+
return null;
}
-
+
/**
* cleans the resources to be rebuilt
- *
+ *
* @param des build description
*/
- public static void cleanGeneratedRebuildResources(IBuildDescription des) throws CoreException{
+ public static void cleanGeneratedRebuildResources(IBuildDescription des) throws CoreException {
IBuildResource bRcs[] = filterGeneratedBuildResources(des.getResources(), REMOVED | REBUILD);
List<Object[]> failList = new ArrayList<Object[]>();
-
- for(int i = 0; i < bRcs.length; i++){
- if(!bRcs[i].isProjectResource())
+
+ for (int i = 0; i < bRcs.length; i++) {
+ if (!bRcs[i].isProjectResource())
continue;
-
+
IResource rc = findResourceForBuildResource(bRcs[i]);
- if(rc != null){
+ if (rc != null) {
try {
rc.delete(true, null);
} catch (CoreException e) {
- failList.add(new Object[]{rc,e});
+ failList.add(new Object[] { rc, e });
}
}
}
-
- if(failList.size() != 0){
- BuildMultiStatus status = new BuildMultiStatus("failed to remove resources", null); //$NON-NLS-1$
- for(Iterator<Object[]> iter = failList.iterator(); iter.hasNext();){
+
+ if (failList.size() != 0) {
+ BuildMultiStatus status = new BuildMultiStatus("failed to remove resources", null); //$NON-NLS-1$
+ for (Iterator<Object[]> iter = failList.iterator(); iter.hasNext();) {
Object[] err = iter.next();
- IResource rc = (IResource)err[0];
- CoreException e = (CoreException)err[1];
+ IResource rc = (IResource) err[0];
+ CoreException e = (CoreException) err[1];
status.add(new BuildStatus(rc.getFullPath().toString(), e));
}
throw new CoreException(status);
}
}
-
- public static IPath getRelPath(IPath cwd, IPath location){
- if(!location.isAbsolute())
+
+ public static IPath getRelPath(IPath cwd, IPath location) {
+ if (!location.isAbsolute())
return location;
-
-// IPath path = null;
+
+ // IPath path = null;
IPath tmp = cwd;
StringBuilder buf = null;
- while(tmp.segmentCount() != 0){
- if(tmp.isPrefixOf(location)){
+ while (tmp.segmentCount() != 0) {
+ if (tmp.isPrefixOf(location)) {
IPath p = location.removeFirstSegments(tmp.segmentCount()).setDevice(null);
- if(buf == null)
+ if (buf == null)
return p;
buf.append(p.makeRelative().toString());
return new Path(buf.toString());
}
- if(buf == null){
+ if (buf == null) {
buf = new StringBuilder();
- buf.append("../"); //$NON-NLS-1$
+ buf.append("../"); //$NON-NLS-1$
} else {
- buf.append("../"); //$NON-NLS-1$
+ buf.append("../"); //$NON-NLS-1$
}
tmp = tmp.removeLastSegments(1);
}
-
+
return location;
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildCommand.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildCommand.java
index 1f5877c60c5..3af6437254b 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildCommand.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildCommand.java
@@ -25,33 +25,33 @@ import org.eclipse.core.runtime.IPath;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IBuildCommand {
-
+
/**
* returns the executable path
* the paths could be either relative or absolute
- *
+ *
* @return IPath
*/
IPath getCommand();
-
+
/**
* Returns the array of arguments to be passed to the executable
- *
+ *
* @return String[]
*/
String[] getArgs();
-
+
/**
* Returns the Map representing the environment to be used for the executable process
* The map contains the String to String pairs representing the variable name and value respectively
- *
+ *
* @return Map
*/
Map<String, String> getEnvironment();
-
+
/**
* Returns the working directory to be used for the process
- *
+ *
* @return IPath
*/
IPath getCWD();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildDescription.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildDescription.java
index 0448d6986c2..026860e5b1b 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildDescription.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildDescription.java
@@ -28,56 +28,56 @@ import org.eclipse.core.runtime.IPath;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IBuildDescription {
-
+
/**
* Returns the main input step
- *
+ *
* @return IBuildStep
*/
IBuildStep getInputStep();
-
+
/**
* Returns the main output step
- *
+ *
* @return IBuildStep
*/
IBuildStep getOutputStep();
/**
* Returns the Build resource for the given resource location
- *
+ *
* @return the IBuildResource or null if not found
*/
IBuildResource getBuildResource(IPath location);
/**
* Returns the Build resource for the given resource
- *
+ *
* @return the IBuildResource or null if not found
*/
IBuildResource getBuildResource(IResource resource);
/**
* Returns all resources used in the build
- *
+ *
* @return IBuildResource[]
*/
IBuildResource[] getResources();
-
+
/**
* Returns all build steps used in the build
- *
+ *
* @return IBuildResource[]
*/
IBuildStep[] getSteps();
-
+
/**
* Returns the build configuration this representation was created for
- *
+ *
* @return IProject
*/
IConfiguration getConfiguration();
-
+
/**
* Returns the default build directory location
* @return IPath
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildDescriptionFactory.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildDescriptionFactory.java
index 2b1cdf4277d..3c5dbfb6574 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildDescriptionFactory.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildDescriptionFactory.java
@@ -25,7 +25,7 @@ import org.eclipse.core.runtime.CoreException;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IBuildDescriptionFactory {
-
+
/**
* creates the build description
* @param cfg the build configuration for which the description is to be
@@ -34,32 +34,30 @@ public interface IBuildDescriptionFactory {
* @param flags specifies how the build description should be generated
* and what information it should contain.
* Can contain the following flags:
- * BuildDescriptionManager.REBUILD,
+ * BuildDescriptionManager.REBUILD,
* BuildDescriptionManager.REMOVED,
* BuildDescriptionManager.DEPS,
* BuildDescriptionManager.DEPFILES,
- *
- *
- * @see BuildDescriptionManager#REBUILD
+ *
+ *
+ * @see BuildDescriptionManager#REBUILD
* @see BuildDescriptionManager#REMOVED
* @see BuildDescriptionManager#DEPS
* @see BuildDescriptionManager#DEPFILES
* @return IBuildDescription
* @throws CoreException if the build description creation fails
*/
- IBuildDescription createBuildDescription(IConfiguration cfg,
- IResourceDelta delta,
- int flags) throws CoreException;
-
+ IBuildDescription createBuildDescription(IConfiguration cfg, IResourceDelta delta, int flags) throws CoreException;
+
/**
- *
+ *
* returns the supported methods of generation the build description
- *
- * @see BuildDescriptionManager#REBUILD
+ *
+ * @see BuildDescriptionManager#REBUILD
* @see BuildDescriptionManager#REMOVED
* @see BuildDescriptionManager#DEPS
* @see BuildDescriptionManager#DEPFILES
- *
+ *
* @return int
*/
int getSupportedMethods();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildIOType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildIOType.java
index 631ae900568..46d198d2618 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildIOType.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildIOType.java
@@ -17,29 +17,29 @@ package org.eclipse.cdt.managedbuilder.buildmodel;
*
* This interface is used to combine a set of build resources
* that are inputs or outputs for the given action
- * into one group
- *
+ * into one group
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IBuildIOType {
/**
* Specifies whether this argument is Step input or output
- *
+ *
* @return boolean
*/
boolean isInput();
-
+
/**
* Specifies a set of resources associated with this argument
- *
+ *
* @return IBuildResource[]
*/
IBuildResource[] getResources();
-
+
/**
* Specifies the build step this argument belongs to
- *
+ *
* @return IBuildStep
*/
IBuildStep getStep();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildResource.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildResource.java
index 4eeb9341630..6851f894434 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildResource.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildResource.java
@@ -27,61 +27,61 @@ import org.eclipse.core.runtime.IPath;
public interface IBuildResource {
/**
* Returns the absolute path to the resource as seen on the target machine.
- *
+ *
* @return IPath
*/
IPath getLocation();
-
+
/**
* In case the resource is a workspace resource,
* returns the full workspace path for the resource
* otherwise returns null
- *
+ *
* @return IPath
*/
IPath getFullPath();
-
+
/**
* Returns a URI that can be used by EFS to access the build resource.
- *
+ *
* @return URI
* @since 6.0
*/
URI getLocationURI();
-
+
/**
* Returns the output io type of the step
* that generates this resource.
* In case the resource is the project source,
* The returned output io type belongs to the main input step
- *
+ *
* @see IBuildDescription#getInputStep()
- *
+ *
* @return IBuildIOType
*/
IBuildIOType getProducerIOType();
-
+
/**
* Returns an array of io types where this resource is used as an input
- *
+ *
* @return IBuildIOType[]
*/
IBuildIOType[] getDependentIOTypes();
-
+
/**
* Returns the step that generates this resource.
* In case the resource is the project source,
* The main input step is returned
- *
+ *
* @see IBuildDescription#getInputStep()
- *
+ *
* @return IBuildIOType
*/
IBuildStep getProducerStep();
/**
* Returns an array of steps that use this resource as an input
- *
+ *
* @return IBuildIOType[]
*/
IBuildStep[] getDependentSteps();
@@ -90,39 +90,39 @@ public interface IBuildResource {
* Returns true if the resource needs rebuild
* this implies that all build steps dependent on this resource
* are to be invoked
- *
+ *
* @return boolean
*/
boolean needsRebuild();
-
+
/**
* Returns true if this resource belongs to the project
- *
+ *
* @return boolean
- *
+ *
*/
boolean isProjectResource();
-
+
/**
* Returns true if the resource was removed from the build
* Note: the removed state represents is BUILD state rather than
* a file system state.
- * If the build resouces is marked as removed that does not mean the
- * resource is removed in the file system
- * The removed state specifies that the resource is no longer used in the
- * build process.
+ * If the build resouces is marked as removed that does not mean the
+ * resource is removed in the file system
+ * The removed state specifies that the resource is no longer used in the
+ * build process.
* E.g. the object file could be marked as removed if the source file was deleted
* in the file system
* The removed state information is used primarily for calculation
* of the project part that is to be rebuild
- *
+ *
* @return boolean
*/
boolean isRemoved();
-
+
/**
* returns a build description that holds this step
- *
+ *
* @return IBuildDescription
*/
IBuildDescription getBuildDescription();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildStep.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildStep.java
index 941548894f4..513b3e9a062 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildStep.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildStep.java
@@ -17,7 +17,6 @@ import java.util.Map;
import org.eclipse.core.runtime.IPath;
-
/**
*
* This interface is used to represent the build action
@@ -29,55 +28,55 @@ public interface IBuildStep {
/**
* Returns an array of input types for this step
* @see IBuildIOType
- *
+ *
* @return IBuildIOType[]
*/
IBuildIOType[] getInputIOTypes();
-
+
/**
* Returns an array of output types for this step
* @see IBuildIOType
- *
+ *
* @return IBuildIOType[]
*/
IBuildIOType[] getOutputIOTypes();
/**
* Returns true if the step needs rebuild, false - otherwise
- *
+ *
* @return boolean
*/
boolean needsRebuild();
-
+
/**
* Returns the complete set of input resources for this step
- *
+ *
* @return IBuildResource[]
*/
IBuildResource[] getInputResources();
/**
* Returns the complete set of output resources for this step
- *
+ *
* @return IBuildResource[]
*/
IBuildResource[] getOutputResources();
-
+
/**
- * Returns true if the step is removed (due to removal
+ * Returns true if the step is removed (due to removal
* of the project resources that were ised in thie action)
- *
+ *
* @return boolean
*/
boolean isRemoved();
-
+
/**
* returns a build description that holds this step
- *
+ *
* @return IBuildDescription
*/
IBuildDescription getBuildDescription();
-
+
/**
* @return the set of commands used for building the step
* NOTE: This is a preliminary method
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IStepVisitor.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IStepVisitor.java
index 2c8f9ea4855..2daf35dc333 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IStepVisitor.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IStepVisitor.java
@@ -19,7 +19,7 @@ import org.eclipse.core.runtime.CoreException;
*
* This interface is used for the build description visitor mechanism
* to represent the visitor
- *
+ *
* @see BuildDescriptionManager#accept(IStepVisitor, IBuildDescription, boolean)
*
* @noextend This class is not intended to be subclassed by clients.
@@ -31,18 +31,18 @@ public interface IStepVisitor {
* to tell the visitor mechanism to continue step visiting process
*/
public static final int VISIT_CONTINUE = 1;
-
+
/**
* This constant can is returneed by the step visitor
* to tell the visitor mechanism to stop step visiting process
*/
public static final int VISIT_STOP = 2;
-
+
/**
* this call-back method is called by the build description
* visitor mechanism for each step in the build description
* The method should return one of the IStepVisitor.VISIT_xxx constants
- *
+ *
* @see IStepVisitor#VISIT_CONTINUE
* @see IStepVisitor#VISIT_STOP
* @see BuildDescriptionManager#accept(IStepVisitor, IBuildDescription, boolean)
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IBuildProperties.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IBuildProperties.java
index 378f6082ea1..d037f474437 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IBuildProperties.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IBuildProperties.java
@@ -21,22 +21,22 @@ import org.eclipse.core.runtime.CoreException;
*/
public interface IBuildProperties extends Cloneable {
IBuildProperty[] getProperties();
-
+
IBuildProperty getProperty(String id);
-
-// IBuildProperty addProperty(IBuildProperty property);
-
+
+ // IBuildProperty addProperty(IBuildProperty property);
+
IBuildProperty setProperty(String propertyId, String propertyValue) throws CoreException;
-// IBuildProperty addProperty(IBuildPropertyType type, String propertyValue) throws CoreException;
+ // IBuildProperty addProperty(IBuildPropertyType type, String propertyValue) throws CoreException;
IBuildProperty removeProperty(String id);
-
+
boolean containsValue(String propertyId, String valueId);
-
-// IBuildProperty removeProperty(IBuildPropertyType propertyType);
+
+ // IBuildProperty removeProperty(IBuildPropertyType propertyType);
void clear();
-
+
Object clone();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IBuildProperty.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IBuildProperty.java
index a00e4d016eb..3e69121155a 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IBuildProperty.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IBuildProperty.java
@@ -13,13 +13,12 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.buildproperties;
-
/**
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IBuildProperty {
IBuildPropertyType getPropertyType();
-
+
IBuildPropertyValue getValue();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IBuildPropertyManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IBuildPropertyManager.java
index 052b76e8f6f..7b38cc5f83b 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IBuildPropertyManager.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IBuildPropertyManager.java
@@ -19,6 +19,6 @@ package org.eclipse.cdt.managedbuilder.buildproperties;
*/
public interface IBuildPropertyManager {
IBuildPropertyType[] getPropertyTypes();
-
+
IBuildPropertyType getPropertyType(String id);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IBuildPropertyType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IBuildPropertyType.java
index 163e58ec2f4..dd2ea4318dc 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IBuildPropertyType.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IBuildPropertyType.java
@@ -13,14 +13,13 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.buildproperties;
-
/**
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IBuildPropertyType extends IPropertyBase {
IBuildPropertyValue[] getSupportedValues();
-
+
IBuildPropertyValue getSupportedValue(String id);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IBuildPropertyValue.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IBuildPropertyValue.java
index f4d0042d834..cd710b808c4 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IBuildPropertyValue.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IBuildPropertyValue.java
@@ -17,6 +17,6 @@ package org.eclipse.cdt.managedbuilder.buildproperties;
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
-public interface IBuildPropertyValue extends IPropertyBase{
+public interface IBuildPropertyValue extends IPropertyBase {
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IPropertyBase.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IPropertyBase.java
index 1f4c851a0ce..3f196b59d3b 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IPropertyBase.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildproperties/IPropertyBase.java
@@ -19,6 +19,6 @@ package org.eclipse.cdt.managedbuilder.buildproperties;
*/
public interface IPropertyBase {
String getId();
-
+
String getName();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/AbstractBuildRunner.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/AbstractBuildRunner.java
index 3ab5d23dc5b..4297ce4ff73 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/AbstractBuildRunner.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/AbstractBuildRunner.java
@@ -41,8 +41,8 @@ public abstract class AbstractBuildRunner {
* has not been called yet.
* @throws CoreException standard core exception if something goes wrong
*/
- public abstract boolean invokeBuild(int kind, IProject project, IConfiguration configuration,
- IBuilder builder, IConsole console, IMarkerGenerator markerGenerator,
- IncrementalProjectBuilder projectBuilder, IProgressMonitor monitor) throws CoreException;
+ public abstract boolean invokeBuild(int kind, IProject project, IConfiguration configuration, IBuilder builder,
+ IConsole console, IMarkerGenerator markerGenerator, IncrementalProjectBuilder projectBuilder,
+ IProgressMonitor monitor) throws CoreException;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/BuildListComparator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/BuildListComparator.java
index 8e0d0a34f3f..2b992120324 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/BuildListComparator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/BuildListComparator.java
@@ -20,56 +20,63 @@ import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyValue;
/**
* This class is intended to compare MBS-specific classes
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
*/
public class BuildListComparator extends CDTListComparator {
private static final String EMPTY = ""; //$NON-NLS-1$
-
+
private static Comparator<Object> comparator = null;
-
+
public static Comparator<Object> getInstance() {
if (comparator == null)
comparator = new BuildListComparator();
return comparator;
}
+
@Override
public int compare(Object a, Object b) {
- if (a == null || b == null)
+ if (a == null || b == null)
return 0;
if (a instanceof ITool) {
- ITool c1 = (ITool)a;
- ITool c2 = (ITool)b;
+ ITool c1 = (ITool) a;
+ ITool c2 = (ITool) b;
String s1 = c1.getName();
- if (s1 == null) s1 = EMPTY;
+ if (s1 == null)
+ s1 = EMPTY;
String s2 = c2.getName();
- if (s2 == null) s2 = EMPTY;
+ if (s2 == null)
+ s2 = EMPTY;
return s1.compareToIgnoreCase(s2);
}
if (a instanceof IToolChain) {
- IToolChain c1 = (IToolChain)a;
- IToolChain c2 = (IToolChain)b;
+ IToolChain c1 = (IToolChain) a;
+ IToolChain c2 = (IToolChain) b;
String s1 = c1.getUniqueRealName();
- if (s1 == null) s1 = EMPTY;
+ if (s1 == null)
+ s1 = EMPTY;
String s2 = c2.getUniqueRealName();
- if (s2 == null) s2 = EMPTY;
+ if (s2 == null)
+ s2 = EMPTY;
return s1.compareToIgnoreCase(s2);
}
if (a instanceof IBuilder) {
- IBuilder c1 = (IBuilder)a;
- IBuilder c2 = (IBuilder)b;
+ IBuilder c1 = (IBuilder) a;
+ IBuilder c2 = (IBuilder) b;
String s1 = c1.getUniqueRealName();
- if (s1 == null) s1 = EMPTY;
+ if (s1 == null)
+ s1 = EMPTY;
String s2 = c2.getUniqueRealName();
- if (s2 == null) s2 = EMPTY;
+ if (s2 == null)
+ s2 = EMPTY;
return s1.compareToIgnoreCase(s2);
}
if (a instanceof IBuildPropertyValue) {
- IBuildPropertyValue c1 = (IBuildPropertyValue)a;
- IBuildPropertyValue c2 = (IBuildPropertyValue)b;
+ IBuildPropertyValue c1 = (IBuildPropertyValue) a;
+ IBuildPropertyValue c2 = (IBuildPropertyValue) b;
return c1.getName().compareToIgnoreCase(c2.getName());
}
-
+
return super.compare(a, b);
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ExternalBuildRunner.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ExternalBuildRunner.java
index 4ad4c02a1ac..b9e4b9edd34 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ExternalBuildRunner.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ExternalBuildRunner.java
@@ -67,16 +67,16 @@ public class ExternalBuildRunner extends AbstractBuildRunner {
private static final int TICKS_REFRESH_PROJECT = 1 * PROGRESS_MONITOR_SCALE;
@Override
- public boolean invokeBuild(int kind, IProject project, IConfiguration configuration,
- IBuilder builder, IConsole console, IMarkerGenerator markerGenerator,
- IncrementalProjectBuilder projectBuilder, IProgressMonitor monitor) throws CoreException {
- return invokeExternalBuild(kind, project, configuration, builder, console,
- markerGenerator, projectBuilder, monitor);
+ public boolean invokeBuild(int kind, IProject project, IConfiguration configuration, IBuilder builder,
+ IConsole console, IMarkerGenerator markerGenerator, IncrementalProjectBuilder projectBuilder,
+ IProgressMonitor monitor) throws CoreException {
+ return invokeExternalBuild(kind, project, configuration, builder, console, markerGenerator, projectBuilder,
+ monitor);
}
- protected boolean invokeExternalBuild(int kind, IProject project, IConfiguration configuration,
- IBuilder builder, IConsole console, IMarkerGenerator markerGenerator,
- IncrementalProjectBuilder projectBuilder, IProgressMonitor monitor) throws CoreException {
+ protected boolean invokeExternalBuild(int kind, IProject project, IConfiguration configuration, IBuilder builder,
+ IConsole console, IMarkerGenerator markerGenerator, IncrementalProjectBuilder projectBuilder,
+ IProgressMonitor monitor) throws CoreException {
boolean isClean = false;
@@ -85,8 +85,10 @@ public class ExternalBuildRunner extends AbstractBuildRunner {
if (monitor == null) {
monitor = new NullProgressMonitor();
}
- monitor.beginTask(ManagedMakeMessages.getResourceString("MakeBuilder.Invoking_Make_Builder") + project.getName(), //$NON-NLS-1$
- TICKS_STREAM_PROGRESS_MONITOR + TICKS_DELETE_MARKERS + TICKS_EXECUTE_COMMAND + TICKS_REFRESH_PROJECT);
+ monitor.beginTask(
+ ManagedMakeMessages.getResourceString("MakeBuilder.Invoking_Make_Builder") + project.getName(), //$NON-NLS-1$
+ TICKS_STREAM_PROGRESS_MONITOR + TICKS_DELETE_MARKERS + TICKS_EXECUTE_COMMAND
+ + TICKS_REFRESH_PROJECT);
IPath buildCommand = builder.getBuildCommand();
if (buildCommand != null) {
@@ -109,28 +111,34 @@ public class ExternalBuildRunner extends AbstractBuildRunner {
String[] envp = BuildRunnerHelper.envMapToEnvp(envMap);
String[] errorParsers = builder.getErrorParsers();
- ErrorParserManager epm = new ErrorParserManager(project, workingDirectoryURI, markerGenerator, errorParsers);
+ ErrorParserManager epm = new ErrorParserManager(project, workingDirectoryURI, markerGenerator,
+ errorParsers);
List<IConsoleParser> parsers = new ArrayList<IConsoleParser>();
if (!isOnlyClean) {
- ICConfigurationDescription cfgDescription = ManagedBuildManager.getDescriptionForConfiguration(configuration);
+ ICConfigurationDescription cfgDescription = ManagedBuildManager
+ .getDescriptionForConfiguration(configuration);
ManagedBuildManager.collectLanguageSettingsConsoleParsers(cfgDescription, epm, parsers);
if (ScannerDiscoveryLegacySupport.isLegacyScannerDiscoveryOn(cfgDescription)) {
- collectScannerInfoConsoleParsers(project, configuration, workingDirectoryURI, markerGenerator, parsers);
+ collectScannerInfoConsoleParsers(project, configuration, workingDirectoryURI, markerGenerator,
+ parsers);
}
}
buildRunnerHelper.setLaunchParameters(launcher, buildCommand, args, workingDirectoryURI, envp);
- buildRunnerHelper.prepareStreams(epm, parsers, console, new SubProgressMonitor(monitor, TICKS_STREAM_PROGRESS_MONITOR));
+ buildRunnerHelper.prepareStreams(epm, parsers, console,
+ new SubProgressMonitor(monitor, TICKS_STREAM_PROGRESS_MONITOR));
- buildRunnerHelper.removeOldMarkers(project, new SubProgressMonitor(monitor, TICKS_DELETE_MARKERS, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
+ buildRunnerHelper.removeOldMarkers(project, new SubProgressMonitor(monitor, TICKS_DELETE_MARKERS,
+ SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
buildRunnerHelper.greeting(kind, cfgName, toolchainName, isSupported);
-
+
int state;
epm.deferDeDuplication();
try {
- state = buildRunnerHelper.build(new SubProgressMonitor(monitor, TICKS_EXECUTE_COMMAND, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
+ state = buildRunnerHelper.build(new SubProgressMonitor(monitor, TICKS_EXECUTE_COMMAND,
+ SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
} finally {
epm.deDuplicate();
}
@@ -138,11 +146,14 @@ public class ExternalBuildRunner extends AbstractBuildRunner {
buildRunnerHelper.goodbye();
if (state != ICommandLauncher.ILLEGAL_COMMAND) {
- buildRunnerHelper.refreshProject(cfgName, new SubProgressMonitor(monitor, TICKS_REFRESH_PROJECT, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
+ buildRunnerHelper.refreshProject(cfgName, new SubProgressMonitor(monitor, TICKS_REFRESH_PROJECT,
+ SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
}
} else {
- String msg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.undefined.build.command", builder.getId()); //$NON-NLS-1$
- throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, msg, new Exception()));
+ String msg = ManagedMakeMessages
+ .getFormattedString("ManagedMakeBuilder.message.undefined.build.command", builder.getId()); //$NON-NLS-1$
+ throw new CoreException(
+ new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, msg, new Exception()));
}
} catch (Exception e) {
String msg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.error.build", //$NON-NLS-1$
@@ -170,28 +181,28 @@ public class ExternalBuildRunner extends AbstractBuildRunner {
protected String[] getTargets(int kind, IBuilder builder) {
String targets = ""; //$NON-NLS-1$
switch (kind) {
- case IncrementalProjectBuilder.AUTO_BUILD :
+ case IncrementalProjectBuilder.AUTO_BUILD:
targets = builder.getAutoBuildTarget();
break;
- case IncrementalProjectBuilder.INCREMENTAL_BUILD : // now treated as the same!
- case IncrementalProjectBuilder.FULL_BUILD :
+ case IncrementalProjectBuilder.INCREMENTAL_BUILD: // now treated as the same!
+ case IncrementalProjectBuilder.FULL_BUILD:
targets = builder.getIncrementalBuildTarget();
break;
- case IncrementalProjectBuilder.CLEAN_BUILD :
+ case IncrementalProjectBuilder.CLEAN_BUILD:
targets = builder.getCleanBuildTarget();
break;
}
String targetsArray[] = CommandLineUtil.argumentsToArray(targets);
-
return targetsArray;
}
protected Map<String, String> getEnvironment(IBuilder builder) throws CoreException {
Map<String, String> envMap = new HashMap<String, String>();
if (builder.appendEnvironment()) {
- ICConfigurationDescription cfgDes = ManagedBuildManager.getDescriptionForConfiguration(builder.getParent().getParent());
+ ICConfigurationDescription cfgDes = ManagedBuildManager
+ .getDescriptionForConfiguration(builder.getParent().getParent());
IEnvironmentVariableManager mngr = CCorePlugin.getDefault().getBuildEnvironmentManager();
IEnvironmentVariable[] vars = mngr.getVariables(cfgDes, true);
for (IEnvironmentVariable var : vars) {
@@ -210,9 +221,9 @@ public class ExternalBuildRunner extends AbstractBuildRunner {
@Deprecated
protected static String[] getEnvStrings(Map<String, String> env) {
// Convert into env strings
- List<String> strings= new ArrayList<String>(env.size());
+ List<String> strings = new ArrayList<String>(env.size());
for (Entry<String, String> entry : env.entrySet()) {
- StringBuilder buffer= new StringBuilder(entry.getKey());
+ StringBuilder buffer = new StringBuilder(entry.getKey());
buffer.append('=').append(entry.getValue());
strings.add(buffer.toString());
}
@@ -226,7 +237,7 @@ public class ExternalBuildRunner extends AbstractBuildRunner {
Map<CfgInfoContext, IScannerConfigBuilderInfo2> map = container.getInfoMap();
String pathFromURI = EFSExtensionManager.getDefault().getPathFromURI(workingDirectoryURI);
- if(pathFromURI == null) {
+ if (pathFromURI == null) {
// fallback to CWD
pathFromURI = System.getProperty("user.dir"); //$NON-NLS-1$
}
@@ -234,28 +245,30 @@ public class ExternalBuildRunner extends AbstractBuildRunner {
int oldSize = parsers.size();
- if(container.isPerRcTypeDiscovery()){
+ if (container.isPerRcTypeDiscovery()) {
for (IResourceInfo rcInfo : cfg.getResourceInfos()) {
ITool tools[];
- if(rcInfo instanceof IFileInfo){
- tools = ((IFileInfo)rcInfo).getToolsToInvoke();
+ if (rcInfo instanceof IFileInfo) {
+ tools = ((IFileInfo) rcInfo).getToolsToInvoke();
} else {
- tools = ((IFolderInfo)rcInfo).getFilteredTools();
+ tools = ((IFolderInfo) rcInfo).getFilteredTools();
}
for (ITool tool : tools) {
IInputType[] types = tool.getInputTypes();
- if(types.length != 0){
+ if (types.length != 0) {
for (IInputType type : types) {
CfgInfoContext context = new CfgInfoContext(rcInfo, tool, type);
- IScannerInfoConsoleParser parser = getScannerInfoConsoleParser(project, map, context, workingDirectory, markerGenerator);
+ IScannerInfoConsoleParser parser = getScannerInfoConsoleParser(project, map, context,
+ workingDirectory, markerGenerator);
if (parser != null) {
parsers.add(parser);
}
}
} else {
CfgInfoContext context = new CfgInfoContext(rcInfo, tool, null);
- IScannerInfoConsoleParser parser = getScannerInfoConsoleParser(project, map, context, workingDirectory, markerGenerator);
+ IScannerInfoConsoleParser parser = getScannerInfoConsoleParser(project, map, context,
+ workingDirectory, markerGenerator);
if (parser != null) {
parsers.add(parser);
}
@@ -264,17 +277,20 @@ public class ExternalBuildRunner extends AbstractBuildRunner {
}
}
- if(parsers.size() == oldSize){
+ if (parsers.size() == oldSize) {
CfgInfoContext context = new CfgInfoContext(cfg);
- IScannerInfoConsoleParser parser = getScannerInfoConsoleParser(project, map, context, workingDirectory, markerGenerator);
+ IScannerInfoConsoleParser parser = getScannerInfoConsoleParser(project, map, context, workingDirectory,
+ markerGenerator);
if (parser != null) {
parsers.add(parser);
}
}
}
- private static IScannerInfoConsoleParser getScannerInfoConsoleParser(IProject project, Map<CfgInfoContext, IScannerConfigBuilderInfo2> map,
- CfgInfoContext context, IPath workingDirectory, IMarkerGenerator markerGenerator) {
- return ScannerInfoConsoleParserFactory.getScannerInfoConsoleParser(project, context.toInfoContext(), workingDirectory, map.get(context), markerGenerator, null);
+ private static IScannerInfoConsoleParser getScannerInfoConsoleParser(IProject project,
+ Map<CfgInfoContext, IScannerConfigBuilderInfo2> map, CfgInfoContext context, IPath workingDirectory,
+ IMarkerGenerator markerGenerator) {
+ return ScannerInfoConsoleParserFactory.getScannerInfoConsoleParser(project, context.toInfoContext(),
+ workingDirectory, map.get(context), markerGenerator, null);
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IAdditionalInput.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IAdditionalInput.java
index f482bbea440..b80c3f67c83 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IAdditionalInput.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IAdditionalInput.java
@@ -16,9 +16,9 @@ package org.eclipse.cdt.managedbuilder.core;
/**
* This interface represents an additionalInput instance in the managed build system.
* This element is only present if the user or a tool integrator needs to define
- * additional inputs or dependencies to a tool. An inputType element can have
+ * additional inputs or dependencies to a tool. An inputType element can have
* multiple additionalInput children.
- *
+ *
* @since 3.0
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
@@ -26,9 +26,9 @@ package org.eclipse.cdt.managedbuilder.core;
public interface IAdditionalInput {
// Schema attribute names for additionalInput elements
- public static final String ADDITIONAL_INPUT_ELEMENT_NAME = "additionalInput"; //$NON-NLS-1$
- public static final String PATHS = "paths"; //$NON-NLS-1$
- public static final String KIND = "kind"; //$NON-NLS-1$
+ public static final String ADDITIONAL_INPUT_ELEMENT_NAME = "additionalInput"; //$NON-NLS-1$
+ public static final String PATHS = "paths"; //$NON-NLS-1$
+ public static final String KIND = "kind"; //$NON-NLS-1$
public static final String ADDITIONAL_DEPENDENCY = "additionaldependency"; //$NON-NLS-1$
public static final int KIND_ADDITIONAL_DEPENDENCY = 1;
public static final String ADDITIONAL_INPUT = "additionalinput"; //$NON-NLS-1$
@@ -38,7 +38,7 @@ public interface IAdditionalInput {
/**
* Returns the InputType parent of this AdditionalInput.
- *
+ *
* @return IInputType
*/
public IInputType getParent();
@@ -46,45 +46,45 @@ public interface IAdditionalInput {
/**
* Returns an array of the relative or absolute paths of the resources
* to which this element applies.
- * The resources must be a member of the project, the output from another tool in the
- * tool-chain, or an external file. The file name of the path can use GNU Make pattern
+ * The resources must be a member of the project, the output from another tool in the
+ * tool-chain, or an external file. The file name of the path can use GNU Make pattern
* rule syntax (in order to generate the name from the input file name).
- *
+ *
* @return String[]
*/
public String[] getPaths();
/**
- * Sets semicolon separated list of the relative or absolute paths of the resources to
+ * Sets semicolon separated list of the relative or absolute paths of the resources to
* which this element applies.
*/
public void setPaths(String paths);
/**
- * Returns the kind of additional input. The valid values are:
+ * Returns the kind of additional input. The valid values are:
* KIND_ADDITIONAL_DEPENDENCY - added as a tool dependency, but not to the command line.
* KIND_ADDITIONAL_INPUT - added as an additional input to the command line, but not as a dependency.
* KIND_ADDITIONAL_INPUT_DEPENDENCY - added as both.
* The default is KIND_ADDITIONAL_INPUT_DEPENDENCY
- */
+ */
public int getKind();
-
+
/**
* Sets the kind of additional input.
- */
+ */
public void setKind(int kind);
/**
- * 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
*/
public boolean isDirty();
-
+
/**
* Sets the element's "dirty" (have I been modified?) flag.
*/
public void setDirty(boolean isDirty);
-
+
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildObject.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildObject.java
index 52abab6c359..c0f302e6bcb 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildObject.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildObject.java
@@ -23,8 +23,9 @@ public interface IBuildObject {
// Schema element names
public static final String ID = "id"; //$NON-NLS-1$
public static final String NAME = "name"; //$NON-NLS-1$
-
+
public String getId();
+
public String getName();
/**
@@ -34,7 +35,9 @@ public interface IBuildObject {
/** @since 8.0 */
public Version getVersion();
+
/** @since 8.0 */
public void setVersion(Version version);
+
public String getManagedBuildRevision();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildObjectProperties.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildObjectProperties.java
index 0ca5266d531..0cf284ca7ae 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildObjectProperties.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildObjectProperties.java
@@ -23,6 +23,6 @@ import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyValue;
*/
public interface IBuildObjectProperties extends IBuildProperties, IBuildPropertiesRestriction {
IBuildPropertyType[] getSupportedTypes();
-
+
IBuildPropertyValue[] getSupportedValues(String typeId);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildPathResolver.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildPathResolver.java
index 4d3aa88bf3f..8008f3f5d59 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildPathResolver.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildPathResolver.java
@@ -32,4 +32,3 @@ public interface IBuildPathResolver {
*/
String[] resolveBuildPaths(int pathType, String variableName, String variableValue, IConfiguration configuration);
}
-
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildPropertiesRestriction.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildPropertiesRestriction.java
index 8fa581d9b62..ab7045dc69f 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildPropertiesRestriction.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildPropertiesRestriction.java
@@ -13,20 +13,19 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.core;
-
/**
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IBuildPropertiesRestriction {
String[] getSupportedTypeIds();
-
+
boolean supportsType(String id);
-
+
String[] getSupportedValueIds(String typeId);
-
+
boolean supportsValue(String typeId, String valueId);
-
+
boolean requiresType(String typeId);
String[] getRequiredTypeIds();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuilder.java
index c689a6c36aa..756f1adb36a 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuilder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuilder.java
@@ -24,64 +24,64 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
/**
- * This class represents the utility that drives the build process
- * (typically, but not necessarily, a variant of "make"). It defines
+ * This class represents the utility that drives the build process
+ * (typically, but not necessarily, a variant of "make"). It defines
* the command needed to invoke the build utility in the command attribute.
- * Any special flags that need to be passed to the builder are defined
+ * Any special flags that need to be passed to the builder are defined
* in the arguments attribute. The builder can specify the error parser(s)
* to be used to parse its output. The builder also specifies a Java class
* that generates the build file.
- *
+ *
* @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.
*/
public interface IBuilder extends IHoldsOptions, IMakeBuilderInfo {
- public static final String ARGUMENTS = "arguments"; //$NON-NLS-1$
- public static final String BUILDER_ELEMENT_NAME = "builder"; //$NON-NLS-1$
- public static final String BUILDFILEGEN_ID ="buildfileGenerator"; //$NON-NLS-1$
- public static final String COMMAND = "command"; //$NON-NLS-1$
-
- public static final String VERSIONS_SUPPORTED = "versionsSupported"; //$NON-NLS-1$
- public static final String CONVERT_TO_ID = "convertToId"; //$NON-NLS-1$
-
- public static final String VARIABLE_FORMAT = "variableFormat"; //$NON-NLS-1$
- public static final String IS_VARIABLE_CASE_SENSITIVE = "isVariableCaseSensitive"; //$NON-NLS-1$
- public static final String RESERVED_MACRO_NAMES = "reservedMacroNames"; //$NON-NLS-1$
- public static final String RESERVED_MACRO_NAME_SUPPLIER = "reservedMacroNameSupplier"; //$NON-NLS-1$
- public static final String IS_SYSTEM = "isSystem"; //$NON-NLS-1$
-
-// static final String BUILD_COMMAND = "buildCommand"; //$NON-NLS-1$
+ public static final String ARGUMENTS = "arguments"; //$NON-NLS-1$
+ public static final String BUILDER_ELEMENT_NAME = "builder"; //$NON-NLS-1$
+ public static final String BUILDFILEGEN_ID = "buildfileGenerator"; //$NON-NLS-1$
+ public static final String COMMAND = "command"; //$NON-NLS-1$
+
+ public static final String VERSIONS_SUPPORTED = "versionsSupported"; //$NON-NLS-1$
+ public static final String CONVERT_TO_ID = "convertToId"; //$NON-NLS-1$
+
+ public static final String VARIABLE_FORMAT = "variableFormat"; //$NON-NLS-1$
+ public static final String IS_VARIABLE_CASE_SENSITIVE = "isVariableCaseSensitive"; //$NON-NLS-1$
+ public static final String RESERVED_MACRO_NAMES = "reservedMacroNames"; //$NON-NLS-1$
+ public static final String RESERVED_MACRO_NAME_SUPPLIER = "reservedMacroNameSupplier"; //$NON-NLS-1$
+ public static final String IS_SYSTEM = "isSystem"; //$NON-NLS-1$
+
+ // static final String BUILD_COMMAND = "buildCommand"; //$NON-NLS-1$
static final String ATTRIBUTE_BUILD_PATH = "buildPath"; //$NON-NLS-1$
-// static final String USE_DEFAULT_BUILD_CMD = "useDefaultBuildCmd"; //$NON-NLS-1$
+ // static final String USE_DEFAULT_BUILD_CMD = "useDefaultBuildCmd"; //$NON-NLS-1$
static final String ATTRIBUTE_TARGET_AUTO = "autoBuildTarget"; //$NON-NLS-1$
static final String ATTRIBUTE_TARGET_INCREMENTAL = "incrementalBuildTarget"; //$NON-NLS-1$
-// static final String BUILD_TARGET_FULL = "fullBuildTarget"; //$NON-NLS-1$
+ // static final String BUILD_TARGET_FULL = "fullBuildTarget"; //$NON-NLS-1$
static final String ATTRIBUTE_TARGET_CLEAN = "cleanBuildTarget"; //$NON-NLS-1$
-// static final String BUILD_FULL_ENABLED = "enableFullBuild"; //$NON-NLS-1$
+ // static final String BUILD_FULL_ENABLED = "enableFullBuild"; //$NON-NLS-1$
static final String ATTRIBUTE_CLEAN_ENABLED = "enableCleanBuild"; //$NON-NLS-1$
static final String ATTRIBUTE_INCREMENTAL_ENABLED = "enabledIncrementalBuild"; //$NON-NLS-1$
static final String ATTRIBUTE_AUTO_ENABLED = "enableAutoBuild"; //$NON-NLS-1$
-// static final String BUILD_ARGUMENTS = "buildArguments"; //$NON-NLS-1$
+ // static final String BUILD_ARGUMENTS = "buildArguments"; //$NON-NLS-1$
static final String ATTRIBUTE_ENVIRONMENT = "environment"; //$NON-NLS-1$
- static final String ATTRIBUTE_APPEND_ENVIRONMENT = "appendEnvironment"; //$NON-NLS-1$
-// public final static String BUILD_TARGET_INCREMENTAL = "build.target.inc"; //$NON-NLS-1$
-// public final static String BUILD_TARGET_AUTO = "build.target.auto"; //$NON-NLS-1$
-// public final static String BUILD_TARGET_CLEAN = "build.target.clean"; //$NON-NLS-1$
-// public final static String BUILD_LOCATION = "build.location"; //$NON-NLS-1$
-// public final static String BUILD_COMMAND = "build.command"; //$NON-NLS-1$
-// public final static String BUILD_ARGUMENTS = "build.arguments"; //$NON-NLS-1$
-
- static final String ATTRIBUTE_MANAGED_BUILD_ON = "managedBuildOn"; //$NON-NLS-1$
- static final String ATTRIBUTE_KEEP_ENV = "keepEnvironmentInBuildfile"; //$NON-NLS-1$
+ static final String ATTRIBUTE_APPEND_ENVIRONMENT = "appendEnvironment"; //$NON-NLS-1$
+ // public final static String BUILD_TARGET_INCREMENTAL = "build.target.inc"; //$NON-NLS-1$
+ // public final static String BUILD_TARGET_AUTO = "build.target.auto"; //$NON-NLS-1$
+ // public final static String BUILD_TARGET_CLEAN = "build.target.clean"; //$NON-NLS-1$
+ // public final static String BUILD_LOCATION = "build.location"; //$NON-NLS-1$
+ // public final static String BUILD_COMMAND = "build.command"; //$NON-NLS-1$
+ // public final static String BUILD_ARGUMENTS = "build.arguments"; //$NON-NLS-1$
+
+ static final String ATTRIBUTE_MANAGED_BUILD_ON = "managedBuildOn"; //$NON-NLS-1$
+ static final String ATTRIBUTE_KEEP_ENV = "keepEnvironmentInBuildfile"; //$NON-NLS-1$
static final String ATTRIBUTE_SUPORTS_MANAGED_BUILD = "supportsManagedBuild"; //$NON-NLS-1$
-
+
static final String ATTRIBUTE_CUSTOMIZED_ERROR_PARSERS = "customizedErrorParsers"; //$NON-NLS-1$
static final String ATTRIBUTE_CUSTOM_PROPS = "customBuilderProperties"; //$NON-NLS-1$
static final String ATTRIBUTE_IGNORE_ERR_CMD = "ignoreErrCmd"; //$NON-NLS-1$
static final String ATTRIBUTE_STOP_ON_ERR = "stopOnErr"; //$NON-NLS-1$
-
+
static final String ATTRIBUTE_PARALLEL_BUILD_CMD = "parallelBuildCmd"; //$NON-NLS-1$
static final String ATTRIBUTE_PARALLEL_BUILD_ON = "parallelBuildOn"; //$NON-NLS-1$
static final String ATTRIBUTE_PARALLELIZATION_NUMBER = "parallelizationNumber"; //$NON-NLS-1$
@@ -92,44 +92,44 @@ public interface IBuilder extends IHoldsOptions, IMakeBuilderInfo {
static final String PARALLEL_PATTERN_NUM = "*"; //$NON-NLS-1$
static final String PARALLEL_PATTERN_NUM_START = "["; //$NON-NLS-1$
static final String PARALLEL_PATTERN_NUM_END = "]"; //$NON-NLS-1$
-
+
static final String OUTPUT_ENTRIES = "outputEntries"; //$NON-NLS-1$
-
- static final String DEFAULT_TARGET_INCREMENTAL = "all"; //$NON-NLS-1$
- static final String DEFAULT_TARGET_CLEAN = "clean"; //$NON-NLS-1$
+
+ static final String DEFAULT_TARGET_INCREMENTAL = "all"; //$NON-NLS-1$
+ static final String DEFAULT_TARGET_CLEAN = "clean"; //$NON-NLS-1$
static final String DEFAULT_TARGET_AUTO = "all"; //$NON-NLS-1$
/** @since 6.0 */
static final String ATTRIBUTE_COMMAND_LAUNCHER = "commandLauncher"; //$NON-NLS-1$
/** @since 8.0 */
static final String ATTRIBUTE_BUILD_RUNNER = "buildRunner"; //$NON-NLS-1$
-
+
/**
- * Returns the command line arguments to pass to the build/make utility used
+ * Returns the command line arguments to pass to the build/make utility used
* to build a configuration.
- *
+ *
* @return String
*/
public String getArguments();
/**
- * Returns the plugin.xml element of the buildFileGenerator extension or <code>null</code> if none.
- *
+ * Returns the plugin.xml element of the buildFileGenerator extension or <code>null</code> if none.
+ *
* @return IConfigurationElement
* @deprecated - use getBuildFileGenerator() instead
*/
@Deprecated
public IConfigurationElement getBuildFileGeneratorElement();
-
+
/**
* Returns the BuildfileGenerator used to generate buildfiles for this builder
- *
+ *
* @return IManagedBuilderMakefileGenerator
*/
IManagedBuilderMakefileGenerator getBuildFileGenerator();
-
+
/**
* Returns the name of the build/make utility for the configuration.
- *
+ *
* @return String
*/
public String getCommand();
@@ -137,22 +137,22 @@ public interface IBuilder extends IHoldsOptions, IMakeBuilderInfo {
/**
* Returns the semicolon separated list of unique IDs of the error parsers associated
* with the builder.
- *
+ *
* @return String
*/
public String getErrorParserIds();
/**
- * Returns the ordered list of unique IDs of the error parsers associated with the
+ * Returns the ordered list of unique IDs of the error parsers associated with the
* builder.
- *
+ *
* @return String[]
*/
public String[] getErrorParserList();
/**
* Returns the tool-chain that is the parent of this builder.
- *
+ *
* @return IToolChain
*/
public IToolChain getParent();
@@ -160,52 +160,52 @@ public interface IBuilder extends IHoldsOptions, IMakeBuilderInfo {
/**
* Returns the <code>IBuilder</code> that is the superclass of this
* target platform, or <code>null</code> if the attribute was not specified.
- *
+ *
* @return IBuilder
*/
public IBuilder getSuperClass();
-
+
/**
* Returns a semi-colon delimited list of child Ids of the superclass'
* children that should not be automatically inherited by this element.
- * Returns an empty string if the attribute was not specified.
- * @return String
+ * Returns an empty string if the attribute was not specified.
+ * @return String
*/
public String getUnusedChildren();
-
+
/**
* Returns whether this element is abstract. Returns <code>false</code>
* if the attribute was not specified.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean isAbstract();
/**
- * 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
*/
public boolean isDirty();
-
+
/**
* Returns <code>true</code> if this builder was loaded from a manifest file,
* and <code>false</code> if it was loaded from a project (.cdtbuild) file.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean isExtensionElement();
/**
- * Sets the arguments to be passed to the build utility used by the
+ * Sets the arguments to be passed to the build utility used by the
* receiver to produce a build goal.
*/
public void setArguments(String makeArgs);
-
+
/**
* Sets the BuildFileGenerator plugin.xml element
- *
+ *
* @deprecated as of CDT 4.0
*/
@Deprecated
@@ -215,7 +215,7 @@ public interface IBuilder extends IHoldsOptions, IMakeBuilderInfo {
* Sets the build command for the receiver to the value in the argument.
*/
public void setCommand(String command);
-
+
/**
* Sets the element's "dirty" (have I been modified?) flag.
*/
@@ -227,101 +227,101 @@ public interface IBuilder extends IHoldsOptions, IMakeBuilderInfo {
public void setErrorParserIds(String ids);
/**
- * Sets the isAbstract attribute of the builder.
+ * Sets the isAbstract attribute of the builder.
*/
public void setIsAbstract(boolean b);
-
+
/**
* Returns the 'versionsSupported' of this builder
- *
+ *
* @return String
*/
public String getVersionsSupported();
-
+
/**
* Returns the 'convertToId' of this builder
- *
+ *
* @return String
*/
public String getConvertToId();
-
+
/**
- * Sets the 'versionsSupported' attribute of the builder.
+ * Sets the 'versionsSupported' attribute of the builder.
*/
-
+
public void setVersionsSupported(String versionsSupported);
-
+
/**
- * Sets the 'convertToId' attribute of the builder.
+ * Sets the 'convertToId' attribute of the builder.
*/
public void setConvertToId(String convertToId);
/**
* Returns the IFileContextBuildMacroValues interface reference that specifies
* the file-context macro-values provided by the tool-integrator
- *
+ *
* @return IFileContextBuildMacroValues
*/
public IFileContextBuildMacroValues getFileContextBuildMacroValues();
-
+
/**
* Returns String representing the build variable pattern to be used while makefile generation
- *
+ *
* @return String
*/
public String getBuilderVariablePattern();
-
+
/**
* Returns whether the builder supports case sensitive variables or not
- *
+ *
* @return boolean
*/
public boolean isVariableCaseSensitive();
-
+
/**
- * Returns an array of Strings representing the patterns of the builder/buildfile-generator
+ * Returns an array of Strings representing the patterns of the builder/buildfile-generator
* reserved variables
- *
+ *
* @return String[]
*/
public String[] getReservedMacroNames();
-
+
/**
* Returns the tool-integrator defined implementation of the IReservedMacroNameSupplier
* to be used for detecting the builder/buildfile-generator reserved variables
* @return IReservedMacroNameSupplier
*/
public IReservedMacroNameSupplier getReservedMacroNameSupplier();
-
+
public CBuildData getBuildData();
-
+
public boolean isCustomBuilder();
-
+
public boolean supportsCustomizedBuild();
-
+
public boolean keepEnvironmentVariablesInBuildfile();
public void setKeepEnvironmentVariablesInBuildfile(boolean keep);
public boolean canKeepEnvironmentVariablesInBuildfile();
-
+
void setBuildPath(String path);
String getBuildPath();
-
+
boolean isInternalBuilder();
-
+
boolean matches(IBuilder builder);
-
+
boolean isSystemObject();
-
+
String getUniqueRealName();
-
+
/**
* Returns the ICommandLauncher which should be used to launch the builder command.
- *
+ *
* @return ICommandLauncher
* @since 6.0
*/
@@ -329,10 +329,10 @@ public interface IBuilder extends IHoldsOptions, IMakeBuilderInfo {
/**
* Returns the build runner for this builder.
- *
+ *
* @return build runner
* @since 8.0
*/
public AbstractBuildRunner getBuildRunner() throws CoreException;
-
+
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java
index ab5da8c25ad..e9044798d74 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java
@@ -39,20 +39,21 @@ import org.eclipse.core.runtime.IPath;
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
-public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesContainer, IOptionalBuildObjectPropertiesContainer {
- public static final String ARTIFACT_NAME = "artifactName"; //$NON-NLS-1$
- public static final String CLEAN_COMMAND = "cleanCommand"; //$NON-NLS-1$
- public static final String PREBUILD_STEP = "prebuildStep"; //$NON-NLS-1$
- public static final String POSTBUILD_STEP = "postbuildStep"; //$NON-NLS-1$
- public static final String PREANNOUNCEBUILD_STEP = "preannouncebuildStep"; //$NON-NLS-1$
- public static final String POSTANNOUNCEBUILD_STEP = "postannouncebuildStep"; //$NON-NLS-1$
+public interface IConfiguration
+ extends IBuildObject, IBuildObjectPropertiesContainer, IOptionalBuildObjectPropertiesContainer {
+ public static final String ARTIFACT_NAME = "artifactName"; //$NON-NLS-1$
+ public static final String CLEAN_COMMAND = "cleanCommand"; //$NON-NLS-1$
+ public static final String PREBUILD_STEP = "prebuildStep"; //$NON-NLS-1$
+ public static final String POSTBUILD_STEP = "postbuildStep"; //$NON-NLS-1$
+ public static final String PREANNOUNCEBUILD_STEP = "preannouncebuildStep"; //$NON-NLS-1$
+ public static final String POSTANNOUNCEBUILD_STEP = "postannouncebuildStep"; //$NON-NLS-1$
// Schema element names
- public static final String CONFIGURATION_ELEMENT_NAME = "configuration"; //$NON-NLS-1$
- public static final String ERROR_PARSERS = "errorParsers"; //$NON-NLS-1$
+ public static final String CONFIGURATION_ELEMENT_NAME = "configuration"; //$NON-NLS-1$
+ public static final String ERROR_PARSERS = "errorParsers"; //$NON-NLS-1$
/** @since 8.1 */
public static final String LANGUAGE_SETTINGS_PROVIDERS = "languageSettingsProviders"; //$NON-NLS-1$
- public static final String EXTENSION = "artifactExtension"; //$NON-NLS-1$
- public static final String PARENT = "parent"; //$NON-NLS-1$
+ public static final String EXTENSION = "artifactExtension"; //$NON-NLS-1$
+ public static final String PARENT = "parent"; //$NON-NLS-1$
public static final String DESCRIPTION = "description"; //$NON-NLS-1$
@@ -62,12 +63,10 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
*/
public static final String OPTIONAL_BUILD_PROPERTIES = "optionalBuildProperties"; //$NON-NLS-1$
public static final String BUILD_ARTEFACT_TYPE = "buildArtefactType"; //$NON-NLS-1$
- public static final String IS_SYSTEM = "isSystem"; //$NON-NLS-1$
+ public static final String IS_SYSTEM = "isSystem"; //$NON-NLS-1$
public static final String SOURCE_ENTRIES = "sourceEntries"; //$NON-NLS-1$
-
-
/**
* Returns the description of the configuration.
*
@@ -128,34 +127,34 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
public String getBuildCommand();
/**
- * Returns the prebuild step command
- *
- * @return String
- */
- public String getPrebuildStep();
-
- /**
- * Returns the postbuild step command
- *
- * @return String
- */
- public String getPostbuildStep();
-
- /**
- * Returns the display string associated with the prebuild step
- *
- * @return String
- */
- public String getPreannouncebuildStep();
-
- /**
- * Returns the display string associated with the postbuild step
- *
- * @return String
- */
- public String getPostannouncebuildStep();
-
- /**
+ * Returns the prebuild step command
+ *
+ * @return String
+ */
+ public String getPrebuildStep();
+
+ /**
+ * Returns the postbuild step command
+ *
+ * @return String
+ */
+ public String getPostbuildStep();
+
+ /**
+ * Returns the display string associated with the prebuild step
+ *
+ * @return String
+ */
+ public String getPreannouncebuildStep();
+
+ /**
+ * Returns the display string associated with the postbuild step
+ *
+ * @return String
+ */
+ public String getPostannouncebuildStep();
+
+ /**
* Answers the OS-specific command to remove files created by the build
* of this configuration.
*
@@ -380,28 +379,28 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
public void setBuildCommand(String command);
/**
- * Sets the prebuild step for the receiver to the value in the argument.
- */
- public void setPrebuildStep(String step);
+ * Sets the prebuild step for the receiver to the value in the argument.
+ */
+ public void setPrebuildStep(String step);
- /**
- * Sets the postbuild step for the receiver to the value in the argument.
- */
- public void setPostbuildStep(String step);
+ /**
+ * Sets the postbuild step for the receiver to the value in the argument.
+ */
+ public void setPostbuildStep(String step);
- /**
- * Sets the prebuild step display string for the receiver to the value in the argument.
- */
- public void setPreannouncebuildStep(String announceStep);
+ /**
+ * Sets the prebuild step display string for the receiver to the value in the argument.
+ */
+ public void setPreannouncebuildStep(String announceStep);
- /**
- * Sets the postbuild step display string for the receiver to the value in the argument.
- */
- public void setPostannouncebuildStep(String announceStep);
+ /**
+ * Sets the postbuild step display string for the receiver to the value in the argument.
+ */
+ public void setPostannouncebuildStep(String announceStep);
- /**
+ /**
* Sets the command used to clean the outputs of this configuration.
- * @param command - the command to clean outputs
+ * @param command - the command to clean outputs
*/
public void setCleanCommand(String command);
@@ -434,8 +433,7 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
* @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;
+ public IOption setOption(IHoldsOptions parent, IOption option, boolean value) throws BuildException;
/**
* Sets the value of a string option for this configuration.
@@ -449,8 +447,7 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
* @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, String value)
- throws BuildException;
+ public IOption setOption(IHoldsOptions parent, IOption option, String value) throws BuildException;
/**
* Sets the value of a list option for this configuration.
@@ -464,8 +461,7 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
* @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, String[] value)
- throws BuildException;
+ public IOption setOption(IHoldsOptions parent, IOption option, String[] value) throws BuildException;
/**
* Sets the rebuild state in this configuration.
@@ -513,7 +509,6 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
*/
public boolean isTemporary();
-
/**
* Returns whether this configuration requires a full rebuild
*
@@ -594,8 +589,8 @@ public interface IConfiguration extends IBuildObject, IBuildObjectPropertiesCont
String getOutputFlag(String outputExt);
- IManagedCommandLineInfo generateToolCommandLineInfo( String sourceExtension, String[] flags,
- String outputFlag, String outputPrefix, String outputName, String[] inputResources, IPath inputLocation, IPath outputLocation );
+ IManagedCommandLineInfo generateToolCommandLineInfo(String sourceExtension, String[] flags, String outputFlag,
+ String outputPrefix, String outputName, String[] inputResources, IPath inputLocation, IPath outputLocation);
String[] getUserObjects(String extension);
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfigurationNameProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfigurationNameProvider.java
index 7a4c4b73795..d1d1cbb2d4d 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfigurationNameProvider.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfigurationNameProvider.java
@@ -12,16 +12,15 @@
* Intel Corporation - Initial API and implementation
*******************************************************************************/
-
package org.eclipse.cdt.managedbuilder.core;
public interface IConfigurationNameProvider {
-
+
/*
* Returns the new unique configuration name based on the 'configuration'
* object and the list of configuration names already in use in the project.
- *
+ *
*/
- String getNewConfigurationName(IConfiguration configuration, String [] usedConfigurationNames );
+ String getNewConfigurationName(IConfiguration configuration, String[] usedConfigurationNames);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfigurationV2.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfigurationV2.java
index b675abc6ba2..40cfd893294 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfigurationV2.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConfigurationV2.java
@@ -19,81 +19,81 @@ import org.eclipse.core.resources.IResource;
/**
* This class represents a project configuration in the old (CDT 2.0)
* managed build system model.
- * <p>
+ * <p>
* The configuration contains one or more children of type tool-reference.
*
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
- *
+ *
* @deprecated This class was deprecated in 2.1
*/
@Deprecated
public interface IConfigurationV2 extends IBuildObject {
// Schema element names
- public static final String CONFIGURATION_ELEMENT_NAME = "configuration"; //$NON-NLS-1$
- public static final String TOOLREF_ELEMENT_NAME = "toolReference"; //$NON-NLS-1$
- public static final String PARENT = "parent"; //$NON-NLS-1$
+ public static final String CONFIGURATION_ELEMENT_NAME = "configuration"; //$NON-NLS-1$
+ public static final String TOOLREF_ELEMENT_NAME = "toolReference"; //$NON-NLS-1$
+ public static final String PARENT = "parent"; //$NON-NLS-1$
/**
- * Projects have C or CC natures. Tools can specify a filter so they are not
- * misapplied to a project. This method allows the caller to retrieve a list
- * of tools from a project that are correct for a project's nature.
- *
+ * Projects have C or CC natures. Tools can specify a filter so they are not
+ * misapplied to a project. This method allows the caller to retrieve a list
+ * of tools from a project that are correct for a project's nature.
+ *
* @param project the project to filter for
- * @return an array of <code>ITools</code> that have compatible filters
+ * @return an array of <code>ITools</code> that have compatible filters
* for the specified project
*/
ITool[] getFilteredTools(IProject project);
-
+
/**
* @return the resource that owns the project that owns the configuration.
*/
public IResource getOwner();
-
+
/**
- * @return the configuration that this configuration is based on.
+ * @return the configuration that this configuration is based on.
*/
public IConfigurationV2 getParent();
-
+
/**
* @return the target for this configuration.
*/
public ITarget getTarget();
-
+
/**
- * Answers the <code>ITool</code> in the receiver with the same
- * id as the argument, or <code>null</code>.
- *
+ * Answers the <code>ITool</code> in the receiver with the same
+ * id as the argument, or <code>null</code>.
+ *
* @param id unique identifier to search for
* @return ITool
*/
public ITool getToolById(String id);
-
+
/**
* Returns the tools that are used in this configuration.
- *
+ *
* @return ITool[]
*/
public ITool[] getTools();
-
+
/**
* @return the tool references that are children of this configuration.
*/
public IToolReference[] getToolReferences();
/**
- * Answers <code>true</code> the receiver has changes that need to be saved
+ * Answers <code>true</code> the receiver has changes that need to be saved
* in the project file, else <code>false</code>.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean isDirty();
/**
- * Answers whether the receiver has been changed and requires the
+ * Answers whether the receiver has been changed and requires the
* project to be rebuilt.
- *
- * @return <code>true</code> if the receiver contains a change
+ *
+ * @return <code>true</code> if the receiver contains a change
* that needs the project to be rebuilt
*/
public boolean needsRebuild();
@@ -105,41 +105,38 @@ public interface IConfigurationV2 extends IBuildObject {
/**
* Sets the name of the receiver to the value specified in the argument
- *
+ *
* @param name new name
*/
public void setName(String name);
/**
* Sets the value of a boolean option for this configuration.
- *
+ *
* @param option The option to change.
* @param value The value to apply to the option.
*/
- public void setOption(IOption option, boolean value)
- throws BuildException;
+ public void setOption(IOption option, boolean value) throws BuildException;
/**
* Sets the value of a string option for this configuration.
- *
+ *
* @param option The option that will be effected by change.
* @param value The value to apply to the option.
*/
- public void setOption(IOption option, String value)
- throws BuildException;
-
+ public void setOption(IOption option, String value) throws BuildException;
+
/**
* Sets the value of a list option for this configuration.
- *
+ *
* @param option The option to change.
* @param value The values to apply to the option.
*/
- public void setOption(IOption option, String[] value)
- throws BuildException;
+ public void setOption(IOption option, String[] value) throws BuildException;
/**
- * Sets the rebuild state in the receiver.
- *
+ * Sets the rebuild state in the receiver.
+ *
* @param rebuild <code>true</code> will force a rebuild the next time the project builds
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#setRebuildState(boolean)
*/
@@ -147,7 +144,7 @@ public interface IConfigurationV2 extends IBuildObject {
/**
* Overrides the tool command for a tool defined in the receiver.
- *
+ *
* @param tool The tool that will have its command modified
* @param command The command
*/
@@ -160,7 +157,7 @@ public interface IConfigurationV2 extends IBuildObject {
/**
* Returns the configuration that was created from this V2.0 configuration.
- *
+ *
* @return IConfiguration
*/
public IConfiguration getCreatedConfig();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConvertManagedBuildObject.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConvertManagedBuildObject.java
index ee2b0c81620..25127c80a92 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConvertManagedBuildObject.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IConvertManagedBuildObject.java
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.core;
-
public interface IConvertManagedBuildObject {
public IBuildObject convert(IBuildObject buildObj, String fromId, String toId, boolean isConfirmed);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IEnvVarBuildPath.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IEnvVarBuildPath.java
index 450c59309ce..9c35070eda6 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IEnvVarBuildPath.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IEnvVarBuildPath.java
@@ -22,17 +22,17 @@ public interface IEnvVarBuildPath {
public static final int BUILDPATH_INCLUDE = 1;
public static final int BUILDPATH_LIBRARY = 2;
- public static final String BUILD_PATH_ELEMENT_NAME = "envVarBuildPath"; //$NON-NLS-1$
- public static final String TYPE = "pathType"; //$NON-NLS-1$
- public static final String LIST = "variableList"; //$NON-NLS-1$
- public static final String PATH_DELIMITER = "pathDelimiter"; //$NON-NLS-1$
- public static final String BUILD_PATH_RESOLVER = "buildPathResolver"; //$NON-NLS-1$
-
- public static final String TYPE_INCLUDE = "buildpathInclude"; //$NON-NLS-1$
- public static final String TYPE_LIBRARY = "buildpathLibrary"; //$NON-NLS-1$
-
- public static final String NAME_SEPARATOR = ","; //$NON-NLS-1$
-
+ public static final String BUILD_PATH_ELEMENT_NAME = "envVarBuildPath"; //$NON-NLS-1$
+ public static final String TYPE = "pathType"; //$NON-NLS-1$
+ public static final String LIST = "variableList"; //$NON-NLS-1$
+ public static final String PATH_DELIMITER = "pathDelimiter"; //$NON-NLS-1$
+ public static final String BUILD_PATH_RESOLVER = "buildPathResolver"; //$NON-NLS-1$
+
+ public static final String TYPE_INCLUDE = "buildpathInclude"; //$NON-NLS-1$
+ public static final String TYPE_LIBRARY = "buildpathLibrary"; //$NON-NLS-1$
+
+ public static final String NAME_SEPARATOR = ","; //$NON-NLS-1$
+
/**
*
* @return one of the ITool.BUILDPATH _xxx
@@ -62,4 +62,3 @@ public interface IEnvVarBuildPath {
*/
public IBuildPathResolver getBuildPathResolver();
}
-
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IFileInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IFileInfo.java
index 51de21c0b52..90a0e36f915 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IFileInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IFileInfo.java
@@ -21,7 +21,7 @@ import org.eclipse.cdt.core.settings.model.extension.CFileData;
*/
public interface IFileInfo extends IResourceConfiguration {
public static final String FILE_INFO_ELEMENT_NAME = "fileInfo"; //$NON-NLS-1$
-
+
CFileData getFileData();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IFolderInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IFolderInfo.java
index 34b0c127871..54583b02feb 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IFolderInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IFolderInfo.java
@@ -23,48 +23,48 @@ public interface IFolderInfo extends IResourceInfo {
public final static String FOLDER_INFO_ELEMENT_NAME = "folderInfo"; //$NON-NLS-1$
ITool[] getFilteredTools();
-
+
IToolChain getToolChain();
-
+
ITool getTool(String id);
-
+
ITool[] getToolsBySuperClassId(String id);
-
+
CFolderData getFolderData();
-
+
/**
- * Returns a <code>ITool</code> for the tool associated with the
+ * Returns a <code>ITool</code> for the tool associated with the
* output extension.
- *
+ *
* @param extension the file extension of the output file
* @return ITool
- *
+ *
* @since 3.1
*/
ITool getToolFromOutputExtension(String extension);
-
+
/**
- * Returns a <code>ITool</code> for the tool associated with the
+ * Returns a <code>ITool</code> for the tool associated with the
* input extension.
- *
+ *
* @param sourceExtension the file extension of the input file
* @return ITool
- *
+ *
* @since 3.1
*/
ITool getToolFromInputExtension(String sourceExtension);
-
- boolean buildsFileType(String srcExt);
-
- IModificationStatus getToolChainModificationStatus(ITool[] removed, ITool[] added);
-
- void modifyToolChain(ITool[] removed, ITool[] added) throws BuildException;
-
- IToolChain changeToolChain(IToolChain newSuperClass, String Id, String name) throws BuildException;
-
- boolean isToolChainCompatible(IToolChain tCh);
-
- String getOutputExtension(String resourceExtension);
-
- boolean isHeaderFile(String ext);
+
+ boolean buildsFileType(String srcExt);
+
+ IModificationStatus getToolChainModificationStatus(ITool[] removed, ITool[] added);
+
+ void modifyToolChain(ITool[] removed, ITool[] added) throws BuildException;
+
+ IToolChain changeToolChain(IToolChain newSuperClass, String Id, String name) throws BuildException;
+
+ boolean isToolChainCompatible(IToolChain tCh);
+
+ String getOutputExtension(String resourceExtension);
+
+ boolean isHeaderFile(String ext);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IHoldsOptions.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IHoldsOptions.java
index b32a0b7bc5b..e1ad66ae57d 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IHoldsOptions.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IHoldsOptions.java
@@ -16,30 +16,30 @@ package org.eclipse.cdt.managedbuilder.core;
/**
* Implements the functionality that is needed to hold options and option
* categories. The functionality has been moved from ITool to here in CDT 3.0.
- * Backwards compatibility of interfaces has been maintained because ITool
+ * Backwards compatibility of interfaces has been maintained because ITool
* extends IHoldOptions.
- *
+ *
* @since 3.0
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IHoldsOptions extends IBuildObject {
- public static final String OPTION = "option"; //$NON-NLS-1$
- public static final String OPTION_CAT = "optionCategory"; //$NON-NLS-1$
- public static final String OPTION_REF = "optionReference"; //$NON-NLS-1$
+ public static final String OPTION = "option"; //$NON-NLS-1$
+ public static final String OPTION_CAT = "optionCategory"; //$NON-NLS-1$
+ public static final String OPTION_REF = "optionReference"; //$NON-NLS-1$
/*
* 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
*/
-
+
/**
* Creates a child Option
- *
+ *
* @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
- *
+ *
* @return IOption
*/
public IOption createOption(IOption superClass, String Id, String name, boolean isExtensionElement);
@@ -50,11 +50,11 @@ public interface IHoldsOptions extends IBuildObject {
public void removeOption(IOption option);
/**
- * This is a deprecated method for retrieving an <code>IOption</code> from
- * the receiver based on an ID. It is preferred that you use the newer method
+ * This is a deprecated method for retrieving an <code>IOption</code> from
+ * the receiver based on an ID. It is preferred that you use the newer method
* <code>getOptionById</code>
* @see IHoldsOptions#getOptionById(java.lang.String)
- *
+ *
* @param id unique identifier of the option to search for
* @return <code>IOption</code>
* @deprecated use getOptionById() instead
@@ -63,13 +63,13 @@ public interface IHoldsOptions extends IBuildObject {
public IOption getOption(String id);
/**
- * Get the <code>IOption</code> in the receiver with the specified
+ * Get the <code>IOption</code> in the receiver with the specified
* ID. This is an efficient search in the receiver.
- *
- * <p>If the receiver does not have an option with that ID, the method
- * returns <code>null</code>. It is the responsibility of the caller to
- * verify the return value.
- *
+ *
+ * <p>If the receiver does not have an option with that ID, the method
+ * returns <code>null</code>. It is the responsibility of the caller to
+ * verify the return value.
+ *
* @param id unique identifier of the option to search for
* @return <code>IOption</code>
* @since 2.0
@@ -77,32 +77,32 @@ public interface IHoldsOptions extends IBuildObject {
public IOption getOptionById(String id);
/**
- * Get the <code>IOption</code> in the receiver with the specified
- * ID, or an option with a superclass with this id.
- *
- * <p>If the receiver does not have an option with that ID, the method
- * returns <code>null</code>. It is the responsibility of the caller to
- * verify the return value.
- *
+ * Get the <code>IOption</code> in the receiver with the specified
+ * ID, or an option with a superclass with this id.
+ *
+ * <p>If the receiver does not have an option with that ID, the method
+ * returns <code>null</code>. It is the responsibility of the caller to
+ * verify the return value.
+ *
* @param id unique identifier of the option to search for
* @return <code>IOption</code>
* @since 3.0
*/
public IOption getOptionBySuperClassId(String id);
-
+
/**
* Returns the complete list of options that are available for this object.
- * The list is a merging of the options specified for this object with the
+ * The list is a merging of the options specified for this object with the
* options of its superclasses. The lowest option instance in the hierarchy
- * takes precedence.
- *
+ * takes precedence.
+ *
* @return IOption[]
*/
- public IOption[] getOptions();
-
+ public IOption[] getOptions();
+
/**
* Returns the option category children of this tool.
- *
+ *
* @return IOptionCategory[]
*/
public IOptionCategory[] getChildCategories();
@@ -110,23 +110,23 @@ public interface IHoldsOptions extends IBuildObject {
/*
* M E T H O D S M O V E D F R O M T O O L I N 3 . 0
*/
-
+
/**
- * Adds the <code>IOptionCategory</code> to this Option Holder's
- * list of Option Categories.
- *
+ * Adds the <code>IOptionCategory</code> to this Option Holder's
+ * list of Option Categories.
+ *
* @param category The option category to be added
*/
public void addOptionCategory(IOptionCategory category);
-
+
/*
* N E W M E T H O D S A D D E D I N 3 . 0
*/
-
+
/**
- * Answers the <code>IOptionCategory</code> that has the unique identifier
- * specified in the argument.
- *
+ * Answers the <code>IOptionCategory</code> that has the unique identifier
+ * specified in the argument.
+ *
* @param id The unique identifier of the option category
* @return <code>IOptionCategory</code> with the id specified in the argument
* @since 3.0
@@ -136,36 +136,36 @@ public interface IHoldsOptions extends IBuildObject {
/**
* Creates options from the superclass and adds it to this class.
* Each individual option in superclass, will become the superclass for
- * the new option.
+ * the new option.
*
- * @param superClass The superClass
+ * @param superClass The superClass
* @since 3.0
*/
public void createOptions(IHoldsOptions superClass);
-
+
/**
* This method should be called in order to obtain the option whose value and attributes could be directly changed/adjusted
- *
+ *
* @param option -the option to be modified
- * @param adjustExtension - if false, modifications are to be made for the non-extension element
+ * @param adjustExtension - if false, modifications are to be made for the non-extension element
* (only for some particular configuration associated with some eclipse project)
* This is the most common use of this method.
- *
+ *
* True is allowed only while while handling the LOAD value handler event.
- * In this case modifications are to be made for the extension element.
- * This could be used for adjusting extension options
+ * In this case modifications are to be made for the extension element.
+ * This could be used for adjusting extension options
* Note: changing this option will affect all non-extension configurations using this option!
*/
IOption getOptionToSet(IOption option, boolean adjustExtension) throws BuildException;
-
+
/**
* specifies whether the option holder is modified and needs rebuild
- *
+ *
* @return boolean
*/
public boolean needsRebuild();
-
+
/**
* sets the holder rebuild state
*/
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IInputOrder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IInputOrder.java
index 9f7d13f59e9..70a946dc9b5 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IInputOrder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IInputOrder.java
@@ -17,31 +17,31 @@ package org.eclipse.cdt.managedbuilder.core;
* This interface represents an inputOrder instance in the managed build system.
* This element is only present if the user or a tool integrator needs to define
* the specific order of input files to a tool, or needs to exclude one or more
- * input files from being used by a tool. An inputType element can have
+ * input files from being used by a tool. An inputType element can have
* multiple inputOrder children.
- *
+ *
* @since 3.0
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IInputOrder {
- public static final String INPUT_ORDER_ELEMENT_NAME = "inputOrder"; //$NON-NLS-1$
- public static final String PATH = "path"; //$NON-NLS-1$
- public static final String ORDER = "order"; //$NON-NLS-1$
- public static final String EXCLUDED = "excluded"; //$NON-NLS-1$
+ public static final String INPUT_ORDER_ELEMENT_NAME = "inputOrder"; //$NON-NLS-1$
+ public static final String PATH = "path"; //$NON-NLS-1$
+ public static final String ORDER = "order"; //$NON-NLS-1$
+ public static final String EXCLUDED = "excluded"; //$NON-NLS-1$
/**
* Returns the InputType parent of this InputOrder.
- *
+ *
* @return IInputType
*/
public IInputType getParent();
/**
* Returns the relative or absolute path of the resource to which this element applies.
- * The resource must be a member of the project, or the output from another tool in the
+ * The resource must be a member of the project, or the output from another tool in the
* tool-chain.
- *
+ *
* @return String
*/
public String getPath();
@@ -50,21 +50,21 @@ public interface IInputOrder {
* Sets the relative or absolute path of the resource to which this element applies.
*/
public void setPath(String path);
-
+
/**
- * Returns a comma-separated list of integer values that specify the order of this resource.
- * In most cases, only a single integer value will be specified. A list is supported
- * for the case where a single input file needs to be specified multiple times on the
- * command line. The order numbers begin at 1. Not all values need to be specified.
+ * Returns a comma-separated list of integer values that specify the order of this resource.
+ * In most cases, only a single integer value will be specified. A list is supported
+ * for the case where a single input file needs to be specified multiple times on the
+ * command line. The order numbers begin at 1. Not all values need to be specified.
* Unordered resources will fill the first "gap". For example:
* - To specify the first input file, use 1.
* - To specify the last input file, without specifying an order for any other input file, use 2.
* - To specify only the first two input files and last input file, use 1, 2 & 4.
- *
+ *
* @return String
*/
public String getOrder();
-
+
/**
* Sets the comma-separated list of integer values that specify the order of this resource.
*/
@@ -72,8 +72,8 @@ public interface IInputOrder {
/**
* Returns <code>true</code> if this resource is not used as an input for the tool.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean getExcluded();
@@ -83,16 +83,16 @@ public interface IInputOrder {
public void setExcluded(boolean excluded);
/**
- * 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
*/
public boolean isDirty();
-
+
/**
* Sets the element's "dirty" (have I been modified?) flag.
*/
public void setDirty(boolean isDirty);
-
+
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IInputType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IInputType.java
index d5d8a938ac5..ffa563a33ea 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IInputType.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IInputType.java
@@ -19,36 +19,36 @@ import org.eclipse.core.runtime.content.IContentType;
/**
* This interface represents an inputType instance in the managed build system.
- * It describes one category of input files to a Tool. A tool can have
+ * It describes one category of input files to a Tool. A tool can have
* multiple inputType children.
- *
+ *
* @since 3.0
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IInputType extends IBuildObject {
- public static final String INPUT_TYPE_ELEMENT_NAME = "inputType"; //$NON-NLS-1$
- public static final String SOURCE_CONTENT_TYPE = "sourceContentType"; //$NON-NLS-1$
- public static final String HEADER_CONTENT_TYPE = "headerContentType"; //$NON-NLS-1$
- public static final String SOURCES = "sources"; //$NON-NLS-1$
- public static final String HEADERS = "headers"; //$NON-NLS-1$
- public static final String DEPENDENCY_CONTENT_TYPE = "dependencyContentType"; //$NON-NLS-1$
- public static final String DEPENDENCY_EXTENSIONS = "dependencyExtensions"; //$NON-NLS-1$
- public static final String OPTION = "option"; //$NON-NLS-1$
- public static final String ASSIGN_TO_OPTION = "assignToOption"; //$NON-NLS-1$
- public static final String MULTIPLE_OF_TYPE = "multipleOfType"; //$NON-NLS-1$
- public static final String PRIMARY_INPUT = "primaryInput"; //$NON-NLS-1$
- public static final String BUILD_VARIABLE = "buildVariable"; //$NON-NLS-1$
- public static final String LANGUAGE_ID = "languageId"; //$NON-NLS-1$
- public static final String LANGUAGE_NAME = "languageName"; //$NON-NLS-1$
- public static final String LANGUAGE_INFO_CALCULATOR = "languageInfoCalculator"; //$NON-NLS-1$
+ public static final String INPUT_TYPE_ELEMENT_NAME = "inputType"; //$NON-NLS-1$
+ public static final String SOURCE_CONTENT_TYPE = "sourceContentType"; //$NON-NLS-1$
+ public static final String HEADER_CONTENT_TYPE = "headerContentType"; //$NON-NLS-1$
+ public static final String SOURCES = "sources"; //$NON-NLS-1$
+ public static final String HEADERS = "headers"; //$NON-NLS-1$
+ public static final String DEPENDENCY_CONTENT_TYPE = "dependencyContentType"; //$NON-NLS-1$
+ public static final String DEPENDENCY_EXTENSIONS = "dependencyExtensions"; //$NON-NLS-1$
+ public static final String OPTION = "option"; //$NON-NLS-1$
+ public static final String ASSIGN_TO_OPTION = "assignToOption"; //$NON-NLS-1$
+ public static final String MULTIPLE_OF_TYPE = "multipleOfType"; //$NON-NLS-1$
+ public static final String PRIMARY_INPUT = "primaryInput"; //$NON-NLS-1$
+ public static final String BUILD_VARIABLE = "buildVariable"; //$NON-NLS-1$
+ public static final String LANGUAGE_ID = "languageId"; //$NON-NLS-1$
+ public static final String LANGUAGE_NAME = "languageName"; //$NON-NLS-1$
+ public static final String LANGUAGE_INFO_CALCULATOR = "languageInfoCalculator"; //$NON-NLS-1$
// The attribute name for the scanner info collector
public static final String SCANNER_CONFIG_PROFILE_ID = "scannerConfigDiscoveryProfileId"; //$NON-NLS-1$
-
+
/**
* Creates an inputOrder child for this InputType.
- *
+ *
* @param path The path associated with the InputOrder element
* @return IInputOrder of the new element
*/
@@ -56,36 +56,36 @@ public interface IInputType extends IBuildObject {
/**
* Removes the InputOrder element with the path specified in the argument.
- *
+ *
* @param path The path associated with the InputOrder element
*/
public void removeInputOrder(String path);
/**
* Removes the InputOrder element specified in the argument.
- *
+ *
* @param element The InputOrder element
*/
public void removeInputOrder(IInputOrder element);
/**
* Returns all of the InputOrder children of this InputType
- *
+ *
* @return IInputOrder[]
*/
public IInputOrder[] getInputOrders();
/**
* Returns the InputOrder element with the path specified in the argument.
- *
+ *
* @param path The path associated with the InputOrder element
* @return IInputOrder
*/
public IInputOrder getInputOrder(String path);
-
+
/**
* Creates an additionalInput child for this InputType.
- *
+ *
* @param path The path associated with the AdditionalInput element
* @return IAdditionalInput of the new element
*/
@@ -93,28 +93,28 @@ public interface IInputType extends IBuildObject {
/**
* Removes the AdditionalInput element with the path specified in the argument.
- *
+ *
* @param path The path associated with the AdditionalInput element
*/
public void removeAdditionalInput(String path);
/**
* Removes the AdditionalInput element specified in the argument.
- *
+ *
* @param element The AdditionalInput element
*/
public void removeAdditionalInput(IAdditionalInput element);
/**
* Returns all of the AdditionalInput children of this InputType
- *
+ *
* @return IAdditionalInput[]
*/
public IAdditionalInput[] getAdditionalInputs();
/**
* Returns the AdditionalInput element with the path specified in the argument.
- *
+ *
* @param path The path associated with the AdditionalInput element
* @return IAdditionalInput
*/
@@ -123,7 +123,7 @@ public interface IInputType extends IBuildObject {
/**
* Returns all of the additional input resources of this InputType.
* Note: This does not include additional dependencies.
- *
+ *
* @return IPath[]
*/
public IPath[] getAdditionalResources();
@@ -131,14 +131,14 @@ public interface IInputType extends IBuildObject {
/**
* Returns all of the additional dependency resources of this InputType.
* Note: This does not include additional inputs.
- *
+ *
* @return IPath[]
*/
public IPath[] getAdditionalDependencies();
/**
* Returns the tool parent of this InputType.
- *
+ *
* @return ITool
*/
public ITool getParent();
@@ -146,29 +146,29 @@ public interface IInputType extends IBuildObject {
/**
* Returns the <code>IInputType</code> that is the superclass of this
* InputType, or <code>null</code> if the attribute was not specified.
- *
+ *
* @return IInputType
*/
public IInputType getSuperClass();
-
+
/**
* Returns the Eclipse <code>IContentType</code> that describes this
- * input type. If both the sources attribute and the sourceContentType
- * attribute are specified, the sourceContentType will be used if it
- * is registered in Eclipse.
- *
+ * input type. If both the sources attribute and the sourceContentType
+ * attribute are specified, the sourceContentType will be used if it
+ * is registered in Eclipse.
+ *
* @return IContentType
*/
public IContentType getSourceContentType();
public IContentType[] getSourceContentTypes();
-
+
public IContentType[] getHeaderContentTypes();
-
+
public String[] getSourceContentTypeIds();
-
+
public String[] getHeaderContentTypeIds();
-
+
public String[] getHeaderExtensions(ITool tool);
public String[] getHeaderExtensionsAttribute();
@@ -176,58 +176,57 @@ public interface IInputType extends IBuildObject {
public void setSourceContentTypeIds(String[] ids);
public void setHeaderContentTypeIds(String[] ids);
-
+
public void setSourceExtensionsAttribute(String[] extensions);
public void setHeaderExtensionsAttribute(String[] extensions);
-
/**
* Sets the Eclipse <code>IContentType</code> that describes this
* input type.
- *
+ *
* @param contentType The Eclipse content type
*/
public void setSourceContentType(IContentType contentType);
-
+
/**
* Returns the list of valid source extensions from the
* sourceExtensions attribute. Note that this value is not used
* if source content type is specified and registered with Eclipse.
- * Also, the user will not be able to modify the set of file
+ * Also, the user will not be able to modify the set of file
* extensions as they can when sourceContentType is specified.
- *
+ *
* @return String[]
*/
public String[] getSourceExtensionsAttribute();
-
+
/**
* Sets the list of valid source extensions for this input type.
- * NOTE: The value of this attribute will NOT be used if a
+ * NOTE: The value of this attribute will NOT be used if a
* source content type is specified and is registered with
* Eclipse.
- *
+ *
* @param extensions The comma-separated list of valid file extensions
* - not including the separator period.
*/
public void setSourceExtensionsAttribute(String extensions);
-
+
/**
* Returns the list of valid source extensions for this input type.
- * Note that the list will come from the sourceContentType if it
- * is specified and registered with Eclipse. Otherwise the
+ * Note that the list will come from the sourceContentType if it
+ * is specified and registered with Eclipse. Otherwise the
* sourceExtensions attribute will be used.
- *
- * @param tool the tool that contains the input-type
+ *
+ * @param tool the tool that contains the input-type
* @return String[]
*/
public String[] getSourceExtensions(ITool tool);
-
+
/**
- * Answers <code>true</code> if the input type considers the file extension to be
+ * Answers <code>true</code> if the input type considers the file extension to be
* one associated with a source file.
- *
- * @param tool the tool that contains the input-type
+ *
+ * @param tool the tool that contains the input-type
* @param ext file extension of the source
* @return boolean
*/
@@ -237,56 +236,56 @@ public interface IInputType extends IBuildObject {
* Returns the Eclipse <code>IContentType</code> that describes the
* dependency files of this input type. If both the dependencyExtensions
* attribute and the dependencyContentType attribute are specified,
- * the dependencyContentType will be used if it is defined in Eclipse.
- *
+ * the dependencyContentType will be used if it is defined in Eclipse.
+ *
* @return IContentType
*/
public IContentType getDependencyContentType();
/**
* Sets the Eclipse <code>IContentType</code> that describes the
- * dependency files of this input type.
+ * dependency files of this input type.
*/
public void setDependencyContentType(IContentType type);
-
+
/**
* Returns the list of valid dependency extensions from the
* dependencyExtensions attribute. Note that this value is not used
* if dependency content type is specified and registered with Eclipse.
- * Also, the user will not be able to modify the set of file
+ * Also, the user will not be able to modify the set of file
* extensions as they can when dependencyContentType is specified.
- *
+ *
* @return String[]
*/
public String[] getDependencyExtensionsAttribute();
-
+
/**
* Sets the list of valid dependency extensions for this input type.
- * NOTE: The value of this attribute will NOT be used if a
+ * NOTE: The value of this attribute will NOT be used if a
* dependency content type is specified and is registered with
* Eclipse.
- *
+ *
* @param extensions The comma-separated list of valid dependency extensions
* - not including the separator period.
*/
public void setDependencyExtensionsAttribute(String extensions);
-
+
/**
* Returns the list of valid dependency extensions for this input type.
- * Note that the list will come from the dependencyContentType if it
- * is specified and registered with Eclipse. Otherwise the
+ * Note that the list will come from the dependencyContentType if it
+ * is specified and registered with Eclipse. Otherwise the
* dependencyExtensions attribute will be used.
- *
- * @param tool the tool that contains the input-type
+ *
+ * @param tool the tool that contains the input-type
* @return String[]
*/
public String[] getDependencyExtensions(ITool tool);
-
+
/**
- * Answers <code>true</code> if the input type considers the file extension to be
+ * Answers <code>true</code> if the input type considers the file extension to be
* one associated with a dependency file.
- *
- * @param tool the tool that contains the input-type
+ *
+ * @param tool the tool that contains the input-type
* @param ext file extension of the source
* @return boolean
*/
@@ -295,76 +294,76 @@ public interface IInputType extends IBuildObject {
/**
* Returns the id of the option that is associated with this input
* type on the command line. If specified, the name(s) of the input
- * files for this input type are taken from the value specified
+ * files for this input type are taken from the value specified
* for the option.
- *
+ *
* @return String
*/
public String getOptionId();
/**
- * Sets the id of the option that is associated with this input type on
- * the command line. If specified, the name(s) of the input files for
+ * Sets the id of the option that is associated with this input type on
+ * the command line. If specified, the name(s) of the input files for
* this input type are taken from the value specified for the option.
*/
public void setOptionId(String optionId);
/**
- * Returns the id of the option whose value is to be assigned to the
- * file(s) calculated for this input type. The default is not to
- * assign the input file(s) to a command line option but to assign the
+ * Returns the id of the option whose value is to be assigned to the
+ * file(s) calculated for this input type. The default is not to
+ * assign the input file(s) to a command line option but to assign the
* files to the ${Inputs} part of the command line. Note that the
* option value is only updated during build file generation and therefore
- * could be out of sync with the project until build file generation
+ * could be out of sync with the project until build file generation
* occurs.
- *
+ *
* @return String
*/
public String getAssignToOptionId();
/**
- * Sets the id of the option whose value is to be assigned to the
- * file(s) calculated for this input type. The default is not to
- * assign the input file(s) to a command line option but to assign the
+ * Sets the id of the option whose value is to be assigned to the
+ * file(s) calculated for this input type. The default is not to
+ * assign the input file(s) to a command line option but to assign the
* files to the ${Inputs} part of the command line. Note that the
* option value is only updated during build file generation and therefore
- * could be out of sync with the project until build file generation
+ * could be out of sync with the project until build file generation
* occurs.
*/
public void setAssignToOptionId(String optionId);
-
+
/**
* Returns <code>true</code> if this inputType can contain multiple input
- * resources, else <code>false</code>. The inputs can be project resources,
+ * resources, else <code>false</code>. The inputs can be project resources,
* or the outputs of other tools in the tool-chain.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean getMultipleOfType();
-
+
/**
* Sets whether this inputType can contain multiple input resources
*/
public void setMultipleOfType(boolean multiple);
-
+
/**
* Returns <code>true</code> if this inputType is considered the primary input
* of the tool, else <code>false</code>.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean getPrimaryInput();
-
+
/**
* Sets whether this inputType is considered the primary input of the tool
*/
public void setPrimaryInput(boolean primary);
/**
- * Returns a class instance that implements an interface to generate
- * source-level dependencies for this input type.
- * This method may return <code>null</code> in which case, the receiver
- * should assume that the input type does not require dependency information
+ * Returns a class instance that implements an interface to generate
+ * source-level dependencies for this input type.
+ * This method may return <code>null</code> in which case, the receiver
+ * should assume that the input type does not require dependency information
* when the project is built.
*
* @return IManagedDependencyGeneratorType
@@ -373,11 +372,11 @@ public interface IInputType extends IBuildObject {
/**
* Returns the name of the build variable associated this this input type's resources
- * The build variable used in the build file to represent the list of input files when
- * multipleOfType is True. The same variable name can be used by an outputType to
- * identify a set of output files that contribute to this tool's input
+ * The build variable used in the build file to represent the list of input files when
+ * multipleOfType is True. The same variable name can be used by an outputType to
+ * identify a set of output files that contribute to this tool's input
* (i.e., those using the same buildVariable name). The default name is chosen by MBS.
- *
+ *
* @return String
*/
public String getBuildVariable();
@@ -388,34 +387,34 @@ public interface IInputType extends IBuildObject {
public void setBuildVariable(String variableName);
/**
- * 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
*/
public boolean isDirty();
-
+
/**
* Returns <code>true</code> if this InputType was loaded from a manifest file,
* and <code>false</code> if it was loaded from a project (.cdtbuild) file.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean isExtensionElement();
-
+
/**
* Sets the element's "dirty" (have I been modified?) flag.
*/
public void setDirty(boolean isDirty);
-
+
String getLanguageId(ITool tool);
-
+
String getLanguageName(ITool tool);
-
+
String getDiscoveryProfileId(ITool tool);
void setLanguageIdAttribute(String id);
-
+
void setLanguageNameAttribute(String name);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildDefinitionsStartup.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildDefinitionsStartup.java
index 104b3593760..7c1fe5cbda4 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildDefinitionsStartup.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildDefinitionsStartup.java
@@ -19,24 +19,23 @@ package org.eclipse.cdt.managedbuilder.core;
* Implementing this interface will insure that a client's plugin is loaded
* before all available configurations are available to the first project that
* is loaded in the workbench.
- *
+ *
* An example of this use is when a client creates unique build configuration IDs,
* derived from default configruations, and all existing projects need to know about
* all possible build configurations at eclipse startup.
*/
public interface IManagedBuildDefinitionsStartup {
-
+
String BUILD_DEFINITION_STARTUP = "buildDefinitionStartup"; //$NON-NLS-1$
- String CLASS_ATTRIBUTE = "class"; //$NON-NLS-1$
-
+ String CLASS_ATTRIBUTE = "class"; //$NON-NLS-1$
+
/**
* Any work you want to do on build definitions after they have been loaded but before they have been resolved.
*/
void buildDefsLoaded();
-
+
/**
* Any work you want to do on build definitions after they have been resolved.
*/
void buildDefsResolved();
}
-
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java
index d5110377ddd..d6105318358 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java
@@ -31,32 +31,32 @@ import org.eclipse.core.runtime.IPath;
* 2. Call other methods (e.g. getBuildArtifactName) which get
* information from the default configuration, and the other managed
* build system model elements that can be reached from the
- * configuration.
- *
+ * configuration.
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IManagedBuildInfo {
- public static final String DEFAULT_CONFIGURATION = "defaultConfig"; //$NON-NLS-1$
- public static final String DEFAULT_TARGET = "defaultTarget"; //$NON-NLS-1$
+ public static final String DEFAULT_CONFIGURATION = "defaultConfig"; //$NON-NLS-1$
+ public static final String DEFAULT_TARGET = "defaultTarget"; //$NON-NLS-1$
/*
* Note: "Target" routines are only currently applicable when loading a CDT 2.0
* or earlier managed build project file (.cdtbuild)
*/
-
+
/**
* Add a new target to the build information for the receiver
- *
+ *
* @deprecated as of CDT 7.0
*/
@Deprecated
public void addTarget(ITarget target);
-
+
/**
- * @return <code>true</code> if the build system knows how to
+ * @return <code>true</code> if the build system knows how to
* build a file with the extension passed in the argument.
- *
+ *
* @deprecated as of CDT 7.0
*/
@Deprecated
@@ -67,179 +67,179 @@ public interface IManagedBuildInfo {
* The command line info contains values with
* build macros resolved to the makefile format.
* That is if a user has chosen to expand all macros in the buildfile,
- * command line info contains values contain all macro references resolved, otherwise, if a user has
+ * command line info contains values contain all macro references resolved, otherwise, if a user has
* chosen to keep the environment build macros unresolved, the command line info contains values contain
* the environment macro references converted to the buildfile variable format,
* all other macro references are resolved
- *
+ *
* @param sourceExtension - source extension
* @param flags - build flags
* @param outputFlag - output flag for build tool
* @return IManagedCommandLineInfo
- *
+ *
* @deprecated - use generateToolCommandLineInfo instead
*/
@Deprecated
- public IManagedCommandLineInfo generateCommandLineInfo( String sourceExtension, String[] flags,
- String outputFlag, String outputPrefix, String outputName, String[] inputResources );
+ public IManagedCommandLineInfo generateCommandLineInfo(String sourceExtension, String[] flags, String outputFlag,
+ String outputPrefix, String outputName, String[] inputResources);
/**
* Returns <code>IManagedCommandLineInfo</code> for source with extension
* The command line info contains values with
* build macros resolved to the makefile format.
* That is if a user has chosen to expand all macros in the buildfile,
- * command line info contains values contain all macro references resolved, otherwise, if a user has
+ * command line info contains values contain all macro references resolved, otherwise, if a user has
* chosen to keep the environment build macros unresolved, the command line info contains values contain
* the environment macro references converted to the buildfile variable format,
* all other macro references are resolved
*/
- public IManagedCommandLineInfo generateToolCommandLineInfo( String sourceExtension, String[] flags,
- String outputFlag, String outputPrefix, String outputName, String[] inputResources, IPath inputLocation, IPath outputLocation );
+ public IManagedCommandLineInfo generateToolCommandLineInfo(String sourceExtension, String[] flags,
+ String outputFlag, String outputPrefix, String outputName, String[] inputResources, IPath inputLocation,
+ IPath outputLocation);
/**
- * Answers a <code>String</code> containing the arguments to be passed to make.
- * For example, if the user has selected a build that keeps going on error, the
+ * Answers a <code>String</code> containing the arguments to be passed to make.
+ * For example, if the user has selected a build that keeps going on error, the
* answer would contain {"-k"}.
- *
+ *
* @return String
*/
public String getBuildArguments();
-
/**
* Answers the file extension for the receivers build goal without a separator.
- *
+ *
* @return the extension or an empty string if none is defined
*/
public String getBuildArtifactExtension();
-
+
/**
* Returns the name of the artifact to build for the receiver.
- *
+ *
* @return Name of the build artifact
*/
public String getBuildArtifactName();
/**
- * Answers a <code>String</code> containing the make command invocation
+ * Answers a <code>String</code> containing the make command invocation
* for the default configuration.
* @return build command
*/
public String getBuildCommand();
/**
- * Answers the prebuild step for the default configuration
- *
- * @return String
- */
- public String getPrebuildStep();
-
- /**
- * Answers the postbuild step for the default configuration
- *
- * @return String
- */
- public String getPostbuildStep();
-
- /**
- * Answers the display string associated with the prebuild step for the default configuration
- *
- * @return String
- */
- public String getPreannouncebuildStep();
-
- /**
- * Answers the display string associated with the postbuild step for the default configuration
- *
- * @return String
- */
- public String getPostannouncebuildStep();
-
- /**
+ * Answers the prebuild step for the default configuration
+ *
+ * @return String
+ */
+ public String getPrebuildStep();
+
+ /**
+ * Answers the postbuild step for the default configuration
+ *
+ * @return String
+ */
+ public String getPostbuildStep();
+
+ /**
+ * Answers the display string associated with the prebuild step for the default configuration
+ *
+ * @return String
+ */
+ public String getPreannouncebuildStep();
+
+ /**
+ * Answers the display string associated with the postbuild step for the default configuration
+ *
+ * @return String
+ */
+ public String getPostannouncebuildStep();
+
+ /**
* Answers the command needed to remove files on the build machine
*/
public String getCleanCommand();
/**
- * Answers the name of the default configuration, for example <code>Debug</code>
+ * Answers the name of the default configuration, for example <code>Debug</code>
* or <code>Release</code>.
- *
+ *
* @return String name of default configuration
*/
public String getConfigurationName();
-
+
/**
* Answers a <code>String</code> array containing the names of all the configurations
* defined for the project.
- *
+ *
* @return String[] of configuration names
*/
public String[] getConfigurationNames();
/**
* Get the default configuration associated with the receiver
- *
+ *
* @return IConfiguration default
*/
public IConfiguration getDefaultConfiguration();
-
+
public IManagedDependencyGeneratorType getDependencyGenerator(String sourceExtension);
/**
- * Returns a <code>String</code> containing the flags, including
+ * Returns a <code>String</code> containing the flags, including
* those overridden by the user, for the tool in the configuration
* defined by the argument.
* The string contains build macros resolved to the makefile format.
* That is if a user has chosen to expand all macros in the buildfile,
- * the string contains all macro references resolved, otherwise, if a user has
+ * the string contains all macro references resolved, otherwise, if a user has
* chosen to keep the environment build macros unresolved, the string contains
* the environment macro references converted to the buildfile variable format,
- * all other macro references are resolved
- *
+ * all other macro references are resolved
+ *
* @deprecated - use getToolFlagsForConfiguration
*/
@Deprecated
public String getFlagsForConfiguration(String extension);
-
+
/**
- * Returns a <code>String</code> containing the flags, including
+ * Returns a <code>String</code> containing the flags, including
* those overridden by the user, for the tool in the configuration
* defined by the argument.
* The string contains build macros resolved to the makefile format.
* That is if a user has chosen to expand all macros in the buildfile,
- * the string contains all macro references resolved, otherwise, if a user has
+ * the string contains all macro references resolved, otherwise, if a user has
* chosen to keep the environment build macros unresolved, the string contains
* the environment macro references converted to the buildfile variable format,
- * all other macro references are resolved
+ * all other macro references are resolved
*/
public String getToolFlagsForConfiguration(String extension, IPath inputLocation, IPath outputLocation);
/**
- * Returns a <code>String</code> containing the flags, including
- * those overridden by the user, for the tool that handles the
+ * Returns a <code>String</code> containing the flags, including
+ * those overridden by the user, for the tool that handles the
* type of source file defined by the argument.
* The string contains build macros resolved to the makefile format.
* That is if a user has chosen to expand all macros in the buildfile,
- * the string contains all macro references resolved, otherwise, if a user has
+ * the string contains all macro references resolved, otherwise, if a user has
* chosen to keep the environment build macros unresolved, the string contains
* the environment macro references converted to the buildfile variable format,
- * all other macro references are resolved
- *
+ * all other macro references are resolved
+ *
* @deprecated - use getToolFlagsForSource
*/
@Deprecated
public String getFlagsForSource(String extension);
/**
- * Returns a <code>String</code> containing the flags, including
- * those overridden by the user, for the tool that handles the
+ * Returns a <code>String</code> containing the flags, including
+ * those overridden by the user, for the tool that handles the
* type of source file defined by the argument.
* The string contains build macros resolved to the makefile format.
* That is if a user has chosen to expand all macros in the buildfile,
- * the string contains all macro references resolved, otherwise, if a user has
+ * the string contains all macro references resolved, otherwise, if a user has
* chosen to keep the environment build macros unresolved, the string contains
* the environment macro references converted to the buildfile variable format,
- * all other macro references are resolved
+ * all other macro references are resolved
*/
public String getToolFlagsForSource(String extension, IPath inputLocation, IPath outputLocation);
@@ -250,45 +250,45 @@ public interface IManagedBuildInfo {
/**
* Returns the ManagedProject associated with this build info
- *
+ *
* @return IManagedProject
*/
- public IManagedProject getManagedProject( );
-
+ public IManagedProject getManagedProject();
+
/**
* Answers the extension that will be built by the current configuration
* for the extension passed in the argument or <code>null</code>.
*/
public String getOutputExtension(String resourceExtension);
-
+
/**
- * Answers the flag to be passed to the build tool to produce a specific output
+ * Answers the flag to be passed to the build tool to produce a specific output
* or an empty <code>String</code> if there is no special flag. For example, the
* GCC tools use the '-o' flag to produce a named output, for example
* gcc -c foo.c -o foo.o
*/
public String getOutputFlag(String outputExt);
-
+
/**
- * Answers the prefix that should be prepended to the name of the build
- * artifact. For example, a library foo, should have the prefix 'lib' and
- * the extension '.a', so the final goal would be 'libfoo.a'
- *
+ * Answers the prefix that should be prepended to the name of the build
+ * artifact. For example, a library foo, should have the prefix 'lib' and
+ * the extension '.a', so the final goal would be 'libfoo.a'
+ *
* @return the prefix or an empty string
*/
public String getOutputPrefix(String outputExtension);
-
+
/**
* Returns the currently selected configuration. This is used while the project
* property pages are displayed
- *
+ *
* @return IConfiguration
*/
public IConfiguration getSelectedConfiguration();
/**
* @return the target specified in the argument.
- *
+ *
* @deprecated as of CDT 7.0
*/
@Deprecated
@@ -297,43 +297,43 @@ public interface IManagedBuildInfo {
/**
* Get all of the targets associated with the receiver.
* @return List<ITarget>
- *
+ *
* @deprecated as of CDT 7.0
*/
@Deprecated
public List<ITarget> getTargets();
/**
- * Returns a <code>String</code> containing the command-line invocation
+ * Returns a <code>String</code> containing the command-line invocation
* for the tool associated with the output extension.
- *
+ *
* @param extension the file extension of the output file
* @return a String containing the command line invocation for the tool
*/
public String getToolForConfiguration(String extension);
/**
- * Returns a <code>String</code> containing the command-line invocation
+ * Returns a <code>String</code> containing the command-line invocation
* for the tool associated with the source extension.
- *
+ *
* @param sourceExtension the file extension of the file to be built
* @return a String containing the command line invocation for the tool
*/
public String getToolForSource(String sourceExtension);
-
+
/**
- * Returns a <code>ITool</code> for the tool associated with the
+ * Returns a <code>ITool</code> for the tool associated with the
* input extension.
- *
+ *
* @param extension the file extension of the input file
* @return ITool
*/
public ITool getToolFromInputExtension(String extension);
-
+
/**
- * Returns a <code>ITool</code> for the tool associated with the
+ * Returns a <code>ITool</code> for the tool associated with the
* output extension.
- *
+ *
* @param extension the file extension of the output file
* @return ITool
*/
@@ -341,89 +341,88 @@ public interface IManagedBuildInfo {
/**
* @param extension the file extension of the build target
- *
- * @return a <code>String</code> array containing the contents of the
+ *
+ * @return a <code>String</code> array containing the contents of the
* user objects option, if one is defined for the target.
*/
public String[] getUserObjectsForConfiguration(String extension);
-
/**
- * Answers the version of the build information in the format
- * @return a <code>String</code> containing the build information
+ * Answers the version of the build information in the format
+ * @return a <code>String</code> containing the build information
* version
*/
public String getVersion();
-
+
/**
* Answers true if the build model has been changed by the user.
- *
+ *
* @return boolean
*/
public boolean isDirty();
-
+
/**
- * Answers <code>true</code> if the extension matches one of the special
- * file extensions the tools for the configuration consider to be a header file.
- *
+ * Answers <code>true</code> if the extension matches one of the special
+ * file extensions the tools for the configuration consider to be a header file.
+ *
* @param ext the file extension of the resource
* @return boolean
*/
public boolean isHeaderFile(String ext);
-
+
/**
* Gets the read only status of Managed Build Info
- *
+ *
* @return <code>true</code> if Managed Build Info is read only
* otherwise returns <code>false</code>
*/
public boolean isReadOnly();
-
+
/**
* Gets the "valid" status of Managed Build Info. Managed Build Info is invalid
- * if the loading of, or conversion to, the Managed Build Info failed.
- *
+ * if the loading of, or conversion to, the Managed Build Info failed.
+ *
* @return <code>true</code> if Managed Build Info is valid,
* otherwise returns <code>false</code>
*/
public boolean isValid();
-
+
/**
- * Answers whether the receiver has been changed and requires the
- * project to be rebuilt. When a project is first created, it is
- * assumed that the user will need it to be fully rebuilt. However
- * only option and tool command changes will trigger the build
+ * Answers whether the receiver has been changed and requires the
+ * project to be rebuilt. When a project is first created, it is
+ * assumed that the user will need it to be fully rebuilt. However
+ * only option and tool command changes will trigger the build
* information for an existing project to require a rebuild.
* <p>
- * Clients can reset the state to force or clear the rebuild status
+ * Clients can reset the state to force or clear the rebuild status
* using <code>setRebuildState()</code>
* @see ManagedBuildInfo#setRebuildState(boolean)
- *
- * @return <code>true</code> if the resource managed by the
+ *
+ * @return <code>true</code> if the resource managed by the
* receiver needs to be rebuilt
*/
public boolean needsRebuild();
public void removeTarget(String id);
-
+
/**
* Set the primary configuration for the receiver.
- *
+ *
* @param configuration The <code>IConfiguration</code> that will be used as the default
* for all building.
*/
public void setDefaultConfiguration(IConfiguration configuration);
-
+
/**
* @return boolean indicating if setDefaultConfiguration was successful
*/
public boolean setDefaultConfiguration(String configName);
-
+
/**
* Sets the dirty flag for the build model to the value of the argument.
*/
public void setDirty(boolean isDirty);
-
+
/**
* Sets the valid flag for the build model to the value of the argument.
*/
@@ -433,26 +432,26 @@ public interface IManagedBuildInfo {
* Sets the ManagedProject associated with this build info
*/
public void setManagedProject(IManagedProject project);
-
+
/**
* sets the read only status of Managed Build Info
*/
public void setReadOnly(boolean readOnly);
-
+
/**
- * Sets the rebuild state in the receiver to the value of the argument.
- * This is a potentially expensive option, so setting it to true should
- * only be done if a project resource or setting has been modified in a
- * way that would invalidate the previous build.
- *
+ * Sets the rebuild state in the receiver to the value of the argument.
+ * This is a potentially expensive option, so setting it to true should
+ * only be done if a project resource or setting has been modified in a
+ * way that would invalidate the previous build.
+ *
* @param rebuild <code>true</code> will force a rebuild the next time the project builds
*/
public void setRebuildState(boolean rebuild);
-
+
/**
- * Sets the currently selected configuration. This is used while the project
+ * Sets the currently selected configuration. This is used while the project
* property pages are displayed
- *
+ *
* @param configuration the user selection
*/
public void setSelectedConfiguration(IConfiguration configuration);
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedCommandLineGenerator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedCommandLineGenerator.java
index af8cb1bc3b5..acadf0c0354 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedCommandLineGenerator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedCommandLineGenerator.java
@@ -14,6 +14,7 @@
package org.eclipse.cdt.managedbuilder.core;
public interface IManagedCommandLineGenerator {
- public IManagedCommandLineInfo generateCommandLineInfo( ITool tool, String commandName, String[] flags,
- String outputFlag, String outputPrefix, String outputName, String[] inputResources, String commandLinePattern );
+ public IManagedCommandLineInfo generateCommandLineInfo(ITool tool, String commandName, String[] flags,
+ String outputFlag, String outputPrefix, String outputName, String[] inputResources,
+ String commandLinePattern);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedCommandLineInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedCommandLineInfo.java
index 625113993d2..4cfce2cdbca 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedCommandLineInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedCommandLineInfo.java
@@ -23,37 +23,37 @@ public interface IManagedCommandLineInfo {
* @return command line
*/
public String getCommandLine();
-
+
/**
- * give command line pattern
+ * give command line pattern
*/
public String getCommandLinePattern();
-
+
/**
* provide tool name
*/
public String getCommandName();
-
+
/**
* give command flags
*/
public String getFlags();
-
+
/**
* provide list of resources used by tool for transformation
*/
public String getInputs();
-
+
/**
* return output file name
*/
public String getOutput();
-
+
/**
* give command flag to generate output
*/
public String getOutputFlag();
-
+
/**
* return output prefix
*/
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedConfigElement.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedConfigElement.java
index 7c96a213bc0..d3774619b1f 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedConfigElement.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedConfigElement.java
@@ -17,29 +17,29 @@ package org.eclipse.cdt.managedbuilder.core;
* This class represents a configuration element for loading the managed build
* model objects. They can either be loaded from the ManagedBuildInfo extension
* point, or from an instance of IManagedConfigProvider.
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IManagedConfigElement {
-
+
/**
- * @return the name of this config element (i.e. tag name of the
+ * @return the name of this config element (i.e. tag name of the
* corresponding xml element)
*/
String getName();
-
+
/**
* @return the value of the attribute with the given name, or null
* if the attribute is unset.
*/
String getAttribute(String name);
-
+
/**
* @return all child elements of the current config element.
*/
IManagedConfigElement[] getChildren();
-
+
/**
* @return all child elements of the current config element, such that
* <code>child.getName().equals(elementName)</code>.
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedConfigElementProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedConfigElementProvider.java
index 90b2df976e1..b9735f0dc0c 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedConfigElementProvider.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedConfigElementProvider.java
@@ -12,17 +12,18 @@
* TimeSys Corporation - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.core;
+
/**
* Clients may implement this interface to dynamically provided the config
* information that is otherwise specified in the ManagedBuidInfo extension
- * point. It corresponds to the <code>configProvider</code> sub-element of
+ * point. It corresponds to the <code>configProvider</code> sub-element of
* the ManagedBuildInfo extension point.
*/
public interface IManagedConfigElementProvider {
-
- String ELEMENT_NAME = "dynamicElementProvider"; //$NON-NLS-1$
- String CLASS_ATTRIBUTE = "class"; //$NON-NLS-1$
-
+
+ String ELEMENT_NAME = "dynamicElementProvider"; //$NON-NLS-1$
+ String CLASS_ATTRIBUTE = "class"; //$NON-NLS-1$
+
/**
* Each configuration element returned from this method is treated as if
* it were a direct sub-child of a ManagedBuildInfo extension. As such
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedIsToolChainSupported.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedIsToolChainSupported.java
index 3a1d47e9718..ce84459a74e 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedIsToolChainSupported.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedIsToolChainSupported.java
@@ -16,14 +16,14 @@ package org.eclipse.cdt.managedbuilder.core;
import org.osgi.framework.Version;
/**
- *
+ *
* @since 3.0
*/
public interface IManagedIsToolChainSupported {
/**
* @return <code>true</code> if the given tool-chain is supported on the system
* otherwise returns <code>false</code>
- *
+ *
* @since 8.0
*/
public boolean isSupported(IToolChain toolChain, Version version, String instance);
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedOptionValueHandler.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedOptionValueHandler.java
index 61e4d9d1905..4b4075a7855 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedOptionValueHandler.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedOptionValueHandler.java
@@ -17,7 +17,7 @@ package org.eclipse.cdt.managedbuilder.core;
* This interface represents an option value handler in the managed build
* system. It is used to enable a tool integrator to use the MBS configuration
* GUI, while linking to an alternative back-end.
- *
+ *
* @since 3.0
*/
public interface IManagedOptionValueHandler {
@@ -61,7 +61,7 @@ public interface IManagedOptionValueHandler {
/**
* Handles transfer between values between UI element and back-end in
* different circumstances.
- *
+ *
* @param configuration
* build configuration of option (may be IConfiguration or
* IResourceConfiguration)
@@ -73,16 +73,16 @@ public interface IManagedOptionValueHandler {
* extra argument for handler
* @param event
* event to be handled
- *
+ *
* @return True when the event was handled, false otherwise. This enables
* default event handling can take place.
*/
- boolean handleValue(IBuildObject configuration, IHoldsOptions holder,
- IOption option, String extraArgument, int event);
+ boolean handleValue(IBuildObject configuration, IHoldsOptions holder, IOption option, String extraArgument,
+ int event);
/**
* Checks whether the value of an option is its default value.
- *
+ *
* @param configuration
* build configuration of option (may be IConfiguration or
* IResourceConfiguration)
@@ -92,24 +92,23 @@ public interface IManagedOptionValueHandler {
* the option that is handled
* @param extraArgument
* extra argument for handler
- *
+ *
* The additional options besides configuration are supplied to
* provide enough information for querying the default value from
* a potential data storage back-end.
- *
+ *
* @return True if the options value is its default value and False
* otherwise. This enables that default event handling can take
* place.
*/
- boolean isDefaultValue(IBuildObject configuration, IHoldsOptions holder,
- IOption option, String extraArgument);
+ boolean isDefaultValue(IBuildObject configuration, IHoldsOptions holder, IOption option, String extraArgument);
/**
* Checks whether an enumeration value of an option is currently a valid
* choice. The use-case for this method is the case, where the set of valid
* enumerations in the plugin.xml file changes. The UI will remove entries
* from selection lists if the value returns false.
- *
+ *
* @param configuration
* build configuration of option (may be IConfiguration or
* IResourceConfiguration)
@@ -121,14 +120,13 @@ public interface IManagedOptionValueHandler {
* extra argument for handler
* @param enumValue
* enumeration value that is to be checked
- *
+ *
* The additional options besides configuration are supplied to
* provide enough information for querying information from a a
* potential data storage back-end.
- *
+ *
* @return True if the enumeration value is valid and False otherwise.
*/
- boolean isEnumValueAppropriate(IBuildObject configuration,
- IHoldsOptions holder, IOption option, String extraArgument,
- String enumValue);
+ 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/IManagedOutputNameProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedOutputNameProvider.java
index 8198f51f847..82baa9e2611 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedOutputNameProvider.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedOutputNameProvider.java
@@ -16,5 +16,5 @@ package org.eclipse.cdt.managedbuilder.core;
import org.eclipse.core.runtime.IPath;
public interface IManagedOutputNameProvider {
- public IPath[] getOutputNames( ITool tool, IPath[] primaryInputNames );
+ public IPath[] getOutputNames(ITool tool, IPath[] primaryInputNames);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedProject.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedProject.java
index 9438ec0ada8..02ca123eac9 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedProject.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IManagedProject.java
@@ -17,33 +17,34 @@ import org.eclipse.core.resources.IResource;
/**
* This class represents a project instance in the managed build system.
- * Project instances are stored in the .cdtbuild file. Note that there
- * is no reason to define a project element in a manifest file - it
+ * Project instances are stored in the .cdtbuild file. Note that there
+ * is no reason to define a project element in a manifest file - it
* would never be used.
* <p>
- * The following steps occur when a CDT user creates a new Managed Build
+ * The following steps occur when a CDT user creates a new Managed Build
* project:
* 1. A new project element is created. Its projectType attribute is set
- * to the projectType that the user selected. Its name attribute is
+ * to the projectType that the user selected. Its name attribute is
* set to the project name that the user entered.
* 2. When the user adds a default configuration, a configuration
- * element is created as a child of the project element created in
+ * element is created as a child of the project element created in
* step 1.
- * 3. Add a tool-chain element that specifies as its superClass the
+ * 3. Add a tool-chain element that specifies as its superClass the
* tool-chain that is the child of the selected configuration element.
- * 4. For each tool element child of the tool-chain that is the child of
- * the selected configuration element, create a tool element child of
- * the cloned configuration's tool-chain element that specifies the
+ * 4. For each tool element child of the tool-chain that is the child of
+ * the selected configuration element, create a tool element child of
+ * the cloned configuration's tool-chain element that specifies the
* original tool element as its superClass.
- * This prepares the new project/configurations for modification by the user.
- *
+ * This prepares the new project/configurations for modification by the user.
+ *
* @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.
*/
-public interface IManagedProject extends IBuildObject, IBuildObjectPropertiesContainer, IOptionalBuildObjectPropertiesContainer {
- public static final String MANAGED_PROJECT_ELEMENT_NAME = "project"; //$NON-NLS-1$
- public static final String PROJECTTYPE = "projectType"; //$NON-NLS-1$
+public interface IManagedProject
+ extends IBuildObject, IBuildObjectPropertiesContainer, IOptionalBuildObjectPropertiesContainer {
+ public static final String MANAGED_PROJECT_ELEMENT_NAME = "project"; //$NON-NLS-1$
+ public static final String PROJECTTYPE = "projectType"; //$NON-NLS-1$
public static final String BUILD_PROPERTIES = "buildProperties"; //$NON-NLS-1$
/**
* @since 8.6
@@ -51,30 +52,29 @@ public interface IManagedProject extends IBuildObject, IBuildObjectPropertiesCon
public static final String OPTIONAL_BUILD_PROPERTIES = "optionalBuildProperties"; //$NON-NLS-1$
public static final String BUILD_ARTEFACT_TYPE = "buildArtefactType"; //$NON-NLS-1$
-
/**
* Creates a configuration for this project populated with the tools
- * and options settings from the parent configuration. As options and
- * tools change in the parent, unoverridden values are updated in the
+ * and options settings from the parent configuration. As options and
+ * tools change in the parent, unoverridden values are updated in the
* child configuration as well.
* <p>
* This method performs steps 3 & 4 described above.
- *
+ *
* @param parent The <code>IConfiguration</code> to use as a settings template
* @param id The unique id the new configuration will have
* @return IConfiguration of the new configuration
*/
public IConfiguration createConfiguration(IConfiguration parent, String id);
-
+
/**
* Creates a configuration for this project populated with the tools
- * and options settings from the parent configuration. As opposed to the
+ * and options settings from the parent configuration. As opposed to the
* <code>createConfiguration</code> method, this method creates a configuration
* from an existing configuration in the project.
* <p>
* In this case, the new configuration is cloned from the existing configuration,
* and does not retain a pointer to the existing configuration.
- *
+ *
* @param parent The <code>IConfiguration</code> to clone
* @param id The unique id the new configuration will have
* @return IConfiguration of the new configuration
@@ -83,21 +83,21 @@ public interface IManagedProject extends IBuildObject, IBuildObjectPropertiesCon
/**
* Removes the configuration with the ID specified in the argument.
- *
+ *
* @param id The unique id of the configuration
*/
public void removeConfiguration(String id);
/**
* Returns all of the configurations defined by this project-type.
- *
+ *
* @return IConfiguration[]
*/
public IConfiguration[] getConfigurations();
/**
* Returns the configuration with the given id, or <code>null</code> if not found.
- *
+ *
* @param id The unique id of the configuration
* @return IConfiguration
*/
@@ -106,14 +106,14 @@ public interface IManagedProject extends IBuildObject, IBuildObjectPropertiesCon
/**
* Answers the <code>IProjectType</code> that is the superclass of this
* project-type, or <code>null</code> if the attribute was not specified.
- *
+ *
* @return IProjectType
*/
public IProjectType getProjectType();
/**
* Returns the owner of the managed project (an IProject).
- *
+ *
* @return IResource
*/
public IResource getOwner();
@@ -124,42 +124,42 @@ public interface IManagedProject extends IBuildObject, IBuildObjectPropertiesCon
public void updateOwner(IResource resource);
/**
- * Returns <code>true</code> if this project has changes that need to
+ * Returns <code>true</code> if this project has changes that need to
* be saved in the project file, else <code>false</code>.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean isDirty();
-
+
/**
* Sets the element's "dirty" (have I been modified?) flag.
*/
public void setDirty(boolean isDirty);
/**
- * Returns <code>true</code> if this project is valid
+ * Returns <code>true</code> if this project is valid
* else <code>false</code>.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean isValid();
-
+
/**
* Sets the element's "Valid" flag.
*/
public void setValid(boolean isValid);
-// /**
-// * Persist the managed project to the project file (.cdtbuild).
-// *
-// * @param doc
-// * @param element
-// */
-// public void serialize(Document doc, Element element);
+ // /**
+ // * Persist the managed project to the project file (.cdtbuild).
+ // *
+ // * @param doc
+ // * @param element
+ // */
+ // public void serialize(Document doc, Element element);
/**
* Returns the default build artifact name for the project
- *
+ *
* @return String
*/
public String getDefaultArtifactName();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IModificationStatus.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IModificationStatus.java
index 0be25064d74..df6f7aca3f7 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IModificationStatus.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IModificationStatus.java
@@ -26,24 +26,23 @@ public interface IModificationStatus extends IStatus {
/**
* flags should be obtained via {@link IStatus#getCode()}
*/
-
-
+
public static final int TOOLS_CONFLICT = 1;
public static final int PROPS_NOT_SUPPORTED = 1 << 1;
public static final int REQUIRED_PROPS_NOT_SUPPORTED = 1 << 2;
-
+
/**
* some properties used in the toolChain are not defined in the System
*/
public static final int PROPS_NOT_DEFINED = 1 << 3;
-
+
/**
* some tools do not support Managed Build Mode
*/
public static final int TOOLS_DONT_SUPPORT_MANAGED_BUILD = 1 << 4;
/**
- *
+ *
* @return Map containing property Id to property Value associations.
* If value is not null then the given value is not supported
* If Value is not null then the fiven property is not supported
@@ -51,7 +50,7 @@ public interface IModificationStatus extends IStatus {
Map<String, String> getUnsupportedProperties();
/**
- *
+ *
* @return Map containing property Id to property Value associations.
* If value is not null then the given value is not supported
* If Value is not null then the fiven property is not supported
@@ -59,12 +58,12 @@ public interface IModificationStatus extends IStatus {
Map<String, String> getUnsupportedRequiredProperties();
/**
- *
+ *
* @return Set containing undefined property IDs
*/
Set<String> getUndefinedProperties();
ITool[][] getToolsConflicts();
-
+
ITool[] getNonManagedBuildTools();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IMultiConfiguration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IMultiConfiguration.java
index 3f95cca17df..20b7ea0c6ab 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IMultiConfiguration.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IMultiConfiguration.java
@@ -21,22 +21,23 @@ import org.eclipse.cdt.managedbuilder.internal.core.Builder;
/**
* This class is to combine multiple configurations to one to support
* selection of multiple configurations on property pages.
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IMultiConfiguration extends IConfiguration, ICMultiItemsHolder {
-
+
/**
* Check if all configurations' builders are operating in parallel mode.
* @return {@code true} if parallel mode is enabled for all configurations,
* {@code false} otherwise.
*/
boolean getParallelDef();
+
/**
* Set same parallel execution mode for all configurations' builders.
* @see Builder#setParallelBuildOn(boolean)
- *
+ *
* @param parallel - the flag to enable or disable parallel mode.
*/
void setParallelDef(boolean parallel);
@@ -44,38 +45,43 @@ public interface IMultiConfiguration extends IConfiguration, ICMultiItemsHolder
/**
* Returns maximum number of parallel threads/jobs used by the configurations' builders.
* @see #setParallelDef(boolean)
- *
+ *
* @return - maximum number of parallel threads or jobs used by each builder or 0 if the numbers
- * don't match.
+ * don't match.
*/
int getParallelNumber();
/**
* Sets maximum number of parallel threads/jobs to be used by each builder.
- *
+ *
* @param jobs - maximum number of jobs or threads, see for more details
* {@link Builder#getOptimalParallelJobNum()}.
*/
void setParallelNumber(int jobs);
-
+
/**
* Check if all configurations' internal builders are operating in parallel mode.
* @return {@code true} if parallel mode is enabled for all configurations,
* {@code false} otherwise.
- *
+ *
* @deprecated since CDT 9.0. Use {@link #getParallelDef()}
*/
@Deprecated
boolean getInternalBuilderParallel();
boolean isInternalBuilderEnabled();
+
boolean canEnableInternalBuilder(boolean v);
- void enableInternalBuilder(boolean v);
-
- void setOutputPrefixForPrimaryOutput(String pref);
- String getToolOutputPrefix();
-
+
+ void enableInternalBuilder(boolean v);
+
+ void setOutputPrefixForPrimaryOutput(String pref);
+
+ String getToolOutputPrefix();
+
IBuildProperty getBuildProperty(String id);
- void setBuildProperty(String id, String val);
+
+ void setBuildProperty(String id, String val);
+
IBuildPropertyValue[] getSupportedValues(String id);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOption.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOption.java
index 25b1c79324f..d296ff09c0d 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOption.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOption.java
@@ -74,21 +74,21 @@ public interface IOption extends IBuildObject {
// Browse type
public static final int BROWSE_NONE = 0;
- public static final String NONE = "none"; //$NON-NLS-1$
+ public static final String NONE = "none"; //$NON-NLS-1$
public static final int BROWSE_FILE = 1;
- public static final String FILE = "file"; //$NON-NLS-1$
+ public static final String FILE = "file"; //$NON-NLS-1$
public static final int BROWSE_DIR = 2;
- public static final String DIR = "directory"; //$NON-NLS-1$
+ public static final String DIR = "directory"; //$NON-NLS-1$
// Resource Filter type
public static final int FILTER_ALL = 0;
- public static final String ALL = "all"; //$NON-NLS-1$
+ public static final String ALL = "all"; //$NON-NLS-1$
public static final int FILTER_FILE = 1;
public static final int FILTER_PROJECT = 2;
- public static final String PROJECT = "project"; //$NON-NLS-1$
+ public static final String PROJECT = "project"; //$NON-NLS-1$
// Schema attribute names for option elements
- public static final String BROWSE_TYPE = "browseType"; //$NON-NLS-1$
+ public static final String BROWSE_TYPE = "browseType"; //$NON-NLS-1$
/** @since 7.0 */
public static final String BROWSE_FILTER_PATH = "browseFilterPath"; //$NON-NLS-1$
/** @since 7.0 */
@@ -210,7 +210,7 @@ public interface IOption extends IBuildObject {
*
* If this option is not defined as an enumeration, it returns <code>null</code>.
*/
- public String [] getApplicableValues();
+ public String[] getApplicableValues();
/**
* @return the value for a boolean option.
@@ -367,7 +367,7 @@ public interface IOption extends IBuildObject {
* manifest defined that as -g, then the return value would be the
* String "-g"
*/
- public String getEnumCommand (String id) throws BuildException;
+ public String getEnumCommand(String id) throws BuildException;
/**
* Returns the command associated with the child of this option
@@ -384,13 +384,13 @@ public interface IOption extends IBuildObject {
* @throws BuildException if this option is not of type {@link #TREE} or {@link #ENUMERATED}
* @since 8.1
*/
- public String getCommand (String id) throws BuildException;
+ public String getCommand(String id) throws BuildException;
/**
* @param id - enumeration id
* @return the "name" associated with the enumeration id.
*/
- public String getEnumName (String id) throws BuildException;
+ public String getEnumName(String id) throws BuildException;
/**
* Returns the name associated with the child of this option
@@ -432,7 +432,7 @@ public interface IOption extends IBuildObject {
* @return an array or <code>String</code>s containing the libraries
* that must be linked into the project.
*/
- public String[] getLibraries() throws BuildException ;
+ public String[] getLibraries() throws BuildException;
/**
* @return an array or <code>String</code>s containing the library files
@@ -460,12 +460,12 @@ public interface IOption extends IBuildObject {
*
* @throws BuildException if the option type is not an enumeration
*/
- public String getSelectedEnum () throws BuildException;
+ public String getSelectedEnum() throws BuildException;
/**
* @return the current value for this option if it is a List of Strings.
*/
- public String [] getStringListValue() throws BuildException;
+ public String[] getStringListValue() throws BuildException;
/**
* @return the current value for this option if it is a String
@@ -476,7 +476,7 @@ public interface IOption extends IBuildObject {
* @return all of the user-defined object files that must be linked with
* the final build target.
*/
- public String [] getUserObjects() throws BuildException;
+ public String[] getUserObjects() throws BuildException;
/**
* @return the raw value of this option which is the Object that contains the raw value of the option.
@@ -518,7 +518,7 @@ public interface IOption extends IBuildObject {
*
* @param value An array of strings to place in the option reference.
*/
- public void setValue(String [] value) throws BuildException;
+ public void setValue(String[] value) throws BuildException;
/**
* Sets the raw value of this option.
@@ -611,7 +611,7 @@ public interface IOption extends IBuildObject {
* {@link IOption#OBJECTS}, {@link IOption#INCLUDE_FILES}, {@link IOption#LIBRARY_PATHS},
* {@link IOption#LIBRARY_FILES}, {@link IOption#MACRO_FILES}
*/
- int getBasicValueType() throws BuildException ;
+ int getBasicValueType() throws BuildException;
/**
* @return in case the option basic value type is STRING_LIST, returns the String list value,
@@ -698,8 +698,11 @@ public interface IOption extends IBuildObject {
public static final int DEFAULT_ORDER = 1000;
String getName();
+
String getID();
+
String getDescription();
+
/**
* The order that determines UI appearance of the tree node,
* not necessarily its position in {@link #getChildren()}
@@ -708,12 +711,17 @@ public interface IOption extends IBuildObject {
* @see #DEFAULT_ORDER
*/
int getOrder();
+
void setOrder(int order);
ITreeOption[] getChildren();
+
ITreeOption getParent();
+
boolean isContainer();
+
String getCommand();
+
ITreeOption getChild(String name);
/**
@@ -723,7 +731,9 @@ public interface IOption extends IBuildObject {
* @return The added child.
*/
ITreeOption addChild(String id, String name);
+
void remove();
+
String getIcon();
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionApplicability.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionApplicability.java
index a7b5ef8e943..9b942fe76ff 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionApplicability.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionApplicability.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Texas Instruments Inc. - initial API and implementation
*******************************************************************************/
@@ -22,43 +22,37 @@ public interface IOptionApplicability {
* This method is queried whenever a makefile or makefile fragment is
* generated which uses this option, and in the C/C++ Build property
* pages when displaying the current command line.
- *
- * @param configuration build configuration of option
+ *
+ * @param configuration build configuration of option
* (may be IConfiguration or IResourceConfiguration)
* @param holder contains the holder of the option
* @param option the option itself
- *
+ *
* @return true if this option is to be used in command line
* generation, false otherwise
*/
- public boolean isOptionUsedInCommandLine(
- IBuildObject configuration,
- IHoldsOptions holder,
- IOption option);
+ public boolean isOptionUsedInCommandLine(IBuildObject configuration, IHoldsOptions holder, IOption option);
/**
* This method is queried whenever a new option category is displayed.
- *
- * @param configuration build configuration of option
+ *
+ * @param configuration build configuration of option
* (may be IConfiguration or IResourceConfiguration)
* @param holder contains the holder of the option
* @param option the option itself
- *
+ *
* @return true if this option should be visible in the build options page,
* false otherwise
*/
- public boolean isOptionVisible(
- IBuildObject configuration,
- IHoldsOptions holder,
- IOption option);
+ public boolean isOptionVisible(IBuildObject configuration, IHoldsOptions holder, IOption option);
/**
* Whenever the value of an option changes in the GUI, this method is
* queried on all other visible options for the same category. Note that
* this occurs when the GUI changes - the user may opt to cancel these
* changes.
- *
- * @param configuration build configuration of option
+ *
+ * @param configuration build configuration of option
* (may be IConfiguration or IResourceConfiguration)
* @param holder contains the holder of the option
* @param option the option itself
@@ -66,9 +60,6 @@ public interface IOptionApplicability {
* @return true if this option should be enabled in the build options page,
* or false if it should be disabled (grayed out)
*/
- public boolean isOptionEnabled(
- IBuildObject configuration,
- IHoldsOptions holder,
- IOption option);
+ public boolean isOptionEnabled(IBuildObject configuration, IHoldsOptions holder, IOption option);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionCategory.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionCategory.java
index 93fdf3518ab..9fb2adaf3cf 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionCategory.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionCategory.java
@@ -24,49 +24,50 @@ public interface IOptionCategory extends IBuildObject {
// Schema element names
public static final String OWNER = "owner"; //$NON-NLS-1$
- public static final String ICON = "icon"; //$NON-NLS-1$
-
-// Resource Filter type
+ public static final String ICON = "icon"; //$NON-NLS-1$
+
+ // Resource Filter type
public static final int FILTER_ALL = 0;
- public static final String ALL = "all"; //$NON-NLS-1$
+ public static final String ALL = "all"; //$NON-NLS-1$
public static final int FILTER_FILE = 1;
public static final int FILTER_PROJECT = 2;
- public static final String PROJECT = "project"; //$NON-NLS-1$
+ public static final String PROJECT = "project"; //$NON-NLS-1$
/**
* Returns the list of children of this node in the option category tree
*/
public IOptionCategory[] getChildCategories();
-
+
/**
* Returns an array of ITool/IOption pairs for the options in this category
* for a given configuration.
- *
+ *
* @since 3.1
*/
public Object[][] getOptions(IConfiguration configuration, IHoldsOptions optHolder);
+
/**
* @deprecated since 3.1 - use getOption with IHoldsOptions aregument instead
*/
@Deprecated
public Object[][] getOptions(IConfiguration configuration);
-// /**
-// * Returns an array of ITool/IOption pairs for the options in this category
-// * for a given resource configuration.
-// *
-// * @since 3.1
-// */
-// public Object[][] getOptions(IResourceConfiguration resConfig, IHoldsOptions optHolder);
+ // /**
+ // * Returns an array of ITool/IOption pairs for the options in this category
+ // * for a given resource configuration.
+ // *
+ // * @since 3.1
+ // */
+ // public Object[][] getOptions(IResourceConfiguration resConfig, IHoldsOptions optHolder);
/**
* Returns an array of ITool/IOption pairs for the options in this category
* for a given resource configuration.
- *
+ *
* @since 3.1
*/
public Object[][] getOptions(IResourceInfo resInfo, IHoldsOptions optHolder);
-
+
/**
* @deprecated since 3.1 - use getOption with IHoldsOptions argument instead
*/
@@ -78,11 +79,11 @@ public interface IOptionCategory extends IBuildObject {
* top category for a tool.
*/
public IOptionCategory getOwner();
-
+
/**
* Returns the tool that ultimately owns this category.
* If owned by a toolChain return null.
- *
+ *
* @deprecated since 3.0 - use getOptionHolder() instead
*/
@Deprecated
@@ -91,12 +92,12 @@ public interface IOptionCategory extends IBuildObject {
/**
* Returns the holder (parent) of this category. This may be an object
* implementing ITool or IToolChain, which both extend IHoldsOptions.
- * The call can return null, for example the top option category of a tool
+ * The call can return null, for example the top option category of a tool
* will return null.
- *
+ *
* Note that the name getOptionHolder() has been choosen, because Tool implements
* both ITool and IOptionCategory and ITool.getParent() exists already.
- *
+ *
* @return IHoldsOptions
* @since 3.0
*/
@@ -105,25 +106,25 @@ public interface IOptionCategory extends IBuildObject {
/**
* Get the path name of an alternative icon for the option group.
* Or null if no alternative icon was defined.
- *
+ *
* @return URL
* @since 3.0
*/
public URL getIconPath();
/**
- * 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
*/
public boolean isDirty();
-
+
/**
* Sets the element's "dirty" (have I been modified?) flag.
*/
public void setDirty(boolean isDirty);
-
+
/**
* @return an instance of the class that calculates whether the option category is visible.
* @since 8.0
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionCategoryApplicability.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionCategoryApplicability.java
index 3bd36ac0f58..cc5b2eec0e1 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionCategoryApplicability.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionCategoryApplicability.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Miwako Tokugawa (Intel Corporation) - initial API and implementation
*******************************************************************************/
@@ -15,25 +15,24 @@ package org.eclipse.cdt.managedbuilder.core;
/**
* This interface determines whether or not the option category is currently displayed.
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
- *
+ *
* @since 8.0
*/
public interface IOptionCategoryApplicability {
/**
* This method is queried whenever a new option category is displayed.
- *
- * @param configuration build configuration of option
+ *
+ * @param configuration build configuration of option
* (may be IConfiguration or IResourceConfiguration)
* @param optHolder contains the holder of the option
* @param category the option category itself
- *
+ *
* @return true if this option should be visible in the build options page,
* false otherwise
*/
- public boolean isOptionCategoryVisible(
- IBuildObject configuration,
- IHoldsOptions optHolder, IOptionCategory category);
+ public boolean isOptionCategoryVisible(IBuildObject configuration, IHoldsOptions optHolder,
+ IOptionCategory category);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionCommandGenerator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionCommandGenerator.java
index 78d74939b43..b8ade51dca3 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionCommandGenerator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionCommandGenerator.java
@@ -16,26 +16,24 @@ package org.eclipse.cdt.managedbuilder.core;
import org.eclipse.cdt.utils.cdtvariables.IVariableSubstitutor;
-
/**
* This interface can be implemented by clients to contribute custom command-generator
* for a build-option.
- *
+ *
* The custom command-generator class should be referenced in the <option>/commandGenerator
* attribute of the org.eclipse.cdt.managedbuilder.core.buildDefinitions extension-point.
- *
+ *
* @since 8.0
*/
-public interface IOptionCommandGenerator
-{
+public interface IOptionCommandGenerator {
/**
* Generate the command for the given option.
- *
+ *
* @param option the underlying build-option
* @param macroSubstitutor to be used for expanding macros in option's value
* @return the generated build-option command. May return {@code null} to fall
* back to the default command generation logic.
*/
String generateCommand(IOption option, IVariableSubstitutor macroSubstitutor);
-
+
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionDefaultValueGenerator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionDefaultValueGenerator.java
index 4f2bd8fcee4..7af738cd201 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionDefaultValueGenerator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionDefaultValueGenerator.java
@@ -17,16 +17,16 @@ package org.eclipse.cdt.managedbuilder.core;
/**
* This interface can be implemented by clients to contribute custom defaultValue-generator for a
* build-option.
- *
+ *
* The custom defaultValue-generator class should be referenced in the <option>/defaultValueGenerator
* attribute of the org.eclipse.cdt.managedbuilder.core.buildDefinitions extension-point.
- *
+ *
* @since 8.5
*/
public interface IOptionDefaultValueGenerator {
/**
* Generate the defaultValue for the given option.
- *
+ *
* @param option
* the underlying build-option
* @return the generated build-option defaultValue. May return {@code null} to fall back to the default
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionPathConverter.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionPathConverter.java
index 4072e8ef69f..189d4e94441 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionPathConverter.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionPathConverter.java
@@ -16,7 +16,7 @@ import org.eclipse.core.runtime.IPath;
/**
* An IOptionPathConverter converts between tool-specific paths
* and their platform locations
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
@@ -30,8 +30,8 @@ public interface IOptionPathConverter {
* @param option TODO
* @param tool TODO
* @return A path which is a meaningful platform location
- * or null, if the conversion fails.
+ * or null, if the conversion fails.
*/
IPath convertToPlatformLocation(String toolSpecificPath, IOption option, ITool tool);
-
+
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOutputType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOutputType.java
index 12ce6749d69..359429a3098 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOutputType.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOutputType.java
@@ -17,30 +17,30 @@ import org.eclipse.core.runtime.content.IContentType;
/**
* This interface represents an outputType instance in the managed build system.
- * It describes one category of output files created by a Tool. A tool can
+ * It describes one category of output files created by a Tool. A tool can
* have multiple outputType children.
- *
+ *
* @since 3.0
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IOutputType extends IBuildObject {
- public static final String OUTPUT_TYPE_ELEMENT_NAME = "outputType"; //$NON-NLS-1$
- public static final String OUTPUT_CONTENT_TYPE = "outputContentType"; //$NON-NLS-1$
- public static final String OUTPUTS = "outputs"; //$NON-NLS-1$
- public static final String OPTION = "option"; //$NON-NLS-1$
- public static final String MULTIPLE_OF_TYPE = "multipleOfType"; //$NON-NLS-1$
- public static final String PRIMARY_INPUT_TYPE = "primaryInputType"; //$NON-NLS-1$
- public static final String PRIMARY_OUTPUT = "primaryOutput"; //$NON-NLS-1$
- public static final String OUTPUT_PREFIX = "outputPrefix"; //$NON-NLS-1$
- public static final String OUTPUT_NAMES = "outputNames"; //$NON-NLS-1$
- public static final String NAME_PATTERN = "namePattern"; //$NON-NLS-1$
- public static final String NAME_PROVIDER = "nameProvider"; //$NON-NLS-1$
- public static final String BUILD_VARIABLE = "buildVariable"; //$NON-NLS-1$
-
+ public static final String OUTPUT_TYPE_ELEMENT_NAME = "outputType"; //$NON-NLS-1$
+ public static final String OUTPUT_CONTENT_TYPE = "outputContentType"; //$NON-NLS-1$
+ public static final String OUTPUTS = "outputs"; //$NON-NLS-1$
+ public static final String OPTION = "option"; //$NON-NLS-1$
+ public static final String MULTIPLE_OF_TYPE = "multipleOfType"; //$NON-NLS-1$
+ public static final String PRIMARY_INPUT_TYPE = "primaryInputType"; //$NON-NLS-1$
+ public static final String PRIMARY_OUTPUT = "primaryOutput"; //$NON-NLS-1$
+ public static final String OUTPUT_PREFIX = "outputPrefix"; //$NON-NLS-1$
+ public static final String OUTPUT_NAMES = "outputNames"; //$NON-NLS-1$
+ public static final String NAME_PATTERN = "namePattern"; //$NON-NLS-1$
+ public static final String NAME_PROVIDER = "nameProvider"; //$NON-NLS-1$
+ public static final String BUILD_VARIABLE = "buildVariable"; //$NON-NLS-1$
+
/**
* Returns the tool defining this OutputType.
- *
+ *
* @return ITool
*/
public ITool getParent();
@@ -48,64 +48,64 @@ public interface IOutputType extends IBuildObject {
/**
* Returns the <code>IOutputType</code> that is the superclass of this
* OutputType, or <code>null</code> if the attribute was not specified.
- *
+ *
* @return IInputType
*/
public IOutputType getSuperClass();
-
+
/**
* Returns the Eclipse <code>IContentType</code> that describes this
- * output type. If both the outputs attribute and the outputContentType
- * attribute are specified, the outputContentType will be used if it
- * is defined in Eclipse.
- *
+ * output type. If both the outputs attribute and the outputContentType
+ * attribute are specified, the outputContentType will be used if it
+ * is defined in Eclipse.
+ *
* @return IContentType
*/
public IContentType getOutputContentType();
-
+
/**
* Sets the Eclipse <code>IContentType</code> that describes this
- * output type.
- *
+ * output type.
+ *
* @param contentType The Eclipse content type
*/
public void setOutputContentType(IContentType contentType);
-
+
/**
* Returns the list of valid output extensions from the
* outputs attribute. Note that this value is not used
* if output content type is specified and registered with Eclipse.
- * Also, the user will not be able to modify the set of file
+ * Also, the user will not be able to modify the set of file
* extensions as they can when outputContentType is specified.
- *
+ *
* @return <code>String[]</code> of extensions
*/
public String[] getOutputExtensionsAttribute();
-
+
/**
* Sets all of the output extensions that the receiver can build.
- * NOTE: The value of this attribute will NOT be used if a
+ * NOTE: The value of this attribute will NOT be used if a
* output content type is specified and is registered with
* Eclipse.
*/
public void setOutputExtensionsAttribute(String extensions);
-
+
/**
* Returns the list of the output extensions that the receiver can build.
- * Note that the list will come from the outputContentType if it
- * is specified and registered with Eclipse. Otherwise the
+ * Note that the list will come from the outputContentType if it
+ * is specified and registered with Eclipse. Otherwise the
* outputs attribute will be used.
- *
- * @param tool the tool that contains the output-type
+ *
+ * @param tool the tool that contains the output-type
* @return String[]
*/
public String[] getOutputExtensions(ITool tool);
-
+
/**
- * Answers <code>true</code> if the output type considers the file extension to be
+ * Answers <code>true</code> if the output type considers the file extension to be
* one associated with an output file.
- *
- * @param tool the tool that contains the output-type
+ *
+ * @param tool the tool that contains the output-type
* @param ext file extension
* @return boolean
*/
@@ -113,58 +113,58 @@ public interface IOutputType extends IBuildObject {
/**
* Returns the id of the option that is associated with this
- * output type on the command line. The default is to use the Tool
- * "outputFlag" attribute if primaryOutput is True. If option is not
- * specified, and primaryOutput is False, then the output file(s) of
- * this outputType are not added to the command line.
+ * output type on the command line. The default is to use the Tool
+ * "outputFlag" attribute if primaryOutput is True. If option is not
+ * specified, and primaryOutput is False, then the output file(s) of
+ * this outputType are not added to the command line.
* When specified, the namePattern, nameProvider and outputNames are ignored.
- *
+ *
* @return String
*/
public String getOptionId();
/**
* Sets the id of the option that is associated with this
- * output type on the command line.
+ * output type on the command line.
*/
public void setOptionId(String optionId);
-
+
/**
* Returns <code>true</code> if this outputType creates multiple output
* resources in one invocation of the tool, else <code>false</code>.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean getMultipleOfType();
-
+
/**
* Sets whether this outputType can create multiple output resources in
* one invocation of the tool.
*/
public void setMultipleOfType(boolean multiple);
-
+
/**
* Returns the input type that is used in determining the default
- * names of this output type.
- *
+ * names of this output type.
+ *
* @return IInputType
*/
public IInputType getPrimaryInputType();
-
+
/**
* Sets the input type that is used in determining the default
* names of this output type.
*/
public void setPrimaryInputType(IInputType contentType);
-
+
/**
* Returns <code>true</code> if this is considered the primary output
* of the tool, else <code>false</code>.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean getPrimaryOutput();
-
+
/**
* Sets whether this is the primary output of the tool.
*/
@@ -184,73 +184,73 @@ public interface IOutputType extends IBuildObject {
public void setOutputPrefix(String prefix);
/**
- * Returns the file names of the complete set of output files for this outputType
- *
+ * Returns the file names of the complete set of output files for this outputType
+ *
* @return String[]
*/
public String[] getOutputNames();
/**
- * Sets the complete set of output file names for this outputType
+ * Sets the complete set of output file names for this outputType
*/
public void setOutputNames(String names);
/**
- * Returns the pattern, using the Gnu pattern rule syntax, for deriving the
- * output resource name from the input resource name. The default is to use
- * the input file base filename with the output extension.
- *
+ * Returns the pattern, using the Gnu pattern rule syntax, for deriving the
+ * output resource name from the input resource name. The default is to use
+ * the input file base filename with the output extension.
+ *
* @return String
*/
public String getNamePattern();
/**
- * Sets the pattern, using the Gnu pattern rule syntax, for deriving the
+ * Sets the pattern, using the Gnu pattern rule syntax, for deriving the
* output resource name from the input resource name.
- *
+ *
*/
public void setNamePattern(String pattern);
-
+
/**
* Returns the IManagedOutputNameProvider interface as specified by the nameProvider attribute.
- *
+ *
* @return IManagedOutputNameProvider
*/
public IManagedOutputNameProvider getNameProvider();
/**
* Returns the name of the build variable associated this this output type's resources
- * The variable is used in the build file to represent the list of output files.
- * The same variable name can be used by an inputType to identify a set of output
- * files that contribute to the tool's input (i.e., those using the same buildVariable
+ * The variable is used in the build file to represent the list of output files.
+ * The same variable name can be used by an inputType to identify a set of output
+ * files that contribute to the tool's input (i.e., those using the same buildVariable
* name). The default name is chosen by MBS.
- *
+ *
* @return String
*/
public String getBuildVariable();
/**
* Sets the name of the build variable associated this this output type's resources.
- *
+ *
*/
public void setBuildVariable(String variableName);
/**
- * 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
*/
public boolean isDirty();
-
+
/**
* Returns <code>true</code> if this OutputType was loaded from a manifest file,
* and <code>false</code> if it was loaded from a project (.cdtbuild) file.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean isExtensionElement();
-
+
/**
* Sets the element's "dirty" (have I been modified?) flag.
*/
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IProjectType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IProjectType.java
index e7ae149e538..5bf24f39a8f 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IProjectType.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IProjectType.java
@@ -19,58 +19,58 @@ import org.eclipse.cdt.managedbuilder.macros.IProjectBuildMacroSupplier;
/**
* This class represents project-types in the managed build system.
- * A project-type is a tool-integrator defined class of project which
- * acts as a template for the projects that a user will create.
+ * A project-type is a tool-integrator defined class of project which
+ * acts as a template for the projects that a user will create.
* The project-type contains one or more children of type configuration.
* These are the default configurations that the user can choose from.
- * Note that there is no reason to define a project-type element in a
- * .cdtbuild file. It would never be used since project-type elements
+ * Note that there is no reason to define a project-type element in a
+ * .cdtbuild file. It would never be used since project-type elements
* are used to primarily populate the "New Project" dialog boxes.
* Project types can be arranged into hierarchies to promote the efficient
- * sharing of configurations. If you have defined a project type that
- * should not be selected by the user, but is a root for other project
+ * sharing of configurations. If you have defined a project type that
+ * should not be selected by the user, but is a root for other project
* types, it may be declared abstract by setting the isAbstract attribute
- * to 'true'. Abstract project types do not appear in the UI. You must
- * provide a unique identifier for the project type in the id attribute.
+ * to 'true'. Abstract project types do not appear in the UI. You must
+ * provide a unique identifier for the project type in the id attribute.
* Children of the abstract project type will have the same configurations
* that the abstract project type has, unless they are explicitly named
- * in the unusedChildren attribute of the child project. For these
- * children to function properly, their superClass attribute must contain
+ * in the unusedChildren attribute of the child project. For these
+ * children to function properly, their superClass attribute must contain
* the unique identifier of the super class project type.
- * A concrete project type must have at least one configuration defined
+ * A concrete project type must have at least one configuration defined
* for it. A project type must also define (or inherit) a set of tool-chain
* definitions that work together to produce the build goal as an output.
- * You must also provide a meaningful name that will be displayed to the
+ * You must also provide a meaningful name that will be displayed to the
* user in the UI and New Project wizards.
- *
+ *
* @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.
*/
-public interface IProjectType extends IBuildObject, IBuildObjectPropertiesContainer, IOptionalBuildObjectPropertiesContainer {
- public static final String PROJECTTYPE_ELEMENT_NAME = "projectType"; //$NON-NLS-1$
- public static final String SUPERCLASS = "superClass"; //$NON-NLS-1$
- public static final String IS_ABSTRACT = "isAbstract"; //$NON-NLS-1$
- public static final String UNUSED_CHILDREN = "unusedChildren"; //$NON-NLS-1$
- public static final String IS_TEST = "isTest"; //$NON-NLS-1$
- public static final String CONVERT_TO_ID = "convertToId"; //$NON-NLS-1$
- public static final String CONFIGURATION_NAME_PROVIDER = "configurationNameProvider"; //$NON-NLS-1$
- public static final String PROJECT_ENVIRONMENT_SUPPLIER = "projectEnvironmentSupplier"; //$NON-NLS-1$
- public static final String PROJECT_MACRO_SUPPLIER = "projectMacroSupplier"; //$NON-NLS-1$
+public interface IProjectType
+ extends IBuildObject, IBuildObjectPropertiesContainer, IOptionalBuildObjectPropertiesContainer {
+ public static final String PROJECTTYPE_ELEMENT_NAME = "projectType"; //$NON-NLS-1$
+ public static final String SUPERCLASS = "superClass"; //$NON-NLS-1$
+ public static final String IS_ABSTRACT = "isAbstract"; //$NON-NLS-1$
+ public static final String UNUSED_CHILDREN = "unusedChildren"; //$NON-NLS-1$
+ public static final String IS_TEST = "isTest"; //$NON-NLS-1$
+ public static final String CONVERT_TO_ID = "convertToId"; //$NON-NLS-1$
+ public static final String CONFIGURATION_NAME_PROVIDER = "configurationNameProvider"; //$NON-NLS-1$
+ public static final String PROJECT_ENVIRONMENT_SUPPLIER = "projectEnvironmentSupplier"; //$NON-NLS-1$
+ public static final String PROJECT_MACRO_SUPPLIER = "projectMacroSupplier"; //$NON-NLS-1$
public static final String BUILD_PROPERTIES = "buildProperties"; //$NON-NLS-1$
public static final String BUILD_ARTEFACT_TYPE = "buildArtefactType"; //$NON-NLS-1$
-
/**
* Creates a configuration for this project-type populated with the tools
- * and options settings from the parent configuration. As options and
- * tools change in the parent, unoverridden values are updated in the
+ * and options settings from the parent configuration. As options and
+ * tools change in the parent, unoverridden values are updated in the
* child configuration as well.
* <p>
* NOTE: This routine affects the in-memory representation of the
* project-type, but since project-types are never written to the
- * .cdtbuild file, the manifest definition does not change.
- *
+ * .cdtbuild file, the manifest definition does not change.
+ *
* @param parent The <code>IConfiguration</code> to use as a settings template
* @param id The unique id the new configuration will have
* @param name The name the new configuration will have
@@ -83,22 +83,22 @@ public interface IProjectType extends IBuildObject, IBuildObjectPropertiesContai
* <p>
* NOTE: This routine affects the in-memory representation of the
* project-type, but since project-types are never written to the
- * .cdtbuild file, the manifest definition does not change.
- *
+ * .cdtbuild file, the manifest definition does not change.
+ *
* @param id The unique id of the configuration
*/
public void removeConfiguration(String id);
/**
* Returns all of the configurations defined by this project-type.
- *
+ *
* @return IConfiguration[]
*/
public IConfiguration[] getConfigurations();
/**
* Returns the configuration with the given id, or <code>null</code> if not found.
- *
+ *
* @param id The unique id of the configuration
* @return IConfiguration
*/
@@ -107,37 +107,37 @@ public interface IProjectType extends IBuildObject, IBuildObjectPropertiesContai
/**
* Returns the <code>IProjectType</code> that is the superclass of this
* project-type, or <code>null</code> if the attribute was not specified.
- *
+ *
* @return IProjectType
*/
public IProjectType getSuperClass();
-
+
/**
* Returns whether this element is abstract. Returns <code>false</code>
* if the attribute was not specified.
- * @return boolean
+ * @return boolean
*/
public boolean isAbstract();
/**
- * Sets the isAbstract attribute of the tool-chain.
+ * Sets the isAbstract attribute of the tool-chain.
*/
public void setIsAbstract(boolean b);
-
+
/**
* Returns a semi-colon delimited list of child Ids of the superclass'
* children that should not be automatically inherited by this element.
- * Returns an empty string if the attribute was not specified.
- * @return String
+ * Returns an empty string if the attribute was not specified.
+ * @return String
*/
public String getUnusedChildren();
-
+
/**
- * Returns <code>true</code> if the project-type is defined
- * for testing purposes only, else <code>false</code>. A test project-type will
+ * Returns <code>true</code> if the project-type is defined
+ * for testing purposes only, else <code>false</code>. A test project-type will
* not be shown in the UI but can still be manipulated programmatically.
* Returns <code>false</code> if the attribute was not specified.
- *
+ *
* @return boolean
*/
public boolean isTestProjectType();
@@ -145,57 +145,57 @@ public interface IProjectType extends IBuildObject, IBuildObjectPropertiesContai
/**
* Returns <code>true</code> if at least one project-type contiguration is supported on the system
* otherwise returns <code>false</code>
- *
- * @return boolean
- */
+ *
+ * @return boolean
+ */
public boolean isSupported();
-
+
/**
- * Returns the configurationNameProvider.
- *
+ * Returns the configurationNameProvider.
+ *
* @return IConfigurationNameProvider
*/
public IConfigurationNameProvider getConfigurationNameProvider();
-
+
/**
* Returns the tool-integrator provided implementation of the project environment variable supplier
- * or <code>null</code> if none.
- *
+ * or <code>null</code> if none.
+ *
* @return IProjectEnvironmentVariableSupplier
*/
public IProjectEnvironmentVariableSupplier getEnvironmentVariableSupplier();
/**
* Returns the tool-integrator provided implementation of the project build macro supplier
- * or <code>null</code> if none.
- *
+ * or <code>null</code> if none.
+ *
* @return IProjectBuildMacroSupplier
*/
public IProjectBuildMacroSupplier getBuildMacroSupplier();
-
+
/**
* Returns the 'convertToId' of this project type.
- *
+ *
* @return String
*/
public String getConvertToId();
-
+
/**
- * Sets the 'convertToId' attribute of the project type.
+ * Sets the 'convertToId' attribute of the project type.
*/
public void setConvertToId(String convertToId);
-
+
/**
* check for migration support.
* @return boolean
*/
-
+
public boolean checkForMigrationSupport();
-
+
public String getNameAttribute();
-
+
public IBuildPropertyValue getBuildArtefactType();
-
+
boolean isSystemObject();
}
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 c8c6b48db50..83e88e6a084 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
@@ -29,15 +29,15 @@ import org.eclipse.core.resources.IResource;
*/
public interface IResourceConfiguration extends IResourceInfo {
public static final String RESOURCE_CONFIGURATION_ELEMENT_NAME = "resourceConfiguration"; //$NON-NLS-1$
- public static final String RCBS_APPLICABILITY = "rcbsApplicability"; //$NON-NLS-1$
- public static final String TOOLS_TO_INVOKE = "toolsToInvoke"; //$NON-NLS-1$
- public static final String APPLY_RCBS_TOOL_AS_OVERRIDE = "override"; //$NON-NLS-1$
+ public static final String RCBS_APPLICABILITY = "rcbsApplicability"; //$NON-NLS-1$
+ public static final String TOOLS_TO_INVOKE = "toolsToInvoke"; //$NON-NLS-1$
+ public static final String APPLY_RCBS_TOOL_AS_OVERRIDE = "override"; //$NON-NLS-1$
public static final int KIND_APPLY_RCBS_TOOL_AS_OVERRIDE = 1;
- public static final String APPLY_RCBS_TOOL_BEFORE = "before"; //$NON-NLS-1$
+ public static final String APPLY_RCBS_TOOL_BEFORE = "before"; //$NON-NLS-1$
public static final int KIND_APPLY_RCBS_TOOL_BEFORE = 2;
- public static final String APPLY_RCBS_TOOL_AFTER = "after"; //$NON-NLS-1$
+ public static final String APPLY_RCBS_TOOL_AFTER = "after"; //$NON-NLS-1$
public static final int KIND_APPLY_RCBS_TOOL_AFTER = 3;
- public static final String DISABLE_RCBS_TOOL = "disable"; //$NON-NLS-1$
+ 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
@@ -174,8 +174,7 @@ public interface IResourceConfiguration extends IResourceInfo {
* Code assuming ITool as type, will continue to work unchanged.
*/
@Override
- public IOption setOption(IHoldsOptions parent, IOption option, boolean value)
- throws BuildException;
+ public IOption setOption(IHoldsOptions parent, IOption option, boolean value) throws BuildException;
/**
* Sets the value of a string option for this resource configuration.
@@ -190,8 +189,7 @@ public interface IResourceConfiguration extends IResourceInfo {
* Code assuming ITool as type, will continue to work unchanged.
*/
@Override
- public IOption setOption(IHoldsOptions parent, IOption option, String value)
- throws BuildException;
+ public IOption setOption(IHoldsOptions parent, IOption option, String value) throws BuildException;
/**
* Sets the value of a list option for this resource configuration.
@@ -206,9 +204,7 @@ public interface IResourceConfiguration extends IResourceInfo {
* Code assuming ITool as type, will continue to work unchanged.
*/
@Override
- public IOption setOption(IHoldsOptions parent, IOption option, String[] value)
- throws BuildException;
-
+ public IOption setOption(IHoldsOptions parent, IOption option, String[] value) throws BuildException;
/**
* Returns the Eclipse project that owns the resource configuration.
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IResourceInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IResourceInfo.java
index 6e96b5187b6..fc00e41d440 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IResourceInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IResourceInfo.java
@@ -22,90 +22,86 @@ import org.eclipse.core.runtime.IPath;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IResourceInfo extends IBuildObject {
-// public static final String PARENT_FOLDER_INFO_ID = "parentFolderInfoId";
-// public static final String BASE_TOOLCHAIN_ID = "baseToolChainId";
-// public static final String INHERIT_PARENT_INFO = "inheritParentInfo"; //$NON-NLS-1$
- public static final String RESOURCE_PATH = "resourcePath"; //$NON-NLS-1$
- public static final String EXCLUDE = "exclude"; //$NON-NLS-1$
+ // public static final String PARENT_FOLDER_INFO_ID = "parentFolderInfoId";
+ // public static final String BASE_TOOLCHAIN_ID = "baseToolChainId";
+ // public static final String INHERIT_PARENT_INFO = "inheritParentInfo"; //$NON-NLS-1$
+ public static final String RESOURCE_PATH = "resourcePath"; //$NON-NLS-1$
+ public static final String EXCLUDE = "exclude"; //$NON-NLS-1$
IPath getPath();
-
+
void setPath(IPath path);
-
+
boolean isExcluded();
-
+
boolean isExtensionElement();
-
+
void setExclude(boolean excluded);
-
+
boolean canExclude(boolean exclude);
-
+
boolean isDirty();
-
+
boolean needsRebuild();
-
+
void setDirty(boolean dirty);
-
+
void setRebuildState(boolean rebuild);
-
+
int getKind();
-
+
IConfiguration getParent();
-
-// IFolderInfo getParentFolderInfo();
-// IToolChain getBaseToolChain();
-
+ // IFolderInfo getParentFolderInfo();
+
+ // IToolChain getBaseToolChain();
+
CResourceData getResourceData();
-
+
boolean isValid();
-
+
CLanguageData[] getCLanguageDatas();
-
+
ITool[] getTools();
-// boolean isParentInfoInherited();
-
+ // boolean isParentInfoInherited();
+
boolean supportsBuild(boolean managed);
-
+
/**
* 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.
*/
- public IOption setOption(IHoldsOptions parent, IOption option, boolean value)
- throws BuildException;
+ 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.
*/
- public IOption setOption(IHoldsOptions parent, IOption option, String value)
- throws BuildException;
-
+ 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.
*/
- public IOption setOption(IHoldsOptions parent, IOption option, String[] value)
- throws BuildException;
+ public IOption setOption(IHoldsOptions parent, IOption option, String[] value) throws BuildException;
+
+ public IOption setOption(IHoldsOptions parent, IOption option, OptionStringValue[] value) throws BuildException;
- public IOption setOption(IHoldsOptions parent, IOption option, OptionStringValue[] value)
- throws BuildException;
-
boolean isSupported();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITarget.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITarget.java
index 098faf84dab..dbfcb8326c5 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITarget.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITarget.java
@@ -26,28 +26,28 @@ import org.eclipse.core.resources.IResource;
*/
@Deprecated
public interface ITarget extends IBuildObject {
- public static final String TARGET_ELEMENT_NAME = "target"; //$NON-NLS-1$
- public static final String ARTIFACT_NAME = "artifactName"; //$NON-NLS-1$
- public static final String BINARY_PARSER = "binaryParser"; //$NON-NLS-1$
- public static final String ERROR_PARSERS = "errorParsers"; //$NON-NLS-1$
- public static final String CLEAN_COMMAND = "cleanCommand"; //$NON-NLS-1$
- public static final String DEFAULT_EXTENSION = "defaultExtension"; //$NON-NLS-1$
- public static final String EXTENSION = "extension"; //$NON-NLS-1$
- public static final String IS_ABSTRACT = "isAbstract"; //$NON-NLS-1$
- public static final String IS_TEST = "isTest"; //$NON-NLS-1$
- public static final String MAKE_COMMAND = "makeCommand"; //$NON-NLS-1$
- public static final String MAKE_ARGS = "makeArguments"; //$NON-NLS-1$
- public static final String OS_LIST = "osList"; //$NON-NLS-1$
- public static final String ARCH_LIST = "archList"; //$NON-NLS-1$
- public static final String PARENT = "parent"; //$NON-NLS-1$
- public static final String SCANNER_INFO_COLLECTOR_ID = "scannerInfoCollector"; //$NON-NLS-1$
-
+ public static final String TARGET_ELEMENT_NAME = "target"; //$NON-NLS-1$
+ public static final String ARTIFACT_NAME = "artifactName"; //$NON-NLS-1$
+ public static final String BINARY_PARSER = "binaryParser"; //$NON-NLS-1$
+ public static final String ERROR_PARSERS = "errorParsers"; //$NON-NLS-1$
+ public static final String CLEAN_COMMAND = "cleanCommand"; //$NON-NLS-1$
+ public static final String DEFAULT_EXTENSION = "defaultExtension"; //$NON-NLS-1$
+ public static final String EXTENSION = "extension"; //$NON-NLS-1$
+ public static final String IS_ABSTRACT = "isAbstract"; //$NON-NLS-1$
+ public static final String IS_TEST = "isTest"; //$NON-NLS-1$
+ public static final String MAKE_COMMAND = "makeCommand"; //$NON-NLS-1$
+ public static final String MAKE_ARGS = "makeArguments"; //$NON-NLS-1$
+ public static final String OS_LIST = "osList"; //$NON-NLS-1$
+ public static final String ARCH_LIST = "archList"; //$NON-NLS-1$
+ public static final String PARENT = "parent"; //$NON-NLS-1$
+ public static final String SCANNER_INFO_COLLECTOR_ID = "scannerInfoCollector"; //$NON-NLS-1$
+
/**
* Creates a configuration for the target populated with the tools and
* options settings from the parent configuration. As options and tools
* change in the parent, unoverridden values are updated in the child
* config as well.
- *
+ *
* @param parent The <code>IConfigurationV2</code> to use as a settings template
* @param id The unique id the new configuration will have
* @return IConfigurationV2
@@ -57,60 +57,60 @@ public interface ITarget extends IBuildObject {
/**
* Creates a new configuration for the target. It is populated with
* the tools defined for that target and options set at their defaults.
- *
+ *
* @param id id for this configuration.
* @return IConfigurationV2
*/
public IConfigurationV2 createConfiguration(String id);
-
+
/**
- * Answers the extension that should be applied to build artifacts created by
+ * Answers the extension that should be applied to build artifacts created by
* this target.
- *
+ *
* @return String
*/
- public String getArtifactExtension();
+ public String getArtifactExtension();
/**
* Get the name of the final build artifact.
- *
+ *
* @return String
*/
public String getArtifactName();
-
+
public void setDirty(boolean isDirty);
/**
* Answers the unique ID of the binary parser associated with the target.
- *
+ *
* @return String
*/
public String getBinaryParserId();
/**
* Answers the semicolon separated list of unique IDs of the error parsers associated with the target.
- *
+ *
* @return String
*/
public String getErrorParserIds();
/**
* Answers the ordered list of unique IDs of the error parsers associated with the target.
- *
+ *
* @return String[]
*/
public String[] getErrorParserList();
-
+
/**
* Answers the OS-specific command to remove files created by the build
- *
+ *
* @return String
*/
public String getCleanCommand();
/**
* Returns all of the configurations defined by this target.
- *
+ *
* @return IConfigurationV2[]
*/
public IConfigurationV2[] getConfigurations();
@@ -118,23 +118,23 @@ public interface ITarget extends IBuildObject {
/**
* Get the default extension that should be applied to build artifacts
* created by this target.
- *
+ *
* @return String
- *
+ *
* @deprecated as of CDT 2.0
*/
@Deprecated
- public String getDefaultExtension();
+ public String getDefaultExtension();
/**
- * Answers the command line arguments to pass to the make utility used
+ * Answers the command line arguments to pass to the make utility used
* by the receiver to build a project.
*/
public String getMakeArguments();
-
+
/**
* Answers the name of the make utility for the target.
- *
+ *
* @return String
*/
public String getMakeCommand();
@@ -143,85 +143,85 @@ public interface ITarget extends IBuildObject {
* Returns the configuration with the given id, or <code>null</code> if not found.
*/
public IConfigurationV2 getConfiguration(String id);
-
+
/**
* Gets the resource that this target is applied to.
- *
+ *
* @return IResource
*/
public IResource getOwner();
/**
* Answers the <code>ITarget</code> that is the parent of the receiver.
- *
+ *
* @return ITarget
*/
public ITarget getParent();
-
+
/**
* Answers an array of operating systems the target can be created on.
- *
+ *
* @return String[]
*/
public String[] getTargetOSList();
-
- /**
- * Answers an array of architectures the target can be created on.
- *
- * @return String[]
- */
- public String[] getTargetArchList();
+
+ /**
+ * Answers an array of architectures the target can be created on.
+ *
+ * @return String[]
+ */
+ public String[] getTargetArchList();
/**
* Returns the list of platform specific tools associated with this
* platform.
- *
+ *
* @return ITool[]
*/
public ITool[] getTools();
/**
- * Answers the tool in the receiver with the ID specified in the argument,
- * or <code>null</code>
+ * Answers the tool in the receiver with the ID specified in the argument,
+ * or <code>null</code>
*/
public ITool getTool(String id);
-
+
/**
- * Answers true if the receiver has a make command that differs from its
+ * Answers true if the receiver has a make command that differs from its
* parent specification.
- *
+ *
* @return boolean
*/
public boolean hasOverridenMakeCommand();
-
+
/**
* Returns whether this target is abstract.
- * @return boolean
+ * @return boolean
*/
public boolean isAbstract();
/**
- * Answers <code>true</code> the receiver has changes that need to be saved
+ * Answers <code>true</code> the receiver has changes that need to be saved
* in the project file, else <code>false</code>.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean isDirty();
-
+
/**
- * Answers <code>true</code> if the receiver is a target that is defined
- * for testing purposes only, else <code>false</code>. A test target will
+ * Answers <code>true</code> if the receiver is a target that is defined
+ * for testing purposes only, else <code>false</code>. A test target will
* not be shown in the UI but can still be manipulated programmatically.
- *
+ *
* @return boolean
*/
public boolean isTestTarget();
/**
- * Answers whether the receiver has been changed and requires the
+ * Answers whether the receiver has been changed and requires the
* project to be rebuilt.
- *
- * @return <code>true</code> if the receiver contains a change
+ *
+ * @return <code>true</code> if the receiver contains a change
* that needs the project to be rebuilt
*/
public boolean needsRebuild();
@@ -230,7 +230,7 @@ public interface ITarget extends IBuildObject {
* Removes the configuration with the ID specified in the argument.
*/
public void removeConfiguration(String id);
-
+
/**
* Set (override) the extension that should be appended to the build artifact
* for the receiver.
@@ -244,7 +244,7 @@ public interface ITarget extends IBuildObject {
public void setArtifactName(String name);
/**
- * Sets the arguments to be passed to the make utility used by the
+ * Sets the arguments to be passed to the make utility used by the
* receiver to produce a build goal.
*/
public void setMakeArguments(String makeArgs);
@@ -258,11 +258,11 @@ public interface ITarget extends IBuildObject {
* Sets the semicolon separated list of error parser ids
*/
public void setErrorParserIds(String ids);
-
+
/**
* Set the rebuild state of the receiver.
- *
- * @param rebuild <code>true</code> will force a rebuild the next time the project builds
+ *
+ * @param rebuild <code>true</code> will force a rebuild the next time the project builds
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#setRebuildState(boolean)
*/
public void setRebuildState(boolean rebuild);
@@ -280,7 +280,7 @@ public interface ITarget extends IBuildObject {
/**
* Returns the <code>ProjectType</code> that this Target has been converted to,
- * or <code>null</code> if it has not been converted.
+ * or <code>null</code> if it has not been converted.
*
* @return ProjectType
*/
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITargetPlatform.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITargetPlatform.java
index 403142a3d49..d2635a87c68 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITargetPlatform.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITargetPlatform.java
@@ -16,24 +16,24 @@ package org.eclipse.cdt.managedbuilder.core;
import org.eclipse.cdt.core.settings.model.extension.CTargetPlatformData;
/**
- * This class defines the os/architecture combination upon which the
- * outputs of a tool-chain can be deployed. The osList and archList
- * attributes contain the Eclipse names of the operating systems and
+ * This class defines the os/architecture combination upon which the
+ * outputs of a tool-chain can be deployed. The osList and archList
+ * attributes contain the Eclipse names of the operating systems and
* architectures described by this 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.
*/
public interface ITargetPlatform extends IBuildObject {
public static final String TARGET_PLATFORM_ELEMENT_NAME = "targetPlatform"; //$NON-NLS-1$
- public static final String BINARY_PARSER = "binaryParser"; //$NON-NLS-1$
- public static final String OS_LIST = "osList"; //$NON-NLS-1$
- public static final String ARCH_LIST = "archList"; //$NON-NLS-1$
+ public static final String BINARY_PARSER = "binaryParser"; //$NON-NLS-1$
+ public static final String OS_LIST = "osList"; //$NON-NLS-1$
+ public static final String ARCH_LIST = "archList"; //$NON-NLS-1$
/**
* Returns the tool-chain that is the parent of this target platform.
- *
+ *
* @return IToolChain
*/
public IToolChain getParent();
@@ -41,63 +41,63 @@ public interface ITargetPlatform extends IBuildObject {
/**
* Returns the <code>ITargetPlatform</code> that is the superclass of this
* target platform, or <code>null</code> if the attribute was not specified.
- *
+ *
* @return ITargetPlatform
*/
public ITargetPlatform getSuperClass();
-
+
/**
* Returns whether this element is abstract. Returns <code>false</code>
* if the attribute was not specified.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean isAbstract();
/**
- * Sets the isAbstract attribute of the target paltform.
+ * Sets the isAbstract attribute of the target paltform.
*/
public void setIsAbstract(boolean b);
-
+
/**
* Returns a semi-colon delimited list of child Ids of the superclass'
* children that should not be automatically inherited by this element.
- * Returns an empty string if the attribute was not specified.
- * @return String
+ * Returns an empty string if the attribute was not specified.
+ * @return String
*/
public String getUnusedChildren();
-
+
/**
* Returns an array of operating systems this target platform represents.
- *
+ *
* @return String[]
*/
public String[] getOSList();
/**
* Sets the OS list.
- *
+ *
* @param OSs The list of OS names
*/
public void setOSList(String[] OSs);
-
- /**
- * Returns an array of architectures this target platform represents.
- *
- * @return String[]
- */
- public String[] getArchList();
-
+
+ /**
+ * Returns an array of architectures this target platform represents.
+ *
+ * @return String[]
+ */
+ public String[] getArchList();
+
/**
* Sets the architecture list.
- *
+ *
* @param archs The list of architecture names
*/
public void setArchList(String[] archs);
/**
* Returns the unique ID of the binary parser associated with the target platform.
- *
+ *
* @return String
* @deprecated Use getBinaryParserList
*/
@@ -106,14 +106,14 @@ public interface ITargetPlatform extends IBuildObject {
/**
* Returns the unique IDs of the binary parsers associated with the target platform.
- *
+ *
* @return String[]
*/
public String[] getBinaryParserList();
/**
* Sets the string id of the binary parser for this target platform.
- *
+ *
* @deprecated Use setBinaryParserList
*/
@Deprecated
@@ -125,26 +125,26 @@ public interface ITargetPlatform extends IBuildObject {
public void setBinaryParserList(String[] ids);
/**
- * 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
*/
public boolean isDirty();
-
+
/**
* Sets the element's "dirty" (have I been modified?) flag.
*/
public void setDirty(boolean isDirty);
-
+
/**
* Returns <code>true</code> if this target platform was loaded from a manifest file,
* and <code>false</code> if it was loaded from a project (.cdtbuild) file.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean isExtensionElement();
-
+
public CTargetPlatformData getTargetPlatformData();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java
index 2e5970ac79f..6106974e4c5 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM - Initial API and implementation
*******************************************************************************/
@@ -25,42 +25,41 @@ import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGeneratorType;
* This interface represents a utility of some sort that is used in the build process.
* A tool will generally process one or more resources to produce output resources.
* Most tools have a set of options that can be used to modify the behavior of the tool.
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ITool extends IHoldsOptions {
// Schema element names
- public static final String COMMAND = "command"; //$NON-NLS-1$
+ public static final String COMMAND = "command"; //$NON-NLS-1$
public static final String COMMAND_LINE_PATTERN = "commandLinePattern"; //$NON-NLS-1$
public static final String COMMAND_LINE_GENERATOR = "commandLineGenerator"; //$NON-NLS-1$
- public static final String DEP_CALC_ID ="dependencyCalculator"; //$NON-NLS-1$
- public static final String INTERFACE_EXTS = "headerExtensions"; //$NON-NLS-1$
- public static final String NATURE = "natureFilter"; //$NON-NLS-1$
- public static final String OUTPUT_FLAG = "outputFlag"; //$NON-NLS-1$
- public static final String INPUT_TYPE = "inputType"; //$NON-NLS-1$
- public static final String OUTPUT_TYPE = "outputType"; //$NON-NLS-1$
- public static final String OUTPUT_PREFIX = "outputPrefix"; //$NON-NLS-1$
- public static final String OUTPUTS = "outputs"; //$NON-NLS-1$
- public static final String SOURCES = "sources"; //$NON-NLS-1$
- public static final String ADVANCED_INPUT_CATEGORY = "advancedInputCategory"; //$NON-NLS-1$
- public static final String CUSTOM_BUILD_STEP = "customBuildStep"; //$NON-NLS-1$
- public static final String ANNOUNCEMENT = "announcement"; //$NON-NLS-1$
- public static final String TOOL_ELEMENT_NAME = "tool"; //$NON-NLS-1$
- public static final String WHITE_SPACE = " "; //$NON-NLS-1$
- public static final String EMPTY_STRING = ""; //$NON-NLS-1$
- public static final String IS_SYSTEM = "isSystem"; //$NON-NLS-1$
+ public static final String DEP_CALC_ID = "dependencyCalculator"; //$NON-NLS-1$
+ public static final String INTERFACE_EXTS = "headerExtensions"; //$NON-NLS-1$
+ public static final String NATURE = "natureFilter"; //$NON-NLS-1$
+ public static final String OUTPUT_FLAG = "outputFlag"; //$NON-NLS-1$
+ public static final String INPUT_TYPE = "inputType"; //$NON-NLS-1$
+ public static final String OUTPUT_TYPE = "outputType"; //$NON-NLS-1$
+ public static final String OUTPUT_PREFIX = "outputPrefix"; //$NON-NLS-1$
+ public static final String OUTPUTS = "outputs"; //$NON-NLS-1$
+ public static final String SOURCES = "sources"; //$NON-NLS-1$
+ public static final String ADVANCED_INPUT_CATEGORY = "advancedInputCategory"; //$NON-NLS-1$
+ public static final String CUSTOM_BUILD_STEP = "customBuildStep"; //$NON-NLS-1$
+ public static final String ANNOUNCEMENT = "announcement"; //$NON-NLS-1$
+ public static final String TOOL_ELEMENT_NAME = "tool"; //$NON-NLS-1$
+ public static final String WHITE_SPACE = " "; //$NON-NLS-1$
+ public static final String EMPTY_STRING = ""; //$NON-NLS-1$
+ public static final String IS_SYSTEM = "isSystem"; //$NON-NLS-1$
/**
* @since 8.4
*/
- public static final String IS_HIDDEN = "isHidden"; //$NON-NLS-1$
-
- public static final String VERSIONS_SUPPORTED = "versionsSupported"; //$NON-NLS-1$
- public static final String CONVERT_TO_ID = "convertToId"; //$NON-NLS-1$
- public static final String OPTIONPATHCONVERTER = "optionPathConverter"; //$NON-NLS-1$
-
+ public static final String IS_HIDDEN = "isHidden"; //$NON-NLS-1$
+
+ public static final String VERSIONS_SUPPORTED = "versionsSupported"; //$NON-NLS-1$
+ public static final String CONVERT_TO_ID = "convertToId"; //$NON-NLS-1$
+ public static final String OPTIONPATHCONVERTER = "optionPathConverter"; //$NON-NLS-1$
+
public static final String SUPPORTS_MANAGED_BUILD = "supportsManagedBuild"; //$NON-NLS-1$
-
public static final int FILTER_C = 0;
public static final int FILTER_CC = 1;
@@ -68,19 +67,19 @@ public interface ITool extends IHoldsOptions {
/**
* Returns the tool-chain or resource configuration that is the parent of this tool.
- *
+ *
* @return IBuildObject
*/
public IBuildObject getParent();
/**
* Creates a child InputType for this tool.
- *
+ *
* @param superClass The superClass, if any
- * @param Id The id for the new InputType
+ * @param Id The id for the new InputType
* @param name The name for the new InputType
* @param isExtensionElement Indicates whether this is an extension element or a managed project element
- *
+ *
* @return IInputType
* @since 3.0
*/
@@ -88,30 +87,30 @@ public interface ITool extends IHoldsOptions {
/**
* Removes an InputType from the tool's list.
- *
+ *
* @since 3.0
*/
public void removeInputType(IInputType type);
-
+
/**
* Returns the complete list of input types that are available for this tool.
- * The list is a merging of the input types specified for this tool with the
+ * The list is a merging of the input types specified for this tool with the
* input types of its superclasses. The lowest input type instance in the hierarchy
- * takes precedence.
- *
+ * takes precedence.
+ *
* @return IInputType[]
* @since 3.0
*/
public IInputType[] getInputTypes();
/**
- * Returns the <code>IInputType</code> in the tool with the specified
+ * Returns the <code>IInputType</code> in the tool with the specified
* ID. This is an efficient search in the receiver.
- *
- * <p>If the receiver does not have an InputType with that ID, the method
- * returns <code>null</code>. It is the responsibility of the caller to
- * verify the return value.
- *
+ *
+ * <p>If the receiver does not have an InputType with that ID, the method
+ * returns <code>null</code>. It is the responsibility of the caller to
+ * verify the return value.
+ *
* @param id unique identifier of the InputType to search for
* @return <code>IInputType</code>
* @since 3.0
@@ -119,13 +118,13 @@ public interface ITool extends IHoldsOptions {
public IInputType getInputTypeById(String id);
/**
- * Returns the <code>IInputType</code> in the tool that uses the
+ * Returns the <code>IInputType</code> in the tool that uses the
* specified extension.
- *
- * <p>If the receiver does not have an InputType that uses the extension,
- * the method returns <code>null</code>. It is the responsibility of the
- * caller to verify the return value.
- *
+ *
+ * <p>If the receiver does not have an InputType that uses the extension,
+ * the method returns <code>null</code>. It is the responsibility of the
+ * caller to verify the return value.
+ *
* @param inputExtension File extension
* @return <code>IInputType</code>
* @since 3.0
@@ -134,11 +133,11 @@ public interface ITool extends IHoldsOptions {
/**
* Returns the primary <code>IInputType</code> in this tool
- *
- * <p>If the receiver has no InputTypes,
- * the method returns <code>null</code>. It is the responsibility of the
- * caller to verify the return value.
- *
+ *
+ * <p>If the receiver has no InputTypes,
+ * the method returns <code>null</code>. It is the responsibility of the
+ * caller to verify the return value.
+ *
* @return <code>IInputType</code>
* @since 3.0
*/
@@ -148,28 +147,28 @@ public interface ITool extends IHoldsOptions {
* Returns all of the additional input resources of all InputType children.
* Note: This does not include the primary InputType and does not include
* additional dependencies.
- *
+ *
* @return IPath[]
*/
public IPath[] getAdditionalResources();
/**
* Returns all of the additional dependency resources of all InputType children.
- * Note: This does not include the primary InputType and does not include
+ * Note: This does not include the primary InputType and does not include
* additional inputs.
- *
+ *
* @return IPath[]
*/
public IPath[] getAdditionalDependencies();
/**
* Creates a child OutputType for this tool.
- *
+ *
* @param superClass The superClass, if any
- * @param Id The id for the new OutputType
+ * @param Id The id for the new OutputType
* @param name The name for the new OutputType
* @param isExtensionElement Indicates whether this is an extension element or a managed project element
- *
+ *
* @return IOutputType
* @since 3.0
*/
@@ -177,29 +176,30 @@ public interface ITool extends IHoldsOptions {
/**
* Removes an OutputType from the tool's list.
- *
+ *
* @since 3.0
*/
public void removeOutputType(IOutputType type);
-
+
/**
* Returns the complete list of output types that are available for this tool.
- * The list is a merging of the output types specified for this tool with the
+ * The list is a merging of the output types specified for this tool with the
* output types of its superclasses. The lowest output type instance in the hierarchy
- * takes precedence.
- *
+ * takes precedence.
+ *
* @return IOutputType[]
* @since 3.0
*/
public IOutputType[] getOutputTypes();
+
/**
- * Get the <code>IOutputType</code> in the receiver with the specified
+ * Get the <code>IOutputType</code> in the receiver with the specified
* ID. This is an efficient search in the receiver.
- *
- * <p>If the receiver does not have an OutputType with that ID, the method
- * returns <code>null</code>. It is the responsibility of the caller to
- * verify the return value.
- *
+ *
+ * <p>If the receiver does not have an OutputType with that ID, the method
+ * returns <code>null</code>. It is the responsibility of the caller to
+ * verify the return value.
+ *
* @param id unique identifier of the OutputType to search for
* @return <code>IOutputType</code>
* @since 3.0
@@ -207,13 +207,13 @@ public interface ITool extends IHoldsOptions {
public IOutputType getOutputTypeById(String id);
/**
- * Returns the <code>IOutputType</code> in the tool that creates the
+ * Returns the <code>IOutputType</code> in the tool that creates the
* specified extension.
- *
- * <p>If the receiver does not have an OutputType that creates the extension,
- * the method returns <code>null</code>. It is the responsibility of the
- * caller to verify the return value.
- *
+ *
+ * <p>If the receiver does not have an OutputType that creates the extension,
+ * the method returns <code>null</code>. It is the responsibility of the
+ * caller to verify the return value.
+ *
* @param outputExtension File extension
* @return <code>IOutputType</code>
* @since 3.0
@@ -222,11 +222,11 @@ public interface ITool extends IHoldsOptions {
/**
* Returns the primary <code>IOutputType</code> in this tool
- *
- * <p>If the receiver has no OutputTypes,
- * the method returns <code>null</code>. It is the responsibility of the
- * caller to verify the return value.
- *
+ *
+ * <p>If the receiver has no OutputTypes,
+ * the method returns <code>null</code>. It is the responsibility of the
+ * caller to verify the return value.
+ *
* @return <code>IOutputType</code>
* @since 3.0
*/
@@ -235,43 +235,43 @@ public interface ITool extends IHoldsOptions {
/**
* Returns the <code>ITool</code> that is the superclass of this
* tool, or <code>null</code> if the attribute was not specified.
- *
+ *
* @return ITool
*/
public ITool getSuperClass();
-
+
/**
* Returns whether this element is abstract. Returns <code>false</code>
* if the attribute was not specified.
- * @return boolean
+ * @return boolean
*/
public boolean isAbstract();
/**
- * Sets the isAbstract attribute of the tool-chain.
+ * Sets the isAbstract attribute of the tool-chain.
*/
public void setIsAbstract(boolean b);
-
+
/**
* Returns a semi-colon delimited list of child Ids of the superclass'
* children that should not be automatically inherited by this element.
- * Returns an empty string if the attribute was not specified.
- * @return String
+ * Returns an empty string if the attribute was not specified.
+ * @return String
*/
public String getUnusedChildren();
/**
* Returns the semicolon separated list of unique IDs of the error parsers associated
* with the tool.
- *
+ *
* @return String
*/
public String getErrorParserIds();
/**
- * Returns the ordered list of unique IDs of the error parsers associated with the
+ * Returns the ordered list of unique IDs of the error parsers associated with the
* tool.
- *
+ *
* @return String[]
*/
public String[] getErrorParserList();
@@ -280,53 +280,53 @@ public interface ITool extends IHoldsOptions {
* Sets the semicolon separated list of error parser ids
*/
public void setErrorParserIds(String ids);
-
+
/**
* Returns the list of valid source extensions this tool knows how to build.
* The list may be empty but will never be <code>null</code>.
- *
+ *
* @return List
* @deprecated - use getPrimaryInputExtensions or getAllInputExtensions
*/
@Deprecated
public List<String> getInputExtensions();
-
+
/**
* Returns the array of valid primary source extensions this tool knows how to build.
* The array may be empty but will never be <code>null</code>.
- *
+ *
* @return String[]
*/
public String[] getPrimaryInputExtensions();
-
+
/**
* Returns the array of all valid source extensions this tool knows how to build.
* The array may be empty but will never be <code>null</code>.
- *
+ *
* @return String[]
*/
public String[] getAllInputExtensions();
-
+
/**
* Returns the default input extension for the primary input of the tool
- *
+ *
* @return String
*/
public String getDefaultInputExtension();
-
+
/**
* Returns the array of all valid dependency extensions for this tool's inputs.
* The array may be empty but will never be <code>null</code>.
- *
+ *
* @return String[]
*/
public String[] getAllDependencyExtensions();
-
+
/**
* Returns the list of valid header extensions for this tool.
* Returns the value of the headerExtensions attribute
* The list may be empty but will never be <code>null</code>.
- *
+ *
* @return List
* @deprecated - use getDependency* methods
*/
@@ -334,79 +334,79 @@ public interface ITool extends IHoldsOptions {
public List<String> getInterfaceExtensions();
/**
- * Answers a constant corresponding to the project nature the tool should be used
+ * Answers a constant corresponding to the project nature the tool should be used
* for. Possible answers are:
- *
+ *
* <dl>
* <dt>ITool.FILTER_C
- * <dd>The tool should only be displayed for C projects. <i>Notes:</i> even
- * though a C++ project has a C nature, this flag will mask the tool for C++
- * projects.
+ * <dd>The tool should only be displayed for C projects. <i>Notes:</i> even
+ * though a C++ project has a C nature, this flag will mask the tool for C++
+ * projects.
* <dt>ITool.FILTER_CC
* <dd>The tool should only be displayed for C++ projects.
* <dt>ITool.FILTER_BOTH
* <dd>The tool should be displayed for projects with both natures.
* </dl>
- *
+ *
* @return int
*/
public int getNatureFilter();
-
+
/**
* Returns the array of all valid output extensions this tool can create.
* The array may be empty but will never be <code>null</code>.
- *
+ *
* @return String[]
*/
public String[] getAllOutputExtensions();
-
+
/**
* Answers all of the output extensions that the receiver can build.
* This routine returns the value if the outputs attribute.
- *
+ *
* @return <code>String[]</code> of extensions
* @deprecated - use getAllOutputExtensions
*/
@Deprecated
public String[] getOutputExtensions();
-
+
/**
* Answers all of the output extensions that the receiver can build,
* from the value of the outputs attribute
- *
+ *
* @return <code>String[]</code> of extensions
*/
public String[] getOutputsAttribute();
-
+
/**
- * Answer the output extension the receiver will create from the input,
+ * Answer the output extension the receiver will create from the input,
* or <code>null</code> if the tool does not understand that extension.
- *
- * @param inputExtension The extension of the source file.
+ *
+ * @param inputExtension The extension of the source file.
* @return String
*/
public String getOutputExtension(String inputExtension);
-
+
/**
* Sets all of the output extensions that the receiver can build,
* into the outputs attribute. Note that the outputs attribute is
- * ignored when one or more outputTypes are specified.
+ * ignored when one or more outputTypes are specified.
*/
public void setOutputsAttribute(String extensions);
-
+
/**
- * 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 getOutputFlag();
-
+
/**
- * Sets 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.
+ * Sets 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.
*/
public void setOutputFlag(String flag);
@@ -420,89 +420,89 @@ public interface ITool extends IHoldsOptions {
/**
* Sets the prefix that the tool should prepend to the name of the build artifact.
* For example, a librarian usually prepends 'lib' to the target.a
- *
- * @see #setOutputPrefixForPrimaryOutput(String)
+ *
+ * @see #setOutputPrefixForPrimaryOutput(String)
*/
public void setOutputPrefix(String prefix);
-
+
public void setOutputPrefixForPrimaryOutput(String prefix);
-
+
/**
- * Returns <code>true</code> if the Tool wants the MBS to display the Advanced
+ * Returns <code>true</code> if the Tool wants the MBS to display the Advanced
* Input category that allows the user to specify additional input resources and
* dependencies, else <code>false</code>.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean getAdvancedInputCategory();
-
+
/**
- * Sets whether the Tool wants the MBS to display the Advanced
+ * Sets whether the Tool wants the MBS to display the Advanced
* Input category that allows the user to specify additional input resources and
- * dependencies.
+ * dependencies.
*/
public void setAdvancedInputCategory(boolean display);
-
+
/**
* Returns <code>true</code> if the Tool represents a user-define custom build
* step, else <code>false</code>.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean getCustomBuildStep();
-
+
/**
* Sets whether the Tool represents a user-define custom build step.
*/
public void setCustomBuildStep(boolean customBuildStep);
-
+
/**
- * Returns the announcement string for this tool
+ * Returns the announcement string for this tool
* @return String
*/
public String getAnnouncement();
-
+
/**
- * Sets the announcement string for this tool
+ * Sets the announcement string for this tool
*/
public void setAnnouncement(String announcement);
-
+
/**
* Answers the command-line invocation defined for the receiver.
- *
+ *
* @return String
*/
public String getToolCommand();
-
+
/**
* Sets the command-line invocation command defined for this tool.
- *
- * @return boolean if <code>true</code>, then the tool command was modified
+ *
+ * @return boolean if <code>true</code>, then the tool command was modified
*/
public boolean setToolCommand(String command);
-
+
/**
- * Returns command line pattern for this tool
+ * Returns command line pattern for this tool
* @return String
*/
public String getCommandLinePattern();
-
+
/**
- * Sets the command line pattern for this tool
+ * Sets the command line pattern for this tool
*/
public void setCommandLinePattern(String pattern);
-
+
/**
* Returns the command line generator specified for this tool
* @return IManagedCommandLineGenerator
*/
public IManagedCommandLineGenerator getCommandLineGenerator();
-
+
/**
- * Returns a class instance that implements an interface to generate
- * source-level dependencies for the tool specified in the argument.
- * This method may return <code>null</code> in which case, the receiver
- * should assume that the tool does not require dependency information
+ * Returns a class instance that implements an interface to generate
+ * source-level dependencies for the tool specified in the argument.
+ * This method may return <code>null</code> in which case, the receiver
+ * should assume that the tool does not require dependency information
* when the project is built.
*
* @return IManagedDependencyGenerator
@@ -510,72 +510,72 @@ public interface ITool extends IHoldsOptions {
*/
@Deprecated
public IManagedDependencyGenerator getDependencyGenerator();
-
+
/**
- * Returns a class instance that implements an interface to generate
- * source-level dependencies for the tool specified in the argument.
- * This method may return <code>null</code> in which case, the receiver
- * should assume that the tool does not require dependency information
+ * Returns a class instance that implements an interface to generate
+ * source-level dependencies for the tool specified in the argument.
+ * This method may return <code>null</code> in which case, the receiver
+ * should assume that the tool does not require dependency information
* when the project is built.
*
* @param sourceExt source file extension
* @return IManagedDependencyGeneratorType
*/
public IManagedDependencyGeneratorType getDependencyGeneratorForExtension(String sourceExt);
-
+
/**
* Returns an array of command line arguments that have been specified for
* the tool.
* The flags contain build macros resolved to the makefile format.
* That is if a user has chosen to expand all macros in the buildfile,
- * the flags contain all macro references resolved, otherwise, if a user has
+ * the flags contain all macro references resolved, otherwise, if a user has
* chosen to keep the environment build macros unresolved, the flags contain
* the environment macro references converted to the buildfile variable format,
- * all other macro references are resolved
- *
+ * all other macro references are resolved
+ *
* @deprecated - use getToolCommandFlags instead
*/
@Deprecated
public String[] getCommandFlags() throws BuildException;
-
+
/**
* Returns the command line arguments that have been specified for
* the tool.
* The string contains build macros resolved to the makefile format.
* That is if a user has chosen to expand all macros in the buildfile,
- * the string contains all macro references resolved, otherwise, if a user has
+ * the string contains all macro references resolved, otherwise, if a user has
* chosen to keep the environment build macros unresolved, the string contains
* the environment macro references converted to the buildfile variable format,
- * all other macro references are resolved
- *
+ * all other macro references are resolved
+ *
* @return String
- *
+ *
* @deprecated - use getToolCommandFlagsString instead
*/
@Deprecated
- public String getToolFlags() throws BuildException ;
-
+ public String getToolFlags() throws BuildException;
+
/**
* Returns an array of command line arguments that have been specified for
* the tool.
* The flags contain build macros resolved to the makefile format.
* That is if a user has chosen to expand all macros in the buildfile,
- * the flags contain all macro references resolved, otherwise, if a user has
+ * the flags contain all macro references resolved, otherwise, if a user has
* chosen to keep the environment build macros unresolved, the flags contain
* the environment macro references converted to the buildfile variable format,
- * all other macro references are resolved
+ * all other macro references are resolved
*/
public String[] getToolCommandFlags(IPath inputFileLocation, IPath outputFileLocation) throws BuildException;
-
+
/**
* Returns the command line arguments that have been specified for
* the tool.
* The string contains build macros resolved to the makefile format.
* That is if a user has chosen to expand all macros in the buildfile,
- * the string contains all macro references resolved, otherwise, if a user has
+ * the string contains all macro references resolved, otherwise, if a user has
* chosen to keep the environment build macros unresolved, the string contains
* the environment macro references converted to the buildfile variable format,
- * all other macro references are resolved
+ * all other macro references are resolved
*/
public String getToolCommandFlagsString(IPath inputFileLocation, IPath outputFileLocation) throws BuildException;
@@ -583,15 +583,15 @@ public interface ITool extends IHoldsOptions {
* Options are organized into categories for UI purposes.
* These categories are organized into a tree. This is the root
* of that tree.
- *
+ *
* @return IOptionCategory
*/
- public IOptionCategory getTopOptionCategory();
+ public IOptionCategory getTopOptionCategory();
/**
* Return <code>true</code> if the receiver builds files with the
* specified extension, else <code>false</code>.
- *
+ *
* @param extension file extension of the source
* @return boolean
*/
@@ -602,16 +602,16 @@ public interface ITool extends IHoldsOptions {
* specified extension as input, else <code>false</code>. This
* returns true for a superset of the extensions that buildFileType
* returns true for - it includes secondary inputs.
- *
+ *
* @param extension file extension of the source
* @return boolean
*/
public boolean isInputFileType(String extension);
-
+
/**
- * Answers <code>true</code> if the tool considers the file extension to be
+ * Answers <code>true</code> if the tool considers the file extension to be
* one associated with a header file.
- *
+ *
* @param ext file extension of the source
* @return boolean
*/
@@ -620,99 +620,99 @@ public interface ITool extends IHoldsOptions {
/**
* Answers <code>true</code> if the receiver builds a file with the extension specified
* in the argument, else <code>false</code>.
- *
+ *
* @param outputExtension extension of the file being produced by a tool
* @return boolean
*/
public boolean producesFileType(String outputExtension);
/**
- * Returns <code>true</code> if this tool has changes that need to
+ * Returns <code>true</code> if this tool has changes that need to
* be saved in the project file, else <code>false</code>.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean isDirty();
-
+
/**
* Sets the element's "dirty" (have I been modified?) flag.
*/
public void setDirty(boolean isDirty);
-
+
/**
* Returns <code>true</code> if this tool was loaded from a manifest file,
* and <code>false</code> if it was loaded from a project (.cdtbuild) file.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean isExtensionElement();
-
+
/**
* Returns the 'versionsSupported' of this tool
- *
+ *
* @return String
*/
public String getVersionsSupported();
-
+
/**
* Returns the 'convertToId' of this tool
- *
+ *
* @return String
*/
public String getConvertToId();
/**
- * Sets the 'versionsSupported' attribute of the tool.
- */
+ * Sets the 'versionsSupported' attribute of the tool.
+ */
public void setVersionsSupported(String versionsSupported);
-
+
/**
- * Sets the 'convertToId' attribute of the tool.
+ * Sets the 'convertToId' attribute of the tool.
*/
public void setConvertToId(String convertToId);
-
+
/**
* Returns an array of the Environment Build Path variable descriptors
- *
+ *
* @return IEnvVarBuildPath[]
*/
public IEnvVarBuildPath[] getEnvVarBuildPaths();
-
+
/**
* Returns an IOptionPathConverter implementation for this tool
* or null, if no conversion is required
*/
- public IOptionPathConverter getOptionPathConverter() ;
-
+ public IOptionPathConverter getOptionPathConverter();
+
CLanguageData getCLanguageData(IInputType type);
-
+
CLanguageData[] getCLanguageDatas();
-
+
IInputType getInputTypeForCLanguageData(CLanguageData data);
-
+
IResourceInfo getParentResourceInfo();
-
+
IInputType getEditableInputType(IInputType base);
-
+
IOutputType getEditableOutputType(IOutputType base);
-
+
boolean isEnabled();
-
+
boolean supportsBuild(boolean managed);
-
+
boolean matches(ITool tool);
-
+
boolean isSystemObject();
-
+
/**
* @since 8.4
*/
boolean isHidden();
-
+
/**
* @since 8.4
*/
void setHidden(boolean hidden);
-
+
String getUniqueRealName();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IToolChain.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IToolChain.java
index 7b1e9616722..a3757026975 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IToolChain.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IToolChain.java
@@ -17,7 +17,6 @@ import org.eclipse.cdt.core.settings.model.extension.CTargetPlatformData;
import org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSupplier;
import org.eclipse.cdt.managedbuilder.macros.IConfigurationBuildMacroSupplier;
-
/**
* This interface represents a tool-integrator-defined, ordered set of tools
* that transform the project's input into the project's outputs. A
@@ -37,21 +36,21 @@ import org.eclipse.cdt.managedbuilder.macros.IConfigurationBuildMacroSupplier;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IToolChain extends IHoldsOptions {
- public static final String TOOL_CHAIN_ELEMENT_NAME = "toolChain"; //$NON-NLS-1$
- public static final String OS_LIST = "osList"; //$NON-NLS-1$
- public static final String ARCH_LIST = "archList"; //$NON-NLS-1$
- public static final String ERROR_PARSERS = "errorParsers"; //$NON-NLS-1$
- public static final String VERSIONS_SUPPORTED = "versionsSupported"; //$NON-NLS-1$
- public static final String CONVERT_TO_ID = "convertToId"; //$NON-NLS-1$
- public static final String TARGET_TOOL = "targetTool"; //$NON-NLS-1$
- public static final String SECONDARY_OUTPUTS = "secondaryOutputs"; //$NON-NLS-1$
- public static final String IS_TOOL_CHAIN_SUPPORTED = "isToolChainSupported"; //$NON-NLS-1$
- public static final String CONFIGURATION_ENVIRONMENT_SUPPLIER = "configurationEnvironmentSupplier"; //$NON-NLS-1$
- public static final String CONFIGURATION_MACRO_SUPPLIER = "configurationMacroSupplier"; //$NON-NLS-1$
+ public static final String TOOL_CHAIN_ELEMENT_NAME = "toolChain"; //$NON-NLS-1$
+ public static final String OS_LIST = "osList"; //$NON-NLS-1$
+ public static final String ARCH_LIST = "archList"; //$NON-NLS-1$
+ public static final String ERROR_PARSERS = "errorParsers"; //$NON-NLS-1$
+ public static final String VERSIONS_SUPPORTED = "versionsSupported"; //$NON-NLS-1$
+ public static final String CONVERT_TO_ID = "convertToId"; //$NON-NLS-1$
+ public static final String TARGET_TOOL = "targetTool"; //$NON-NLS-1$
+ public static final String SECONDARY_OUTPUTS = "secondaryOutputs"; //$NON-NLS-1$
+ public static final String IS_TOOL_CHAIN_SUPPORTED = "isToolChainSupported"; //$NON-NLS-1$
+ public static final String CONFIGURATION_ENVIRONMENT_SUPPLIER = "configurationEnvironmentSupplier"; //$NON-NLS-1$
+ public static final String CONFIGURATION_MACRO_SUPPLIER = "configurationMacroSupplier"; //$NON-NLS-1$
public static final String SUPPORTS_MANAGED_BUILD = "supportsManagedBuild"; //$NON-NLS-1$
- public static final String IS_SYSTEM= "isSystem"; //$NON-NLS-1$
- public static final String NON_INTERNAL_BUILDER_ID = "nonInternalBuilderId"; //$NON-NLS-1$
- public static final String RESOURCE_TYPE_BASED_DISCOVERY = "resourceTypeBasedDiscovery"; //$NON-NLS-1$
+ public static final String IS_SYSTEM = "isSystem"; //$NON-NLS-1$
+ public static final String NON_INTERNAL_BUILDER_ID = "nonInternalBuilderId"; //$NON-NLS-1$
+ public static final String RESOURCE_TYPE_BASED_DISCOVERY = "resourceTypeBasedDiscovery"; //$NON-NLS-1$
// The attribute name for the scanner info collector
public static final String SCANNER_CONFIG_PROFILE_ID = "scannerConfigDiscoveryProfileId"; //$NON-NLS-1$
@@ -76,7 +75,8 @@ public interface IToolChain extends IHoldsOptions {
*
* @return ITargetPlatform
*/
- public ITargetPlatform createTargetPlatform(ITargetPlatform superClass, String Id, String name, boolean isExtensionElement);
+ public ITargetPlatform createTargetPlatform(ITargetPlatform superClass, String Id, String name,
+ boolean isExtensionElement);
/**
* Returns the target-platform child of this tool-chain
@@ -98,6 +98,7 @@ public interface IToolChain extends IHoldsOptions {
*/
public String getVersionsSupported();
+
/**
* Returns the 'convertToId' of this tool-chain
*
@@ -384,7 +385,7 @@ public interface IToolChain extends IHoldsOptions {
* Returns an IOptionPathConverter implementation for this toolchain
* or null, if no conversion is required
*/
- public IOptionPathConverter getOptionPathConverter() ;
+ public IOptionPathConverter getOptionPathConverter();
IFolderInfo getParentFolderInfo();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/InternalBuildRunner.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/InternalBuildRunner.java
index 19b19e961f3..e15b95c149c 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/InternalBuildRunner.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/InternalBuildRunner.java
@@ -61,9 +61,9 @@ public class InternalBuildRunner extends AbstractBuildRunner {
private static final int TICKS_REFRESH_PROJECT = 1 * PROGRESS_MONITOR_SCALE;
@Override
- public boolean invokeBuild(int kind, IProject project, IConfiguration configuration,
- IBuilder builder, IConsole console, IMarkerGenerator markerGenerator,
- IncrementalProjectBuilder projectBuilder, IProgressMonitor monitor) throws CoreException {
+ public boolean invokeBuild(int kind, IProject project, IConfiguration configuration, IBuilder builder,
+ IConsole console, IMarkerGenerator markerGenerator, IncrementalProjectBuilder projectBuilder,
+ IProgressMonitor monitor) throws CoreException {
BuildRunnerHelper buildRunnerHelper = new BuildRunnerHelper(project);
@@ -71,7 +71,8 @@ public class InternalBuildRunner extends AbstractBuildRunner {
if (monitor == null) {
monitor = new NullProgressMonitor();
}
- monitor.beginTask("", TICKS_STREAM_PROGRESS_MONITOR + TICKS_DELETE_MARKERS + TICKS_EXECUTE_COMMAND + TICKS_REFRESH_PROJECT); //$NON-NLS-1$
+ monitor.beginTask("", TICKS_STREAM_PROGRESS_MONITOR + TICKS_DELETE_MARKERS + TICKS_EXECUTE_COMMAND //$NON-NLS-1$
+ + TICKS_REFRESH_PROJECT);
boolean isParallel = builder.getParallelizationNum() > 1;
boolean resumeOnErr = !builder.isStopOnError();
@@ -82,13 +83,14 @@ public class InternalBuildRunner extends AbstractBuildRunner {
IProjectBuildState pBS = bsMngr.getProjectBuildState(project);
IConfigurationBuildState cBS = pBS.getConfigurationBuildState(configuration.getId(), true);
-// if(delta != null){
+ // if(delta != null){
flags = BuildDescriptionManager.REBUILD | BuildDescriptionManager.REMOVED | BuildDescriptionManager.DEPS;
-// delta = getDelta(currentProject);
-// }
+ // delta = getDelta(currentProject);
+ // }
boolean buildIncrementaly = delta != null;
- ICConfigurationDescription cfgDescription = ManagedBuildManager.getDescriptionForConfiguration(configuration);
+ ICConfigurationDescription cfgDescription = ManagedBuildManager
+ .getDescriptionForConfiguration(configuration);
// Prepare launch parameters for BuildRunnerHelper
String cfgName = configuration.getName();
@@ -98,31 +100,38 @@ public class InternalBuildRunner extends AbstractBuildRunner {
URI workingDirectoryURI = ManagedBuildManager.getBuildLocationURI(configuration, builder);
String[] errorParsers = builder.getErrorParsers();
- ErrorParserManager epm = new ErrorParserManager(project, workingDirectoryURI, markerGenerator, errorParsers);
+ ErrorParserManager epm = new ErrorParserManager(project, workingDirectoryURI, markerGenerator,
+ errorParsers);
List<IConsoleParser> parsers = new ArrayList<IConsoleParser>();
ManagedBuildManager.collectLanguageSettingsConsoleParsers(cfgDescription, epm, parsers);
- buildRunnerHelper.prepareStreams(epm, parsers, console, new SubProgressMonitor(monitor, TICKS_STREAM_PROGRESS_MONITOR));
+ buildRunnerHelper.prepareStreams(epm, parsers, console,
+ new SubProgressMonitor(monitor, TICKS_STREAM_PROGRESS_MONITOR));
IBuildDescription des = BuildDescriptionManager.createBuildDescription(configuration, cBS, delta, flags);
DescriptionBuilder dBuilder = null;
if (!isParallel) {
dBuilder = new DescriptionBuilder(des, buildIncrementaly, resumeOnErr, cBS);
if (dBuilder.getNumCommands() <= 0) {
- buildRunnerHelper.printLine(ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.no.build", project.getName())); //$NON-NLS-1$
+ buildRunnerHelper.printLine(ManagedMakeMessages
+ .getFormattedString("ManagedMakeBuilder.message.no.build", project.getName())); //$NON-NLS-1$
return false;
}
}
- buildRunnerHelper.removeOldMarkers(project, new SubProgressMonitor(monitor, TICKS_DELETE_MARKERS, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
+ buildRunnerHelper.removeOldMarkers(project, new SubProgressMonitor(monitor, TICKS_DELETE_MARKERS,
+ SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
if (buildIncrementaly) {
- buildRunnerHelper.greeting(IncrementalProjectBuilder.INCREMENTAL_BUILD, cfgName, toolchainName, isConfigurationSupported);
+ buildRunnerHelper.greeting(IncrementalProjectBuilder.INCREMENTAL_BUILD, cfgName, toolchainName,
+ isConfigurationSupported);
} else {
- buildRunnerHelper.greeting(ManagedMakeMessages.getResourceString("ManagedMakeBuider.type.rebuild"), cfgName, toolchainName, isConfigurationSupported); //$NON-NLS-1$
+ buildRunnerHelper.greeting(ManagedMakeMessages.getResourceString("ManagedMakeBuider.type.rebuild"), //$NON-NLS-1$
+ cfgName, toolchainName, isConfigurationSupported);
}
- buildRunnerHelper.printLine(ManagedMakeMessages.getResourceString("ManagedMakeBuilder.message.internal.builder.header.note")); //$NON-NLS-1$
+ buildRunnerHelper.printLine(
+ ManagedMakeMessages.getResourceString("ManagedMakeBuilder.message.internal.builder.header.note")); //$NON-NLS-1$
OutputStream stdout = buildRunnerHelper.getOutputStream();
OutputStream stderr = buildRunnerHelper.getErrorStream();
@@ -130,29 +139,35 @@ public class InternalBuildRunner extends AbstractBuildRunner {
int status;
epm.deferDeDuplication();
try {
-
+
if (dBuilder != null) {
- status = dBuilder.build(stdout, stderr, new SubProgressMonitor(monitor, TICKS_EXECUTE_COMMAND, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
+ status = dBuilder.build(stdout, stderr, new SubProgressMonitor(monitor, TICKS_EXECUTE_COMMAND,
+ SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
} else {
- status = ParallelBuilder.build(des, null, null, stdout, stderr, new SubProgressMonitor(monitor, TICKS_EXECUTE_COMMAND, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK), resumeOnErr, buildIncrementaly, cBS);
+ status = ParallelBuilder.build(des, null, null, stdout, stderr,
+ new SubProgressMonitor(monitor, TICKS_EXECUTE_COMMAND,
+ SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK),
+ resumeOnErr, buildIncrementaly, cBS);
// Bug 403670:
// Make sure the build configuration's rebuild status is updated with the result of
// this successful build. In the non-parallel case this happens within dBuilder.build
// (the cBS is passed as an instance of IResourceRebuildStateContainer).
if (status == ParallelBuilder.STATUS_OK)
cBS.setState(0);
- buildRunnerHelper.printLine(ManagedMakeMessages.getFormattedString("CommonBuilder.7", Integer.toString(ParallelBuilder.lastThreadsUsed))); //$NON-NLS-1$
+ buildRunnerHelper.printLine(ManagedMakeMessages.getFormattedString("CommonBuilder.7", //$NON-NLS-1$
+ Integer.toString(ParallelBuilder.lastThreadsUsed)));
}
} finally {
epm.deDuplicate();
}
-
+
bsMngr.setProjectBuildState(project, pBS);
buildRunnerHelper.close();
buildRunnerHelper.goodbye();
if (status != ICommandLauncher.ILLEGAL_COMMAND) {
- buildRunnerHelper.refreshProject(cfgName, new SubProgressMonitor(monitor, TICKS_REFRESH_PROJECT, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
+ buildRunnerHelper.refreshProject(cfgName, new SubProgressMonitor(monitor, TICKS_REFRESH_PROJECT,
+ SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
}
} catch (Exception e) {
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 5f147091f78..52cee0b9945 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
@@ -160,50 +160,50 @@ import org.w3c.dom.ProcessingInstruction;
* @noinstantiate This class is not intended to be instantiated by clients.
*/
public class ManagedBuildManager extends AbstractCExtension {
-// private static final QualifiedName buildInfoProperty = new QualifiedName(ManagedBuilderCorePlugin.PLUGIN_ID, "managedBuildInfo"); //$NON-NLS-1$
- private static final String ROOT_NODE_NAME = "ManagedProjectBuildInfo"; //$NON-NLS-1$
- public static final String SETTINGS_FILE_NAME = ".cdtbuild"; //$NON-NLS-1$
+ // private static final QualifiedName buildInfoProperty = new QualifiedName(ManagedBuilderCorePlugin.PLUGIN_ID, "managedBuildInfo"); //$NON-NLS-1$
+ private static final String ROOT_NODE_NAME = "ManagedProjectBuildInfo"; //$NON-NLS-1$
+ public static final String SETTINGS_FILE_NAME = ".cdtbuild"; //$NON-NLS-1$
private static final ITarget[] emptyTargets = new ITarget[0];
- public static final String INTERFACE_IDENTITY = ManagedBuilderCorePlugin.PLUGIN_ID + ".ManagedBuildManager"; //$NON-NLS-1$
- public static final String EXTENSION_POINT_ID = ManagedBuilderCorePlugin.PLUGIN_ID + ".buildDefinitions"; //$NON-NLS-1$
- public static final String EXTENSION_POINT_ID_V2 = ManagedBuilderCorePlugin.PLUGIN_ID + ".ManagedBuildInfo"; //$NON-NLS-1$
- private static final String REVISION_ELEMENT_NAME = "managedBuildRevision"; //$NON-NLS-1$
- private static final String VERSION_ELEMENT_NAME = "fileVersion"; //$NON-NLS-1$
- private static final String MANIFEST_VERSION_ERROR ="ManagedBuildManager.error.manifest.version.error"; //$NON-NLS-1$
- private static final String PROJECT_VERSION_ERROR ="ManagedBuildManager.error.project.version.error"; //$NON-NLS-1$
- private static final String PROJECT_FILE_ERROR = "ManagedBuildManager.error.project.file.missing"; //$NON-NLS-1$
- private static final String MANIFEST_ERROR_HEADER = "ManagedBuildManager.error.manifest.header"; //$NON-NLS-1$
- public static final String MANIFEST_ERROR_RESOLVING = "ManagedBuildManager.error.manifest.resolving"; //$NON-NLS-1$
- public static final String MANIFEST_ERROR_DUPLICATE = "ManagedBuildManager.error.manifest.duplicate"; //$NON-NLS-1$
- public static final String MANIFEST_ERROR_ICON = "ManagedBuildManager.error.manifest.icon"; //$NON-NLS-1$
- private static final String MANIFEST_ERROR_OPTION_CATEGORY = "ManagedBuildManager.error.manifest.option.category"; //$NON-NLS-1$
- private static final String MANIFEST_ERROR_OPTION_FILTER = "ManagedBuildManager.error.manifest.option.filter"; //$NON-NLS-1$
- private static final String MANIFEST_ERROR_OPTION_VALUEHANDLER = "ManagedBuildManager.error.manifest.option.valuehandler"; //$NON-NLS-1$
- private static final String MANIFEST_ERROR_READ_ONLY = "ManagedBuildManager.error.read_only"; //$NON-NLS-1$
- private static final String MANIFEST_ERROR_WRITE_FAILED = "ManagedBuildManager.error.write_failed"; //$NON-NLS-1$
+ public static final String INTERFACE_IDENTITY = ManagedBuilderCorePlugin.PLUGIN_ID + ".ManagedBuildManager"; //$NON-NLS-1$
+ public static final String EXTENSION_POINT_ID = ManagedBuilderCorePlugin.PLUGIN_ID + ".buildDefinitions"; //$NON-NLS-1$
+ public static final String EXTENSION_POINT_ID_V2 = ManagedBuilderCorePlugin.PLUGIN_ID + ".ManagedBuildInfo"; //$NON-NLS-1$
+ private static final String REVISION_ELEMENT_NAME = "managedBuildRevision"; //$NON-NLS-1$
+ private static final String VERSION_ELEMENT_NAME = "fileVersion"; //$NON-NLS-1$
+ private static final String MANIFEST_VERSION_ERROR = "ManagedBuildManager.error.manifest.version.error"; //$NON-NLS-1$
+ private static final String PROJECT_VERSION_ERROR = "ManagedBuildManager.error.project.version.error"; //$NON-NLS-1$
+ private static final String PROJECT_FILE_ERROR = "ManagedBuildManager.error.project.file.missing"; //$NON-NLS-1$
+ private static final String MANIFEST_ERROR_HEADER = "ManagedBuildManager.error.manifest.header"; //$NON-NLS-1$
+ public static final String MANIFEST_ERROR_RESOLVING = "ManagedBuildManager.error.manifest.resolving"; //$NON-NLS-1$
+ public static final String MANIFEST_ERROR_DUPLICATE = "ManagedBuildManager.error.manifest.duplicate"; //$NON-NLS-1$
+ public static final String MANIFEST_ERROR_ICON = "ManagedBuildManager.error.manifest.icon"; //$NON-NLS-1$
+ private static final String MANIFEST_ERROR_OPTION_CATEGORY = "ManagedBuildManager.error.manifest.option.category"; //$NON-NLS-1$
+ private static final String MANIFEST_ERROR_OPTION_FILTER = "ManagedBuildManager.error.manifest.option.filter"; //$NON-NLS-1$
+ private static final String MANIFEST_ERROR_OPTION_VALUEHANDLER = "ManagedBuildManager.error.manifest.option.valuehandler"; //$NON-NLS-1$
+ private static final String MANIFEST_ERROR_READ_ONLY = "ManagedBuildManager.error.read_only"; //$NON-NLS-1$
+ private static final String MANIFEST_ERROR_WRITE_FAILED = "ManagedBuildManager.error.write_failed"; //$NON-NLS-1$
// Error ID's for OptionValidError()
public static final int ERROR_CATEGORY = 0;
public static final int ERROR_FILTER = 1;
- public static final String BUILD_TYPE_PROPERTY_ID = "org.eclipse.cdt.build.core.buildType"; //$NON-NLS-1$
- public static final String BUILD_ARTEFACT_TYPE_PROPERTY_ID = "org.eclipse.cdt.build.core.buildArtefactType"; //$NON-NLS-1$
+ public static final String BUILD_TYPE_PROPERTY_ID = "org.eclipse.cdt.build.core.buildType"; //$NON-NLS-1$
+ public static final String BUILD_ARTEFACT_TYPE_PROPERTY_ID = "org.eclipse.cdt.build.core.buildArtefactType"; //$NON-NLS-1$
- public static final String BUILD_TYPE_PROPERTY_DEBUG = "org.eclipse.cdt.build.core.buildType.debug"; //$NON-NLS-1$
- public static final String BUILD_TYPE_PROPERTY_RELEASE = "org.eclipse.cdt.build.core.buildType.release"; //$NON-NLS-1$
- public static final String BUILD_ARTEFACT_TYPE_PROPERTY_EXE = "org.eclipse.cdt.build.core.buildArtefactType.exe"; //$NON-NLS-1$
- public static final String BUILD_ARTEFACT_TYPE_PROPERTY_STATICLIB = "org.eclipse.cdt.build.core.buildArtefactType.staticLib"; //$NON-NLS-1$
- public static final String BUILD_ARTEFACT_TYPE_PROPERTY_SHAREDLIB = "org.eclipse.cdt.build.core.buildArtefactType.sharedLib"; //$NON-NLS-1$
+ public static final String BUILD_TYPE_PROPERTY_DEBUG = "org.eclipse.cdt.build.core.buildType.debug"; //$NON-NLS-1$
+ public static final String BUILD_TYPE_PROPERTY_RELEASE = "org.eclipse.cdt.build.core.buildType.release"; //$NON-NLS-1$
+ public static final String BUILD_ARTEFACT_TYPE_PROPERTY_EXE = "org.eclipse.cdt.build.core.buildArtefactType.exe"; //$NON-NLS-1$
+ public static final String BUILD_ARTEFACT_TYPE_PROPERTY_STATICLIB = "org.eclipse.cdt.build.core.buildArtefactType.staticLib"; //$NON-NLS-1$
+ public static final String BUILD_ARTEFACT_TYPE_PROPERTY_SHAREDLIB = "org.eclipse.cdt.build.core.buildArtefactType.sharedLib"; //$NON-NLS-1$
public static final String CFG_DATA_PROVIDER_ID = ManagedBuilderCorePlugin.PLUGIN_ID + ".configurationDataProvider"; //$NON-NLS-1$
- private static final String NEWLINE = System.getProperty("line.separator"); //$NON-NLS-1$
+ private static final String NEWLINE = System.getProperty("line.separator"); //$NON-NLS-1$
- public static final String INTERNAL_BUILDER_ID = "org.eclipse.cdt.build.core.internal.builder"; //$NON-NLS-1$
+ public static final String INTERNAL_BUILDER_ID = "org.eclipse.cdt.build.core.internal.builder"; //$NON-NLS-1$
private static final String os = Platform.getOS();
private static final String arch = Platform.getOSArch();
- private static final String ALL = "all"; //$NON-NLS-1$
+ private static final String ALL = "all"; //$NON-NLS-1$
// This is the version of the manifest and project files
private static final Version buildInfoVersion = new Version(4, 0, 0);
@@ -238,7 +238,6 @@ public class ManagedBuildManager extends AbstractCExtension {
// Targets defined in the manifest files (CDT V2.0 object model)
private static Map<String, ITarget> extensionTargetMap;
-
// "Selected configuraton" elements defined in the manifest files.
// These are configuration elements that map to objects in the internal
// representation of the manifest files. For example, ListOptionValues
@@ -252,8 +251,8 @@ public class ManagedBuildManager extends AbstractCExtension {
// This map has a lifecycle corresponding to the build definitions extension loading.
private static Map<IBuildObject, IManagedConfigElement> configElementMap;
-// private static List sortedToolChains;
-// private static Map builtTypeToToolChainListMap;
+ // private static List sortedToolChains;
+ // private static Map builtTypeToToolChainListMap;
// Listeners interested in build model changes
private static Map<IResource, List<IScannerInfoChangeListener>> buildModelListeners;
// Random number for derived object model elements
@@ -267,19 +266,19 @@ public class ManagedBuildManager extends AbstractCExtension {
private static Map<IProject, IManagedBuildInfo> fInfoMap = new HashMap<IProject, IManagedBuildInfo>();
- private static ISorter fToolChainSorter = new ISorter(){
+ private static ISorter fToolChainSorter = new ISorter() {
@Override
public void sort() {
resortToolChains();
}
};
- private static ISorter fToolSorter = new ISorter(){
+ private static ISorter fToolSorter = new ISorter() {
@Override
public void sort() {
resortTools();
}
};
- private static ISorter fBuilderSorter = new ISorter(){
+ private static ISorter fBuilderSorter = new ISorter() {
@Override
public void sort() {
resortBuilders();
@@ -290,19 +289,19 @@ public class ManagedBuildManager extends AbstractCExtension {
void sort();
}
-
static {
- getEnvironmentVariableProvider().subscribe(
- fEnvironmentBuildPathsChangeListener = new IEnvironmentBuildPathsChangeListener(){
+ getEnvironmentVariableProvider()
+ .subscribe(fEnvironmentBuildPathsChangeListener = new IEnvironmentBuildPathsChangeListener() {
@Override
- public void buildPathsChanged(IConfiguration configuration, int buildPathType){
-// if(buildPathType == IEnvVarBuildPath.BUILDPATH_INCLUDE){
-// initializePathEntries(configuration,null);
-// notifyListeners(configuration,null);
-// }
+ public void buildPathsChanged(IConfiguration configuration, int buildPathType) {
+ // if(buildPathType == IEnvVarBuildPath.BUILDPATH_INCLUDE){
+ // initializePathEntries(configuration,null);
+ // notifyListeners(configuration,null);
+ // }
}
});
}
+
/**
* @return the next random number as a positive integer.
*/
@@ -371,7 +370,7 @@ public class ManagedBuildManager extends AbstractCExtension {
return getExtensionProjectTypeMap().get(id);
}
- public static Version getVersion(){
+ public static Version getVersion() {
return version;
}
@@ -419,7 +418,7 @@ public class ManagedBuildManager extends AbstractCExtension {
}
if (extensionToolChainMap == null) {
- extensionToolChainMap = new TreeMap<String, ToolChain>();
+ extensionToolChainMap = new TreeMap<String, ToolChain>();
}
return extensionToolChainMap;
}
@@ -582,7 +581,7 @@ public class ManagedBuildManager extends AbstractCExtension {
* @since 8.0
*/
public static IConfiguration getExtensionConfiguration(IConfiguration cfg) {
- for(;cfg != null && !cfg.isExtensionElement(); cfg = cfg.getParent()) {
+ for (; cfg != null && !cfg.isExtensionElement(); cfg = cfg.getParent()) {
// empty loop to find base configuration
}
return cfg;
@@ -613,7 +612,8 @@ public class ManagedBuildManager extends AbstractCExtension {
e.printStackTrace();
}
- return getExtensionConfigurationMap().values().toArray(new Configuration[getExtensionConfigurationMap().size()]);
+ return getExtensionConfigurationMap().values()
+ .toArray(new Configuration[getExtensionConfigurationMap().size()]);
}
/**
@@ -673,13 +673,12 @@ public class ManagedBuildManager extends AbstractCExtension {
}
public static IBuilder getExtensionBuilder(IBuilder builder) {
- for(;builder != null && !builder.isExtensionElement(); builder = builder.getSuperClass()) {
+ for (; builder != null && !builder.isExtensionElement(); builder = builder.getSuperClass()) {
// empty loop to find parent builder
}
return builder;
}
-
/**
* @return the option from the manifest with the ID specified in the argument
* or {@code null}.
@@ -798,9 +797,9 @@ public class ManagedBuildManager extends AbstractCExtension {
public static IManagedBuilderMakefileGenerator getBuildfileGenerator(IConfiguration config) {
IToolChain toolChain = config.getToolChain();
- if(toolChain != null){
+ if (toolChain != null) {
IBuilder builder = toolChain.getBuilder();
- if(builder != null)
+ if (builder != null)
return builder.getBuildFileGenerator();
}
// If no generator is defined, return the default GNU generator
@@ -819,17 +818,17 @@ public class ManagedBuildManager extends AbstractCExtension {
return ManagedCommandLineGenerator.getCommandLineGenerator();
}
- /**
- * Targets may have a scanner config discovery profile defined that knows
- * how to discover built-in compiler defines and includes search paths.
- * Find the profile for the target specified.
- *
- * @return scanner configuration discovery profile id
- */
- public static String getScannerInfoProfileId(IConfiguration config) {
- IToolChain toolChain = config.getToolChain();
- return toolChain.getScannerConfigDiscoveryProfileId();
- }
+ /**
+ * Targets may have a scanner config discovery profile defined that knows
+ * how to discover built-in compiler defines and includes search paths.
+ * Find the profile for the target specified.
+ *
+ * @return scanner configuration discovery profile id
+ */
+ public static String getScannerInfoProfileId(IConfiguration config) {
+ IToolChain toolChain = config.getToolChain();
+ return toolChain.getScannerConfigDiscoveryProfileId();
+ }
/**
* Gets the currently selected target. This is used while the project
@@ -889,26 +888,21 @@ public class ManagedBuildManager extends AbstractCExtension {
((IScannerInfoChangeListener)iter.next()).changeNotification(resource, (IScannerInfo)getBuildInfo(resource));
}
}
-*/
- public static void initializePathEntries(IConfiguration config, IOption option){
- try{
- if(config.isTemporary() ||
- (option != null
- && option.getValueType() != IOption.INCLUDE_PATH
+ */
+ public static void initializePathEntries(IConfiguration config, IOption option) {
+ try {
+ if (config.isTemporary() || (option != null && option.getValueType() != IOption.INCLUDE_PATH
&& option.getValueType() != IOption.PREPROCESSOR_SYMBOLS
- && option.getValueType() != IOption.INCLUDE_FILES
- && option.getValueType() != IOption.LIBRARY_PATHS
- && option.getValueType() != IOption.LIBRARY_FILES
- && option.getValueType() != IOption.MACRO_FILES
+ && option.getValueType() != IOption.INCLUDE_FILES && option.getValueType() != IOption.LIBRARY_PATHS
+ && option.getValueType() != IOption.LIBRARY_FILES && option.getValueType() != IOption.MACRO_FILES
&& option.getValueType() != IOption.UNDEF_INCLUDE_PATH
&& option.getValueType() != IOption.UNDEF_PREPROCESSOR_SYMBOLS
&& option.getValueType() != IOption.UNDEF_INCLUDE_FILES
&& option.getValueType() != IOption.UNDEF_LIBRARY_PATHS
&& option.getValueType() != IOption.UNDEF_LIBRARY_FILES
- && option.getValueType() != IOption.UNDEF_MACRO_FILES
- ))
+ && option.getValueType() != IOption.UNDEF_MACRO_FILES))
return;
- } catch (BuildException e){
+ } catch (BuildException e) {
return;
}
@@ -919,33 +913,30 @@ public class ManagedBuildManager extends AbstractCExtension {
}
- public static void initializePathEntries(IResourceConfiguration resConfig, IOption option){
+ public static void initializePathEntries(IResourceConfiguration resConfig, IOption option) {
IConfiguration cfg = resConfig.getParent();
- if(cfg != null)
- initializePathEntries(cfg,option);
+ if (cfg != null)
+ initializePathEntries(cfg, option);
}
private static void notifyListeners(IResourceInfo resConfig, IOption option) {
// Continue if change is something that effect the scanreser
try {
- if (resConfig.getParent().isTemporary() ||
- (option != null && option.getValueType() != IOption.INCLUDE_PATH
- && option.getValueType() != IOption.PREPROCESSOR_SYMBOLS
- && option.getValueType() != IOption.INCLUDE_FILES
- && option.getValueType() != IOption.LIBRARY_PATHS
- && option.getValueType() != IOption.LIBRARY_FILES
- && option.getValueType() != IOption.MACRO_FILES
- && option.getValueType() != IOption.UNDEF_INCLUDE_PATH
- && option.getValueType() != IOption.UNDEF_PREPROCESSOR_SYMBOLS
- && option.getValueType() != IOption.UNDEF_INCLUDE_FILES
- && option.getValueType() != IOption.UNDEF_LIBRARY_PATHS
- && option.getValueType() != IOption.UNDEF_LIBRARY_FILES
- && option.getValueType() != IOption.UNDEF_MACRO_FILES
- && !option.isForScannerDiscovery()
- )) {
+ if (resConfig.getParent().isTemporary() || (option != null && option.getValueType() != IOption.INCLUDE_PATH
+ && option.getValueType() != IOption.PREPROCESSOR_SYMBOLS
+ && option.getValueType() != IOption.INCLUDE_FILES && option.getValueType() != IOption.LIBRARY_PATHS
+ && option.getValueType() != IOption.LIBRARY_FILES && option.getValueType() != IOption.MACRO_FILES
+ && option.getValueType() != IOption.UNDEF_INCLUDE_PATH
+ && option.getValueType() != IOption.UNDEF_PREPROCESSOR_SYMBOLS
+ && option.getValueType() != IOption.UNDEF_INCLUDE_FILES
+ && option.getValueType() != IOption.UNDEF_LIBRARY_PATHS
+ && option.getValueType() != IOption.UNDEF_LIBRARY_FILES
+ && option.getValueType() != IOption.UNDEF_MACRO_FILES && !option.isForScannerDiscovery())) {
return;
}
- } catch (BuildException e) {return;}
+ } catch (BuildException e) {
+ return;
+ }
// Figure out if there is a listener for this change
IResource resource = resConfig.getParent().getOwner();
@@ -955,7 +946,7 @@ public class ManagedBuildManager extends AbstractCExtension {
}
ListIterator<IScannerInfoChangeListener> iter = listeners.listIterator();
while (iter.hasNext()) {
- iter.next().changeNotification(resource, (IScannerInfo)getBuildInfo(resource));
+ iter.next().changeNotification(resource, (IScannerInfo) getBuildInfo(resource));
}
}
@@ -968,7 +959,7 @@ public class ManagedBuildManager extends AbstractCExtension {
public static void setNewProjectVersion(IProject newProject) {
// Get the build info for the argument
ManagedBuildInfo info = findBuildInfo(newProject, true);
- if(info != null)
+ if (info != null)
info.setVersion(buildInfoVersion.toString());
}
@@ -991,19 +982,15 @@ public class ManagedBuildManager extends AbstractCExtension {
try {
// Request a value change and set dirty if real change results
retOpt = config.setOption(holder, option, value);
- if (retOpt.getValueHandler().handleValue(
- config,
- holder,
- retOpt,
- retOpt.getValueHandlerExtraArgument(),
+ if (retOpt.getValueHandler().handleValue(config, holder, retOpt, retOpt.getValueHandlerExtraArgument(),
IManagedOptionValueHandler.EVENT_APPLY)) {
// TODO : Event is handled successfully and returned true.
// May need to do something here say log a message.
} else {
// Event handling Failed.
}
-// initializePathEntries(config,retOpt);
-// notifyListeners(config, retOpt);
+ // initializePathEntries(config,retOpt);
+ // notifyListeners(config, retOpt);
} catch (BuildException e) {
return null;
}
@@ -1029,24 +1016,21 @@ public class ManagedBuildManager extends AbstractCExtension {
try {
// Request a value change and set dirty if real change results
retOpt = resConfig.setOption(holder, option, value);
- if (retOpt != null && retOpt.getValueHandler().handleValue(
- resConfig,
- holder,
- retOpt,
- retOpt.getValueHandlerExtraArgument(),
- IManagedOptionValueHandler.EVENT_APPLY)) {
+ if (retOpt != null && retOpt.getValueHandler().handleValue(resConfig, holder, retOpt,
+ retOpt.getValueHandlerExtraArgument(), IManagedOptionValueHandler.EVENT_APPLY)) {
// TODO : Event is handled successfully and returned true.
// May need to do something here say log a message.
} else {
// Event handling Failed.
}
- // initializePathEntries(resConfig,retOpt);
+ // initializePathEntries(resConfig,retOpt);
notifyListeners(resConfig, retOpt);
} catch (BuildException e) {
return null;
}
return retOpt;
}
+
/**
* Set the string value for an option for a given config.
*
@@ -1065,19 +1049,15 @@ public class ManagedBuildManager extends AbstractCExtension {
IOption retOpt;
try {
retOpt = config.setOption(holder, option, value);
- if (retOpt.getValueHandler().handleValue(
- config,
- holder,
- retOpt,
- retOpt.getValueHandlerExtraArgument(),
+ if (retOpt.getValueHandler().handleValue(config, holder, retOpt, retOpt.getValueHandlerExtraArgument(),
IManagedOptionValueHandler.EVENT_APPLY)) {
// TODO : Event is handled successfully and returned true.
// May need to do something here say log a message.
} else {
// Event handling Failed.
}
-// initializePathEntries(config,retOpt);
-// notifyListeners(config, retOpt);
+ // initializePathEntries(config,retOpt);
+ // notifyListeners(config, retOpt);
} catch (BuildException e) {
return null;
}
@@ -1102,55 +1082,48 @@ public class ManagedBuildManager extends AbstractCExtension {
IOption retOpt;
try {
retOpt = resConfig.setOption(holder, option, value);
- if (retOpt.getValueHandler().handleValue(
- resConfig,
- holder,
- retOpt,
- retOpt.getValueHandlerExtraArgument(),
+ if (retOpt.getValueHandler().handleValue(resConfig, holder, retOpt, retOpt.getValueHandlerExtraArgument(),
IManagedOptionValueHandler.EVENT_APPLY)) {
// TODO : Event is handled successfully and returned true.
// May need to do something here say log a message.
} else {
// Event handling Failed.
}
- // initializePathEntries(resConfig,retOpt);
+ // initializePathEntries(resConfig,retOpt);
notifyListeners(resConfig, retOpt);
} catch (BuildException e) {
return null;
}
return retOpt;
}
-/**
- * Set the string array value for an option for a given config.
- *
- * @param config The configuration the option belongs to.
- * @param holder The holder/parent of the option.
- * @param option The option to set the value for.
- * @param value The values the option should contain after the change.
- *
- * @return The modified option. This can be the same option or a newly created option.
- *
- * @since 3.0 - The type and name of the <code>ITool tool</code> parameter
- * has changed to <code>IHoldsOptions holder</code>. Client code
- * assuming <code>ITool</code> as type, will continue to work unchanged.
- */
+
+ /**
+ * Set the string array value for an option for a given config.
+ *
+ * @param config The configuration the option belongs to.
+ * @param holder The holder/parent of the option.
+ * @param option The option to set the value for.
+ * @param value The values the option should contain after the change.
+ *
+ * @return The modified option. This can be the same option or a newly created option.
+ *
+ * @since 3.0 - The type and name of the <code>ITool tool</code> parameter
+ * has changed to <code>IHoldsOptions holder</code>. Client code
+ * assuming <code>ITool</code> as type, will continue to work unchanged.
+ */
public static IOption setOption(IConfiguration config, IHoldsOptions holder, IOption option, String[] value) {
IOption retOpt;
try {
retOpt = config.setOption(holder, option, value);
- if (retOpt.getValueHandler().handleValue(
- config,
- holder,
- retOpt,
- retOpt.getValueHandlerExtraArgument(),
+ if (retOpt.getValueHandler().handleValue(config, holder, retOpt, retOpt.getValueHandlerExtraArgument(),
IManagedOptionValueHandler.EVENT_APPLY)) {
// TODO : Event is handled successfully and returned true.
// May need to do something here say log a message.
} else {
// Event handling Failed.
}
-// initializePathEntries(config,retOpt);
-// notifyListeners(config, retOpt);
+ // initializePathEntries(config,retOpt);
+ // notifyListeners(config, retOpt);
} catch (BuildException e) {
return null;
}
@@ -1175,18 +1148,14 @@ public class ManagedBuildManager extends AbstractCExtension {
IOption retOpt;
try {
retOpt = resConfig.setOption(holder, option, value);
- if (retOpt.getValueHandler().handleValue(
- resConfig,
- holder,
- retOpt,
- retOpt.getValueHandlerExtraArgument(),
+ if (retOpt.getValueHandler().handleValue(resConfig, holder, retOpt, retOpt.getValueHandlerExtraArgument(),
IManagedOptionValueHandler.EVENT_APPLY)) {
// TODO : Event is handled successfully and returned true.
// May need to do something here say log a message.
} else {
// Event handling Failed.
}
-// initializePathEntries(resConfig,retOpt);
+ // initializePathEntries(resConfig,retOpt);
notifyListeners(resConfig, retOpt);
} catch (BuildException e) {
return null;
@@ -1194,22 +1163,19 @@ public class ManagedBuildManager extends AbstractCExtension {
return retOpt;
}
- public static IOption setOption(IResourceInfo resConfig, IHoldsOptions holder, IOption option, OptionStringValue[] value) {
+ public static IOption setOption(IResourceInfo resConfig, IHoldsOptions holder, IOption option,
+ OptionStringValue[] value) {
IOption retOpt;
try {
retOpt = resConfig.setOption(holder, option, value);
- if (retOpt.getValueHandler().handleValue(
- resConfig,
- holder,
- retOpt,
- retOpt.getValueHandlerExtraArgument(),
+ if (retOpt.getValueHandler().handleValue(resConfig, holder, retOpt, retOpt.getValueHandlerExtraArgument(),
IManagedOptionValueHandler.EVENT_APPLY)) {
// TODO : Event is handled successfully and returned true.
// May need to do something here say log a message.
} else {
// Event handling Failed.
}
-// initializePathEntries(resConfig,retOpt);
+ // initializePathEntries(resConfig,retOpt);
notifyListeners(resConfig, retOpt);
} catch (BuildException e) {
return null;
@@ -1221,7 +1187,7 @@ public class ManagedBuildManager extends AbstractCExtension {
// The tool may be a reference.
if (tool instanceof IToolReference) {
// If so, just set the command in the reference
- ((IToolReference)tool).setToolCommand(command);
+ ((IToolReference) tool).setToolCommand(command);
} else {
config.setToolCommand(tool, command);
}
@@ -1231,7 +1197,7 @@ public class ManagedBuildManager extends AbstractCExtension {
// The tool may be a reference.
if (tool instanceof IToolReference) {
// If so, just set the command in the reference
- ((IToolReference)tool).setToolCommand(command);
+ ((IToolReference) tool).setToolCommand(command);
} else {
resConfig.setToolCommand(tool, command);
}
@@ -1248,14 +1214,13 @@ public class ManagedBuildManager extends AbstractCExtension {
ManagedBuildInfo buildInfo = (ManagedBuildInfo) getBuildInfo(project);
// Save the build info
- if (buildInfo != null &&
- !buildInfo.isReadOnly() &&
- buildInfo.isValid() &&
- (force == true || buildInfo.isDirty())) {
+ if (buildInfo != null && !buildInfo.isReadOnly() && buildInfo.isValid()
+ && (force == true || buildInfo.isDirty())) {
// For post-2.0 projects, there will be a version
String projectVersion = buildInfo.getVersion();
if (projectVersion != null) {
- ProcessingInstruction instruction = doc.createProcessingInstruction(VERSION_ELEMENT_NAME, projectVersion);
+ ProcessingInstruction instruction = doc.createProcessingInstruction(VERSION_ELEMENT_NAME,
+ projectVersion);
doc.appendChild(instruction);
}
Element rootElement = doc.createElement(ROOT_NODE_NAME);
@@ -1265,16 +1230,16 @@ public class ManagedBuildManager extends AbstractCExtension {
// Transform the document to something we can save in a file
ByteArrayOutputStream stream = new ByteArrayOutputStream();
Transformer transformer = TransformerFactory.newInstance().newTransformer();
- transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
+ transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); //$NON-NLS-1$
- transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
+ transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
DOMSource source = new DOMSource(doc);
StreamResult result = new StreamResult(stream);
transformer.transform(source, result);
// Save the document
IFile projectFile = project.getFile(SETTINGS_FILE_NAME);
- String utfString = stream.toString("UTF-8"); //$NON-NLS-1$
+ String utfString = stream.toString("UTF-8"); //$NON-NLS-1$
if (projectFile.exists()) {
if (projectFile.isReadOnly()) {
@@ -1289,11 +1254,11 @@ public class ManagedBuildManager extends AbstractCExtension {
if (window != null) {
shell = window.getShell();
}
- // Inform Eclipse that we are intending to modify this file
+ // Inform Eclipse that we are intending to modify this file
// This will provide the user the opportunity, via UI prompts, to fetch the file from source code control
// reset a read-only file protection to write etc.
// If there is no shell, i.e. shell is null, then there will be no user UI interaction
- IStatus status = projectFile.getWorkspace().validateEdit(new IFile[]{projectFile}, shell);
+ IStatus status = projectFile.getWorkspace().validateEdit(new IFile[] { projectFile }, shell);
// If the file is still read-only, then we should not attempt the write, since it will
// just fail - just throw an exception, to be caught below, and inform the user
// For other non-successful status, we take our chances, attempt the write, and pass
@@ -1301,13 +1266,16 @@ public class ManagedBuildManager extends AbstractCExtension {
if (!status.isOK()) {
if (status.getCode() == IResourceStatus.READ_ONLY_LOCAL) {
stream.close();
- throw new IOException(ManagedMakeMessages.getFormattedString(MANIFEST_ERROR_READ_ONLY, projectFile.getFullPath().toString()));
+ throw new IOException(ManagedMakeMessages.getFormattedString(MANIFEST_ERROR_READ_ONLY,
+ projectFile.getFullPath().toString()));
}
}
}
- projectFile.setContents(new ByteArrayInputStream(utfString.getBytes("UTF-8")), IResource.FORCE, new NullProgressMonitor()); //$NON-NLS-1$
+ projectFile.setContents(new ByteArrayInputStream(utfString.getBytes("UTF-8")), IResource.FORCE, //$NON-NLS-1$
+ new NullProgressMonitor());
} else {
- projectFile.create(new ByteArrayInputStream(utfString.getBytes("UTF-8")), IResource.FORCE, new NullProgressMonitor()); //$NON-NLS-1$
+ projectFile.create(new ByteArrayInputStream(utfString.getBytes("UTF-8")), IResource.FORCE, //$NON-NLS-1$
+ new NullProgressMonitor());
}
// Close the streams
@@ -1326,10 +1294,10 @@ public class ManagedBuildManager extends AbstractCExtension {
} catch (IOException e) {
// The save failed
err = e;
- } catch (CoreException e) {
- // Save to IFile failed
- err = e;
- }
+ } catch (CoreException e) {
+ // Save to IFile failed
+ err = e;
+ }
if (err != null) {
// Put out an error message indicating that the attempted write to the .cdtbuild project file failed
@@ -1342,15 +1310,14 @@ public class ManagedBuildManager extends AbstractCExtension {
final Shell shell = window.getShell();
if (shell != null) {
final String exceptionMsg = err.getMessage();
- shell.getDisplay().syncExec( new Runnable() {
+ shell.getDisplay().syncExec(new Runnable() {
@Override
public void run() {
MessageDialog.openError(shell,
- ManagedMakeMessages.getResourceString("ManagedBuildManager.error.write_failed_title"), //$NON-NLS-1$
- ManagedMakeMessages.getFormattedString(MANIFEST_ERROR_WRITE_FAILED,
- exceptionMsg));
+ ManagedMakeMessages.getResourceString("ManagedBuildManager.error.write_failed_title"), //$NON-NLS-1$
+ ManagedMakeMessages.getFormattedString(MANIFEST_ERROR_WRITE_FAILED, exceptionMsg));
}
- } );
+ });
}
}
// If we return an honest status when the operation fails, there are instances when the UI behavior
@@ -1369,9 +1336,9 @@ public class ManagedBuildManager extends AbstractCExtension {
return updateBuildInfo(project, force);
} catch (CoreException e) {
Throwable cause = e.getStatus().getException();
- if(cause instanceof IllegalArgumentException){
+ if (cause instanceof IllegalArgumentException) {
//can not acquire the root rule
- Job j = new Job("save build info job"){ //$NON-NLS-1$
+ Job j = new Job("save build info job") { //$NON-NLS-1$
@Override
protected IStatus run(IProgressMonitor monitor) {
@@ -1400,17 +1367,17 @@ public class ManagedBuildManager extends AbstractCExtension {
*/
private static boolean updateBuildInfo(IProject project, boolean force) throws CoreException {
IManagedBuildInfo info = getBuildInfo(project, false);
- if(info == null)
+ if (info == null)
return true;
ICProjectDescription projDes = CoreModel.getDefault().getProjectDescription(project);
projDes = BuildSettingsUtil.synchBuildInfo(info, projDes, force);
-// try {
- BuildSettingsUtil.checkApplyDescription(project, projDes);
-// } catch (CoreException e) {
-// return false;
-// }
+ // try {
+ BuildSettingsUtil.checkApplyDescription(project, projDes);
+ // } catch (CoreException e) {
+ // return false;
+ // }
return true;
/*
// Create document
@@ -1464,7 +1431,7 @@ public class ManagedBuildManager extends AbstractCExtension {
if (window != null) {
shell = window.getShell();
}
- // Inform Eclipse that we are intending to modify this file
+ // Inform Eclipse that we are intending to modify this file
// This will provide the user the opportunity, via UI prompts, to fetch the file from source code control
// reset a read-only file protection to write etc.
// If there is no shell, i.e. shell is null, then there will be no user UI interaction
@@ -1501,10 +1468,10 @@ public class ManagedBuildManager extends AbstractCExtension {
} catch (IOException e) {
// The save failed
err = e;
- } catch (CoreException e) {
- // Save to IFile failed
+ } catch (CoreException e) {
+ // Save to IFile failed
err = e;
- }
+ }
if (err != null) {
// Put out an error message indicating that the attempted write to the .cdtbuild project file failed
@@ -1543,38 +1510,40 @@ public class ManagedBuildManager extends AbstractCExtension {
updateBuildInfo(project, true);
}
- public static void updateCoreSettings(IConfiguration cfg) throws CoreException{
+ public static void updateCoreSettings(IConfiguration cfg) throws CoreException {
IProject project = cfg.getOwner().getProject();
ICProjectDescription projDes = CoreModel.getDefault().getProjectDescription(project);
- if(projDes != null){
- if(BuildSettingsUtil.applyConfiguration(cfg, projDes, true)){
+ if (projDes != null) {
+ if (BuildSettingsUtil.applyConfiguration(cfg, projDes, true)) {
BuildSettingsUtil.checkApplyDescription(project, projDes);
}
}
}
- public static void updateCoreSettings(IProject project, IConfiguration[] cfgs) throws CoreException{
+
+ public static void updateCoreSettings(IProject project, IConfiguration[] cfgs) throws CoreException {
updateCoreSettings(project, cfgs, false);
}
- public static void updateCoreSettings(IProject project, IConfiguration[] cfgs, boolean avoidSerialization) throws CoreException{
- if(cfgs == null){
+ public static void updateCoreSettings(IProject project, IConfiguration[] cfgs, boolean avoidSerialization)
+ throws CoreException {
+ if (cfgs == null) {
IManagedBuildInfo info = getBuildInfo(project);
- if(info != null && info.isValid() && info.getManagedProject() != null)
+ if (info != null && info.isValid() && info.getManagedProject() != null)
cfgs = info.getManagedProject().getConfigurations();
}
- if(cfgs == null || cfgs.length == 0)
+ if (cfgs == null || cfgs.length == 0)
return;
ICProjectDescription projDes = CoreModel.getDefault().getProjectDescription(project);
boolean updated = false;
- if(projDes != null){
+ if (projDes != null) {
for (IConfiguration cfg : cfgs) {
- if(BuildSettingsUtil.applyConfiguration(cfg, projDes, true)){
+ if (BuildSettingsUtil.applyConfiguration(cfg, projDes, true)) {
updated = true;
}
}
- if(updated){
+ if (updated) {
BuildSettingsUtil.checkApplyDescription(project, projDes, avoidSerialization);
}
}
@@ -1607,16 +1576,14 @@ public class ManagedBuildManager extends AbstractCExtension {
public static void resetConfiguration(IProject project, IConfiguration configuration) {
// reset the configuration
if (configuration instanceof MultiConfiguration) {
- IConfiguration[] cfs = (IConfiguration[])((MultiConfiguration)configuration).getItems();
+ IConfiguration[] cfs = (IConfiguration[]) ((MultiConfiguration) configuration).getItems();
for (IConfiguration c : cfs) {
- ((Configuration)c).reset();
- performValueHandlerEvent(c,
- IManagedOptionValueHandler.EVENT_SETDEFAULT, false);
+ ((Configuration) c).reset();
+ performValueHandlerEvent(c, IManagedOptionValueHandler.EVENT_SETDEFAULT, false);
}
} else {
- ((Configuration)configuration).reset();
- performValueHandlerEvent(configuration,
- IManagedOptionValueHandler.EVENT_SETDEFAULT, false);
+ ((Configuration) configuration).reset();
+ performValueHandlerEvent(configuration, IManagedOptionValueHandler.EVENT_SETDEFAULT, false);
}
}
@@ -1624,41 +1591,41 @@ public class ManagedBuildManager extends AbstractCExtension {
// reset the configuration
((ResourceConfiguration) resConfig).reset();
- performValueHandlerEvent(resConfig,
- IManagedOptionValueHandler.EVENT_SETDEFAULT);
+ performValueHandlerEvent(resConfig, IManagedOptionValueHandler.EVENT_SETDEFAULT);
}
- public static void resetOptionSettings(IResourceInfo rcInfo){
- if(rcInfo instanceof IFileInfo){
+ public static void resetOptionSettings(IResourceInfo rcInfo) {
+ if (rcInfo instanceof IFileInfo) {
IConfiguration c = rcInfo.getParent();
Configuration cfg = null;
IProject project = null;
if (c instanceof Configuration)
- cfg = (Configuration)c;
+ cfg = (Configuration) c;
else if (c instanceof MultiConfiguration) {
- MultiConfiguration mc = (MultiConfiguration)c;
- IConfiguration[] cfs = (IConfiguration[])mc.getItems();
- cfg = (Configuration)cfs[0];
+ MultiConfiguration mc = (MultiConfiguration) c;
+ IConfiguration[] cfs = (IConfiguration[]) mc.getItems();
+ cfg = (Configuration) cfs[0];
}
- if(!(cfg==null || cfg.isExtensionElement() || cfg.isPreference()))
+ if (!(cfg == null || cfg.isExtensionElement() || cfg.isPreference()))
project = cfg.getOwner().getProject();
if (rcInfo instanceof MultiResourceInfo) {
- for (IResourceInfo ri : (IResourceInfo[])((MultiResourceInfo)rcInfo).getItems())
- resetResourceConfiguration(project, (IFileInfo)ri);
+ for (IResourceInfo ri : (IResourceInfo[]) ((MultiResourceInfo) rcInfo).getItems())
+ resetResourceConfiguration(project, (IFileInfo) ri);
} else
- resetResourceConfiguration(project, (IFileInfo)rcInfo);
+ resetResourceConfiguration(project, (IFileInfo) rcInfo);
} else {
if (rcInfo instanceof MultiFolderInfo) {
- for (IFolderInfo fi : (IFolderInfo[])((MultiFolderInfo)rcInfo).getItems())
- ((FolderInfo)fi).resetOptionSettings();
+ for (IFolderInfo fi : (IFolderInfo[]) ((MultiFolderInfo) rcInfo).getItems())
+ ((FolderInfo) fi).resetOptionSettings();
} else {
- FolderInfo fo = (FolderInfo)rcInfo;
+ FolderInfo fo = (FolderInfo) rcInfo;
fo.resetOptionSettings();
}
}
}
+
/**
* Adds a ProjectType that is is specified in the manifest to the
* build system. It is available to any element that
@@ -1673,8 +1640,7 @@ public class ManagedBuildManager extends AbstractCExtension {
IProjectType previous = getExtensionProjectTypeMap().put(projectType.getId(), projectType);
if (previous != null) {
// Report error
- ManagedBuildManager.outputDuplicateIdError(
- "ProjectType", //$NON-NLS-1$
+ ManagedBuildManager.outputDuplicateIdError("ProjectType", //$NON-NLS-1$
projectType.getId());
}
}
@@ -1688,8 +1654,7 @@ public class ManagedBuildManager extends AbstractCExtension {
IConfiguration previous = getExtensionConfigurationMap().put(configuration.getId(), configuration);
if (previous != null) {
// Report error
- ManagedBuildManager.outputDuplicateIdError(
- "Configuration", //$NON-NLS-1$
+ ManagedBuildManager.outputDuplicateIdError("Configuration", //$NON-NLS-1$
configuration.getId());
}
}
@@ -1700,11 +1665,11 @@ public class ManagedBuildManager extends AbstractCExtension {
* has a reference to it as part of its description.
*/
public static void addExtensionResourceConfiguration(ResourceConfiguration resourceConfiguration) {
- IResourceConfiguration previous = getExtensionResourceConfigurationMap().put(resourceConfiguration.getId(), resourceConfiguration);
+ IResourceConfiguration previous = getExtensionResourceConfigurationMap().put(resourceConfiguration.getId(),
+ resourceConfiguration);
if (previous != null) {
// Report error
- ManagedBuildManager.outputDuplicateIdError(
- "ResourceConfiguration", //$NON-NLS-1$
+ ManagedBuildManager.outputDuplicateIdError("ResourceConfiguration", //$NON-NLS-1$
resourceConfiguration.getId());
}
}
@@ -1718,8 +1683,7 @@ public class ManagedBuildManager extends AbstractCExtension {
IToolChain previous = getExtensionToolChainMapInternal().put(toolChain.getId(), toolChain);
if (previous != null) {
// Report error
- ManagedBuildManager.outputDuplicateIdError(
- "ToolChain", //$NON-NLS-1$
+ ManagedBuildManager.outputDuplicateIdError("ToolChain", //$NON-NLS-1$
toolChain.getId());
}
}
@@ -1735,8 +1699,7 @@ public class ManagedBuildManager extends AbstractCExtension {
ITool previous = getExtensionToolMapInternal().put(tool.getId(), tool);
if (previous != null) {
// Report error
- ManagedBuildManager.outputDuplicateIdError(
- "Tool", //$NON-NLS-1$
+ ManagedBuildManager.outputDuplicateIdError("Tool", //$NON-NLS-1$
tool.getId());
}
}
@@ -1750,8 +1713,7 @@ public class ManagedBuildManager extends AbstractCExtension {
ITargetPlatform previous = getExtensionTargetPlatformMap().put(targetPlatform.getId(), targetPlatform);
if (previous != null) {
// Report error
- ManagedBuildManager.outputDuplicateIdError(
- "TargetPlatform", //$NON-NLS-1$
+ ManagedBuildManager.outputDuplicateIdError("TargetPlatform", //$NON-NLS-1$
targetPlatform.getId());
}
}
@@ -1765,8 +1727,7 @@ public class ManagedBuildManager extends AbstractCExtension {
IBuilder previous = getExtensionBuilderMapInternal().put(builder.getId(), builder);
if (previous != null) {
// Report error
- ManagedBuildManager.outputDuplicateIdError(
- "Builder", //$NON-NLS-1$
+ ManagedBuildManager.outputDuplicateIdError("Builder", //$NON-NLS-1$
builder.getId());
}
}
@@ -1780,8 +1741,7 @@ public class ManagedBuildManager extends AbstractCExtension {
IOption previous = getExtensionOptionMap().put(option.getId(), option);
if (previous != null) {
// Report error
- ManagedBuildManager.outputDuplicateIdError(
- "Option", //$NON-NLS-1$
+ ManagedBuildManager.outputDuplicateIdError("Option", //$NON-NLS-1$
option.getId());
}
}
@@ -1795,8 +1755,7 @@ public class ManagedBuildManager extends AbstractCExtension {
IOptionCategory previous = getExtensionOptionCategoryMap().put(optionCategory.getId(), optionCategory);
if (previous != null) {
// Report error
- ManagedBuildManager.outputDuplicateIdError(
- "OptionCategory", //$NON-NLS-1$
+ ManagedBuildManager.outputDuplicateIdError("OptionCategory", //$NON-NLS-1$
optionCategory.getId());
}
}
@@ -1810,8 +1769,7 @@ public class ManagedBuildManager extends AbstractCExtension {
IInputType previous = getExtensionInputTypeMap().put(inputType.getId(), inputType);
if (previous != null) {
// Report error
- ManagedBuildManager.outputDuplicateIdError(
- "InputType", //$NON-NLS-1$
+ ManagedBuildManager.outputDuplicateIdError("InputType", //$NON-NLS-1$
inputType.getId());
}
}
@@ -1825,8 +1783,7 @@ public class ManagedBuildManager extends AbstractCExtension {
IOutputType previous = getExtensionOutputTypeMap().put(outputType.getId(), outputType);
if (previous != null) {
// Report error
- ManagedBuildManager.outputDuplicateIdError(
- "OutputType", //$NON-NLS-1$
+ ManagedBuildManager.outputDuplicateIdError("OutputType", //$NON-NLS-1$
outputType.getId());
}
}
@@ -1846,9 +1803,7 @@ public class ManagedBuildManager extends AbstractCExtension {
* @param parent - parent project type
* @return new <code>ITarget</code> with settings based on the parent passed in the arguments
*/
- public static IManagedProject createManagedProject(IResource resource, IProjectType parent)
- throws BuildException
- {
+ public static IManagedProject createManagedProject(IResource resource, IProjectType parent) throws BuildException {
return new ManagedProject(resource, parent);
}
@@ -1857,9 +1812,7 @@ public class ManagedBuildManager extends AbstractCExtension {
*
* @return new <code>ITarget</code> with settings based on the parent passed in the arguments
*/
- public static ITarget createTarget(IResource resource, ITarget parentTarget)
- throws BuildException
- {
+ public static ITarget createTarget(IResource resource, ITarget parentTarget) throws BuildException {
IResource owner = parentTarget.getOwner();
if (owner != null && owner.equals(resource))
@@ -1869,13 +1822,15 @@ public class ManagedBuildManager extends AbstractCExtension {
if (resource instanceof IProject) {
// Must be an extension target
if (owner != null)
- throw new BuildException(ManagedMakeMessages.getResourceString("ManagedBuildManager.error.owner_not_null")); //$NON-NLS-1$
+ throw new BuildException(
+ ManagedMakeMessages.getResourceString("ManagedBuildManager.error.owner_not_null")); //$NON-NLS-1$
} else {
// Owner must be owned by the project containing this resource
if (owner == null)
throw new BuildException(ManagedMakeMessages.getResourceString("ManagedBuildManager.error.null_owner")); //$NON-NLS-1$
if (!owner.equals(resource.getProject()))
- throw new BuildException(ManagedMakeMessages.getResourceString("ManagedBuildManager.error.owner_not_project")); //$NON-NLS-1$
+ throw new BuildException(
+ ManagedMakeMessages.getResourceString("ManagedBuildManager.error.owner_not_project")); //$NON-NLS-1$
}
// Passed validation so create the target.
@@ -1906,41 +1861,41 @@ public class ManagedBuildManager extends AbstractCExtension {
*/
}
-// /**
-// * Private helper method to initialize the path entry container once and
-// * only once when the build info is first loaded or created.
-// *
-// * @param info
-// * @throws CoreException
-// */
-// private static void initBuildInfoContainer(ManagedBuildInfo info) throws CoreException {
-// if (info == null) {
-// throw new CoreException(new Status(IStatus.ERROR,
-// ManagedBuilderCorePlugin.PLUGIN_ID,
-// IStatus.ERROR,
-// "", //$NON-NLS-1$
-// null));
-// }
-//
-// if (info.isContainerInited()) return;
-// // Now associate the path entry container with the project
-// ICProject cProject = info.getCProject();
-//
-// synchronized (cProject) {
-//
-// // This does not block the workspace or trigger delta events
-// IPathEntry[] entries = cProject.getRawPathEntries();
-// // Make sure the container for this project is in the path entries
-// List newEntries = new ArrayList(Arrays.asList(entries));
-// if (!newEntries.contains(ManagedBuildInfo.containerEntry)) {
-// // In this case we should trigger an init and deltas
-// newEntries.add(ManagedBuildInfo.containerEntry);
-// cProject.setRawPathEntries((IPathEntry[])newEntries.toArray(new IPathEntry[newEntries.size()]), new NullProgressMonitor());
-// }
-// info.setContainerInited(true);
-//
-// } // end synchronized
-// }
+ // /**
+ // * Private helper method to initialize the path entry container once and
+ // * only once when the build info is first loaded or created.
+ // *
+ // * @param info
+ // * @throws CoreException
+ // */
+ // private static void initBuildInfoContainer(ManagedBuildInfo info) throws CoreException {
+ // if (info == null) {
+ // throw new CoreException(new Status(IStatus.ERROR,
+ // ManagedBuilderCorePlugin.PLUGIN_ID,
+ // IStatus.ERROR,
+ // "", //$NON-NLS-1$
+ // null));
+ // }
+ //
+ // if (info.isContainerInited()) return;
+ // // Now associate the path entry container with the project
+ // ICProject cProject = info.getCProject();
+ //
+ // synchronized (cProject) {
+ //
+ // // This does not block the workspace or trigger delta events
+ // IPathEntry[] entries = cProject.getRawPathEntries();
+ // // Make sure the container for this project is in the path entries
+ // List newEntries = new ArrayList(Arrays.asList(entries));
+ // if (!newEntries.contains(ManagedBuildInfo.containerEntry)) {
+ // // In this case we should trigger an init and deltas
+ // newEntries.add(ManagedBuildInfo.containerEntry);
+ // cProject.setRawPathEntries((IPathEntry[])newEntries.toArray(new IPathEntry[newEntries.size()]), new NullProgressMonitor());
+ // }
+ // info.setContainerInited(true);
+ //
+ // } // end synchronized
+ // }
private static boolean isVersionCompatible(IExtension extension) {
// We can ignore the qualifier
@@ -1961,7 +1916,7 @@ public class ManagedBuildManager extends AbstractCExtension {
// This is a 1.2 manifest and we are compatible for now
return true;
}
- return(buildInfoVersion.compareTo(version)>=0);
+ return (buildInfoVersion.compareTo(version) >= 0);
}
/**
@@ -1970,9 +1925,11 @@ public class ManagedBuildManager extends AbstractCExtension {
*/
private static boolean canLoadBuildInfo(final IProject project) {
IFile file = project.getFile(SETTINGS_FILE_NAME);
- if (file == null) return false;
+ if (file == null)
+ return false;
File cdtbuild = file.getLocation().toFile();
- if (cdtbuild == null) return false;
+ if (cdtbuild == null)
+ return false;
return cdtbuild.exists();
}
@@ -2007,7 +1964,7 @@ public class ManagedBuildManager extends AbstractCExtension {
fileVersion = rootElement.getNodeValue();
Version version = new Version(fileVersion);
//if buildInfoVersion is greater than fileVersion
- if (buildInfoVersion.compareTo(version)>0) {
+ if (buildInfoVersion.compareTo(version) > 0) {
// This is >= 2.0 project, but earlier than the current MBS version - it may need to be updated
} else {
// This is a
@@ -2015,23 +1972,24 @@ public class ManagedBuildManager extends AbstractCExtension {
// o The major versions are not equal
// o The major versions are equal, but the remainder of the .cdtbuild version # is
// greater than the MBS version #
- boolean compatible=false;
+ boolean compatible = false;
if (version == null)
- compatible=false;
+ compatible = false;
if (buildInfoVersion.getMajor() != version.getMajor())
- compatible=false;
+ compatible = false;
if (buildInfoVersion.getMinor() > version.getMinor())
- compatible=true;
+ compatible = true;
if (buildInfoVersion.getMinor() < version.getMinor())
- compatible=false;
+ compatible = false;
if (buildInfoVersion.getMicro() > version.getMicro())
- compatible=true;
+ compatible = true;
if (buildInfoVersion.getMicro() < version.getMicro())
- compatible=false;
+ compatible = false;
if (buildInfoVersion.getQualifier().compareTo(version.getQualifier()) >= 0)
- compatible=true;
+ compatible = true;
if (!compatible) {
- throw new BuildException(ManagedMakeMessages.getFormattedString(PROJECT_VERSION_ERROR, project.getName()));
+ throw new BuildException(
+ ManagedMakeMessages.getFormattedString(PROJECT_VERSION_ERROR, project.getName()));
}
}
}
@@ -2042,20 +2000,21 @@ public class ManagedBuildManager extends AbstractCExtension {
Node node = nodes.item(0);
// Create the internal representation of the project's MBS information
- buildInfo = new ManagedBuildInfo(project, XmlStorageUtil.createCStorageTree((Element)node), true, fileVersion);
+ buildInfo = new ManagedBuildInfo(project, XmlStorageUtil.createCStorageTree((Element) node), true,
+ fileVersion);
if (fileVersion != null) {
- // buildInfo.setVersion(fileVersion);
+ // buildInfo.setVersion(fileVersion);
Version version = new Version(fileVersion);
- Version version21 = new Version("2.1"); //$NON-NLS-1$
+ Version version21 = new Version("2.1"); //$NON-NLS-1$
// CDT 2.1 is the first version using the new MBS model
- if (version.compareTo(version21)>=0) {
+ if (version.compareTo(version21) >= 0) {
// Check to see if all elements could be loaded correctly - for example,
// if references in the project file could not be resolved to extension
// elements
- if (buildInfo.getManagedProject() == null ||
- (!buildInfo.getManagedProject().isValid())) {
+ if (buildInfo.getManagedProject() == null || (!buildInfo.getManagedProject().isValid())) {
// The load failed
- throw new Exception(ManagedMakeMessages.getFormattedString("ManagedBuildManager.error.id.nomatch", project.getName())); //$NON-NLS-1$
+ throw new Exception(ManagedMakeMessages
+ .getFormattedString("ManagedBuildManager.error.id.nomatch", project.getName())); //$NON-NLS-1$
}
// Each ToolChain/Tool/Builder element maintain two separate
@@ -2063,12 +2022,12 @@ public class ManagedBuildManager extends AbstractCExtension {
// 0ne for previous Mbs versions and one for current Mbs version
// walk through the project hierarchy and call the converters
// written for previous mbs versions
- if ( checkForMigrationSupport(buildInfo, false) != true ) {
+ if (checkForMigrationSupport(buildInfo, false) != true) {
// display an error message that the project is not loadable
- if (buildInfo.getManagedProject() == null ||
- (!buildInfo.getManagedProject().isValid())) {
- // The load failed
- throw new Exception(ManagedMakeMessages.getFormattedString("ManagedBuildManager.error.id.nomatch", project.getName())); //$NON-NLS-1$
+ if (buildInfo.getManagedProject() == null || (!buildInfo.getManagedProject().isValid())) {
+ // The load failed
+ throw new Exception(ManagedMakeMessages
+ .getFormattedString("ManagedBuildManager.error.id.nomatch", project.getName())); //$NON-NLS-1$
}
}
}
@@ -2079,21 +2038,21 @@ public class ManagedBuildManager extends AbstractCExtension {
UpdateManagedProjectManager.updateProject(project, buildInfo);
}
// Check to see if the upgrade (if required) succeeded
- if (buildInfo.getManagedProject() == null ||
- (!buildInfo.getManagedProject().isValid())) {
+ if (buildInfo.getManagedProject() == null || (!buildInfo.getManagedProject().isValid())) {
// The load failed
- throw new Exception(ManagedMakeMessages.getFormattedString("ManagedBuildManager.error.id.nomatch", project.getName())); //$NON-NLS-1$
+ throw new Exception(ManagedMakeMessages.getFormattedString("ManagedBuildManager.error.id.nomatch", //$NON-NLS-1$
+ project.getName()));
}
// Walk through the project hierarchy and call the converters
// written for current mbs version
- if ( checkForMigrationSupport(buildInfo, true) != true ) {
+ if (checkForMigrationSupport(buildInfo, true) != true) {
// display an error message.that the project is no loadable
- if (buildInfo.getManagedProject() == null ||
- (!buildInfo.getManagedProject().isValid())) {
- // The load failed
- throw new Exception(ManagedMakeMessages.getFormattedString("ManagedBuildManager.error.id.nomatch", project.getName())); //$NON-NLS-1$
- }
+ if (buildInfo.getManagedProject() == null || (!buildInfo.getManagedProject().isValid())) {
+ // The load failed
+ throw new Exception(ManagedMakeMessages
+ .getFormattedString("ManagedBuildManager.error.id.nomatch", project.getName())); //$NON-NLS-1$
+ }
}
IConfiguration[] configs = buildInfo.getManagedProject().getConfigurations();
@@ -2132,239 +2091,151 @@ public class ManagedBuildManager extends AbstractCExtension {
private synchronized static void loadExtensionsSynchronized() throws BuildException {
// Do this once
if (projectTypesLoaded)
- return;
+ return;
// This routine gets called recursively. If so, just return
if (projectTypesLoading)
return;
projectTypesLoading = true;
-
// scalability issue: configElementMap does not need to live past when loading is done, so we will
// deallocate it upon exit with a try...finally
try {
- //The list of the IManagedBuildDefinitionsStartup callbacks
- List<IManagedBuildDefinitionsStartup> buildDefStartupList = null;
- // Get the extensions that use the current CDT managed build model
- IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT_ID);
- if( extensionPoint != null) {
- IExtension[] extensions = extensionPoint.getExtensions();
- if (extensions != null) {
-
- // First call the constructors of the internal classes that correspond to the
- // build model elements
- for (IExtension extension : extensions) {
- // Can we read this manifest
- if (!isVersionCompatible(extension)) {
- // The version of the Plug-in is greater than what the manager thinks it understands
- // Display error message
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if(window == null){
- IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows();
- window = windows[0];
- }
+ //The list of the IManagedBuildDefinitionsStartup callbacks
+ List<IManagedBuildDefinitionsStartup> buildDefStartupList = null;
+ // Get the extensions that use the current CDT managed build model
+ IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT_ID);
+ if (extensionPoint != null) {
+ IExtension[] extensions = extensionPoint.getExtensions();
+ if (extensions != null) {
- 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$
- errMsg);
+ // First call the constructors of the internal classes that correspond to the
+ // build model elements
+ for (IExtension extension : extensions) {
+ // Can we read this manifest
+ if (!isVersionCompatible(extension)) {
+ // The version of the Plug-in is greater than what the manager thinks it understands
+ // Display error message
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if (window == null) {
+ IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows();
+ window = windows[0];
}
- } );
- } else {
- // Get the "configuraton elements" defined in the plugin.xml file.
- // Note that these "configuration elements" are not related to the
- // managed build system "configurations".
- // From the PDE Guide:
- // A configuration element, with its attributes and children, directly
- // reflects the content and structure of the extension section within the
- // declaring plug-in's manifest (plugin.xml) file.
- IConfigurationElement[] elements = extension.getConfigurationElements();
- String revision = null;
-
- // Get the managedBuildRevsion of the extension.
- for (IConfigurationElement element : elements) {
- if( element.getName().equals(REVISION_ELEMENT_NAME) ) {
- revision = element.getAttribute(VERSION_ELEMENT_NAME);
- break;
+
+ 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$
+ errMsg);
+ }
+ });
+ } else {
+ // Get the "configuraton elements" defined in the plugin.xml file.
+ // Note that these "configuration elements" are not related to the
+ // managed build system "configurations".
+ // From the PDE Guide:
+ // A configuration element, with its attributes and children, directly
+ // reflects the content and structure of the extension section within the
+ // declaring plug-in's manifest (plugin.xml) file.
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ String revision = null;
+
+ // Get the managedBuildRevsion of the extension.
+ for (IConfigurationElement element : elements) {
+ if (element.getName().equals(REVISION_ELEMENT_NAME)) {
+ revision = element.getAttribute(VERSION_ELEMENT_NAME);
+ break;
+ }
}
- }
- // Get the value of 'ManagedBuildRevision' attribute
- loadConfigElements(DefaultManagedConfigElement.convertArray(elements, extension), revision);
+ // Get the value of 'ManagedBuildRevision' attribute
+ loadConfigElements(DefaultManagedConfigElement.convertArray(elements, extension), revision);
+ }
}
- }
- // Call the start up config extensions. These may rely on the standard elements
- // having already been loaded so we wait to call them from here.
- if (startUpConfigElements != null) {
- buildDefStartupList = new ArrayList<IManagedBuildDefinitionsStartup>(startUpConfigElements.size());
+ // Call the start up config extensions. These may rely on the standard elements
+ // having already been loaded so we wait to call them from here.
+ if (startUpConfigElements != null) {
+ buildDefStartupList = new ArrayList<IManagedBuildDefinitionsStartup>(
+ startUpConfigElements.size());
- for (IManagedConfigElement startUpConfigElement : startUpConfigElements) {
- IManagedBuildDefinitionsStartup customConfigLoader;
- try {
- customConfigLoader = createStartUpConfigLoader((DefaultManagedConfigElement)startUpConfigElement);
+ for (IManagedConfigElement startUpConfigElement : startUpConfigElements) {
+ IManagedBuildDefinitionsStartup customConfigLoader;
+ try {
+ customConfigLoader = createStartUpConfigLoader(
+ (DefaultManagedConfigElement) startUpConfigElement);
- //need to save the startup for the future notifications
- buildDefStartupList.add(customConfigLoader);
+ //need to save the startup for the future notifications
+ buildDefStartupList.add(customConfigLoader);
- // Now we can perform any actions on the build configurations
- // in an extended plugin before the build configurations have been resolved
- customConfigLoader.buildDefsLoaded();
- } catch (CoreException e) {
+ // Now we can perform any actions on the build configurations
+ // in an extended plugin before the build configurations have been resolved
+ customConfigLoader.buildDefsLoaded();
+ } catch (CoreException e) {
+ }
}
}
- }
-
- // Then call resolve.
- //
- // Here are notes on "references" within the managed build system.
- // References are "pointers" from one model element to another.
- // These are encoded in manifest and managed build system project files (.cdtbuild)
- // using unique string IDs (e.g. "cdt.managedbuild.tool.gnu.c.linker").
- // These string IDs are "resolved" to pointers to interfaces in model
- // elements in the in-memory represent of the managed build system information.
- //
- // Here are the current "rules" for references:
- // 1. A reference is always resolved to an interface pointer in the
- // referenced object.
- // 2. A reference is always TO an extension object - that is, an object
- // loaded from a manifest file or a dynamic element provider. It cannot
- // be to an object loaded from a managed build system project file (.cdtbuild).
- //
-
- Collection<IProjectType> prjTypes = getExtensionProjectTypeMap().values();
- for (IProjectType projectType : prjTypes) {
- try {
- ((ProjectType) projectType).resolveReferences();
- } catch (Exception ex) {
- // TODO: log
- ex.printStackTrace();
- }
- }
- Collection<IConfiguration> configurations = getExtensionConfigurationMap().values();
- for (IConfiguration configuration : configurations) {
- try {
- ((Configuration) configuration).resolveReferences();
- } catch (Exception ex) {
- // TODO: log
- ex.printStackTrace();
- }
- }
- Collection<IResourceConfiguration> resConfigs = getExtensionResourceConfigurationMap().values();
- for (IResourceConfiguration resConfig : resConfigs) {
- try {
- ((ResourceConfiguration) resConfig).resolveReferences();
- } catch (Exception ex) {
- // TODO: log
- ex.printStackTrace();
- }
- }
- Collection<ToolChain> toolChains = getExtensionToolChainMapInternal().values();
- for (ToolChain toolChain : toolChains) {
- try {
- toolChain.resolveReferences();
- } catch (Exception ex) {
- // TODO: log
- ex.printStackTrace();
- }
- }
- Collection<Tool> tools = getExtensionToolMapInternal().values();
- for (Tool tool : tools) {
- try {
- tool.resolveReferences();
- } catch (Exception ex) {
- // TODO: log
- ex.printStackTrace();
- }
- }
- Collection<ITargetPlatform> targetPlatforms = getExtensionTargetPlatformMap().values();
- for (ITargetPlatform targetPlatform : targetPlatforms) {
- try {
- ((TargetPlatform) targetPlatform).resolveReferences();
- } catch (Exception ex) {
- // TODO: log
- ex.printStackTrace();
- }
- }
- Collection<Builder> builders = getExtensionBuilderMapInternal().values();
- for (Builder builder : builders) {
- try {
- builder.resolveReferences();
- } catch (Exception ex) {
- // TODO: log
- ex.printStackTrace();
- }
- }
- Collection<IOption> options = getExtensionOptionMap().values();
- for (IOption option : options) {
- try {
- ((Option) option).resolveReferences();
- } catch (Exception ex) {
- // TODO: log
- ex.printStackTrace();
- }
- }
- Collection<IOptionCategory> optionCategories = getExtensionOptionCategoryMap().values();
- for (IOptionCategory optionCat : optionCategories) {
- try {
- ((OptionCategory) optionCat).resolveReferences();
- } catch (Exception ex) {
- // TODO: log
- ex.printStackTrace();
- }
- }
- }
- }
- // Get the extensions that use the CDT 2.0 build model
- extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT_ID_V2);
- if( extensionPoint != null) {
- IExtension[] extensions = extensionPoint.getExtensions();
- String revision = null;
-
- if (extensions != null) {
- if (extensions.length > 0) {
+ // Then call resolve.
+ //
+ // Here are notes on "references" within the managed build system.
+ // References are "pointers" from one model element to another.
+ // These are encoded in manifest and managed build system project files (.cdtbuild)
+ // using unique string IDs (e.g. "cdt.managedbuild.tool.gnu.c.linker").
+ // These string IDs are "resolved" to pointers to interfaces in model
+ // elements in the in-memory represent of the managed build system information.
+ //
+ // Here are the current "rules" for references:
+ // 1. A reference is always resolved to an interface pointer in the
+ // referenced object.
+ // 2. A reference is always TO an extension object - that is, an object
+ // loaded from a manifest file or a dynamic element provider. It cannot
+ // be to an object loaded from a managed build system project file (.cdtbuild).
+ //
- // Call the constructors of the internal classes that correspond to the
- // V2.0 build model elements. Some of these objects are converted to new model objects.
- // Others can use the same classes.
- for (IExtension extension : extensions) {
- // Can we read this manifest
- if (!isVersionCompatible(extension)) {
- //The version of the Plug-in is greater than what the manager thinks it understands
- throw new BuildException(ManagedMakeMessages.getResourceString(MANIFEST_VERSION_ERROR));
+ Collection<IProjectType> prjTypes = getExtensionProjectTypeMap().values();
+ for (IProjectType projectType : prjTypes) {
+ try {
+ ((ProjectType) projectType).resolveReferences();
+ } catch (Exception ex) {
+ // TODO: log
+ ex.printStackTrace();
}
- IConfigurationElement[] elements = extension.getConfigurationElements();
-
- // Get the managedBuildRevsion of the extension.
- for (IConfigurationElement element : elements) {
- if(element.getName().equals(REVISION_ELEMENT_NAME)) {
- revision = element.getAttribute(VERSION_ELEMENT_NAME);
- break;
- }
+ }
+ Collection<IConfiguration> configurations = getExtensionConfigurationMap().values();
+ for (IConfiguration configuration : configurations) {
+ try {
+ ((Configuration) configuration).resolveReferences();
+ } catch (Exception ex) {
+ // TODO: log
+ ex.printStackTrace();
}
- // If the "fileVersion" attribute is missing, then default revision is "1.2.0"
- if (revision == null)
- revision = "1.2.0"; //$NON-NLS-1$
- loadConfigElementsV2(DefaultManagedConfigElement.convertArray(elements, extension), revision);
}
- // Resolve references
- Collection<ITarget> targets = getExtensionTargetMap().values();
- for (ITarget target : targets) {
+ Collection<IResourceConfiguration> resConfigs = getExtensionResourceConfigurationMap().values();
+ for (IResourceConfiguration resConfig : resConfigs) {
try {
- ((Target) target).resolveReferences();
+ ((ResourceConfiguration) resConfig).resolveReferences();
+ } catch (Exception ex) {
+ // TODO: log
+ ex.printStackTrace();
+ }
+ }
+ Collection<ToolChain> toolChains = getExtensionToolChainMapInternal().values();
+ for (ToolChain toolChain : toolChains) {
+ try {
+ toolChain.resolveReferences();
} catch (Exception ex) {
// TODO: log
ex.printStackTrace();
}
}
- // The V2 model can also add top-level Tools - they need to be "resolved"
Collection<Tool> tools = getExtensionToolMapInternal().values();
for (Tool tool : tools) {
try {
@@ -2374,64 +2245,156 @@ public class ManagedBuildManager extends AbstractCExtension {
ex.printStackTrace();
}
}
- // Convert the targets to the new model
- targets = getExtensionTargetMap().values();
- for (ITarget target : targets) {
+ Collection<ITargetPlatform> targetPlatforms = getExtensionTargetPlatformMap().values();
+ for (ITargetPlatform targetPlatform : targetPlatforms) {
try {
- // Check to see if it has already been converted - if not, do it
- if (target.getCreatedProjectType() == null) {
- target.convertToProjectType(revision);
- }
+ ((TargetPlatform) targetPlatform).resolveReferences();
} catch (Exception ex) {
// TODO: log
ex.printStackTrace();
}
}
- // Resolve references for new ProjectTypes
- Collection<IProjectType> prjTypes = getExtensionProjectTypeMap().values();
- for (IProjectType prjType : prjTypes) {
+ Collection<Builder> builders = getExtensionBuilderMapInternal().values();
+ for (Builder builder : builders) {
+ try {
+ builder.resolveReferences();
+ } catch (Exception ex) {
+ // TODO: log
+ ex.printStackTrace();
+ }
+ }
+ Collection<IOption> options = getExtensionOptionMap().values();
+ for (IOption option : options) {
+ try {
+ ((Option) option).resolveReferences();
+ } catch (Exception ex) {
+ // TODO: log
+ ex.printStackTrace();
+ }
+ }
+ Collection<IOptionCategory> optionCategories = getExtensionOptionCategoryMap().values();
+ for (IOptionCategory optionCat : optionCategories) {
try {
- ((ProjectType) prjType).resolveReferences();
+ ((OptionCategory) optionCat).resolveReferences();
} catch (Exception ex) {
// TODO: log
ex.printStackTrace();
}
}
+ }
+ }
+
+ // Get the extensions that use the CDT 2.0 build model
+ extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT_ID_V2);
+ if (extensionPoint != null) {
+ IExtension[] extensions = extensionPoint.getExtensions();
+ String revision = null;
+
+ if (extensions != null) {
+ if (extensions.length > 0) {
+
+ // Call the constructors of the internal classes that correspond to the
+ // V2.0 build model elements. Some of these objects are converted to new model objects.
+ // Others can use the same classes.
+ for (IExtension extension : extensions) {
+ // Can we read this manifest
+ if (!isVersionCompatible(extension)) {
+ //The version of the Plug-in is greater than what the manager thinks it understands
+ throw new BuildException(ManagedMakeMessages.getResourceString(MANIFEST_VERSION_ERROR));
+ }
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+
+ // Get the managedBuildRevsion of the extension.
+ for (IConfigurationElement element : elements) {
+ if (element.getName().equals(REVISION_ELEMENT_NAME)) {
+ revision = element.getAttribute(VERSION_ELEMENT_NAME);
+ break;
+ }
+ }
+ // If the "fileVersion" attribute is missing, then default revision is "1.2.0"
+ if (revision == null)
+ revision = "1.2.0"; //$NON-NLS-1$
+ loadConfigElementsV2(DefaultManagedConfigElement.convertArray(elements, extension),
+ revision);
+ }
+ // Resolve references
+ Collection<ITarget> targets = getExtensionTargetMap().values();
+ for (ITarget target : targets) {
+ try {
+ ((Target) target).resolveReferences();
+ } catch (Exception ex) {
+ // TODO: log
+ ex.printStackTrace();
+ }
+ }
+ // The V2 model can also add top-level Tools - they need to be "resolved"
+ Collection<Tool> tools = getExtensionToolMapInternal().values();
+ for (Tool tool : tools) {
+ try {
+ tool.resolveReferences();
+ } catch (Exception ex) {
+ // TODO: log
+ ex.printStackTrace();
+ }
+ }
+ // Convert the targets to the new model
+ targets = getExtensionTargetMap().values();
+ for (ITarget target : targets) {
+ try {
+ // Check to see if it has already been converted - if not, do it
+ if (target.getCreatedProjectType() == null) {
+ target.convertToProjectType(revision);
+ }
+ } catch (Exception ex) {
+ // TODO: log
+ ex.printStackTrace();
+ }
+ }
+ // Resolve references for new ProjectTypes
+ Collection<IProjectType> prjTypes = getExtensionProjectTypeMap().values();
+ for (IProjectType prjType : prjTypes) {
+ try {
+ ((ProjectType) prjType).resolveReferences();
+ } catch (Exception ex) {
+ // TODO: log
+ ex.printStackTrace();
+ }
+ }
- // TODO: Clear the target and configurationV2 maps so that the object can be garbage collected
- // We can't do this yet, because the UpdateManagedProjectAction class may need these elements later
- // Can we change UpdateManagedProjectAction to see the converted model elements?
- //targetIter = getExtensionTargetMap().values().iterator();
- //while (targetIter.hasNext()) {
- // try {
- // Target target = (Target)targetIter.next();
- // ManagedBuildManager.removeConfigElement(target);
- // getExtensionTargetMap().remove(target);
- // } catch (Exception ex) {
- // // TODO: log
- // ex.printStackTrace();
- // }
- //}
- //getExtensionConfigurationV2Map().clear();
+ // TODO: Clear the target and configurationV2 maps so that the object can be garbage collected
+ // We can't do this yet, because the UpdateManagedProjectAction class may need these elements later
+ // Can we change UpdateManagedProjectAction to see the converted model elements?
+ //targetIter = getExtensionTargetMap().values().iterator();
+ //while (targetIter.hasNext()) {
+ // try {
+ // Target target = (Target)targetIter.next();
+ // ManagedBuildManager.removeConfigElement(target);
+ // getExtensionTargetMap().remove(target);
+ // } catch (Exception ex) {
+ // // TODO: log
+ // ex.printStackTrace();
+ // }
+ //}
+ //getExtensionConfigurationV2Map().clear();
+ }
}
}
- }
- // configs resolved...
- // Call the start up config extensions again now that configs have been resolved.
- if (buildDefStartupList != null) {
- for (IManagedBuildDefinitionsStartup customConfigLoader : buildDefStartupList) {
- // Now we can perform any actions on the build configurations
- // in an extended plugin now that all build configruations have been resolved
- customConfigLoader.buildDefsResolved();
+ // configs resolved...
+ // Call the start up config extensions again now that configs have been resolved.
+ if (buildDefStartupList != null) {
+ for (IManagedBuildDefinitionsStartup customConfigLoader : buildDefStartupList) {
+ // Now we can perform any actions on the build configurations
+ // in an extended plugin now that all build configruations have been resolved
+ customConfigLoader.buildDefsResolved();
+ }
}
- }
- performAdjustments();
- projectTypesLoading = false;
- projectTypesLoaded = true;
+ performAdjustments();
+ projectTypesLoading = false;
+ projectTypesLoaded = true;
- ToolChainModificationManager.getInstance().start();
+ ToolChainModificationManager.getInstance().start();
} // try
@@ -2440,7 +2403,7 @@ public class ManagedBuildManager extends AbstractCExtension {
}
}
- private static void performAdjustments(){
+ private static void performAdjustments() {
IProjectType types[] = getDefinedProjectTypes();
for (IProjectType type : types) {
IConfiguration cfgs[] = type.getConfigurations();
@@ -2458,11 +2421,11 @@ public class ManagedBuildManager extends AbstractCExtension {
}
- private static void adjustConfig(IConfiguration cfg){
+ private static void adjustConfig(IConfiguration cfg) {
IResourceInfo rcInfos[] = cfg.getResourceInfos();
for (IResourceInfo rcInfo : rcInfos) {
- if(rcInfo instanceof IFolderInfo){
- IFolderInfo info = (IFolderInfo)rcInfo;
+ if (rcInfo instanceof IFolderInfo) {
+ IFolderInfo info = (IFolderInfo) rcInfo;
IToolChain tc = info.getToolChain();
adjustHolder(info, tc);
@@ -2470,8 +2433,8 @@ public class ManagedBuildManager extends AbstractCExtension {
for (ITool tool : tools) {
adjustHolder(info, tool);
}
- } else if (rcInfo instanceof IFileInfo){
- IFileInfo info = (IFileInfo)rcInfo;
+ } else if (rcInfo instanceof IFileInfo) {
+ IFileInfo info = (IFileInfo) rcInfo;
ITool rcTools[] = info.getTools();
for (ITool rcTool : rcTools) {
adjustHolder(info, rcTool);
@@ -2482,25 +2445,23 @@ public class ManagedBuildManager extends AbstractCExtension {
IResourceConfiguration rcCfgs[] = cfg.getResourceConfigurations();
-// for (IResourceConfiguration rcCfg : rcCfgs) {
-// }
+ // for (IResourceConfiguration rcCfg : rcCfgs) {
+ // }
}
- private static void adjustHolder(IResourceInfo rcInfo, IHoldsOptions holder){
+ private static void adjustHolder(IResourceInfo rcInfo, IHoldsOptions holder) {
IOption options[] = holder.getOptions();
for (IOption opt : options) {
- Option option = (Option)opt;
- BooleanExpressionApplicabilityCalculator calc =
- option.getBooleanExpressionCalculator(true);
+ Option option = (Option) opt;
+ BooleanExpressionApplicabilityCalculator calc = option.getBooleanExpressionCalculator(true);
- if(calc != null)
- calc.adjustOption(rcInfo,holder,option, true);
+ if (calc != null)
+ calc.adjustOption(rcInfo, holder, option, true);
}
}
-
private static void loadConfigElements(IManagedConfigElement[] elements, String revision) {
for (IManagedConfigElement element : elements) {
try {
@@ -2508,28 +2469,28 @@ public class ManagedBuildManager extends AbstractCExtension {
if (element.getName().equals(IProjectType.PROJECTTYPE_ELEMENT_NAME)) {
new ProjectType(element, revision);
} else if (element.getName().equals(IConfiguration.CONFIGURATION_ELEMENT_NAME)) {
- new Configuration((ProjectType)null, element, revision);
+ new Configuration((ProjectType) null, element, revision);
} else if (element.getName().equals(IToolChain.TOOL_CHAIN_ELEMENT_NAME)) {
- new ToolChain((IFolderInfo)null, element, revision);
+ new ToolChain((IFolderInfo) null, element, revision);
} else if (element.getName().equals(ITool.TOOL_ELEMENT_NAME)) {
- new Tool((ProjectType)null, element, revision);
+ new Tool((ProjectType) null, element, revision);
} else if (element.getName().equals(ITargetPlatform.TARGET_PLATFORM_ELEMENT_NAME)) {
- new TargetPlatform((ToolChain)null, element, revision);
+ new TargetPlatform((ToolChain) null, element, revision);
} else if (element.getName().equals(IBuilder.BUILDER_ELEMENT_NAME)) {
- new Builder((ToolChain)null, element, revision);
+ new Builder((ToolChain) null, element, revision);
} else if (element.getName().equals(IManagedConfigElementProvider.ELEMENT_NAME)) {
// don't allow nested config providers.
if (element instanceof DefaultManagedConfigElement) {
IManagedConfigElement[] providedConfigs;
IManagedConfigElementProvider provider = createConfigProvider(
- (DefaultManagedConfigElement)element);
+ (DefaultManagedConfigElement) element);
providedConfigs = provider.getConfigElements();
- loadConfigElements(providedConfigs, revision); // This must use the current build model
+ loadConfigElements(providedConfigs, revision); // This must use the current build model
}
} else if (element.getName().equals(IManagedBuildDefinitionsStartup.BUILD_DEFINITION_STARTUP)) {
if (element instanceof DefaultManagedConfigElement) {
- // Cache up early configuration extension elements so was can call them after
- // other configuration elements have loaded.
+ // Cache up early configuration extension elements so was can call them after
+ // other configuration elements have loaded.
if (startUpConfigElements == null)
startUpConfigElements = new ArrayList<IManagedConfigElement>();
startUpConfigElements.add(element);
@@ -2551,15 +2512,15 @@ public class ManagedBuildManager extends AbstractCExtension {
if (element.getName().equals(ITool.TOOL_ELEMENT_NAME)) {
new Tool(element, revision);
} else if (element.getName().equals(ITarget.TARGET_ELEMENT_NAME)) {
- new Target(element,revision);
+ new Target(element, revision);
} else if (element.getName().equals(IManagedConfigElementProvider.ELEMENT_NAME)) {
// don't allow nested config providers.
if (element instanceof DefaultManagedConfigElement) {
IManagedConfigElement[] providedConfigs;
IManagedConfigElementProvider provider = createConfigProvider(
- (DefaultManagedConfigElement)element);
+ (DefaultManagedConfigElement) element);
providedConfigs = provider.getConfigElements();
- loadConfigElementsV2(providedConfigs, revision); // This must use the 2.0 build model
+ loadConfigElementsV2(providedConfigs, revision); // This must use the 2.0 build model
}
}
} catch (Exception ex) {
@@ -2599,90 +2560,91 @@ public class ManagedBuildManager extends AbstractCExtension {
return buildInfo;
}
- public static void setLoaddedBuildInfo(IProject project, IManagedBuildInfo info) throws CoreException{
+ public static void setLoaddedBuildInfo(IProject project, IManagedBuildInfo info) throws CoreException {
// Associate the build info with the project for the duration of the session
//project.setSessionProperty(buildInfoProperty, info);
-// IResourceRuleFactory rcRf = ResourcesPlugin.getWorkspace().getRuleFactory();
-// ISchedulingRule rule = rcRf.modifyRule(project);
-// IJobManager mngr = Job.getJobManager();
-
-// try {
-// mngr.beginRule(rule, null);
- doSetLoaddedInfo(project, info, true);
-// } catch (IllegalArgumentException e) {
-// // TODO: set anyway for now
-// doSetLoaddedInfo(project, info);
-// }finally {
-// mngr.endRule(rule);
-// }
- }
-
- private synchronized static void doSetLoaddedInfo(IProject project, IManagedBuildInfo info, boolean overwrite){
- if(!overwrite && fInfoMap.get(project) != null)
+ // IResourceRuleFactory rcRf = ResourcesPlugin.getWorkspace().getRuleFactory();
+ // ISchedulingRule rule = rcRf.modifyRule(project);
+ // IJobManager mngr = Job.getJobManager();
+
+ // try {
+ // mngr.beginRule(rule, null);
+ doSetLoaddedInfo(project, info, true);
+ // } catch (IllegalArgumentException e) {
+ // // TODO: set anyway for now
+ // doSetLoaddedInfo(project, info);
+ // }finally {
+ // mngr.endRule(rule);
+ // }
+ }
+
+ private synchronized static void doSetLoaddedInfo(IProject project, IManagedBuildInfo info, boolean overwrite) {
+ if (!overwrite && fInfoMap.get(project) != null)
return;
- if(info != null){
+ if (info != null) {
fInfoMap.put(project, info);
- if(BuildDbgUtil.DEBUG)
- BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: build info set for project " + project.getName()); //$NON-NLS-1$
- }else{
+ if (BuildDbgUtil.DEBUG)
+ BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD,
+ "build info load: build info set for project " + project.getName()); //$NON-NLS-1$
+ } else {
fInfoMap.remove(project);
- if(BuildDbgUtil.DEBUG)
- BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: build info CLEARED for project " + project.getName()); //$NON-NLS-1$
+ if (BuildDbgUtil.DEBUG)
+ BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD,
+ "build info load: build info CLEARED for project " + project.getName()); //$NON-NLS-1$
}
}
- private static IManagedConfigElementProvider createConfigProvider(
- DefaultManagedConfigElement element) throws CoreException {
+ private static IManagedConfigElementProvider createConfigProvider(DefaultManagedConfigElement element)
+ throws CoreException {
- return (IManagedConfigElementProvider)element.getConfigurationElement().
- createExecutableExtension(IManagedConfigElementProvider.CLASS_ATTRIBUTE);
+ return (IManagedConfigElementProvider) element.getConfigurationElement()
+ .createExecutableExtension(IManagedConfigElementProvider.CLASS_ATTRIBUTE);
}
+ private static IManagedBuildDefinitionsStartup createStartUpConfigLoader(DefaultManagedConfigElement element)
+ throws CoreException {
- private static IManagedBuildDefinitionsStartup createStartUpConfigLoader(
- DefaultManagedConfigElement element) throws CoreException {
-
- return (IManagedBuildDefinitionsStartup)element.getConfigurationElement().createExecutableExtension(IManagedBuildDefinitionsStartup.CLASS_ATTRIBUTE);
- }
+ return (IManagedBuildDefinitionsStartup) element.getConfigurationElement()
+ .createExecutableExtension(IManagedBuildDefinitionsStartup.CLASS_ATTRIBUTE);
+ }
public static boolean manages(IResource resource) {
ICProjectDescription des = CoreModel.getDefault().getProjectDescription(resource.getProject(), false);
- if(des == null){
+ if (des == null) {
return false;
}
ICConfigurationDescription cfgDes = des.getActiveConfiguration();
IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(cfgDes);
- if(cfg != null)
+ if (cfg != null)
return true;
return false;
-
// // The managed build manager manages build information for the
-// // resource IFF it it is a project and has a build file with the proper
-// // root element
-// IProject project = null;
-// if (resource instanceof IProject){
-// project = (IProject)resource;
-// } else if (resource instanceof IFile) {
-// project = ((IFile)resource).getProject();
-// } else {
-// return false;
-// }
-// IFile file = project.getFile(SETTINGS_FILE_NAME);
-// if (file.exists()) {
-// try {
-// InputStream stream = file.getContents();
-// DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
-// Document document = parser.parse(stream);
-// NodeList nodes = document.getElementsByTagName(ROOT_NODE_NAME);
-// return (nodes.getLength() > 0);
-// } catch (Exception e) {
-// return false;
-// }
-// }
-// return false;
+ // // resource IFF it it is a project and has a build file with the proper
+ // // root element
+ // IProject project = null;
+ // if (resource instanceof IProject){
+ // project = (IProject)resource;
+ // } else if (resource instanceof IFile) {
+ // project = ((IFile)resource).getProject();
+ // } else {
+ // return false;
+ // }
+ // IFile file = project.getFile(SETTINGS_FILE_NAME);
+ // if (file.exists()) {
+ // try {
+ // InputStream stream = file.getContents();
+ // DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ // Document document = parser.parse(stream);
+ // NodeList nodes = document.getElementsByTagName(ROOT_NODE_NAME);
+ // return (nodes.getLength() > 0);
+ // } catch (Exception e) {
+ // return false;
+ // }
+ // }
+ // return false;
}
/**
@@ -2694,8 +2656,8 @@ public class ManagedBuildManager extends AbstractCExtension {
*/
private static ManagedBuildInfo findBuildInfo(IResource rc, boolean forceLoad) {
- if (rc == null){
- if(BuildDbgUtil.DEBUG)
+ if (rc == null) {
+ if (BuildDbgUtil.DEBUG)
BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: null resource"); //$NON-NLS-1$
return null;
}
@@ -2704,110 +2666,122 @@ public class ManagedBuildManager extends AbstractCExtension {
IProject proj = rc.getProject();
if (!proj.exists()) {
- if(BuildDbgUtil.DEBUG)
- BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: info is null, project does not exist"); //$NON-NLS-1$
+ if (BuildDbgUtil.DEBUG)
+ BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD,
+ "build info load: info is null, project does not exist"); //$NON-NLS-1$
return null;
}
- if(BuildDbgUtil.DEBUG)
- BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: info is null, querying the update mngr"); //$NON-NLS-1$
+ if (BuildDbgUtil.DEBUG)
+ BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD,
+ "build info load: info is null, querying the update mngr"); //$NON-NLS-1$
buildInfo = UpdateManagedProjectManager.getConvertedManagedBuildInfo(proj);
- if(buildInfo != null)
+ if (buildInfo != null)
return buildInfo;
// Check if there is any build info associated with this project for this session
try {
buildInfo = getLoadedBuildInfo(proj);
} catch (CoreException e) {
- if(BuildDbgUtil.DEBUG)
- BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: core exception while getting the loaded info: " + e.getLocalizedMessage()); //$NON-NLS-1$
+ if (BuildDbgUtil.DEBUG)
+ BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD,
+ "build info load: core exception while getting the loaded info: " + e.getLocalizedMessage()); //$NON-NLS-1$
return null;
}
- if(buildInfo == null /*&& forceLoad*/){
+ if (buildInfo == null /*&& forceLoad*/) {
int flags = forceLoad ? 0 : ICProjectDescriptionManager.GET_IF_LOADDED;
- if(BuildDbgUtil.DEBUG)
- BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: build info is NOT loaded" + (forceLoad ? " forceload" : "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- ICProjectDescription projDes = CoreModel.getDefault().getProjectDescriptionManager().getProjectDescription(proj, flags);
- if(projDes != null){
- if(BuildDbgUtil.DEBUG)
- BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: project description is obtained, qwerying the loaded build info"); //$NON-NLS-1$
+ if (BuildDbgUtil.DEBUG)
+ BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD,
+ "build info load: build info is NOT loaded" + (forceLoad ? " forceload" : "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ ICProjectDescription projDes = CoreModel.getDefault().getProjectDescriptionManager()
+ .getProjectDescription(proj, flags);
+ if (projDes != null) {
+ if (BuildDbgUtil.DEBUG)
+ BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD,
+ "build info load: project description is obtained, qwerying the loaded build info"); //$NON-NLS-1$
try {
buildInfo = getLoadedBuildInfo(proj);
} catch (CoreException e) {
- if(BuildDbgUtil.DEBUG)
- BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: core exception while getting the loaded info (2): " + e.getLocalizedMessage()); //$NON-NLS-1$
+ if (BuildDbgUtil.DEBUG)
+ BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD,
+ "build info load: core exception while getting the loaded info (2): " //$NON-NLS-1$
+ + e.getLocalizedMessage());
return null;
}
- if(buildInfo == null){
- if(BuildDbgUtil.DEBUG)
- BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: info is null, trying the cfg data provider"); //$NON-NLS-1$
+ if (buildInfo == null) {
+ if (BuildDbgUtil.DEBUG)
+ BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD,
+ "build info load: info is null, trying the cfg data provider"); //$NON-NLS-1$
buildInfo = ConfigurationDataProvider.getLoaddedBuildInfo(projDes);
- if(buildInfo != null){
- if(BuildDbgUtil.DEBUG)
- BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: info found, setting as loaded"); //$NON-NLS-1$
+ if (buildInfo != null) {
+ if (BuildDbgUtil.DEBUG)
+ BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD,
+ "build info load: info found, setting as loaded"); //$NON-NLS-1$
try {
setLoaddedBuildInfo(proj, buildInfo);
} catch (CoreException e) {
- if(BuildDbgUtil.DEBUG)
- BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: core exception while setting loaded description, ignoring; : " + e.getLocalizedMessage()); //$NON-NLS-1$
+ if (BuildDbgUtil.DEBUG)
+ BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD,
+ "build info load: core exception while setting loaded description, ignoring; : " //$NON-NLS-1$
+ + e.getLocalizedMessage());
}
}
}
- } else if(BuildDbgUtil.DEBUG){
- BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: project description in null"); //$NON-NLS-1$
+ } else if (BuildDbgUtil.DEBUG) {
+ BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD,
+ "build info load: project description in null"); //$NON-NLS-1$
}
-
-// if(buildInfo == null){
-// if(BuildDbgUtil.DEBUG)
-// BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: info is null, querying the update mngr"); //$NON-NLS-1$
-// buildInfo = UpdateManagedProjectManager.getConvertedManagedBuildInfo(proj);
-// }
+ // if(buildInfo == null){
+ // if(BuildDbgUtil.DEBUG)
+ // BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: info is null, querying the update mngr"); //$NON-NLS-1$
+ // buildInfo = UpdateManagedProjectManager.getConvertedManagedBuildInfo(proj);
+ // }
}
-// if (buildInfo == null && resource instanceof IProject)
-// buildInfo = findBuildInfoSynchronized((IProject)resource, forceLoad);
-/*
- // Nothing in session store, so see if we can load it from cdtbuild
- if (buildInfo == null && resource instanceof IProject) {
- try {
- buildInfo = loadBuildInfo((IProject)resource);
- } catch (Exception e) {
- // TODO: Issue error reagarding not being able to load the project file (.cdtbuild)
- }
+ // if (buildInfo == null && resource instanceof IProject)
+ // buildInfo = findBuildInfoSynchronized((IProject)resource, forceLoad);
+ /*
+ // Nothing in session store, so see if we can load it from cdtbuild
+ if (buildInfo == null && resource instanceof IProject) {
+ try {
+ buildInfo = loadBuildInfo((IProject)resource);
+ } catch (Exception e) {
+ // TODO: Issue error reagarding not being able to load the project file (.cdtbuild)
+ }
- try {
- // Check if the project needs its container initialized
- initBuildInfoContainer(buildInfo);
- } catch (CoreException e) {
- // We can live without a path entry container if the build information is valid
- }
- }
-*/
- if(buildInfo != null)
+ try {
+ // Check if the project needs its container initialized
+ initBuildInfoContainer(buildInfo);
+ } catch (CoreException e) {
+ // We can live without a path entry container if the build information is valid
+ }
+ }
+ */
+ if (buildInfo != null)
buildInfo.updateOwner(proj);
- if(BuildDbgUtil.DEBUG){
- if(buildInfo == null)
+ if (BuildDbgUtil.DEBUG) {
+ if (buildInfo == null)
BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: build info is null"); //$NON-NLS-1$
-// else
-// BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: build info found");
+ // else
+ // BuildDbgUtil.getInstance().traceln(BuildDbgUtil.BUILD_INFO_LOAD, "build info load: build info found");
}
return buildInfo;
}
- synchronized static ManagedBuildInfo getLoadedBuildInfo(IProject project) throws CoreException{
+ synchronized static ManagedBuildInfo getLoadedBuildInfo(IProject project) throws CoreException {
// Check if there is any build info associated with this project for this session
- ManagedBuildInfo buildInfo = (ManagedBuildInfo)fInfoMap.get(project);//project.getSessionProperty(buildInfoProperty);
- // Make sure that if a project has build info, that the info is not corrupted
+ ManagedBuildInfo buildInfo = (ManagedBuildInfo) fInfoMap.get(project);//project.getSessionProperty(buildInfoProperty);
+ // Make sure that if a project has build info, that the info is not corrupted
if (buildInfo != null) {
buildInfo.updateOwner(project);
}
@@ -2823,7 +2797,8 @@ public class ManagedBuildManager extends AbstractCExtension {
*/
private static boolean canFindBuildInfo(IResource resource) {
- if (resource == null) return false;
+ if (resource == null)
+ return false;
// Make sure the extension information is loaded first
try {
@@ -2844,10 +2819,11 @@ public class ManagedBuildManager extends AbstractCExtension {
if (buildInfo == null && resource instanceof IProject) {
// Check weather getBuildInfo is called from converter
- buildInfo = UpdateManagedProjectManager.getConvertedManagedBuildInfo((IProject)resource);
- if (buildInfo != null) return true;
+ buildInfo = UpdateManagedProjectManager.getConvertedManagedBuildInfo((IProject) resource);
+ if (buildInfo != null)
+ return true;
// Check if the build information can be loaded from the .cdtbuild file
- return canLoadBuildInfo(((IProject)resource));
+ return canLoadBuildInfo(((IProject) resource));
}
return (buildInfo != null);
@@ -2860,81 +2836,81 @@ public class ManagedBuildManager extends AbstractCExtension {
* findBuildInfoSynchronized could also be called from project converter
* in this case the ManagedBuildInfo saved in the converter would be returned
*/
-/* synchronized private static ManagedBuildInfo findBuildInfoSynchronized(IProject project, boolean forceLoad) {
- ManagedBuildInfo buildInfo = null;
+ /* synchronized private static ManagedBuildInfo findBuildInfoSynchronized(IProject project, boolean forceLoad) {
+ ManagedBuildInfo buildInfo = null;
- // Check if there is any build info associated with this project for this session
- try {
- buildInfo = (ManagedBuildInfo)project.getSessionProperty(buildInfoProperty);
- // Make sure that if a project has build info, that the info is not corrupted
- if (buildInfo != null) {
- buildInfo.updateOwner(project);
- }
- } catch (CoreException e) {
- // return null;
- }
-
- if(buildInfo == null && forceLoad){
- // Make sure the extension information is loaded first
+ // Check if there is any build info associated with this project for this session
try {
- loadExtensions();
- } catch (BuildException e) {
- e.printStackTrace();
- return null;
+ buildInfo = (ManagedBuildInfo)project.getSessionProperty(buildInfoProperty);
+ // Make sure that if a project has build info, that the info is not corrupted
+ if (buildInfo != null) {
+ buildInfo.updateOwner(project);
+ }
+ } catch (CoreException e) {
+ // return null;
}
+ if(buildInfo == null && forceLoad){
+ // Make sure the extension information is loaded first
+ try {
+ loadExtensions();
+ } catch (BuildException e) {
+ e.printStackTrace();
+ return null;
+ }
- // Check weather getBuildInfo is called from converter
- buildInfo = UpdateManagedProjectManager.getConvertedManagedBuildInfo(project);
- // Nothing in session store, so see if we can load it from cdtbuild
- if (buildInfo == null) {
- try {
- buildInfo = loadBuildInfo(project);
- } catch (Exception e) {
- // Issue error regarding not being able to load the project file (.cdtbuild)
- if (buildInfo == null) {
- buildInfo = createBuildInfo(project);
- }
- buildInfo.setValid(false);
- // Display error message
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if(window == null){
- IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows();
- window = windows[0];
- }
+ // Check weather getBuildInfo is called from converter
+ buildInfo = UpdateManagedProjectManager.getConvertedManagedBuildInfo(project);
- final Shell shell = window.getShell();
- final String exceptionMsg = e.getMessage();
- //using syncExec could cause a dead-lock
- //that is why asyncExec is used
- shell.getDisplay().asyncExec( new Runnable() {
- public void run() {
- MessageDialog.openError(shell,
- ManagedMakeMessages.getResourceString("ManagedBuildManager.error.open_failed_title"), //$NON-NLS-1$
- ManagedMakeMessages.getFormattedString("ManagedBuildManager.error.open_failed", //$NON-NLS-1$
- exceptionMsg));
+ // Nothing in session store, so see if we can load it from cdtbuild
+ if (buildInfo == null) {
+ try {
+ buildInfo = loadBuildInfo(project);
+ } catch (Exception e) {
+ // Issue error regarding not being able to load the project file (.cdtbuild)
+ if (buildInfo == null) {
+ buildInfo = createBuildInfo(project);
+ }
+ buildInfo.setValid(false);
+ // Display error message
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if(window == null){
+ IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows();
+ window = windows[0];
}
- } );
- }
- if (buildInfo != null && !buildInfo.isContainerInited()) {
- // NOTE: If this is called inside the above rule, then an IllegalArgumentException can
- // occur when the CDT project file is saved - it uses the Workspace Root as the scheduling rule.
- //
- try {
- // Check if the project needs its container initialized
- initBuildInfoContainer(buildInfo);
- } catch (CoreException e) {
- // We can live without a path entry container if the build information is valid
+ final Shell shell = window.getShell();
+ final String exceptionMsg = e.getMessage();
+ //using syncExec could cause a dead-lock
+ //that is why asyncExec is used
+ shell.getDisplay().asyncExec( new Runnable() {
+ public void run() {
+ MessageDialog.openError(shell,
+ ManagedMakeMessages.getResourceString("ManagedBuildManager.error.open_failed_title"), //$NON-NLS-1$
+ ManagedMakeMessages.getFormattedString("ManagedBuildManager.error.open_failed", //$NON-NLS-1$
+ exceptionMsg));
+ }
+ } );
+ }
+
+ if (buildInfo != null && !buildInfo.isContainerInited()) {
+ // NOTE: If this is called inside the above rule, then an IllegalArgumentException can
+ // occur when the CDT project file is saved - it uses the Workspace Root as the scheduling rule.
+ //
+ try {
+ // Check if the project needs its container initialized
+ initBuildInfoContainer(buildInfo);
+ } catch (CoreException e) {
+ // We can live without a path entry container if the build information is valid
+ }
}
}
}
- }
- return buildInfo;
- }
-*/
+ return buildInfo;
+ }
+ */
/**
* Finds, but does not create, the managed build information for the
* argument.
@@ -2956,14 +2932,15 @@ public class ManagedBuildManager extends AbstractCExtension {
} catch (CoreException e) {
}
- if(info == null){
+ if (info == null) {
try {
info = loadOldStyleBuildInfo(project);
- if(info != null)
+ if (info != null)
doSetLoaddedInfo(project, info, false);
} catch (Exception e) {
- throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, e.getLocalizedMessage(), e));
+ throw new CoreException(
+ new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, e.getLocalizedMessage(), e));
}
}
@@ -2971,7 +2948,7 @@ public class ManagedBuildManager extends AbstractCExtension {
}
- public static synchronized IManagedBuildInfo getBuildInfoLegacy(IProject project){
+ public static synchronized IManagedBuildInfo getBuildInfoLegacy(IProject project) {
try {
return getOldStyleBuildInfo(project);
} catch (CoreException e) {
@@ -2979,6 +2956,7 @@ public class ManagedBuildManager extends AbstractCExtension {
return null;
}
}
+
/**
* Finds, but does not create, the managed build information for the
* argument.
@@ -3025,7 +3003,7 @@ public class ManagedBuildManager extends AbstractCExtension {
public static URL getURLInBuildDefinitions(DefaultManagedConfigElement element, IPath path) {
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT_ID);
- if( extensionPoint != null) {
+ if (extensionPoint != null) {
IExtension[] extensions = extensionPoint.getExtensions();
if (extensions != null) {
@@ -3037,23 +3015,19 @@ public class ManagedBuildManager extends AbstractCExtension {
//
// Note: If not done, icon file names would have to be unique
// across several plug-ins.
- if (element.getExtension().getExtensionPointUniqueIdentifier()
- == extension.getExtensionPointUniqueIdentifier())
- {
+ if (element.getExtension().getExtensionPointUniqueIdentifier() == extension
+ .getExtensionPointUniqueIdentifier()) {
// Get the path-name
- Bundle bundle = Platform.getBundle( extension.getNamespace() );
+ Bundle bundle = Platform.getBundle(extension.getNamespace());
URL url = Platform.find(bundle, path);
- if ( url != null )
- {
+ if (url != null) {
try {
return Platform.asLocalURL(url);
} catch (IOException e) {
// Ignore the exception
return null;
}
- }
- else
- {
+ } else {
// Print a warning
outputIconError(path.toString());
}
@@ -3075,7 +3049,7 @@ public class ManagedBuildManager extends AbstractCExtension {
}
private static Map<IBuildObject, IManagedConfigElement> getConfigElementMap() {
- if(!projectTypesLoading)
+ if (!projectTypesLoading)
throw new IllegalStateException();
if (configElementMap == null) {
@@ -3121,7 +3095,7 @@ public class ManagedBuildManager extends AbstractCExtension {
msgs[0] = attribute;
msgs[1] = id;
ManagedBuildManager.outputManifestError(
- ManagedMakeMessages.getFormattedString(ManagedBuildManager.MANIFEST_ERROR_OPTION_VALUEHANDLER, msgs));
+ ManagedMakeMessages.getFormattedString(ManagedBuildManager.MANIFEST_ERROR_OPTION_VALUEHANDLER, msgs));
}
public static void outputResolveError(String attribute, String lookupId, String type, String id) {
@@ -3131,7 +3105,7 @@ public class ManagedBuildManager extends AbstractCExtension {
msgs[2] = type;
msgs[3] = id;
ManagedBuildManager.outputManifestError(
- ManagedMakeMessages.getFormattedString(ManagedBuildManager.MANIFEST_ERROR_RESOLVING, msgs));
+ ManagedMakeMessages.getFormattedString(ManagedBuildManager.MANIFEST_ERROR_RESOLVING, msgs));
}
public static void outputDuplicateIdError(String type, String id) {
@@ -3139,7 +3113,7 @@ public class ManagedBuildManager extends AbstractCExtension {
msgs[0] = type;
msgs[1] = id;
ManagedBuildManager.outputManifestError(
- ManagedMakeMessages.getFormattedString(ManagedBuildManager.MANIFEST_ERROR_DUPLICATE, msgs));
+ ManagedMakeMessages.getFormattedString(ManagedBuildManager.MANIFEST_ERROR_DUPLICATE, msgs));
}
public static void outputManifestError(String message) {
@@ -3148,15 +3122,15 @@ public class ManagedBuildManager extends AbstractCExtension {
public static void outputIconError(String iconLocation) {
String[] msgs = new String[1];
- msgs[0]= iconLocation;
+ msgs[0] = iconLocation;
ManagedBuildManager.outputManifestError(
- ManagedMakeMessages.getFormattedString(ManagedBuildManager.MANIFEST_ERROR_ICON, msgs));
+ ManagedMakeMessages.getFormattedString(ManagedBuildManager.MANIFEST_ERROR_ICON, msgs));
}
/**
* @return the instance of the Environment Variable Provider
*/
- public static IEnvironmentVariableProvider getEnvironmentVariableProvider(){
+ public static IEnvironmentVariableProvider getEnvironmentVariableProvider() {
return EnvironmentVariableProvider.getDefault();
}
@@ -3167,13 +3141,13 @@ public class ManagedBuildManager extends AbstractCExtension {
public static String getVersionFromIdAndVersion(String idAndVersion) {
-// Get the index of the separator '_' in tool id.
+ // Get the index of the separator '_' in tool id.
int index = idAndVersion.lastIndexOf('_');
//Validate the version number if exists.
- if ( index != -1) {
+ if (index != -1) {
// Get the version number from tool id.
- String version = idAndVersion.substring(index+1);
+ String version = idAndVersion.substring(index + 1);
try {
// If there is a valid version then return 'version'
@@ -3193,12 +3167,11 @@ public class ManagedBuildManager extends AbstractCExtension {
*/
public static String getIdFromIdAndVersion(String idAndVersion) {
// If there is a valid version return only 'id' part
- if ( getVersionFromIdAndVersion(idAndVersion) != null) {
+ if (getVersionFromIdAndVersion(idAndVersion) != null) {
// Get the index of the separator '_' in tool id.
int index = idAndVersion.lastIndexOf('_');
- return idAndVersion.substring(0,index);
- }
- else {
+ return idAndVersion.substring(0, index);
+ } else {
// if there is no version or no valid version
return idAndVersion;
}
@@ -3207,7 +3180,7 @@ public class ManagedBuildManager extends AbstractCExtension {
/**
* @return the instance of the Build Macro Provider
*/
- public static IBuildMacroProvider getBuildMacroProvider(){
+ public static IBuildMacroProvider getBuildMacroProvider() {
return BuildMacroProvider.getDefault();
}
@@ -3247,12 +3220,8 @@ public class ManagedBuildManager extends AbstractCExtension {
// Ignore invalid options
if (option.isValid()) {
// Call the handler
- if (option.getValueHandler().handleValue(
- config,
- toolChain,
- option,
- option.getValueHandlerExtraArgument(),
- event)) {
+ if (option.getValueHandler().handleValue(config, toolChain, option,
+ option.getValueHandlerExtraArgument(), event)) {
// TODO : Event is handled successfully and returned true.
// May need to do something here say logging a message.
} else {
@@ -3269,12 +3238,8 @@ public class ManagedBuildManager extends AbstractCExtension {
// Ignore invalid options
if (toolOption.isValid()) {
// Call the handler
- if (toolOption.getValueHandler().handleValue(
- config,
- tool,
- toolOption,
- toolOption.getValueHandlerExtraArgument(),
- event)) {
+ if (toolOption.getValueHandler().handleValue(config, tool, toolOption,
+ toolOption.getValueHandlerExtraArgument(), event)) {
// TODO : Event is handled successfully and returned true.
// May need to do something here say logging a message.
} else {
@@ -3306,21 +3271,16 @@ public class ManagedBuildManager extends AbstractCExtension {
// Note: Resource configurations have no toolchain options
// Get options associated with the resource configuration
- ITool[] tools = config instanceof IFileInfo ?
- ((IFileInfo)config).getToolsToInvoke() :
- ((IFolderInfo)config).getFilteredTools();
+ ITool[] tools = config instanceof IFileInfo ? ((IFileInfo) config).getToolsToInvoke()
+ : ((IFolderInfo) config).getFilteredTools();
for (ITool tool : tools) {
IOption[] toolOptions = tool.getOptions();
for (IOption toolOption : toolOptions) {
// Ignore invalid options
if (toolOption.isValid()) {
// Call the handler
- if (toolOption.getValueHandler().handleValue(
- config,
- tool,
- toolOption,
- toolOption.getValueHandlerExtraArgument(),
- event)) {
+ if (toolOption.getValueHandler().handleValue(config, tool, toolOption,
+ toolOption.getValueHandlerExtraArgument(), event)) {
// TODO : Event is handled successfully and returned true.
// May need to do something here say logging a message.
} else {
@@ -3331,8 +3291,7 @@ public class ManagedBuildManager extends AbstractCExtension {
}
}
- private static boolean checkForMigrationSupport(ManagedBuildInfo buildInfo,
- boolean forCurrentMbsVersion) {
+ private static boolean checkForMigrationSupport(ManagedBuildInfo buildInfo, boolean forCurrentMbsVersion) {
IConfigurationElement element = null;
@@ -3341,11 +3300,9 @@ public class ManagedBuildManager extends AbstractCExtension {
IProjectType projectType = managedProject.getProjectType();
if (forCurrentMbsVersion) {
- element = ((ProjectType) projectType)
- .getCurrentMbsVersionConversionElement();
+ element = ((ProjectType) projectType).getCurrentMbsVersionConversionElement();
} else {
- element = ((ProjectType) projectType)
- .getPreviousMbsVersionConversionElement();
+ element = ((ProjectType) projectType).getPreviousMbsVersionConversionElement();
}
if (element != null) {
@@ -3365,11 +3322,9 @@ public class ManagedBuildManager extends AbstractCExtension {
IToolChain toolChain = configuration.getToolChain();
if (forCurrentMbsVersion) {
- element = ((ToolChain) toolChain)
- .getCurrentMbsVersionConversionElement();
+ element = ((ToolChain) toolChain).getCurrentMbsVersionConversionElement();
} else {
- element = ((ToolChain) toolChain)
- .getPreviousMbsVersionConversionElement();
+ element = ((ToolChain) toolChain).getPreviousMbsVersionConversionElement();
}
if (element != null) {
@@ -3386,11 +3341,9 @@ public class ManagedBuildManager extends AbstractCExtension {
ITool[] tools = toolChain.getTools();
for (ITool tool : tools) {
if (forCurrentMbsVersion) {
- element = ((Tool) tool)
- .getCurrentMbsVersionConversionElement();
+ element = ((Tool) tool).getCurrentMbsVersionConversionElement();
} else {
- element = ((Tool) tool)
- .getPreviousMbsVersionConversionElement();
+ element = ((Tool) tool).getPreviousMbsVersionConversionElement();
}
if (element != null) {
if (invokeConverter(buildInfo, tool, element) == null) {
@@ -3402,11 +3355,9 @@ public class ManagedBuildManager extends AbstractCExtension {
IBuilder builder = toolChain.getBuilder();
if (builder != null) {
if (forCurrentMbsVersion) {
- element = ((Builder) builder)
- .getCurrentMbsVersionConversionElement();
+ element = ((Builder) builder).getCurrentMbsVersionConversionElement();
} else {
- element = ((Builder) builder)
- .getPreviousMbsVersionConversionElement();
+ element = ((Builder) builder).getPreviousMbsVersionConversionElement();
}
if (element != null) {
@@ -3421,23 +3372,19 @@ public class ManagedBuildManager extends AbstractCExtension {
// walk through each resource configuration and look if there
// are any converters
// available. If so, invoke them.
- IResourceConfiguration[] resourceConfigs = configuration
- .getResourceConfigurations();
+ IResourceConfiguration[] resourceConfigs = configuration.getResourceConfigurations();
if ((resourceConfigs != null) && (resourceConfigs.length > 0)) {
for (IResourceConfiguration resConfig : resourceConfigs) {
ITool[] resTools = resConfig.getTools();
for (ITool resTool : resTools) {
if (forCurrentMbsVersion) {
- element = ((Tool) resTool)
- .getCurrentMbsVersionConversionElement();
+ element = ((Tool) resTool).getCurrentMbsVersionConversionElement();
} else {
- element = ((Tool) resTool)
- .getPreviousMbsVersionConversionElement();
+ element = ((Tool) resTool).getPreviousMbsVersionConversionElement();
}
if (element != null) {
if (invokeConverter(buildInfo, resTool, element) == null) {
- buildInfo.getManagedProject().setValid(
- false);
+ buildInfo.getManagedProject().setValid(false);
return false;
}
}
@@ -3452,7 +3399,8 @@ public class ManagedBuildManager extends AbstractCExtension {
return true;
}
- private static IBuildObject invokeConverter(ManagedBuildInfo bi, IBuildObject buildObject, IConfigurationElement element) {
+ private static IBuildObject invokeConverter(ManagedBuildInfo bi, IBuildObject buildObject,
+ IConfigurationElement element) {
if (element != null) {
IConvertManagedBuildObject convertBuildObject = null;
@@ -3460,8 +3408,7 @@ public class ManagedBuildManager extends AbstractCExtension {
String fromId = element.getAttribute("fromId"); //$NON-NLS-1$
try {
- convertBuildObject = (IConvertManagedBuildObject) element
- .createExecutableExtension("class"); //$NON-NLS-1$
+ convertBuildObject = (IConvertManagedBuildObject) element.createExecutableExtension("class"); //$NON-NLS-1$
} catch (CoreException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -3473,7 +3420,7 @@ public class ManagedBuildManager extends AbstractCExtension {
IBuildObject result = null;
try {
if (bi != null) {
- prj = (IProject)bi.getManagedProject().getOwner();
+ prj = (IProject) bi.getManagedProject().getOwner();
UpdateManagedProjectManager.addInfo(prj, bi);
}
result = convertBuildObject.convert(buildObject, fromId, toId, false);
@@ -3496,26 +3443,25 @@ public class ManagedBuildManager extends AbstractCExtension {
* It returns 'IBuildObject' if the conversion is successful.
*/
- public static IBuildObject convert(IBuildObject buildObj, String toId,
- boolean userhasConfirmed) {
+ public static IBuildObject convert(IBuildObject buildObj, String toId, boolean userhasConfirmed) {
String tmpToId = null;
// Get the Converter Extension Point
- IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
- .getExtensionPoint("org.eclipse.cdt.managedbuilder.core", //$NON-NLS-1$
- "projectConverter"); //$NON-NLS-1$
+ IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(
+ "org.eclipse.cdt.managedbuilder.core", //$NON-NLS-1$
+ "projectConverter"); //$NON-NLS-1$
if (extensionPoint != null) {
// Get the extensions
IExtension[] extensions = extensionPoint.getExtensions();
for (IExtension extension : extensions) {
// Get the configuration elements of each extension
- IConfigurationElement[] configElements = extension
- .getConfigurationElements();
+ IConfigurationElement[] configElements = extension.getConfigurationElements();
for (IConfigurationElement element : configElements) {
- if (element.getName().equals("converter") && (isBuildObjectApplicableForConversion(buildObj, element) == true)) { //$NON-NLS-1$
- tmpToId = element.getAttribute("toId"); //$NON-NLS-1$
+ if (element.getName().equals("converter") //$NON-NLS-1$
+ && (isBuildObjectApplicableForConversion(buildObj, element) == true)) {
+ tmpToId = element.getAttribute("toId"); //$NON-NLS-1$
if (tmpToId.equals(toId)) {
return invokeConverter(null, buildObj, element);
}
@@ -3536,9 +3482,9 @@ public class ManagedBuildManager extends AbstractCExtension {
public static boolean hasTargetConversionElements(IBuildObject buildObj) {
// Get the Converter Extension Point
- IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
- .getExtensionPoint("org.eclipse.cdt.managedbuilder.core", //$NON-NLS-1$
- "projectConverter"); //$NON-NLS-1$
+ IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(
+ "org.eclipse.cdt.managedbuilder.core", //$NON-NLS-1$
+ "projectConverter"); //$NON-NLS-1$
if (extensionPoint != null) {
// Get the extensions
IExtension[] extensions = extensionPoint.getExtensions();
@@ -3546,7 +3492,8 @@ public class ManagedBuildManager extends AbstractCExtension {
// Get the configuration elements of each extension
IConfigurationElement[] configElements = extension.getConfigurationElements();
for (IConfigurationElement element : configElements) {
- if (element.getName().equals("converter") && (isBuildObjectApplicableForConversion(buildObj, element) == true)) //$NON-NLS-1$
+ if (element.getName().equals("converter") //$NON-NLS-1$
+ && (isBuildObjectApplicableForConversion(buildObj, element) == true))
return true;
}
}
@@ -3563,9 +3510,9 @@ public class ManagedBuildManager extends AbstractCExtension {
Map<String, IConfigurationElement> conversionTargets = new HashMap<String, IConfigurationElement>();
// Get the Converter Extension Point
- IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
- .getExtensionPoint("org.eclipse.cdt.managedbuilder.core", //$NON-NLS-1$
- "projectConverter"); //$NON-NLS-1$
+ IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(
+ "org.eclipse.cdt.managedbuilder.core", //$NON-NLS-1$
+ "projectConverter"); //$NON-NLS-1$
if (extensionPoint != null) {
// Get the extensions
IExtension[] extensions = extensionPoint.getExtensions();
@@ -3573,7 +3520,8 @@ public class ManagedBuildManager extends AbstractCExtension {
// Get the configuration elements of each extension
IConfigurationElement[] configElements = extension.getConfigurationElements();
for (IConfigurationElement element : configElements) {
- if (element.getName().equals("converter") && (isBuildObjectApplicableForConversion(buildObj, element) == true)) { //$NON-NLS-1$
+ if (element.getName().equals("converter") //$NON-NLS-1$
+ && (isBuildObjectApplicableForConversion(buildObj, element) == true)) {
conversionTargets.put(element.getAttribute("name"), element); //$NON-NLS-1$
}
}
@@ -3587,8 +3535,7 @@ public class ManagedBuildManager extends AbstractCExtension {
* build object. It returns true if the given build object is convertable, otherwise it returns false.
*/
- private static boolean isBuildObjectApplicableForConversion(
- IBuildObject buildObj, IConfigurationElement element) {
+ private static boolean isBuildObjectApplicableForConversion(IBuildObject buildObj, IConfigurationElement element) {
String id = null;
String fromId = element.getAttribute("fromId"); //$NON-NLS-1$
@@ -3654,17 +3601,16 @@ public class ManagedBuildManager extends AbstractCExtension {
/*
* if the suffix is null, then the random number will be appended to the superId
*/
- static public String calculateChildId(String superId, String suffix){
- if(suffix == null)
+ static public String calculateChildId(String superId, String suffix) {
+ if (suffix == null)
suffix = Integer.toString(getRandomNumber());
String version = getVersionFromIdAndVersion(superId);
- if(version != null)
- return ManagedBuildManager.getIdFromIdAndVersion(superId) + "." + suffix + "_" + version; //$NON-NLS-1$ //$NON-NLS-2$
- return superId + "." + suffix; //$NON-NLS-1$
+ if (version != null)
+ return ManagedBuildManager.getIdFromIdAndVersion(superId) + "." + suffix + "_" + version; //$NON-NLS-1$ //$NON-NLS-2$
+ return superId + "." + suffix; //$NON-NLS-1$
}
-
private static int isInt(String s) {
try {
return Integer.parseInt(s);
@@ -3679,12 +3625,12 @@ public class ManagedBuildManager extends AbstractCExtension {
*/
public static String calculateBaseId(String id) {
int index = id.lastIndexOf('.');
- if (index<0)
+ if (index < 0)
return id;
- String lastSeg = id.substring(index+1,id.length());
- if (isInt(lastSeg)>0) {
- String baseId = id.substring(0,index);
+ String lastSeg = id.substring(index + 1, id.length());
+ if (isInt(lastSeg) > 0) {
+ String baseId = id.substring(0, index);
return baseId;
}
return getIdFromIdAndVersion(id);
@@ -3693,66 +3639,67 @@ public class ManagedBuildManager extends AbstractCExtension {
/**
* @return calculated relative path given the full path to a folder and a file
*/
- public static IPath calculateRelativePath(IPath container, IPath contents){
+ public static IPath calculateRelativePath(IPath container, IPath contents) {
IPath path = contents;
- if(container.isPrefixOf(contents)){
+ if (container.isPrefixOf(contents)) {
path = contents.setDevice(null).removeFirstSegments(container.segmentCount());
} else {
String file = null;
container = container.addTrailingSeparator();
- if(!contents.hasTrailingSeparator()){
+ if (!contents.hasTrailingSeparator()) {
file = contents.lastSegment();
contents = contents.removeLastSegments(1);
contents = contents.addTrailingSeparator();
}
IPath prefix = contents;
- for(;prefix.segmentCount() > 0 && !prefix.isPrefixOf(container);prefix = prefix.removeLastSegments(1)){
+ for (; prefix.segmentCount() > 0 && !prefix.isPrefixOf(container); prefix = prefix.removeLastSegments(1)) {
}
- if(prefix.segmentCount() > 0){
+ if (prefix.segmentCount() > 0) {
int diff = container.segmentCount() - prefix.segmentCount();
StringBuilder buff = new StringBuilder();
- while(diff-- > 0)
- buff.append("../"); //$NON-NLS-1$
+ while (diff-- > 0)
+ buff.append("../"); //$NON-NLS-1$
path = new Path(buff.toString()).append(contents.removeFirstSegments(prefix.segmentCount()));
- if(file != null)
+ if (file != null)
path = path.append(file);
}
}
return path;
}
-/* private static IBuildObject getBuildObjectFromDataObject(CDataObject data){
- if(data instanceof BuildConfigurationData)
- return ((BuildConfigurationData)data).getConfiguration();
- else if(data instanceof BuildFolderData)
- return ((BuildFolderData)data).getFolderInfo();
- else if(data instanceof BuildFileData)
- return ((BuildFileData)data).getFileInfo();
- return null;
- }
-*/
+ /* private static IBuildObject getBuildObjectFromDataObject(CDataObject data){
+ if(data instanceof BuildConfigurationData)
+ return ((BuildConfigurationData)data).getConfiguration();
+ else if(data instanceof BuildFolderData)
+ return ((BuildFolderData)data).getFolderInfo();
+ else if(data instanceof BuildFileData)
+ return ((BuildFileData)data).getFileInfo();
+ return null;
+ }
+ */
private static final boolean TEST_CONSISTENCE = false;
- public static IConfiguration getConfigurationForDescription(ICConfigurationDescription cfgDes){
+ public static IConfiguration getConfigurationForDescription(ICConfigurationDescription cfgDes) {
return getConfigurationForDescription(cfgDes, TEST_CONSISTENCE);
}
- private static IConfiguration getConfigurationForDescription(ICConfigurationDescription cfgDes, boolean checkConsistance){
- if(cfgDes == null)
+ private static IConfiguration getConfigurationForDescription(ICConfigurationDescription cfgDes,
+ boolean checkConsistance) {
+ if (cfgDes == null)
return null;
if (cfgDes instanceof ICMultiConfigDescription) {
- ICMultiConfigDescription mcd = (ICMultiConfigDescription)cfgDes;
- ICConfigurationDescription[] cfds = (ICConfigurationDescription[])mcd.getItems();
+ ICMultiConfigDescription mcd = (ICMultiConfigDescription) cfgDes;
+ ICConfigurationDescription[] cfds = (ICConfigurationDescription[]) mcd.getItems();
return new MultiConfiguration(cfds);
}
CConfigurationData cfgData = cfgDes.getConfigurationData();
- if(cfgData instanceof BuildConfigurationData){
- IConfiguration cfg = ((BuildConfigurationData)cfgData).getConfiguration();
- if(checkConsistance){
- if(cfgDes != getDescriptionForConfiguration(cfg, false)){
+ if (cfgData instanceof BuildConfigurationData) {
+ IConfiguration cfg = ((BuildConfigurationData) cfgData).getConfiguration();
+ if (checkConsistance) {
+ if (cfgDes != getDescriptionForConfiguration(cfg, false)) {
throw new IllegalStateException();
}
}
@@ -3766,8 +3713,8 @@ public class ManagedBuildManager extends AbstractCExtension {
* @param type {@link IOption#getValueType()}
* @return ICSettingEntry type
*/
- public static int optionTypeToEntryKind(int type){
- switch(type){
+ public static int optionTypeToEntryKind(int type) {
+ switch (type) {
case IOption.INCLUDE_PATH:
return ICSettingEntry.INCLUDE_PATH;
case IOption.PREPROCESSOR_SYMBOLS:
@@ -3790,8 +3737,8 @@ public class ManagedBuildManager extends AbstractCExtension {
* @param type {@link IOption#getValueType()}
* @return ICSettingEntry type
*/
- public static int optionUndefTypeToEntryKind(int type){
- switch(type){
+ public static int optionUndefTypeToEntryKind(int type) {
+ switch (type) {
case IOption.UNDEF_INCLUDE_PATH:
return ICSettingEntry.INCLUDE_PATH;
case IOption.UNDEF_PREPROCESSOR_SYMBOLS:
@@ -3808,8 +3755,8 @@ public class ManagedBuildManager extends AbstractCExtension {
return 0;
}
- public static int entryKindToOptionType(int kind){
- switch(kind){
+ public static int entryKindToOptionType(int kind) {
+ switch (kind) {
case ICSettingEntry.INCLUDE_PATH:
return IOption.INCLUDE_PATH;
case ICSettingEntry.INCLUDE_FILE:
@@ -3826,8 +3773,8 @@ public class ManagedBuildManager extends AbstractCExtension {
return 0;
}
- public static int entryKindToUndefOptionType(int kind){
- switch(kind){
+ public static int entryKindToUndefOptionType(int kind) {
+ switch (kind) {
case ICSettingEntry.INCLUDE_PATH:
return IOption.UNDEF_INCLUDE_PATH;
case ICSettingEntry.INCLUDE_FILE:
@@ -3843,18 +3790,20 @@ public class ManagedBuildManager extends AbstractCExtension {
}
return 0;
}
- public static ICConfigurationDescription getDescriptionForConfiguration(IConfiguration cfg){
+
+ public static ICConfigurationDescription getDescriptionForConfiguration(IConfiguration cfg) {
return getDescriptionForConfiguration(cfg, TEST_CONSISTENCE);
}
- private static ICConfigurationDescription getDescriptionForConfiguration(IConfiguration cfg, boolean checkConsistance){
- if(cfg.isExtensionElement())
+ private static ICConfigurationDescription getDescriptionForConfiguration(IConfiguration cfg,
+ boolean checkConsistance) {
+ if (cfg.isExtensionElement())
return null;
- ICConfigurationDescription des = ((Configuration)cfg).getConfigurationDescription();
- if(des == null){
- if(checkConsistance)
+ ICConfigurationDescription des = ((Configuration) cfg).getConfigurationDescription();
+ if (des == null) {
+ if (checkConsistance)
throw new IllegalStateException();
- if(((Configuration)cfg).isPreference()){
+ if (((Configuration) cfg).isPreference()) {
try {
des = CCorePlugin.getDefault().getPreferenceConfiguration(CFG_DATA_PROVIDER_ID);
} catch (CoreException e) {
@@ -3863,22 +3812,22 @@ public class ManagedBuildManager extends AbstractCExtension {
} else {
IProject project = cfg.getOwner().getProject();
ICProjectDescription projDes = CoreModel.getDefault().getProjectDescription(project, false);
- if(projDes != null){
+ if (projDes != null) {
des = projDes.getConfigurationById(cfg.getId());
}
}
}
- if(checkConsistance){
- if(cfg != getConfigurationForDescription(des, false)){
+ if (checkConsistance) {
+ if (cfg != getConfigurationForDescription(des, false)) {
throw new IllegalStateException();
}
}
return des;
}
- public static IPath getBuildFullPath(IConfiguration cfg, IBuilder builder){
+ public static IPath getBuildFullPath(IConfiguration cfg, IBuilder builder) {
IProject project = cfg.getOwner().getProject();
-// String path = builder.getBuildPath();
+ // String path = builder.getBuildPath();
IPath buildDirectory = builder.getBuildLocation();
IPath fullPath = null;
@@ -3887,25 +3836,25 @@ public class ManagedBuildManager extends AbstractCExtension {
if (res instanceof IContainer && res.exists()) {
fullPath = res.getFullPath();
} else {
- IContainer crs[] = ((IWorkspaceRoot)project.getParent()).findContainersForLocation(buildDirectory);
- if(crs.length != 0){
+ IContainer crs[] = ((IWorkspaceRoot) project.getParent()).findContainersForLocation(buildDirectory);
+ if (crs.length != 0) {
String projName = project.getName();
for (IContainer cr : crs) {
IPath path = cr.getFullPath();
- if(path.segmentCount() != 0 && path.segment(0).equals(projName)){
+ if (path.segmentCount() != 0 && path.segment(0).equals(projName)) {
fullPath = path;
break;
}
}
- if(fullPath == null){
+ if (fullPath == null) {
fullPath = crs[0].getFullPath();
}
}
}
} else {
fullPath = cfg.getOwner().getProject().getFullPath();
- if(builder.isManagedBuildOn())
+ if (builder.isManagedBuildOn())
fullPath = fullPath.append(cfg.getName());
}
@@ -3917,23 +3866,23 @@ public class ManagedBuildManager extends AbstractCExtension {
* or null if the String path doesn't contain workspace_loc
* @param path String path to have workspace_loc removed
* @return workspace path or null
- *
+ *
* @deprecated as of CDT 8.3. This method is useless as API as it does something very specfic to {@link BuildEntryStorage}.
* It was moved there as private method {@link BuildEntryStorage#locationToFullPath}.
*/
@Deprecated
- public static String locationToFullPath(String path){
+ public static String locationToFullPath(String path) {
Assert.isLegal(false, "Do not use this method"); //$NON-NLS-1$
return null;
}
- public static String fullPathToLocation(String path){
+ public static String fullPathToLocation(String path) {
StringBuilder buf = new StringBuilder();
return buf.append("${").append("workspace_loc:").append(path).append("}").toString(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
public static IPath getBuildLocation(IConfiguration cfg, IBuilder builder) {
- if(cfg.getOwner() == null)
+ if (cfg.getOwner() == null)
return Path.EMPTY;
IProject project = cfg.getOwner().getProject();
@@ -3959,7 +3908,7 @@ public class ManagedBuildManager extends AbstractCExtension {
* @since 6.0
*/
public static URI getBuildLocationURI(IConfiguration cfg, IBuilder builder) {
- if(cfg.getOwner() == null)
+ if (cfg.getOwner() == null)
return null;
IProject project = cfg.getOwner().getProject();
@@ -3983,119 +3932,120 @@ public class ManagedBuildManager extends AbstractCExtension {
return new Path(uri.getPath());
}
- public static IBuilder[] createBuilders(IProject project, Map<String, String> args){
+ public static IBuilder[] createBuilders(IProject project, Map<String, String> args) {
return ManagedBuilderCorePlugin.createBuilders(project, args);
}
- public static IBuilder createCustomBuilder(IConfiguration cfg, String builderId) throws CoreException{
+ public static IBuilder createCustomBuilder(IConfiguration cfg, String builderId) throws CoreException {
return ManagedBuilderCorePlugin.createCustomBuilder(cfg, builderId);
}
- public static IBuilder createCustomBuilder(IConfiguration cfg, IBuilder base){
+ public static IBuilder createCustomBuilder(IConfiguration cfg, IBuilder base) {
return ManagedBuilderCorePlugin.createCustomBuilder(cfg, base);
}
- public static IBuilder createBuilderForEclipseBuilder(IConfiguration cfg, String eclipseBuilderID) throws CoreException {
+ public static IBuilder createBuilderForEclipseBuilder(IConfiguration cfg, String eclipseBuilderID)
+ throws CoreException {
return ManagedBuilderCorePlugin.createBuilderForEclipseBuilder(cfg, eclipseBuilderID);
}
-/* public static IToolChain[] getExtensionsToolChains(String propertyType, String propertyValue){
- List all = getSortedToolChains();
- List result = new ArrayList();
- for(int i = 0; i < all.size(); i++){
- List list = (List)all.get(i);
- IToolChain tc = findToolChain(list, propertyType, propertyValue);
- if(tc != null)
- result.add(tc);
- }
- return (IToolChain[])result.toArray(new ToolChain[result.size()]);
- }
-*/
-/* public static void resortToolChains(){
- sortedToolChains = null;
- getSortedToolChains();
- }
-*/
-/* private static List getSortedToolChains(){
- if(sortedToolChains == null){
- sortedToolChains = new ArrayList();
- SortedMap map = getExtensionToolChainMapInternal();
- for(Iterator iter = map.values().iterator(); iter.hasNext();){
- ToolChain tc = (ToolChain)iter.next();
- if(tc.isAbstract())
- continue;
- List list = searchIdentical(sortedToolChains, tc);
- if(list == null){
- list = new ArrayList();
- sortedToolChains.add(list);
+ /* public static IToolChain[] getExtensionsToolChains(String propertyType, String propertyValue){
+ List all = getSortedToolChains();
+ List result = new ArrayList();
+ for(int i = 0; i < all.size(); i++){
+ List list = (List)all.get(i);
+ IToolChain tc = findToolChain(list, propertyType, propertyValue);
+ if(tc != null)
+ result.add(tc);
+ }
+ return (IToolChain[])result.toArray(new ToolChain[result.size()]);
+ }
+ */
+ /* public static void resortToolChains(){
+ sortedToolChains = null;
+ getSortedToolChains();
+ }
+ */
+ /* private static List getSortedToolChains(){
+ if(sortedToolChains == null){
+ sortedToolChains = new ArrayList();
+ SortedMap map = getExtensionToolChainMapInternal();
+ for(Iterator iter = map.values().iterator(); iter.hasNext();){
+ ToolChain tc = (ToolChain)iter.next();
+ if(tc.isAbstract())
+ continue;
+ List list = searchIdentical(sortedToolChains, tc);
+ if(list == null){
+ list = new ArrayList();
+ sortedToolChains.add(list);
+ }
+ list.add(tc);
+ tc.setIdenticalList(list);
}
- list.add(tc);
- tc.setIdenticalList(list);
}
- }
- return sortedToolChains;
- }
-*/
-// private static List findIdenticalToolChains(IToolChain tc){
-// ToolChain tCh = (ToolChain)tc;
-// List list = tCh.getIdenticalList();
-// if(list == null){
-// resortToolChains();
-// list = tCh.getIdenticalList();
-// if(list == null){
-// list = new ArrayList(0);
-// tCh.setIdenticalList(list);
-// }
-// }
-//
-// return ((ToolChain)tc).getIdenticalList();
-// }
-
- public static IToolChain[] getExtensionToolChains(IProjectType type){
+ return sortedToolChains;
+ }
+ */
+ // private static List findIdenticalToolChains(IToolChain tc){
+ // ToolChain tCh = (ToolChain)tc;
+ // List list = tCh.getIdenticalList();
+ // if(list == null){
+ // resortToolChains();
+ // list = tCh.getIdenticalList();
+ // if(list == null){
+ // list = new ArrayList(0);
+ // tCh.setIdenticalList(list);
+ // }
+ // }
+ //
+ // return ((ToolChain)tc).getIdenticalList();
+ // }
+
+ public static IToolChain[] getExtensionToolChains(IProjectType type) {
List<IToolChain> result = new ArrayList<IToolChain>();
IConfiguration cfgs[] = type.getConfigurations();
for (IConfiguration cfg : cfgs) {
IToolChain tc = cfg.getToolChain();
- if(tc == null)
+ if (tc == null)
continue;
- List<ToolChain> list = findIdenticalElements((ToolChain)tc, fToolChainSorter);
+ List<ToolChain> list = findIdenticalElements((ToolChain) tc, fToolChainSorter);
int k = 0;
- for(; k < result.size(); k++){
- if(findIdenticalElements((ToolChain)result.get(k), fToolChainSorter) == list)
+ for (; k < result.size(); k++) {
+ if (findIdenticalElements((ToolChain) result.get(k), fToolChainSorter) == list)
break;
}
- if(k == result.size()){
+ if (k == result.size()) {
result.add(tc);
}
}
return result.toArray(new IToolChain[result.size()]);
}
- public static IConfiguration[] getExtensionConfigurations(IToolChain tChain, IProjectType type){
+ public static IConfiguration[] getExtensionConfigurations(IToolChain tChain, IProjectType type) {
List<IConfiguration> list = new ArrayList<IConfiguration>();
IConfiguration cfgs[] = type.getConfigurations();
for (IConfiguration cfg : cfgs) {
IToolChain cur = cfg.getToolChain();
- if(cur != null
- && findIdenticalElements((ToolChain)cur, fToolChainSorter) == findIdenticalElements((ToolChain)tChain, fToolChainSorter)){
+ if (cur != null && findIdenticalElements((ToolChain) cur,
+ fToolChainSorter) == findIdenticalElements((ToolChain) tChain, fToolChainSorter)) {
list.add(cfg);
}
}
return list.toArray(new Configuration[list.size()]);
}
- public static IConfiguration getFirstExtensionConfiguration(IToolChain tChain){
- if(tChain.getParent() != null)
+ public static IConfiguration getFirstExtensionConfiguration(IToolChain tChain) {
+ if (tChain.getParent() != null)
return tChain.getParent();
- List<ToolChain> list = findIdenticalElements((ToolChain)tChain, fToolChainSorter);
- if(list != null){
- for(int i = 0; i < list.size(); i++){
+ List<ToolChain> list = findIdenticalElements((ToolChain) tChain, fToolChainSorter);
+ if (list != null) {
+ for (int i = 0; i < list.size(); i++) {
ToolChain cur = list.get(i);
- if(cur.getParent() != null)
+ if (cur.getParent() != null)
return cur.getParent();
}
}
@@ -4103,22 +4053,23 @@ public class ManagedBuildManager extends AbstractCExtension {
return null;
}
- public static IConfiguration[] getExtensionConfigurations(IToolChain tChain, String propertyType, String propertyValue){
-// List all = getSortedToolChains();
- List<ToolChain> list = findIdenticalElements((ToolChain)tChain, fToolChainSorter);
+ public static IConfiguration[] getExtensionConfigurations(IToolChain tChain, String propertyType,
+ String propertyValue) {
+ // List all = getSortedToolChains();
+ List<ToolChain> list = findIdenticalElements((ToolChain) tChain, fToolChainSorter);
LinkedHashSet<IConfiguration> result = new LinkedHashSet<IConfiguration>();
boolean tcFound = false;
- if(list != null){
- for(int i = 0; i < list.size(); i++){
+ if (list != null) {
+ for (int i = 0; i < list.size(); i++) {
ToolChain cur = list.get(i);
- if(cur == tChain){
+ if (cur == tChain) {
tcFound = true;
}
IConfiguration cfg = cur.getParent();
- if(cfg != null){
+ if (cfg != null) {
IBuildObjectProperties props = cfg.getBuildProperties();
- if(props.containsValue(propertyType, propertyValue)){
+ if (props.containsValue(propertyType, propertyValue)) {
result.add(cfg);
}
}
@@ -4126,71 +4077,72 @@ public class ManagedBuildManager extends AbstractCExtension {
}
- if(!tcFound) {
+ if (!tcFound) {
IConfiguration cfg = tChain.getParent();
- if(cfg != null){
+ if (cfg != null) {
IBuildObjectProperties props = cfg.getBuildProperties();
- if(props.containsValue(propertyType, propertyValue)){
+ if (props.containsValue(propertyType, propertyValue)) {
result.add(cfg);
}
}
}
-// if(result.size() == 0){
-// if(((ToolChain)tChain).supportsValue(propertyType, propertyValue)){
-// IConfiguration cfg = getFirstExtensionConfiguration(tChain);
-// if(cfg != null){
-// result.add(cfg);
-// }
-// }
-// }
+ // if(result.size() == 0){
+ // if(((ToolChain)tChain).supportsValue(propertyType, propertyValue)){
+ // IConfiguration cfg = getFirstExtensionConfiguration(tChain);
+ // if(cfg != null){
+ // result.add(cfg);
+ // }
+ // }
+ // }
return result.toArray(new IConfiguration[result.size()]);
}
-/* public static IToolChain[] getRealToolChains(){
- List all = getSortedToolChains();
- IToolChain tcs[] = new ToolChain[all.size()];
- for(int i = 0; i < tcs.length; i++){
- List list = (List)all.get(i);
- tcs[i] = (ToolChain)list.get(0);
+ /* public static IToolChain[] getRealToolChains(){
+ List all = getSortedToolChains();
+ IToolChain tcs[] = new ToolChain[all.size()];
+ for(int i = 0; i < tcs.length; i++){
+ List list = (List)all.get(i);
+ tcs[i] = (ToolChain)list.get(0);
+ }
+ return tcs;
}
- return tcs;
- }
-*/
+ */
- private static HashMap<MatchKey<ToolChain>, List<ToolChain>> getSortedToolChains(){
- if(fSortedToolChains == null){
+ private static HashMap<MatchKey<ToolChain>, List<ToolChain>> getSortedToolChains() {
+ if (fSortedToolChains == null) {
Collection<ToolChain> toolChains = getExtensionToolChainMapInternal().values();
fSortedToolChains = getSortedElements(toolChains);
}
return fSortedToolChains;
}
- private static HashMap<MatchKey<Tool>, List<Tool>> getSortedTools(){
- if(fSortedTools == null){
+ private static HashMap<MatchKey<Tool>, List<Tool>> getSortedTools() {
+ if (fSortedTools == null) {
Collection<Tool> tools = getExtensionToolMapInternal().values();
fSortedTools = getSortedElements(tools);
}
return fSortedTools;
}
- private static HashMap<MatchKey<Builder>, List<Builder>> getSortedBuilders(){
- if(fSortedBuilders == null){
+ private static HashMap<MatchKey<Builder>, List<Builder>> getSortedBuilders() {
+ if (fSortedBuilders == null) {
Collection<Builder> builders = getExtensionBuilderMapInternal().values();
fSortedBuilders = getSortedElements(builders);
}
return fSortedBuilders;
}
- private static <T extends BuildObject & IMatchKeyProvider<T>> HashMap<MatchKey<T>, List<T>> getSortedElements(Collection<T> elements){
+ private static <T extends BuildObject & IMatchKeyProvider<T>> HashMap<MatchKey<T>, List<T>> getSortedElements(
+ Collection<T> elements) {
HashMap<MatchKey<T>, List<T>> map = new HashMap<MatchKey<T>, List<T>>();
for (T p : elements) {
MatchKey<T> key = p.getMatchKey();
- if(key == null)
+ if (key == null)
continue;
List<T> list = map.get(key);
- if(list == null){
+ if (list == null) {
list = new ArrayList<T>();
map.put(key, list);
}
@@ -4205,7 +4157,7 @@ public class ManagedBuildManager extends AbstractCExtension {
return map;
}
- public static IToolChain[] getRealToolChains(){
+ public static IToolChain[] getRealToolChains() {
HashMap<MatchKey<ToolChain>, List<ToolChain>> map = getSortedToolChains();
IToolChain tcs[] = new ToolChain[map.size()];
int i = 0;
@@ -4215,7 +4167,7 @@ public class ManagedBuildManager extends AbstractCExtension {
return tcs;
}
- public static ITool[] getRealTools(){
+ public static ITool[] getRealTools() {
HashMap<MatchKey<Tool>, List<Tool>> map = getSortedTools();
Tool ts[] = new Tool[map.size()];
int i = 0;
@@ -4225,7 +4177,7 @@ public class ManagedBuildManager extends AbstractCExtension {
return ts;
}
- public static IBuilder[] getRealBuilders(){
+ public static IBuilder[] getRealBuilders() {
HashMap<MatchKey<Builder>, List<Builder>> map = getSortedBuilders();
IBuilder bs[] = new Builder[map.size()];
int i = 0;
@@ -4235,21 +4187,21 @@ public class ManagedBuildManager extends AbstractCExtension {
return bs;
}
- public static IBuilder getRealBuilder(IBuilder builder){
+ public static IBuilder getRealBuilder(IBuilder builder) {
IBuilder extBuilder = builder;
IBuilder realBuilder = null;
- for(;extBuilder != null && !extBuilder.isExtensionElement(); extBuilder = extBuilder.getSuperClass()) {
+ for (; extBuilder != null && !extBuilder.isExtensionElement(); extBuilder = extBuilder.getSuperClass()) {
// empty body
}
- if(extBuilder != null){
- List<Builder> list = findIdenticalElements((Builder)extBuilder, fBuilderSorter);
- if(list.size() == 0){
+ if (extBuilder != null) {
+ List<Builder> list = findIdenticalElements((Builder) extBuilder, fBuilderSorter);
+ if (list.size() == 0) {
realBuilder = extBuilder;
} else {
for (IBuilder realBldr : getRealBuilders()) {
- List<Builder> rList = findIdenticalElements((Builder)realBldr, fBuilderSorter);
- if(rList == list){
+ List<Builder> rList = findIdenticalElements((Builder) realBldr, fBuilderSorter);
+ if (rList == list) {
realBuilder = realBldr;
break;
}
@@ -4261,23 +4213,23 @@ public class ManagedBuildManager extends AbstractCExtension {
return realBuilder;
}
- public static ITool getRealTool(ITool tool){
- if(tool == null)
+ public static ITool getRealTool(ITool tool) {
+ if (tool == null)
return null;
ITool extTool = tool;
ITool realTool = null;
- for(;extTool != null && !extTool.isExtensionElement(); extTool= extTool.getSuperClass()) {
+ for (; extTool != null && !extTool.isExtensionElement(); extTool = extTool.getSuperClass()) {
// empty body
}
- if(extTool != null){
- List<Tool> list = findIdenticalElements((Tool)extTool, fToolSorter);
- if(list.size() == 0){
+ if (extTool != null) {
+ List<Tool> list = findIdenticalElements((Tool) extTool, fToolSorter);
+ if (list.size() == 0) {
realTool = extTool;
} else {
for (ITool realT : getRealTools()) {
- List<Tool> rList = findIdenticalElements((Tool)realT, fToolSorter);
- if(rList == list){
+ List<Tool> rList = findIdenticalElements((Tool) realT, fToolSorter);
+ if (rList == list) {
realTool = realT;
break;
}
@@ -4289,29 +4241,29 @@ public class ManagedBuildManager extends AbstractCExtension {
return realTool;
}
- public static IToolChain getExtensionToolChain(IToolChain tc){
+ public static IToolChain getExtensionToolChain(IToolChain tc) {
IToolChain extTc = tc;
- for(;extTc != null && !extTc.isExtensionElement(); extTc= extTc.getSuperClass()) {
+ for (; extTc != null && !extTc.isExtensionElement(); extTc = extTc.getSuperClass()) {
// empty body
}
return extTc;
}
- public static IToolChain getRealToolChain(IToolChain tc){
+ public static IToolChain getRealToolChain(IToolChain tc) {
IToolChain extTc = tc;
IToolChain realToolChain = null;
- for(;extTc != null && !extTc.isExtensionElement(); extTc= extTc.getSuperClass()) {
+ for (; extTc != null && !extTc.isExtensionElement(); extTc = extTc.getSuperClass()) {
// empty body
}
- if(extTc != null){
- List<ToolChain> list = findIdenticalElements((ToolChain)extTc, fToolChainSorter);
- if(list.size() == 0){
+ if (extTc != null) {
+ List<ToolChain> list = findIdenticalElements((ToolChain) extTc, fToolChainSorter);
+ if (list.size() == 0) {
realToolChain = extTc;
} else {
for (IToolChain realTc : getRealToolChains()) {
- List<ToolChain> rList = findIdenticalElements((ToolChain)realTc, fToolChainSorter);
- if(rList == list){
+ List<ToolChain> rList = findIdenticalElements((ToolChain) realTc, fToolChainSorter);
+ if (rList == list) {
realToolChain = realTc;
break;
}
@@ -4323,96 +4275,98 @@ public class ManagedBuildManager extends AbstractCExtension {
return realToolChain;
}
- public static IToolChain[] findIdenticalToolChains(IToolChain tc){
- List<ToolChain> list = findIdenticalElements((ToolChain)tc, fToolChainSorter);
+ public static IToolChain[] findIdenticalToolChains(IToolChain tc) {
+ List<ToolChain> list = findIdenticalElements((ToolChain) tc, fToolChainSorter);
return list.toArray(new ToolChain[list.size()]);
}
- public static ITool[] findIdenticalTools(ITool tool){
- List<Tool> list = findIdenticalElements((Tool)tool, fToolSorter);
+ public static ITool[] findIdenticalTools(ITool tool) {
+ List<Tool> list = findIdenticalElements((Tool) tool, fToolSorter);
return list.toArray(new Tool[list.size()]);
}
- public static IBuilder[] findIdenticalBuilders(IBuilder b){
- List<Builder> list = findIdenticalElements((Builder)b, fBuilderSorter);
+ public static IBuilder[] findIdenticalBuilders(IBuilder b) {
+ List<Builder> list = findIdenticalElements((Builder) b, fBuilderSorter);
return list.toArray(new Builder[list.size()]);
}
- public static IToolChain[] getExtensionsToolChains(String propertyType, String propertyValue){
+ public static IToolChain[] getExtensionsToolChains(String propertyType, String propertyValue) {
return getExtensionsToolChains(propertyType, propertyValue, true);
}
- public static IToolChain[] getExtensionsToolChains(String propertyType, String propertyValue, boolean supportedPropsOnly){
+ public static IToolChain[] getExtensionsToolChains(String propertyType, String propertyValue,
+ boolean supportedPropsOnly) {
HashMap<MatchKey<ToolChain>, List<ToolChain>> all = getSortedToolChains();
List<IToolChain> result = new ArrayList<IToolChain>();
for (List<ToolChain> list : all.values()) {
IToolChain tc = findToolChain(list, propertyType, propertyValue, supportedPropsOnly);
- if(tc != null)
+ if (tc != null)
result.add(tc);
}
return result.toArray(new ToolChain[result.size()]);
}
- public static void resortToolChains(){
+ public static void resortToolChains() {
fSortedToolChains = null;
getSortedToolChains();
}
- public static void resortTools(){
+ public static void resortTools() {
fSortedTools = null;
getSortedTools();
}
- public static void resortBuilders(){
+ public static void resortBuilders() {
fSortedBuilders = null;
getSortedBuilders();
}
- private static IToolChain findToolChain(List<ToolChain> list, String propertyType, String propertyValue, boolean supportedOnly){
+ private static IToolChain findToolChain(List<ToolChain> list, String propertyType, String propertyValue,
+ boolean supportedOnly) {
ToolChain bestMatch = null;
IConfiguration cfg = null;
IProjectType type = null;
boolean valueSupported = false;
- for(int i = 0; i < list.size(); i++){
+ for (int i = 0; i < list.size(); i++) {
ToolChain tc = list.get(i);
- if(tc.supportsValue(propertyType, propertyValue)){
+ if (tc.supportsValue(propertyType, propertyValue)) {
valueSupported = true;
- } else if (valueSupported){
+ } else if (valueSupported) {
continue;
}
- if(!tc.supportsBuild(true))
+ if (!tc.supportsBuild(true))
return null;
- if(bestMatch == null && valueSupported)
+ if (bestMatch == null && valueSupported)
bestMatch = tc;
IConfiguration tcCfg = tc.getParent();
- if(tcCfg != null){
- if(cfg == null && valueSupported){
+ if (tcCfg != null) {
+ if (cfg == null && valueSupported) {
bestMatch = tc;
cfg = tcCfg;
}
- IBuildObjectProperties props =tcCfg.getBuildProperties();
+ IBuildObjectProperties props = tcCfg.getBuildProperties();
IBuildProperty prop = props.getProperty(propertyType);
- if(valueSupported && prop != null && propertyValue.equals(prop.getValue().getId())){
+ if (valueSupported && prop != null && propertyValue.equals(prop.getValue().getId())) {
bestMatch = tc;
cfg = tcCfg;
}
IProjectType tcType = tcCfg.getProjectType();
- if(tcType != null){
- if(type == null && valueSupported){
+ if (tcType != null) {
+ if (type == null && valueSupported) {
type = tcType;
bestMatch = tc;
}
props = tcType.getBuildProperties();
prop = props.getProperty(propertyType);
- if(prop != null && propertyValue.equals(prop.getValue().getId())){
+ if (prop != null && propertyValue.equals(prop.getValue().getId())) {
bestMatch = tc;
- if(valueSupported){
+ if (valueSupported) {
type = tcType;
break;
}
@@ -4421,17 +4375,17 @@ public class ManagedBuildManager extends AbstractCExtension {
}
}
- if(valueSupported || ! supportedOnly)
+ if (valueSupported || !supportedOnly)
return bestMatch;
return null;
}
- private static <T extends BuildObject & IMatchKeyProvider<T>> List<T> findIdenticalElements(T p, ISorter sorter){
+ private static <T extends BuildObject & IMatchKeyProvider<T>> List<T> findIdenticalElements(T p, ISorter sorter) {
List<T> list = p.getIdenticalList();
- if(list == null){
+ if (list == null) {
sorter.sort();
list = p.getIdenticalList();
- if(list == null){
+ if (list == null) {
list = new ArrayList<T>(0);
p.setIdenticalList(list);
}
@@ -4440,9 +4394,7 @@ public class ManagedBuildManager extends AbstractCExtension {
return list;
}
-
-
- public static IBuildPropertyManager getBuildPropertyManager(){
+ public static IBuildPropertyManager getBuildPropertyManager() {
return BuildPropertyManager.getInstance();
}
@@ -4453,14 +4405,14 @@ public class ManagedBuildManager extends AbstractCExtension {
* @see CoreModelUtil#getReferencedConfigurationDescriptions(ICConfigurationDescription, boolean)
* @return an array of IConfiguration objects referenced by this IConfiguration
*/
- public static IConfiguration[] getReferencedConfigurations(IConfiguration config){
+ public static IConfiguration[] getReferencedConfigurations(IConfiguration config) {
ICConfigurationDescription cfgDes = getDescriptionForConfiguration(config);
- if(cfgDes != null){
- ICConfigurationDescription[] descs= CoreModelUtil.getReferencedConfigurationDescriptions(cfgDes, false);
+ if (cfgDes != null) {
+ ICConfigurationDescription[] descs = CoreModelUtil.getReferencedConfigurationDescriptions(cfgDes, false);
List<IConfiguration> result = new ArrayList<IConfiguration>();
for (ICConfigurationDescription desc : descs) {
IConfiguration cfg = getConfigurationForDescription(desc);
- if(cfg != null) {
+ if (cfg != null) {
result.add(cfg);
}
}
@@ -4475,7 +4427,7 @@ public class ManagedBuildManager extends AbstractCExtension {
* @param configs - configurations to build
* @param monitor - progress monitor
*/
- public static void buildConfigurations(IConfiguration[] configs, IProgressMonitor monitor) throws CoreException{
+ public static void buildConfigurations(IConfiguration[] configs, IProgressMonitor monitor) throws CoreException {
buildConfigurations(configs, null, monitor);
}
@@ -4485,7 +4437,8 @@ public class ManagedBuildManager extends AbstractCExtension {
* @param builder - builder to retrieve build arguments
* @param monitor - progress monitor
*/
- public static void buildConfigurations(IConfiguration[] configs, IBuilder builder, IProgressMonitor monitor) throws CoreException{
+ public static void buildConfigurations(IConfiguration[] configs, IBuilder builder, IProgressMonitor monitor)
+ throws CoreException {
buildConfigurations(configs, builder, monitor, true);
}
@@ -4498,7 +4451,8 @@ public class ManagedBuildManager extends AbstractCExtension {
* @param allBuilders - {@code true} if all builders need to be building
* or {@code false} to build with {@link CommonBuilder}
*/
- public static void buildConfigurations(IConfiguration[] configs, IBuilder builder, IProgressMonitor monitor, boolean allBuilders) throws CoreException{
+ public static void buildConfigurations(IConfiguration[] configs, IBuilder builder, IProgressMonitor monitor,
+ boolean allBuilders) throws CoreException {
buildConfigurations(configs, builder, monitor, allBuilders, IncrementalProjectBuilder.FULL_BUILD);
}
@@ -4518,7 +4472,7 @@ public class ManagedBuildManager extends AbstractCExtension {
* @since 7.0
*/
public static void buildConfigurations(IConfiguration[] configs, IBuilder builder, IProgressMonitor monitor,
- boolean allBuilders, int buildKind) throws CoreException{
+ boolean allBuilders, int buildKind) throws CoreException {
Map<IProject, IConfiguration[]> map = sortConfigs(configs);
for (Entry<IProject, IConfiguration[]> entry : map.entrySet()) {
@@ -4528,12 +4482,12 @@ public class ManagedBuildManager extends AbstractCExtension {
}
}
- private static Map<IProject, IConfiguration[]> sortConfigs(IConfiguration cfgs[]){
+ private static Map<IProject, IConfiguration[]> sortConfigs(IConfiguration cfgs[]) {
Map<IProject, Set<IConfiguration>> cfgSetMap = new HashMap<IProject, Set<IConfiguration>>();
for (IConfiguration cfg : cfgs) {
IProject proj = cfg.getOwner().getProject();
Set<IConfiguration> set = cfgSetMap.get(proj);
- if(set == null){
+ if (set == null) {
set = new HashSet<IConfiguration>();
cfgSetMap.put(proj, set);
}
@@ -4541,7 +4495,7 @@ public class ManagedBuildManager extends AbstractCExtension {
}
Map<IProject, IConfiguration[]> cfgArrayMap = new HashMap<IProject, IConfiguration[]>();
- if(cfgSetMap.size() != 0){
+ if (cfgSetMap.size() != 0) {
Set<Entry<IProject, Set<IConfiguration>>> entrySet = cfgSetMap.entrySet();
for (Entry<IProject, Set<IConfiguration>> entry : entrySet) {
IProject key = entry.getKey();
@@ -4570,7 +4524,8 @@ public class ManagedBuildManager extends AbstractCExtension {
* @throws CoreException
*/
private static void buildConfigurations(final IProject project, final IConfiguration[] configs,
- final IBuilder builder, final IProgressMonitor monitor, final boolean allBuilders, final int buildKind) throws CoreException{
+ final IBuilder builder, final IProgressMonitor monitor, final boolean allBuilders, final int buildKind)
+ throws CoreException {
IWorkspaceRunnable op = new IWorkspaceRunnable() {
/*
@@ -4581,16 +4536,16 @@ public class ManagedBuildManager extends AbstractCExtension {
@Override
public void run(IProgressMonitor monitor) throws CoreException {
int ticks = 1;
- if (buildKind==IncrementalProjectBuilder.CLEAN_BUILD) {
+ if (buildKind == IncrementalProjectBuilder.CLEAN_BUILD) {
if (allBuilders) {
ICommand[] commands = project.getDescription().getBuildSpec();
ticks = commands.length;
}
- ticks = ticks*configs.length;
+ ticks = ticks * configs.length;
}
monitor.beginTask(project.getName(), ticks);
- if (buildKind==IncrementalProjectBuilder.CLEAN_BUILD) {
+ 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);
@@ -4609,7 +4564,7 @@ public class ManagedBuildManager extends AbstractCExtension {
}
} else {
// configuration IDs are passed in args to CDT builder
- Map<String, String> args = builder!=null ? BuilderFactory.createBuildArgs(configs, builder)
+ Map<String, String> args = builder != null ? BuilderFactory.createBuildArgs(configs, builder)
: BuilderFactory.createBuildArgs(configs);
buildProject(project, args, allBuilders, buildKind, monitor);
}
@@ -4617,8 +4572,8 @@ public class ManagedBuildManager extends AbstractCExtension {
monitor.done();
}
- private void buildProject(IProject project, Map<String, String> args, boolean allBuilders, int buildKind, IProgressMonitor monitor)
- throws CoreException {
+ private void buildProject(IProject project, Map<String, String> args, boolean allBuilders, int buildKind,
+ IProgressMonitor monitor) throws CoreException {
if (allBuilders) {
ICommand[] commands = project.getDescription().getBuildSpec();
@@ -4628,7 +4583,7 @@ public class ManagedBuildManager extends AbstractCExtension {
String builderName = command.getBuilderName();
Map<String, String> newArgs = null;
- if (buildKind!=IncrementalProjectBuilder.CLEAN_BUILD) {
+ if (buildKind != IncrementalProjectBuilder.CLEAN_BUILD) {
newArgs = new HashMap<String, String>(args);
if (!builderName.equals(CommonBuilder.BUILDER_ID)) {
newArgs.putAll(command.getArguments());
@@ -4649,26 +4604,29 @@ public class ManagedBuildManager extends AbstractCExtension {
}
}
- public static IBuilder getInternalBuilder(){
+ public static IBuilder getInternalBuilder() {
return getExtensionBuilder(INTERNAL_BUILDER_ID);
}
- public static ITool getExtensionTool(ITool tool){
+ public static ITool getExtensionTool(ITool tool) {
ITool extTool = tool;
- for(;extTool != null && !extTool.isExtensionElement(); extTool = extTool.getSuperClass()) {}
+ for (; extTool != null && !extTool.isExtensionElement(); extTool = extTool.getSuperClass()) {
+ }
return extTool;
}
- public static IInputType getExtensionInputType(IInputType inType){
+ public static IInputType getExtensionInputType(IInputType inType) {
IInputType extIT = inType;
- for(;extIT != null && !extIT.isExtensionElement(); extIT = extIT.getSuperClass()) {}
+ for (; extIT != null && !extIT.isExtensionElement(); extIT = extIT.getSuperClass()) {
+ }
return extIT;
}
- public static IConfiguration getPreferenceConfiguration(boolean write){
+ public static IConfiguration getPreferenceConfiguration(boolean write) {
try {
- ICConfigurationDescription des = CCorePlugin.getDefault().getPreferenceConfiguration(CFG_DATA_PROVIDER_ID, write);
- if(des != null)
+ ICConfigurationDescription des = CCorePlugin.getDefault().getPreferenceConfiguration(CFG_DATA_PROVIDER_ID,
+ write);
+ if (des != null)
return getConfigurationForDescription(des);
} catch (CoreException e) {
ManagedBuilderCorePlugin.log(e);
@@ -4676,13 +4634,13 @@ public class ManagedBuildManager extends AbstractCExtension {
return null;
}
- public static void setPreferenceConfiguration(IConfiguration cfg) throws CoreException{
+ public static void setPreferenceConfiguration(IConfiguration cfg) throws CoreException {
ICConfigurationDescription des = getDescriptionForConfiguration(cfg);
- if(des != null)
+ if (des != null)
CCorePlugin.getDefault().setPreferenceConfiguration(CFG_DATA_PROVIDER_ID, des);
}
- static synchronized void updateLoaddedInfo(IProject fromProject, IProject toProject, IManagedBuildInfo info){
+ static synchronized void updateLoaddedInfo(IProject fromProject, IProject toProject, IManagedBuildInfo info) {
try {
setLoaddedBuildInfo(fromProject, null);
setLoaddedBuildInfo(toProject, info);
@@ -4693,7 +4651,7 @@ public class ManagedBuildManager extends AbstractCExtension {
/**
* entry-point for the tool-chain modification validation functionality
*/
- public static IToolChainModificationManager getToolChainModificationManager(){
+ public static IToolChainModificationManager getToolChainModificationManager() {
return ToolChainModificationManager.getInstance();
}
@@ -4712,9 +4670,11 @@ public class ManagedBuildManager extends AbstractCExtension {
return true; // no target platform - nothing to check.
}
- /*package*/ static void collectLanguageSettingsConsoleParsers(ICConfigurationDescription cfgDescription, IWorkingDirectoryTracker cwdTracker, List<IConsoleParser> parsers) {
+ /*package*/ static void collectLanguageSettingsConsoleParsers(ICConfigurationDescription cfgDescription,
+ IWorkingDirectoryTracker cwdTracker, List<IConsoleParser> parsers) {
if (cfgDescription instanceof ILanguageSettingsProvidersKeeper) {
- List<ILanguageSettingsProvider> lsProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> lsProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
for (ILanguageSettingsProvider lsProvider : lsProviders) {
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(lsProvider);
if (rawProvider instanceof ICBuildOutputParser) {
@@ -4733,7 +4693,7 @@ public class ManagedBuildManager extends AbstractCExtension {
/**
* Generic routine for checking the availability of converters for the given list of Build Objects.
- *
+ *
* @return true if there are converters for at least one object in the given list of Build Objects.
* Returns false if there are no converters.
* @since 8.1
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java
index 96165c8e6b8..07f110d471b 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java
@@ -36,7 +36,6 @@ import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
import org.osgi.framework.BundleContext;
-
/**
* ManagedBuilderCorePlugin is the life-cycle owner of the managedbuilder core plug-in.
*
@@ -49,17 +48,18 @@ public class ManagedBuilderCorePlugin extends Plugin {
// The shared instance
private static ManagedBuilderCorePlugin plugin;
// The attribute name for the makefile generator
- public static final String MAKEGEN_ID ="makefileGenerator"; //$NON-NLS-1$
+ public static final String MAKEGEN_ID = "makefileGenerator"; //$NON-NLS-1$
public static final String COMMANDLINEGEN_ID = "commandlineGenerator"; //$NON-NLS-1$
// The unique id for all managed make projects
- public static final String MANAGED_MAKE_PROJECT_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".managedMake"; //$NON-NLS-1$
+ public static final String MANAGED_MAKE_PROJECT_ID = ManagedBuilderCorePlugin.getUniqueIdentifier()
+ + ".managedMake"; //$NON-NLS-1$
// NOTE: The code below is for tracking resource renaming and deleting. This is needed to keep
// ResourceConfiguration elements up to date. It may also be needed by AdditionalInput
// elements
private static ResourceChangeHandler2 listener;
-// private DiscoveredPathManager fDiscoveryPathManager;
+ // private DiscoveredPathManager fDiscoveryPathManager;
public ManagedBuilderCorePlugin() {
super();
@@ -92,62 +92,58 @@ public class ManagedBuilderCorePlugin extends Plugin {
super.start(context);
configurePluginDebugOptions();
-
// NOTE: The code below is for tracking resource renaming and deleting. This is needed to keep
// ResourceConfiguration elements up to date. It may also be needed by AdditionalInput
// elements
-// IJobManager jobManager = Platform.getJobManager();
-// IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ // IJobManager jobManager = Platform.getJobManager();
+ // IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
listener = new ResourceChangeHandler2();
- ResourcesPlugin.getWorkspace().addResourceChangeListener(
- listener,
- IResourceChangeEvent.POST_CHANGE
- | IResourceChangeEvent.PRE_DELETE
- | IResourceChangeEvent.PRE_CLOSE
- /*| IResourceChangeEvent.POST_BUILD*/);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(listener,
+ IResourceChangeEvent.POST_CHANGE | IResourceChangeEvent.PRE_DELETE | IResourceChangeEvent.PRE_CLOSE
+ /*| IResourceChangeEvent.POST_BUILD*/);
BuildStateManager.getInstance().startup();
-/* try {
- jobManager.beginRule(root, null);
-
- startResourceChangeHandling();
- } catch (Throwable e) {
- //either an IllegalArgumentException is thrown by the jobManager.beginRule
- //or core exception is thrown by the startResourceChangeHandling()
- //in any case, schedule a job with the root rule
- //that will perform the resource change handling initialization
-*/
+ /* try {
+ jobManager.beginRule(root, null);
+
+ startResourceChangeHandling();
+ } catch (Throwable e) {
+ //either an IllegalArgumentException is thrown by the jobManager.beginRule
+ //or core exception is thrown by the startResourceChangeHandling()
+ //in any case, schedule a job with the root rule
+ //that will perform the resource change handling initialization
+ */
//The startResourceChangeHandling() might result in throwing an error
//see bug# 132001
//Always schedule a job
-// Job rcJob = new Job(ManagedMakeMessages.getResourceString("ManagedBuilderCorePlugin.resourceChangeHandlingInitializationJob")){ //$NON-NLS-1$
-// protected IStatus run(IProgressMonitor monitor) {
-// try{
-// startResourceChangeHandling();
-// } catch (CoreException e){
-// CCorePlugin.log(e);
-// return e.getStatus();
-// }
-// return new Status(
-// IStatus.OK,
-// ManagedBuilderCorePlugin.getUniqueIdentifier(),
-// IStatus.OK,
-// "", //$NON-NLS-1$
-// null);
-// }
-// };
-//
-// rcJob.setRule(root);
-// rcJob.setPriority(Job.INTERACTIVE);
-// rcJob.setSystem(true);
-// rcJob.schedule();
-/*
- } finally {
- jobManager.endRule(root);
- }
-*/
+ // Job rcJob = new Job(ManagedMakeMessages.getResourceString("ManagedBuilderCorePlugin.resourceChangeHandlingInitializationJob")){ //$NON-NLS-1$
+ // protected IStatus run(IProgressMonitor monitor) {
+ // try{
+ // startResourceChangeHandling();
+ // } catch (CoreException e){
+ // CCorePlugin.log(e);
+ // return e.getStatus();
+ // }
+ // return new Status(
+ // IStatus.OK,
+ // ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ // IStatus.OK,
+ // "", //$NON-NLS-1$
+ // null);
+ // }
+ // };
+ //
+ // rcJob.setRule(root);
+ // rcJob.setPriority(Job.INTERACTIVE);
+ // rcJob.setSystem(true);
+ // rcJob.schedule();
+ /*
+ } finally {
+ jobManager.endRule(root);
+ }
+ */
}
/*
@@ -155,23 +151,23 @@ public class ManagedBuilderCorePlugin extends Plugin {
* Throws CoreException if the methods fails to add a save participant.
* The resource change listener in not added in this case either.
*/
-// private void startResourceChangeHandling() throws CoreException{
-// // Set up a listener for resource change events
-// listener = new ResourceChangeHandler();
-// ISavedState lastState =
-// ResourcesPlugin.getWorkspace().addSaveParticipant(ManagedBuilderCorePlugin.this, listener);
-//
-// ResourcesPlugin.getWorkspace().addResourceChangeListener(
-// listener,
-// IResourceChangeEvent.POST_CHANGE
-// | IResourceChangeEvent.PRE_DELETE
-// | IResourceChangeEvent.PRE_CLOSE
-// /*| IResourceChangeEvent.POST_BUILD*/);
-//
-// if (lastState != null) {
-// lastState.processResourceChangeEvents(listener);
-// }
-// }
+ // private void startResourceChangeHandling() throws CoreException{
+ // // Set up a listener for resource change events
+ // listener = new ResourceChangeHandler();
+ // ISavedState lastState =
+ // ResourcesPlugin.getWorkspace().addSaveParticipant(ManagedBuilderCorePlugin.this, listener);
+ //
+ // ResourcesPlugin.getWorkspace().addResourceChangeListener(
+ // listener,
+ // IResourceChangeEvent.POST_CHANGE
+ // | IResourceChangeEvent.PRE_DELETE
+ // | IResourceChangeEvent.PRE_CLOSE
+ // /*| IResourceChangeEvent.POST_BUILD*/);
+ //
+ // if (lastState != null) {
+ // lastState.processResourceChangeEvents(listener);
+ // }
+ // }
/* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
@@ -181,12 +177,10 @@ public class ManagedBuilderCorePlugin extends Plugin {
BuildStateManager.getInstance().shutdown();
CfgDiscoveredPathManager.stop();
-// if (fDiscoveryPathManager != null) {
-// fDiscoveryPathManager.shutdown();
-// fDiscoveryPathManager = null;
-// }
-
-
+ // if (fDiscoveryPathManager != null) {
+ // fDiscoveryPathManager.shutdown();
+ // fDiscoveryPathManager = null;
+ // }
// NOTE: The code below is for tracking resource renaming and deleting. This is needed to keep
// ResourceConfiguration elements up to date. It may also be needed by AdditionalInput
@@ -201,7 +195,8 @@ public class ManagedBuilderCorePlugin extends Plugin {
}
private static final String PATH_ENTRY = ManagedBuilderCorePlugin.getUniqueIdentifier() + "/debug/pathEntry"; //$NON-NLS-1$
- private static final String PATH_ENTRY_INIT = ManagedBuilderCorePlugin.getUniqueIdentifier() + "/debug/pathEntryInit"; //$NON-NLS-1$
+ private static final String PATH_ENTRY_INIT = ManagedBuilderCorePlugin.getUniqueIdentifier()
+ + "/debug/pathEntryInit"; //$NON-NLS-1$
private static final String BUILDER = ManagedBuilderCorePlugin.getUniqueIdentifier() + "/debug/builder"; //$NON-NLS-1$
private static final String BUILD_MODEL = ManagedBuilderCorePlugin.getUniqueIdentifier() + "/debug/buildModel"; //$NON-NLS-1$
@@ -214,7 +209,8 @@ public class ManagedBuilderCorePlugin extends Plugin {
e = ((InvocationTargetException) e).getTargetException();
IStatus status = null;
if (e instanceof CoreException)
- status = new Status(((CoreException) e).getStatus().getSeverity(), getUniqueIdentifier(), e.getMessage(), e);
+ status = new Status(((CoreException) e).getStatus().getSeverity(), getUniqueIdentifier(), e.getMessage(),
+ e);
else
status = new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.OK, e.getMessage(), e);
log(status);
@@ -245,44 +241,45 @@ public class ManagedBuilderCorePlugin extends Plugin {
if (isDebugging()) {
String pathInit = Platform.getDebugOption(PATH_ENTRY_INIT);
if (pathInit != null) {
- ManagedBuildPathEntryContainerInitializer.VERBOSE = pathInit.equalsIgnoreCase("true") ; //$NON-NLS-1$
+ ManagedBuildPathEntryContainerInitializer.VERBOSE = pathInit.equalsIgnoreCase("true"); //$NON-NLS-1$
}
String pathCalc = Platform.getDebugOption(PATH_ENTRY);
if (pathCalc != null) {
- ManagedBuildCPathEntryContainer.VERBOSE = pathCalc.equalsIgnoreCase("true") ; //$NON-NLS-1$
+ ManagedBuildCPathEntryContainer.VERBOSE = pathCalc.equalsIgnoreCase("true"); //$NON-NLS-1$
}
String builder = Platform.getDebugOption(BUILDER);
if (builder != null) {
- GeneratedMakefileBuilder.VERBOSE = builder.equalsIgnoreCase("true") ; //$NON-NLS-1$
+ GeneratedMakefileBuilder.VERBOSE = builder.equalsIgnoreCase("true"); //$NON-NLS-1$
}
String buildModel = Platform.getDebugOption(BUILD_MODEL);
- if(buildModel != null){
+ if (buildModel != null) {
DbgUtil.DEBUG = buildModel.equalsIgnoreCase("true"); //$NON-NLS-1$
}
}
}
- public static IBuilder[] createBuilders(IProject project, Map<String, String> args){
+ public static IBuilder[] createBuilders(IProject project, Map<String, String> args) {
return BuilderFactory.createBuilders(project, args);
}
- public static IBuilder createCustomBuilder(IConfiguration cfg, String builderId) throws CoreException{
+ public static IBuilder createCustomBuilder(IConfiguration cfg, String builderId) throws CoreException {
return BuilderFactory.createCustomBuilder(cfg, builderId);
}
- public static IBuilder createCustomBuilder(IConfiguration cfg, IBuilder base){
+ public static IBuilder createCustomBuilder(IConfiguration cfg, IBuilder base) {
return BuilderFactory.createCustomBuilder(cfg, base);
}
- public static IBuilder createBuilderForEclipseBuilder(IConfiguration cfg, String eclipseBuilderID) throws CoreException {
+ public static IBuilder createBuilderForEclipseBuilder(IConfiguration cfg, String eclipseBuilderID)
+ throws CoreException {
return BuilderFactory.createBuilderForEclipseBuilder(cfg, eclipseBuilderID);
}
- public boolean isOldStyleMakeProject(IProject project){
+ public boolean isOldStyleMakeProject(IProject project) {
return ProjectConverter.isOldStyleMakeProject(project);
}
- public void convertOldStdMakeToNewStyle(IProject project, IProgressMonitor monitor) throws CoreException{
+ public void convertOldStdMakeToNewStyle(IProject project, IProgressMonitor monitor) throws CoreException {
ProjectConverter.convertOldStdMakeToNewStyle(project, monitor);
}
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 1bf070f16cf..a46c0c8a481 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
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.core;
-
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -36,7 +35,7 @@ import org.eclipse.core.runtime.Plugin;
public class ManagedCProjectNature implements IProjectNature {
public static final String BUILDER_NAME = "genmakebuilder"; //$NON-NLS-1$
public static final String BUILDER_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + "." + BUILDER_NAME; //$NON-NLS-1$
- public static final String MNG_NATURE_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".managedBuildNature"; //$NON-NLS-1$
+ public static final String MNG_NATURE_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".managedBuildNature"; //$NON-NLS-1$
private IProject project;
/**
@@ -63,7 +62,7 @@ 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;
}
@@ -73,21 +72,21 @@ public class ManagedCProjectNature implements IProjectNature {
boolean found = false;
// See if the builder is already there
for (int i = 0; i < commands.length; ++i) {
- if (commands[i].getBuilderName().equals(getBuilderID())) {
- found = true;
- break;
- }
+ if (commands[i].getBuilderName().equals(getBuilderID())) {
+ found = true;
+ break;
+ }
}
if (!found) {
- //add builder to project
- ICommand command = description.newCommand();
- command.setBuilderName(getBuilderID());
- ICommand[] newCommands = new ICommand[commands.length + 1];
- // Add it before other builders.
- System.arraycopy(commands, 0, newCommands, 1, commands.length);
- newCommands[0] = command;
- description.setBuildSpec(newCommands);
- project.setDescription(description, null);
+ //add builder to project
+ ICommand command = description.newCommand();
+ command.setBuilderName(getBuilderID());
+ ICommand[] newCommands = new ICommand[commands.length + 1];
+ // Add it before other builders.
+ System.arraycopy(commands, 0, newCommands, 1, commands.length);
+ newCommands[0] = command;
+ description.setBuildSpec(newCommands);
+ project.setDescription(description, null);
}
}
@@ -189,7 +188,6 @@ public class ManagedCProjectNature implements IProjectNature {
return project;
}
-
/**
* Utility method to remove the managed nature from a 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 7a52ef6b538..b6945baff5e 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
@@ -17,13 +17,11 @@ package org.eclipse.cdt.managedbuilder.core;
import java.util.Arrays;
import java.util.List;
-
/**
* This class implements the default managed option value handler for MBS.
* It is also be intended to be used as a base class for other value handlers.
*/
-public class ManagedOptionValueHandler implements
- IManagedOptionValueHandler {
+public class ManagedOptionValueHandler implements IManagedOptionValueHandler {
/*
* E N A B L E U S E A S B A S E C L A S S A N D
@@ -37,7 +35,7 @@ public class ManagedOptionValueHandler implements
}
public static ManagedOptionValueHandler getManagedOptionValueHandler() {
- if( mbsValueHandler == null ) {
+ if (mbsValueHandler == null) {
mbsValueHandler = new ManagedOptionValueHandler();
}
return mbsValueHandler;
@@ -51,11 +49,8 @@ public class ManagedOptionValueHandler implements
* @see org.eclipse.cdt.managedbuilder.core.IManagedOptionValueHandler#handleValue(IConfiguration,IToolChain,IOption,String,int)
*/
@Override
- public boolean handleValue(IBuildObject configuration,
- IHoldsOptions holder,
- IOption option,
- String extraArgument, int event)
- {
+ public boolean handleValue(IBuildObject configuration, IHoldsOptions holder, IOption option, String extraArgument,
+ int event) {
/*
// The following is for debug purposes and thus normally commented out
String configLabel = "???"; //$NON-NLS-1$
@@ -91,7 +86,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;
}
@@ -100,7 +95,8 @@ public class ManagedOptionValueHandler implements
* @see org.eclipse.cdt.managedbuilder.core.IManagedOptionValueHandler#isDefaultValue(IConfiguration,IToolChain,IOption,String)
*/
@Override
- public boolean isDefaultValue(IBuildObject configuration, IHoldsOptions holder, IOption option, String extraArgument) {
+ public boolean isDefaultValue(IBuildObject configuration, IHoldsOptions holder, IOption option,
+ String extraArgument) {
// Get the default Value
Object defaultValue = option.getDefaultValue();
if (defaultValue instanceof List) {
@@ -112,63 +108,63 @@ public class ManagedOptionValueHandler implements
try {
// Figure out which type the option is and implement default behaviour for it.
switch (option.getValueType()) {
- case IOption.STRING:
- if (option.getStringValue().equals(defaultValue)) {
- return true;
- }
- break;
- case IOption.BOOLEAN:
- if (option.getBooleanValue() == ((Boolean)defaultValue).booleanValue()) {
- return true;
- }
- break;
- case IOption.ENUMERATED:
- case IOption.TREE:
- if (option.getValue().toString().equals(defaultValue.toString())) {
- return true;
- }
- break;
- case IOption.INCLUDE_PATH:
- case IOption.UNDEF_INCLUDE_PATH:
- if (Arrays.equals(option.getBasicStringListValue(), (String[])defaultValue)) {
- return true;
- }
- break;
- case IOption.STRING_LIST:
- if (Arrays.equals(option.getStringListValue(), (String[])defaultValue)) {
- return true;
- }
- break;
- case IOption.PREPROCESSOR_SYMBOLS:
- case IOption.UNDEF_PREPROCESSOR_SYMBOLS:
- if (Arrays.equals(option.getBasicStringListValue(), (String[])defaultValue)) {
- return true;
- }
- break;
- case IOption.LIBRARIES:
- if (Arrays.equals(option.getLibraries(), (String[])defaultValue)) {
- return true;
- }
- break;
- case IOption.OBJECTS:
- if (Arrays.equals(option.getUserObjects(), (String[])defaultValue)) {
- return true;
- }
- break;
- case IOption.INCLUDE_FILES:
- case IOption.LIBRARY_PATHS:
- case IOption.LIBRARY_FILES:
- case IOption.MACRO_FILES:
- case IOption.UNDEF_INCLUDE_FILES:
- case IOption.UNDEF_LIBRARY_PATHS:
- case IOption.UNDEF_LIBRARY_FILES:
- case IOption.UNDEF_MACRO_FILES:
- default:
- if (Arrays.equals(option.getBasicStringListValue(), (String[])defaultValue)) {
- return true;
- }
- break;
+ case IOption.STRING:
+ if (option.getStringValue().equals(defaultValue)) {
+ return true;
+ }
+ break;
+ case IOption.BOOLEAN:
+ if (option.getBooleanValue() == ((Boolean) defaultValue).booleanValue()) {
+ return true;
+ }
+ break;
+ case IOption.ENUMERATED:
+ case IOption.TREE:
+ if (option.getValue().toString().equals(defaultValue.toString())) {
+ return true;
+ }
+ break;
+ case IOption.INCLUDE_PATH:
+ case IOption.UNDEF_INCLUDE_PATH:
+ if (Arrays.equals(option.getBasicStringListValue(), (String[]) defaultValue)) {
+ return true;
+ }
+ break;
+ case IOption.STRING_LIST:
+ if (Arrays.equals(option.getStringListValue(), (String[]) defaultValue)) {
+ return true;
+ }
+ break;
+ case IOption.PREPROCESSOR_SYMBOLS:
+ case IOption.UNDEF_PREPROCESSOR_SYMBOLS:
+ if (Arrays.equals(option.getBasicStringListValue(), (String[]) defaultValue)) {
+ return true;
+ }
+ break;
+ case IOption.LIBRARIES:
+ if (Arrays.equals(option.getLibraries(), (String[]) defaultValue)) {
+ return true;
+ }
+ break;
+ case IOption.OBJECTS:
+ if (Arrays.equals(option.getUserObjects(), (String[]) defaultValue)) {
+ return true;
+ }
+ break;
+ case IOption.INCLUDE_FILES:
+ case IOption.LIBRARY_PATHS:
+ case IOption.LIBRARY_FILES:
+ case IOption.MACRO_FILES:
+ case IOption.UNDEF_INCLUDE_FILES:
+ case IOption.UNDEF_LIBRARY_PATHS:
+ case IOption.UNDEF_LIBRARY_FILES:
+ case IOption.UNDEF_MACRO_FILES:
+ default:
+ if (Arrays.equals(option.getBasicStringListValue(), (String[]) defaultValue)) {
+ return true;
}
+ break;
+ }
} catch (BuildException e) {
}
return false;
@@ -178,11 +174,8 @@ public class ManagedOptionValueHandler implements
* @see org.eclipse.cdt.managedbuilder.core.IManagedOptionValueHandler#isEnumValueAppropriate(IConfiguration,IToolChain,IOption,String,String)
*/
@Override
- public boolean isEnumValueAppropriate(IBuildObject configuration,
- IHoldsOptions holder,
- IOption option,
- String extraArgument, String enumValue)
- {
+ public boolean isEnumValueAppropriate(IBuildObject configuration, IHoldsOptions holder, IOption option,
+ String extraArgument, String enumValue) {
// By default return true for all the enum values.
return true;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/OptionStringValue.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/OptionStringValue.java
index d4ff7520d8d..c5ffdabefe3 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/OptionStringValue.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/OptionStringValue.java
@@ -21,7 +21,7 @@ import org.eclipse.cdt.internal.core.SafeStringInterner;
import org.eclipse.cdt.managedbuilder.internal.core.Option;
public final class OptionStringValue {
- private static final String ATTR_SRC_PATH = "srcPath"; //$NON-NLS-1$
+ private static final String ATTR_SRC_PATH = "srcPath"; //$NON-NLS-1$
private static final String ATTR_SRC_ROOT_PATH = "srcRootPath"; //$NON-NLS-1$
private static final String ATTR_SRC_PREFIX_MAPPING = "srcPrefixMapping"; //$NON-NLS-1$
@@ -30,8 +30,8 @@ public final class OptionStringValue {
private String srcRootPath;
private String srcPrefixMapping;
private boolean isBuiltIn;
-
- public OptionStringValue(ICStorageElement el){
+
+ public OptionStringValue(ICStorageElement el) {
if (el.getAttribute(Option.LIST_ITEM_BUILTIN) != null) {
isBuiltIn = Boolean.valueOf(el.getAttribute(Option.LIST_ITEM_BUILTIN)).booleanValue();
} else {
@@ -41,11 +41,11 @@ public final class OptionStringValue {
srcPath = el.getAttribute(ATTR_SRC_PATH);
srcRootPath = el.getAttribute(ATTR_SRC_ROOT_PATH);
srcPrefixMapping = el.getAttribute(ATTR_SRC_PREFIX_MAPPING);
- if(value == null)
+ if (value == null)
value = Option.EMPTY_STRING;
}
- public OptionStringValue(IManagedConfigElement el){
+ public OptionStringValue(IManagedConfigElement el) {
if (el.getAttribute(Option.LIST_ITEM_BUILTIN) != null) {
isBuiltIn = Boolean.valueOf(el.getAttribute(Option.LIST_ITEM_BUILTIN)).booleanValue();
} else {
@@ -55,11 +55,11 @@ public final class OptionStringValue {
srcPath = SafeStringInterner.safeIntern(el.getAttribute(ATTR_SRC_PATH));
srcRootPath = SafeStringInterner.safeIntern(el.getAttribute(ATTR_SRC_ROOT_PATH));
srcPrefixMapping = SafeStringInterner.safeIntern(el.getAttribute(ATTR_SRC_PREFIX_MAPPING));
- if(value == null)
+ if (value == null)
value = Option.EMPTY_STRING;
}
- public OptionStringValue(OptionStringValue base){
+ public OptionStringValue(OptionStringValue base) {
isBuiltIn = base.isBuiltIn;
value = base.value;
srcPath = base.srcPath;
@@ -67,19 +67,20 @@ public final class OptionStringValue {
srcPrefixMapping = base.srcPrefixMapping;
}
- public OptionStringValue(String value){
+ public OptionStringValue(String value) {
this(value, false);
}
- public OptionStringValue(String value, boolean isBuiltIn){
+ public OptionStringValue(String value, boolean isBuiltIn) {
this(value, isBuiltIn, null, null, null);
}
/**
* source path settings are applicable for the {@link IOption#LIBRARY_FILES} only
*/
- public OptionStringValue(String value, boolean isBuiltIn, String srcPath, String srcRootPath, String srcPrefixMapping){
- if(value == null)
+ public OptionStringValue(String value, boolean isBuiltIn, String srcPath, String srcRootPath,
+ String srcPrefixMapping) {
+ if (value == null)
value = Option.EMPTY_STRING;
this.isBuiltIn = isBuiltIn;
this.value = value;
@@ -87,91 +88,91 @@ public final class OptionStringValue {
this.srcRootPath = srcRootPath;
this.srcPrefixMapping = srcPrefixMapping;
}
-
- public void serialize(ICStorageElement el){
+
+ public void serialize(ICStorageElement el) {
el.setAttribute(Option.LIST_ITEM_VALUE, value);
el.setAttribute(Option.LIST_ITEM_BUILTIN, Boolean.toString(isBuiltIn));
- if(srcPath != null)
+ if (srcPath != null)
el.setAttribute(ATTR_SRC_PATH, srcPath);
- if(srcRootPath != null)
+ if (srcRootPath != null)
el.setAttribute(ATTR_SRC_ROOT_PATH, srcRootPath);
- if(srcPrefixMapping != null)
+ if (srcPrefixMapping != null)
el.setAttribute(ATTR_SRC_PREFIX_MAPPING, srcPrefixMapping);
}
- public boolean isBuiltIn(){
+ public boolean isBuiltIn() {
return isBuiltIn;
}
-
- public String getValue(){
+
+ public String getValue() {
return value;
}
/**
* source attachment settings are applicable for the {@link IOption#LIBRARY_FILES} only
- * added to fully support the {@link ICLibraryFileEntry} settings
- *
+ * added to fully support the {@link ICLibraryFileEntry} settings
+ *
* @see ICLibraryFileEntry
* @see ICLibraryFileEntry#getSourceAttachmentPath()
* @see ICLibraryFileEntry#getSourceAttachmentRootPath()
* @see ICLibraryFileEntry#getSourceAttachmentPrefixMapping()
- *
+ *
*/
- public String getSourceAttachmentPath(){
+ public String getSourceAttachmentPath() {
return srcPath;
}
/**
* source attachment settings are applicable for the {@link IOption#LIBRARY_FILES} only
- * added to fully support the {@link ICLibraryFileEntry} settings
- *
+ * added to fully support the {@link ICLibraryFileEntry} settings
+ *
* @see ICLibraryFileEntry
* @see ICLibraryFileEntry#getSourceAttachmentPath()
* @see ICLibraryFileEntry#getSourceAttachmentRootPath()
* @see ICLibraryFileEntry#getSourceAttachmentPrefixMapping()
- *
+ *
*/
- public String getSourceAttachmentRootPath(){
+ public String getSourceAttachmentRootPath() {
return srcRootPath;
}
/**
* source attachment settings are applicable for the {@link IOption#LIBRARY_FILES} only
- * added to fully support the {@link ICLibraryFileEntry} settings
- *
+ * added to fully support the {@link ICLibraryFileEntry} settings
+ *
* @see ICLibraryFileEntry
* @see ICLibraryFileEntry#getSourceAttachmentPath()
* @see ICLibraryFileEntry#getSourceAttachmentRootPath()
* @see ICLibraryFileEntry#getSourceAttachmentPrefixMapping()
- *
+ *
*/
- public String getSourceAttachmentPrefixMapping(){
+ public String getSourceAttachmentPrefixMapping() {
return srcPrefixMapping;
}
@Override
public boolean equals(Object obj) {
- if(obj == this)
+ if (obj == this)
return true;
-
- if(!(obj instanceof OptionStringValue))
+
+ if (!(obj instanceof OptionStringValue))
return false;
-
- OptionStringValue other = (OptionStringValue)obj;
-
- if(isBuiltIn != other.isBuiltIn)
+
+ OptionStringValue other = (OptionStringValue) obj;
+
+ if (isBuiltIn != other.isBuiltIn)
return false;
-
- if(!CDataUtil.objectsEqual(value, other.value))
+
+ if (!CDataUtil.objectsEqual(value, other.value))
return false;
- if(!CDataUtil.objectsEqual(srcPath, other.srcPath))
+ if (!CDataUtil.objectsEqual(srcPath, other.srcPath))
return false;
- if(!CDataUtil.objectsEqual(srcRootPath, other.srcRootPath))
+ if (!CDataUtil.objectsEqual(srcRootPath, other.srcRootPath))
return false;
- if(!CDataUtil.objectsEqual(srcPrefixMapping, other.srcPrefixMapping))
+ if (!CDataUtil.objectsEqual(srcPrefixMapping, other.srcPrefixMapping))
return false;
return true;
@@ -181,8 +182,8 @@ public final class OptionStringValue {
public int hashCode() {
return code(value);
}
-
- private static int code(String str){
+
+ private static int code(String str) {
return str != null ? str.hashCode() : 0;
}
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 58e27e161a0..7e169c859b7 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
@@ -38,7 +38,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
-class ResourceChangeHandler2 extends ResourceChangeHandlerBase{
+class ResourceChangeHandler2 extends ResourceChangeHandlerBase {
private class RcMoveHandler implements IResourceMoveHandler {
@Override
@@ -56,12 +56,12 @@ class ResourceChangeHandler2 extends ResourceChangeHandlerBase{
@Override
public boolean handleResourceMove(IResource fromRc, IResource toRc) {
- switch(fromRc.getType()){
+ switch (fromRc.getType()) {
case IResource.PROJECT:
IProject fromProject = fromRc.getProject();
IProject toProject = toRc.getProject();
- ManagedBuildInfo info = (ManagedBuildInfo)ManagedBuildManager.getBuildInfo(fromProject, false);
- if(info != null){
+ ManagedBuildInfo info = (ManagedBuildInfo) ManagedBuildManager.getBuildInfo(fromProject, false);
+ if (info != null) {
info.updateOwner(toRc);
ManagedBuildManager.updateLoaddedInfo(fromProject, toProject, info);
}
@@ -71,7 +71,7 @@ class ResourceChangeHandler2 extends ResourceChangeHandlerBase{
@Override
public boolean handleResourceRemove(IResource rc) {
- switch(rc.getType()){
+ switch (rc.getType()) {
case IResource.PROJECT:
IProject project = rc.getProject();
sendClose(project);
@@ -85,22 +85,21 @@ class ResourceChangeHandler2 extends ResourceChangeHandlerBase{
}
@Override
- protected IResourceMoveHandler createResourceMoveHandler(
- IResourceChangeEvent event) {
+ protected IResourceMoveHandler createResourceMoveHandler(IResourceChangeEvent event) {
return new RcMoveHandler();
}
- public void sendClose(IProject project){
- sendClose(ManagedBuildManager.getBuildInfo(project,false));
+ public void sendClose(IProject project) {
+ sendClose(ManagedBuildManager.getBuildInfo(project, false));
}
- private void sendClose(IManagedBuildInfo info){
- if(info != null){
+ private void sendClose(IManagedBuildInfo info) {
+ if (info != null) {
IManagedProject managedProj = info.getManagedProject();
if (managedProj != null) {
IConfiguration cfgs[] = managedProj.getConfigurations();
- for(int i = 0; i < cfgs.length; i++)
+ for (int i = 0; i < cfgs.length; i++)
ManagedBuildManager.performValueHandlerEvent(cfgs[i], IManagedOptionValueHandler.EVENT_CLOSE, true);
}
}
@@ -109,7 +108,7 @@ class ResourceChangeHandler2 extends ResourceChangeHandlerBase{
private static class Visitor implements IResourceDeltaVisitor {
private Set<IProject> fProjSet;
- Visitor(Set<IProject> projSet){
+ Visitor(Set<IProject> projSet) {
fProjSet = projSet;
}
@@ -121,17 +120,17 @@ class ResourceChangeHandler2 extends ResourceChangeHandlerBase{
return true;
case IResource.PROJECT:
int flags = delta.getFlags();
- if((flags & IResourceDelta.DESCRIPTION) == IResourceDelta.DESCRIPTION){
+ if ((flags & IResourceDelta.DESCRIPTION) == IResourceDelta.DESCRIPTION) {
IProject project = rc.getProject();
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
- if(info != null && info.isValid() && info.getManagedProject() != null){
+ if (info != null && info.isValid() && info.getManagedProject() != null) {
IProjectDescription eDes = project.getDescription();
IConfiguration[] cfgs = info.getManagedProject().getConfigurations();
String natureIds[] = eDes.getNatureIds();
- for(int i = 0; i < cfgs.length; i++){
+ for (int i = 0; i < cfgs.length; i++) {
String cachedIds[] = ConfigurationDataProvider.getNaturesIdsUsedOnCache(cfgs[i]);
- if(checkNaturesNeedUpdate(cachedIds, natureIds)){
- if(fProjSet == null)
+ if (checkNaturesNeedUpdate(cachedIds, natureIds)) {
+ if (fProjSet == null)
fProjSet = new HashSet<IProject>();
fProjSet.add(project);
@@ -146,14 +145,14 @@ class ResourceChangeHandler2 extends ResourceChangeHandlerBase{
}
}
- Set<IProject> getProjSet(){
+ Set<IProject> getProjSet() {
return fProjSet;
}
}
- private static boolean checkNaturesNeedUpdate(String[] oldIds, String[] newIds){
- if(oldIds == null)
+ private static boolean checkNaturesNeedUpdate(String[] oldIds, String[] newIds) {
+ if (oldIds == null)
return true;
Set<String> oldSet = new HashSet<String>(Arrays.asList(oldIds));
@@ -161,10 +160,8 @@ class ResourceChangeHandler2 extends ResourceChangeHandlerBase{
Set<String> newSet = new HashSet<String>(Arrays.asList(newIds));
oldSet.removeAll(newSet);
newSet.removeAll(oldSetCopy);
- if(oldSet.contains(CProjectNature.C_NATURE_ID)
- || oldSet.contains(CCProjectNature.CC_NATURE_ID)
- || newSet.contains(CProjectNature.C_NATURE_ID)
- || newSet.contains(CCProjectNature.CC_NATURE_ID))
+ if (oldSet.contains(CProjectNature.C_NATURE_ID) || oldSet.contains(CCProjectNature.CC_NATURE_ID)
+ || newSet.contains(CProjectNature.C_NATURE_ID) || newSet.contains(CCProjectNature.CC_NATURE_ID))
return true;
return false;
@@ -174,10 +171,10 @@ class ResourceChangeHandler2 extends ResourceChangeHandlerBase{
public void resourceChanged(IResourceChangeEvent event) {
super.resourceChanged(event);
- switch(event.getType()){
+ switch (event.getType()) {
case IResourceChangeEvent.POST_CHANGE:
IResourceDelta delta = event.getDelta();
- if(delta != null){
+ if (delta != null) {
Visitor visitor = new Visitor(null);
try {
delta.accept(visitor);
@@ -189,14 +186,14 @@ class ResourceChangeHandler2 extends ResourceChangeHandlerBase{
}
}
- private void postProcess(final Set<IProject> projSet){
- if(projSet == null || projSet.size() == 0)
+ private void postProcess(final Set<IProject> projSet) {
+ if (projSet == null || projSet.size() == 0)
return;
IWorkspace wsp = ResourcesPlugin.getWorkspace();
IWorkspaceRoot root = wsp.getRoot();
- Job job = new Job(ManagedMakeMessages.getString("ResourceChangeHandler2.0")){ //$NON-NLS-1$
+ Job job = new Job(ManagedMakeMessages.getString("ResourceChangeHandler2.0")) { //$NON-NLS-1$
@Override
protected IStatus run(IProgressMonitor monitor) {
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 b52ada4486a..7df966a202a 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
@@ -19,7 +19,7 @@ import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
* this interface represents the given environment variable
* @since 3.0
*/
-public interface IBuildEnvironmentVariable extends IEnvironmentVariable{
+public interface IBuildEnvironmentVariable extends IEnvironmentVariable {
public static final int ENVVAR_REPLACE = IEnvironmentVariable.ENVVAR_REPLACE;
public static final int ENVVAR_REMOVE = IEnvironmentVariable.ENVVAR_REMOVE;
public static final int ENVVAR_PREPEND = IEnvironmentVariable.ENVVAR_PREPEND;
@@ -72,7 +72,7 @@ public interface IBuildEnvironmentVariable extends IEnvironmentVariable{
*
* 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/envvar/IConfigurationEnvironmentVariableSupplier.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IConfigurationEnvironmentVariableSupplier.java
index 11c9471c191..9352c14602a 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IConfigurationEnvironmentVariableSupplier.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IConfigurationEnvironmentVariableSupplier.java
@@ -38,7 +38,8 @@ public interface IConfigurationEnvironmentVariableSupplier {
* @return The reference to the IBuildEnvironmentVariable interface representing
* the variable of a given name or {@code null} if the variable is not defined.
*/
- IBuildEnvironmentVariable getVariable(String variableName, IConfiguration configuration, IEnvironmentVariableProvider provider);
+ IBuildEnvironmentVariable getVariable(String variableName, IConfiguration configuration,
+ IEnvironmentVariableProvider provider);
/**
* @param configuration - configuration.
@@ -57,4 +58,3 @@ public interface IConfigurationEnvironmentVariableSupplier {
*/
IBuildEnvironmentVariable[] getVariables(IConfiguration configuration, IEnvironmentVariableProvider provider);
}
-
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentBuildPathsChangeListener.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentBuildPathsChangeListener.java
index 9cdab62441e..c1c0e11f16f 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentBuildPathsChangeListener.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentBuildPathsChangeListener.java
@@ -16,9 +16,9 @@ package org.eclipse.cdt.managedbuilder.envvar;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
/**
- *
+ *
* listeners of the environment build path changes should implement this interface
- *
+ *
* @since 3.0
*/
public interface IEnvironmentBuildPathsChangeListener {
@@ -26,12 +26,11 @@ public interface IEnvironmentBuildPathsChangeListener {
/**
*
* @param configuration represent the configuration for which the paths were changed
- * @param buildPathType set to one of
- * the IEnvVarBuildPath.BUILDPATH_xxx
- * (the IEnvVarBuildPath will represent the build environment variables, see also
+ * @param buildPathType set to one of
+ * the IEnvVarBuildPath.BUILDPATH_xxx
+ * (the IEnvVarBuildPath will represent the build environment variables, see also
* the "Specifying the Includes and Library paths environment variables",
* the "envVarBuildPath schema" and the "Expected CDT/MBS code changes" sections)
*/
void buildPathsChanged(IConfiguration configuration, int buildPathType);
}
-
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentVariableProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentVariableProvider.java
index 0a2745e89e7..09326b88c61 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentVariableProvider.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentVariableProvider.java
@@ -52,7 +52,8 @@ public interface IEnvironmentVariableProvider {
* @deprecated use {@link IEnvironmentVariableProvider#getVariable(String, IConfiguration, boolean)} instead
*/
@Deprecated
- public IBuildEnvironmentVariable getVariable(String variableName, Object level, boolean includeParentLevels, boolean resolveMacros);
+ public IBuildEnvironmentVariable getVariable(String variableName, Object level, boolean includeParentLevels,
+ boolean resolveMacros);
/**
* Get variable for the given configuration, normally including those defined in project properties
@@ -113,7 +114,6 @@ public interface IEnvironmentVariableProvider {
*/
IEnvironmentVariableSupplier[] getSuppliers(Object level);
-
/**
* @return the array of String that holds the build paths of the specified type
*
@@ -137,4 +137,3 @@ public interface IEnvironmentVariableProvider {
*/
void unsubscribe(IEnvironmentBuildPathsChangeListener listener);
}
-
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentVariableSupplier.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentVariableSupplier.java
index 7618316ca23..9f37f410ab3 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentVariableSupplier.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IEnvironmentVariableSupplier.java
@@ -16,26 +16,26 @@ package org.eclipse.cdt.managedbuilder.envvar;
import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
/**
- *
+ *
* @since 3.0
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IEnvironmentVariableSupplier {
-
+
/**
*
* @param name the variable name
* @param context the context
- * @return the reference to the IBuildEnvironmentVariable interface representing
+ * @return the reference to the IBuildEnvironmentVariable interface representing
* the variable of a given name
*/
IEnvironmentVariable getVariable(String name, Object context);
-
+
/**
*
* @param context the context
- * @return the array of IBuildEnvironmentVariable that represents the environment variables
+ * @return the array of IBuildEnvironmentVariable that represents the environment variables
*/
IEnvironmentVariable[] getVariables(Object context);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IProjectEnvironmentVariableSupplier.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IProjectEnvironmentVariableSupplier.java
index 044a5d70f1f..e8b74162ea9 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IProjectEnvironmentVariableSupplier.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/envvar/IProjectEnvironmentVariableSupplier.java
@@ -16,13 +16,13 @@ package org.eclipse.cdt.managedbuilder.envvar;
import org.eclipse.cdt.managedbuilder.core.IManagedProject;
/**
- *
+ *
* this interface is to be implemented by the tool-integrator
* for supplying the project-specific environment
- *
+ *
* @since 3.0
*/
-public interface IProjectEnvironmentVariableSupplier{
+public interface IProjectEnvironmentVariableSupplier {
/**
*
* @param variableName the variable name
@@ -31,17 +31,16 @@ public interface IProjectEnvironmentVariableSupplier{
* environment variables from within the supplier. The supplier should use this provider to obtain
* the already defined environment instead of using the "default" provider returned by the
* ManagedBuildManager.getEnvironmentVariableProvider().
- * The provider passed to a supplier will ignore searching the variables for the levels
- * higher than the current supplier level, will query only the lower-precedence suppliers
- * for the current level and will query all suppliers for the lower levels.
- * This is done to avoid infinite loops that could be caused if the supplier calls the provider
+ * The provider passed to a supplier will ignore searching the variables for the levels
+ * higher than the current supplier level, will query only the lower-precedence suppliers
+ * for the current level and will query all suppliers for the lower levels.
+ * This is done to avoid infinite loops that could be caused if the supplier calls the provider
* and the provider in turn calls that supplier again. Also the supplier should not know anything
* about the environment variables defined for the higher levels.
- * @return the reference to the IBuildEnvironmentVariable interface representing
+ * @return the reference to the IBuildEnvironmentVariable interface representing
* the variable of a given name
*/
- IBuildEnvironmentVariable getVariable(String variableName,
- IManagedProject project,
+ IBuildEnvironmentVariable getVariable(String variableName, IManagedProject project,
IEnvironmentVariableProvider provider);
/**
@@ -51,15 +50,13 @@ public interface IProjectEnvironmentVariableSupplier{
* environment variables from within the supplier. The supplier should use this provider to obtain
* the already defined environment instead of using the "default" provider returned by the
* ManagedBuildManager.getEnvironmentVariableProvider().
- * The provider passed to a supplier will ignore searching the variables for the levels
- * higher than the current supplier level, will query only the lower-precedence suppliers
- * for the current level and will query all suppliers for the lower levels.
- * This is done to avoid infinite loops that could be caused if the supplier calls the provider
+ * The provider passed to a supplier will ignore searching the variables for the levels
+ * higher than the current supplier level, will query only the lower-precedence suppliers
+ * for the current level and will query all suppliers for the lower levels.
+ * This is done to avoid infinite loops that could be caused if the supplier calls the provider
* and the provider in turn calls that supplier again. Also the supplier should not know anything
* about the environment variables defined for the higher levels.
- * @return the array of IBuildEnvironmentVariable that represents the environment variables
+ * @return the array of IBuildEnvironmentVariable that represents the environment variables
*/
- IBuildEnvironmentVariable[] getVariables (IManagedProject project,
- IEnvironmentVariableProvider provider);
+ IBuildEnvironmentVariable[] getVariables(IManagedProject project, IEnvironmentVariableProvider provider);
}
-
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 8bb6dbaf091..73a104bf0d2 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
@@ -28,11 +28,11 @@ public class BuildCommand implements IBuildCommand {
private Map<String, String> fEnv;
private IPath fCWD;
- public BuildCommand(IPath cmd, String args[], Map<String, String> env, IPath cwd, BuildStep step){
+ public BuildCommand(IPath cmd, String args[], Map<String, String> env, IPath cwd, BuildStep step) {
fCmd = cmd;
- if(args != null)
+ if (args != null)
fArgs = args.clone();
- if(env != null)
+ if (env != null)
fEnv = new HashMap<String, String>(env);
fCWD = cwd;
@@ -51,7 +51,7 @@ public class BuildCommand implements IBuildCommand {
*/
@Override
public String[] getArgs() {
- if(fArgs != null)
+ if (fArgs != null)
return fArgs.clone();
return null;
}
@@ -61,7 +61,7 @@ public class BuildCommand implements IBuildCommand {
*/
@Override
public Map<String, String> getEnvironment() {
- if(fEnv != null)
+ if (fEnv != null)
return new HashMap<String, String>(fEnv);
return null;
}
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 2374466b73e..7c7fb15e22f 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
@@ -94,12 +94,11 @@ import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
public class BuildDescription implements IBuildDescription {
- private final static String DOT = "."; //$NON-NLS-1$
- private final static String WILDCARD = "%"; //$NON-NLS-1$
+ private final static String DOT = "."; //$NON-NLS-1$
+ private final static String WILDCARD = "%"; //$NON-NLS-1$
private final static String VAR_USER_OBJS = "USER_OBJS"; //$NON-NLS-1$
private final static String VAR_LIBS = "LIBS"; //$NON-NLS-1$
-
private Configuration fCfg;
private IResourceDelta fDelta;
private IConfigurationBuildState fBuildState;
@@ -132,7 +131,7 @@ public class BuildDescription implements IBuildDescription {
private ICSourceEntry[] fSourceEntries;
-// private Map fExtToToolAndTypeListMap = new HashMap();
+ // private Map fExtToToolAndTypeListMap = new HashMap();
private Map<String, String> fEnvironment;
@@ -147,34 +146,33 @@ public class BuildDescription implements IBuildDescription {
Map<String, BuildGroup> fInTypeToGroupMap = new HashMap<String, BuildGroup>();
}
- class ToolAndType{
+ class ToolAndType {
ITool fTool;
IInputType fType;
String fExt;
- ToolAndType(ITool tool, IInputType inputType, String ext){
+ ToolAndType(ITool tool, IInputType inputType, String ext) {
fTool = tool;
fType = inputType;
fExt = ext;
}
}
- private class RcVisitor implements IResourceProxyVisitor,
- IResourceDeltaVisitor{
+ private class RcVisitor implements IResourceProxyVisitor, IResourceDeltaVisitor {
private boolean fPostProcessMode;
- RcVisitor(){
+ RcVisitor() {
setMode(false);
}
- public void setMode(boolean postProcess){
+ public void setMode(boolean postProcess) {
fPostProcessMode = postProcess;
}
@Override
public boolean visit(IResourceProxy proxy) throws CoreException {
try {
- if(proxy.getType() == IResource.FILE){
+ if (proxy.getType() == IResource.FILE) {
doVisitFile(proxy.requestResource());
return false;
}
@@ -184,36 +182,36 @@ public class BuildDescription implements IBuildDescription {
throw e;
} catch (Exception e) {
String msg = e.getLocalizedMessage();
- if(msg == null)
+ if (msg == null)
msg = ""; //$NON-NLS-1$
- throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), msg, e));
+ throw new CoreException(
+ new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), msg, e));
}
}
- protected boolean postProcessVisit(IResourceDelta delta){
+ protected boolean postProcessVisit(IResourceDelta delta) {
IResource rc = delta.getResource();
- if(rc.getType() == IResource.FILE){
+ if (rc.getType() == IResource.FILE) {
IPath rcLocation = calcResourceLocation(rc);
- BuildResource bRc = (BuildResource)getBuildResource(rcLocation);
- if(bRc != null){
- if(bRc.getProducerIOType() != null
- && bRc.getProducerIOType().getStep() == fInputStep){
- if(delta.getKind() == IResourceDelta.REMOVED){
- if(checkFlags(BuildDescriptionManager.REMOVED)){
+ BuildResource bRc = (BuildResource) getBuildResource(rcLocation);
+ if (bRc != null) {
+ if (bRc.getProducerIOType() != null && bRc.getProducerIOType().getStep() == fInputStep) {
+ if (delta.getKind() == IResourceDelta.REMOVED) {
+ if (checkFlags(BuildDescriptionManager.REMOVED)) {
bRc.setRemoved(true);
}
- } else {
- if(checkFlags(BuildDescriptionManager.REBUILD)){
+ } else {
+ if (checkFlags(BuildDescriptionManager.REBUILD)) {
bRc.setRebuildState(true);
}
}
} else {
- if(checkFlags(BuildDescriptionManager.REBUILD)){
+ if (checkFlags(BuildDescriptionManager.REBUILD)) {
bRc.setRebuildState(true);
IBuildIOType type = bRc.getProducerIOType();
- if(type != null){
- ((BuildStep)type.getStep()).setRebuildState(true);
+ if (type != null) {
+ ((BuildStep) type.getStep()).setRebuildState(true);
}
}
}
@@ -225,15 +223,14 @@ public class BuildDescription implements IBuildDescription {
public boolean removedCalcVisit(IResourceDelta delta) throws CoreException {
IResource rc = delta.getResource();
- if(rc.getType() == IResource.FILE){
- if(!isGenerated(rc.getFullPath())){
+ if (rc.getType() == IResource.FILE) {
+ if (!isGenerated(rc.getFullPath())) {
//this is a project source, check the removed state
- if(delta.getKind() == IResourceDelta.REMOVED
- && checkFlags(BuildDescriptionManager.REMOVED)){
+ if (delta.getKind() == IResourceDelta.REMOVED && checkFlags(BuildDescriptionManager.REMOVED)) {
IPath rcLocation = calcResourceLocation(rc);
- BuildResource bRc = (BuildResource)getBuildResource(rcLocation);
+ BuildResource bRc = (BuildResource) getBuildResource(rcLocation);
- if(bRc == null){
+ if (bRc == null) {
doVisitFile(rc);
}
}
@@ -244,15 +241,14 @@ public class BuildDescription implements IBuildDescription {
return true;//!isGenerated(rc.getFullPath());
}
-
@Override
public boolean visit(IResourceDelta delta) throws CoreException {
- if(fPostProcessMode)
+ if (fPostProcessMode)
return postProcessVisit(delta);
return removedCalcVisit(delta);
}
- private void doVisitFile(IResource res) throws CoreException{
+ private void doVisitFile(IResource res) throws CoreException {
BuildResource rc = createResource(res);
composeOutputs(fInputStep, null, rc);
@@ -261,88 +257,88 @@ public class BuildDescription implements IBuildDescription {
}
- protected IPath calcResourceLocation(IResource rc){
+ protected IPath calcResourceLocation(IResource rc) {
- //return rc.getFullPath();
+ //return rc.getFullPath();
IPath rcLocation = rc.getLocation();
- if(rcLocation == null){
+ if (rcLocation == null) {
rcLocation = new Path(EFSExtensionManager.getDefault().getPathFromURI(rc.getLocationURI()));
}
return rcLocation;
}
-// private class StepCollector implements IStepVisitor{
-// private Set<IBuildStep> fStepSet = new HashSet<IBuildStep>();
-//
-// public int visit(IBuildStep action) throws CoreException {
-// if(DbgUtil.DEBUG){
-// DbgUtil.trace("StepCollector: visiting step " + DbgUtil.stepName(action)); //$NON-NLS-1$
-// }
-// fStepSet.add(action);
-// return VISIT_CONTINUE;
-// }
-//
-// public BuildStep[] getSteps(){
-// return (BuildStep[])fStepSet.toArray(new BuildStep[fStepSet.size()]);
-// }
-//
-// public Set getStepSet(){
-// return fStepSet;
-// }
-//
-// public void clear(){
-// fStepSet.clear();
-// }
-// }
-
- private class RebuildStateSynchronizer implements IStepVisitor{
+ // private class StepCollector implements IStepVisitor{
+ // private Set<IBuildStep> fStepSet = new HashSet<IBuildStep>();
+ //
+ // public int visit(IBuildStep action) throws CoreException {
+ // if(DbgUtil.DEBUG){
+ // DbgUtil.trace("StepCollector: visiting step " + DbgUtil.stepName(action)); //$NON-NLS-1$
+ // }
+ // fStepSet.add(action);
+ // return VISIT_CONTINUE;
+ // }
+ //
+ // public BuildStep[] getSteps(){
+ // return (BuildStep[])fStepSet.toArray(new BuildStep[fStepSet.size()]);
+ // }
+ //
+ // public Set getStepSet(){
+ // return fStepSet;
+ // }
+ //
+ // public void clear(){
+ // fStepSet.clear();
+ // }
+ // }
+
+ private class RebuildStateSynchronizer implements IStepVisitor {
/* (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();
+ BuildStep action = (BuildStep) a;
+ BuildResource rcs[] = (BuildResource[]) action.getInputResources();
boolean rebuild = action.needsRebuild();
boolean removed = action.isRemoved();
- if(DbgUtil.DEBUG){
- DbgUtil.trace(">>visiting step " + DbgUtil.stepName(a)); //$NON-NLS-1$
+ if (DbgUtil.DEBUG) {
+ DbgUtil.trace(">>visiting step " + DbgUtil.stepName(a)); //$NON-NLS-1$
}
- if(!removed){
+ if (!removed) {
BuildIOType args[] = action.getPrimaryTypes(true);
int j = 0;
- if(args.length > 0){
- for(j = 0; j < args.length; j++){
- BuildResource[] ress = (BuildResource[])args[j].getResources();
- if(ress.length > 0){
+ if (args.length > 0) {
+ for (j = 0; j < args.length; j++) {
+ BuildResource[] ress = (BuildResource[]) args[j].getResources();
+ if (ress.length > 0) {
int k = 0;
- for(k = 0; k < ress.length; k++){
- if(!ress[k].isRemoved())
+ for (k = 0; k < ress.length; k++) {
+ if (!ress[k].isRemoved())
break;
}
- if(k != ress.length)
+ if (k != ress.length)
break;
}
}
- if(j == args.length)
+ if (j == args.length)
removed = true;
}
}
- if(!removed){
+ if (!removed) {
for (BuildResource rc : rcs) {
- if(rc.needsRebuild()){
- if(DbgUtil.DEBUG)
- DbgUtil.trace("resource " + locationToRel(rc.getLocation()).toString() + " needs rebuild"); //$NON-NLS-1$ //$NON-NLS-2$
+ if (rc.needsRebuild()) {
+ if (DbgUtil.DEBUG)
+ DbgUtil.trace("resource " + locationToRel(rc.getLocation()).toString() + " needs rebuild"); //$NON-NLS-1$ //$NON-NLS-2$
rebuild = true;
}
- if(rc.isRemoved()){
- if(DbgUtil.DEBUG)
- DbgUtil.trace("resource " + locationToRel(rc.getLocation()).toString() + " is removed"); //$NON-NLS-1$ //$NON-NLS-2$
+ if (rc.isRemoved()) {
+ if (DbgUtil.DEBUG)
+ DbgUtil.trace("resource " + locationToRel(rc.getLocation()).toString() + " is removed"); //$NON-NLS-1$ //$NON-NLS-2$
// Remove the obsolete input resource from the action (Bug #366039)
for (BuildIOType type : action.getPrimaryTypes(true)) {
@@ -359,38 +355,40 @@ public class BuildDescription implements IBuildDescription {
}
}
- if(removed){
- if(DbgUtil.DEBUG)
- DbgUtil.trace("action to be removed"); //$NON-NLS-1$
+ if (removed) {
+ if (DbgUtil.DEBUG)
+ DbgUtil.trace("action to be removed"); //$NON-NLS-1$
action.setRemoved();
for (IBuildResource outRc : action.getOutputResources()) {
- if(DbgUtil.DEBUG)
- DbgUtil.trace("setting remove state for resource " + locationToRel(outRc.getLocation()).toString()); //$NON-NLS-1$
+ if (DbgUtil.DEBUG)
+ DbgUtil.trace(
+ "setting remove state for resource " + locationToRel(outRc.getLocation()).toString()); //$NON-NLS-1$
- ((BuildResource)outRc).setRemoved(true);
+ ((BuildResource) outRc).setRemoved(true);
// Delete the obsolete output file (Bug #366039)
deleteResource(outRc);
}
- } else if(rebuild){
- if(DbgUtil.DEBUG)
- DbgUtil.trace("action needs rebuild"); //$NON-NLS-1$
+ } else if (rebuild) {
+ if (DbgUtil.DEBUG)
+ DbgUtil.trace("action needs rebuild"); //$NON-NLS-1$
action.setRebuildState(true);
for (IBuildResource outRc : action.getOutputResources()) {
- if(DbgUtil.DEBUG)
- DbgUtil.trace("setting rebuild state for resource " + locationToRel(outRc.getLocation()).toString()); //$NON-NLS-1$
+ if (DbgUtil.DEBUG)
+ DbgUtil.trace(
+ "setting rebuild state for resource " + locationToRel(outRc.getLocation()).toString()); //$NON-NLS-1$
- ((BuildResource)outRc).setRebuildState(true);
+ ((BuildResource) outRc).setRebuildState(true);
}
}
- if(DbgUtil.DEBUG)
- DbgUtil.trace("<<leaving.."); //$NON-NLS-1$
+ if (DbgUtil.DEBUG)
+ DbgUtil.trace("<<leaving.."); //$NON-NLS-1$
return VISIT_CONTINUE;
}
@@ -406,8 +404,8 @@ public class BuildDescription implements IBuildDescription {
try {
resource.delete(false, null);
} catch (CoreException e) {
- ManagedBuilderCorePlugin.log(new Status(IStatus.WARNING,
- ManagedBuilderCorePlugin.PLUGIN_ID, IStatus.OK, e.getMessage(), e));
+ ManagedBuilderCorePlugin.log(new Status(IStatus.WARNING, ManagedBuilderCorePlugin.PLUGIN_ID,
+ IStatus.OK, e.getMessage(), e));
}
}
}
@@ -418,71 +416,71 @@ public class BuildDescription implements IBuildDescription {
private ITool fDeps[];
private ITool fConsumers[];
- private ToolOrderEstimation(ITool tool){
+ private ToolOrderEstimation(ITool tool) {
fTool = tool;
}
-// ITool getTool(){
-// return fTool;
-// }
+ // ITool getTool(){
+ // return fTool;
+ // }
- ITool[] getDeps(){
- if(fDeps == null)
+ ITool[] getDeps() {
+ if (fDeps == null)
fDeps = doCalcDeps(fTool);
return fDeps;
}
- ITool[] getConsumers(){
- if(fConsumers == null)
+ ITool[] getConsumers() {
+ if (fConsumers == null)
fConsumers = doCalcConsumers(fTool);
return fConsumers;
}
-// boolean dependsOn(ITool tool){
-// return indexOf(tool, getDeps()) != -1;
-// }
-//
-// boolean hasConsumer(ITool tool){
-// return indexOf(tool, getConsumers()) != -1;
-// }
+ // boolean dependsOn(ITool tool){
+ // return indexOf(tool, getDeps()) != -1;
+ // }
+ //
+ // boolean hasConsumer(ITool tool){
+ // return indexOf(tool, getConsumers()) != -1;
+ // }
}
- protected BuildDescription(){
+ protected BuildDescription() {
}
- public BuildDescription(IConfiguration cfg){
+ public BuildDescription(IConfiguration cfg) {
initBase(cfg, null, null, 0);
}
- public void synchRebuildState() throws CoreException{
- if(DbgUtil.DEBUG)
- DbgUtil.trace("--->Synch started"); //$NON-NLS-1$
+ public void synchRebuildState() throws CoreException {
+ if (DbgUtil.DEBUG)
+ DbgUtil.trace("--->Synch started"); //$NON-NLS-1$
BuildDescriptionManager.accept(new RebuildStateSynchronizer(), this, true);
- if(fOutputStep.needsRebuild())
+ if (fOutputStep.needsRebuild())
fInputStep.setRebuildState(true);//needed for the pre-build step invocation
- if(DbgUtil.DEBUG)
- DbgUtil.trace("<---Synch stopped"); //$NON-NLS-1$
+ if (DbgUtil.DEBUG)
+ DbgUtil.trace("<---Synch stopped"); //$NON-NLS-1$
}
- private BuildIOType findTypeForExtension(BuildStep step, boolean input, String ext){
- if(ext == null)
+ private BuildIOType findTypeForExtension(BuildStep step, boolean input, String ext) {
+ if (ext == null)
return null;
- BuildIOType types[] = input ? (BuildIOType[])step.getInputIOTypes() : (BuildIOType[])step.getOutputIOTypes();
+ BuildIOType types[] = input ? (BuildIOType[]) step.getInputIOTypes() : (BuildIOType[]) step.getOutputIOTypes();
for (BuildIOType type : types) {
for (IBuildResource rc : type.getResources()) {
String e = rc.getLocation().getFileExtension();
- if(e == null){
- if(ext.length() == 0)
+ if (e == null) {
+ if (ext.length() == 0)
return type;
} else {
- if(ext.equals(e))
+ if (ext.equals(e))
return type;
}
}
@@ -490,16 +488,16 @@ public class BuildDescription implements IBuildDescription {
return null;
}
- private Map<String, List<ToolAndType>> initToolAndTypeMap(IFolderInfo foInfo){
+ private Map<String, List<ToolAndType>> initToolAndTypeMap(IFolderInfo foInfo) {
Map<String, List<ToolAndType>> extToToolAndTypeListMap = new HashMap<String, List<ToolAndType>>();
for (ITool tool : foInfo.getFilteredTools()) {
IInputType types[] = tool.getInputTypes();
- if(types.length != 0){
+ if (types.length != 0) {
for (IInputType type : types) {
for (String ext : type.getSourceExtensions(tool)) {
- if(tool.buildsFileType(ext)){
+ if (tool.buildsFileType(ext)) {
List<ToolAndType> list = extToToolAndTypeListMap.get(ext);
- if(list == null){
+ if (list == null) {
list = new ArrayList<ToolAndType>();
extToToolAndTypeListMap.put(ext, list);
}
@@ -509,9 +507,9 @@ public class BuildDescription implements IBuildDescription {
}
} else {
for (String ext : tool.getAllInputExtensions()) {
- if(tool.buildsFileType(ext)){
+ if (tool.buildsFileType(ext)) {
List<ToolAndType> list = extToToolAndTypeListMap.get(ext);
- if(list == null){
+ if (list == null) {
list = new ArrayList<ToolAndType>();
extToToolAndTypeListMap.put(ext, list);
}
@@ -523,33 +521,33 @@ public class BuildDescription implements IBuildDescription {
return extToToolAndTypeListMap;
}
- ToolAndType getToolAndType(BuildResource rc, boolean checkVar){
+ ToolAndType getToolAndType(BuildResource rc, boolean checkVar) {
ToolInfoHolder h = getToolInfo(rc);
return getToolAndType(h, rc, checkVar);
}
- ToolAndType getToolAndType(ToolInfoHolder h, BuildResource rc, boolean checkVar){
+ ToolAndType getToolAndType(ToolInfoHolder h, BuildResource rc, boolean checkVar) {
String locString = rc.getLocation().toString();
- BuildIOType arg = (BuildIOType)rc.getProducerIOType();
+ BuildIOType arg = (BuildIOType) rc.getProducerIOType();
String linkId = (checkVar && arg != null) ? arg.getLinkId() : null;
for (Entry<String, List<ToolAndType>> entry : h.fExtToToolAndTypeListMap.entrySet()) {
String ext = entry.getKey();
- if(locString.endsWith("." + ext)){ //$NON-NLS-1$
+ if (locString.endsWith("." + ext)) { //$NON-NLS-1$
List<ToolAndType> list = entry.getValue();
for (ToolAndType tt : list) {
- if(!checkVar)
+ if (!checkVar)
return tt;
IInputType type = tt.fType;
- if(type == null)
+ if (type == null)
return tt;
String var = type.getBuildVariable();
- if(var == null || var.length() == 0)
+ if (var == null || var.length() == 0)
return tt;
- if(linkId != null && linkId.equals(var)){
+ if (linkId != null && linkId.equals(var)) {
return tt;
}
}
@@ -559,31 +557,30 @@ public class BuildDescription implements IBuildDescription {
return null;
}
- protected boolean isSource(IPath path){
+ protected boolean isSource(IPath path) {
return !CDataUtil.isExcluded(path, fSourceEntries);
-//
-// path = path.makeRelative();
-// for(int i = 0; i < fSourcePaths.length; i++){
-// if(fSourcePaths[i].isPrefixOf(path))
-// return true;
-// }
-// return false;
+ //
+ // path = path.makeRelative();
+ // for(int i = 0; i < fSourcePaths.length; i++){
+ // if(fSourcePaths[i].isPrefixOf(path))
+ // return true;
+ // }
+ // return false;
}
-
- private void composeOutputs(BuildStep inputAction, BuildIOType inputActionArg, BuildResource rc) throws CoreException{
+ private void composeOutputs(BuildStep inputAction, BuildIOType inputActionArg, BuildResource rc)
+ throws CoreException {
boolean isSource = inputActionArg == null;
- if(isSource){
- if(rc.isProjectResource()
- && !isSource(rc.getFullPath().removeFirstSegments(1).makeRelative()))
+ if (isSource) {
+ if (rc.isProjectResource() && !isSource(rc.getFullPath().removeFirstSegments(1).makeRelative()))
return;
} else {
- if(inputAction != null && inputAction == fTargetStep){
- BuildIOType arg = (BuildIOType)rc.getProducerIOType();
- if(arg.isPrimary()){
- BuildIOType oArg = findTypeForExtension(fOutputStep,true,rc.getLocation().getFileExtension());
- if(oArg == null || !arg.isPrimary())
+ if (inputAction != null && inputAction == fTargetStep) {
+ BuildIOType arg = (BuildIOType) rc.getProducerIOType();
+ if (arg.isPrimary()) {
+ BuildIOType oArg = findTypeForExtension(fOutputStep, true, rc.getLocation().getFileExtension());
+ if (oArg == null || !arg.isPrimary())
oArg = fOutputStep.createIOType(true, true, null);
oArg.addResource(rc);
}
@@ -591,9 +588,9 @@ public class BuildDescription implements IBuildDescription {
return;
} else {
for (IOutputType secondaryOutput : fCfg.getToolChain().getSecondaryOutputs()) {
- if(inputActionArg!=null && secondaryOutput==inputActionArg.getIoType()){
- BuildIOType arg = findTypeForExtension(fOutputStep,true,rc.getLocation().getFileExtension());
- if(arg == null || arg.isPrimary()){
+ if (inputActionArg != null && secondaryOutput == inputActionArg.getIoType()) {
+ BuildIOType arg = findTypeForExtension(fOutputStep, true, rc.getLocation().getFileExtension());
+ if (arg == null || arg.isPrimary()) {
arg = fOutputStep.createIOType(true, false, null);
}
arg.addResource(rc);
@@ -604,39 +601,38 @@ public class BuildDescription implements IBuildDescription {
IPath location = rc.getLocation();
- IResourceInfo rcInfo = rc.isProjectResource() ?
- fCfg.getResourceInfo(rc.getFullPath().removeFirstSegments(1), false) :
- fCfg.getRootFolderInfo();
+ IResourceInfo rcInfo = rc.isProjectResource()
+ ? fCfg.getResourceInfo(rc.getFullPath().removeFirstSegments(1), false)
+ : fCfg.getRootFolderInfo();
ITool tool = null;
IInputType inputType = null;
String ext = null;
boolean stepRemoved = false;
- if(rcInfo.isExcluded()){
- if(rcInfo.needsRebuild())
+ if (rcInfo.isExcluded()) {
+ if (rcInfo.needsRebuild())
stepRemoved = true;
else
return;
}
ToolInfoHolder h = null;
- if(rcInfo instanceof IFileInfo){
- IFileInfo fi = (IFileInfo)rcInfo;
+ if (rcInfo instanceof IFileInfo) {
+ IFileInfo fi = (IFileInfo) rcInfo;
ITool[] tools = fi.getToolsToInvoke();
- if(tools.length > 0 )
- {
- tool = fi.getToolsToInvoke()[0];
- String locString = location.toString();
- for (String e : tool.getAllInputExtensions()) {
- if(locString.endsWith(e)){
- inputType = tool.getInputType(e);
- ext = e;
- }
- }
+ if (tools.length > 0) {
+ tool = fi.getToolsToInvoke()[0];
+ String locString = location.toString();
+ for (String e : tool.getAllInputExtensions()) {
+ if (locString.endsWith(e)) {
+ inputType = tool.getInputType(e);
+ ext = e;
+ }
+ }
}
} else {
h = getToolInfo(rc);
ToolAndType tt = getToolAndType(h, rc, true);
- if(tt != null){
+ if (tt != null) {
tool = tt.fTool;
inputType = tt.fType;
ext = tt.fExt;
@@ -644,35 +640,35 @@ public class BuildDescription implements IBuildDescription {
}
- if(ext == null)
+ if (ext == null)
ext = location.getFileExtension();
- if(tool != null) {
+ if (tool != null) {
// Generate the step to build this source file
IInputType primaryInputType = tool.getPrimaryInputType();
- if ((primaryInputType != null && !primaryInputType.getMultipleOfType()) ||
- (inputType == null && tool != fCfg.calculateTargetTool())){
+ if ((primaryInputType != null && !primaryInputType.getMultipleOfType())
+ || (inputType == null && tool != fCfg.calculateTargetTool())) {
BuildStep action = null;
BuildIOType argument = null;
BuildGroup group = null;
- if(h != null)
+ if (h != null)
group = createGroup(h, inputType, ext);
action = createStep(tool, inputType);//new BuildStep(this, tool, inputType);
- if(stepRemoved)
+ if (stepRemoved)
action.setRemoved();
- if(group != null)
+ if (group != null)
group.addAction(action);
argument = action.createIOType(true, true, inputType);
argument.addResource(rc);
- if(inputActionArg == null){
- inputActionArg = findTypeForExtension(inputAction,false,rc.getLocation().getFileExtension());
- if(inputActionArg == null && inputAction!=null)
+ if (inputActionArg == null) {
+ inputActionArg = findTypeForExtension(inputAction, false, rc.getLocation().getFileExtension());
+ if (inputActionArg == null && inputAction != null)
inputActionArg = inputAction.createIOType(false, false, null);
- if (inputActionArg!=null)
+ if (inputActionArg != null)
inputActionArg.addResource(rc);
}
@@ -680,31 +676,32 @@ public class BuildDescription implements IBuildDescription {
calculateOutputs(action, argument, rc);
- BuildIOType outputs[] = (BuildIOType[])action.getOutputIOTypes();
+ BuildIOType outputs[] = (BuildIOType[]) action.getOutputIOTypes();
for (BuildIOType output : outputs) {
- BuildResource rcs[] = (BuildResource[])output.getResources();
+ BuildResource rcs[] = (BuildResource[]) output.getResources();
for (BuildResource outputRc : rcs) {
composeOutputs(action, output, outputRc);
}
}
} else {
- if(inputType != null ? inputType.getMultipleOfType() : tool == fCfg.calculateTargetTool()){
+ if (inputType != null ? inputType.getMultipleOfType() : tool == fCfg.calculateTargetTool()) {
BuildStep step = fToolToMultiStepMap.get(tool);
- if(step != null){
+ if (step != null) {
BuildIOType argument = step.getIOTypeForType(inputType, true);
- if(argument == null)
+ if (argument == null)
argument = step.createIOType(true, true, inputType);
argument.addResource(rc);
- if(inputActionArg == null){
- inputActionArg = findTypeForExtension(inputAction,false,rc.getLocation().getFileExtension());
- if(inputActionArg == null && inputAction!=null)
+ if (inputActionArg == null) {
+ inputActionArg = findTypeForExtension(inputAction, false,
+ rc.getLocation().getFileExtension());
+ if (inputActionArg == null && inputAction != null)
inputActionArg = inputAction.createIOType(false, false, null);
- if (inputActionArg!=null)
+ if (inputActionArg != null)
inputActionArg.addResource(rc);
}
}
@@ -715,11 +712,10 @@ public class BuildDescription implements IBuildDescription {
}
}
- private BuildGroup createGroup(ToolInfoHolder h, IInputType inType, String ext){
- String key = inType != null ?
- inType.getId() : "ext:"+ext; //$NON-NLS-1$
+ private BuildGroup createGroup(ToolInfoHolder h, IInputType inType, String ext) {
+ String key = inType != null ? inType.getId() : "ext:" + ext; //$NON-NLS-1$
BuildGroup group = h.fInTypeToGroupMap.get(key);
- if(group == null){
+ if (group == null) {
group = new BuildGroup();
h.fInTypeToGroupMap.put(key, group);
}
@@ -742,12 +738,12 @@ public class BuildDescription implements IBuildDescription {
return fOutputStep;
}
- public boolean checkFlags(int flags){
+ public boolean checkFlags(int flags) {
return (fFlags & flags) == flags;
}
- protected void initBase(IConfiguration cfg, IConfigurationBuildState bs, IResourceDelta delta, int flags){
- fCfg = (Configuration)cfg;
+ protected void initBase(IConfiguration cfg, IConfigurationBuildState bs, IResourceDelta delta, int flags) {
+ fCfg = (Configuration) cfg;
fDelta = delta;
fBuildState = bs;
fProject = cfg.getOwner().getProject();
@@ -755,21 +751,22 @@ public class BuildDescription implements IBuildDescription {
fFlags = flags;
fSourceEntries = fCfg.getSourceEntries();
- if(fSourceEntries.length == 0){
- fSourceEntries = new ICSourceEntry[]{new CSourceEntry(Path.EMPTY, null, ICSettingEntry.RESOLVED | ICSettingEntry.VALUE_WORKSPACE_PATH)};
+ if (fSourceEntries.length == 0) {
+ fSourceEntries = new ICSourceEntry[] {
+ new CSourceEntry(Path.EMPTY, null, ICSettingEntry.RESOLVED | ICSettingEntry.VALUE_WORKSPACE_PATH) };
} else {
ICConfigurationDescription cfgDes = ManagedBuildManager.getDescriptionForConfiguration(cfg);
fSourceEntries = CDataUtil.resolveEntries(fSourceEntries, cfgDes);
}
- fInputStep = createStep(null,null);
- fOutputStep = createStep(null,null);
+ fInputStep = createStep(null, null);
+ fOutputStep = createStep(null, null);
}
- protected void initDescription() throws CoreException{
- if(fCfg.needsFullRebuild())
+ protected void initDescription() throws CoreException {
+ if (fCfg.needsFullRebuild())
fInputStep.setRebuildState(true);
- if(fBuildState != null && fBuildState.getState() == IRebuildState.NEED_REBUILD)
+ if (fBuildState != null && fBuildState.getState() == IRebuildState.NEED_REBUILD)
fInputStep.setRebuildState(true);
initToolInfos();
@@ -779,19 +776,16 @@ public class BuildDescription implements IBuildDescription {
RcVisitor visitor = new RcVisitor();
fProject.accept(visitor, IResource.NONE);
-
- if(checkFlags(BuildDescriptionManager.REMOVED)
- && fDelta != null)
+ if (checkFlags(BuildDescriptionManager.REMOVED) && fDelta != null)
fDelta.accept(visitor);
handleMultiSteps();
visitor.setMode(true);
- if((checkFlags(BuildDescriptionManager.REMOVED)
- || checkFlags(BuildDescriptionManager.REBUILD))){
- if(fDelta != null)
+ if ((checkFlags(BuildDescriptionManager.REMOVED) || checkFlags(BuildDescriptionManager.REBUILD))) {
+ if (fDelta != null)
fDelta.accept(visitor);
- if(fBuildState != null)
+ if (fBuildState != null)
processBuildState();
}
@@ -800,7 +794,7 @@ public class BuildDescription implements IBuildDescription {
//TODO: trim();
}
- protected void processBuildState(){
+ protected void processBuildState() {
IPath paths[] = fBuildState.getFullPathsForState(IRebuildState.NEED_REBUILD);
processBuildState(IRebuildState.NEED_REBUILD, paths);
@@ -808,76 +802,75 @@ public class BuildDescription implements IBuildDescription {
processBuildState(IRebuildState.REMOVED, paths);
}
- protected void processBuildState(int state, IPath fullPaths[]){
+ protected void processBuildState(int state, IPath fullPaths[]) {
for (IPath fullPath : fullPaths) {
processBuildState(state, fullPath);
}
}
- protected void processBuildState(int state, IPath fullPath){
- BuildResource bRc = (BuildResource)getBuildResourceForFullPath(fullPath);
- if(bRc == null)
+ protected void processBuildState(int state, IPath fullPath) {
+ BuildResource bRc = (BuildResource) getBuildResourceForFullPath(fullPath);
+ if (bRc == null)
return;
- if(bRc.getProducerIOType() != null
- && bRc.getProducerIOType().getStep() == fInputStep){
- if(state == IRebuildState.REMOVED){
- if(checkFlags(BuildDescriptionManager.REMOVED)){
+ if (bRc.getProducerIOType() != null && bRc.getProducerIOType().getStep() == fInputStep) {
+ if (state == IRebuildState.REMOVED) {
+ if (checkFlags(BuildDescriptionManager.REMOVED)) {
bRc.setRemoved(true);
}
- } else if (state == IRebuildState.NEED_REBUILD){
- if(checkFlags(BuildDescriptionManager.REBUILD)){
+ } else if (state == IRebuildState.NEED_REBUILD) {
+ if (checkFlags(BuildDescriptionManager.REBUILD)) {
bRc.setRebuildState(true);
}
}
} else {
- if(state == IRebuildState.NEED_REBUILD
- || state == IRebuildState.REMOVED
- || checkFlags(BuildDescriptionManager.REBUILD)){
+ if (state == IRebuildState.NEED_REBUILD || state == IRebuildState.REMOVED
+ || checkFlags(BuildDescriptionManager.REBUILD)) {
bRc.setRebuildState(true);
IBuildIOType type = bRc.getProducerIOType();
- if(type != null){
- ((BuildStep)type.getStep()).setRebuildState(true);
+ if (type != null) {
+ ((BuildStep) type.getStep()).setRebuildState(true);
}
}
}
}
- protected void init(IConfiguration cfg, IConfigurationBuildState bs, IResourceDelta delta, int flags) throws CoreException {
+ protected void init(IConfiguration cfg, IConfigurationBuildState bs, IResourceDelta delta, int flags)
+ throws CoreException {
initBase(cfg, bs, delta, flags);
initDescription();
}
- protected void stepRemoved(BuildStep step){
+ protected void stepRemoved(BuildStep step) {
fStepList.remove(step);
- if(fTargetStep == step){
+ if (fTargetStep == step) {
fTargetStep = null;
}
}
- public BuildResource[][] removeStep(BuildStep step){
+ public BuildResource[][] removeStep(BuildStep step) {
return step.remove();
}
- public BuildIOType[][] removeResource(BuildResource rc){
+ public BuildIOType[][] removeResource(BuildResource rc) {
return rc.remove();
}
- private void handleMultiSteps() throws CoreException{
+ private void handleMultiSteps() throws CoreException {
for (BuildStep action : fOrderedMultiActions) {
calculateInputs(action);
calculateOutputs(action, action.getPrimaryTypes(true)[0], null);
- if(action.getOutputResources().length == 0){
+ if (action.getOutputResources().length == 0) {
removeStep(action);
}
- BuildIOType args[] = (BuildIOType[])action.getOutputIOTypes();
+ BuildIOType args[] = (BuildIOType[]) action.getOutputIOTypes();
for (BuildIOType arg : args) {
- BuildResource rcs[] = (BuildResource[])arg.getResources();
+ BuildResource rcs[] = (BuildResource[]) arg.getResources();
for (BuildResource rc : rcs) {
composeOutputs(action, arg, rc);
}
@@ -885,14 +878,14 @@ public class BuildDescription implements IBuildDescription {
}
}
- private void initMultiSteps(){
+ private void initMultiSteps() {
ITool targetTool = fCfg.calculateTargetTool();
for (ITool tool : fCfg.getFilteredTools()) {
IInputType type = tool.getPrimaryInputType();
BuildStep action = null;
- if(type != null ? type.getMultipleOfType() : tool == targetTool){
- action = createStep(tool,type);//new BuildStep(this, tool, type);
+ if (type != null ? type.getMultipleOfType() : tool == targetTool) {
+ action = createStep(tool, type);//new BuildStep(this, tool, type);
action.createIOType(true, true, type);
fToolToMultiStepMap.put(tool, action);
}
@@ -903,69 +896,65 @@ public class BuildDescription implements IBuildDescription {
int index = 0;
for (ITool orderedTool : getOrderedTools()) {
BuildStep action = fToolToMultiStepMap.get(orderedTool);
- if(action != null)
+ if (action != null)
fOrderedMultiActions[index++] = action;
}
}
-
-
- private void completeLinking() throws CoreException{
+ private void completeLinking() throws CoreException {
boolean foundUnused = false;
- do{
- BuildStep steps[] = (BuildStep[])getSteps();
+ do {
+ BuildStep steps[] = (BuildStep[]) getSteps();
foundUnused = false;
for (BuildStep step : steps) {
- if(step == fOutputStep || step == fInputStep)
+ if (step == fOutputStep || step == fInputStep)
continue;
IBuildResource rcs[] = step.getResources(false);
int i;
- for(i = 0; i < rcs.length; i++){
- if(rcs[i].getDependentIOTypes().length != 0)
+ for (i = 0; i < rcs.length; i++) {
+ if (rcs[i].getDependentIOTypes().length != 0)
break;
}
- if(i == rcs.length){
- if(DbgUtil.DEBUG){
- DbgUtil.trace("unused step found: " + DbgUtil.stepName(step)); //$NON-NLS-1$
+ if (i == rcs.length) {
+ if (DbgUtil.DEBUG) {
+ DbgUtil.trace("unused step found: " + DbgUtil.stepName(step)); //$NON-NLS-1$
}
foundUnused = true;
- if(step.needsRebuild()
- && step.getTool() != null
- && step.getTool().getCustomBuildStep()){
- if(DbgUtil.DEBUG){
- DbgUtil.trace("unused step is an RCBS needing rebuild, settings input step rebuild state to true"); //$NON-NLS-1$
+ if (step.needsRebuild() && step.getTool() != null && step.getTool().getCustomBuildStep()) {
+ if (DbgUtil.DEBUG) {
+ DbgUtil.trace(
+ "unused step is an RCBS needing rebuild, settings input step rebuild state to true"); //$NON-NLS-1$
}
fInputStep.setRebuildState(true);
}
removeStep(step);
}
}
- }while(foundUnused);
+ } while (foundUnused);
Set<Entry<URI, BuildResource>> set = fLocationToRcMap.entrySet();
List<BuildResource> list = new ArrayList<BuildResource>();
for (Entry<URI, BuildResource> entry : set) {
BuildResource rc = entry.getValue();
boolean doRemove = false;
- BuildIOType producerArg = (BuildIOType)rc.getProducerIOType();
- if(producerArg == null){
- if(rc.getDependentIOTypes().length == 0)
+ BuildIOType producerArg = (BuildIOType) rc.getProducerIOType();
+ if (producerArg == null) {
+ if (rc.getDependentIOTypes().length == 0)
doRemove = true;
else {
- producerArg = findTypeForExtension(fInputStep,false,rc.getLocation().getFileExtension());
- if(producerArg == null)
+ producerArg = findTypeForExtension(fInputStep, false, rc.getLocation().getFileExtension());
+ if (producerArg == null)
producerArg = fInputStep.createIOType(false, false, null);
producerArg.addResource(rc);
}
- } else if(producerArg.getStep() == fInputStep
- && rc.getDependentIOTypes().length == 0) {
- doRemove = true;
+ } else if (producerArg.getStep() == fInputStep && rc.getDependentIOTypes().length == 0) {
+ doRemove = true;
}
- if(doRemove)
+ if (doRemove)
list.add(rc);
}
@@ -973,52 +962,54 @@ public class BuildDescription implements IBuildDescription {
BuildIOType[][] types = removeResource(buildResource);
BuildIOType producer = types[0][0];
- if(producer != null && producer.getResources().length == 0){
- ((BuildStep)producer.getStep()).removeIOType(producer);
+ if (producer != null && producer.getResources().length == 0) {
+ ((BuildStep) producer.getStep()).removeIOType(producer);
}
BuildIOType deps[] = types[1];
for (BuildIOType dep : deps) {
- if(dep.getResources().length == 0)
- ((BuildStep)dep.getStep()).removeIOType(dep);
+ if (dep.getResources().length == 0)
+ ((BuildStep) dep.getStep()).removeIOType(dep);
}
}
}
- protected void resourceRemoved(BuildResource rc){
+ protected void resourceRemoved(BuildResource rc) {
fLocationToRcMap.remove(rc.getLocationURI());
}
- protected void resourceCreated(BuildResource rc){
+ protected void resourceCreated(BuildResource rc) {
fLocationToRcMap.put(rc.getLocationURI(), rc);
}
- private IManagedBuilderMakefileGenerator getMakeGenInitialized(){
- if(fMakeGen == null){
+ private IManagedBuilderMakefileGenerator getMakeGenInitialized() {
+ if (fMakeGen == null) {
fMakeGen = ManagedBuildManager.getBuildfileGenerator(fCfg);
- if(fMakeGen instanceof IManagedBuilderMakefileGenerator2)
- ((IManagedBuilderMakefileGenerator2)fMakeGen).initialize(IncrementalProjectBuilder.FULL_BUILD, fCfg, fCfg.getEditableBuilder(), new NullProgressMonitor());
+ if (fMakeGen instanceof IManagedBuilderMakefileGenerator2)
+ ((IManagedBuilderMakefileGenerator2) fMakeGen).initialize(IncrementalProjectBuilder.FULL_BUILD, fCfg,
+ fCfg.getEditableBuilder(), new NullProgressMonitor());
else
fMakeGen.initialize(fProject, fInfo, null);
}
return fMakeGen;
}
- private IPath getTopBuildDirFullPath(){
- if(fTopBuildDirFullPath == null)
- fTopBuildDirFullPath = fProject.getFullPath().append(getMakeGenInitialized().getBuildWorkingDir()).addTrailingSeparator();
+ private IPath getTopBuildDirFullPath() {
+ if (fTopBuildDirFullPath == null)
+ fTopBuildDirFullPath = fProject.getFullPath().append(getMakeGenInitialized().getBuildWorkingDir())
+ .addTrailingSeparator();
return fTopBuildDirFullPath;
}
- private IPath getTopBuildDirLocation(){
+ private IPath getTopBuildDirLocation() {
IPath projLocation = getProjectLocation();
return projLocation.append(getTopBuildDirFullPath().removeFirstSegments(1));
}
- private URI getTopBuildDirLocationURI(){
- return org.eclipse.core.runtime.URIUtil.makeAbsolute(URIUtil.toURI(getTopBuildDirFullPath().removeFirstSegments(1)),
- fProject.getLocationURI());
+ private URI getTopBuildDirLocationURI() {
+ return org.eclipse.core.runtime.URIUtil.makeAbsolute(
+ URIUtil.toURI(getTopBuildDirFullPath().removeFirstSegments(1)), fProject.getLocationURI());
}
private IPath getProjectLocation() {
@@ -1026,8 +1017,8 @@ public class BuildDescription implements IBuildDescription {
return UNCPathConverter.toPath(uri);
}
- private BuildResource[] addOutputs(IPath paths[], BuildIOType buildArg, IPath outDirPath){
- if(paths != null){
+ private BuildResource[] addOutputs(IPath paths[], BuildIOType buildArg, IPath outDirPath) {
+ if (paths != null) {
List<BuildResource> list = new ArrayList<BuildResource>();
for (IPath path : paths) {
IPath outFullPath = path;
@@ -1035,16 +1026,15 @@ public class BuildDescription implements IBuildDescription {
IPath outProjPath;
IPath projLocation = getProjectLocation();
- if(outFullPath.isAbsolute()){
+ if (outFullPath.isAbsolute()) {
outProjPath = outFullPath;
- if(projLocation.isPrefixOf(outProjPath)) {
+ if (projLocation.isPrefixOf(outProjPath)) {
// absolute location really points to same place the project lives, so it IS a project file
outProjPath = outProjPath.removeFirstSegments(projLocation.segmentCount());
outFullPath = projLocation.append(outProjPath.removeFirstSegments(projLocation.segmentCount()));
outWorkspacePath = fProject.getFullPath().append(outProjPath);
- }
- else {
+ } else {
// absolute path to somewhere outside the workspace
outProjPath = null;
outWorkspacePath = null;
@@ -1055,13 +1045,15 @@ public class BuildDescription implements IBuildDescription {
outProjPath = outDirPath.removeFirstSegments(1).append(outWorkspacePath);
outWorkspacePath = fProject.getFullPath().append(outProjPath);
} else {
- outProjPath = fProject.getFullPath().removeFirstSegments(1).append(outDirPath.removeFirstSegments(1).append(outWorkspacePath));
+ outProjPath = fProject.getFullPath().removeFirstSegments(1)
+ .append(outDirPath.removeFirstSegments(1).append(outWorkspacePath));
- if(outDirPath.isPrefixOf(outFullPath)) {
+ if (outDirPath.isPrefixOf(outFullPath)) {
outFullPath.removeFirstSegments(outDirPath.segmentCount());
}
- outFullPath = projLocation.append(outDirPath.removeFirstSegments(1).append(outFullPath.lastSegment()));
+ outFullPath = projLocation
+ .append(outDirPath.removeFirstSegments(1).append(outFullPath.lastSegment()));
outWorkspacePath = fProject.getFullPath().append(outProjPath);
}
}
@@ -1090,7 +1082,7 @@ public class BuildDescription implements IBuildDescription {
try {
IFileStore projStore = EFS.getStore(projURI);
- if(projStore.toLocalFile(EFS.NONE, null) != null) {
+ if (projStore.toLocalFile(EFS.NONE, null) != null) {
// local file
return URIUtil.toURI(location);
}
@@ -1112,70 +1104,73 @@ public class BuildDescription implements IBuildDescription {
IPath resPath = null;
- if(!isMultiAction){
+ if (!isMultiAction) {
resPath = buildRc.getFullPath();
- if(resPath == null)
+ if (resPath == null)
resPath = buildRc.getLocation();
} else {
- rcs = (BuildResource[])action.getPrimaryTypes(true)[0].getResources();
- if(rcs.length == 0)
+ rcs = (BuildResource[]) action.getPrimaryTypes(true)[0].getResources();
+ if (rcs.length == 0)
return;
}
- IPath outDirPath = isMultiAction ?
- getTopBuildDirFullPath() :
- buildRc.getProducerIOType().getStep() == fInputStep ?
- getTopBuildDirFullPath().append(resPath.removeFirstSegments(1).removeLastSegments(1)).addTrailingSeparator() :
- resPath.removeLastSegments(1).addTrailingSeparator();
- IInputType inType = (IInputType)arg.getIoType();
+ IPath outDirPath = isMultiAction ? getTopBuildDirFullPath()
+ : buildRc.getProducerIOType().getStep() == fInputStep
+ ? getTopBuildDirFullPath().append(resPath.removeFirstSegments(1).removeLastSegments(1))
+ .addTrailingSeparator()
+ : resPath.removeLastSegments(1).addTrailingSeparator();
+ IInputType inType = (IInputType) arg.getIoType();
String linkId = inType != null ? inType.getBuildVariable() : null;
- if(linkId != null && linkId.length() == 0)
+ if (linkId != null && linkId.length() == 0)
linkId = null;
IOutputType[] outTypes = tool.getOutputTypes();
// 1. If the tool is the build target and this is the primary output,
// use artifact name & extension
- if (fTargetStep == action){
+ if (fTargetStep == action) {
String artifactName = fCfg.getArtifactName();
- if (artifactName != null && ! artifactName.trim().isEmpty()) {
+ if (artifactName != null && !artifactName.trim().isEmpty()) {
try {
- String tmp = ManagedBuildManager.getBuildMacroProvider().resolveValue(artifactName, "", " ", IBuildMacroProvider.CONTEXT_CONFIGURATION, fCfg); //$NON-NLS-1$ //$NON-NLS-2$
- if((tmp = tmp.trim()).length() > 0)
+ String tmp = ManagedBuildManager.getBuildMacroProvider().resolveValue(artifactName, "", " ", //$NON-NLS-1$//$NON-NLS-2$
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, fCfg);
+ if ((tmp = tmp.trim()).length() > 0)
artifactName = tmp;
- } catch (BuildMacroException e){
+ } catch (BuildMacroException e) {
}
-
+
String artifactExt = fCfg.getArtifactExtension();
try {
- String tmp = ManagedBuildManager.getBuildMacroProvider()
- .resolveValue(artifactExt, "", " ", IBuildMacroProvider.CONTEXT_CONFIGURATION, fCfg); //$NON-NLS-1$ //$NON-NLS-2$
- if((tmp = tmp.trim()).length() > 0)
+ String tmp = ManagedBuildManager.getBuildMacroProvider().resolveValue(artifactExt, "", " ", //$NON-NLS-1$//$NON-NLS-2$
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, fCfg);
+ if ((tmp = tmp.trim()).length() > 0)
artifactExt = tmp;
} catch (BuildMacroException e) {
}
-
+
String artifactPrefix = tool.getOutputPrefix();
- if(artifactPrefix != null && artifactPrefix.length() != 0){
+ if (artifactPrefix != null && artifactPrefix.length() != 0) {
try {
- String tmp = ManagedBuildManager.getBuildMacroProvider().resolveValue(artifactPrefix, "", " ", IBuildMacroProvider.CONTEXT_CONFIGURATION, fCfg); //$NON-NLS-1$ //$NON-NLS-2$
- if((tmp = tmp.trim()).length() > 0)
+ String tmp = ManagedBuildManager.getBuildMacroProvider().resolveValue(artifactPrefix, "", " ", //$NON-NLS-1$//$NON-NLS-2$
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, fCfg);
+ if ((tmp = tmp.trim()).length() > 0)
artifactPrefix = tmp;
- } catch (BuildMacroException e){
+ } catch (BuildMacroException e) {
}
artifactName = artifactPrefix + artifactName;
}
-
+
IPath path = new Path(artifactName);
- if(artifactExt != null && artifactExt.length() != 0)
+ if (artifactExt != null && artifactExt.length() != 0)
path = path.addFileExtension(artifactExt);
-
+
IOutputType type = action.getTool().getPrimaryOutputType();
BuildIOType ioType = action.getIOTypeForType(type, false);
- if(ioType == null)
+ if (ioType == null)
ioType = action.createIOType(false, true, type);
- addOutputs(new IPath[]{path}, ioType, outDirPath);
+ addOutputs(new IPath[] { path }, ioType, outDirPath);
} else {
- String msg = BuildModelMessages.getFormattedString("BuildDescription.MissingArtifact", new String[] {fProject.getName(), fCfg.getName()}); //$NON-NLS-1$
+ String msg = BuildModelMessages.getFormattedString("BuildDescription.MissingArtifact", //$NON-NLS-1$
+ new String[] { fProject.getName(), fCfg.getName() });
ManagedBuilderCorePlugin.log(new Status(IStatus.WARNING, ManagedBuilderCorePlugin.PLUGIN_ID, msg));
}
} else if (outTypes != null && outTypes.length > 0) {
@@ -1185,50 +1180,44 @@ public class BuildDescription implements IBuildDescription {
String[] pathStrings = null;
IPath[] paths = null;
- // Resolve any macros in the outputPrefix
- // Note that we cannot use file macros because if we do a clean
- // we need to know the actual name of the file to clean, and
- // cannot use any builder variables such as $@. Hence we use the
- // next best thing, i.e. configuration context.
-
- // figure out the configuration we're using
- IBuildObject toolParent = tool.getParent();
- IConfiguration config = null;
- // if the parent is a config then we're done
- if (toolParent instanceof IConfiguration)
- config = (IConfiguration) toolParent;
- else if (toolParent instanceof IToolChain) {
- // must be a toolchain
- config = ((IToolChain) toolParent).getParent();
- }
-
- else if (toolParent instanceof IResourceConfiguration) {
- config = ((IResourceConfiguration) toolParent).getParent();
- }
-
- else {
- // bad
- throw new AssertionError(
- "tool parent must be one of configuration, toolchain, or resource configuration"); //$NON-NLS-1$
- }
-
- if (config != null) {
-
- try {
-//TODO
- outputPrefix = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveValue(
- outputPrefix,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- config);
- }
- catch (BuildMacroException e) {
- }
-
- }
+ // Resolve any macros in the outputPrefix
+ // Note that we cannot use file macros because if we do a clean
+ // we need to know the actual name of the file to clean, and
+ // cannot use any builder variables such as $@. Hence we use the
+ // next best thing, i.e. configuration context.
+
+ // figure out the configuration we're using
+ IBuildObject toolParent = tool.getParent();
+ IConfiguration config = null;
+ // if the parent is a config then we're done
+ if (toolParent instanceof IConfiguration)
+ config = (IConfiguration) toolParent;
+ else if (toolParent instanceof IToolChain) {
+ // must be a toolchain
+ config = ((IToolChain) toolParent).getParent();
+ }
+
+ else if (toolParent instanceof IResourceConfiguration) {
+ config = ((IResourceConfiguration) toolParent).getParent();
+ }
+
+ else {
+ // bad
+ throw new AssertionError(
+ "tool parent must be one of configuration, toolchain, or resource configuration"); //$NON-NLS-1$
+ }
+
+ if (config != null) {
+
+ try {
+ //TODO
+ outputPrefix = ManagedBuildManager.getBuildMacroProvider().resolveValue(outputPrefix, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, config);
+ } catch (BuildMacroException e) {
+ }
+
+ }
boolean multOfType = type.getMultipleOfType();
IOption option = tool.getOptionBySuperClassId(type.getOptionId());
@@ -1236,75 +1225,56 @@ public class BuildDescription implements IBuildDescription {
String[] outputNames = type.getOutputNames();
BuildIOType buildArg = null;
-
// 2. If an option is specified, use the value of the option
- if (option != null) {
+ if (option != null) {
try {
int optType = option.getValueType();
if (optType == IOption.STRING) {
String val = option.getStringValue();
- if(val != null && val.length() > 0){
+ if (val != null && val.length() > 0) {
// try to resolve the build macros in the output
// names
try {
-//TODO
- val = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveValue(
- val,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(
- resPath,
- null, option, tool));
- } catch (BuildMacroException e){
+ //TODO
+ val = ManagedBuildManager.getBuildMacroProvider().resolveValue(val, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(resPath, null, option, tool));
+ } catch (BuildMacroException e) {
}
- if((val = val.trim()).length() > 0){
- pathStrings = new String[]{outputPrefix + val};
+ if ((val = val.trim()).length() > 0) {
+ pathStrings = new String[] { outputPrefix + val };
}
}
- } else if (
- optType == IOption.STRING_LIST ||
- optType == IOption.LIBRARIES ||
- optType == IOption.OBJECTS ||
- optType == IOption.INCLUDE_FILES ||
- optType == IOption.LIBRARY_PATHS ||
- optType == IOption.LIBRARY_FILES ||
- optType == IOption.MACRO_FILES ||
- optType == IOption.UNDEF_INCLUDE_PATH ||
- optType == IOption.UNDEF_PREPROCESSOR_SYMBOLS ||
- optType == IOption.UNDEF_INCLUDE_FILES ||
- optType == IOption.UNDEF_LIBRARY_PATHS ||
- optType == IOption.UNDEF_LIBRARY_FILES ||
- optType == IOption.UNDEF_MACRO_FILES) {
- List<String> outputList = (List<String>)option.getValue();
+ } else if (optType == IOption.STRING_LIST || optType == IOption.LIBRARIES
+ || optType == IOption.OBJECTS || optType == IOption.INCLUDE_FILES
+ || optType == IOption.LIBRARY_PATHS || optType == IOption.LIBRARY_FILES
+ || optType == IOption.MACRO_FILES || optType == IOption.UNDEF_INCLUDE_PATH
+ || optType == IOption.UNDEF_PREPROCESSOR_SYMBOLS
+ || optType == IOption.UNDEF_INCLUDE_FILES || optType == IOption.UNDEF_LIBRARY_PATHS
+ || optType == IOption.UNDEF_LIBRARY_FILES || optType == IOption.UNDEF_MACRO_FILES) {
+ List<String> outputList = (List<String>) option.getValue();
// Add outputPrefix to each if necessary
- if(outputList != null && outputList.size() > 0){
-//TODO
- try{
- pathStrings = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveStringListValues(
- outputList.toArray(new String[outputList.size()]),
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(
- resPath,
- null, option, tool));
- } catch (BuildMacroException e){
- }
+ if (outputList != null && outputList.size() > 0) {
+ //TODO
+ try {
+ pathStrings = ManagedBuildManager.getBuildMacroProvider().resolveStringListValues(
+ outputList.toArray(new String[outputList.size()]), "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(resPath, null, option, tool));
+ } catch (BuildMacroException e) {
+ }
}
-
- if(pathStrings != null && pathStrings.length > 0 && outputPrefix.length() > 0){
- for (int j=0; j<pathStrings.length; j++) {
- if(pathStrings[j] == null && (pathStrings[j] = pathStrings[j].trim()).length() == 0)
+ if (pathStrings != null && pathStrings.length > 0 && outputPrefix.length() > 0) {
+ for (int j = 0; j < pathStrings.length; j++) {
+ if (pathStrings[j] == null
+ && (pathStrings[j] = pathStrings[j].trim()).length() == 0)
pathStrings[j] = null;
else
pathStrings[j] = outputPrefix + pathStrings[j];
@@ -1312,17 +1282,18 @@ public class BuildDescription implements IBuildDescription {
}
}
- } catch( BuildException ex ) {}
+ } catch (BuildException ex) {
+ }
} else
// 3. If a nameProvider is specified, call it
if (nameProvider != null) {
IPath[] inPaths;
- if(buildRc != null){
+ if (buildRc != null) {
inPaths = new Path[1];
inPaths[0] = buildRc.getLocation();
} else {
inPaths = new Path[rcs.length];
- for(int k = 0; k < inPaths.length; k++){
+ for (int k = 0; k < inPaths.length; k++) {
inPaths[k] = rcs[k].getLocation();
}
}
@@ -1330,24 +1301,18 @@ public class BuildDescription implements IBuildDescription {
} else
// 4. If outputNames is specified, use it
if (outputNames != null) {
- try{
- pathStrings = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveStringListValues(
- outputNames,
+ try {
+ pathStrings = ManagedBuildManager.getBuildMacroProvider().resolveStringListValues(outputNames,
"", //$NON-NLS-1$
" ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(
- resPath,
- null, option, tool));
- } catch (BuildMacroException e){
+ IBuildMacroProvider.CONTEXT_FILE, new FileContextData(resPath, null, option, tool));
+ } catch (BuildMacroException e) {
}
} else {
- // 5. Use the name pattern to generate a transformation macro
- // so that the source names can be transformed into the target names
- // using the built-in string substitution functions of <code>make</code>.
+ // 5. Use the name pattern to generate a transformation macro
+ // so that the source names can be transformed into the target names
+ // using the built-in string substitution functions of <code>make</code>.
if (multOfType || isMultiAction) {
// This case is not handled - a nameProvider or outputNames must be specified
// TODO - report error
@@ -1357,37 +1322,37 @@ public class BuildDescription implements IBuildDescription {
String inExt = resPath.getFileExtension();
String outExt = tool.getOutputExtension(inExt);
if (namePattern == null || namePattern.length() == 0) {
- namePattern = /*outDirPath.toOSString() +*/ outputPrefix + IManagedBuilderMakefileGenerator.WILDCARD;
+ namePattern = /*outDirPath.toOSString() +*/ outputPrefix
+ + IManagedBuilderMakefileGenerator.WILDCARD;
if (outExt != null && outExt.length() > 0) {
namePattern += DOT + outExt;
}
namePatternPath = Path.fromOSString(namePattern);
- }
- else {
+ } else {
if (outputPrefix.length() > 0) {
namePattern = outputPrefix + namePattern;
}
namePatternPath = Path.fromOSString(namePattern);
// If only a file name is specified, add the relative path of this output directory
if (namePatternPath.segmentCount() == 1) {
- namePatternPath = Path.fromOSString(/*outDirPath.toOSString() +*/ namePatternPath.toString());
+ namePatternPath = Path
+ .fromOSString(/*outDirPath.toOSString() +*/ namePatternPath.toString());
}
}
- paths = new IPath[]{resolvePercent(namePatternPath, buildRc.getLocation())};
+ paths = new IPath[] { resolvePercent(namePatternPath, buildRc.getLocation()) };
}
}
- if(paths == null && pathStrings != null){
+ if (paths == null && pathStrings != null) {
paths = new IPath[pathStrings.length];
- for(int k = 0; k < pathStrings.length; k++){
+ for (int k = 0; k < pathStrings.length; k++) {
paths[k] = Path.fromOSString(pathStrings[k]);
}
}
-
- if(paths != null){
+ if (paths != null) {
buildArg = action.createIOType(false, primaryOutput, type);
addOutputs(paths, buildArg, outDirPath);
}
@@ -1401,40 +1366,39 @@ public class BuildDescription implements IBuildDescription {
// In this case, the output file name is the input file name with
// the output extension.
- String outPrefix = tool.getOutputPrefix();
- IPath outFullPath = Path.fromOSString(outDirPath.toOSString() + outPrefix + WILDCARD);
- IPath outLocation;
- String inExt = resPath.getFileExtension();
- String outExt = tool.getOutputExtension(inExt);
- outFullPath = resolvePercent(outFullPath.addFileExtension(outExt), buildRc.getLocation());
+ String outPrefix = tool.getOutputPrefix();
+ IPath outFullPath = Path.fromOSString(outDirPath.toOSString() + outPrefix + WILDCARD);
+ IPath outLocation;
+ String inExt = resPath.getFileExtension();
+ String outExt = tool.getOutputExtension(inExt);
+ outFullPath = resolvePercent(outFullPath.addFileExtension(outExt), buildRc.getLocation());
- outLocation = getProjectLocation().append(outFullPath.removeFirstSegments(1));
+ outLocation = getProjectLocation().append(outFullPath.removeFirstSegments(1));
- BuildIOType buildArg = action.createIOType(false, true, null);
+ BuildIOType buildArg = action.createIOType(false, true, null);
- BuildResource outRc = createResource(outFullPath, getURIForLocation(outLocation));
- buildArg.addResource(outRc);
+ BuildResource outRc = createResource(outFullPath, getURIForLocation(outLocation));
+ buildArg.addResource(outRc);
}
- if(checkFlags(BuildDescriptionManager.DEPFILES)){
- if(buildRc != null){
+ if (checkFlags(BuildDescriptionManager.DEPFILES)) {
+ if (buildRc != null) {
IInputType type = action.getInputType();
String ext = null;
- if(type != null){
+ if (type != null) {
String location = buildRc.getLocation().toOSString();
for (String srcExt : type.getSourceExtensions(tool)) {
- if(location.endsWith(srcExt)){
+ if (location.endsWith(srcExt)) {
ext = srcExt;
break;
}
}
}
- if(ext == null)
+ if (ext == null)
ext = buildRc.getLocation().getFileExtension();
if (ext != null) {
- IManagedDependencyGeneratorType depGenType = tool
- .getDependencyGeneratorForExtension(ext);
+ IManagedDependencyGeneratorType depGenType = tool.getDependencyGeneratorForExtension(ext);
if (depGenType != null) {
IPath depFiles[] = null;
if (depGenType instanceof IManagedDependencyGenerator2) {
@@ -1442,36 +1406,29 @@ public class BuildDescription implements IBuildDescription {
if (context instanceof IToolChain) {
context = ((IToolChain) context).getParent();
}
- IPath path = buildRc.isProjectResource() ? buildRc
- .getFullPath().removeFirstSegments(1)
+ IPath path = buildRc.isProjectResource() ? buildRc.getFullPath().removeFirstSegments(1)
: buildRc.getLocation();
- IResource resource = buildRc.isProjectResource() ? fProject
- .findMember(buildRc.getLocation())
+ IResource resource = buildRc.isProjectResource()
+ ? fProject.findMember(buildRc.getLocation())
: null;
IManagedDependencyInfo info = ((IManagedDependencyGenerator2) depGenType)
- .getDependencySourceInfo(path, resource,
- context, tool,
+ .getDependencySourceInfo(path, resource, context, tool,
getDefaultBuildDirLocation());
if (info instanceof IManagedDependencyCommands) {
- depFiles = ((IManagedDependencyCommands) info)
- .getDependencyFiles();
+ depFiles = ((IManagedDependencyCommands) info).getDependencyFiles();
}
} else if (depGenType.getCalculatorType() == IManagedDependencyGeneratorType.TYPE_COMMAND
&& depGenType instanceof IManagedDependencyGenerator) {
depFiles = new IPath[1];
- depFiles[0] = new Path(buildRc.getLocation()
- .segment(
- buildRc.getLocation()
- .segmentCount() - 1))
- .removeFileExtension()
- .addFileExtension("d"); //$NON-NLS-1$
+ depFiles[0] = new Path(
+ buildRc.getLocation().segment(buildRc.getLocation().segmentCount() - 1))
+ .removeFileExtension().addFileExtension("d"); //$NON-NLS-1$
}
if (depFiles != null) {
- BuildIOType depType = action.createIOType(false,
- false, null);
+ BuildIOType depType = action.createIOType(false, false, null);
addOutputs(depFiles, depType, outDirPath);
}
}
@@ -1480,7 +1437,6 @@ public class BuildDescription implements IBuildDescription {
}
}
-
/* (non-Javadoc)
* If the path contains a %, returns the path resolved using the resource name
*
@@ -1493,9 +1449,8 @@ public class BuildDescription implements IBuildDescription {
return Path.fromOSString(outName);
}
-
- private IPath locationToRel(IPath location){
- if(getProjectLocation().isPrefixOf(location))
+ private IPath locationToRel(IPath location) {
+ if (getProjectLocation().isPrefixOf(location))
return location.removeFirstSegments(getProjectLocation().segmentCount()).setDevice(null);
//TODO
return location;
@@ -1514,14 +1469,14 @@ public class BuildDescription implements IBuildDescription {
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildDescription#getResources()
*/
@Override
- public IBuildResource[] getResources(){
+ public IBuildResource[] getResources() {
return fLocationToRcMap.values().toArray(new IBuildResource[0]);
}
- public IBuildResource[] getResources(boolean generated){
+ public IBuildResource[] getResources(boolean generated) {
List<IBuildResource> list = new ArrayList<IBuildResource>();
for (IBuildResource rc : getResources()) {
- if(generated == (rc.getProducerStep() != fInputStep))
+ if (generated == (rc.getProducerStep() != fInputStep))
list.add(rc);
}
@@ -1536,14 +1491,15 @@ public class BuildDescription implements IBuildDescription {
return fCfg;
}
- public Map<String, String> getEnvironment(){
- if(fEnvironment == null)
+ public Map<String, String> getEnvironment() {
+ if (fEnvironment == null)
fEnvironment = calculateEnvironment();
return fEnvironment;
}
- protected Map<String, String> calculateEnvironment(){
- IBuildEnvironmentVariable variables[] = ManagedBuildManager.getEnvironmentVariableProvider().getVariables(fCfg,true,true);
+ protected Map<String, String> calculateEnvironment() {
+ IBuildEnvironmentVariable variables[] = ManagedBuildManager.getEnvironmentVariableProvider().getVariables(fCfg,
+ true, true);
Map<String, String> map = new HashMap<String, String>();
for (IBuildEnvironmentVariable var : variables) {
@@ -1581,52 +1537,36 @@ public class BuildDescription implements IBuildDescription {
int optType = option.getValueType();
if (optType == IOption.STRING) {
inputs.add(option.getStringValue());
- } else if (
- optType == IOption.STRING_LIST ||
- optType == IOption.LIBRARIES ||
- optType == IOption.OBJECTS ||
- optType == IOption.INCLUDE_FILES ||
- optType == IOption.LIBRARY_PATHS ||
- optType == IOption.LIBRARY_FILES ||
- optType == IOption.MACRO_FILES ||
- optType == IOption.UNDEF_INCLUDE_PATH ||
- optType == IOption.UNDEF_PREPROCESSOR_SYMBOLS ||
- optType == IOption.UNDEF_INCLUDE_FILES ||
- optType == IOption.UNDEF_LIBRARY_PATHS ||
- optType == IOption.UNDEF_LIBRARY_FILES ||
- optType == IOption.UNDEF_MACRO_FILES
- ) {
- inputs = (List<String>)option.getValue();
+ } else if (optType == IOption.STRING_LIST || optType == IOption.LIBRARIES
+ || optType == IOption.OBJECTS || optType == IOption.INCLUDE_FILES
+ || optType == IOption.LIBRARY_PATHS || optType == IOption.LIBRARY_FILES
+ || optType == IOption.MACRO_FILES || optType == IOption.UNDEF_INCLUDE_PATH
+ || optType == IOption.UNDEF_PREPROCESSOR_SYMBOLS
+ || optType == IOption.UNDEF_INCLUDE_FILES || optType == IOption.UNDEF_LIBRARY_PATHS
+ || optType == IOption.UNDEF_LIBRARY_FILES || optType == IOption.UNDEF_MACRO_FILES) {
+ inputs = (List<String>) option.getValue();
}
- for (int j=0; j<inputs.size(); j++) {
+ for (int j = 0; j < inputs.size(); j++) {
String inputName = inputs.get(j).trim();
-
try {
String resolved = null;
- resolved = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveValue(
- inputName,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_OPTION,
- new OptionContextData(
- option,
- tool));
+ resolved = ManagedBuildManager.getBuildMacroProvider().resolveValue(inputName, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_OPTION, new OptionContextData(option, tool));
if ((resolved = resolved.trim()).length() > 0)
inputName = resolved;
} catch (BuildMacroException e) {
}
- if(arg == null)
+ if (arg == null)
arg = step.createIOType(true, primaryInput, type);
addInput(inputName, arg);
}
- } catch( BuildException ex ) {
+ } catch (BuildException ex) {
}
}
@@ -1636,8 +1576,8 @@ public class BuildDescription implements IBuildDescription {
if (addlInputs != null) {
for (IAdditionalInput addlInput : addlInputs) {
int kind = addlInput.getKind();
- if (kind == IAdditionalInput.KIND_ADDITIONAL_INPUT ||
- kind == IAdditionalInput.KIND_ADDITIONAL_INPUT_DEPENDENCY) {
+ if (kind == IAdditionalInput.KIND_ADDITIONAL_INPUT
+ || kind == IAdditionalInput.KIND_ADDITIONAL_INPUT_DEPENDENCY) {
String[] paths = addlInput.getPaths();
if (paths != null) {
for (String path : paths) {
@@ -1645,20 +1585,20 @@ public class BuildDescription implements IBuildDescription {
// Translate the path from project relative to
// build directory relative
- if (!(strPath.startsWith("$("))) { //$NON-NLS-1$
+ if (!(strPath.startsWith("$("))) { //$NON-NLS-1$
- if(arg == null)
+ if (arg == null)
arg = step.createIOType(true, primaryInput, type);
addInput(strPath, arg);
- } else if (strPath.endsWith(")")){ //$NON-NLS-1$
+ } else if (strPath.endsWith(")")) { //$NON-NLS-1$
String var = strPath.substring(2, strPath.length() - 1);
- if((var = var.trim()).length() != 0){
- if(VAR_USER_OBJS.equals(var)){
+ if ((var = var.trim()).length() != 0) {
+ if (VAR_USER_OBJS.equals(var)) {
String objs[] = getUserObjs(step);
- if(objs != null && objs.length != 0){
- if(arg == null)
+ if (objs != null && objs.length != 0) {
+ if (arg == null)
arg = step.createIOType(true, primaryInput, type);
for (String userObj : objs) {
@@ -1666,26 +1606,26 @@ public class BuildDescription implements IBuildDescription {
}
}
//TODO
- } else if (VAR_LIBS.equals(var)){
+ } else if (VAR_LIBS.equals(var)) {
ITool libTool = fCfg.calculateTargetTool();
- if(libTool == null)
+ if (libTool == null)
libTool = step.getTool();
step.setLibTool(libTool);
} else {
- if(arg == null)
+ if (arg == null)
arg = step.createIOType(true, primaryInput, type);
Set<BuildIOType> set = fVarToAddlInSetMap.get(var);
- if(set == null){
+ if (set == null) {
set = new HashSet<BuildIOType>();
fVarToAddlInSetMap.put(var, set);
}
- if(set.add(arg)){
+ if (set.add(arg)) {
for (BuildResource rc : fLocationToRcMap.values()) {
- BuildIOType t = (BuildIOType)rc.getProducerIOType();
- if(t != null && var.equals(t.getLinkId()))
+ BuildIOType t = (BuildIOType) rc.getProducerIOType();
+ if (t != null && var.equals(t.getLinkId()))
arg.addResource(rc);
}
}
@@ -1706,13 +1646,13 @@ public class BuildDescription implements IBuildDescription {
calculateDeps(step);
}
- private void calculateDeps(BuildStep step){
- BuildResource rcs[] = (BuildResource[])step.getInputResources();
+ private void calculateDeps(BuildStep step) {
+ BuildResource rcs[] = (BuildResource[]) step.getInputResources();
Set<IPath> depSet = new HashSet<IPath>();
for (BuildResource rc : rcs) {
IManagedDependencyCalculator depCalc = getDependencyCalculator(step, rc);
- if(depCalc != null){
+ if (depCalc != null) {
IPath paths[] = depCalc.getDependencies();
for (IPath path : paths) {
depSet.add(path);
@@ -1720,7 +1660,7 @@ public class BuildDescription implements IBuildDescription {
}
}
- if(depSet.size() > 0){
+ if (depSet.size() > 0) {
BuildIOType ioType = step.createIOType(true, false, null);
for (IPath path : depSet) {
@@ -1729,23 +1669,23 @@ public class BuildDescription implements IBuildDescription {
}
}
- protected IManagedDependencyCalculator getDependencyCalculator(BuildStep step, BuildResource bRc){
- if(!checkFlags(BuildDescriptionManager.DEPS))
+ protected IManagedDependencyCalculator getDependencyCalculator(BuildStep step, BuildResource bRc) {
+ if (!checkFlags(BuildDescriptionManager.DEPS))
return null;
final ITool tool = step.getTool();
- if(tool == null)
+ if (tool == null)
return null;
IManagedDependencyCalculator depCalc = null;
String ext = bRc.getLocation().getFileExtension();
- if(ext == null)
- ext = ""; //$NON-NLS-1$
+ if (ext == null)
+ ext = ""; //$NON-NLS-1$
IManagedDependencyGeneratorType depGenType = tool.getDependencyGeneratorForExtension(ext);
IManagedDependencyGeneratorType depGen = null;
- if(depGenType != null){
- switch(depGenType.getCalculatorType()){
+ if (depGenType != null) {
+ switch (depGenType.getCalculatorType()) {
case IManagedDependencyGeneratorType.TYPE_NODEPS:
case IManagedDependencyGeneratorType.TYPE_NODEPENDENCIES:
//no dependencies
@@ -1768,32 +1708,28 @@ public class BuildDescription implements IBuildDescription {
depGen = getPDOMDependencyGenerator();
}
- if(depGen != null){
+ if (depGen != null) {
final IResource rc = BuildDescriptionManager.findResourceForBuildResource(bRc);
IBuildObject bo = tool.getParent();
- if(bo instanceof IToolChain)
- bo = ((IToolChain)bo).getParent();
-
- if(rc != null){
- if(depGen instanceof IManagedDependencyGenerator2){
- IManagedDependencyInfo srcInfo = ((IManagedDependencyGenerator2)depGen).getDependencySourceInfo(
- rc.getLocation(),
- rc,
- bo,
- tool,
- getTopBuildDirLocation());
- if(srcInfo instanceof IManagedDependencyCalculator)
- depCalc = (IManagedDependencyCalculator)srcInfo;
-
- } else if (depGen instanceof IManagedDependencyGenerator){
- IResource rcs[] = ((IManagedDependencyGenerator)depGen).findDependencies(rc, fProject);
- if(rcs != null && rcs.length > 0){
+ if (bo instanceof IToolChain)
+ bo = ((IToolChain) bo).getParent();
+
+ if (rc != null) {
+ if (depGen instanceof IManagedDependencyGenerator2) {
+ IManagedDependencyInfo srcInfo = ((IManagedDependencyGenerator2) depGen)
+ .getDependencySourceInfo(rc.getLocation(), rc, bo, tool, getTopBuildDirLocation());
+ if (srcInfo instanceof IManagedDependencyCalculator)
+ depCalc = (IManagedDependencyCalculator) srcInfo;
+
+ } else if (depGen instanceof IManagedDependencyGenerator) {
+ IResource rcs[] = ((IManagedDependencyGenerator) depGen).findDependencies(rc, fProject);
+ if (rcs != null && rcs.length > 0) {
final IPath paths[] = new IPath[rcs.length];
final IBuildObject bof = bo;
- for(int i = 0; i < paths.length; i++){
+ for (int i = 0; i < paths.length; i++) {
paths[i] = rcs[i].getLocation();
}
- depCalc = new IManagedDependencyCalculator(){
+ depCalc = new IManagedDependencyCalculator() {
@Override
public IPath[] getAdditionalTargets() {
@@ -1832,8 +1768,8 @@ public class BuildDescription implements IBuildDescription {
return depCalc;
}
- protected PDOMDependencyGenerator getPDOMDependencyGenerator(){
- if(fPdomDepGen == null)
+ protected PDOMDependencyGenerator getPDOMDependencyGenerator() {
+ if (fPdomDepGen == null)
fPdomDepGen = new PDOMDependencyGenerator();
return fPdomDepGen;
}
@@ -1842,7 +1778,7 @@ public class BuildDescription implements IBuildDescription {
Vector<String> libs = new Vector<String>();
ITool tool = step.getLibTool();
- if(tool != null){
+ if (tool != null) {
// Look for the lib option type
for (IOption option : tool.getOptions()) {
try {
@@ -1856,15 +1792,14 @@ public class BuildDescription implements IBuildDescription {
String command = option.getCommand();
for (String lib : option.getLibraries()) {
try {
- String resolved[] = ManagedBuildManager.getBuildMacroProvider().resolveStringListValueToMakefileFormat(
- lib,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_OPTION,
- new OptionContextData(option, tool));
- if(resolved != null && resolved.length > 0){
+ String resolved[] = ManagedBuildManager.getBuildMacroProvider()
+ .resolveStringListValueToMakefileFormat(lib, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_OPTION,
+ new OptionContextData(option, tool));
+ if (resolved != null && resolved.length > 0) {
for (String string : resolved) {
- if(string.length() > 0)
+ if (string.length() > 0)
libs.add(command + string);
}
}
@@ -1888,48 +1823,47 @@ public class BuildDescription implements IBuildDescription {
public String[] getUserObjs(BuildStep step) {
Vector<String> objs = new Vector<String>();
ITool tool = fCfg.calculateTargetTool();
- if(tool == null)
+ if (tool == null)
tool = step.getTool();
- if(tool != null){
- // Look for the user object option type
- for (IOption option : tool.getOptions()) {
- try {
- if (option.getValueType() == IOption.OBJECTS) {
- String unresolved[] = option.getUserObjects();
- if(unresolved != null && unresolved.length > 0){
- for (String unresolvedObj : unresolved) {
- try {
- String resolved[] = ManagedBuildManager.getBuildMacroProvider().resolveStringListValueToMakefileFormat(
- unresolvedObj,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_OPTION,
- new OptionContextData(option, tool));
- if(resolved != null && resolved.length > 0)
- objs.addAll(Arrays.asList(resolved));
- } catch (BuildMacroException e) {
- // TODO: report error
- continue;
- }
+ if (tool != null) {
+ // Look for the user object option type
+ for (IOption option : tool.getOptions()) {
+ try {
+ if (option.getValueType() == IOption.OBJECTS) {
+ String unresolved[] = option.getUserObjects();
+ if (unresolved != null && unresolved.length > 0) {
+ for (String unresolvedObj : unresolved) {
+ try {
+ String resolved[] = ManagedBuildManager.getBuildMacroProvider()
+ .resolveStringListValueToMakefileFormat(unresolvedObj, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_OPTION,
+ new OptionContextData(option, tool));
+ if (resolved != null && resolved.length > 0)
+ objs.addAll(Arrays.asList(resolved));
+ } catch (BuildMacroException e) {
+ // TODO: report error
+ continue;
}
}
}
- } catch (BuildException e) {
- // TODO: report error
- continue;
}
+ } catch (BuildException e) {
+ // TODO: report error
+ continue;
}
+ }
}
return objs.toArray(new String[objs.size()]);
}
- private BuildResource addInput(String path, BuildIOType buildArg){
- if(path.length() > 0){
- if(path.length() >= 2){
+ private BuildResource addInput(String path, BuildIOType buildArg) {
+ if (path.length() > 0) {
+ if (path.length() >= 2) {
// Unquote path potentially quoted by FileListControl.getNewInputObject()
- if(path.charAt(0) == '"' && path.charAt(path.length() -1) == '"') {
- path = path.substring(1, path.length() -1);
+ if (path.charAt(0) == '"' && path.charAt(path.length() - 1) == '"') {
+ path = path.substring(1, path.length() - 1);
}
}
IPath pPath = Path.fromOSString(path);
@@ -1944,7 +1878,7 @@ public class BuildDescription implements IBuildDescription {
* @param buildArg builds setps BuildIOType to which the input resource is added
* @return BuildResource
*/
- private BuildResource addInput(final IPath path, BuildIOType buildArg){
+ private BuildResource addInput(final IPath path, BuildIOType buildArg) {
BuildResource rc;
// Is path a location, or project relative?
@@ -1953,7 +1887,7 @@ public class BuildDescription implements IBuildDescription {
IPath inFullPath = null;
// If this is a location, check whether we've already created the BuildResource
- rc = (BuildResource)getBuildResource(uri);
+ rc = (BuildResource) getBuildResource(uri);
if (rc == null) {
IFile files[] = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(uri);
for (IFile file : files) {
@@ -1962,10 +1896,11 @@ public class BuildDescription implements IBuildDescription {
break;
}
}
- if(inFullPath == null && files.length > 0)
+ if (inFullPath == null && files.length > 0)
inFullPath = files[0].getFullPath();
- if(inFullPath == null && getProjectLocation().isPrefixOf(path))
- inFullPath = fProject.getFullPath().append(path.removeFirstSegments(getProjectLocation().segmentCount()));
+ if (inFullPath == null && getProjectLocation().isPrefixOf(path))
+ inFullPath = fProject.getFullPath()
+ .append(path.removeFirstSegments(getProjectLocation().segmentCount()));
rc = createResource(inFullPath, uri);
}
} else {
@@ -1979,16 +1914,15 @@ public class BuildDescription implements IBuildDescription {
return rc;
}
-
- void typeCreated(BuildIOType arg){
+ void typeCreated(BuildIOType arg) {
}
- public BuildResource createResource(String projPath){
+ public BuildResource createResource(String projPath) {
Path path = new Path(projPath);
return createResource(path);
}
- public BuildResource createResource(IPath projPath){
+ public BuildResource createResource(IPath projPath) {
return createResource(fProject.getFullPath().append(projPath), createProjectRelativeURI(projPath));
}
@@ -2002,14 +1936,14 @@ public class BuildDescription implements IBuildDescription {
e.printStackTrace();
}
- if(projStore == null)
+ if (projStore == null)
return null;
IFileStore childStore = projStore.getFileStore(projPath);
return childStore.toURI();
}
- public BuildResource createResource(IResource rc){
+ public BuildResource createResource(IResource rc) {
return createResource(rc.getFullPath(), rc.getLocationURI());
}
@@ -2020,8 +1954,8 @@ public class BuildDescription implements IBuildDescription {
* @param locationURI URI of the resource (must be unique)
* @return BuildResource
*/
- public BuildResource createResource(IPath fullWorkspacePath, URI locationURI){
- BuildResource rc = (BuildResource)getBuildResource(locationURI);
+ public BuildResource createResource(IPath fullWorkspacePath, URI locationURI) {
+ BuildResource rc = (BuildResource) getBuildResource(locationURI);
if (rc == null)
// Creating the BuildResource implicitly adds it to fLocationToRcMap.
rc = new BuildResource(this, fullWorkspacePath, locationURI);
@@ -2029,30 +1963,30 @@ public class BuildDescription implements IBuildDescription {
return rc;
}
- public IResourceDelta getDelta(){
+ public IResourceDelta getDelta() {
return fDelta;
}
- private ITool[] getOrderedTools(){
- if(fOrderedTools == null){
+ private ITool[] getOrderedTools() {
+ if (fOrderedTools == null) {
ITool tools[] = fCfg.getFilteredTools();
- for(int i = 0; i < tools.length; i++){
- for(int j = i; j < tools.length; j++){
+ for (int i = 0; i < tools.length; i++) {
+ for (int j = i; j < tools.length; j++) {
ITool tool = tools[j];
ToolOrderEstimation order = getToolOrder(tool);
ITool deps[] = order.getDeps();
boolean put = deps.length == 0;
- if(!put && deps.length <= i){
+ if (!put && deps.length <= i) {
put = true;
for (ITool dep : deps) {
- if(indexOf(dep, tools, 0, i) == -1){
+ if (indexOf(dep, tools, 0, i) == -1) {
put = false;
break;
}
}
}
- if(put){
- if(i != j){
+ if (put) {
+ if (i != j) {
ITool tmp = tools[i];
tools[i] = tools[j];
tools[j] = tmp;
@@ -2066,39 +2000,39 @@ public class BuildDescription implements IBuildDescription {
return fOrderedTools;
}
-// private int indexOf(Object obj, Object array[]){
-// return indexOf(obj, array, 0, -1);
-// }
+ // private int indexOf(Object obj, Object array[]){
+ // return indexOf(obj, array, 0, -1);
+ // }
- private int indexOf(Object obj, Object array[], int start, int stop){
- if(start < 0)
+ private int indexOf(Object obj, Object array[], int start, int stop) {
+ if (start < 0)
start = 0;
- if(stop == -1)
+ if (stop == -1)
stop = array.length;
- if(start < stop){
- for(int i = start; i < stop; i++){
- if(obj == array[i])
+ if (start < stop) {
+ for (int i = start; i < stop; i++) {
+ if (obj == array[i])
return i;
}
}
return -1;
}
- private ToolOrderEstimation getToolOrder(ITool tool){
+ private ToolOrderEstimation getToolOrder(ITool tool) {
ToolOrderEstimation order = fToolOrderMap.get(tool.getId());
- if(order == null){
+ if (order == null) {
order = new ToolOrderEstimation(tool);
fToolOrderMap.put(tool.getId(), order);
}
return order;
}
- private ITool[] doCalcDeps(ITool tool){
- if(!fToolInProcesSet.add(tool)){
+ private ITool[] doCalcDeps(ITool tool) {
+ if (!fToolInProcesSet.add(tool)) {
//TODO throw error?
- if(DbgUtil.DEBUG)
- DbgUtil.trace("loop dependency for tool" + tool.getName()); //$NON-NLS-1$
+ if (DbgUtil.DEBUG)
+ DbgUtil.trace("loop dependency for tool" + tool.getName()); //$NON-NLS-1$
return new ITool[0];
}
@@ -2106,25 +2040,24 @@ public class BuildDescription implements IBuildDescription {
Set<ITool> set = new HashSet<ITool>();
for (ITool t : fCfg.getFilteredTools()) {
- if(t == tool)
+ if (t == tool)
continue;
for (String e : exts) {
- if(t.producesFileType(e)){
+ if (t.producesFileType(e)) {
IInputType inType = tool.getInputType(e);
IOutputType outType = t.getOutputType(e);
- if((inType == null && outType == null)
- || (inType != null && outType != null
- && inType.getBuildVariable().equals(outType.getBuildVariable()))){
+ if ((inType == null && outType == null) || (inType != null && outType != null
+ && inType.getBuildVariable().equals(outType.getBuildVariable()))) {
set.add(t);
ToolOrderEstimation est = getToolOrder(t);
for (ITool dep : est.getDeps()) {
- if(dep != tool)
+ if (dep != tool)
set.add(dep);
- else{
- if(DbgUtil.DEBUG)
- DbgUtil.trace("loop dependency for tool" + tool.getName()); //$NON-NLS-1$
+ else {
+ if (DbgUtil.DEBUG)
+ DbgUtil.trace("loop dependency for tool" + tool.getName()); //$NON-NLS-1$
//TODO throw error
}
}
@@ -2137,11 +2070,11 @@ public class BuildDescription implements IBuildDescription {
return set.toArray(new ITool[set.size()]);
}
- private ITool[] doCalcConsumers(ITool tool){
- if(!fToolInProcesSet.add(tool)){
+ private ITool[] doCalcConsumers(ITool tool) {
+ if (!fToolInProcesSet.add(tool)) {
//TODO throw error?
- if(DbgUtil.DEBUG)
- DbgUtil.trace("loop dependency for tool" + tool.getName()); //$NON-NLS-1$
+ if (DbgUtil.DEBUG)
+ DbgUtil.trace("loop dependency for tool" + tool.getName()); //$NON-NLS-1$
return new ITool[0];
}
@@ -2149,25 +2082,24 @@ public class BuildDescription implements IBuildDescription {
Set<ITool> set = new HashSet<ITool>();
for (ITool t : fCfg.getFilteredTools()) {
- if(t == tool)
+ if (t == tool)
continue;
for (String e : exts) {
- if(t.buildsFileType(e)){
+ if (t.buildsFileType(e)) {
IOutputType inType = tool.getOutputType(e);
IInputType outType = t.getInputType(e);
- if((inType == null && outType == null)
- || (inType != null && outType != null
- && inType.getBuildVariable().equals(outType.getBuildVariable()))){
+ if ((inType == null && outType == null) || (inType != null && outType != null
+ && inType.getBuildVariable().equals(outType.getBuildVariable()))) {
set.add(t);
ToolOrderEstimation est = getToolOrder(t);
for (ITool consumer : est.getConsumers()) {
- if(consumer != tool)
+ if (consumer != tool)
set.add(consumer);
- else{
- if(DbgUtil.DEBUG)
- DbgUtil.trace("loop dependency for tool" + tool.getName()); //$NON-NLS-1$
+ else {
+ if (DbgUtil.DEBUG)
+ DbgUtil.trace("loop dependency for tool" + tool.getName()); //$NON-NLS-1$
//TODO throw error
}
}
@@ -2180,46 +2112,45 @@ public class BuildDescription implements IBuildDescription {
return set.toArray(new ITool[set.size()]);
}
- private IPath[] getGeneratedPaths(){
- if(fGeneratedPaths == null){
+ private IPath[] getGeneratedPaths() {
+ if (fGeneratedPaths == null) {
IConfiguration cfgs[] = fCfg.getManagedProject().getConfigurations();
fGeneratedPaths = new IPath[cfgs.length];
//TODO: this is a temporary hack for obtaining the top generated dirs
//for all configurations. We can not use the buildfile generator here
//since it can only be used for the default configuration
- for(int i = 0; i < cfgs.length; i++){
+ for (int i = 0; i < cfgs.length; i++) {
fGeneratedPaths[i] = fProject.getFullPath().append(cfgs[i].getName());
}
}
return fGeneratedPaths;
}
- protected boolean isGenerated(IPath path){
+ protected boolean isGenerated(IPath path) {
for (IPath genPath : getGeneratedPaths()) {
- if(genPath.isPrefixOf(path))
+ if (genPath.isPrefixOf(path))
return true;
}
return getTopBuildDirFullPath().isPrefixOf(path);
}
- protected void stepCreated(BuildStep step){
+ protected void stepCreated(BuildStep step) {
fStepList.add(step);
ITool tool = step.getTool();
- if(tool != null
- && tool == fCfg.calculateTargetTool()
- // && (prym == null || step.getInputType() == prym)
- ){
- if(fTargetStep != null){
+ if (tool != null && tool == fCfg.calculateTargetTool()
+ // && (prym == null || step.getInputType() == prym)
+ ) {
+ if (fTargetStep != null) {
//TODO: this is an error case, log or perform some special handling
- if(DbgUtil.DEBUG)
- DbgUtil.trace("ERROR: target action already created"); //$NON-NLS-1$
+ if (DbgUtil.DEBUG)
+ DbgUtil.trace("ERROR: target action already created"); //$NON-NLS-1$
}
fTargetStep = step;
}
}
- public BuildStep createStep(ITool tool, IInputType type){
+ public BuildStep createStep(ITool tool, IInputType type) {
return new BuildStep(this, tool, type);
}
@@ -2241,14 +2172,14 @@ public class BuildDescription implements IBuildDescription {
return getTopBuildDirFullPath();
}
- protected void resourceAddedToType(BuildIOType type, BuildResource rc){
- if(!type.isInput()){
+ protected void resourceAddedToType(BuildIOType type, BuildResource rc) {
+ if (!type.isInput()) {
String var = type.getLinkId();
- if(var == null)
+ if (var == null)
var = ""; //$NON-NLS-1$
Set<BuildIOType> set = fVarToAddlInSetMap.get(var);
- if(set != null){
+ if (set != null) {
for (BuildIOType t : set) {
t.addResource(rc);
}
@@ -2256,7 +2187,7 @@ public class BuildDescription implements IBuildDescription {
}
}
- protected void resourceRemovedFromType(BuildIOType type, BuildResource rc){
+ protected void resourceRemovedFromType(BuildIOType type, BuildResource rc) {
}
@@ -2272,20 +2203,20 @@ public class BuildDescription implements IBuildDescription {
* @see org.eclipse.cdt.managedbuilder.buildmodel.IBuildDescription#findBuildResource(org.eclipse.core.resources.IResource)
*/
@Override
- public IBuildResource getBuildResource(IResource resource){
+ public IBuildResource getBuildResource(IResource resource) {
return getBuildResource(calcResourceLocation(resource));
}
- public IBuildResource getBuildResourceForFullPath(IPath fullPath){
+ public IBuildResource getBuildResourceForFullPath(IPath fullPath) {
IPath location = calcLocationForFullPath(fullPath);
return getBuildResource(location);
}
- protected IPath calcLocationForFullPath(IPath fullPath){
+ protected IPath calcLocationForFullPath(IPath fullPath) {
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IProject proj = root.getProject(fullPath.segment(0));
IPath rcLocation = proj.getLocation();
- if(rcLocation != null){
+ if (rcLocation != null) {
rcLocation = rcLocation.append(fullPath.removeFirstSegments(1));
} else {
rcLocation = root.getLocation().append(fullPath);
@@ -2293,38 +2224,36 @@ public class BuildDescription implements IBuildDescription {
return rcLocation;
}
- private void initToolInfos(){
+ private void initToolInfos() {
fToolInfos = PathSettingsContainer.createRootContainer();
for (IResourceInfo rcInfo : fCfg.getResourceInfos()) {
-// if(rcInfo.isExcluded())
-// continue;
+ // if(rcInfo.isExcluded())
+ // continue;
ToolInfoHolder h = getToolInfo(rcInfo.getPath(), true);
- if(rcInfo instanceof IFolderInfo){
- IFolderInfo fo = (IFolderInfo)rcInfo;
+ if (rcInfo instanceof IFolderInfo) {
+ IFolderInfo fo = (IFolderInfo) rcInfo;
h.fExtToToolAndTypeListMap = initToolAndTypeMap(fo);
}
}
}
- private ToolInfoHolder getToolInfo(BuildResource rc){
- IPath path = rc.isProjectResource() ?
- rc.getFullPath().removeFirstSegments(1).makeRelative() :
- Path.EMPTY;
+ private ToolInfoHolder getToolInfo(BuildResource rc) {
+ IPath path = rc.isProjectResource() ? rc.getFullPath().removeFirstSegments(1).makeRelative() : Path.EMPTY;
return getToolInfo(path);
}
- private ToolInfoHolder getToolInfo(IPath path){
+ private ToolInfoHolder getToolInfo(IPath path) {
return getToolInfo(path, false);
}
- private ToolInfoHolder getToolInfo(IPath path, boolean create){
+ private ToolInfoHolder getToolInfo(IPath path, boolean create) {
PathSettingsContainer child = fToolInfos.getChildContainer(path, create, create);
ToolInfoHolder h = null;
- if(child != null){
- h = (ToolInfoHolder)child.getValue();
- if(h == null && create){
+ if (child != null) {
+ h = (ToolInfoHolder) child.getValue();
+ if (h == null && create) {
h = new ToolInfoHolder();
child.setValue(h);
}
@@ -2332,8 +2261,8 @@ public class BuildDescription implements IBuildDescription {
return h;
}
- public IBuildStep getCleanStep(){
- if(fCleanStep == null){
+ public IBuildStep getCleanStep() {
+ if (fCleanStep == null) {
fCleanStep = new BuildStep(this, null, null);
}
return fCleanStep;
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 5fbd9d2722a..93ad4f7fadd 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
@@ -54,29 +54,31 @@ public class BuildDescriptionGnuMakefileGenerator {
private class DescriptionVisitor implements IStepVisitor {
Writer fWriter;
- DescriptionVisitor(Writer writer){
+
+ DescriptionVisitor(Writer writer) {
fWriter = writer;
}
@Override
public int visit(IBuildStep step) throws CoreException {
- if(step == fDes.getInputStep() || step == fDes.getOutputStep())
+ if (step == fDes.getInputStep() || step == fDes.getOutputStep())
return VISIT_CONTINUE;
try {
write(fWriter, step);
} catch (IOException e) {
- throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), ManagedMakeMessages.getString("BuildDescriptionGnuMakefileGenerator.0"), e)); //$NON-NLS-1$
+ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ ManagedMakeMessages.getString("BuildDescriptionGnuMakefileGenerator.0"), e)); //$NON-NLS-1$
}
return VISIT_CONTINUE;
}
}
- public BuildDescriptionGnuMakefileGenerator(IBuildDescription des){
+ public BuildDescriptionGnuMakefileGenerator(IBuildDescription des) {
fDes = des;
}
- public void store(OutputStream stream) throws CoreException{
+ public void store(OutputStream stream) throws CoreException {
Writer writer = createWriter(stream);
try {
@@ -109,12 +111,13 @@ public class BuildDescriptionGnuMakefileGenerator {
writer.flush();
} catch (IOException e) {
- throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), ManagedMakeMessages.getString("BuildDescriptionGnuMakefileGenerator.1"), e)); //$NON-NLS-1$
+ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ ManagedMakeMessages.getString("BuildDescriptionGnuMakefileGenerator.1"), e)); //$NON-NLS-1$
}
}
- protected Writer createWriter(OutputStream stream){
+ protected Writer createWriter(OutputStream stream) {
try {
return new OutputStreamWriter(stream, ENCODING);
} catch (UnsupportedEncodingException e1) {
@@ -124,7 +127,7 @@ public class BuildDescriptionGnuMakefileGenerator {
}
- protected String createVarRef(String var){
+ protected String createVarRef(String var) {
return new StringBuilder().append(VARREF_PREFIX).append(var).append(VARREF_SUFFIX).toString();
}
@@ -132,10 +135,10 @@ public class BuildDescriptionGnuMakefileGenerator {
writer.write(LINE_SEPARATOR);
String target, deps;
- if(step == fDes.getOutputStep()){
+ if (step == fDes.getOutputStep()) {
target = OUT_STEP_RULE;
deps = createVarRef(VAR_TARGETS);
- } else if (step == fDes.getInputStep()){
+ } else if (step == fDes.getInputStep()) {
target = IN_STEP_RULE;
deps = ""; //$NON-NLS-1$
} else {
@@ -148,7 +151,7 @@ public class BuildDescriptionGnuMakefileGenerator {
writeRuleHeader(writer, target, deps);
IBuildCommand[] cmds = step.getCommands(null, null, null, true);
- for(int i = 0; i < cmds.length; i++){
+ for (int i = 0; i < cmds.length; i++) {
String cmdStr = toString(cmds[i]);
writeCommand(writer, cmdStr);
}
@@ -158,24 +161,24 @@ public class BuildDescriptionGnuMakefileGenerator {
}
- protected void writeCommand(Writer writer, String cmd) throws IOException{
+ protected void writeCommand(Writer writer, String cmd) throws IOException {
writer.write(TAB);
writer.write(cmd);
writer.write(LINE_SEPARATOR);
}
- protected String toString(IBuildCommand cmd){
+ protected String toString(IBuildCommand cmd) {
StringBuilder buf = new StringBuilder();
buf.append(cmd.getCommand());
String argsString = CDataUtil.arrayToString(cmd.getArgs(), SPACE);
- if(argsString != null && argsString.length() != 0){
+ if (argsString != null && argsString.length() != 0) {
buf.append(SPACE);
buf.append(argsString);
}
return removeDotDotSlashesAndBackSlashesHack(buf.toString());
}
- protected void writeRuleHeader(Writer writer, String target, String deps) throws IOException{
+ protected void writeRuleHeader(Writer writer, String target, String deps) throws IOException {
writer.write(target);
writer.write(TARGET_SEPARATOR);
writer.write(SPACE);
@@ -183,10 +186,10 @@ public class BuildDescriptionGnuMakefileGenerator {
writer.write(LINE_SEPARATOR);
}
- protected String toString(IBuildResource[] rcs){
+ protected String toString(IBuildResource[] rcs) {
StringBuilder buf = new StringBuilder();
- for(int i = 0; i < rcs.length; i++){
- if(i != 0)
+ for (int i = 0; i < rcs.length; i++) {
+ if (i != 0)
buf.append(SPACE);
buf.append(toString(rcs[i]));
@@ -194,8 +197,9 @@ public class BuildDescriptionGnuMakefileGenerator {
return buf.toString();
}
- protected String toString(IBuildResource rc){
- return removeDotDotSlashesAndBackSlashesHack(BuildDescriptionManager.getRelPath(fDes.getDefaultBuildDirLocation(), rc.getLocation()).toString());
+ protected String toString(IBuildResource rc) {
+ return removeDotDotSlashesAndBackSlashesHack(
+ BuildDescriptionManager.getRelPath(fDes.getDefaultBuildDirLocation(), rc.getLocation()).toString());
}
/*
@@ -203,17 +207,17 @@ public class BuildDescriptionGnuMakefileGenerator {
* this is needed to overcome an assumption that the source root is ../
* the BuildDescription calculation mechanism should be fixed to remove this assumption
*/
- private String removeDotDotSlashesAndBackSlashesHack(String str){
+ private String removeDotDotSlashesAndBackSlashesHack(String str) {
str = removeDotDotSlashes(str);
return removeDotDotBackslashes(str);
}
- private String removeDotDotSlashes(String str){
+ private String removeDotDotSlashes(String str) {
int index = str.indexOf(DOT_DOT_SLASH, 0);
- if(index != -1){
+ if (index != -1) {
StringBuilder buf = new StringBuilder();
int start = 0;
- for(; index != -1; index = str.indexOf(DOT_DOT_SLASH, start)){
+ for (; index != -1; index = str.indexOf(DOT_DOT_SLASH, start)) {
buf.append(str.substring(start, index));
start = index + DOT_DOT_SLASH.length();
}
@@ -223,12 +227,12 @@ public class BuildDescriptionGnuMakefileGenerator {
return str;
}
- private String removeDotDotBackslashes(String str){
+ private String removeDotDotBackslashes(String str) {
int index = str.indexOf(DOT_DOT_BACKSLASH, 0);
- if(index != -1){
+ if (index != -1) {
StringBuilder buf = new StringBuilder();
int start = 0;
- for(; index != -1; index = str.indexOf(DOT_DOT_BACKSLASH, start)){
+ for (; index != -1; index = str.indexOf(DOT_DOT_BACKSLASH, start)) {
buf.append(str.substring(start, index));
start = index + DOT_DOT_BACKSLASH.length();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildGroup.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildGroup.java
index e6219dc426c..7ef23ade637 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildGroup.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildGroup.java
@@ -28,8 +28,8 @@ public class BuildGroup {
public IBuildStep[] getSteps() {
return fActions.toArray(new IBuildStep[fActions.size()]);
}
-
- public void addAction(BuildStep action){
+
+ public void addAction(BuildStep action) {
fActions.add(action);
}
@@ -46,10 +46,10 @@ public class BuildGroup {
public boolean needsRebuild() {
return fNeedsRebuild;
}
-
- public void setRebuildState(boolean rebuild){
+
+ public void setRebuildState(boolean rebuild) {
fNeedsRebuild = rebuild;
-
+
for (BuildStep action : fActions) {
action.setRebuildState(rebuild);
}
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 18f16770cb3..debdd80b591 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
@@ -31,27 +31,28 @@ public class BuildIOType implements IBuildIOType {
private String fLinkId;
private IBuildObject fIoType;
- protected BuildIOType(BuildStep action, boolean input, boolean primary,/* BuildPattern pattern,*/ IBuildObject ioType ) {
+ protected BuildIOType(BuildStep action, boolean input, boolean primary,
+ /* BuildPattern pattern,*/ IBuildObject ioType) {
fStep = action;
fIsInput = input;
fIsPrimary = primary;
- if(ioType != null){
- if(input){
- if(ioType instanceof IInputType)
- fLinkId = ((IInputType)ioType).getBuildVariable();
+ if (ioType != null) {
+ if (input) {
+ if (ioType instanceof IInputType)
+ fLinkId = ((IInputType) ioType).getBuildVariable();
else
- throw new IllegalArgumentException("wrong arg"); //$NON-NLS-1$
+ throw new IllegalArgumentException("wrong arg"); //$NON-NLS-1$
} else {
- if(ioType instanceof IOutputType) {
- fLinkId = ((IOutputType)ioType).getBuildVariable();
+ if (ioType instanceof IOutputType) {
+ fLinkId = ((IOutputType) ioType).getBuildVariable();
} else
- throw new IllegalArgumentException("wrong arg"); //$NON-NLS-1$
+ throw new IllegalArgumentException("wrong arg"); //$NON-NLS-1$
}
fIoType = ioType;
} else {
//TODO
}
- ((BuildDescription)fStep.getBuildDescription()).typeCreated(this);
+ ((BuildDescription) fStep.getBuildDescription()).typeCreated(this);
}
@Override
@@ -64,27 +65,27 @@ public class BuildIOType implements IBuildIOType {
return fStep;
}
- public void addResource(BuildResource rc){
+ public void addResource(BuildResource rc) {
fResources.add(rc);
rc.addToArg(this);
- if(DbgUtil.DEBUG)
- 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$
+ if (DbgUtil.DEBUG)
+ 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);
+ ((BuildDescription) fStep.getBuildDescription()).resourceAddedToType(this, rc);
}
- public void removeResource(BuildResource 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$
- + " from the action " + DbgUtil.stepName(fStep)); //$NON-NLS-1$
+ 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$
+ + " from the action " + DbgUtil.stepName(fStep)); //$NON-NLS-1$
- ((BuildDescription)fStep.getBuildDescription()).resourceRemovedFromType(this, rc);
+ ((BuildDescription) fStep.getBuildDescription()).resourceRemovedFromType(this, rc);
}
@Override
@@ -92,19 +93,20 @@ public class BuildIOType implements IBuildIOType {
return fIsInput;
}
- public boolean isPrimary(){
+ public boolean isPrimary() {
return fIsPrimary;
}
- public String getLinkId(){
- if(!fIsInput && fStep.getTool() != null && /*(fLinkId == null || fLinkId.length() == 0) && */
- fStep.getTool().getCustomBuildStep()){
+ public String getLinkId() {
+ if (!fIsInput && fStep.getTool() != null && /*(fLinkId == null || fLinkId.length() == 0) && */
+ fStep.getTool().getCustomBuildStep()) {
IBuildResource rcs[] = getResources();
- if(rcs.length != 0){
- BuildDescription.ToolAndType tt = ((BuildDescription)fStep.getBuildDescription()).getToolAndType((BuildResource)rcs[0], false);
- if(tt != null){
+ if (rcs.length != 0) {
+ BuildDescription.ToolAndType tt = ((BuildDescription) fStep.getBuildDescription())
+ .getToolAndType((BuildResource) rcs[0], false);
+ if (tt != null) {
IInputType type = tt.fTool.getPrimaryInputType();
- if(type != null)
+ if (type != null)
fLinkId = type.getBuildVariable();
} else {
}
@@ -114,14 +116,14 @@ public class BuildIOType implements IBuildIOType {
return fLinkId;
}
- public IBuildObject getIoType(){
+ public IBuildObject getIoType() {
return fIoType;
}
- BuildResource[] remove(){
- BuildResource rcs[] = (BuildResource[])getResources();
+ BuildResource[] remove() {
+ BuildResource rcs[] = (BuildResource[]) getResources();
- for(int i = 0; i < rcs.length; i++){
+ for (int i = 0; i < rcs.length; i++) {
removeResource(rcs[i]);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildModelMessages.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildModelMessages.java
index 76e06dabc45..163e96da447 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildModelMessages.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildModelMessages.java
@@ -21,8 +21,7 @@ import java.util.ResourceBundle;
public class BuildModelMessages {
private static final String BUNDLE_NAME = "org.eclipse.cdt.managedbuilder.internal.buildmodel.BuildModelMessages"; //$NON-NLS-1$
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
private BuildModelMessages() {
}
@@ -30,7 +29,7 @@ public class BuildModelMessages {
public static String getString(String key) {
return getResourceString(key);
}
-
+
public static String getResourceString(String key) {
try {
return RESOURCE_BUNDLE.getString(key);
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildMultiStatus.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildMultiStatus.java
index 089f327f413..c1c9210d367 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildMultiStatus.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildMultiStatus.java
@@ -20,8 +20,8 @@ import org.eclipse.core.runtime.MultiStatus;
*
*/
public class BuildMultiStatus extends MultiStatus {
-
- public BuildMultiStatus(String message, Throwable exception){
+
+ public BuildMultiStatus(String message, Throwable exception) {
super(ManagedBuilderCorePlugin.getUniqueIdentifier(), 0, message, exception);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildProcessManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildProcessManager.java
index 318f38d35ba..c6591c72815 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildProcessManager.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildProcessManager.java
@@ -27,7 +27,7 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
/**
- * This class implements process pool management for internal builder
+ * This class implements process pool management for internal builder
*/
public class BuildProcessManager {
protected OutputStream out;
@@ -35,10 +35,10 @@ public class BuildProcessManager {
protected boolean show;
protected Vector<ProcessLauncher> processes;
protected int maxProcesses;
-
+
/**
* Initializes process manager
- *
+ *
* @param _out Output stream
* @param _err Error output stream
* @param _show If true, print command line before launching
@@ -50,34 +50,36 @@ public class BuildProcessManager {
maxProcesses = _procNumber;
processes = new Vector<ProcessLauncher>(Math.min(10, maxProcesses), 10);
}
-
+
/**
* Returns maximum number of processes
*/
public int getMaxProcesses() {
return maxProcesses;
}
-
+
/**
- * Performs an attempt to launch new process. Returns BuildProcessLauncher
- * if it was successfully launched, null if there is no room for it yet in
+ * Performs an attempt to launch new process. Returns BuildProcessLauncher
+ * if it was successfully launched, null if there is no room for it yet in
* the process pool.
- *
+ *
* @param cmd Command to launch
* @param cwd Command working directory
- * @param monitor Progress monitor for this task
+ * @param monitor Progress monitor for this task
*/
public ProcessLauncher launchProcess(IBuildCommand cmd, IPath cwd, IProgressMonitor monitor) {
for (int i = 0; i < maxProcesses; i++) {
if (i >= processes.size()) {
- ProcessLauncher process = new ProcessLauncher(cmd.getCommand(), cmd.getArgs(), mapToStringArray(cmd.getEnvironment()), cwd, out, err, monitor, show);
+ ProcessLauncher process = new ProcessLauncher(cmd.getCommand(), cmd.getArgs(),
+ mapToStringArray(cmd.getEnvironment()), cwd, out, err, monitor, show);
processes.add(process);
process.launch();
return process;
-
+
}
if (processes.get(i).queryState() == ProcessLauncher.STATE_DONE) {
- ProcessLauncher process = new ProcessLauncher(cmd.getCommand(), cmd.getArgs(), mapToStringArray(cmd.getEnvironment()), cwd, out, err, monitor, show);
+ ProcessLauncher process = new ProcessLauncher(cmd.getCommand(), cmd.getArgs(),
+ mapToStringArray(cmd.getEnvironment()), cwd, out, err, monitor, show);
processes.set(i, process);
process.launch();
return process;
@@ -85,9 +87,9 @@ public class BuildProcessManager {
}
return null;
}
-
+
/**
- * Checks states of all currently running processes. If it finds
+ * Checks states of all currently running processes. If it finds
* one with state other than STATE_DONE or STATE_RUNNING, it is
* returned as a result. Otherwise this method returns null.
*/
@@ -97,19 +99,19 @@ public class BuildProcessManager {
if (state != ProcessLauncher.STATE_RUNNING && state != ProcessLauncher.STATE_DONE)
return process;
}
-
+
return null;
}
/**
- * Checks states of all currently running processes.
+ * Checks states of all currently running processes.
*/
public boolean hasEmpty() {
if (processes.size() < maxProcesses)
return true;
-
+
for (ProcessLauncher process : processes) {
- if (process.queryState() != ProcessLauncher.STATE_RUNNING)
+ if (process.queryState() != ProcessLauncher.STATE_RUNNING)
return true;
}
return false;
@@ -121,26 +123,24 @@ public class BuildProcessManager {
public int getThreadsUsed() {
return processes.size();
}
-
-
/**
* Converts map to strings array
*/
- protected String[] mapToStringArray(Map<String, String> map){
- if(map == null)
+ protected 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()]);
}
-
+
/**
* @return Number of processors detected
* @deprecated since CDT 9.0 - just use Runtime.getRuntime().availableProcessors()
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 565ba82df29..1f2ee3d97fe 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
@@ -40,13 +40,13 @@ public class BuildResource implements IBuildResource {
private BuildDescription fInfo;
private URI fLocationURI;
- protected BuildResource(BuildDescription info, IResource rc){
+ protected BuildResource(BuildDescription info, IResource rc) {
this(info, info.calcResourceLocation(rc), rc.getLocationURI());
}
- protected BuildResource(BuildDescription info, IPath fullWorkspacePath, URI locationURI){
+ protected BuildResource(BuildDescription info, IPath fullWorkspacePath, URI locationURI) {
- if(locationURI == null)
+ if (locationURI == null)
throw new IllegalArgumentException(); // must point to somewhere!
fLocationURI = locationURI;
@@ -58,24 +58,25 @@ public class BuildResource implements IBuildResource {
info.resourceCreated(this);
- if(DbgUtil.DEBUG)
- DbgUtil.trace("resource " + fullWorkspacePath + " created"); //$NON-NLS-1$ //$NON-NLS-2$
+ 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) {
+ if (fFullWorkspacePath == null) {
return new Path(fLocationURI.getPath());
}
IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(fFullWorkspacePath);
- if(resource == null) {
+ if (resource == null) {
return new Path(fLocationURI.getPath());
}
- if(resource.getLocation() != null)
+ if (resource.getLocation() != null)
return resource.getLocation();
else
return new Path(fLocationURI.getPath());
@@ -123,64 +124,65 @@ public class BuildResource implements IBuildResource {
}
public void setRemoved(boolean removed) {
- if(DbgUtil.DEBUG){
- if(removed)
+ if (DbgUtil.DEBUG) {
+ if (removed)
DbgUtil.trace("REMOVED state: resource " + DbgUtil.resourceName(this)); //$NON-NLS-1$
}
fIsRemoved = removed;
- if(fIsRemoved)
+ if (fIsRemoved)
fNeedsRebuild = false;
}
- public void setRebuildState(boolean rebuild){
+ public void setRebuildState(boolean rebuild) {
fNeedsRebuild = rebuild;
}
- protected void addToArg(BuildIOType arg){
- if(arg.isInput()){
+ protected void addToArg(BuildIOType arg) {
+ if (arg.isInput()) {
fDepArgs.add(arg);
} else {
- if(fProducerArg == null){
+ if (fProducerArg == null) {
fProducerArg = arg;
- } else if(fProducerArg.getStep() == fInfo.getInputStep()) {
- BuildStep inStep = (BuildStep)fInfo.getInputStep();
+ } else if (fProducerArg.getStep() == fInfo.getInputStep()) {
+ BuildStep inStep = (BuildStep) fInfo.getInputStep();
inStep.removeResource(fProducerArg, this, true);
fProducerArg = arg;
} else {
// Bug 461628
// Check if this resource is an output produced by a Tool that support merging in which case
// a producer can already be defined by a previous step. This is supported.
-
+
IBuildStep step = fProducerArg.getStep();
- ITool tool = step instanceof BuildStep ? ((BuildStep)(step)).getTool() : null;
- if(tool != null && !arg.isInput()) {
+ ITool tool = step instanceof BuildStep ? ((BuildStep) (step)).getTool() : null;
+ if (tool != null && !arg.isInput()) {
return;
}
- String err = "ProducerArgument not null!!!\n"; //$NON-NLS-1$
+ String err = "ProducerArgument not null!!!\n"; //$NON-NLS-1$
String rcName = DbgUtil.resourceName(this);
String step1Name = DbgUtil.stepName(fProducerArg.getStep());
String step2Name = DbgUtil.stepName(arg.getStep());
- String rcs[] = new String[]{rcName, step1Name, step2Name};
+ 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$
+ if (DbgUtil.DEBUG) {
+ err = err + externalizedErr + "curent producer: " + DbgUtil.dumpStep(fProducerArg.getStep()) //$NON-NLS-1$
+ + "\n producer attempt: " + DbgUtil.dumpStep(arg.getStep()); //$NON-NLS-1$
}
throw new IllegalArgumentException(externalizedErr);
}
}
}
- void removeFromArg(BuildIOType arg){
- if(arg.isInput()){
+ void removeFromArg(BuildIOType arg) {
+ if (arg.isInput()) {
fDepArgs.remove(arg);
} else {
- if(fProducerArg == arg){
+ if (fProducerArg == arg) {
fProducerArg = null;
- }else
- throw new IllegalArgumentException("Resource is not produced by this arg!!!"); //$NON-NLS-1$
+ } else
+ throw new IllegalArgumentException("Resource is not produced by this arg!!!"); //$NON-NLS-1$
}
}
@@ -189,27 +191,27 @@ public class BuildResource implements IBuildResource {
return fIsProjectRc;
}
- BuildIOType[][] clear(){
+ BuildIOType[][] clear() {
BuildIOType types[][] = new BuildIOType[2][];
types[0] = new BuildIOType[1];
types[0][0] = fProducerArg;
- BuildIOType outs[] = (BuildIOType[])getDependentIOTypes();
+ BuildIOType outs[] = (BuildIOType[]) getDependentIOTypes();
types[1] = outs;
- if(fProducerArg != null)
+ if (fProducerArg != null)
fProducerArg.removeResource(this);
- for(int i = 0; i < outs.length; i++){
+ for (int i = 0; i < outs.length; i++) {
outs[i].removeResource(this);
}
return types;
}
- BuildIOType[][] remove(){
+ BuildIOType[][] remove() {
BuildIOType types[][] = clear();
- if(DbgUtil.DEBUG)
- DbgUtil.trace("resource " + DbgUtil.resourceName(this) + " removed"); //$NON-NLS-1$ //$NON-NLS-2$
+ if (DbgUtil.DEBUG)
+ DbgUtil.trace("resource " + DbgUtil.resourceName(this) + " removed"); //$NON-NLS-1$ //$NON-NLS-2$
fInfo.resourceRemoved(this);
fInfo = null;
@@ -218,14 +220,14 @@ public class BuildResource implements IBuildResource {
}
@Override
- public IBuildDescription getBuildDescription(){
+ public IBuildDescription getBuildDescription() {
return fInfo;
}
@Override
public IBuildStep[] getDependentSteps() {
Set<IBuildStep> set = new HashSet<IBuildStep>();
- for(Iterator<BuildIOType> iter = fDepArgs.iterator(); iter.hasNext();){
+ for (Iterator<BuildIOType> iter = fDepArgs.iterator(); iter.hasNext();) {
set.add(iter.next().getStep());
}
return set.toArray(new BuildStep[set.size()]);
@@ -233,7 +235,7 @@ public class BuildResource implements IBuildResource {
@Override
public IBuildStep getProducerStep() {
- if(fProducerArg != null)
+ if (fProducerArg != null)
return fProducerArg.getStep();
return null;
}
@@ -243,7 +245,7 @@ public class BuildResource implements IBuildResource {
StringBuilder buf = new StringBuilder();
buf.append("BR "); //$NON-NLS-1$
IPath fullPath = getFullPath();
- if(fullPath != null)
+ if (fullPath != null)
buf.append("WSP|").append(fullPath); //$NON-NLS-1$
else
buf.append("FS|").append(getLocation()); //$NON-NLS-1$
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 d95728072fa..c677a322025 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
@@ -55,8 +55,8 @@ public class BuildStateManager {
return doHandleResourceRemove(rc);
}
- private boolean doHandleResourceRemove(IResource rc){
- switch(rc.getType()){
+ private boolean doHandleResourceRemove(IResource rc) {
+ switch (rc.getType()) {
case IResource.PROJECT:
removeProjectInfo(rc.getProject());
return false;
@@ -78,7 +78,7 @@ public class BuildStateManager {
@Override
public void handleEvent(CProjectDescriptionEvent event) {
- switch(event.getEventType()){
+ switch (event.getEventType()) {
case CProjectDescriptionEvent.APPLIED:
case CProjectDescriptionEvent.LOADED:
ICDescriptionDelta delta = event.getProjectDelta();
@@ -87,8 +87,8 @@ public class BuildStateManager {
}
}
- private void processAppliedDelta(CProjectDescriptionEvent event, ICDescriptionDelta delta){
- if(delta == null)
+ private void processAppliedDelta(CProjectDescriptionEvent event, ICDescriptionDelta delta) {
+ if (delta == null)
return;
IProjectBuildState pbs = null;
@@ -99,13 +99,13 @@ public class BuildStateManager {
break;
case ICDescriptionDelta.CHANGED:
ICDescriptionDelta[] children = delta.getChildren();
- for(int i = 0; i < children.length; i++){
- if(children[i].getDeltaKind() == ICDescriptionDelta.REMOVED){
- if(pbs == null){
+ for (int i = 0; i < children.length; i++) {
+ if (children[i].getDeltaKind() == ICDescriptionDelta.REMOVED) {
+ if (pbs == null) {
pbs = getProjectBuildState(event.getProject());
String id = children[i].getSetting().getId();
IConfigurationBuildState cbs = pbs.getConfigurationBuildState(id, false);
- if(cbs != null){
+ if (cbs != null) {
apply = true;
pbs.removeConfigurationBuildState(id);
}
@@ -117,82 +117,80 @@ public class BuildStateManager {
break;
}
- if(pbs != null && apply){
+ if (pbs != null && apply) {
setProjectBuildState(event.getProject(), pbs);
}
}
@Override
- protected IResourceMoveHandler createResourceMoveHandler(
- IResourceChangeEvent event) {
+ protected IResourceMoveHandler createResourceMoveHandler(IResourceChangeEvent event) {
return new ResourceMoveHandler();
}
}
- private void removeProjectInfo(IProject project){
+ private void removeProjectInfo(IProject project) {
File f = getPrefsDir(project);
- if(f.exists()){
+ if (f.exists()) {
File[] children = f.listFiles();
- for(int i = 0; i < children.length; i++){
+ for (int i = 0; i < children.length; i++) {
children[i].delete();
}
f.delete();
}
}
- private BuildStateManager(){
+ private BuildStateManager() {
}
- public static BuildStateManager getInstance(){
- if(fInstance == null)
+ public static BuildStateManager getInstance() {
+ if (fInstance == null)
fInstance = new BuildStateManager();
return fInstance;
}
- public void startup(){
- if(fListener == null){
+ 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
- | IResourceChangeEvent.PRE_DELETE
- | IResourceChangeEvent.PRE_CLOSE);
+ CoreModel.getDefault().getProjectDescriptionManager().addCProjectDescriptionListener(fListener,
+ CProjectDescriptionEvent.APPLIED | CProjectDescriptionEvent.LOADED);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(fListener, IResourceChangeEvent.POST_CHANGE
+ | IResourceChangeEvent.PRE_DELETE | IResourceChangeEvent.PRE_CLOSE);
}
}
- public void shutdown(){
- if(fListener != null){
+ public void shutdown() {
+ if (fListener != null) {
ResourcesPlugin.getWorkspace().removeResourceChangeListener(fListener);
CoreModel.getDefault().getProjectDescriptionManager().removeCProjectDescriptionListener(fListener);
}
}
- public IProjectBuildState getProjectBuildState(IProject project){
+ public IProjectBuildState getProjectBuildState(IProject project) {
return new ProjectBuildState(project);
}
- public void setProjectBuildState(IProject project, IProjectBuildState state){
- ((ProjectBuildState)state).serialize();
+ public void setProjectBuildState(IProject project, IProjectBuildState state) {
+ ((ProjectBuildState) state).serialize();
}
- private IPath getPrefsDirPath(){
+ private IPath getPrefsDirPath() {
IPath path = ManagedBuilderCorePlugin.getDefault().getStateLocation();
path = path.append(PREFS_LOCATION);
return path;
}
- IPath getPrefsDirPath(IProject project){
+ IPath getPrefsDirPath(IProject project) {
IPath path = getPrefsDirPath();
path = path.append(project.getName());
return path;
}
- private File getPrefsDir(IProject project){
+ private File getPrefsDir(IProject project) {
IPath path = getPrefsDirPath(project);
File file = path.toFile();
-// if(!file.exists())
-// file.mkdirs();
+ // if(!file.exists())
+ // file.mkdirs();
return file;
}
}
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 8d579bfde19..9eeaead489c 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
@@ -59,7 +59,7 @@ public class BuildStep implements IBuildStep {
* On Windows XP and above, the maximum command line length is 8191, on Linux it is at least 131072, but
* that includes the environment. We want to limit the invocation of a single command to this number of
* characters, and we want to ensure that the number isn't so low as to slow down operation.
- *
+ *
* Doing each rm in its own command would be very slow, especially on Windows.
*/
private static final int MAX_CLEAN_LENGTH = 6000;
@@ -98,8 +98,7 @@ public class BuildStep implements IBuildStep {
@Override
public boolean needsRebuild() {
- if (fNeedsRebuild || (fTool != null && fTool.needsRebuild())
- || (fLibTool != null && fLibTool.needsRebuild()))
+ if (fNeedsRebuild || (fTool != null && fTool.needsRebuild()) || (fLibTool != null && fLibTool.needsRebuild()))
return true;
if (fBuildGroup != null && fBuildGroup.needsRebuild())
@@ -242,8 +241,7 @@ public class BuildStep implements IBuildStep {
}
@Override
- public IBuildCommand[] getCommands(IPath cwd, Map inputArgValues, Map outputArgValues,
- boolean resolveAll) {
+ public IBuildCommand[] getCommands(IPath cwd, Map inputArgValues, Map outputArgValues, boolean resolveAll) {
if (cwd == null)
cwd = calcCWD();
@@ -260,8 +258,7 @@ public class BuildStep implements IBuildStep {
}
List<String> cleanCmdArgs = convertStringToArguments(commands[commands.length - 1]);
- final int initialLen = cleanCmdArgs.stream()
- .mapToInt(w -> w.length() + PER_ARGUMENT_PADDING).sum();
+ final int initialLen = cleanCmdArgs.stream().mapToInt(w -> w.length() + PER_ARGUMENT_PADDING).sum();
IPath cleanCmdPath = new Path(cleanCmdArgs.get(0));
Map<String, String> env = getEnvironment();
@@ -292,8 +289,8 @@ public class BuildStep implements IBuildStep {
}
// add remaining files
- BuildCommand buildCommand = new BuildCommand(cleanCmdPath,
- args.toArray(new String[args.size()]), env, cwd, this);
+ BuildCommand buildCommand = new BuildCommand(cleanCmdPath, args.toArray(new String[args.size()]),
+ env, cwd, this);
list.add(buildCommand);
return list.toArray(new BuildCommand[list.size()]);
@@ -314,8 +311,7 @@ public class BuildStep implements IBuildStep {
List<IBuildCommand> list = new ArrayList<IBuildCommand>();
for (int i = 0; i < commands.length; i++) {
- IBuildCommand cmds[] = createCommandsFromString(commands[i], cwd,
- getEnvironment());
+ IBuildCommand cmds[] = createCommandsFromString(commands[i], cwd, getEnvironment());
for (int j = 0; j < cmds.length; j++) {
list.add(cmds[j]);
}
@@ -345,8 +341,7 @@ public class BuildStep implements IBuildStep {
listToString(resourcesToStrings(cwd, getPrimaryResources(false), outPrefix), " "), //$NON-NLS-1$
getInputResources(cwd, getPrimaryResources(true)), fTool.getCommandLinePattern());
- return createCommandsFromString(resolveMacros(info.getCommandLine(), data, true), cwd,
- getEnvironment());
+ return createCommandsFromString(resolveMacros(info.getCommandLine(), data, true), cwd, getEnvironment());
}
private IPath rmNamePrefix(IPath path, String prefix) {
@@ -555,8 +550,7 @@ public class BuildStep implements IBuildStep {
IConfiguration cfg = getBuildDescription().getConfiguration();
IBuilder builder = cfg.getBuilder();
return ((Tool) fTool).getToolCommandFlags(inRcPath, outRcPath,
- createSubstitutor(cfg, builder,
- new FileContextData(inRcPath, outRcPath, null, fTool)),
+ createSubstitutor(cfg, builder, new FileContextData(inRcPath, outRcPath, null, fTool)),
BuildMacroProvider.getDefault());
}
return fTool.getToolCommandFlags(inRcPath, outRcPath);
@@ -666,8 +660,7 @@ public class BuildStep implements IBuildStep {
if (j != 0) {
optVal += " "; //$NON-NLS-1$
}
- optVal += BuildDescriptionManager.getRelPath(cwd, bRcs[j].getLocation())
- .toOSString();
+ optVal += BuildDescriptionManager.getRelPath(cwd, bRcs[j].getLocation()).toOSString();
}
ManagedBuildManager.setOption(cfg, fTool, assignToOption, optVal);
} else if (optType == IOption.STRING_LIST || optType == IOption.LIBRARIES
@@ -675,18 +668,15 @@ public class BuildStep implements IBuildStep {
|| optType == IOption.PREPROCESSOR_SYMBOLS || optType == IOption.INCLUDE_FILES
|| optType == IOption.LIBRARY_PATHS || optType == IOption.LIBRARY_FILES
|| optType == IOption.MACRO_FILES || optType == IOption.UNDEF_INCLUDE_PATH
- || optType == IOption.UNDEF_PREPROCESSOR_SYMBOLS
- || optType == IOption.UNDEF_INCLUDE_FILES
- || optType == IOption.UNDEF_LIBRARY_PATHS
- || optType == IOption.UNDEF_LIBRARY_FILES
+ || optType == IOption.UNDEF_PREPROCESSOR_SYMBOLS || optType == IOption.UNDEF_INCLUDE_FILES
+ || 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
// to top build directory relative
String[] paths = new String[bRcs.length];
for (int j = 0; j < bRcs.length; j++) {
- paths[j] = BuildDescriptionManager.getRelPath(cwd, bRcs[j].getLocation())
- .toOSString();
+ paths[j] = BuildDescriptionManager.getRelPath(cwd, bRcs[j].getLocation()).toOSString();
}
ManagedBuildManager.setOption(cfg, fTool, assignToOption, paths);
} else if (optType == IOption.BOOLEAN) {
@@ -697,8 +687,8 @@ public class BuildStep implements IBuildStep {
}
} else if (optType == IOption.ENUMERATED || optType == IOption.TREE) {
if (bRcs.length > 0) {
- ManagedBuildManager.setOption(cfg, fTool, assignToOption, BuildDescriptionManager
- .getRelPath(cwd, bRcs[0].getLocation()).toOSString());
+ ManagedBuildManager.setOption(cfg, fTool, assignToOption,
+ BuildDescriptionManager.getRelPath(cwd, bRcs[0].getLocation()).toOSString());
}
}
} catch (BuildException ex) {
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 2209f449726..2b84254c9ec 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
@@ -56,7 +56,7 @@ public class CommandBuilder implements IBuildModelBuilder {
protected class OutputStreamWrapper extends OutputStream {
private OutputStream fOut;
- public OutputStreamWrapper(OutputStream out){
+ public OutputStreamWrapper(OutputStream out) {
fOut = out;
}
@@ -86,12 +86,12 @@ public class CommandBuilder implements IBuildModelBuilder {
}
- public CommandBuilder(IBuildCommand cmd, IResourceRebuildStateContainer cr, IProject project){
+ public CommandBuilder(IBuildCommand cmd, IResourceRebuildStateContainer cr, IProject project) {
fCmd = cmd;
fProject = project;
}
- protected OutputStream wrap(OutputStream out){
+ protected OutputStream wrap(OutputStream out) {
return new OutputStreamWrapper(out);
}
@@ -109,7 +109,8 @@ public class CommandBuilder implements IBuildModelBuilder {
ICommandLauncher launcher = createLauncher();
launcher.showCommand(true);
- fProcess = launcher.execute(fCmd.getCommand(), fCmd.getArgs(), mapToStringArray(fCmd.getEnvironment()), fCmd.getCWD(), monitor);
+ fProcess = launcher.execute(fCmd.getCommand(), fCmd.getArgs(), mapToStringArray(fCmd.getEnvironment()),
+ fCmd.getCWD(), monitor);
if (fProcess != null) {
try {
// Close the input of the process since we will never write to it
@@ -118,7 +119,7 @@ public class CommandBuilder implements IBuildModelBuilder {
}
// Wrapping out and err streams to avoid their closure
- int st = launcher.waitAndRead(wrap(out), wrap(err), new SubProgressMonitor(monitor, getNumCommands()));
+ int st = launcher.waitAndRead(wrap(out), wrap(err), new SubProgressMonitor(monitor, getNumCommands()));
switch (st) {
case ICommandLauncher.OK:
// assuming that compiler returns error code after compilation errors
@@ -157,8 +158,8 @@ public class CommandBuilder implements IBuildModelBuilder {
return fErrMsg;
}
- private String[] mapToStringArray(Map<String, String> map){
- if(map == null)
+ private String[] mapToStringArray(Map<String, String> map) {
+ if (map == null)
return null;
List<String> list = new ArrayList<String>();
@@ -171,7 +172,7 @@ public class CommandBuilder implements IBuildModelBuilder {
return list.toArray(new String[list.size()]);
}
- protected void printMessage(String msg, OutputStream os){
+ protected void printMessage(String msg, OutputStream os) {
if (os != null) {
try {
os.write((msg + NEWLINE).getBytes());
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 55382289b21..163eec8991d 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
@@ -37,29 +37,29 @@ public class ConfigurationBuildState implements IConfigurationBuildState {
private IProject fProject;
private int fState;
- ConfigurationBuildState(IProject project, String cfgId){
+ ConfigurationBuildState(IProject project, String cfgId) {
fCfgId = cfgId;
fProject = project;
fState = NEED_REBUILD;
}
- void setProject(IProject project){
+ void setProject(IProject project) {
fProject = project;
}
@Override
public IPath[] getFullPathsForState(int state) {
- if(fStateToPathListMap == null)
+ if (fStateToPathListMap == null)
return new IPath[0];
Set<String> set = fStateToPathListMap.get(Integer.valueOf(state));
- if(set == null)
+ if (set == null)
return new IPath[0];
return setToFullPaths(set);
}
- private IPath[] setToFullPaths(Set<String> set){
+ private IPath[] setToFullPaths(Set<String> set) {
IPath paths[] = new IPath[set.size()];
IPath path = fProject.getFullPath();
int num = 0;
@@ -71,13 +71,13 @@ public class ConfigurationBuildState implements IConfigurationBuildState {
@Override
public int getStateForFullPath(IPath fullPath) {
- if(fPathToStateProps == null)
+ if (fPathToStateProps == null)
return 0;
String str = fullPathToString(fullPath);
String v = fPathToStateProps.getProperty(str);
- if(v != null){
+ if (v != null) {
Integer i = stateToInt(v);
- if(i != null)
+ if (i != null)
return i.intValue();
}
return 0;
@@ -87,29 +87,29 @@ public class ConfigurationBuildState implements IConfigurationBuildState {
public void setStateForFullPath(IPath fullPath, int state) {
String str = fullPathToString(fullPath);
int cur = getStateForFullPath(fullPath);
- if(cur == state)
+ if (cur == state)
return;
- if(fPathToStateProps == null){
+ if (fPathToStateProps == null) {
fPathToStateProps = new Properties();
fStateToPathListMap = new HashMap<Integer, Set<String>>();
}
String strState = stateToString(Integer.valueOf(state));
Integer iState = stateToInt(strState);
- if(iState == null)
+ if (iState == null)
throw new IllegalArgumentException();
- if(cur != 0){
+ if (cur != 0) {
Set<String> set = fStateToPathListMap.get(Integer.valueOf(cur));
set.remove(str);
- if(set.size() == 0)
+ if (set.size() == 0)
fStateToPathListMap.remove(iState);
}
- if(state != 0){
+ if (state != 0) {
fPathToStateProps.setProperty(str, strState);
Set<String> set = fStateToPathListMap.get(iState);
- if(set == null){
+ if (set == null) {
set = new HashSet<String>();
fStateToPathListMap.put(iState, set);
}
@@ -119,74 +119,75 @@ public class ConfigurationBuildState implements IConfigurationBuildState {
}
}
- private String fullPathToString(IPath fullPath){
+ private String fullPathToString(IPath fullPath) {
return fullPath.removeFirstSegments(1).toString();
}
- public void load(InputStream iStream) throws IOException{
+ public void load(InputStream iStream) throws IOException {
Properties props = new Properties();
props.load(iStream);
load(props);
}
- private void load(Properties props){
+ private void load(Properties props) {
HashMap<Integer, Set<String>> map = new HashMap<Integer, Set<String>>();
- for (@SuppressWarnings("rawtypes") Entry entry : props.entrySet()) {
- Integer i = stateToInt((String)entry.getValue());
+ for (@SuppressWarnings("rawtypes")
+ Entry entry : props.entrySet()) {
+ Integer i = stateToInt((String) entry.getValue());
Set<String> list = map.get(i);
- if(list == null){
+ if (list == null) {
list = new HashSet<String>();
map.put(i, list);
}
- list.add((String)entry.getKey());
+ list.add((String) entry.getKey());
}
//TODO: trim lists
- if(map.size() != 0){
+ if (map.size() != 0) {
fStateToPathListMap = map;
fPathToStateProps = props;
}
fState = 0;
}
- public void store(OutputStream oStream) throws IOException{
- if(fPathToStateProps != null)
+ public void store(OutputStream oStream) throws IOException {
+ if (fPathToStateProps != null)
fPathToStateProps.store(oStream, ""); //$NON-NLS-1$
-// Properties props = new Properties();
-// store(props);
-// props.store(oStream, "");
- }
-
-// 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());
-// List list = (List)entry.getValue();
-// for(int i = 0; i < list.size(); i++){
-// props.setProperty((String)list.get(i), propValue);
-// }
-// }
-// }
-
- private Integer stateToInt(String state){
+ // Properties props = new Properties();
+ // store(props);
+ // props.store(oStream, "");
+ }
+
+ // 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());
+ // List list = (List)entry.getValue();
+ // for(int i = 0; i < list.size(); i++){
+ // props.setProperty((String)list.get(i), propValue);
+ // }
+ // }
+ // }
+
+ private Integer stateToInt(String state) {
try {
- Integer i = Integer.valueOf(state);
- if(i.equals(REBUILD_STATE))
- return REBUILD_STATE;
- if(i.equals(REMOVED_STATE))
- return REMOVED_STATE;
- if(i.equals(NONE_STATE))
- return NONE_STATE;
- } catch (NumberFormatException e){
+ Integer i = Integer.valueOf(state);
+ if (i.equals(REBUILD_STATE))
+ return REBUILD_STATE;
+ if (i.equals(REMOVED_STATE))
+ return REMOVED_STATE;
+ if (i.equals(NONE_STATE))
+ return NONE_STATE;
+ } catch (NumberFormatException e) {
ManagedBuilderCorePlugin.log(e);
}
return null;
}
- private String stateToString(Integer state){
+ private String stateToString(Integer state) {
return state.toString();
}
@@ -201,7 +202,7 @@ public class ConfigurationBuildState implements IConfigurationBuildState {
clear();
}
- private void clear(){
+ private void clear() {
fPathToStateProps = null;
fStateToPathListMap = null;
}
@@ -216,7 +217,7 @@ public class ConfigurationBuildState implements IConfigurationBuildState {
return fProject;
}
- public boolean exists(){
+ public boolean exists() {
return fState == 0;
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DbgUtil.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DbgUtil.java
index 006b0d7e5e4..8b38012f05a 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DbgUtil.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/DbgUtil.java
@@ -28,119 +28,118 @@ import org.eclipse.cdt.managedbuilder.core.ITool;
public class DbgUtil {
public static boolean DEBUG = false;
private static PrintStream out = System.out;
- private static final String TRACE_PREFIX = "BuildModel[ "; //$NON-NLS-1$
- private static final String TRACE_SUFIX = " ]"; //$NON-NLS-1$
+ private static final String TRACE_PREFIX = "BuildModel[ "; //$NON-NLS-1$
+ private static final String TRACE_SUFIX = " ]"; //$NON-NLS-1$
-
- public static void trace(String str){
+ public static void trace(String str) {
out.println(formatMsg(str));
}
-
- public static String formatMsg(String msg){
+
+ public static String formatMsg(String msg) {
return TRACE_PREFIX + msg + TRACE_SUFIX;
}
-
- public static String stepName(IBuildStep action){
- ITool tool = action instanceof BuildStep ? ((BuildStep)action).getTool() : null;
- if(tool != null)
+
+ public static String stepName(IBuildStep action) {
+ ITool tool = action instanceof BuildStep ? ((BuildStep) action).getTool() : null;
+ if (tool != null)
return tool.getName();
- if(action.getBuildDescription().getInputStep() == action)
- return "input step"; //$NON-NLS-1$
- if(action.getBuildDescription().getOutputStep() == action)
- return "output step"; //$NON-NLS-1$
- return "<undefined name>"; //$NON-NLS-1$
+ if (action.getBuildDescription().getInputStep() == action)
+ return "input step"; //$NON-NLS-1$
+ if (action.getBuildDescription().getOutputStep() == action)
+ return "output step"; //$NON-NLS-1$
+ return "<undefined name>"; //$NON-NLS-1$
}
- public static String resourceName(IBuildResource rc){
- if(rc.getFullPath() != null)
+ public static String resourceName(IBuildResource rc) {
+ if (rc.getFullPath() != null)
return rc.getFullPath().toString();
return rc.getLocation().toString();
}
- public static String dumpType(IBuildIOType type){
+ public static String dumpType(IBuildIOType type) {
StringBuilder buf = new StringBuilder();
- buf.append("dumping type: "); //$NON-NLS-1$
- buf.append(type.isInput() ? "INPUT" : "OUTPUT"); //$NON-NLS-1$ //$NON-NLS-2$
+ buf.append("dumping type: "); //$NON-NLS-1$
+ buf.append(type.isInput() ? "INPUT" : "OUTPUT"); //$NON-NLS-1$ //$NON-NLS-2$
buf.append(ioTypeResources(type));
- buf.append("end dumping type"); //$NON-NLS-1$
+ buf.append("end dumping type"); //$NON-NLS-1$
return buf.toString();
}
-
- public static String ioTypeResources(IBuildIOType type){
+
+ public static String ioTypeResources(IBuildIOType type) {
StringBuilder buf = new StringBuilder();
-
+
IBuildResource rcs[] = type.getResources();
- buf.append("\n"); //$NON-NLS-1$
-
- for(int i = 0; i < rcs.length; i++){
+ buf.append("\n"); //$NON-NLS-1$
+
+ for (int i = 0; i < rcs.length; i++) {
buf.append(resourceName(rcs[i]));
- buf.append("\n"); //$NON-NLS-1$
+ buf.append("\n"); //$NON-NLS-1$
}
-
+
return buf.toString();
}
-
+
public static String dumpStep(IBuildStep step, boolean inputs) {
StringBuilder buf = new StringBuilder();
-
- buf.append("dumping step ").append(stepName(step)).append(inputs ? " inputs" : " outputs"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
+
+ buf.append("dumping step ").append(stepName(step)).append(inputs ? " inputs" : " outputs"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
IBuildIOType types[] = inputs ? step.getInputIOTypes() : step.getOutputIOTypes();
-
+
buf.append('\n');
-
- for(int i = 0; i < types.length; i++){
+
+ for (int i = 0; i < types.length; i++) {
buf.append("ioType ").append(i).append(':'); //$NON-NLS-1$
buf.append(ioTypeResources(types[i]));
}
-
- buf.append("end dump step\n"); //$NON-NLS-1$
+
+ buf.append("end dump step\n"); //$NON-NLS-1$
return buf.toString();
}
-
- public static String dumpStep(IBuildStep step){
+
+ public static String dumpStep(IBuildStep step) {
return dumpStep(step, true) + dumpStep(step, false);
}
- public static String dumpResource(IBuildResource rc){
- return dumpResource(rc, true) + dumpResource(rc, false);
+ public static String dumpResource(IBuildResource rc) {
+ return dumpResource(rc, true) + dumpResource(rc, false);
}
- public static String dumpResource(IBuildResource rc, boolean producer){
+ public static String dumpResource(IBuildResource rc, boolean producer) {
StringBuilder buf = new StringBuilder();
-
- buf.append("dumping resource ").append(resourceName(rc)).append(producer ? " producer:" : " deps:"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- if(producer){
- if(rc.getProducerIOType() != null)
+
+ buf.append("dumping resource ").append(resourceName(rc)).append(producer ? " producer:" : " deps:"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+ if (producer) {
+ if (rc.getProducerIOType() != null)
buf.append(dumpStep(rc.getProducerIOType().getStep()));
else
- buf.append("\nresourse has no producer\n"); //$NON-NLS-1$
+ buf.append("\nresourse has no producer\n"); //$NON-NLS-1$
} else {
IBuildIOType types[] = rc.getDependentIOTypes();
-
- if(types.length > 0){
+
+ if (types.length > 0) {
Set<IBuildStep> set = new HashSet<IBuildStep>();
- for(int i = 0; i < types.length; i++){
- if(set.add(types[i].getStep())){
+ for (int i = 0; i < types.length; i++) {
+ if (set.add(types[i].getStep())) {
buf.append(dumpStep(types[i].getStep()));
}
}
} else {
- buf.append("\n resource has no deps\n"); //$NON-NLS-1$
+ buf.append("\n resource has no deps\n"); //$NON-NLS-1$
}
-
+
}
- buf.append("end dump resource\n"); //$NON-NLS-1$
+ buf.append("end dump resource\n"); //$NON-NLS-1$
return buf.toString();
}
-
- public static void flush(){
+
+ public static void flush() {
out.flush();
}
}
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 234a340aa68..6077bee73b7 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
@@ -22,12 +22,13 @@ import org.eclipse.core.runtime.CoreException;
public class DefaultBuildDescriptionFactory implements IBuildDescriptionFactory {
static private DefaultBuildDescriptionFactory fInstance;
- protected DefaultBuildDescriptionFactory(){
+
+ protected DefaultBuildDescriptionFactory() {
}
- public static DefaultBuildDescriptionFactory getInstance(){
- if(fInstance == null)
+ public static DefaultBuildDescriptionFactory getInstance() {
+ if (fInstance == null)
fInstance = new DefaultBuildDescriptionFactory();
return fInstance;
}
@@ -36,14 +37,16 @@ public class DefaultBuildDescriptionFactory implements IBuildDescriptionFactory
* @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 {
+ public IBuildDescription createBuildDescription(IConfiguration cfg, IResourceDelta delta, int flags)
+ throws CoreException {
return createBuildDescription(cfg, null, delta, flags);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildDescriptionFactory#createBuildDescription(org.eclipse.cdt.managedbuilder.core.IConfiguration, org.eclipse.core.resources.IResourceDelta, int)
*/
- public IBuildDescription createBuildDescription(IConfiguration cfg, IConfigurationBuildState bs, IResourceDelta delta, int flags) throws CoreException {
+ public IBuildDescription createBuildDescription(IConfiguration cfg, IConfigurationBuildState bs,
+ IResourceDelta delta, int flags) throws CoreException {
BuildDescription info = new BuildDescription();
info.init(cfg, bs, delta, flags);
return info;
@@ -54,10 +57,8 @@ public class DefaultBuildDescriptionFactory implements IBuildDescriptionFactory
*/
@Override
public int getSupportedMethods() {
- return BuildDescriptionManager.REMOVED
- | BuildDescriptionManager.REBUILD
- | BuildDescriptionManager.DEPFILES
- | BuildDescriptionManager.DEPS;
+ 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 b2f9d39546b..be3404d1c72 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
@@ -46,7 +46,6 @@ public class DescriptionBuilder implements IBuildModelBuilder {
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 IBuildDescription fDes;
private IPath fCWD;
private boolean fBuildIncrementaly;
@@ -56,18 +55,18 @@ public class DescriptionBuilder implements IBuildModelBuilder {
private GenDirInfo fDir;
private IResourceRebuildStateContainer fRebuildStateContainer;
- private class BuildStepVisitor implements IStepVisitor{
+ private class BuildStepVisitor implements IStepVisitor {
private OutputStream fOut;
private OutputStream fErr;
private IProgressMonitor fMonitor;
private int fStatus;
private boolean fBuild;
- public BuildStepVisitor(OutputStream out, OutputStream err, IProgressMonitor monitor){
+ public BuildStepVisitor(OutputStream out, OutputStream err, IProgressMonitor monitor) {
this(out, err, monitor, true);
}
- public BuildStepVisitor(OutputStream out, OutputStream err, IProgressMonitor monitor, boolean build){
+ public BuildStepVisitor(OutputStream out, OutputStream err, IProgressMonitor monitor, boolean build) {
fOut = out;
fErr = err;
fMonitor = monitor;
@@ -80,19 +79,18 @@ public class DescriptionBuilder implements IBuildModelBuilder {
*/
@Override
public int visit(IBuildStep action) throws CoreException {
- if(fMonitor.isCanceled())
+ if (fMonitor.isCanceled())
return VISIT_STOP;
- if(DbgUtil.DEBUG)
+ if (DbgUtil.DEBUG)
DbgUtil.trace("visiting step " + DbgUtil.stepName(action)); //$NON-NLS-1$
- if(!action.isRemoved()
- && (!fBuildIncrementaly || action.needsRebuild())){
- if(DbgUtil.DEBUG)
- DbgUtil.trace("step " + DbgUtil.stepName(action) + " needs rebuild" ); //$NON-NLS-1$ //$NON-NLS-2$
+ if (!action.isRemoved() && (!fBuildIncrementaly || action.needsRebuild())) {
+ 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()))){
+ if (fBuild) {
+ switch (builder.build(fOut, fErr, new SubProgressMonitor(fMonitor, builder.getNumCommands()))) {
case STATUS_OK:
break;
case STATUS_CANCELLED:
@@ -102,41 +100,42 @@ public class DescriptionBuilder implements IBuildModelBuilder {
case STATUS_ERROR_LAUNCH:
default:
fStatus = STATUS_ERROR_BUILD;
- break;
+ break;
}
} else {
fNumCommands += builder.getNumCommands();
}
}
- if(fStatus != STATUS_CANCELLED
- && (fResumeOnErrs || fStatus == STATUS_OK))
+ if (fStatus != STATUS_CANCELLED && (fResumeOnErrs || fStatus == STATUS_OK))
return VISIT_CONTINUE;
return VISIT_STOP;
}
}
- public DescriptionBuilder(IBuildDescription des, IResourceRebuildStateContainer rs){
+ public DescriptionBuilder(IBuildDescription des, IResourceRebuildStateContainer rs) {
this(des, true, rs);
}
- public DescriptionBuilder(IBuildDescription des, boolean buildIncrementaly, IResourceRebuildStateContainer rs){
+ public DescriptionBuilder(IBuildDescription des, boolean buildIncrementaly, IResourceRebuildStateContainer rs) {
this(des, buildIncrementaly, true, rs);
}
- public DescriptionBuilder(IBuildDescription des, boolean buildIncrementaly, boolean resumeOnError, IResourceRebuildStateContainer rs){
+ public DescriptionBuilder(IBuildDescription des, boolean buildIncrementaly, boolean resumeOnError,
+ IResourceRebuildStateContainer rs) {
this(des, buildIncrementaly, resumeOnError, null, rs);
}
- public DescriptionBuilder(IBuildDescription des, boolean buildIncrementaly, boolean resumeOnErrs, IPath cwd, IResourceRebuildStateContainer rs){
+ public DescriptionBuilder(IBuildDescription des, boolean buildIncrementaly, boolean resumeOnErrs, IPath cwd,
+ IResourceRebuildStateContainer rs) {
fDes = des;
fCWD = cwd;
fBuildIncrementaly = buildIncrementaly;
fResumeOnErrs = resumeOnErrs;
fDir = new GenDirInfo(fDes.getConfiguration());
- if(fCWD == null)
+ if (fCWD == null)
fCWD = fDes.getDefaultBuildDirLocation();
fRebuildStateContainer = rs;
@@ -146,69 +145,64 @@ public class DescriptionBuilder implements IBuildModelBuilder {
* @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){
+ 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$
+ monitor.beginTask("", num > 0 ? num : 1); //$NON-NLS-1$
+ monitor.subTask(""); //$NON-NLS-1$
- if(num > 0){
+ if (num > 0) {
BuildStepVisitor visitor = new BuildStepVisitor(out, err, monitor);
try {
- BuildDescriptionManager.accept(visitor,
- fDes, true);
+ BuildDescriptionManager.accept(visitor, fDes, true);
} catch (CoreException e) {
status = STATUS_ERROR_LAUNCH;
}
- if(status == STATUS_OK)
+ if (status == STATUS_OK)
status = visitor.fStatus;
} else {
- printMessage(
- ManagedMakeMessages.getFormattedString(BUILDER_NOTHING_TODO,
- fDes.getConfiguration().getOwner().getName()),
- out);
+ printMessage(ManagedMakeMessages.getFormattedString(BUILDER_NOTHING_TODO,
+ fDes.getConfiguration().getOwner().getName()), out);
}
monitor.done();
- if(status == STATUS_OK)
+ if (status == STATUS_OK)
clearRebuildStates();
return status;
}
public int getNumCommands() {
- if(fNumCommands == -1){
+ if (fNumCommands == -1) {
fNumCommands = 0;
BuildStepVisitor visitor = new BuildStepVisitor(null, null, new NullProgressMonitor(), false);
try {
- BuildDescriptionManager.accept(visitor,
- fDes, true);
+ BuildDescriptionManager.accept(visitor, fDes, true);
} catch (CoreException e) {
//TODO: report an error
}
- if(DbgUtil.DEBUG)
- DbgUtil.trace("Description Builder: total work = " + fNumCommands); //$NON-NLS-1$
+ if (DbgUtil.DEBUG)
+ DbgUtil.trace("Description Builder: total work = " + fNumCommands); //$NON-NLS-1$
}
return fNumCommands;
}
- protected StepBuilder getStepBuilder(IBuildStep step){
+ protected StepBuilder getStepBuilder(IBuildStep step) {
StepBuilder b = fStepToStepBuilderMap.get(step);
- if(b == null){
+ if (b == null) {
b = new StepBuilder(step, fCWD, fResumeOnErrs, fDir, fRebuildStateContainer);
fStepToStepBuilderMap.put(step, b);
}
return b;
}
- protected void printMessage(String msg, OutputStream os){
+ protected void printMessage(String msg, OutputStream os) {
if (os != null) {
msg = ManagedMakeMessages.getFormattedString(BUILDER_MSG_HEADER, msg) + LINE_SEPARATOR;
try {
@@ -220,8 +214,8 @@ public class DescriptionBuilder implements IBuildModelBuilder {
}
}
- private void initRebuildStates(){
- if(fRebuildStateContainer == null)
+ private void initRebuildStates() {
+ if (fRebuildStateContainer == null)
return;
fRebuildStateContainer.setState(0);
@@ -230,26 +224,26 @@ public class DescriptionBuilder implements IBuildModelBuilder {
putAll(fRebuildStateContainer, rcs, IRebuildState.NEED_REBUILD, true);
}
- private void clearRebuildStates(){
- if(fRebuildStateContainer == null)
+ private void clearRebuildStates() {
+ if (fRebuildStateContainer == null)
return;
fRebuildStateContainer.setState(0);
-// IBuildResource[] rcs = fDes.getResources();
-// putAll(fRebuildStateContainer, rcs, IRebuildState.NEED_REBUILD, true);
+ // IBuildResource[] rcs = fDes.getResources();
+ // putAll(fRebuildStateContainer, rcs, IRebuildState.NEED_REBUILD, true);
}
- static void putAll(IResourceRebuildStateContainer cbs, IBuildResource[] rcs, int state, boolean rebuildRcOnly){
- for(int i = 0; i < rcs.length; i++){
+ static void putAll(IResourceRebuildStateContainer cbs, IBuildResource[] rcs, int state, boolean rebuildRcOnly) {
+ for (int i = 0; i < rcs.length; i++) {
IBuildResource rc = rcs[i];
- if(rebuildRcOnly && !rc.needsRebuild())
+ if (rebuildRcOnly && !rc.needsRebuild())
continue;
- if(!rc.isProjectResource())
+ if (!rc.isProjectResource())
continue;
IPath fullPath = rc.getFullPath();
- if(fullPath == null)
+ if (fullPath == null)
continue;
cbs.setStateForFullPath(fullPath, state);
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/FileMacroExplicitSubstitutor.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/FileMacroExplicitSubstitutor.java
index ba5ab04bb14..c5e05e17c68 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/FileMacroExplicitSubstitutor.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/FileMacroExplicitSubstitutor.java
@@ -23,16 +23,14 @@ import org.eclipse.cdt.managedbuilder.internal.macros.MbsMacroSupplier;
import org.eclipse.cdt.utils.cdtvariables.SupplierBasedCdtVariableSubstitutor;
public class FileMacroExplicitSubstitutor extends SupplierBasedCdtVariableSubstitutor {
- private IConfiguration fCfg;
- private IBuilder fBuilder;
-// public FileMacroExplicitSubstitutor(int contextType, Object contextData, String inexistentMacroValue, String listDelimiter){
-// super(contextType, contextData, inexistentMacroValue, listDelimiter);
-// }
+ private IConfiguration fCfg;
+ private IBuilder fBuilder;
+ // public FileMacroExplicitSubstitutor(int contextType, Object contextData, String inexistentMacroValue, String listDelimiter){
+ // super(contextType, contextData, inexistentMacroValue, listDelimiter);
+ // }
- public FileMacroExplicitSubstitutor(IMacroContextInfo contextInfo,
- IConfiguration cfg,
- IBuilder builder,
- String inexistentMacroValue, String listDelimiter){
+ public FileMacroExplicitSubstitutor(IMacroContextInfo contextInfo, IConfiguration cfg, IBuilder builder,
+ String inexistentMacroValue, String listDelimiter) {
super(contextInfo, inexistentMacroValue, listDelimiter);
fCfg = cfg;
fBuilder = builder;
@@ -42,13 +40,13 @@ public class FileMacroExplicitSubstitutor extends SupplierBasedCdtVariableSubsti
* @see org.eclipse.cdt.managedbuilder.internal.macros.DefaultMacroSubstitutor#resolveMacro(org.eclipse.cdt.managedbuilder.macros.IBuildMacro)
*/
@Override
- protected ResolvedMacro resolveMacro(ICdtVariable macro) throws CdtVariableException{
- if(macro instanceof MbsMacroSupplier.FileContextMacro){
- MbsMacroSupplier.FileContextMacro fileMacro = (MbsMacroSupplier.FileContextMacro)macro;
+ protected ResolvedMacro resolveMacro(ICdtVariable macro) throws CdtVariableException {
+ if (macro instanceof MbsMacroSupplier.FileContextMacro) {
+ MbsMacroSupplier.FileContextMacro fileMacro = (MbsMacroSupplier.FileContextMacro) macro;
String val = fileMacro.getExplicitMacroValue(fCfg, fBuilder);
return new ResolvedMacro(macro.getName(), val);
}
return super.resolveMacro(macro);
}
-
+
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/GenDirInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/GenDirInfo.java
index d4d310e4ad5..64db3bc93fa 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/GenDirInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/GenDirInfo.java
@@ -26,55 +26,54 @@ import org.eclipse.core.runtime.IProgressMonitor;
/**
* This class represents the generated directory information
- *
- * 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 GenDirInfo {
private IProject fProject;
private IPath fProjPath;
private Set<IPath> fDirPathSet = new HashSet<IPath>();
-
- public GenDirInfo(IProject proj){
+
+ public GenDirInfo(IProject proj) {
fProject = proj;
fProjPath = proj.getFullPath();
}
- public GenDirInfo(IConfiguration cfg){
+ public GenDirInfo(IConfiguration cfg) {
this(cfg.getOwner().getProject());
}
-
- public void createDir(IBuildResource rc, IProgressMonitor monitor){
+
+ public void createDir(IBuildResource rc, IProgressMonitor monitor) {
IPath path = rc.getFullPath();
- if(path != null
- && fProjPath.isPrefixOf(path)){
+ if (path != null && fProjPath.isPrefixOf(path)) {
path = path.removeLastSegments(1).removeFirstSegments(1);
createDir(path, monitor);
}
}
- public void createIfProjectDir(IPath fullPath, IProgressMonitor monitor){
- if(fullPath.segmentCount() > fProjPath.segmentCount() && fProjPath.isPrefixOf(fullPath))
+ public void createIfProjectDir(IPath fullPath, IProgressMonitor monitor) {
+ if (fullPath.segmentCount() > fProjPath.segmentCount() && fProjPath.isPrefixOf(fullPath))
createDir(fullPath.removeFirstSegments(fProjPath.segmentCount()), monitor);
}
- protected void createDir(IPath path, IProgressMonitor monitor){
- if(path.segmentCount() > 0 && fDirPathSet.add(path)){
+ protected void createDir(IPath path, IProgressMonitor monitor) {
+ if (path.segmentCount() > 0 && fDirPathSet.add(path)) {
IFolder folder = fProject.getFolder(path);
- if(!folder.exists()){
+ if (!folder.exists()) {
createDir(path.removeLastSegments(1), monitor);
try {
folder.create(true, true, monitor);
folder.setDerived(true);
} catch (CoreException e) {
- if(DbgUtil.DEBUG)
- DbgUtil.trace("GenDirInfo: failed to create dir: " + e.getLocalizedMessage()); //$NON-NLS-1$
+ if (DbgUtil.DEBUG)
+ DbgUtil.trace("GenDirInfo: failed to create dir: " + e.getLocalizedMessage()); //$NON-NLS-1$
//TODO: log the error
}
}
}
}
-
+
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/IBuildModelBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/IBuildModelBuilder.java
index f873020db12..062ea7fbd30 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/IBuildModelBuilder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/IBuildModelBuilder.java
@@ -18,19 +18,19 @@ import java.io.OutputStream;
import org.eclipse.core.runtime.IProgressMonitor;
/**
- *
+ *
* This is a generic interface representing the builder
* It is implemented currently by the BuildDescription builder,
* BuildStep builder and BuildCommand builder that are used for building
- * the different parts of the build model
+ * the different parts of the build model
* and represent an MBS Internal Builder.
* In the future we might also adopt the external builder invocation
- * to the same concept, e.g. the IBuildModelBuilder implementer
+ * to the same concept, e.g. the IBuildModelBuilder implementer
* for the external builder invocation might invoke an external builder
* from within its build method
- *
- * NOTE: This interface is subject to change and discuss,
- * and is currently available in experimental mode only
+ *
+ * NOTE: This interface is subject to change and discuss,
+ * and is currently available in experimental mode only
*
*/
public interface IBuildModelBuilder {
@@ -38,10 +38,7 @@ public interface IBuildModelBuilder {
public static final int STATUS_ERROR_BUILD = -1;
public static final int STATUS_ERROR_LAUNCH = -2;
public static final int STATUS_CANCELLED = -3;
-
- int build(OutputStream out,
- OutputStream err,
- IProgressMonitor monitor);
-
+ int build(OutputStream out, OutputStream err, IProgressMonitor monitor);
+
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/IConfigurationBuildState.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/IConfigurationBuildState.java
index 0c69b56bcd2..5ddf445ebb3 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/IConfigurationBuildState.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/IConfigurationBuildState.java
@@ -15,9 +15,8 @@ package org.eclipse.cdt.managedbuilder.internal.buildmodel;
import org.eclipse.core.resources.IProject;
-
public interface IConfigurationBuildState extends IResourceRebuildStateContainer {
String getConfigurationId();
-
+
IProject getProject();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/IProjectBuildState.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/IProjectBuildState.java
index 5dd35fba119..65ce906bbcd 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/IProjectBuildState.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/IProjectBuildState.java
@@ -17,10 +17,10 @@ import org.eclipse.core.resources.IProject;
public interface IProjectBuildState extends IRebuildState {
IConfigurationBuildState[] getConfigurationBuildStates();
-
+
IConfigurationBuildState getConfigurationBuildState(String id, boolean create);
void removeConfigurationBuildState(String id);
-
+
IProject getProject();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/IRebuildState.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/IRebuildState.java
index 133b7c9f160..044e57d7782 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/IRebuildState.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/IRebuildState.java
@@ -16,8 +16,8 @@ package org.eclipse.cdt.managedbuilder.internal.buildmodel;
public interface IRebuildState {
public static final int NEED_REBUILD = 1;
public static final int REMOVED = 1 << 1;
-
+
int getState();
-
+
void setState(int state);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/IResourceRebuildStateContainer.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/IResourceRebuildStateContainer.java
index 7f74ebe4f48..921dfd1f774 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/IResourceRebuildStateContainer.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/IResourceRebuildStateContainer.java
@@ -17,8 +17,8 @@ import org.eclipse.core.runtime.IPath;
public interface IResourceRebuildStateContainer extends IRebuildState {
int getStateForFullPath(IPath fullPath);
-
+
IPath[] getFullPathsForState(int state);
-
+
void setStateForFullPath(IPath fullPath, int state);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ParallelBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ParallelBuilder.java
index 8880344bfa4..bd915816f46 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ParallelBuilder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ParallelBuilder.java
@@ -42,9 +42,9 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
/**
- * This is the main class for parallel internal builder implementation
+ * This is the main class for parallel internal builder implementation
*
- * 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 ParallelBuilder {
@@ -53,12 +53,12 @@ public class ParallelBuilder {
public static final int STATUS_CANCELED = 2;
public static final int STATUS_INVALID = -1;
public static final long MAIN_LOOP_DELAY = 50L;
-
- private static final String BUILDER_MSG_HEADER = "InternalBuilder.msg.header"; //$NON-NLS-1$
+
+ private static final String BUILDER_MSG_HEADER = "InternalBuilder.msg.header"; //$NON-NLS-1$
private static final String LINE_SEPARATOR = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
-
+
public static int lastThreadsUsed = 0; // use externally for report purposes only
-
+
protected IPath cwd;
protected GenDirInfo dirs;
protected IProgressMonitor monitor;
@@ -78,34 +78,34 @@ public class ParallelBuilder {
protected class BuildQueueElement implements Comparable<BuildQueueElement> {
protected IBuildStep step;
protected int level;
-
+
public BuildQueueElement(IBuildStep _step, int _level) {
step = _step;
level = _level;
}
-
+
public IBuildStep getStep() {
return step;
}
-
+
public int getLevel() {
return level;
}
-
+
public void setLevel(int _level) {
level = _level;
}
-
+
@Override
public int hashCode() {
return step.hashCode();
}
-
+
@Override
public int compareTo(BuildQueueElement elem) {
if (elem == null)
throw new NullPointerException();
-
+
if (elem.getLevel() > level)
return -1;
if (elem.getLevel() < level)
@@ -114,21 +114,23 @@ public class ParallelBuilder {
}
/**
- * Updates level value
+ * Updates level value
*/
public boolean check(IBuildStep _step, int _level) {
if (level < _level && step.equals(_step)) {
level = _level;
return true;
- } else { return false; }
+ } else {
+ return false;
+ }
}
-
+
@Override
public String toString() {
- return"[BuildQueueElement] " + DbgUtil.stepName(step) + " @ " + level; //$NON-NLS-1$ //$NON-NLS-2$
+ return "[BuildQueueElement] " + DbgUtil.stepName(step) + " @ " + level; //$NON-NLS-1$ //$NON-NLS-2$
}
- }
-
+ }
+
/**
* This class stores information about step being built
*/
@@ -140,11 +142,11 @@ public class ParallelBuilder {
protected int activeCmd;
protected boolean done;
protected ProcessLauncher launcher;
-
+
public ActiveBuildStep(IBuildStep _step) {
step = _step;
-
- if(dirs == null)
+
+ if (dirs == null)
stepDirs = new GenDirInfo(step.getBuildDescription().getConfiguration());
else
stepDirs = dirs;
@@ -157,7 +159,7 @@ public class ParallelBuilder {
done = false;
createOutDirs();
}
-
+
public boolean launchNextCmd(BuildProcessManager mgr) {
if (monitor.isCanceled()) {
done = true;
@@ -167,29 +169,31 @@ public class ParallelBuilder {
done = true;
else {
IBuildCommand cmd = cmds[++activeCmd];
- launcher = mgr.launchProcess(cmd, stepCwd, monitor);
- if (launcher != null) return true;
+ launcher = mgr.launchProcess(cmd, stepCwd, monitor);
+ if (launcher != null)
+ return true;
activeCmd--;
done = true; // temporary
}
return false;
}
-
+
public boolean isDone() {
return done;
}
-
+
public IBuildStep getStep() {
return step;
}
-
+
public ProcessLauncher getLauncher() {
return launcher;
}
- protected void createOutDirs(){
+
+ protected void createOutDirs() {
IBuildResource rcs[] = step.getOutputResources();
-
- for(int i = 0; i < rcs.length; i++){
+
+ for (int i = 0; i < rcs.length; i++) {
dirs.createDir(rcs[i], new NullProgressMonitor());
}
}
@@ -200,7 +204,7 @@ public class ParallelBuilder {
* 1. Resources enqueueing & levelling
* 2. Queue sorting
* 3. Queue dispatching
- *
+ *
* @param des Build description
* @param cwd Working directory
* @param dirs GenDirInfo?
@@ -214,7 +218,8 @@ public class ParallelBuilder {
* ParallelBuilder#STATUS_INVALID}.
* @see #build(IBuildDescription, IPath, GenDirInfo, OutputStream, OutputStream, IProgressMonitor, boolean, boolean, IResourceRebuildStateContainer)
*/
- static public int build(IBuildDescription des, IPath cwd, GenDirInfo dirs, OutputStream out, OutputStream err, IProgressMonitor monitor, boolean resumeOnErrors, boolean buildIncrementally) {
+ static public int build(IBuildDescription des, IPath cwd, GenDirInfo dirs, OutputStream out, OutputStream err,
+ IProgressMonitor monitor, boolean resumeOnErrors, boolean buildIncrementally) {
return build(des, cwd, dirs, out, err, monitor, resumeOnErrors, buildIncrementally, null);
}
@@ -237,17 +242,22 @@ public class ParallelBuilder {
* {@link ParallelBuilder#STATUS_ERROR}, {@link ParallelBuilder#STATUS_CANCELED}, or {@link
* ParallelBuilder#STATUS_INVALID}.
*/
- static public int build(IBuildDescription des, IPath cwd, GenDirInfo dirs, OutputStream out, OutputStream err, IProgressMonitor monitor, boolean resumeOnErrors, boolean buildIncrementally, IResourceRebuildStateContainer rs) {
+ static public int build(IBuildDescription des, IPath cwd, GenDirInfo dirs, OutputStream out, OutputStream err,
+ IProgressMonitor monitor, boolean resumeOnErrors, boolean buildIncrementally,
+ IResourceRebuildStateContainer rs) {
int status = IBuildModelBuilder.STATUS_OK;
IConfiguration cfg = des.getConfiguration();
- if(dirs == null) dirs = new GenDirInfo(cfg);
- if(cwd == null) cwd = des.getDefaultBuildDirLocation();
+ if (dirs == null)
+ dirs = new GenDirInfo(cfg);
+ if (cwd == null)
+ cwd = des.getDefaultBuildDirLocation();
int threads = 1;
if (cfg instanceof Configuration) {
- threads = ((Configuration)cfg).getParallelNumber();
+ threads = ((Configuration) cfg).getParallelNumber();
}
- ParallelBuilder builder = new ParallelBuilder(cwd, dirs, out, err, monitor, resumeOnErrors, buildIncrementally, rs, des);
+ ParallelBuilder builder = new ParallelBuilder(cwd, dirs, out, err, monitor, resumeOnErrors, buildIncrementally,
+ rs, des);
status = builder.executePreBuildStep();
if (status != IBuildModelBuilder.STATUS_OK) {
@@ -312,7 +322,7 @@ public class ParallelBuilder {
*/
protected int executeStep(IBuildStep step) {
if (hasResourceToBuild() && step != null) {
- IProject project = (IProject)fDes.getConfiguration().getOwner();
+ IProject project = (IProject) fDes.getConfiguration().getOwner();
IBuildCommand[] bcs = step.getCommands(cwd, null, null, true);
for (IBuildCommand bc : bcs) {
CommandBuilder cb = new CommandBuilder(bc, fRebuildStateContainer, project);
@@ -361,7 +371,8 @@ public class ParallelBuilder {
fRebuildStateContainer.setState(0);
}
- private static void putAll(IResourceRebuildStateContainer cbs, IBuildResource[] rcs, int state, boolean rebuildRcOnly) {
+ private static void putAll(IResourceRebuildStateContainer cbs, IBuildResource[] rcs, int state,
+ boolean rebuildRcOnly) {
for (IBuildResource rc : rcs) {
if (rebuildRcOnly && !rc.needsRebuild()) {
continue;
@@ -383,7 +394,9 @@ public class ParallelBuilder {
/**
* Initializes parallel builder
*/
- protected ParallelBuilder(IPath _cwd, GenDirInfo _dirs, OutputStream _out, OutputStream _err, IProgressMonitor _monitor, boolean _resumeOnErrors, boolean _buildIncrementally, IResourceRebuildStateContainer _fRebuildStateContainer, IBuildDescription _fDes) {
+ protected ParallelBuilder(IPath _cwd, GenDirInfo _dirs, OutputStream _out, OutputStream _err,
+ IProgressMonitor _monitor, boolean _resumeOnErrors, boolean _buildIncrementally,
+ IResourceRebuildStateContainer _fRebuildStateContainer, IBuildDescription _fDes) {
cwd = _cwd;
dirs = _dirs;
out = _out;
@@ -394,14 +407,14 @@ public class ParallelBuilder {
fRebuildStateContainer = _fRebuildStateContainer;
fDes = _fDes;
}
-
+
/**
* Enqueues build steps, calculating their levels
*/
protected void enqueueAll(IBuildDescription des) {
enqueueSteps(des.getInputStep(), 0);
}
-
+
/**
* Sorts the queue
*/
@@ -423,51 +436,51 @@ public class ParallelBuilder {
*/
protected void enqueueSteps(IBuildStep step, int level) {
IBuildResource[] resources = step.getOutputResources();
-
+
for (int i = 0; i < resources.length; i++) {
IBuildStep steps[] = resources[i].getDependentSteps();
for (int j = 0; j < steps.length; j++) {
IBuildStep st = steps[j];
if (st != null && st.getBuildDescription().getOutputStep() != st) {
BuildQueueElement b = queueHash.get(st);
- if (b != null){
- if (b.level < level) b.setLevel(level);
- } else {
- //TODO: whether we need check isRemoved & needRebuild ?
- if (!steps[j].isRemoved() && (!buildIncrementally || steps[j].needsRebuild())) {
- addElement(steps[j], level);
- }
- enqueueSteps(steps[j], level + 1);
- }
+ if (b != null) {
+ if (b.level < level)
+ b.setLevel(level);
+ } else {
+ //TODO: whether we need check isRemoved & needRebuild ?
+ if (!steps[j].isRemoved() && (!buildIncrementally || steps[j].needsRebuild())) {
+ addElement(steps[j], level);
+ }
+ enqueueSteps(steps[j], level + 1);
+ }
}
}
}
}
-
+
/**
* Adds new element to the build queue and step<->element hash map
*/
protected void addElement(IBuildStep step, int level) {
- BuildQueueElement elem = new BuildQueueElement(step, level);
+ BuildQueueElement elem = new BuildQueueElement(step, level);
unsorted.add(elem);
queueHash.put(step, elem);
}
-
+
/**
* Dispatches the build queue and returns build status
*/
protected int dispatch(BuildProcessManager mgr) {
int maxProcesses = mgr.getMaxProcesses();
Vector<ActiveBuildStep> active = new Vector<ActiveBuildStep>(Math.min(maxProcesses, 10), 10);
-
+
int activeCount = 0;
int maxLevel = 0;
int status = STATUS_OK;
String errorMsg = null;
-
+
// Going into "infinite" main loop
- main_loop:
- while (true) {
+ main_loop: while (true) {
if (monitor.isCanceled()) {
status = STATUS_CANCELED;
errorMsg = CCorePlugin.getResourceString("CommandLauncher.error.commandCanceled"); //$NON-NLS-1$
@@ -486,7 +499,7 @@ public class ParallelBuilder {
}
// Everything goes OK.
boolean proceed = true;
-
+
// Check if there is room for new process
if (!mgr.hasEmpty()) {
proceed = false;
@@ -494,17 +507,19 @@ public class ParallelBuilder {
// Check "active steps" list for completed ones
for (ActiveBuildStep buildStep : active) {
ProcessLauncher pl = buildStep.getLauncher();
- if (pl == null) continue;
+ if (pl == null)
+ continue;
if (pl.queryState() == ProcessLauncher.STATE_DONE) {
// If process has terminated with error, break loop
// (except resumeOnErrors == true)
-
+
if (!resumeOnErrors && pl.getExitCode() != 0) {
status = STATUS_ERROR;
break main_loop;
}
// Try to launch next command for the current active step
- if (buildStep.isDone()) continue;
+ if (buildStep.isDone())
+ continue;
if (buildStep.launchNextCmd(mgr)) {
// Command has been launched. Check if process pool is not maximized yet
if (!mgr.hasEmpty()) {
@@ -520,7 +535,7 @@ public class ParallelBuilder {
}
}
}
-
+
// If nothing to do, then sleep and continue main loop
if (!proceed) {
try {
@@ -530,20 +545,20 @@ public class ParallelBuilder {
}
continue main_loop;
}
-
+
// Check if we need to schedule another process
if (queue.size() != 0 && activeCount < maxProcesses) {
- // Need to schedule another process
+ // Need to schedule another process
Iterator<BuildQueueElement> iter = queue.iterator();
// Iterate over build queue
while (iter.hasNext()) {
BuildQueueElement elem = iter.next();
-
+
// If "active steps" list reaches maximum, then break loop
if (activeCount == maxProcesses)
break;
-
+
// If current element's level exceeds maximum level of currently built
// resources, then stop iteration (we can not build it anyway)
if (elem.getLevel() > maxLevel + 1)
@@ -571,7 +586,7 @@ public class ParallelBuilder {
if (prereqBuilt) {
// All prereqs are built
IBuildStep step = elem.getStep();
-
+
// Remove element from the build queue and add it to the
// "active steps" list.
iter.remove();
@@ -593,7 +608,7 @@ public class ParallelBuilder {
break;
}
}
-
+
// Update maxLevel
if (elem.getLevel() > maxLevel)
maxLevel = elem.getLevel();
@@ -602,19 +617,19 @@ public class ParallelBuilder {
}
}
}
-
+
// Now finally, check if we're done
- if (activeCount <= 0 && queue.size() == 0)
+ if (activeCount <= 0 && queue.size() == 0)
break main_loop;
}
- if (status != STATUS_OK && errorMsg != null)
+ if (status != STATUS_OK && errorMsg != null)
printMessage(errorMsg, out);
return status;
}
-
+
/**
- * Prints output to the console
+ * Prints output to the console
*/
protected void printMessage(String msg, OutputStream out) {
if (out != null) {
@@ -627,19 +642,21 @@ public class ParallelBuilder {
}
}
}
-
+
/**
* Updates info about generated files (after step completed)
*/
- protected void refreshOutputs(IBuildStep step){
+ protected void refreshOutputs(IBuildStep step) {
IProgressMonitor mon = new NullProgressMonitor();
IBuildResource outres[] = step.getOutputResources();
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- for(int i = 0; i < outres.length; i++){
+ for (int i = 0; i < outres.length; i++) {
IPath path = outres[i].getFullPath();
- if(path != null){
- try { root.getFile(path).refreshLocal(0, mon); }
- catch (CoreException e) {}
+ if (path != null) {
+ try {
+ root.getFile(path).refreshLocal(0, mon);
+ } catch (CoreException e) {
+ }
}
}
@@ -661,5 +678,4 @@ public class ParallelBuilder {
putAll(fRebuildStateContainer, inres, 0, false);
}
-
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ProcessLauncher.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ProcessLauncher.java
index 4ddd2371c6a..0dab38d1e84 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ProcessLauncher.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/ProcessLauncher.java
@@ -22,9 +22,9 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
/**
- * This class implements external process launching for internal builder.
+ * This class implements external process launching for internal builder.
*
- * 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 ProcessLauncher {
@@ -32,7 +32,7 @@ public class ProcessLauncher {
public final static int STATE_RUNNING = 1;
public final static int STATE_CANCELED = 2;
public final static int STATE_ILLEGAL = -1;
-
+
protected String[] cmd;
protected String[] env;
protected File cwd;
@@ -52,7 +52,7 @@ public class ProcessLauncher {
public String[] getCommandArray() {
return cmd;
}
-
+
/**
* Returns command line in a single string
*/
@@ -65,55 +65,60 @@ public class ProcessLauncher {
}
buf.append(lineSeparator);
}
-
+
return buf.toString();
}
-
+
/**
* Returns process environment
*/
public String[] getEnvironment() {
return env;
}
-
+
/**
* Returns command working directory
*/
public File getWorkingDir() {
return cwd;
}
-
+
/**
* Returns error message (if any)
*/
public String getErrorMessage() {
return error;
}
-
+
/**
* Returns exit code of a process
*/
public int getExitCode() {
- if (process == null || closure.isAlive()) return 0;
- try { return process.waitFor(); }
- catch (InterruptedException e) { return 0; }
+ if (process == null || closure.isAlive())
+ return 0;
+ try {
+ return process.waitFor();
+ } catch (InterruptedException e) {
+ return 0;
+ }
}
-
+
/**
* Initializes launcher
* @param _cmd Command path
* @param args Command arguments
- * @param _env Environment
+ * @param _env Environment
* @param _cwd Working directory
* @param _out Output stream
* @param _err Error output stream
- * @param _monitor Progress monitor
+ * @param _monitor Progress monitor
* @param _show If true, print command line before launching
*/
- public ProcessLauncher(IPath _cmd, String[] args, String[] _env, IPath _cwd, OutputStream _out, OutputStream _err, IProgressMonitor _monitor, boolean _show) {
+ public ProcessLauncher(IPath _cmd, String[] args, String[] _env, IPath _cwd, OutputStream _out, OutputStream _err,
+ IProgressMonitor _monitor, boolean _show) {
cmd = createCmdArray(_cmd.toOSString(), args);
env = _env;
- cwd = _cwd.toFile();
+ cwd = _cwd.toFile();
out = _out;
err = _err;
monitor = _monitor;
@@ -121,7 +126,7 @@ public class ProcessLauncher {
error = ""; //$NON-NLS-1$
lineSeparator = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
}
-
+
/**
* Launches a process
*/
@@ -130,7 +135,7 @@ public class ProcessLauncher {
if (show)
printCommandLine();
state = STATE_RUNNING;
- process = ProcessFactory.getFactory().exec(cmd, env, cwd);
+ process = ProcessFactory.getFactory().exec(cmd, env, cwd);
closure = new ProcessClosure(process, out, err);
// Close the input of the process since we will never write to it
try {
@@ -144,13 +149,13 @@ public class ProcessLauncher {
closure = null;
}
}
-
+
/**
* Returns process state
*/
public int queryState() {
if (state == STATE_RUNNING) {
- if (closure == null)
+ if (closure == null)
state = STATE_ILLEGAL;
else if (monitor.isCanceled()) {
closure.terminate();
@@ -160,22 +165,22 @@ public class ProcessLauncher {
state = STATE_DONE;
}
}
-
+
return state;
}
/**
- * Creates a string array representing the command that will be passed
+ * Creates a string array representing the command that will be passed
* to the process
*/
protected String[] createCmdArray(String cmdPath, String[] cmdArgs) {
String[] args = new String[1 + cmdArgs.length];
args[0] = cmdPath;
System.arraycopy(cmdArgs, 0, args, 1, cmdArgs.length);
-
+
return args;
}
-
+
/**
* Prints command line
*/
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 acf1f62abbb..13e7bf0b4a7 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
@@ -39,11 +39,11 @@ public class ProjectBuildState implements IProjectBuildState {
private IProject fProject;
private boolean fIsMapInfoDirty;
- public ProjectBuildState(IProject project){
+ public ProjectBuildState(IProject project) {
fProject = project;
}
- void setProject(IProject project){
+ void setProject(IProject project) {
fProject = project;
Collection<ConfigurationBuildState> cbStates = fCfgIdToStateMap.values();
for (ConfigurationBuildState cbs : cbStates) {
@@ -54,9 +54,9 @@ public class ProjectBuildState implements IProjectBuildState {
@Override
public IConfigurationBuildState getConfigurationBuildState(String id, boolean create) {
ConfigurationBuildState state = fCfgIdToStateMap.get(id);
- if(state == null){
+ if (state == null) {
state = loadState(id, create);
- if(state.exists() || create)
+ if (state.exists() || create)
fCfgIdToStateMap.put(id, state);
else
state = null;
@@ -64,10 +64,10 @@ public class ProjectBuildState implements IProjectBuildState {
return state;
}
- private ConfigurationBuildState loadState(String id, boolean create){
+ private ConfigurationBuildState loadState(String id, boolean create) {
File file = getFileForCfg(id, create);
ConfigurationBuildState bs = new ConfigurationBuildState(fProject, id);
- if(file != null && file.exists()){
+ if (file != null && file.exists()) {
try {
InputStream iStream = new FileInputStream(file);
bs.load(iStream);
@@ -87,9 +87,9 @@ public class ProjectBuildState implements IProjectBuildState {
List<IConfigurationBuildState> list = new ArrayList<IConfigurationBuildState>(props.size());
Set<Object> keySet = props.keySet();
for (Object key : keySet) {
- String id = (String)key;
+ String id = (String) key;
IConfigurationBuildState state = getConfigurationBuildState(id, false);
- if(state != null)
+ if (state != null)
list.add(state);
}
return list.toArray(new ConfigurationBuildState[list.size()]);
@@ -97,8 +97,8 @@ public class ProjectBuildState implements IProjectBuildState {
@Override
public void removeConfigurationBuildState(String id) {
- ConfigurationBuildState cbs = (ConfigurationBuildState)getConfigurationBuildState(id, false);
- if(cbs != null){
+ ConfigurationBuildState cbs = (ConfigurationBuildState) getConfigurationBuildState(id, false);
+ if (cbs != null) {
cbs.setState(IRebuildState.NEED_REBUILD);
}
}
@@ -113,29 +113,30 @@ public class ProjectBuildState implements IProjectBuildState {
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){
+ private String getFileName(String id, int op) {
Properties props = getIdToNameProperties();
String name = props.getProperty(id);
- if(name == null){
- if(op == OP_CREATE){
+ if (name == null) {
+ if (op == OP_CREATE) {
name = Integer.toString(CDataUtil.genRandomNumber());
props.setProperty(id, name);
fIsMapInfoDirty = true;
- // saveMapFile();
+ // saveMapFile();
}
- } else if (op == OP_REMOVE){
+ } else if (op == OP_REMOVE) {
props.remove(id);
fIsMapInfoDirty = true;
}
return name;
}
- private File getFileForCfg(String id, boolean create){
+ private File getFileForCfg(String id, boolean create) {
String name = getFileName(id, create ? OP_CREATE : 0);
- if(name == null)
+ if (name == null)
return null;
IPath path = BuildStateManager.getInstance().getPrefsDirPath(fProject);
@@ -143,13 +144,13 @@ public class ProjectBuildState implements IProjectBuildState {
return path.toFile();
}
- private void saveMapFile(){
- if(fCfgIdToFileNameProps == null)
+ private void saveMapFile() {
+ if (fCfgIdToFileNameProps == null)
return;
File file = getMapFile();
File parent = file.getParentFile();
- if(!parent.exists())
+ if (!parent.exists())
parent.mkdirs();
try {
@@ -163,18 +164,18 @@ public class ProjectBuildState implements IProjectBuildState {
}
}
- private File getMapFile(){
+ private File getMapFile() {
IPath path = BuildStateManager.getInstance().getPrefsDirPath(fProject);
path = path.append(getProjFileName());
File file = path.toFile();
return file;
}
- private Properties getIdToNameProperties(){
- if(fCfgIdToFileNameProps == null){
+ private Properties getIdToNameProperties() {
+ if (fCfgIdToFileNameProps == null) {
fCfgIdToFileNameProps = new Properties();
File file = getMapFile();
- if(file.exists()){
+ if (file.exists()) {
try {
InputStream iStream = new FileInputStream(file);
fCfgIdToFileNameProps.load(iStream);
@@ -189,7 +190,7 @@ public class ProjectBuildState implements IProjectBuildState {
return fCfgIdToFileNameProps;
}
- private String getProjFileName(){
+ private String getProjFileName() {
return fProject.getName();
}
@@ -198,21 +199,21 @@ public class ProjectBuildState implements IProjectBuildState {
return fProject;
}
- void serialize(){
+ void serialize() {
Collection<ConfigurationBuildState> cbStates = fCfgIdToStateMap.values();
for (ConfigurationBuildState s : cbStates) {
String id = s.getConfigurationId();
- if(!s.exists()){
+ if (!s.exists()) {
File file = getFileForCfg(id, false);
- if(file != null && file.exists()){
+ if (file != null && file.exists()) {
file.delete();
getFileName(id, OP_REMOVE);
}
} else {
File file = getFileForCfg(id, true);
File parent = file.getParentFile();
- if(!parent.exists())
+ if (!parent.exists())
parent.mkdirs();
try {
@@ -227,7 +228,7 @@ public class ProjectBuildState implements IProjectBuildState {
}
}
- if(fIsMapInfoDirty)
+ if (fIsMapInfoDirty)
saveMapFile();
}
}
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 5f2b5b7fe94..1667a36bad9 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
@@ -51,24 +51,25 @@ public class StepBuilder implements IBuildModelBuilder {
private CommandBuilder fCommandBuilders[];
private IResourceRebuildStateContainer fRebuildStateContainer;
- public StepBuilder(IBuildStep step, IResourceRebuildStateContainer rs){
+ public StepBuilder(IBuildStep step, IResourceRebuildStateContainer rs) {
this(step, null, rs);
}
- public StepBuilder(IBuildStep step, IPath cwd, IResourceRebuildStateContainer rs){
+ public StepBuilder(IBuildStep step, IPath cwd, IResourceRebuildStateContainer rs) {
this(step, cwd, true, null, rs);
}
- public StepBuilder(IBuildStep step, IPath cwd, boolean resumeOnErrs, GenDirInfo dirs, IResourceRebuildStateContainer rs){
+ public StepBuilder(IBuildStep step, IPath cwd, boolean resumeOnErrs, GenDirInfo dirs,
+ IResourceRebuildStateContainer rs) {
fStep = step;
fCWD = cwd;
fDirs = dirs;
fResumeOnErrs = resumeOnErrs;
- if(fDirs == null)
+ if (fDirs == null)
fDirs = new GenDirInfo(fStep.getBuildDescription().getConfiguration());
- if(fCWD == null)
+ if (fCWD == null)
fCWD = fStep.getBuildDescription().getDefaultBuildDirLocation();
fRebuildStateContainer = rs;
@@ -78,31 +79,27 @@ public class StepBuilder implements IBuildModelBuilder {
* @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){
+ public int build(OutputStream out, OutputStream err, IProgressMonitor monitor) {
- monitor.beginTask("", getNumCommands()); //$NON-NLS-1$
- monitor.subTask(""); //$NON-NLS-1$
+ monitor.beginTask("", getNumCommands()); //$NON-NLS-1$
+ monitor.subTask(""); //$NON-NLS-1$
int status = STATUS_OK;
CommandBuilder bs[] = getCommandBuilders();
- if(bs.length > 0){
+ if (bs.length > 0) {
//TODO: monitor
createOutDirs(new NullProgressMonitor());
- for(int i = 0;
- i < bs.length
- && status != STATUS_CANCELLED
- && (fResumeOnErrs || status == STATUS_OK);
- i++){
+ for (int i = 0; i < bs.length && status != STATUS_CANCELLED
+ && (fResumeOnErrs || status == STATUS_OK); i++) {
CommandBuilder builder = bs[i];
- switch(builder.build(out, err, new SubProgressMonitor(monitor, builder.getNumCommands()))){
+ switch (builder.build(out, err, new SubProgressMonitor(monitor, builder.getNumCommands()))) {
case STATUS_OK:
break;
case STATUS_CANCELLED:
status = STATUS_CANCELLED;
case STATUS_ERROR_BUILD:
- if(status != STATUS_ERROR_LAUNCH)
+ if (status != STATUS_ERROR_LAUNCH)
status = STATUS_ERROR_BUILD;
break;
case STATUS_ERROR_LAUNCH:
@@ -118,11 +115,11 @@ public class StepBuilder implements IBuildModelBuilder {
return status;
}
- protected int postProcess(int status, IProgressMonitor monitor){
- if(status != STATUS_ERROR_LAUNCH){
+ protected int postProcess(int status, IProgressMonitor monitor) {
+ if (status != STATUS_ERROR_LAUNCH) {
refreshOutputs(monitor);
}
- switch(status){
+ switch (status) {
case STATUS_OK:
clearRebuildState();
break;
@@ -136,8 +133,8 @@ public class StepBuilder implements IBuildModelBuilder {
return status;
}
- private void clearRebuildState(){
- if(fRebuildStateContainer == null)
+ private void clearRebuildState() {
+ if (fRebuildStateContainer == null)
return;
IBuildResource[] rcs = fStep.getOutputResources();
@@ -146,91 +143,89 @@ public class StepBuilder implements IBuildModelBuilder {
DescriptionBuilder.putAll(fRebuildStateContainer, rcs, 0, false);
}
- protected void refreshOutputs(IProgressMonitor monitor){
- if(fStep == fStep.getBuildDescription().getInputStep())
+ 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++){
+ for (int i = 0; i < rcs.length; i++) {
IPath path = rcs[i].getFullPath();
- if(path != null){
+ if (path != null) {
IFile file = root.getFile(path);
try {
file.refreshLocal(IResource.DEPTH_ZERO, monitor);
} catch (CoreException e) {
- if(DbgUtil.DEBUG){
- DbgUtil.trace("failed to refresh resource " //$NON-NLS-1$
- + file.getFullPath()
- + ", error: " + e.getLocalizedMessage()); //$NON-NLS-1$
+ if (DbgUtil.DEBUG) {
+ DbgUtil.trace("failed to refresh resource " //$NON-NLS-1$
+ + file.getFullPath() + ", error: " + e.getLocalizedMessage()); //$NON-NLS-1$
}
}
}
}
}
- protected void cleanOutputs(IProgressMonitor monitor){
- if(fStep == fStep.getBuildDescription().getInputStep())
+ 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())
+ for (int i = 0; i < bRcs.length; i++) {
+ if (!bRcs[i].isProjectResource())
continue;
IResource rc = BuildDescriptionManager.findResourceForBuildResource(bRcs[i]);
- if(rc != null){
+ if (rc != null) {
try {
rc.delete(true, monitor);
} catch (CoreException e) {
- if(DbgUtil.DEBUG){
- DbgUtil.trace("failed to delete resource " //$NON-NLS-1$
- + rc.getFullPath()
- + ", error: " + e.getLocalizedMessage()); //$NON-NLS-1$
+ if (DbgUtil.DEBUG) {
+ DbgUtil.trace("failed to delete resource " //$NON-NLS-1$
+ + rc.getFullPath() + ", error: " + e.getLocalizedMessage()); //$NON-NLS-1$
}
}
}
}
}
- protected void createOutDirs(IProgressMonitor monitor){
+ protected void createOutDirs(IProgressMonitor monitor) {
IBuildDescription des = fStep.getBuildDescription();
- if(des != null && des.getInputStep() == fStep){
+ if (des != null && des.getInputStep() == fStep) {
IPath path = des.getDefaultBuildDirFullPath();
- if(path != null){
+ if (path != null) {
fDirs.createIfProjectDir(path, monitor);
}
}
IBuildResource rcs[] = fStep.getOutputResources();
- for(int i = 0; i < rcs.length; i++){
+ for (int i = 0; i < rcs.length; i++) {
fDirs.createDir(rcs[i], monitor);
}
}
public int getNumCommands() {
- if(fNumCommands == -1){
+ if (fNumCommands == -1) {
CommandBuilder bs[] = getCommandBuilders();
fNumCommands = 0;
- for(int i = 0; i < bs.length; i++){
+ for (int i = 0; i < bs.length; i++) {
fNumCommands += bs[i].getNumCommands();
}
}
return fNumCommands;
}
- protected CommandBuilder[] getCommandBuilders(){
- if(fCommandBuilders == null){
+ protected CommandBuilder[] getCommandBuilders() {
+ if (fCommandBuilders == null) {
IBuildCommand cmds[] = fStep.getCommands(fCWD, null, null, true);
- if(cmds == null)
+ if (cmds == null)
fCommandBuilders = new CommandBuilder[0];
else {
fCommandBuilders = new CommandBuilder[cmds.length];
IConfiguration cfg = fStep.getBuildDescription().getConfiguration();
- IProject project = (IProject)cfg.getOwner();
- for(int i = 0; i < cmds.length; i++){
+ IProject project = (IProject) cfg.getOwner();
+ for (int i = 0; i < cmds.length; i++) {
fCommandBuilders[i] = new CommandBuilder(cmds[i], fRebuildStateContainer, project);
}
}
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 30ff74ba122..eb2cec78373 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
@@ -27,47 +27,47 @@ public class BuildProperties implements IBuildProperties {
private HashMap<String, IBuildProperty> fPropertiesMap = new HashMap<String, IBuildProperty>();
private ArrayList<String> fInexistentProperties;
- public BuildProperties(){
+ public BuildProperties() {
}
- public BuildProperties(String properties){
+ public BuildProperties(String properties) {
StringTokenizer t = new StringTokenizer(properties, BuildPropertyManager.PROPERTIES_SEPARATOR);
- while(t.hasMoreTokens()){
+ while (t.hasMoreTokens()) {
String property = t.nextToken();
try {
BuildProperty prop = new BuildProperty(property);
addProperty(prop);
} catch (CoreException e) {
- if(fInexistentProperties == null)
+ if (fInexistentProperties == null)
fInexistentProperties = new ArrayList<String>();
fInexistentProperties.add(property);
}
}
- if(fInexistentProperties != null)
+ if (fInexistentProperties != null)
fInexistentProperties.trimToSize();
}
@SuppressWarnings("unchecked")
- public BuildProperties(BuildProperties properties){
+ public BuildProperties(BuildProperties properties) {
fPropertiesMap.putAll(properties.fPropertiesMap);
- if(properties.fInexistentProperties != null)
- fInexistentProperties = (ArrayList<String>)properties.fInexistentProperties.clone();
+ if (properties.fInexistentProperties != null)
+ fInexistentProperties = (ArrayList<String>) properties.fInexistentProperties.clone();
}
@Override
- public IBuildProperty[] getProperties(){
+ public IBuildProperty[] getProperties() {
return fPropertiesMap.values().toArray(new BuildProperty[fPropertiesMap.size()]);
}
@Override
- public IBuildProperty getProperty(String id){
+ public IBuildProperty getProperty(String id) {
return fPropertiesMap.get(id);
}
- void addProperty(IBuildProperty property){
+ void addProperty(IBuildProperty property) {
fPropertiesMap.put(property.getPropertyType().getId(), property);
}
@@ -83,9 +83,9 @@ public class BuildProperties implements IBuildProperties {
addProperty(property);
return property;
- } catch (CoreException e){
- if(force){
- if(fInexistentProperties == null)
+ } catch (CoreException e) {
+ if (force) {
+ if (fInexistentProperties == null)
fInexistentProperties = new ArrayList<String>(1);
fInexistentProperties.add(BuildProperty.toString(propertyId, propertyValue));
@@ -96,20 +96,22 @@ public class BuildProperties implements IBuildProperties {
}
@Override
- public IBuildProperty removeProperty(String id){
+ public IBuildProperty removeProperty(String id) {
return fPropertiesMap.remove(id);
}
- void removeProperty(BuildProperty property){
+ void removeProperty(BuildProperty property) {
fPropertiesMap.remove(property.getPropertyType().getId());
}
@Override
- public String toString(){
+ public String toString() {
String props = toStringExistingProperties();
- if(fInexistentProperties != null){
- String inexistentProps = CDataUtil.arrayToString(fInexistentProperties.toArray(new String[fInexistentProperties.size()]), BuildPropertyManager.PROPERTIES_SEPARATOR);
- if(props.length() != 0){
+ if (fInexistentProperties != null) {
+ String inexistentProps = CDataUtil.arrayToString(
+ fInexistentProperties.toArray(new String[fInexistentProperties.size()]),
+ BuildPropertyManager.PROPERTIES_SEPARATOR);
+ if (props.length() != 0) {
StringBuilder buf = new StringBuilder();
buf.append(props).append(BuildPropertyManager.PROPERTIES_SEPARATOR).append(inexistentProps);
} else {
@@ -119,17 +121,17 @@ public class BuildProperties implements IBuildProperties {
return props;
}
- public String toStringExistingProperties(){
+ public String toStringExistingProperties() {
int size = fPropertiesMap.size();
- if(size == 0)
+ if (size == 0)
return ""; //$NON-NLS-1$
- else if(size == 1)
+ else if (size == 1)
return fPropertiesMap.values().iterator().next().toString();
StringBuilder buf = new StringBuilder();
Iterator<IBuildProperty> iter = fPropertiesMap.values().iterator();
buf.append(iter.next().toString());
- for(;iter.hasNext();){
+ for (; iter.hasNext();) {
buf.append(BuildPropertyManager.PROPERTIES_SEPARATOR);
buf.append(iter.next().toString());
}
@@ -140,18 +142,18 @@ public class BuildProperties implements IBuildProperties {
@Override
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();
- BuildProperty prop = (BuildProperty)entry.getValue();
- entry.setValue(prop.clone());
- }
-*/
+ 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();
+ BuildProperty prop = (BuildProperty)entry.getValue();
+ entry.setValue(prop.clone());
+ }
+ */
return clone;
} catch (CloneNotSupportedException e) {
}
@@ -167,12 +169,10 @@ public class BuildProperties implements IBuildProperties {
@Override
public boolean containsValue(String propertyId, String valueId) {
IBuildProperty prop = getProperty(propertyId);
- if(prop != null){
+ if (prop != null) {
return valueId.equals(prop.getValue().getId());
}
return false;
}
-
-
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertiesMessages.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertiesMessages.java
index 0cc9fafeeea..1b06824ec63 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertiesMessages.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertiesMessages.java
@@ -19,8 +19,7 @@ import java.util.ResourceBundle;
public class BuildPropertiesMessages {
private static final String BUNDLE_NAME = "org.eclipse.cdt.managedbuilder.internal.buildproperties.BuildPropertiesMessages"; //$NON-NLS-1$
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
private BuildPropertiesMessages() {
}
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 495ff9a8342..6da82c16c91 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
@@ -23,14 +23,14 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-public class BuildProperty implements IBuildProperty{
+public class BuildProperty implements IBuildProperty {
private IBuildPropertyType fType;
private IBuildPropertyValue fValue;
BuildProperty(String property) throws CoreException {
int index = property.indexOf(BuildPropertyManager.PROPERTY_VALUE_SEPARATOR);
String type, value;
- if(index != -1){
+ if (index != -1) {
type = SafeStringInterner.safeIntern(property.substring(0, index));
value = SafeStringInterner.safeIntern(property.substring(index + 1));
} else {
@@ -39,9 +39,8 @@ public class BuildProperty implements IBuildProperty{
}
fType = BuildPropertyManager.getInstance().getPropertyType(type);
- if(fType == null){
- throw new CoreException(new Status(IStatus.ERROR,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ if (fType == null) {
+ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
BuildPropertiesMessages.getString("BuildProperty.0"))); //$NON-NLS-1$
}
setValue(value);
@@ -53,48 +52,47 @@ public class BuildProperty implements IBuildProperty{
}
@Override
- public IBuildPropertyType getPropertyType(){
+ 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(),
- BuildPropertiesMessages.getString("BuildProperty.1")+id)); //$NON-NLS-1$
+ if (value == null)
+ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ BuildPropertiesMessages.getString("BuildProperty.1") + id)); //$NON-NLS-1$
setValue(value);
}
- private void setValue(IBuildPropertyValue value){
+ private void setValue(IBuildPropertyValue value) {
fValue = value;
}
@Override
- public IBuildPropertyValue getValue(){
+ public IBuildPropertyValue getValue() {
return fValue;
}
@Override
- public String toString(){
+ public String toString() {
return toString(fType.toString(), fValue.toString());
}
- public static String toString(String type, String value){
+ public static String toString(String type, String value) {
StringBuilder buf = new StringBuilder();
buf.append(type).append(BuildPropertyManager.PROPERTY_VALUE_SEPARATOR).append(value);
return buf.toString();
}
-/* public Object clone() {
- try {
- return super.clone();
- } catch (CloneNotSupportedException e) {
+ /* public Object clone() {
+ try {
+ return super.clone();
+ } catch (CloneNotSupportedException e) {
+ }
+ return null;
}
- return null;
- }
-*/
+ */
}
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 1e91cb57ce3..80ed810f9b6 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
@@ -31,9 +31,9 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
-public class BuildPropertyManager implements IBuildPropertyManager{
+public class BuildPropertyManager implements IBuildPropertyManager {
private static final String PROPERTIES_EXT_POINT_ID = "org.eclipse.cdt.managedbuilder.core.buildProperties"; //$NON-NLS-1$
- static final String PROPERTY_VALUE_SEPARATOR = "="; //$NON-NLS-1$
+ static final String PROPERTY_VALUE_SEPARATOR = "="; //$NON-NLS-1$
static final String PROPERTIES_SEPARATOR = ","; //$NON-NLS-1$
static final String ELEMENT_PROPERTY_TYPE = "propertyType"; //$NON-NLS-1$
static final String ELEMENT_PROPERTY_VALUE = "propertyValue"; //$NON-NLS-1$
@@ -46,37 +46,36 @@ public class BuildPropertyManager implements IBuildPropertyManager{
private List<IConfigurationElement> fTypeCfgElements;
private List<IConfigurationElement> fValueCfgElements;
- private BuildPropertyManager(){
+ private BuildPropertyManager() {
loadExtensions();
}
- public static BuildPropertyManager getInstance(){
- if(fInstance == null)
+ public static BuildPropertyManager getInstance() {
+ if (fInstance == null)
fInstance = new BuildPropertyManager();
return fInstance;
}
- public BuildProperties loadPropertiesFromString(String properties){
+ public BuildProperties loadPropertiesFromString(String properties) {
return new BuildProperties(properties);
}
- public String savePropertiesToString(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){
+ public IBuildPropertyType getPropertyType(String id) {
return fPropertyTypeMap.get(id);
}
- public IBuildPropertyType createPropertyType(String id, String name) throws CoreException{
+ public IBuildPropertyType createPropertyType(String id, String name) throws CoreException {
IBuildPropertyType type = getPropertyType(id);
- if(type != null){
- if(!name.equals(type.getName()))
- throw new CoreException(new Status(IStatus.ERROR,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ if (type != null) {
+ if (!name.equals(type.getName()))
+ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
BuildPropertiesMessages.getString("BuildPropertyManager.8"))); //$NON-NLS-1$
} else {
type = new BuildPropertyType(id, name);
@@ -85,80 +84,76 @@ public class BuildPropertyManager implements IBuildPropertyManager{
return type;
}
- public IBuildPropertyValue createPropertyValue(String typeId, String id, String name) throws CoreException{
+ public IBuildPropertyValue createPropertyValue(String typeId, String id, String name) throws CoreException {
IBuildPropertyType type = getPropertyType(typeId);
- if(type == null)
- throw new CoreException(new Status(
- IStatus.ERROR,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ if (type == null)
+ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
BuildPropertiesMessages.getString("BuildPropertyManager.9"))); //$NON-NLS-1$
return createPropertyValue(type, id, name);
}
- public IBuildPropertyValue createPropertyValue(IBuildPropertyType type, String id, String name) throws CoreException{
- BuildPropertyValue value = (BuildPropertyValue)type.getSupportedValue(id);
- if(value != null){
- if(!name.equals(value.getName()))
- throw new CoreException(new Status(IStatus.ERROR,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ public IBuildPropertyValue createPropertyValue(IBuildPropertyType type, String id, String name)
+ throws CoreException {
+ BuildPropertyValue value = (BuildPropertyValue) type.getSupportedValue(id);
+ if (value != null) {
+ if (!name.equals(value.getName()))
+ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
BuildPropertiesMessages.getString("BuildPropertyManager.10"))); //$NON-NLS-1$
} else {
value = new BuildPropertyValue(id, name);
- ((BuildPropertyType)type).addSupportedValue(value);
+ ((BuildPropertyType) type).addSupportedValue(value);
}
return value;
}
@Override
- public IBuildPropertyType[] getPropertyTypes(){
+ 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)
- throw new CoreException(new Status(
- IStatus.ERROR,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ if (type == null)
+ throw new CoreException(new Status(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())){
+ private boolean addConfigElement(IConfigurationElement el) {
+ if (ELEMENT_PROPERTY_TYPE.equals(el.getName())) {
getTypeElList(true).add(el);
return true;
- } else if(ELEMENT_PROPERTY_VALUE.equals(el.getName())){
+ } else if (ELEMENT_PROPERTY_VALUE.equals(el.getName())) {
getValueElList(true).add(el);
return true;
}
return false;
}
- private List<IConfigurationElement> getTypeElList(boolean create){
- if(fTypeCfgElements == null && create)
+ private List<IConfigurationElement> getTypeElList(boolean create) {
+ if (fTypeCfgElements == null && create)
fTypeCfgElements = new ArrayList<IConfigurationElement>();
return fTypeCfgElements;
}
- private List<IConfigurationElement> getValueElList(boolean create){
- if(fValueCfgElements == null && create)
+ private List<IConfigurationElement> getValueElList(boolean create) {
+ if (fValueCfgElements == null && create)
fValueCfgElements = new ArrayList<IConfigurationElement>();
return fValueCfgElements;
}
- private void loadExtensions(){
+ private void loadExtensions() {
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(PROPERTIES_EXT_POINT_ID);
- if( extensionPoint != null) {
+ if (extensionPoint != null) {
IExtension[] extensions = extensionPoint.getExtensions();
for (int i = 0; i < extensions.length; ++i) {
IExtension extension = extensions[i];
IConfigurationElement els[] = extension.getConfigurationElements();
- for(int k = 0; k < els.length; k++){
+ for (int k = 0; k < els.length; k++) {
addConfigElement(els[k]);
}
}
@@ -167,10 +162,9 @@ public class BuildPropertyManager implements IBuildPropertyManager{
}
}
-
- private void resolveConfigElements(){
+ private void resolveConfigElements() {
List<IConfigurationElement> typeEls = getTypeElList(false);
- if(typeEls != null){
+ if (typeEls != null) {
for (IConfigurationElement el : typeEls) {
try {
createPropertyType(el);
@@ -180,7 +174,7 @@ public class BuildPropertyManager implements IBuildPropertyManager{
}
List<IConfigurationElement> valEls = getValueElList(false);
- if(valEls != null){
+ if (valEls != null) {
for (IConfigurationElement el : valEls) {
try {
createPropertyValue(el);
@@ -191,39 +185,33 @@ public class BuildPropertyManager implements IBuildPropertyManager{
}
- private IBuildPropertyType createPropertyType(IConfigurationElement el) throws CoreException{
+ private IBuildPropertyType createPropertyType(IConfigurationElement el) throws CoreException {
String id = el.getAttribute(ATTRIBUTE_ID);
- if(id == null)
- throw new CoreException(new Status(IStatus.ERROR,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ if (id == null)
+ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
BuildPropertiesMessages.getString("BuildPropertyManager.12"))); //$NON-NLS-1$
String name = el.getAttribute(ATTRIBUTE_NAME);
- if(name == null)
- throw new CoreException(new Status(IStatus.ERROR,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ if (name == null)
+ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
BuildPropertiesMessages.getString("BuildPropertyManager.13"))); //$NON-NLS-1$
return createPropertyType(id, name);
}
- private IBuildPropertyValue createPropertyValue(IConfigurationElement el) throws CoreException{
+ private IBuildPropertyValue createPropertyValue(IConfigurationElement el) throws CoreException {
String id = el.getAttribute(ATTRIBUTE_ID);
- if(id == null)
- throw new CoreException(new Status(IStatus.ERROR,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ if (id == null)
+ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
BuildPropertiesMessages.getString("BuildPropertyManager.14"))); //$NON-NLS-1$
String name = el.getAttribute(ATTRIBUTE_NAME);
- if(name == null)
- throw new CoreException(new Status(IStatus.ERROR,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ if (name == null)
+ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
BuildPropertiesMessages.getString("BuildPropertyManager.15"))); //$NON-NLS-1$
String property = el.getAttribute(ATTRIBUTE_PROPERTY);
- if(property == null)
- throw new CoreException(new Status(IStatus.ERROR,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ if (property == null)
+ throw new CoreException(new Status(IStatus.ERROR, 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 1e36b8ae05c..3d2781354d4 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,25 +19,24 @@ import java.util.Map;
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyType;
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyValue;
-
-public class BuildPropertyType extends PropertyBase implements IBuildPropertyType{
+public class BuildPropertyType extends PropertyBase implements IBuildPropertyType {
private Map<String, BuildPropertyValue> fValuesMap = new HashMap<String, BuildPropertyValue>();
- BuildPropertyType(String id, String name){
+ BuildPropertyType(String id, String name) {
super(id, name);
}
- void addSupportedValue(BuildPropertyValue value){
+ void addSupportedValue(BuildPropertyValue value) {
fValuesMap.put(value.getId(), value);
}
@Override
- public IBuildPropertyValue[] getSupportedValues(){
+ public IBuildPropertyValue[] getSupportedValues() {
return fValuesMap.values().toArray(new BuildPropertyValue[fValuesMap.size()]);
}
@Override
- public IBuildPropertyValue getSupportedValue(String id){
+ public IBuildPropertyValue getSupportedValue(String id) {
return fValuesMap.get(id);
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertyValue.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertyValue.java
index 98f8e145ea3..a8b9777bff6 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertyValue.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/BuildPropertyValue.java
@@ -15,8 +15,7 @@ package org.eclipse.cdt.managedbuilder.internal.buildproperties;
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyValue;
-
-public class BuildPropertyValue extends PropertyBase implements IBuildPropertyValue{
+public class BuildPropertyValue extends PropertyBase implements IBuildPropertyValue {
BuildPropertyValue(String id, String name) {
super(id, name);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/PropertyBase.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/PropertyBase.java
index f3c8a16a5c9..147ae70125e 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/PropertyBase.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildproperties/PropertyBase.java
@@ -13,40 +13,38 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.internal.buildproperties;
-
-
public abstract class PropertyBase {
private String fId;
private String fName;
-
- PropertyBase(String id, String name){
+
+ PropertyBase(String id, String name) {
fId = id;
fName = name;
}
- public String getId(){
+ public String getId() {
return fId;
}
-
- public String getName(){
+
+ public String getName() {
return fName;
}
-
+
@Override
- public String toString(){
+ public String toString() {
return getId();
}
-
+
@Override
- public boolean equals(Object o){
- if(!o.getClass().equals(getClass()))
+ public boolean equals(Object o) {
+ if (!o.getClass().equals(getClass()))
return false;
-
- return fId.equals(((PropertyBase)o).getId());
+
+ return fId.equals(((PropertyBase) o).getId());
}
-
+
@Override
- public int hashCode(){
+ public int hashCode() {
return fId.hashCode();
}
}
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 a0adbb6e319..90fdbce539d 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
@@ -56,7 +56,7 @@ public class AdditionalInput implements IAdditionalInput {
private static final String BUILD_VARIABLE_STATIC_LIB = "ARCHIVES"; //$NON-NLS-1$
private static final String BUILD_VARIABLE_SHARED_LIB = "LIBRARIES"; //$NON-NLS-1$
-
+
private String[] expandedNames;
// Superclass
@@ -211,18 +211,18 @@ public class AdditionalInput implements IAdditionalInput {
if (fKind != null) {
String str;
switch (getKind()) {
- case KIND_ADDITIONAL_INPUT:
- str = ADDITIONAL_INPUT;
- break;
- case KIND_ADDITIONAL_DEPENDENCY:
- str = ADDITIONAL_DEPENDENCY;
- break;
- case KIND_ADDITIONAL_INPUT_DEPENDENCY:
- str = ADDITIONAL_INPUT_DEPENDENCY;
- break;
- default:
- str = ""; //$NON-NLS-1$
- break;
+ case KIND_ADDITIONAL_INPUT:
+ str = ADDITIONAL_INPUT;
+ break;
+ case KIND_ADDITIONAL_DEPENDENCY:
+ str = ADDITIONAL_DEPENDENCY;
+ break;
+ case KIND_ADDITIONAL_INPUT_DEPENDENCY:
+ str = ADDITIONAL_INPUT_DEPENDENCY;
+ break;
+ default:
+ str = ""; //$NON-NLS-1$
+ break;
}
element.setAttribute(IAdditionalInput.KIND, str);
}
@@ -264,7 +264,8 @@ public class AdditionalInput implements IAdditionalInput {
*/
@Override
public void setPaths(String newPaths) {
- if (fPaths == null && newPaths == null) return;
+ if (fPaths == null && newPaths == null)
+ return;
if (fPaths == null || newPaths == null || !(fPaths.equals(newPaths))) {
fPaths = newPaths;
fIsDirty = true;
@@ -312,7 +313,8 @@ public class AdditionalInput implements IAdditionalInput {
@Override
public boolean isDirty() {
// This shouldn't be called for an extension AdditionalInput
- if (fIsExtensionAdditionalInput) return false;
+ if (fIsExtensionAdditionalInput)
+ return false;
return fIsDirty;
}
@@ -332,7 +334,7 @@ public class AdditionalInput implements IAdditionalInput {
fResolved = true;
}
}
-
+
public boolean needsRebuild() {
// This shouldn't be called for an extension AdditionalInput
if (fIsExtensionAdditionalInput)
@@ -340,8 +342,7 @@ public class AdditionalInput implements IAdditionalInput {
if (fRebuildState)
return fRebuildState;
if (fKind.intValue() == IAdditionalInput.KIND_ADDITIONAL_DEPENDENCY
- || fKind.intValue() == IAdditionalInput.KIND_ADDITIONAL_INPUT_DEPENDENCY
- || isLibrariesInput()) {
+ || fKind.intValue() == IAdditionalInput.KIND_ADDITIONAL_INPUT_DEPENDENCY || isLibrariesInput()) {
IToolChain toolChain = getToolChain();
/* toolChain can be null e.g. in tools for custom build steps */
if (toolChain != null && !toolChain.isExtensionElement()) {
@@ -359,7 +360,7 @@ public class AdditionalInput implements IAdditionalInput {
}
return false;
}
-
+
private long getArtifactTimeStamp(IToolChain toolChain) {
IBuilder builder = toolChain.getBuilder();
IConfiguration configuration = toolChain.getParent();
@@ -369,7 +370,7 @@ public class AdditionalInput implements IAdditionalInput {
// ensure that it's a directory URI
buildLocationURI = URI.create(buildLocationURI.toString() + "/"); //$NON-NLS-1$
}
-
+
String artifactName = configuration.getArtifactName();
String artifactExt = configuration.getArtifactExtension();
String artifactPref = configuration.getOutputPrefix(artifactExt);
@@ -383,9 +384,9 @@ public class AdditionalInput implements IAdditionalInput {
" ", IBuildMacroProvider.CONTEXT_CONFIGURATION, configuration); //$NON-NLS-1$
} catch (BuildMacroException e) {
}
-
+
URI buildArtifactURI = EFSExtensionManager.getDefault().append(buildLocationURI, artifactName);
-
+
try {
IFileStore artifact = EFS.getStore(buildArtifactURI);
org.eclipse.core.filesystem.IFileInfo info = (artifact == null) ? null : artifact.fetchInfo();
@@ -404,9 +405,10 @@ public class AdditionalInput implements IAdditionalInput {
// libraries are of the "additionalinput" kind, not "additionalinputdependency" because otherwise the
// external make builder would generate makefiles with $(LIBS) in the dependency list, resulting in
// failure to build dependency -lxyz etc.
- return (fKind.intValue() == IAdditionalInput.KIND_ADDITIONAL_INPUT && Arrays.asList(getPaths()).contains("$(LIBS)")); //$NON-NLS-1$
+ return (fKind.intValue() == IAdditionalInput.KIND_ADDITIONAL_INPUT
+ && Arrays.asList(getPaths()).contains("$(LIBS)")); //$NON-NLS-1$
}
-
+
private boolean dependencyChanged(String sPath, long artefactTimeStamp) {
try {
IToolChain toolChain = getToolChain();
@@ -482,10 +484,9 @@ public class AdditionalInput implements IAdditionalInput {
}
private URI findLibrary(IToolChain toolChain, final String libName, List<String> dirs) throws CoreException {
- final String libSO = getDynamicLibPrefix(toolChain) + libName + '.'
- + getDynamicLibExtension(toolChain);
+ final String libSO = getDynamicLibPrefix(toolChain) + libName + '.' + getDynamicLibExtension(toolChain);
final String libA = getStaticLibPrefix(toolChain) + libName + '.' + getStaticLibExtension(toolChain);
-
+
class LibFilter {
public boolean accept(String name) {
if (equals(libA, name))
@@ -504,28 +505,28 @@ public class AdditionalInput implements IAdditionalInput {
return false;
}
}
-
+
boolean equals(String a, String b) {
return a.equals(b);
}
-
+
boolean startsWith(String string, String prefix) {
return string.startsWith(prefix);
}
-
+
}
class CaseInsensitiveLibFilter extends LibFilter {
@Override
boolean equals(String a, String b) {
return a.equalsIgnoreCase(b);
}
-
+
@Override
boolean startsWith(String string, String prefix) {
return string.toLowerCase().startsWith(prefix.toLowerCase());
}
}
-
+
for (Iterator<String> i = dirs.iterator(); i.hasNext();) {
IFileStore dir = getEFSFile(i.next());
LibFilter filter = dir.getFileSystem().isCaseSensitive() ? new LibFilter() : new CaseInsensitiveLibFilter();
@@ -537,17 +538,17 @@ public class AdditionalInput implements IAdditionalInput {
}
return null;
}
-
+
/**
* Gets an EFS file-store for the specified path or URI, which may be a local filesystem path or may be a more abstract URI.
- *
+ *
* @param pathOrURI a local filesystem path or URI
- *
+ *
* @return the file store, if one could be determined
*/
private static IFileStore getEFSFile(String pathOrURI) {
IFileStore result;
-
+
try {
// try it as a URI
result = EFS.getStore(URI.create(pathOrURI));
@@ -555,7 +556,7 @@ public class AdditionalInput implements IAdditionalInput {
// most likely, the path is not a URI, so assume a local file and try again
result = EFS.getLocalFileSystem().getStore(new Path(pathOrURI));
}
-
+
return result;
}
@@ -588,7 +589,7 @@ public class AdditionalInput implements IAdditionalInput {
IOutputType type = findOutputType(toolChain, BUILD_VARIABLE_STATIC_LIB);
if (null == type || type.getOutputExtensionsAttribute().length == 0) {
return "a"; //$NON-NLS-1$
- }
+ }
return type.getOutputExtensionsAttribute()[0];
}
@@ -603,7 +604,7 @@ public class AdditionalInput implements IAdditionalInput {
IOutputType type = findOutputType(toolChain, BUILD_VARIABLE_SHARED_LIB);
if (null == type || type.getOutputExtensionsAttribute().length == 0) {
return "so"; //$NON-NLS-1$
- }
+ }
return type.getOutputExtensionsAttribute()[0];
}
@@ -640,8 +641,8 @@ public class AdditionalInput implements IAdditionalInput {
return new String[0];
}
- public void setRebuildState(boolean rebuild){
- if(isExtensionElement() && rebuild)
+ 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/BooleanExpressionApplicabilityCalculator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BooleanExpressionApplicabilityCalculator.java
index f93e5e33b79..bbd8387febf 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
@@ -42,123 +42,112 @@ public class BooleanExpressionApplicabilityCalculator implements IOptionApplicab
private Map<String, Set<String>> fRefPropsMap;
- public BooleanExpressionApplicabilityCalculator(IManagedConfigElement optionElement){
+ public BooleanExpressionApplicabilityCalculator(IManagedConfigElement optionElement) {
this(optionElement.getChildren(OptionEnablementExpression.NAME));
}
- public BooleanExpressionApplicabilityCalculator(IManagedConfigElement enablementElements[]){
+ public BooleanExpressionApplicabilityCalculator(IManagedConfigElement enablementElements[]) {
fExpressions = new OptionEnablementExpression[enablementElements.length];
- for(int i = 0; i < enablementElements.length; i++){
+ for (int i = 0; i < enablementElements.length; i++) {
fExpressions[i] = new OptionEnablementExpression(enablementElements[i]);
}
}
@Override
- public boolean isOptionVisible(IBuildObject configuration,
- IHoldsOptions holder,
- IOption option){
+ public boolean isOptionVisible(IBuildObject configuration, IHoldsOptions holder, IOption option) {
IResourceInfo rcInfo = rcInfoFromConfiguration(configuration);
- if(rcInfo != null)
+ 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;
- if(configuration instanceof IFileInfo)
- return (IFileInfo)configuration;
- if(configuration instanceof IConfiguration)
- return ((IConfiguration)configuration).getRootFolderInfo();
+ public static IResourceInfo rcInfoFromConfiguration(IBuildObject configuration) {
+ if (configuration instanceof IFolderInfo)
+ return (IFolderInfo) configuration;
+ if (configuration instanceof IFileInfo)
+ return (IFileInfo) configuration;
+ if (configuration instanceof IConfiguration)
+ return ((IConfiguration) configuration).getRootFolderInfo();
return null;
}
- public boolean isInputTypeEnabled(ITool tool, IInputType type){
+ public boolean isInputTypeEnabled(ITool tool, IInputType type) {
return evaluate(tool.getParentResourceInfo(), tool, null, OptionEnablementExpression.FLAG_CMD_USAGE);
}
- public boolean isOutputTypeEnabled(ITool tool, IOutputType type){
+ public boolean isOutputTypeEnabled(ITool tool, IOutputType type) {
return evaluate(tool.getParentResourceInfo(), tool, null, OptionEnablementExpression.FLAG_CMD_USAGE);
}
- public boolean isToolUsedInCommandLine(IResourceInfo rcInfo,
- ITool tool){
+ public boolean isToolUsedInCommandLine(IResourceInfo rcInfo, ITool tool) {
return evaluate(rcInfo, tool, null, OptionEnablementExpression.FLAG_CMD_USAGE);
}
@Override
- public boolean isOptionEnabled(IBuildObject configuration,
- IHoldsOptions holder,
- IOption option){
+ public boolean isOptionEnabled(IBuildObject configuration, IHoldsOptions holder, IOption option) {
IResourceInfo rcInfo = rcInfoFromConfiguration(configuration);
- if(rcInfo != null)
+ if (rcInfo != null)
return evaluate(rcInfo, holder, option, OptionEnablementExpression.FLAG_UI_ENABLEMENT);
return true;
}
@Override
- public boolean isOptionUsedInCommandLine(IBuildObject configuration,
- IHoldsOptions holder,
- IOption option){
+ public boolean isOptionUsedInCommandLine(IBuildObject configuration, IHoldsOptions holder, IOption option) {
IResourceInfo rcInfo = rcInfoFromConfiguration(configuration);
- if(rcInfo != null)
+ if (rcInfo != null)
return evaluate(rcInfo, holder, option, OptionEnablementExpression.FLAG_CMD_USAGE);
return true;
}
- public boolean evaluate(IResourceInfo rcInfo,
- IHoldsOptions holder, IOption option, int flags){
- for(int i = 0; i < fExpressions.length; i++){
- if(!fExpressions[i].evaluate(rcInfo, holder, option, flags))
+ public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder, IOption option, int flags) {
+ for (int i = 0; i < fExpressions.length; i++) {
+ if (!fExpressions[i].evaluate(rcInfo, holder, option, flags))
return false;
}
return true;
}
-/* public boolean performAdjustment(IBuildObject configuration,
- IHoldsOptions holder, IOption option, boolean extensionAdjustment){
- boolean adjusted = false;
- for(int i = 0; i < fExpressions.length; i++){
- if(fExpressions[i].performAdjustment(configuration, holder, option, extensionAdjustment))
- adjusted = true;
+ /* public boolean performAdjustment(IBuildObject configuration,
+ IHoldsOptions holder, IOption option, boolean extensionAdjustment){
+ boolean adjusted = false;
+ for(int i = 0; i < fExpressions.length; i++){
+ if(fExpressions[i].performAdjustment(configuration, holder, option, extensionAdjustment))
+ adjusted = true;
+ }
+ return adjusted;
}
- return adjusted;
- }
-*/
- public boolean adjustOption(IResourceInfo rcInfo,
- IHoldsOptions holder,
- IOption option,
- boolean extensionAdjustment){
+ */
+ public boolean adjustOption(IResourceInfo rcInfo, IHoldsOptions holder, IOption option,
+ boolean extensionAdjustment) {
boolean adjusted = false;
AdjustmentContext context = extensionAdjustment ? null : new AdjustmentContext();
- for(int i = 0; i < fExpressions.length; i++){
- if(fExpressions[i].adjustOption(rcInfo, holder, option, context, extensionAdjustment))
+ for (int i = 0; i < fExpressions.length; i++) {
+ if (fExpressions[i].adjustOption(rcInfo, holder, option, context, extensionAdjustment))
adjusted = true;
}
- if(context != null){
+ if (context != null) {
String unadjusted[] = context.getUnadjusted();
- for(int i = 0; i < unadjusted.length; i++){
- OptionEnablementExpression.adjustOption(rcInfo, holder, option, unadjusted[i], null, extensionAdjustment);
+ for (int i = 0; i < unadjusted.length; i++) {
+ OptionEnablementExpression.adjustOption(rcInfo, holder, option, unadjusted[i], null,
+ extensionAdjustment);
}
}
return adjusted;
}
- public boolean adjustToolChain(IFolderInfo info,
- IToolChain tChain,
- boolean extensionAdjustment){
+ public boolean adjustToolChain(IFolderInfo info, IToolChain tChain, boolean extensionAdjustment) {
boolean adjusted = false;
AdjustmentContext context = extensionAdjustment ? null : new AdjustmentContext();
- for(int i = 0; i < fExpressions.length; i++){
- if(fExpressions[i].adjustToolChain(info, tChain, context, extensionAdjustment))
+ for (int i = 0; i < fExpressions.length; i++) {
+ if (fExpressions[i].adjustToolChain(info, tChain, context, extensionAdjustment))
adjusted = true;
}
- if(context != null){
+ if (context != null) {
String unadjusted[] = context.getUnadjusted();
- for(int i = 0; i < unadjusted.length; i++){
+ for (int i = 0; i < unadjusted.length; i++) {
OptionEnablementExpression.adjustToolChain(info, tChain, unadjusted[i], null, extensionAdjustment);
}
}
@@ -166,19 +155,17 @@ public class BooleanExpressionApplicabilityCalculator implements IOptionApplicab
return adjusted;
}
- public boolean adjustTool(IResourceInfo info,
- ITool tool,
- boolean extensionAdjustment){
+ public boolean adjustTool(IResourceInfo info, ITool tool, boolean extensionAdjustment) {
boolean adjusted = false;
AdjustmentContext context = extensionAdjustment ? null : new AdjustmentContext();
- for(int i = 0; i < fExpressions.length; i++){
- if(fExpressions[i].adjustTool(info, tool, context, extensionAdjustment))
+ for (int i = 0; i < fExpressions.length; i++) {
+ if (fExpressions[i].adjustTool(info, tool, context, extensionAdjustment))
adjusted = true;
}
- if(context != null){
+ if (context != null) {
String unadjusted[] = context.getUnadjusted();
- for(int i = 0; i < unadjusted.length; i++){
+ for (int i = 0; i < unadjusted.length; i++) {
OptionEnablementExpression.adjustTool(info, tool, unadjusted[i], null, extensionAdjustment);
}
}
@@ -186,18 +173,17 @@ public class BooleanExpressionApplicabilityCalculator implements IOptionApplicab
return adjusted;
}
- public boolean adjustConfiguration(IConfiguration cfg,
- boolean extensionAdjustment){
+ public boolean adjustConfiguration(IConfiguration cfg, boolean extensionAdjustment) {
boolean adjusted = false;
AdjustmentContext context = extensionAdjustment ? null : new AdjustmentContext();
- for(int i = 0; i < fExpressions.length; i++){
- if(fExpressions[i].adjustConfiguration(cfg, context, extensionAdjustment))
+ for (int i = 0; i < fExpressions.length; i++) {
+ if (fExpressions[i].adjustConfiguration(cfg, context, extensionAdjustment))
adjusted = true;
}
- if(context != null){
+ if (context != null) {
String unadjusted[] = context.getUnadjusted();
- for(int i = 0; i < unadjusted.length; i++){
+ for (int i = 0; i < unadjusted.length; i++) {
OptionEnablementExpression.adjustConfiguration(cfg, unadjusted[i], null, extensionAdjustment);
}
}
@@ -205,37 +191,37 @@ public class BooleanExpressionApplicabilityCalculator implements IOptionApplicab
return adjusted;
}
- private Map<String, Set<String>> getReferencedProperties(){
- if(fRefPropsMap == null){
+ private Map<String, Set<String>> getReferencedProperties() {
+ if (fRefPropsMap == null) {
fRefPropsMap = new HashMap<String, Set<String>>();
- for(int i = 0; i < fExpressions.length; i++){
+ for (int i = 0; i < fExpressions.length; i++) {
fExpressions[i].getReferencedProperties(fRefPropsMap);
}
}
return fRefPropsMap;
}
- public boolean referesProperty(String id){
+ public boolean referesProperty(String id) {
Map<String, Set<String>> map = getReferencedProperties();
return map.containsKey(id);
}
- public boolean referesPropertyValue(String propertyId, String valueId){
+ public boolean referesPropertyValue(String propertyId, String valueId) {
Map<String, Set<String>> map = getReferencedProperties();
Set<String> set = map.get(propertyId);
- if(set != null)
+ if (set != null)
return set.contains(valueId);
return false;
}
- public String[] getReferencedPropertyIds(){
+ public String[] getReferencedPropertyIds() {
Map<String, Set<String>> map = getReferencedProperties();
return map.keySet().toArray(new String[map.size()]);
}
- public String[] getReferencedValueIds(String propertyId){
+ public String[] getReferencedValueIds(String propertyId) {
Map<String, Set<String>> map = getReferencedProperties();
Set<String> set = map.get(propertyId);
return set.toArray(new String[set.size()]);
@@ -248,11 +234,11 @@ public class BooleanExpressionApplicabilityCalculator implements IOptionApplicab
}
private boolean evaluateCategory(IResourceInfo rcInfo, IHoldsOptions holder, IOptionCategory category) {
- for(int i = 0; i < fExpressions.length; i++){
- if(!fExpressions[i].evaluate(rcInfo, holder, category))
+ for (int i = 0; i < fExpressions.length; i++) {
+ if (!fExpressions[i].evaluate(rcInfo, holder, category))
return false;
}
return true;
-}
+ }
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildDbgUtil.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildDbgUtil.java
index 5a2bc39c940..f8db26ce419 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildDbgUtil.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildDbgUtil.java
@@ -17,31 +17,31 @@ public class BuildDbgUtil extends DbgUtilBase {
public static final int BUILD_INFO_LOAD = 1;
public static boolean DEBUG = false;
private static BuildDbgUtil fInstance;
-
- private BuildDbgUtil(){
+
+ private BuildDbgUtil() {
fDbgOn = DEBUG;
}
-
- public static BuildDbgUtil getInstance(){
- if(fInstance == null)
+
+ public static BuildDbgUtil getInstance() {
+ if (fInstance == null)
fInstance = new BuildDbgUtil();
return fInstance;
}
-
- public int getFlags(){
+
+ public int getFlags() {
return fFlags;
}
-
- public void setFlags(int flags){
+
+ public void setFlags(int flags) {
fFlags = flags;
}
- public void enable(boolean enable){
+ public void enable(boolean enable) {
DEBUG = enable;
fDbgOn = enable;
}
-
- public boolean isEnabled(){
+
+ public boolean isEnabled() {
return DEBUG && fDbgOn;
}
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 b26e8551285..716a39534eb 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
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.internal.core;
-
import org.eclipse.cdt.managedbuilder.core.IBuildObject;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.osgi.framework.Version;
@@ -22,7 +21,7 @@ public class BuildObject implements IBuildObject {
protected String id;
protected String name;
- private String baseId=null;
+ private String baseId = null;
protected Version version = null;
protected String managedBuildRevision = null;
@@ -68,7 +67,7 @@ public class BuildObject implements IBuildObject {
*/
@Override
public Version getVersion() {
- return version;
+ return version;
}
/**
@@ -85,31 +84,30 @@ public class BuildObject implements IBuildObject {
*/
@Override
public String getBaseId() {
- if (baseId==null)
+ if (baseId == null)
baseId = ManagedBuildManager.calculateBaseId(id);
return baseId;
}
-
public Version getVersionFromId() {
- String versionNumber = ManagedBuildManager.getVersionFromIdAndVersion( getId());
+ String versionNumber = ManagedBuildManager.getVersionFromIdAndVersion(getId());
- if( versionNumber == null) {
+ 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$
- versionNumber = "0.0.1"; //$NON-NLS-1$
- else if (tmpManagedBuildRevision.equals(new Version("2.0.0")) ) //$NON-NLS-1$
- versionNumber = "0.0.2"; //$NON-NLS-1$
- else if (tmpManagedBuildRevision.equals(new Version("2.1.0")) ) //$NON-NLS-1$
- versionNumber = "0.0.3"; //$NON-NLS-1$
+ if (getManagedBuildRevision() != null) {
+ Version tmpManagedBuildRevision = new Version(getManagedBuildRevision());
+ if (tmpManagedBuildRevision.equals(new Version("1.2.0"))) //$NON-NLS-1$
+ versionNumber = "0.0.1"; //$NON-NLS-1$
+ else if (tmpManagedBuildRevision.equals(new Version("2.0.0"))) //$NON-NLS-1$
+ versionNumber = "0.0.2"; //$NON-NLS-1$
+ else if (tmpManagedBuildRevision.equals(new Version("2.1.0"))) //$NON-NLS-1$
+ versionNumber = "0.0.3"; //$NON-NLS-1$
else
- versionNumber = "0.0.4"; //$NON-NLS-1$
+ versionNumber = "0.0.4"; //$NON-NLS-1$
} else {
- versionNumber = "0.0.0"; //$NON-NLS-1$
+ versionNumber = "0.0.0"; //$NON-NLS-1$
}
}
return new Version(versionNumber);
@@ -122,7 +120,7 @@ public class BuildObject implements IBuildObject {
/**
* updates revision for this build object and all its children
*/
- public void updateManagedBuildRevision(String revision){
+ public void updateManagedBuildRevision(String revision) {
setManagedBuildRevision(revision);
setVersion(getVersionFromId());
}
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 3cc20439bc5..56838b4a6bc 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
@@ -25,8 +25,7 @@ import org.eclipse.cdt.managedbuilder.internal.buildproperties.BuildProperties;
import org.eclipse.cdt.managedbuilder.internal.buildproperties.BuildPropertyManager;
import org.eclipse.core.runtime.CoreException;
-public class BuildObjectProperties extends BuildProperties implements
- IBuildObjectProperties {
+public class BuildObjectProperties extends BuildProperties implements IBuildObjectProperties {
private IBuildPropertiesRestriction fRestriction;
private IBuildPropertyChangeListener fListener;
@@ -36,13 +35,15 @@ public class BuildObjectProperties extends BuildProperties implements
fListener = listener;
}
- public BuildObjectProperties(BuildObjectProperties properties, IBuildPropertiesRestriction restriction, IBuildPropertyChangeListener listener) {
+ public BuildObjectProperties(BuildObjectProperties properties, IBuildPropertiesRestriction restriction,
+ IBuildPropertyChangeListener listener) {
super(properties);
fRestriction = restriction;
fListener = listener;
}
- public BuildObjectProperties(String properties, IBuildPropertiesRestriction restriction, IBuildPropertyChangeListener listener) {
+ public BuildObjectProperties(String properties, IBuildPropertiesRestriction restriction,
+ IBuildPropertyChangeListener listener) {
super(properties);
fRestriction = restriction;
fListener = listener;
@@ -52,10 +53,10 @@ public class BuildObjectProperties extends BuildProperties implements
public IBuildPropertyType[] getSupportedTypes() {
IBuildPropertyType types[] = BuildPropertyManager.getInstance().getPropertyTypes();
- if(fRestriction != null && types.length != 0){
+ if (fRestriction != null && types.length != 0) {
List<IBuildPropertyType> list = new ArrayList<IBuildPropertyType>(types.length);
for (IBuildPropertyType type : types) {
- if(fRestriction.supportsType(type.getId()))
+ if (fRestriction.supportsType(type.getId()))
list.add(type);
}
@@ -68,12 +69,12 @@ public class BuildObjectProperties extends BuildProperties implements
@Override
public IBuildPropertyValue[] getSupportedValues(String typeId) {
IBuildPropertyType type = BuildPropertyManager.getInstance().getPropertyType(typeId);
- if(type != null){
+ if (type != null) {
IBuildPropertyValue values[] = type.getSupportedValues();
- if(fRestriction != null && values.length != 0){
+ if (fRestriction != null && values.length != 0) {
List<IBuildPropertyValue> list = new ArrayList<IBuildPropertyValue>(values.length);
for (IBuildPropertyValue value : values) {
- if(fRestriction.supportsValue(type.getId(), value.getId()))
+ if (fRestriction.supportsValue(type.getId(), value.getId()))
list.add(value);
}
@@ -86,30 +87,30 @@ public class BuildObjectProperties extends BuildProperties implements
@Override
public boolean supportsType(String id) {
return fRestriction.supportsType(id);
-// IBuildPropertyType type = BuildPropertyManager.getInstance().getPropertyType(id);
-// if(type != null){
-// if(fRestriction != null){
-// return fRestriction.supportsType(type.getId());
-// }
-// return true;
-// }
-// return false;
+ // IBuildPropertyType type = BuildPropertyManager.getInstance().getPropertyType(id);
+ // if(type != null){
+ // if(fRestriction != null){
+ // return fRestriction.supportsType(type.getId());
+ // }
+ // return true;
+ // }
+ // return false;
}
@Override
public boolean supportsValue(String typeId, String valueId) {
return fRestriction.supportsValue(typeId, valueId);
-// IBuildPropertyType type = BuildPropertyManager.getInstance().getPropertyType(typeId);
-// if(type != null){
-// IBuildPropertyValue value = type.getSupportedValue(valueId);
-// if(value != null){
-// if(fRestriction != null){
-// return fRestriction.supportsValue(type.getId(), value.getId());
-// }
-// return true;
-// }
-// }
-// return false;
+ // IBuildPropertyType type = BuildPropertyManager.getInstance().getPropertyType(typeId);
+ // if(type != null){
+ // IBuildPropertyValue value = type.getSupportedValue(valueId);
+ // if(value != null){
+ // if(fRestriction != null){
+ // return fRestriction.supportsValue(type.getId(), value.getId());
+ // }
+ // return true;
+ // }
+ // }
+ // return false;
}
@Override
@@ -121,26 +122,25 @@ public class BuildObjectProperties extends BuildProperties implements
@Override
public IBuildProperty removeProperty(String id) {
IBuildProperty property = super.removeProperty(id);
- if(property != null)
+ if (property != null)
fListener.propertiesChanged();
return property;
}
- IBuildProperty internalSetProperty(String propertyId, String propertyValue) throws CoreException{
+ IBuildProperty internalSetProperty(String propertyId, String propertyValue) throws CoreException {
return super.setProperty(propertyId, propertyValue);
}
@Override
- public IBuildProperty setProperty(String propertyId, String propertyValue)
- throws CoreException {
-// if(!supportsType(propertyId))
-// throw new CoreException(new Status(IStatus.ERROR,
-// ManagedBuilderCorePlugin.getUniqueIdentifier(),
-// "property type is not supported"));
-// if(!supportsValue(propertyId, propertyValue))
-// throw new CoreException(new Status(IStatus.ERROR,
-// ManagedBuilderCorePlugin.getUniqueIdentifier(),
-// "property value is not supported"));
+ public IBuildProperty setProperty(String propertyId, String propertyValue) throws CoreException {
+ // if(!supportsType(propertyId))
+ // throw new CoreException(new Status(IStatus.ERROR,
+ // ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ // "property type is not supported"));
+ // if(!supportsValue(propertyId, propertyValue))
+ // throw new CoreException(new Status(IStatus.ERROR,
+ // ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ // "property value is not supported"));
IBuildProperty property = super.setProperty(propertyId, propertyValue);
fListener.propertiesChanged();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildSettingsUtil.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildSettingsUtil.java
index 0067f755bc0..bd60d8b5f34 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildSettingsUtil.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuildSettingsUtil.java
@@ -35,134 +35,128 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
public class BuildSettingsUtil {
- private static final int[] COMMON_SETTINGS_IDS = new int[]{
- IOption.INCLUDE_PATH,
- IOption.PREPROCESSOR_SYMBOLS,
- IOption.LIBRARIES,
- IOption.OBJECTS,
- IOption.INCLUDE_FILES,
- IOption.LIBRARY_PATHS,
- IOption.LIBRARY_FILES,
- IOption.MACRO_FILES,
- };
-
- public static void disconnectDepentents(IConfiguration cfg, ITool[] tools){
- for(int i = 0; i < tools.length; i++){
+ private static final int[] COMMON_SETTINGS_IDS = new int[] { IOption.INCLUDE_PATH, IOption.PREPROCESSOR_SYMBOLS,
+ IOption.LIBRARIES, IOption.OBJECTS, IOption.INCLUDE_FILES, IOption.LIBRARY_PATHS, IOption.LIBRARY_FILES,
+ IOption.MACRO_FILES, };
+
+ public static void disconnectDepentents(IConfiguration cfg, ITool[] tools) {
+ for (int i = 0; i < tools.length; i++) {
disconnectDepentents(cfg, tools[i]);
}
}
- public static void disconnectDepentents(IConfiguration cfg, ITool tool){
+ public static void disconnectDepentents(IConfiguration cfg, ITool tool) {
ITool deps[] = getDependentTools(cfg, tool);
- for(int i = 0; i < deps.length; i++){
+ for (int i = 0; i < deps.length; i++) {
disconnect(deps[i], tool);
}
}
-
- private static void disconnect(ITool child, ITool superClass){
+
+ private static void disconnect(ITool child, ITool superClass) {
ITool directChild = child;
- for(;directChild != null; directChild = directChild.getSuperClass()){
- if(superClass.equals(directChild.getSuperClass()))
+ for (; directChild != null; directChild = directChild.getSuperClass()) {
+ if (superClass.equals(directChild.getSuperClass()))
break;
}
-
- if(directChild == null)
+
+ if (directChild == null)
return;
-
- ((Tool)directChild).copyNonoverriddenSettings((Tool)superClass);
- ((Tool)directChild).setSuperClass(superClass.getSuperClass());
+
+ ((Tool) directChild).copyNonoverriddenSettings((Tool) superClass);
+ ((Tool) directChild).setSuperClass(superClass.getSuperClass());
}
-
- public static ITool[] getDependentTools(IConfiguration cfg, ITool tool){
+
+ public static ITool[] getDependentTools(IConfiguration cfg, ITool tool) {
IResourceInfo rcInfos[] = cfg.getResourceInfos();
List<ITool> list = new ArrayList<ITool>();
- for(int i = 0; i < rcInfos.length; i++){
+ for (int i = 0; i < rcInfos.length; i++) {
calcDependentTools(rcInfos[i], tool, list);
}
return list.toArray(new Tool[list.size()]);
}
-
- private static List<ITool> calcDependentTools(IResourceInfo info, ITool tool, List<ITool> list){
+
+ private static List<ITool> calcDependentTools(IResourceInfo info, ITool tool, List<ITool> list) {
return calcDependentTools(info.getTools(), tool, list);
}
-
- public static List<ITool> calcDependentTools(ITool tools[], ITool tool, List<ITool> list){
- if(list == null)
+
+ public static List<ITool> calcDependentTools(ITool tools[], ITool tool, List<ITool> list) {
+ if (list == null)
list = new ArrayList<ITool>();
-
- for(int i = 0; i < tools.length; i++){
+
+ for (int i = 0; i < tools.length; i++) {
ITool superTool = tools[i];
- for(;superTool != null; superTool = superTool.getSuperClass()){
- if(superTool.equals(tool)){
+ for (; superTool != null; superTool = superTool.getSuperClass()) {
+ if (superTool.equals(tool)) {
list.add(tools[i]);
}
}
}
-
+
return list;
}
- public static void copyCommonSettings(ITool fromTool, ITool toTool){
- Tool fromT = (Tool)fromTool;
- Tool toT = (Tool)toTool;
+ public static void copyCommonSettings(ITool fromTool, ITool toTool) {
+ Tool fromT = (Tool) fromTool;
+ Tool toT = (Tool) toTool;
List<OptionStringValue> values = new ArrayList<OptionStringValue>();
- for(int i = 0; i < COMMON_SETTINGS_IDS.length; i++){
+ for (int i = 0; i < COMMON_SETTINGS_IDS.length; i++) {
int type = COMMON_SETTINGS_IDS[i];
IOption[] toOptions = toT.getOptionsOfType(type);
- if(toOptions.length == 0)
+ if (toOptions.length == 0)
continue;
IOption[] fromOptions = fromT.getOptionsOfType(type);
values.clear();
- for(int k = 0; k < fromOptions.length; k++){
- Option fromOption = (Option)fromOptions[k];
- if(fromOption.getParent() != fromTool)
+ for (int k = 0; k < fromOptions.length; k++) {
+ Option fromOption = (Option) fromOptions[k];
+ if (fromOption.getParent() != fromTool)
continue;
-
+
@SuppressWarnings("unchecked")
- List<OptionStringValue> v = (List<OptionStringValue>)fromOption.getExactValue();
+ List<OptionStringValue> v = (List<OptionStringValue>) fromOption.getExactValue();
values.addAll(v);
}
-
- if(values.size() == 0)
+
+ if (values.size() == 0)
continue;
IOption toOption = toOptions[0];
-
+
try {
OptionStringValue[] v = toOption.getBasicStringListValueElements();
- if(v.length != 0)
+ if (v.length != 0)
values.addAll(Arrays.asList(v));
} catch (BuildException e) {
ManagedBuilderCorePlugin.log(e);
}
-
+
OptionStringValue[] v = values.toArray(new OptionStringValue[values.size()]);
IResourceInfo rcInfo = toTool.getParentResourceInfo();
-
+
ManagedBuildManager.setOption(rcInfo, toTool, toOption, v);
values.clear();
}
}
- public static boolean applyConfiguration(IConfiguration cfg, ICProjectDescription des, boolean force) throws CoreException{
+ public static boolean applyConfiguration(IConfiguration cfg, ICProjectDescription des, boolean force)
+ throws CoreException {
boolean updated = false;
ICConfigurationDescription cfgDes = des.getConfigurationById(cfg.getId());
- if(cfgDes == null){
+ if (cfgDes == null) {
des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, cfg.getConfigurationData());
updated = true;
- } else if(force || cfg.isDirty()){
+ } else if (force || cfg.isDirty()) {
cfgDes.setConfigurationData(ManagedBuildManager.CFG_DATA_PROVIDER_ID, cfg.getConfigurationData());
updated = true;
}
-
+
return updated;
}
public static ICProjectDescription checkSynchBuildInfo(IProject project) throws CoreException {
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project, false);
- if(info == null)
+ if (info == null)
return null;
ICProjectDescription projDes = CoreModel.getDefault().getProjectDescription(project);
@@ -171,49 +165,51 @@ public class BuildSettingsUtil {
return projDes.isModified() ? projDes : null;
}
- public static ICProjectDescription synchBuildInfo(IManagedBuildInfo info, ICProjectDescription projDes, boolean force) throws CoreException {
+ public static ICProjectDescription synchBuildInfo(IManagedBuildInfo info, ICProjectDescription projDes,
+ boolean force) throws CoreException {
IManagedProject mProj = info.getManagedProject();
-
+
IConfiguration cfgs[] = mProj.getConfigurations();
ICConfigurationDescription cfgDess[] = projDes.getConfigurations();
-
- for(int i = 0; i < cfgs.length; i++){
+
+ for (int i = 0; i < cfgs.length; i++) {
IConfiguration cfg = cfgs[i];
-// try {
- applyConfiguration(cfg, projDes, force);
-// } catch (CoreException e) {
-// }
+ // try {
+ applyConfiguration(cfg, projDes, force);
+ // } catch (CoreException e) {
+ // }
}
-
- for(int i = 0; i < cfgDess.length; i++){
+
+ for (int i = 0; i < cfgDess.length; i++) {
ICConfigurationDescription cfgDes = cfgDess[i];
IConfiguration cfg = mProj.getConfiguration(cfgDes.getId());
- if(cfg == null){
+ if (cfg == null) {
projDes.removeConfiguration(cfgDes);
-// mProj.removeConfiguration(cfgDes.getId());
+ // mProj.removeConfiguration(cfgDes.getId());
}
}
return projDes;
}
- public static void checkApplyDescription(IProject project, ICProjectDescription des) throws CoreException{
+ public static void checkApplyDescription(IProject project, ICProjectDescription des) throws CoreException {
checkApplyDescription(project, des, false);
}
- public static void checkApplyDescription(IProject project, ICProjectDescription des, boolean avoidSerialization) throws CoreException{
+ public static void checkApplyDescription(IProject project, ICProjectDescription des, boolean avoidSerialization)
+ throws CoreException {
ICConfigurationDescription[] cfgs = des.getConfigurations();
- for(int i = 0; i < cfgs.length; i++){
- if(!ManagedBuildManager.CFG_DATA_PROVIDER_ID.equals(cfgs[i].getBuildSystemId()))
+ for (int i = 0; i < cfgs.length; i++) {
+ if (!ManagedBuildManager.CFG_DATA_PROVIDER_ID.equals(cfgs[i].getBuildSystemId()))
des.removeConfiguration(cfgs[i]);
}
-
+
int flags = 0;
- if(avoidSerialization)
- flags |= ICProjectDescriptionManager.SET_NO_SERIALIZE;
+ if (avoidSerialization)
+ flags |= ICProjectDescriptionManager.SET_NO_SERIALIZE;
CoreModel.getDefault().getProjectDescriptionManager().setProjectDescription(project, des, flags, null);
}
-
+
public static ITool[] getToolsBySuperClassId(ITool[] tools, String id) {
List<ITool> retTools = new ArrayList<ITool>();
if (id != null) {
@@ -224,11 +220,11 @@ public class BuildSettingsUtil {
if (id.equals(tool.getId())) {
retTools.add(targetTool);
break;
- }
+ }
tool = tool.getSuperClass();
} while (tool != null);
}
}
- return retTools.toArray( new ITool[retTools.size()]);
+ return retTools.toArray(new ITool[retTools.size()]);
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java
index aa2e0bdd802..dfd5c21252c 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java
@@ -82,7 +82,7 @@ import org.eclipse.core.variables.IStringVariableManager;
import org.eclipse.core.variables.VariablesPlugin;
import org.osgi.framework.Version;
-public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider<Builder>, IRealBuildObjectAssociation {
+public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider<Builder>, IRealBuildObjectAssociation {
public static final int UNLIMITED_JOBS = Integer.MAX_VALUE;
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
@@ -105,7 +105,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
private String[] reservedMacroNames;
private IReservedMacroNameSupplier reservedMacroNameSupplier;
private IConfigurationElement reservedMacroNameSupplierElement;
-
+
private String autoBuildTarget;
private Boolean autoBuildEnabled;
private String incrementalBuildTarget;
@@ -116,12 +116,12 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
private Boolean keepEnvVarInBuildfile;
private Boolean supportsManagedBuild;
//custom builder settings
- private String[] customizedErrorParserIds;
+ private String[] customizedErrorParserIds;
private HashMap<String, String> customizedEnvironment;
private Boolean appendEnvironment;// = Boolean.valueOf(true);
private String buildPath;
private HashMap<String, String> customBuildProperties;
-// private Boolean isWorkspaceBuildPath;
+ // private Boolean isWorkspaceBuildPath;
private String ignoreErrCmd;
private Boolean stopOnErr;
// parallelization
@@ -130,22 +130,22 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
private Integer parallelNumberAttribute; // negative number denotes "optimal" value, see getOptimalParallelJobNum()
private boolean isTest;
-
+
// Miscellaneous
private boolean isExtensionBuilder = false;
private boolean resolved = true;
private IConfigurationElement previousMbsVersionConversionElement = null;
private IConfigurationElement currentMbsVersionConversionElement = null;
-
+
private BuildBuildData fBuildData;
-
+
private Boolean fSupportsCustomizedBuild;
private List<Builder> identicalList;
-
+
private ICOutputEntry[] outputEntries;
-
+
private ICommandLauncher fCommandLauncher = null;
private IConfigurationElement fCommandLauncherElement = null;
@@ -155,39 +155,38 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
/*
* C O N S T R U C T O R S
*/
-
/**
- * This constructor is called to create a builder defined by an extension point in
+ * This constructor is called to create a builder defined by an extension point in
* a plugin manifest file, or returned by a dynamic element provider
- *
+ *
* @param parent The IToolChain parent of this builder, or <code>null</code> if
* defined at the top level
* @param element The builder definition from the manifest file or a dynamic element
* provider
- * @param managedBuildRevision The fileVersion of Managed Buid System
+ * @param managedBuildRevision The fileVersion of Managed Buid System
*/
public Builder(IToolChain parent, IManagedConfigElement element, String managedBuildRevision) {
super(true);
this.parent = parent;
isExtensionBuilder = true;
-
+
// setup for resolving
resolved = false;
// Set the managedBuildRevision
setManagedBuildRevision(managedBuildRevision);
-
+
loadFromManifest(element);
-
+
// Hook me up to the Managed Build Manager
ManagedBuildManager.addExtensionBuilder(this);
}
-
+
/**
- * This constructor is called to create a Builder whose attributes and children will be
+ * This constructor is called to create a Builder whose attributes and children will be
* added by separate calls.
- *
+ *
* @param parent The parent of the builder, if any
* @param superClass The superClass, if any
* @param Id The id for the new Builder
@@ -205,7 +204,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
setId(Id);
setName(name);
setVersion(getVersionFromId());
-
+
isExtensionBuilder = isExtensionElement;
if (isExtensionElement) {
// Hook me up to the Managed Build Manager
@@ -217,10 +216,10 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
}
/**
- * Create a <code>Builder</code> based on the specification stored in the
+ * Create a <code>Builder</code> based on the specification stored in the
* project file (.cdtbuild).
- *
- * @param parent The <code>IToolChain</code> the Builder will be added to.
+ *
+ * @param parent The <code>IToolChain</code> the Builder will be added to.
* @param element The XML element that contains the Builder settings.
* @param managedBuildRevision The fileVersion of Managed Buid System
*/
@@ -228,12 +227,12 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
super(true);
this.parent = parent;
isExtensionBuilder = false;
-
+
fBuildData = new BuildBuildData(this);
-
+
// Set the managedBuildRevision
setManagedBuildRevision(managedBuildRevision);
-
+
// Initialize from the XML attributes
loadFromProject(element);
}
@@ -242,17 +241,17 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
private HashMap<String, String> cloneMap(HashMap<String, String> map) {
return (HashMap<String, String>) map.clone();
}
-
+
/**
* Create a <code>Builder</code> based upon an existing builder.
- *
- * @param parent The <code>IToolChain</code> the builder will be added to.
+ *
+ * @param parent The <code>IToolChain</code> the builder will be added to.
* @param builder The existing builder to clone.
*/
public Builder(IToolChain parent, String Id, String name, Builder builder) {
super(true);
this.parent = parent;
-
+
superClass = builder.superClass;
if (superClass != null && builder.superClassId != null) {
superClassId = builder.superClassId;
@@ -260,18 +259,18 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
setId(Id);
setName(name);
-
+
// Set the managedBuildRevision & the version
setManagedBuildRevision(builder.getManagedBuildRevision());
setVersion(getVersionFromId());
isExtensionBuilder = false;
-
+
// Copy the remaining attributes
- if(builder.versionsSupported != null) {
+ if (builder.versionsSupported != null) {
versionsSupported = builder.versionsSupported;
}
- if(builder.convertToId != null) {
+ if (builder.convertToId != null) {
convertToId = builder.convertToId;
}
if (builder.unusedChildren != null) {
@@ -306,16 +305,16 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
buildPath = builder.buildPath;
if (builder.customBuildProperties != null)
customBuildProperties = cloneMap(builder.customBuildProperties);
-
- buildFileGeneratorElement = builder.buildFileGeneratorElement;
-
- if (builder.fileContextBuildMacroValues != null){
- fileContextBuildMacroValues = (FileContextBuildMacroValues)builder.fileContextBuildMacroValues.clone();
+
+ buildFileGeneratorElement = builder.buildFileGeneratorElement;
+
+ if (builder.fileContextBuildMacroValues != null) {
+ fileContextBuildMacroValues = (FileContextBuildMacroValues) builder.fileContextBuildMacroValues.clone();
fileContextBuildMacroValues.setBuilder(this);
}
-
+
builderVariablePattern = builder.builderVariablePattern;
-
+
if (builder.isVariableCaseSensitive != null)
isVariableCaseSensitive = builder.isVariableCaseSensitive;
@@ -326,7 +325,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
reservedMacroNameSupplier = builder.reservedMacroNameSupplier;
fBuildData = new BuildBuildData(this);
-
+
stopOnErr = builder.stopOnErr;
ignoreErrCmd = builder.ignoreErrCmd;
@@ -334,7 +333,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
parallelNumberAttribute = builder.parallelNumberAttribute;
parallelBuildCmd = builder.parallelBuildCmd;
- if(builder.outputEntries != null){
+ if (builder.outputEntries != null) {
outputEntries = builder.outputEntries.clone();
}
@@ -342,34 +341,33 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
fCommandLauncher = builder.fCommandLauncher;
fCommandLauncherElement = builder.fCommandLauncherElement;
-
+
fBuildRunner = builder.fBuildRunner;
fBuildRunnerElement = builder.fBuildRunnerElement;
}
-
- public void copySettings(Builder builder, boolean allBuildSettings){
+
+ public void copySettings(Builder builder, boolean allBuildSettings) {
try {
- if(isAutoBuildEnable() != builder.isAutoBuildEnable())
+ if (isAutoBuildEnable() != builder.isAutoBuildEnable())
setAutoBuildEnable(builder.isAutoBuildEnable());
} catch (CoreException e) {
}
try {
- if(isIncrementalBuildEnabled() != builder.isIncrementalBuildEnabled())
+ if (isIncrementalBuildEnabled() != builder.isIncrementalBuildEnabled())
setIncrementalBuildEnable(builder.isIncrementalBuildEnabled());
} catch (CoreException e) {
}
try {
- if(isFullBuildEnabled() != builder.isFullBuildEnabled())
+ if (isFullBuildEnabled() != builder.isFullBuildEnabled())
setFullBuildEnable(builder.isFullBuildEnabled());
} catch (CoreException e) {
}
try {
- if(isCleanBuildEnabled() != builder.isCleanBuildEnabled())
+ if (isCleanBuildEnabled() != builder.isCleanBuildEnabled())
setCleanBuildEnable(builder.isCleanBuildEnabled());
} catch (CoreException e) {
}
- if(isStopOnError() != builder.isStopOnError()
- && supportsStopOnError(builder.isStopOnError())){
+ if (isStopOnError() != builder.isStopOnError() && supportsStopOnError(builder.isStopOnError())) {
try {
setStopOnError(builder.isStopOnError());
} catch (CoreException e) {
@@ -387,172 +385,170 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
} catch (CoreException e) {
}
}
- if(builder.keepEnvironmentVariablesInBuildfile() &&
- canKeepEnvironmentVariablesInBuildfile()){
+ if (builder.keepEnvironmentVariablesInBuildfile() && canKeepEnvironmentVariablesInBuildfile()) {
setKeepEnvironmentVariablesInBuildfile(builder.keepEnvironmentVariablesInBuildfile());
}
- if(isManagedBuildOn() != builder.isManagedBuildOn()
- && supportsBuild(builder.isManagedBuildOn())){
+ if (isManagedBuildOn() != builder.isManagedBuildOn() && supportsBuild(builder.isManagedBuildOn())) {
try {
setManagedBuildOn(builder.isManagedBuildOn());
} catch (CoreException e) {
}
}
- if(builder.customizedErrorParserIds != null)
+ if (builder.customizedErrorParserIds != null)
customizedErrorParserIds = builder.customizedErrorParserIds.clone();
- if(builder.customizedEnvironment != null)
+ if (builder.customizedEnvironment != null)
customizedEnvironment = cloneMap(builder.customizedEnvironment);
appendEnvironment = builder.appendEnvironment;
- if(isBuildPathEditable()){
- if(!getBuildPath().equals(builder.getBuildPath()))
+ if (isBuildPathEditable()) {
+ if (!getBuildPath().equals(builder.getBuildPath()))
setBuildPath(builder.getBuildPath());
}
- if(builder.customBuildProperties != null)
+ if (builder.customBuildProperties != null)
customBuildProperties = cloneMap(builder.customBuildProperties);
- if(allBuildSettings){
- if(!getCommand().equals(builder.getCommand()))
+ if (allBuildSettings) {
+ if (!getCommand().equals(builder.getCommand()))
setCommand(builder.getCommand());
- if(!getArgumentsAttribute().equals(builder.getArgumentsAttribute()))
+ if (!getArgumentsAttribute().equals(builder.getArgumentsAttribute()))
setArgumentsAttribute(builder.getArgumentsAttribute());
- if(!CDataUtil.objectsEqual(getAutoBuildTargetAttribute(), builder.getAutoBuildTargetAttribute())){
+ if (!CDataUtil.objectsEqual(getAutoBuildTargetAttribute(), builder.getAutoBuildTargetAttribute())) {
autoBuildTarget = builder.getAutoBuildTargetAttribute();
}
- if(!CDataUtil.objectsEqual(getIncrementalBuildTargetAttribute(), builder.getIncrementalBuildTargetAttribute())){
+ if (!CDataUtil.objectsEqual(getIncrementalBuildTargetAttribute(),
+ builder.getIncrementalBuildTargetAttribute())) {
incrementalBuildTarget = builder.getIncrementalBuildTargetAttribute();
}
- if(!CDataUtil.objectsEqual(getCleanBuildTargetAttribute(), builder.getCleanBuildTargetAttribute())){
+ if (!CDataUtil.objectsEqual(getCleanBuildTargetAttribute(), builder.getCleanBuildTargetAttribute())) {
cleanBuildTarget = builder.getCleanBuildTargetAttribute();
}
}
setDirty(true);
}
-
-/* public Builder(IToolChain parent, String Id, String name, Builder builder, ICStorageElement el) {
- this(parent, Id, name, builder);
-
- loadFromProject(el);
- }
-*/
+
+ /* public Builder(IToolChain parent, String Id, String name, Builder builder, ICStorageElement el) {
+ this(parent, Id, name, builder);
+
+ loadFromProject(el);
+ }
+ */
/*
* 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
*/
-
+
/**
- * Loads the builder information from the ManagedConfigElement specified in the
+ * Loads the builder information from the ManagedConfigElement specified in the
* argument.
- *
- * @param element Contains the Builder information
+ *
+ * @param element Contains the Builder information
*/
protected void loadFromManifest(IManagedConfigElement element) {
ManagedBuildManager.putConfigElement(this, element);
-
+
// id
String idAttribute = SafeStringInterner.safeIntern(element.getAttribute(IBuildObject.ID));
setId(idAttribute);
-
+
// Get the name
final String nameAttribute = SafeStringInterner.safeIntern(element.getAttribute(IBuildObject.NAME));
setName(nameAttribute);
-
+
// Set the version after extracting from 'id' attribute
setVersion(getVersionFromId());
-
+
// 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));
+
// Get the 'versionsSupported' attribute
versionsSupported = SafeStringInterner.safeIntern(element.getAttribute(VERSIONS_SUPPORTED));
-
+
// Get the 'convertToId' attribute
convertToId = SafeStringInterner.safeIntern(element.getAttribute(CONVERT_TO_ID));
// get the 'variableFormat' attribute
builderVariablePattern = SafeStringInterner.safeIntern(element.getAttribute(VARIABLE_FORMAT));
-
+
// get the 'isVariableCaseSensitive' attribute
String isCS = element.getAttribute(IS_VARIABLE_CASE_SENSITIVE);
- if(isCS != null)
+ if (isCS != null)
isVariableCaseSensitive = Boolean.parseBoolean(isCS);
// get the reserved macro names
String reservedNames = element.getAttribute(RESERVED_MACRO_NAMES);
- if(reservedNames != null)
+ if (reservedNames != null)
reservedMacroNames = reservedNames.split(","); //$NON-NLS-1$
-
+
reservedMacroNames = SafeStringInterner.safeIntern(reservedMacroNames);
// Get the reservedMacroNameSupplier configuration element
- String reservedMacroNameSupplier = element.getAttribute(RESERVED_MACRO_NAME_SUPPLIER);
- if(reservedMacroNameSupplier != null && element instanceof DefaultManagedConfigElement){
- reservedMacroNameSupplierElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
+ String reservedMacroNameSupplier = element.getAttribute(RESERVED_MACRO_NAME_SUPPLIER);
+ if (reservedMacroNameSupplier != null && element instanceof DefaultManagedConfigElement) {
+ reservedMacroNameSupplierElement = ((DefaultManagedConfigElement) element).getConfigurationElement();
}
-
// isAbstract
- String isAbs = element.getAttribute(IProjectType.IS_ABSTRACT);
- if (isAbs != null){
- isAbstract = Boolean.parseBoolean(isAbs);
- }
-
- // command
- command = SafeStringInterner.safeIntern(element.getAttribute(IBuilder.COMMAND));
-
- // arguments
+ String isAbs = element.getAttribute(IProjectType.IS_ABSTRACT);
+ if (isAbs != null) {
+ isAbstract = Boolean.parseBoolean(isAbs);
+ }
+
+ // command
+ command = SafeStringInterner.safeIntern(element.getAttribute(IBuilder.COMMAND));
+
+ // arguments
args = SafeStringInterner.safeIntern(element.getAttribute(IBuilder.ARGUMENTS));
-
+
autoBuildTarget = SafeStringInterner.safeIntern(element.getAttribute(ATTRIBUTE_TARGET_AUTO));
-
+
String tmp = element.getAttribute(ATTRIBUTE_AUTO_ENABLED);
- if(tmp != null)
+ if (tmp != null)
autoBuildEnabled = Boolean.valueOf(tmp);
-
+
incrementalBuildTarget = SafeStringInterner.safeIntern(element.getAttribute(ATTRIBUTE_TARGET_INCREMENTAL));
-
+
tmp = element.getAttribute(ATTRIBUTE_AUTO_ENABLED);
- if(tmp != null)
+ if (tmp != null)
incrementalBuildEnabled = Boolean.valueOf(tmp);
-
+
cleanBuildTarget = SafeStringInterner.safeIntern(element.getAttribute(ATTRIBUTE_TARGET_CLEAN));
-
+
tmp = element.getAttribute(ATTRIBUTE_CLEAN_ENABLED);
- if(tmp != null)
+ if (tmp != null)
cleanBuildEnabled = Boolean.valueOf(tmp);
tmp = element.getAttribute(ATTRIBUTE_MANAGED_BUILD_ON);
- if(tmp != null)
+ if (tmp != null)
managedBuildOn = Boolean.valueOf(tmp);
tmp = element.getAttribute(ATTRIBUTE_KEEP_ENV);
- if(tmp != null)
+ if (tmp != null)
keepEnvVarInBuildfile = Boolean.valueOf(tmp);
tmp = element.getAttribute(ATTRIBUTE_SUPORTS_MANAGED_BUILD);
- if(tmp != null)
+ if (tmp != null)
supportsManagedBuild = Boolean.valueOf(tmp);
tmp = element.getAttribute(ATTRIBUTE_CUSTOMIZED_ERROR_PARSERS);
-
- if(tmp != null)
+
+ if (tmp != null)
customizedErrorParserIds = CDataUtil.stringToArray(tmp, ";"); //$NON-NLS-1$
-
+
customizedErrorParserIds = SafeStringInterner.safeIntern(customizedErrorParserIds);
-
+
tmp = element.getAttribute(ATTRIBUTE_ENVIRONMENT);
- if(tmp != null)
+ if (tmp != null)
customizedEnvironment = MapStorageElement.decodeMap(tmp);
tmp = element.getAttribute(ATTRIBUTE_APPEND_ENVIRONMENT);
- if(tmp != null)
+ if (tmp != null)
appendEnvironment = Boolean.valueOf(tmp);
buildPath = element.getAttribute(ATTRIBUTE_BUILD_PATH);
tmp = element.getAttribute(ATTRIBUTE_CUSTOM_PROPS);
- if(tmp != null)
+ if (tmp != null)
customBuildProperties = MapStorageElement.decodeMap(tmp);
ignoreErrCmd = SafeStringInterner.safeIntern(element.getAttribute(ATTRIBUTE_IGNORE_ERR_CMD));
-
+
tmp = element.getAttribute(ATTRIBUTE_STOP_ON_ERR);
if (tmp != null)
stopOnErr = Boolean.valueOf(tmp);
@@ -566,66 +562,68 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
isParallelBuildEnabled = Boolean.valueOf(tmp);
if (isParallelBuildEnabled) {
tmp = element.getAttribute(ATTRIBUTE_PARALLELIZATION_NUMBER);
- setParallelizationNumAttribute(decodeParallelizationNumber(element.getAttribute(ATTRIBUTE_PARALLELIZATION_NUMBER)));
+ setParallelizationNumAttribute(
+ decodeParallelizationNumber(element.getAttribute(ATTRIBUTE_PARALLELIZATION_NUMBER)));
}
}
// Get the semicolon separated list of IDs of the error parsers
errorParserIds = SafeStringInterner.safeIntern(element.getAttribute(IToolChain.ERROR_PARSERS));
-
- // Store the configuration element IFF there is a build file generator defined
- String buildfileGenerator = element.getAttribute(BUILDFILEGEN_ID);
+
+ // Store the configuration element IFF there is a build file generator defined
+ String buildfileGenerator = element.getAttribute(BUILDFILEGEN_ID);
if (buildfileGenerator != null && element instanceof DefaultManagedConfigElement) {
- buildFileGeneratorElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
+ buildFileGeneratorElement = ((DefaultManagedConfigElement) element).getConfigurationElement();
}
-
+
//load the File Context Build Macro Values
- fileContextBuildMacroValues = new FileContextBuildMacroValues(this,element);
-
- tmp = element.getAttribute(IS_SYSTEM);
- if(tmp != null)
- isTest = Boolean.parseBoolean(tmp);
-
- IManagedConfigElement[] children = element.getChildren();
- for(int i = 0; i < children.length; i++){
- IManagedConfigElement child = children[i];
- if (loadChild(child)) {
- // nothing
- } else {
- String name = child.getName();
- if(OUTPUT_ENTRIES.equals(name)){
- ICSettingEntry entries[] = LanguageSettingEntriesSerializer.loadEntries(new ManagedConfigStorageElement(child));
- if(entries.length == 0){
- outputEntries = new ICOutputEntry[0];
- } else {
- List<ICSettingEntry> list = new ArrayList<ICSettingEntry>(entries.length);
- for(int k = 0; k < entries.length; k++){
- if(entries[k].getKind() == ICLanguageSettingEntry.OUTPUT_PATH)
- list.add(entries[k]);
- }
- outputEntries = list.toArray(new ICOutputEntry[list.size()]);
- }
- }
- }
- }
-
- String commandLauncher = element.getAttribute(ATTRIBUTE_COMMAND_LAUNCHER);
- if(commandLauncher != null && element instanceof DefaultManagedConfigElement){
- fCommandLauncherElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
- }
-
+ fileContextBuildMacroValues = new FileContextBuildMacroValues(this, element);
+
+ tmp = element.getAttribute(IS_SYSTEM);
+ if (tmp != null)
+ isTest = Boolean.parseBoolean(tmp);
+
+ IManagedConfigElement[] children = element.getChildren();
+ for (int i = 0; i < children.length; i++) {
+ IManagedConfigElement child = children[i];
+ if (loadChild(child)) {
+ // nothing
+ } else {
+ String name = child.getName();
+ if (OUTPUT_ENTRIES.equals(name)) {
+ ICSettingEntry entries[] = LanguageSettingEntriesSerializer
+ .loadEntries(new ManagedConfigStorageElement(child));
+ if (entries.length == 0) {
+ outputEntries = new ICOutputEntry[0];
+ } else {
+ List<ICSettingEntry> list = new ArrayList<ICSettingEntry>(entries.length);
+ for (int k = 0; k < entries.length; k++) {
+ if (entries[k].getKind() == ICLanguageSettingEntry.OUTPUT_PATH)
+ list.add(entries[k]);
+ }
+ outputEntries = list.toArray(new ICOutputEntry[list.size()]);
+ }
+ }
+ }
+ }
+
+ String commandLauncher = element.getAttribute(ATTRIBUTE_COMMAND_LAUNCHER);
+ if (commandLauncher != null && element instanceof DefaultManagedConfigElement) {
+ fCommandLauncherElement = ((DefaultManagedConfigElement) element).getConfigurationElement();
+ }
+
String buildRunner = element.getAttribute(ATTRIBUTE_BUILD_RUNNER);
if (buildRunner != null && element instanceof DefaultManagedConfigElement)
- fBuildRunnerElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
+ fBuildRunnerElement = ((DefaultManagedConfigElement) element).getConfigurationElement();
}
-
+
private String encodeParallelizationNumber(Integer jobsNumber) {
if (jobsNumber <= 0)
return VALUE_OPTIMAL;
-
+
if (jobsNumber.equals(UNLIMITED_JOBS))
return VALUE_UNLIMITED;
-
+
return jobsNumber.toString();
}
@@ -658,28 +656,28 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
}
/**
- * Initialize the builder information from the XML element
+ * Initialize the builder information from the XML element
* specified in the argument
- *
- * @param element An XML element containing the builder information
+ *
+ * @param element An XML element containing the builder information
*/
protected void loadFromProject(ICStorageElement element) {
-
+
// id
// note: IDs are unique so no benefit to intern them
- if(element.getAttribute(IBuildObject.ID) != null)
+ if (element.getAttribute(IBuildObject.ID) != null)
setId(element.getAttribute(IBuildObject.ID));
// name
if (element.getAttribute(IBuildObject.NAME) != null) {
setName(SafeStringInterner.safeIntern(element.getAttribute(IBuildObject.NAME)));
}
-
+
// Set the version after extracting from 'id' attribute
setVersion(getVersionFromId());
// superClass
- if(element.getAttribute(IProjectType.SUPERCLASS) != null){
+ if (element.getAttribute(IProjectType.SUPERCLASS) != null) {
superClassId = SafeStringInterner.safeIntern(element.getAttribute(IProjectType.SUPERCLASS));
if (superClassId != null && superClassId.length() > 0) {
superClass = ManagedBuildManager.getExtensionBuilder(superClassId);
@@ -692,101 +690,101 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
if (element.getAttribute(VERSIONS_SUPPORTED) != null) {
versionsSupported = SafeStringInterner.safeIntern(element.getAttribute(VERSIONS_SUPPORTED));
}
-
+
// Get the 'convertToId' id
if (element.getAttribute(CONVERT_TO_ID) != null) {
convertToId = SafeStringInterner.safeIntern(element.getAttribute(CONVERT_TO_ID));
}
-
+
// 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);
- if (isAbs != null){
+ if (isAbs != null) {
isAbstract = Boolean.parseBoolean(isAbs);
}
}
- // command
+ // command
if (element.getAttribute(IBuilder.COMMAND) != null) {
- command = SafeStringInterner.safeIntern(element.getAttribute(IBuilder.COMMAND));
+ command = SafeStringInterner.safeIntern(element.getAttribute(IBuilder.COMMAND));
}
-
- // arguments
+
+ // arguments
if (element.getAttribute(IBuilder.ARGUMENTS) != null) {
args = SafeStringInterner.safeIntern(element.getAttribute(IBuilder.ARGUMENTS));
}
-
- if(element.getAttribute(ATTRIBUTE_TARGET_AUTO) != null)
+
+ if (element.getAttribute(ATTRIBUTE_TARGET_AUTO) != null)
autoBuildTarget = SafeStringInterner.safeIntern(element.getAttribute(ATTRIBUTE_TARGET_AUTO));
-
+
String tmp = element.getAttribute(ATTRIBUTE_AUTO_ENABLED);
- if(tmp != null)
+ if (tmp != null)
autoBuildEnabled = Boolean.valueOf(tmp);
-
- if(element.getAttribute(ATTRIBUTE_TARGET_INCREMENTAL) != null)
+
+ if (element.getAttribute(ATTRIBUTE_TARGET_INCREMENTAL) != null)
incrementalBuildTarget = SafeStringInterner.safeIntern(element.getAttribute(ATTRIBUTE_TARGET_INCREMENTAL));
-
+
tmp = element.getAttribute(ATTRIBUTE_INCREMENTAL_ENABLED);
- if(tmp != null)
+ if (tmp != null)
incrementalBuildEnabled = Boolean.valueOf(tmp);
-
- if(element.getAttribute(ATTRIBUTE_TARGET_CLEAN) != null)
+
+ if (element.getAttribute(ATTRIBUTE_TARGET_CLEAN) != null)
cleanBuildTarget = SafeStringInterner.safeIntern(element.getAttribute(ATTRIBUTE_TARGET_CLEAN));
-
+
tmp = element.getAttribute(ATTRIBUTE_CLEAN_ENABLED);
- if(tmp != null)
+ if (tmp != null)
cleanBuildEnabled = Boolean.valueOf(tmp);
-
+
tmp = element.getAttribute(ATTRIBUTE_MANAGED_BUILD_ON);
- if(tmp != null)
+ if (tmp != null)
managedBuildOn = Boolean.valueOf(tmp);
-
+
tmp = element.getAttribute(ATTRIBUTE_KEEP_ENV);
- if(tmp != null)
+ if (tmp != null)
keepEnvVarInBuildfile = Boolean.valueOf(tmp);
-
+
tmp = element.getAttribute(ATTRIBUTE_SUPORTS_MANAGED_BUILD);
- if(tmp != null)
+ if (tmp != null)
supportsManagedBuild = Boolean.valueOf(tmp);
-
+
tmp = element.getAttribute(ATTRIBUTE_CUSTOMIZED_ERROR_PARSERS);
- if(tmp != null)
+ if (tmp != null)
customizedErrorParserIds = CDataUtil.stringToArray(tmp, ";"); //$NON-NLS-1$
-
+
tmp = element.getAttribute(ATTRIBUTE_ENVIRONMENT);
- if(tmp != null)
+ if (tmp != null)
customizedEnvironment = MapStorageElement.decodeMap(tmp);
-
+
tmp = element.getAttribute(ATTRIBUTE_APPEND_ENVIRONMENT);
- if(tmp != null)
+ if (tmp != null)
appendEnvironment = Boolean.valueOf(tmp);
-
- if(element.getAttribute(ATTRIBUTE_BUILD_PATH) != null)
+
+ if (element.getAttribute(ATTRIBUTE_BUILD_PATH) != null)
buildPath = SafeStringInterner.safeIntern(element.getAttribute(ATTRIBUTE_BUILD_PATH));
-
+
tmp = element.getAttribute(ATTRIBUTE_CUSTOM_PROPS);
- if(tmp != null)
+ if (tmp != null)
customBuildProperties = MapStorageElement.decodeMap(tmp);
// Get the semicolon separated list of IDs of the error parsers
if (element.getAttribute(IToolChain.ERROR_PARSERS) != null) {
errorParserIds = SafeStringInterner.safeIntern(element.getAttribute(IToolChain.ERROR_PARSERS));
}
-
+
// Note: build file generator cannot be specified in a project file because
// an IConfigurationElement is needed to load it!
if (element.getAttribute(IBuilder.BUILDFILEGEN_ID) != null) {
// TODO: Issue warning?
}
-
- if(element.getAttribute(ATTRIBUTE_IGNORE_ERR_CMD) != null)
+
+ if (element.getAttribute(ATTRIBUTE_IGNORE_ERR_CMD) != null)
ignoreErrCmd = SafeStringInterner.safeIntern(element.getAttribute(ATTRIBUTE_IGNORE_ERR_CMD));
-
+
tmp = element.getAttribute(ATTRIBUTE_STOP_ON_ERR);
if (tmp != null)
stopOnErr = Boolean.valueOf(tmp);
@@ -800,32 +798,33 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
isParallelBuildEnabled = Boolean.valueOf(tmp);
if (isParallelBuildEnabled) {
tmp = element.getAttribute(ATTRIBUTE_PARALLELIZATION_NUMBER);
- setParallelizationNumAttribute(decodeParallelizationNumber(element.getAttribute(ATTRIBUTE_PARALLELIZATION_NUMBER)));
+ setParallelizationNumAttribute(
+ decodeParallelizationNumber(element.getAttribute(ATTRIBUTE_PARALLELIZATION_NUMBER)));
}
}
- ICStorageElement[] children = element.getChildren();
- for(int i = 0; i < children.length; i++){
- ICStorageElement child = children[i];
- if (loadChild(child)) {
- // nothing
- } else {
- String name = child.getName();
- if(OUTPUT_ENTRIES.equals(name)){
- ICSettingEntry entries[] = LanguageSettingEntriesSerializer.loadEntries(child);
- if(entries.length == 0){
- outputEntries = new ICOutputEntry[0];
- } else {
- List<ICSettingEntry> list = new ArrayList<ICSettingEntry>(entries.length);
- for(int k = 0; k < entries.length; k++){
- if(entries[k].getKind() == ICLanguageSettingEntry.OUTPUT_PATH)
- list.add(entries[k]);
- }
- outputEntries = list.toArray(new ICOutputEntry[list.size()]);
- }
- }
- }
- }
+ ICStorageElement[] children = element.getChildren();
+ for (int i = 0; i < children.length; i++) {
+ ICStorageElement child = children[i];
+ if (loadChild(child)) {
+ // nothing
+ } else {
+ String name = child.getName();
+ if (OUTPUT_ENTRIES.equals(name)) {
+ ICSettingEntry entries[] = LanguageSettingEntriesSerializer.loadEntries(child);
+ if (entries.length == 0) {
+ outputEntries = new ICOutputEntry[0];
+ } else {
+ List<ICSettingEntry> list = new ArrayList<ICSettingEntry>(entries.length);
+ for (int k = 0; k < entries.length; k++) {
+ if (entries[k].getKind() == ICLanguageSettingEntry.OUTPUT_PATH)
+ list.add(entries[k]);
+ }
+ outputEntries = list.toArray(new ICOutputEntry[list.size()]);
+ }
+ }
+ }
+ }
}
@@ -840,9 +839,9 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
public void serialize(ICStorageElement element, boolean resetDirtyState) {
if (superClass != null)
element.setAttribute(IProjectType.SUPERCLASS, superClass.getId());
-
+
element.setAttribute(IBuildObject.ID, id);
-
+
if (name != null) {
element.setAttribute(IBuildObject.NAME, name);
}
@@ -850,7 +849,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
if (unusedChildren != null) {
element.setAttribute(IProjectType.UNUSED_CHILDREN, unusedChildren);
}
-
+
if (isAbstract != null) {
element.setAttribute(IProjectType.IS_ABSTRACT, isAbstract.toString());
}
@@ -859,7 +858,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
if (versionsSupported != null) {
element.setAttribute(VERSIONS_SUPPORTED, versionsSupported);
}
-
+
// convertToId
if (convertToId != null) {
element.setAttribute(CONVERT_TO_ID, convertToId);
@@ -868,42 +867,43 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
if (errorParserIds != null) {
element.setAttribute(IToolChain.ERROR_PARSERS, errorParserIds);
}
-
+
if (command != null) {
element.setAttribute(IBuilder.COMMAND, command);
}
-
+
if (args != null) {
element.setAttribute(IBuilder.ARGUMENTS, args);
}
-
- if(autoBuildTarget != null)
+
+ if (autoBuildTarget != null)
element.setAttribute(ATTRIBUTE_TARGET_AUTO, autoBuildTarget);
- if(autoBuildEnabled != null)
+ if (autoBuildEnabled != null)
element.setAttribute(ATTRIBUTE_AUTO_ENABLED, autoBuildEnabled.toString());
- if(incrementalBuildTarget != null)
+ if (incrementalBuildTarget != null)
element.setAttribute(ATTRIBUTE_TARGET_INCREMENTAL, incrementalBuildTarget);
- if(incrementalBuildEnabled != null)
+ if (incrementalBuildEnabled != null)
element.setAttribute(ATTRIBUTE_INCREMENTAL_ENABLED, incrementalBuildEnabled.toString());
- if(cleanBuildTarget != null)
+ if (cleanBuildTarget != null)
element.setAttribute(ATTRIBUTE_TARGET_CLEAN, cleanBuildTarget);
- if(cleanBuildEnabled != null)
+ if (cleanBuildEnabled != null)
element.setAttribute(ATTRIBUTE_CLEAN_ENABLED, cleanBuildEnabled.toString());
- if(managedBuildOn != null)
+ if (managedBuildOn != null)
element.setAttribute(ATTRIBUTE_MANAGED_BUILD_ON, managedBuildOn.toString());
- if(keepEnvVarInBuildfile != null)
+ if (keepEnvVarInBuildfile != null)
element.setAttribute(ATTRIBUTE_KEEP_ENV, keepEnvVarInBuildfile.toString());
- if(supportsManagedBuild != null)
+ if (supportsManagedBuild != null)
element.setAttribute(ATTRIBUTE_SUPORTS_MANAGED_BUILD, supportsManagedBuild.toString());
- if(customizedErrorParserIds != null)
- element.setAttribute(ATTRIBUTE_CUSTOMIZED_ERROR_PARSERS, CDataUtil.arrayToString(customizedErrorParserIds, ";")); //$NON-NLS-1$
- if(customizedEnvironment != null)
+ if (customizedErrorParserIds != null)
+ element.setAttribute(ATTRIBUTE_CUSTOMIZED_ERROR_PARSERS,
+ CDataUtil.arrayToString(customizedErrorParserIds, ";")); //$NON-NLS-1$
+ if (customizedEnvironment != null)
element.setAttribute(ATTRIBUTE_ENVIRONMENT, MapStorageElement.encodeMap(customizedEnvironment));
- if(appendEnvironment != null)
+ if (appendEnvironment != null)
element.setAttribute(ATTRIBUTE_APPEND_ENVIRONMENT, appendEnvironment.toString());
- if(buildPath != null)
+ if (buildPath != null)
element.setAttribute(ATTRIBUTE_BUILD_PATH, buildPath);
- if(customBuildProperties != null)
+ if (customBuildProperties != null)
element.setAttribute(ATTRIBUTE_CUSTOM_PROPS, MapStorageElement.encodeMap(customBuildProperties));
if (ignoreErrCmd != null)
@@ -917,38 +917,39 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
if (isParallelBuildEnabled != null)
element.setAttribute(ATTRIBUTE_PARALLEL_BUILD_ON, isParallelBuildEnabled.toString());
if (isParallelBuildOn() && parallelNumberAttribute != null)
- element.setAttribute(ATTRIBUTE_PARALLELIZATION_NUMBER, encodeParallelizationNumber(parallelNumberAttribute));
+ element.setAttribute(ATTRIBUTE_PARALLELIZATION_NUMBER,
+ encodeParallelizationNumber(parallelNumberAttribute));
// Note: build file generator cannot be specified in a project file because
// an IConfigurationElement is needed to load it!
if (buildFileGeneratorElement != null) {
// TODO: issue warning?
}
-
+
// options
try {
super.serialize(element);
} catch (BuildException e) {
ManagedBuilderCorePlugin.log(e);
}
-
- if(outputEntries != null){
+
+ if (outputEntries != null) {
ICStorageElement outEl = element.createChild(OUTPUT_ENTRIES);
LanguageSettingEntriesSerializer.serializeEntries(outputEntries, outEl);
}
-
- if(resetDirtyState){
+
+ if (resetDirtyState) {
// I am clean now
setDirty(false);
}
}
-
+
public void serializeRawData(ICStorageElement element) {
if (superClass != null)
element.setAttribute(IProjectType.SUPERCLASS, superClass.getId());
-
+
element.setAttribute(IBuildObject.ID, id);
-
+
if (getName() != null) {
element.setAttribute(IBuildObject.NAME, getName());
}
@@ -956,7 +957,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
if (unusedChildren != null) {
element.setAttribute(IProjectType.UNUSED_CHILDREN, unusedChildren);
}
-
+
if (isAbstract != null) {
element.setAttribute(IProjectType.IS_ABSTRACT, isAbstract.toString());
}
@@ -965,7 +966,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
if (versionsSupported != null) {
element.setAttribute(VERSIONS_SUPPORTED, versionsSupported);
}
-
+
// convertToId
if (convertToId != null) {
element.setAttribute(CONVERT_TO_ID, convertToId);
@@ -974,35 +975,36 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
if (getErrorParserIds() != null) {
element.setAttribute(IToolChain.ERROR_PARSERS, getErrorParserIds());
}
-
+
if (getCommand() != null) {
element.setAttribute(IBuilder.COMMAND, getCommand());
}
-
+
if (getArgumentsAttribute() != null) {
element.setAttribute(IBuilder.ARGUMENTS, getArguments/*Attribute*/());
}
-
- if(getAutoBuildTargetAttribute() != null)
+
+ if (getAutoBuildTargetAttribute() != null)
element.setAttribute(ATTRIBUTE_TARGET_AUTO, getAutoBuildTargetAttribute());
element.setAttribute(ATTRIBUTE_AUTO_ENABLED, String.valueOf(isAutoBuildEnable()));
- if(getIncrementalBuildTargetAttribute() != null)
+ if (getIncrementalBuildTargetAttribute() != null)
element.setAttribute(ATTRIBUTE_TARGET_INCREMENTAL, getIncrementalBuildTargetAttribute());
element.setAttribute(ATTRIBUTE_INCREMENTAL_ENABLED, String.valueOf(isIncrementalBuildEnabled()));
- if(getCleanBuildTargetAttribute() != null)
+ if (getCleanBuildTargetAttribute() != null)
element.setAttribute(ATTRIBUTE_TARGET_CLEAN, getCleanBuildTargetAttribute());
element.setAttribute(ATTRIBUTE_CLEAN_ENABLED, String.valueOf(isCleanBuildEnabled()));
element.setAttribute(ATTRIBUTE_MANAGED_BUILD_ON, String.valueOf(isManagedBuildOn()));
element.setAttribute(ATTRIBUTE_KEEP_ENV, String.valueOf(keepEnvironmentVariablesInBuildfile()));
element.setAttribute(ATTRIBUTE_SUPORTS_MANAGED_BUILD, String.valueOf(supportsBuild(true)));
- if(customizedErrorParserIds != null)
- element.setAttribute(ATTRIBUTE_CUSTOMIZED_ERROR_PARSERS, CDataUtil.arrayToString(customizedErrorParserIds, ";")); //$NON-NLS-1$
- if(customizedEnvironment != null)
+ if (customizedErrorParserIds != null)
+ element.setAttribute(ATTRIBUTE_CUSTOMIZED_ERROR_PARSERS,
+ CDataUtil.arrayToString(customizedErrorParserIds, ";")); //$NON-NLS-1$
+ if (customizedEnvironment != null)
element.setAttribute(ATTRIBUTE_ENVIRONMENT, MapStorageElement.encodeMap(customizedEnvironment));
element.setAttribute(ATTRIBUTE_APPEND_ENVIRONMENT, String.valueOf(appendEnvironment()));
- if(getBuildPathAttribute() != null)
+ if (getBuildPathAttribute() != null)
element.setAttribute(ATTRIBUTE_BUILD_PATH, getBuildPathAttribute());
- if(customBuildProperties != null)
+ if (customBuildProperties != null)
element.setAttribute(ATTRIBUTE_CUSTOM_PROPS, MapStorageElement.encodeMap(customBuildProperties));
if (getIgnoreErrCmdAttribute() != null)
@@ -1015,14 +1017,15 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
if (isParallelBuildEnabled != null)
element.setAttribute(ATTRIBUTE_PARALLEL_BUILD_ON, isParallelBuildEnabled.toString());
if (isParallelBuildOn() && parallelNumberAttribute != null)
- element.setAttribute(ATTRIBUTE_PARALLELIZATION_NUMBER, encodeParallelizationNumber(parallelNumberAttribute));
+ element.setAttribute(ATTRIBUTE_PARALLELIZATION_NUMBER,
+ encodeParallelizationNumber(parallelNumberAttribute));
// Note: build file generator cannot be specified in a project file because
// an IConfigurationElement is needed to load it!
if (buildFileGeneratorElement != null) {
// TODO: issue warning?
}
-
+
// options
try {
super.serialize(element);
@@ -1030,7 +1033,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
ManagedBuilderCorePlugin.log(e);
}
- if(outputEntries != null){
+ if (outputEntries != null) {
ICStorageElement outEl = element.createChild(OUTPUT_ENTRIES);
LanguageSettingEntriesSerializer.serializeEntries(outputEntries, outEl);
}
@@ -1051,7 +1054,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public IBuilder getSuperClass() {
- return (IBuilder)superClass;
+ return (IBuilder) superClass;
}
@Override
@@ -1064,7 +1067,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
if (isAbstract != null) {
return isAbstract.booleanValue();
} else {
- return false; // Note: no inheritance from superClass
+ return false; // Note: no inheritance from superClass
}
}
@@ -1073,7 +1076,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
if (unusedChildren != null) {
return unusedChildren;
} else
- return EMPTY_STRING; // Note: no inheritance from superClass
+ return EMPTY_STRING; // Note: no inheritance from superClass
}
@Override
@@ -1091,81 +1094,81 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public String getArguments() {
- String args = getArgumentsAttribute();
+ String args = getArgumentsAttribute();
String stopOnErrCmd = getStopOnErrCmd(isStopOnError());
int parallelNum = getParallelizationNum();
String parallelCmd = isParallelBuildOn() ? getParallelizationCmd(parallelNum) : EMPTY_STRING;
-
+
String reversedStopOnErrCmd = getStopOnErrCmd(!isStopOnError());
String reversedParallelBuildCmd = !isParallelBuildOn() ? getParallelizationCmd(parallelNum) : EMPTY_STRING;
-
+
args = removeCmd(args, reversedStopOnErrCmd);
args = removeCmd(args, reversedParallelBuildCmd);
-
+
args = addCmd(args, stopOnErrCmd);
args = addCmd(args, parallelCmd);
return args != null ? args.trim() : null;
}
-
- private String addCmd(String args, String cmd){
+
+ private String addCmd(String args, String cmd) {
// Don't modify the args parameter if the cmd to add is emtpy.
// Bug 360846
- if(cmd.length() == 0)
+ if (cmd.length() == 0)
return args;
-
- if(getCmdIndex(args, cmd) == -1){
- if(args.length() != 0){
+
+ if (getCmdIndex(args, cmd) == -1) {
+ if (args.length() != 0) {
args += ' ';
}
args += cmd;
}
return args;
}
-
- private String removeCmd(String args, String cmd){
+
+ private String removeCmd(String args, String cmd) {
int index = getCmdIndex(args, cmd);
- if(index != -1){
+ if (index != -1) {
String prefix = args.substring(0, index).trim();
String suffix = args.substring(index + cmd.length(), args.length()).trim();
- if(prefix.length() == 0){
+ if (prefix.length() == 0) {
args = suffix;
- } else if (suffix.length() == 0){
+ } else if (suffix.length() == 0) {
args = prefix;
} else {
args = prefix + ' ' + suffix;
}
-
+
args = args.trim();
}
return args;
}
-
- private int getCmdIndex(String args, String cmd){
- if(cmd.length() == 0)
+
+ private int getCmdIndex(String args, String cmd) {
+ if (cmd.length() == 0)
return -1;
String tmp = args;
int index = -1;
- for(index = tmp.indexOf(cmd); index != -1; index = tmp.indexOf(cmd, index + 1)){
- if(index != 0){
- char c = tmp.charAt(index-1);
- if(c != '\t' && c != ' ')
+ for (index = tmp.indexOf(cmd); index != -1; index = tmp.indexOf(cmd, index + 1)) {
+ if (index != 0) {
+ char c = tmp.charAt(index - 1);
+ if (c != '\t' && c != ' ')
continue;
}
int end = index + cmd.length();
- if(end < tmp.length()){
+ if (end < tmp.length()) {
char c = tmp.charAt(end);
- if(c != '\t' && c != ' ')
+ if (c != '\t' && c != ' ')
continue;
- }
+ }
//found
break;
}
return index;
}
-
+
public String getParallelizationCmd(int num) {
String pattern = getParrallelBuildCmd();
if (pattern.length() == 0 || num == 0) {
@@ -1175,37 +1178,37 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
// that behavior corresponds that of "make" flag "-j".
return processParallelPattern(pattern, num == UNLIMITED_JOBS, num);
}
-
+
/**
* This method turns the supplied pattern to parallelization command
- *
+ *
* It supports 2 kinds of pattern where "*" is replaced with number of jobs:
* <li>Pattern 1 (supports "<b>-j*</b>"): "text*text" -> "text#text"</li>
* <li>Pattern 2 (supports "<b>-[j*]</b>"): "text[text*text]text" -> "texttext#texttext</li>
* <br>Where # is num or empty if {@code empty} is {@code true})
*/
- private String processParallelPattern(String pattern, boolean empty, int num){
+ private String processParallelPattern(String pattern, boolean empty, int num) {
Assert.isTrue(num > 0);
-
+
int start = pattern.indexOf(PARALLEL_PATTERN_NUM_START);
int end = -1;
boolean hasStartChar = false;
String result;
- if(start != -1){
+ if (start != -1) {
end = pattern.indexOf(PARALLEL_PATTERN_NUM_END);
- if(end != -1){
+ if (end != -1) {
hasStartChar = true;
} else {
start = -1;
}
}
- if(start == -1){
+ if (start == -1) {
start = pattern.indexOf(PARALLEL_PATTERN_NUM);
- if(start != -1){
+ if (start != -1) {
end = start + PARALLEL_PATTERN_NUM.length();
}
}
- if(start == -1){
+ if (start == -1) {
result = pattern;
} else {
String prefix;
@@ -1214,16 +1217,16 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
prefix = pattern.substring(0, start);
suffix = pattern.substring(end);
numStr = pattern.substring(start, end);
- if(empty){
+ if (empty) {
result = prefix + suffix;
} else {
String resolvedNum;
- if(hasStartChar){
+ if (hasStartChar) {
String numPrefix, numSuffix;
numStr = numStr.substring(0, PARALLEL_PATTERN_NUM_START.length());
numStr = numStr.substring(numStr.length() - PARALLEL_PATTERN_NUM_END.length());
int numStart = pattern.indexOf(PARALLEL_PATTERN_NUM);
- if(numStart != -1){
+ if (numStart != -1) {
int numEnd = numStart + PARALLEL_PATTERN_NUM.length();
numPrefix = numStr.substring(0, numStart);
numSuffix = numStr.substring(numEnd);
@@ -1239,12 +1242,12 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
}
return result;
}
-
+
public String getArgumentsAttribute() {
if (args == null) {
// If I have a superClass, ask it
if (superClass != null) {
- return ((Builder)superClass).getArgumentsAttribute();
+ return ((Builder) superClass).getArgumentsAttribute();
}
return EMPTY_STRING;
}
@@ -1277,7 +1280,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
while (tok.hasMoreElements()) {
list.add(tok.nextToken());
}
- String[] strArr = {""}; //$NON-NLS-1$
+ String[] strArr = { "" }; //$NON-NLS-1$
errorParsers = list.toArray(strArr);
}
} else {
@@ -1288,8 +1291,10 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public void setCommand(String cmd) {
- if(getCommand().equals(cmd)) return;
- if (cmd == null && command == null) return;
+ if (getCommand().equals(cmd))
+ return;
+ if (cmd == null && command == null)
+ return;
if (command == null || cmd == null || !cmd.equals(command)) {
command = cmd;
setDirty(true);
@@ -1298,10 +1303,10 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public void setArguments(String newArgs) {
- if(getArguments().equals(newArgs))
+ if (getArguments().equals(newArgs))
return;
-
- if(newArgs != null){
+
+ if (newArgs != null) {
String stopOnErrCmd = getStopOnErrCmd(isStopOnError());
String parallelCmd = isParallelBuildOn() ? getParallelizationCmd(getParallelizationNum()) : EMPTY_STRING;
@@ -1312,7 +1317,8 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
}
public void setArgumentsAttribute(String newArgs) {
- if (newArgs == null && args == null) return;
+ if (newArgs == null && args == null)
+ return;
if (args == null || newArgs == null || !newArgs.equals(args)) {
args = newArgs;
setDirty(true);
@@ -1322,7 +1328,8 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public void setErrorParserIds(String ids) {
String currentIds = getErrorParserIds();
- if (ids == null && currentIds == null) return;
+ if (ids == null && currentIds == null)
+ return;
if (currentIds == null || ids == null || !(currentIds.equals(ids))) {
errorParserIds = ids;
setDirty(true);
@@ -1334,40 +1341,41 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
isAbstract = b;
setDirty(true);
}
-
+
@Override
public IConfigurationElement getBuildFileGeneratorElement() {
if (buildFileGeneratorElement == null) {
if (superClass != null) {
- return ((Builder)superClass).getBuildFileGeneratorElement();
+ return ((Builder) superClass).getBuildFileGeneratorElement();
}
}
return buildFileGeneratorElement;
}
-
+
@Override
- public IManagedBuilderMakefileGenerator getBuildFileGenerator(){
+ public IManagedBuilderMakefileGenerator getBuildFileGenerator() {
IConfigurationElement element = getBuildFileGeneratorElement();
if (element != null) {
try {
- if (element.getName().equalsIgnoreCase("target")) { //$NON-NLS-1$
+ if (element.getName().equalsIgnoreCase("target")) { //$NON-NLS-1$
if (element.getAttribute(ManagedBuilderCorePlugin.MAKEGEN_ID) != null) {
- return (IManagedBuilderMakefileGenerator) element.createExecutableExtension(ManagedBuilderCorePlugin.MAKEGEN_ID);
+ return (IManagedBuilderMakefileGenerator) element
+ .createExecutableExtension(ManagedBuilderCorePlugin.MAKEGEN_ID);
}
} else {
if (element.getAttribute(IBuilder.BUILDFILEGEN_ID) != null) {
- return (IManagedBuilderMakefileGenerator) element.createExecutableExtension(IBuilder.BUILDFILEGEN_ID);
+ return (IManagedBuilderMakefileGenerator) element
+ .createExecutableExtension(IBuilder.BUILDFILEGEN_ID);
}
}
} catch (CoreException e) {
} catch (ClassCastException e) {
}
-
+
}
return new GnuMakefileGenerator();
}
-
@Override
public void setBuildFileGeneratorElement(IConfigurationElement element) {
buildFileGeneratorElement = element;
@@ -1377,7 +1385,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
/*
* O B J E C T S T A T E M A I N T E N A N C E
*/
-
+
@Override
public boolean isExtensionElement() {
return isExtensionBuilder;
@@ -1386,7 +1394,8 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public boolean isDirty() {
// This shouldn't be called for an extension Builder
- if (isExtensionBuilder) return false;
+ if (isExtensionBuilder)
+ return false;
return super.isDirty();
}
@@ -1394,7 +1403,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
public void setDirty(boolean isDirty) {
super.setDirty(isDirty);
}
-
+
@Override
public void resolveReferences() {
if (!resolved) {
@@ -1404,10 +1413,8 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
superClass = ManagedBuildManager.getExtensionBuilder(superClassId);
if (superClass == null) {
// Report error
- ManagedBuildManager.outputResolveError(
- "superClass", //$NON-NLS-1$
- superClassId,
- "builder", //$NON-NLS-1$
+ ManagedBuildManager.outputResolveError("superClass", //$NON-NLS-1$
+ superClassId, "builder", //$NON-NLS-1$
getId());
}
}
@@ -1429,7 +1436,8 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public void setConvertToId(String convertToId) {
- if (convertToId == null && this.convertToId == null) return;
+ if (convertToId == null && this.convertToId == null)
+ return;
if (convertToId == null || this.convertToId == null || !convertToId.equals(this.convertToId)) {
this.convertToId = convertToId;
setDirty(true);
@@ -1452,58 +1460,61 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public void setVersionsSupported(String versionsSupported) {
- if (versionsSupported == null && this.versionsSupported == null) return;
- if (versionsSupported == null || this.versionsSupported == null || !versionsSupported.equals(this.versionsSupported)) {
+ if (versionsSupported == null && this.versionsSupported == null)
+ return;
+ if (versionsSupported == null || this.versionsSupported == null
+ || !versionsSupported.equals(this.versionsSupported)) {
this.versionsSupported = versionsSupported;
setDirty(true);
}
return;
}
-
+
@Override
- public IFileContextBuildMacroValues getFileContextBuildMacroValues(){
- if(fileContextBuildMacroValues == null && superClass != null)
+ public IFileContextBuildMacroValues getFileContextBuildMacroValues() {
+ if (fileContextBuildMacroValues == null && superClass != null)
return getSuperClass().getFileContextBuildMacroValues();
return fileContextBuildMacroValues;
}
-
+
@Override
- public String getBuilderVariablePattern(){
- if(builderVariablePattern == null && superClass != null)
+ public String getBuilderVariablePattern() {
+ if (builderVariablePattern == null && superClass != null)
return getSuperClass().getBuilderVariablePattern();
return builderVariablePattern;
}
-
+
@Override
- public boolean isVariableCaseSensitive(){
- if(isVariableCaseSensitive == null){
- if(superClass != null)
+ public boolean isVariableCaseSensitive() {
+ if (isVariableCaseSensitive == null) {
+ if (superClass != null)
return getSuperClass().isVariableCaseSensitive();
return true;
}
return isVariableCaseSensitive.booleanValue();
}
-
+
@Override
- public String[] getReservedMacroNames(){
- if(reservedMacroNames == null && superClass != null)
+ public String[] getReservedMacroNames() {
+ if (reservedMacroNames == null && superClass != null)
return getSuperClass().getReservedMacroNames();
return reservedMacroNames;
}
-
+
@Override
- public IReservedMacroNameSupplier getReservedMacroNameSupplier(){
- if(reservedMacroNameSupplier == null && reservedMacroNameSupplierElement != null){
- try{
- reservedMacroNameSupplier = (IReservedMacroNameSupplier)reservedMacroNameSupplierElement.createExecutableExtension(RESERVED_MACRO_NAME_SUPPLIER);
- }catch(CoreException e){
+ public IReservedMacroNameSupplier getReservedMacroNameSupplier() {
+ if (reservedMacroNameSupplier == null && reservedMacroNameSupplierElement != null) {
+ try {
+ reservedMacroNameSupplier = (IReservedMacroNameSupplier) reservedMacroNameSupplierElement
+ .createExecutableExtension(RESERVED_MACRO_NAME_SUPPLIER);
+ } catch (CoreException e) {
}
}
- if(reservedMacroNameSupplier == null && superClass != null)
+ if (reservedMacroNameSupplier == null && superClass != null)
return getSuperClass().getReservedMacroNameSupplier();
return reservedMacroNameSupplier;
}
-
+
/*
* This function checks for migration support for the builder, while
* loading. If migration support is needed, looks for the available
@@ -1512,16 +1523,15 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
public void checkForMigrationSupport() {
-// String tmpId = null;
+ // String tmpId = null;
boolean isExists = false;
if (getSuperClass() == null) {
// If 'superClass' is null, then there is no builder available in
// plugin manifest file with the same 'id' & version.
// Look for the 'versionsSupported' attribute
- String high = ManagedBuildManager
- .getExtensionBuilderMap().lastKey();
-
+ String high = ManagedBuildManager.getExtensionBuilderMap().lastKey();
+
SortedMap<String, ? extends IBuilder> subMap = null;
if (superClassId.compareTo(high) <= 0) {
subMap = ManagedBuildManager.getExtensionBuilderMap().subMap(superClassId, high + "\0"); //$NON-NLS-1$
@@ -1542,46 +1552,36 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
// check the 'versionsSupported' attribute whether the given
// builder version is supported
- String baseId = ManagedBuildManager
- .getIdFromIdAndVersion(superClassId);
- String version = ManagedBuildManager
- .getVersionFromIdAndVersion(superClassId);
+ String baseId = ManagedBuildManager.getIdFromIdAndVersion(superClassId);
+ String version = ManagedBuildManager.getVersionFromIdAndVersion(superClassId);
Collection<? extends IBuilder> c = subMap.values();
IBuilder[] builderElements = c.toArray(new IBuilder[c.size()]);
-
+
for (int i = 0; i < builderElements.length; i++) {
IBuilder builderElement = builderElements[i];
- if (ManagedBuildManager.getIdFromIdAndVersion(
- builderElement.getId()).compareTo(baseId) > 0)
+ if (ManagedBuildManager.getIdFromIdAndVersion(builderElement.getId()).compareTo(baseId) > 0)
break;
// First check if both base ids are equal
- if (ManagedBuildManager.getIdFromIdAndVersion(
- builderElement.getId()).equals(baseId)) {
+ if (ManagedBuildManager.getIdFromIdAndVersion(builderElement.getId()).equals(baseId)) {
// Check if 'versionsSupported' attribute is available'
- String versionsSupported = builderElement
- .getVersionsSupported();
+ String versionsSupported = builderElement.getVersionsSupported();
- if ((versionsSupported != null)
- && (!versionsSupported.isEmpty())) {
+ if ((versionsSupported != null) && (!versionsSupported.isEmpty())) {
String[] tmpVersions = versionsSupported.split(","); //$NON-NLS-1$
for (int j = 0; j < tmpVersions.length; j++) {
- if (new Version(version).equals(new Version(
- tmpVersions[j]))) {
+ if (new Version(version).equals(new Version(tmpVersions[j]))) {
// version is supported.
// Do the automatic conversion without
// prompting the user.
// Get the supported version
String supportedVersion = ManagedBuildManager
- .getVersionFromIdAndVersion(builderElement
- .getId());
- setId(ManagedBuildManager
- .getIdFromIdAndVersion(getId())
- + "_" + supportedVersion); //$NON-NLS-1$
-
+ .getVersionFromIdAndVersion(builderElement.getId());
+ setId(ManagedBuildManager.getIdFromIdAndVersion(getId()) + "_" + supportedVersion); //$NON-NLS-1$
+
// If control comes here means that 'superClass' is null
// So, set the superClass to this builder element
superClass = builderElement;
@@ -1590,9 +1590,9 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
break;
}
}
- if(isExists)
- break; // break the outer for loop if 'isExists' is true
- }
+ if (isExists)
+ break; // break the outer for loop if 'isExists' is true
+ }
}
}
}
@@ -1616,13 +1616,13 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
} else {
// make the project is invalid
- //
+ //
IToolChain parent = getParent();
IConfiguration parentConfig = parent.getParent();
IManagedProject managedProject = parentConfig.getManagedProject();
if (managedProject != null) {
managedProject.setValid(false);
- }
+ }
}
return;
}
@@ -1633,16 +1633,15 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
String toId = null;
// Get the Converter Extension Point
- IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
- .getExtensionPoint("org.eclipse.cdt.managedbuilder.core", //$NON-NLS-1$
- "projectConverter"); //$NON-NLS-1$
+ IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(
+ "org.eclipse.cdt.managedbuilder.core", //$NON-NLS-1$
+ "projectConverter"); //$NON-NLS-1$
if (extensionPoint != null) {
// Get the extensions
IExtension[] extensions = extensionPoint.getExtensions();
for (int i = 0; i < extensions.length; i++) {
// Get the configuration elements of each extension
- IConfigurationElement[] configElements = extensions[i]
- .getConfigurationElements();
+ IConfigurationElement[] configElements = extensions[i].getConfigurationElements();
for (int j = 0; j < configElements.length; j++) {
IConfigurationElement element = configElements[j];
@@ -1654,16 +1653,13 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
// Check whether the current converter can be used for
// the selected builder
- if (fromId.equals(getSuperClass().getId())
- && toId.equals(convertToId)) {
+ if (fromId.equals(getSuperClass().getId()) && toId.equals(convertToId)) {
// If it matches
- String mbsVersion = element
- .getAttribute("mbsVersion"); //$NON-NLS-1$
- Version currentMbsVersion = ManagedBuildManager
- .getBuildInfoVersion();
+ String mbsVersion = element.getAttribute("mbsVersion"); //$NON-NLS-1$
+ Version currentMbsVersion = ManagedBuildManager.getBuildInfoVersion();
// set the converter element based on the MbsVersion
- if (currentMbsVersion.compareTo(new Version(mbsVersion))>0) {
+ if (currentMbsVersion.compareTo(new Version(mbsVersion)) > 0) {
previousMbsVersionConversionElement = element;
} else {
currentMbsVersionConversionElement = element;
@@ -1687,7 +1683,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
managedProject.setValid(false);
}
}
-
+
public IConfigurationElement getPreviousMbsVersionConversionElement() {
return previousMbsVersionConversionElement;
}
@@ -1701,44 +1697,44 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
return fBuildData;
}
-// public String[] getCustomizedErrorParserIds(){
-// if(customizedErrorParserIds != null)
-// return (String[])customizedErrorParserIds.clone();
-// return null;
-// }
-
+ // public String[] getCustomizedErrorParserIds(){
+ // if(customizedErrorParserIds != null)
+ // return (String[])customizedErrorParserIds.clone();
+ // return null;
+ // }
+
@Override
public String[] getErrorParsers() {
- if(isCustomBuilder() && customizedErrorParserIds != null)
+ if (isCustomBuilder() && customizedErrorParserIds != null)
return customizedErrorParserIds.clone();
-
+
IToolChain parent = getParent();
IConfiguration parentConfig = parent.getParent();
return parentConfig.getErrorParserList();
}
-
- public String[] getCustomizedErrorParserIds(){
- if(customizedErrorParserIds != null)
+
+ public String[] getCustomizedErrorParserIds() {
+ if (customizedErrorParserIds != null)
return customizedErrorParserIds.clone();
return null;
}
-
- public void setCustomizedErrorParserIds(String[] ids){
- customizedErrorParserIds = ids != null ? (String[])ids.clone() : ids;
+
+ public void setCustomizedErrorParserIds(String[] ids) {
+ customizedErrorParserIds = ids != null ? (String[]) ids.clone() : ids;
}
@Override
public void setErrorParsers(String[] parsers) throws CoreException {
- if(isCustomBuilder()){
- customizedErrorParserIds = (parsers != null && parsers.length != 0) ? (String[])parsers.clone() : parsers;
+ if (isCustomBuilder()) {
+ customizedErrorParserIds = (parsers != null && parsers.length != 0) ? (String[]) parsers.clone() : parsers;
} else {
IToolChain parent = getParent();
IConfiguration parentConfig = parent.getParent();
parentConfig.setErrorParserList(parsers);
}
}
-
- private Object getMacroContextData(){
+
+ private Object getMacroContextData() {
return this;//!isExtensionBuilder ? (Object)this : (Object)getParent().getParent();
}
@@ -1748,10 +1744,11 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
IBuildMacroProvider provider = ManagedBuildManager.getBuildMacroProvider();
try {
- args = provider.resolveValue(args, "", " ", IBuildMacroProvider.CONTEXT_CONFIGURATION, getMacroContextData()); //$NON-NLS-1$ //$NON-NLS-2$
+ args = provider.resolveValue(args, "", " ", IBuildMacroProvider.CONTEXT_CONFIGURATION, //$NON-NLS-1$//$NON-NLS-2$
+ getMacroContextData());
} catch (BuildMacroException e) {
}
-
+
return args;
}
@@ -1761,144 +1758,150 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
IBuildMacroProvider provider = ManagedBuildManager.getBuildMacroProvider();
try {
- command = provider.resolveValue(command, "", " ", IBuildMacroProvider.CONTEXT_CONFIGURATION, getMacroContextData()); //$NON-NLS-1$ //$NON-NLS-2$
+ command = provider.resolveValue(command, "", " ", IBuildMacroProvider.CONTEXT_CONFIGURATION, //$NON-NLS-1$//$NON-NLS-2$
+ getMacroContextData());
} catch (BuildMacroException e) {
}
return new Path(command);
}
-
- public String getBuildPathAttribute(){
+
+ public String getBuildPathAttribute() {
return getBuildPathAttribute(true);
}
-
- public String getBuildPathAttribute(boolean querySuperClass){
- if(buildPath == null){
- if(querySuperClass && superClass != null){
- return ((Builder)superClass).getBuildPathAttribute(true);
+
+ public String getBuildPathAttribute(boolean querySuperClass) {
+ if (buildPath == null) {
+ if (querySuperClass && superClass != null) {
+ return ((Builder) superClass).getBuildPathAttribute(true);
}
}
return buildPath;
}
-
+
@Override
- public void setBuildPath(String path){
+ public void setBuildPath(String path) {
setBuildPathAttribute(path);
}
-
- public void setBuildPathAttribute(String path){
+
+ public void setBuildPathAttribute(String path) {
buildPath = path;
setDirty(true);
}
-
+
@Override
- public String getBuildPath(){
- if(isManagedBuildOn())
+ public String getBuildPath() {
+ if (isManagedBuildOn())
return getDefaultBuildPath();
-
+
String path = getBuildPathAttribute();
- if(path == null){
+ if (path == null) {
path = getDefaultBuildPath();
-// if(isManagedBuildOn() && !isExtensionElement()) {
-// buildPath = path;
-// }
+ // if(isManagedBuildOn() && !isExtensionElement()) {
+ // buildPath = path;
+ // }
}
return path;
}
-
- private boolean isBuildPathEditable(){
+
+ private boolean isBuildPathEditable() {
return !isManagedBuildOn();
}
-
- public String getDefaultBuildPath(){
- Configuration cfg = (Configuration)getConfguration();
+
+ public String getDefaultBuildPath() {
+ Configuration cfg = (Configuration) getConfguration();
IPath buildPath;
String result;
-
-// Builder extBuilder = (Builder)ManagedBuildManager.getExtensionBuilder(this);
-// String attr = extBuilder.getBuildPathAttribute();
- if(cfg != null){
- if(!isExtensionElement() && !cfg.isPreference()){
+
+ // Builder extBuilder = (Builder)ManagedBuildManager.getExtensionBuilder(this);
+ // String attr = extBuilder.getBuildPathAttribute();
+ if (cfg != null) {
+ if (!isExtensionElement() && !cfg.isPreference()) {
IProject project = cfg.getOwner().getProject();
-// if(attr == null){
- if(isManagedBuildOn()){
- IManagedBuilderMakefileGenerator gen = getBuildFileGenerator();
- if(gen instanceof IManagedBuilderMakefileGenerator2){
- ((IManagedBuilderMakefileGenerator2)gen).initialize(IncrementalProjectBuilder.FULL_BUILD, cfg, this, new NullProgressMonitor());
- } else {
- gen.initialize(project, ManagedBuildManager.getBuildInfo(project), new NullProgressMonitor());
- }
-
- buildPath = gen.getBuildWorkingDir();
- if(buildPath == null)
- buildPath = new Path(cfg.getName());
+ // if(attr == null){
+ if (isManagedBuildOn()) {
+ IManagedBuilderMakefileGenerator gen = getBuildFileGenerator();
+ if (gen instanceof IManagedBuilderMakefileGenerator2) {
+ ((IManagedBuilderMakefileGenerator2) gen).initialize(IncrementalProjectBuilder.FULL_BUILD, cfg,
+ this, new NullProgressMonitor());
} else {
- buildPath = Path.EMPTY;
+ gen.initialize(project, ManagedBuildManager.getBuildInfo(project), new NullProgressMonitor());
}
-// } else {
-// buildPath = new Path(attr);
-// }
-
- if(!buildPath.isAbsolute()){
+
+ buildPath = gen.getBuildWorkingDir();
+ if (buildPath == null)
+ buildPath = new Path(cfg.getName());
+ } else {
+ buildPath = Path.EMPTY;
+ }
+ // } else {
+ // buildPath = new Path(attr);
+ // }
+
+ if (!buildPath.isAbsolute()) {
IStringVariableManager mngr = VariablesPlugin.getDefault().getStringVariableManager();
// build dir may not exist yet and non-existent paths will resolve to empty string by VariablesPlugin
// so append relative part outside of expression, i.e. ${workspace_loc:/Project}/BuildDir
- result = mngr.generateVariableExpression("workspace_loc", project.getFullPath().toString()) + Path.SEPARATOR + buildPath.toString(); //$NON-NLS-1$
+ result = mngr.generateVariableExpression("workspace_loc", project.getFullPath().toString()) //$NON-NLS-1$
+ + Path.SEPARATOR + buildPath.toString();
} else {
result = buildPath.toString();
}
} else {
- if(isManagedBuildOn()){
+ if (isManagedBuildOn()) {
result = cfg.getName();
- if(result == null)
+ if (result == null)
result = ""; //$NON-NLS-1$
} else {
- result = ""; //$NON-NLS-1$
+ result = ""; //$NON-NLS-1$
}
}
} else {
- result = ""; //$NON-NLS-1$
+ result = ""; //$NON-NLS-1$
}
-
+
return result;
}
-
-/* public boolean isWorkspaceBuildPath(){
- String path = getBuildPathAttribute();
- if(path == null)
- return true;
-
- if(isWorkspaceBuildPath == null){
- if(superClass != null)
- return superClass.isWorkspaceBuildPath();
- return true;
+
+ /* public boolean isWorkspaceBuildPath(){
+ String path = getBuildPathAttribute();
+ if(path == null)
+ return true;
+
+ if(isWorkspaceBuildPath == null){
+ if(superClass != null)
+ return superClass.isWorkspaceBuildPath();
+ return true;
+ }
+ return isWorkspaceBuildPath.booleanValue();
}
- return isWorkspaceBuildPath.booleanValue();
- }
-*/
+ */
@Override
public IPath getBuildLocation() {
String path = getBuildPath();
-
+
IBuildMacroProvider provider = ManagedBuildManager.getBuildMacroProvider();
try {
- path = provider.resolveValue(path, "", " ", IBuildMacroProvider.CONTEXT_CONFIGURATION, getMacroContextData()); //$NON-NLS-1$ //$NON-NLS-2$
+ path = provider.resolveValue(path, "", " ", IBuildMacroProvider.CONTEXT_CONFIGURATION, //$NON-NLS-1$//$NON-NLS-2$
+ getMacroContextData());
} catch (BuildMacroException e) {
}
-
+
return new Path(path);
}
@Override
public boolean isDefaultBuildCmd() {
- return isExtensionBuilder || (command == null && args == null /*&& stopOnErr == null && parallelBuildOn == null && parallelNum == null */ && superClass != null);
+ return isExtensionBuilder || (command == null
+ && args == null /*&& stopOnErr == null && parallelBuildOn == null && parallelNum == null */
+ && superClass != null);
}
@Override
public boolean isStopOnError() {
- if(stopOnErr == null){
- if(superClass != null){
+ if (stopOnErr == null) {
+ if (superClass != null) {
return getSuperClass().isStopOnError();
}
return true;
@@ -1925,14 +1928,14 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public void setStopOnError(boolean on) throws CoreException {
- if(isStopOnError() == on)
+ if (isStopOnError() == on)
return;
-
- if(supportsStopOnError(on)){
+
+ if (supportsStopOnError(on)) {
String curCmd = getStopOnErrCmd(isStopOnError());
String args = getArgumentsAttribute();
String updatedArgs = removeCmd(args, curCmd);
- if(!updatedArgs.equals(args))
+ if (!updatedArgs.equals(args))
setArgumentsAttribute(updatedArgs);
stopOnErr = on;
}
@@ -1941,13 +1944,13 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public void setUseDefaultBuildCmd(boolean on) throws CoreException {
- if(!isExtensionBuilder && superClass != null){
- if(on){
+ if (!isExtensionBuilder && superClass != null) {
+ if (on) {
command = null;
args = null;
-// stopOnErr = null;
-// parallelBuildOn = null;
-// parallelNum = null;
+ // stopOnErr = null;
+ // parallelBuildOn = null;
+ // parallelNum = null;
} else {
command = getCommand();
}
@@ -1955,38 +1958,38 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
}
public String getAutoBuildTargetAttribute() {
- if(autoBuildTarget == null){
- if(superClass != null)
- return ((Builder)superClass).getAutoBuildTargetAttribute();
+ if (autoBuildTarget == null) {
+ if (superClass != null)
+ return ((Builder) superClass).getAutoBuildTargetAttribute();
return null;
}
return autoBuildTarget;
}
-
+
@Override
public String getAutoBuildTarget() {
String attr = getAutoBuildTargetAttribute();
-
- if(attr != null){
+
+ if (attr != null) {
IBuildMacroProvider provider = ManagedBuildManager.getBuildMacroProvider();
-
+
try {
- attr = provider.resolveValue(attr, "", " ", IBuildMacroProvider.CONTEXT_CONFIGURATION, getMacroContextData()); //$NON-NLS-1$ //$NON-NLS-2$
+ attr = provider.resolveValue(attr, "", " ", IBuildMacroProvider.CONTEXT_CONFIGURATION, //$NON-NLS-1$//$NON-NLS-2$
+ getMacroContextData());
} catch (BuildMacroException e) {
}
}
- if(attr == null){
+ if (attr == null) {
attr = DEFAULT_TARGET_AUTO;
}
-
+
return attr;
}
-
public String getCleanBuildTargetAttribute() {
- if(cleanBuildTarget == null){
- if(superClass != null)
- return ((Builder)superClass).getCleanBuildTargetAttribute();
+ if (cleanBuildTarget == null) {
+ if (superClass != null)
+ return ((Builder) superClass).getCleanBuildTargetAttribute();
return null;
}
return cleanBuildTarget;
@@ -1995,32 +1998,32 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public String getCleanBuildTarget() {
String attr = getCleanBuildTargetAttribute();
-
- if(attr != null){
+
+ if (attr != null) {
IBuildMacroProvider provider = ManagedBuildManager.getBuildMacroProvider();
-
+
try {
- attr = provider.resolveValue(attr, "", " ", IBuildMacroProvider.CONTEXT_CONFIGURATION, getMacroContextData()); //$NON-NLS-1$ //$NON-NLS-2$
+ attr = provider.resolveValue(attr, "", " ", IBuildMacroProvider.CONTEXT_CONFIGURATION, //$NON-NLS-1$//$NON-NLS-2$
+ getMacroContextData());
} catch (BuildMacroException e) {
}
}
- if(attr == null){
+ if (attr == null) {
attr = DEFAULT_TARGET_CLEAN;
}
-
+
return attr;
}
-
@Override
public String getFullBuildTarget() {
return getIncrementalBuildTarget();
}
public String getIncrementalBuildTargetAttribute() {
- if(incrementalBuildTarget == null){
- if(superClass != null)
- return ((Builder)superClass).getIncrementalBuildTargetAttribute();
+ if (incrementalBuildTarget == null) {
+ if (superClass != null)
+ return ((Builder) superClass).getIncrementalBuildTargetAttribute();
return null;
}
return incrementalBuildTarget;
@@ -2029,26 +2032,27 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public String getIncrementalBuildTarget() {
String attr = getIncrementalBuildTargetAttribute();
-
- if(attr != null){
+
+ if (attr != null) {
IBuildMacroProvider provider = ManagedBuildManager.getBuildMacroProvider();
-
+
try {
- attr = provider.resolveValue(attr, "", " ", IBuildMacroProvider.CONTEXT_CONFIGURATION, getMacroContextData()); //$NON-NLS-1$ //$NON-NLS-2$
+ attr = provider.resolveValue(attr, "", " ", IBuildMacroProvider.CONTEXT_CONFIGURATION, //$NON-NLS-1$//$NON-NLS-2$
+ getMacroContextData());
} catch (BuildMacroException e) {
}
}
- if(attr == null){
+ if (attr == null) {
attr = DEFAULT_TARGET_INCREMENTAL;
}
-
+
return attr;
}
@Override
public boolean isAutoBuildEnable() {
- if(autoBuildEnabled == null){
- if(superClass != null)
+ if (autoBuildEnabled == null) {
+ if (superClass != null)
return getSuperClass().isAutoBuildEnable();
return false;
}
@@ -2057,8 +2061,8 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public boolean isCleanBuildEnabled() {
- if(cleanBuildEnabled == null){
- if(superClass != null)
+ if (cleanBuildEnabled == null) {
+ if (superClass != null)
return getSuperClass().isCleanBuildEnabled();
return true;
}
@@ -2072,8 +2076,8 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public boolean isIncrementalBuildEnabled() {
- if(incrementalBuildEnabled == null){
- if(superClass != null)
+ if (incrementalBuildEnabled == null) {
+ if (superClass != null)
return getSuperClass().isIncrementalBuildEnabled();
return true;
}
@@ -2122,8 +2126,8 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public boolean appendEnvironment() {
- if(appendEnvironment == null){
- if(superClass != null){
+ if (appendEnvironment == null) {
+ if (superClass != null) {
return getSuperClass().appendEnvironment();
}
return true;
@@ -2134,163 +2138,156 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public String getBuildAttribute(String name, String defaultValue) {
String result = null;
- if(BUILD_TARGET_INCREMENTAL.equals(name)){
+ if (BUILD_TARGET_INCREMENTAL.equals(name)) {
result = getIncrementalBuildTargetAttribute();
- } else if(BUILD_TARGET_AUTO.equals(name)){
- result = getAutoBuildTargetAttribute();
- } else if(BUILD_TARGET_CLEAN.equals(name)){
- result = getCleanBuildTargetAttribute();
- } else if(BUILD_LOCATION.equals(name)){
+ } else if (BUILD_TARGET_AUTO.equals(name)) {
+ result = getAutoBuildTargetAttribute();
+ } else if (BUILD_TARGET_CLEAN.equals(name)) {
+ result = getCleanBuildTargetAttribute();
+ } else if (BUILD_LOCATION.equals(name)) {
result = getBuildPathAttribute();
- } else if(BUILD_COMMAND.equals(name)){
+ } else if (BUILD_COMMAND.equals(name)) {
result = getCommand();
- } else if(BUILD_ARGUMENTS.equals(name)){
+ } else if (BUILD_ARGUMENTS.equals(name)) {
result = getArguments();
- } else if(BuilderFactory.BUILD_COMMAND.equals(name)){
+ } else if (BuilderFactory.BUILD_COMMAND.equals(name)) {
result = getCommand();
- } else if(BuilderFactory.BUILD_LOCATION.equals(name)){
+ } else if (BuilderFactory.BUILD_LOCATION.equals(name)) {
result = getBuildPathAttribute();
- } else if(BuilderFactory.STOP_ON_ERROR.equals(name)){
+ } else if (BuilderFactory.STOP_ON_ERROR.equals(name)) {
result = String.valueOf(isStopOnError());
- } else if(BuilderFactory.USE_DEFAULT_BUILD_CMD.equals(name)){
+ } else if (BuilderFactory.USE_DEFAULT_BUILD_CMD.equals(name)) {
result = String.valueOf(isDefaultBuildCmd());
- } else if(BuilderFactory.BUILD_TARGET_AUTO.equals(name)){
+ } else if (BuilderFactory.BUILD_TARGET_AUTO.equals(name)) {
result = getAutoBuildTargetAttribute();
- } else if(BuilderFactory.BUILD_TARGET_INCREMENTAL.equals(name)){
+ } else if (BuilderFactory.BUILD_TARGET_INCREMENTAL.equals(name)) {
result = getIncrementalBuildTargetAttribute();
- } else if(BuilderFactory.BUILD_TARGET_FULL.equals(name)){
+ } else if (BuilderFactory.BUILD_TARGET_FULL.equals(name)) {
result = getIncrementalBuildTargetAttribute();
- } else if(BuilderFactory.BUILD_TARGET_CLEAN.equals(name)){
+ } else if (BuilderFactory.BUILD_TARGET_CLEAN.equals(name)) {
result = getCleanBuildTargetAttribute();
- } else if(BuilderFactory.BUILD_FULL_ENABLED.equals(name)){
+ } else if (BuilderFactory.BUILD_FULL_ENABLED.equals(name)) {
result = String.valueOf(isFullBuildEnabled());
- } else if(BuilderFactory.BUILD_CLEAN_ENABLED.equals(name)){
+ } else if (BuilderFactory.BUILD_CLEAN_ENABLED.equals(name)) {
result = String.valueOf(isCleanBuildEnabled());
- } else if(BuilderFactory.BUILD_INCREMENTAL_ENABLED.equals(name)){
+ } else if (BuilderFactory.BUILD_INCREMENTAL_ENABLED.equals(name)) {
result = String.valueOf(isIncrementalBuildEnabled());
- } else if(BuilderFactory.BUILD_AUTO_ENABLED.equals(name)){
+ } else if (BuilderFactory.BUILD_AUTO_ENABLED.equals(name)) {
result = String.valueOf(isAutoBuildEnable());
- } else if(BuilderFactory.BUILD_ARGUMENTS.equals(name)){
+ } else if (BuilderFactory.BUILD_ARGUMENTS.equals(name)) {
result = getArguments();
- } else if(BuilderFactory.ENVIRONMENT.equals(name)){
- result = customizedEnvironment != null ?
- MapStorageElement.encodeMap(customizedEnvironment) : null;
- } else if(BuilderFactory.BUILD_APPEND_ENVIRONMENT.equals(name)){
+ } else if (BuilderFactory.ENVIRONMENT.equals(name)) {
+ result = customizedEnvironment != null ? MapStorageElement.encodeMap(customizedEnvironment) : null;
+ } else if (BuilderFactory.BUILD_APPEND_ENVIRONMENT.equals(name)) {
result = String.valueOf(appendEnvironment());
- } else if(customBuildProperties != null){
+ } else if (customBuildProperties != null) {
result = customBuildProperties.get(name);
}
-
- if(result == null)
+
+ if (result == null)
return defaultValue;
return result;
}
-
+
public static String[] toBuildAttributes(String name) {
-
- if(ATTRIBUTE_TARGET_INCREMENTAL.equals(name)){
- return new String[]{BUILD_TARGET_INCREMENTAL, BuilderFactory.BUILD_TARGET_INCREMENTAL, BUILD_TARGET_FULL, BuilderFactory.BUILD_TARGET_FULL};
- } else if(ATTRIBUTE_TARGET_AUTO.equals(name)){
- return new String[]{BUILD_TARGET_AUTO, BuilderFactory.BUILD_TARGET_AUTO};
- } else if(ATTRIBUTE_TARGET_CLEAN.equals(name)){
- return new String[]{BUILD_TARGET_CLEAN, BuilderFactory.BUILD_TARGET_CLEAN};
- } else if(ATTRIBUTE_BUILD_PATH.equals(name)){
- return new String[]{BUILD_LOCATION, BuilderFactory.BUILD_LOCATION};
- } else if(COMMAND.equals(name)){
- return new String[]{BUILD_COMMAND, BuilderFactory.BUILD_COMMAND};
- } else if(ARGUMENTS.equals(name)){
- return new String[]{BUILD_ARGUMENTS, BuilderFactory.BUILD_ARGUMENTS};
- } else if(ATTRIBUTE_STOP_ON_ERR.equals(name)){
- return new String[]{BuilderFactory.STOP_ON_ERROR};
+
+ if (ATTRIBUTE_TARGET_INCREMENTAL.equals(name)) {
+ return new String[] { BUILD_TARGET_INCREMENTAL, BuilderFactory.BUILD_TARGET_INCREMENTAL, BUILD_TARGET_FULL,
+ BuilderFactory.BUILD_TARGET_FULL };
+ } else if (ATTRIBUTE_TARGET_AUTO.equals(name)) {
+ return new String[] { BUILD_TARGET_AUTO, BuilderFactory.BUILD_TARGET_AUTO };
+ } else if (ATTRIBUTE_TARGET_CLEAN.equals(name)) {
+ return new String[] { BUILD_TARGET_CLEAN, BuilderFactory.BUILD_TARGET_CLEAN };
+ } else if (ATTRIBUTE_BUILD_PATH.equals(name)) {
+ return new String[] { BUILD_LOCATION, BuilderFactory.BUILD_LOCATION };
+ } else if (COMMAND.equals(name)) {
+ return new String[] { BUILD_COMMAND, BuilderFactory.BUILD_COMMAND };
+ } else if (ARGUMENTS.equals(name)) {
+ return new String[] { BUILD_ARGUMENTS, BuilderFactory.BUILD_ARGUMENTS };
+ } else if (ATTRIBUTE_STOP_ON_ERR.equals(name)) {
+ return new String[] { BuilderFactory.STOP_ON_ERROR };
} //TODO else if(BuilderFactory.USE_DEFAULT_BUILD_CMD.equals(name)){
- // return getCommand();
- //}
- else if(ATTRIBUTE_INCREMENTAL_ENABLED.equals(name)) {
- return new String[]{BuilderFactory.BUILD_INCREMENTAL_ENABLED, BuilderFactory.BUILD_FULL_ENABLED};
- } else if(ATTRIBUTE_CLEAN_ENABLED.equals(name)){
- return new String[]{BuilderFactory.BUILD_CLEAN_ENABLED};
- } else if(ATTRIBUTE_AUTO_ENABLED.equals(name)){
- return new String[]{BuilderFactory.BUILD_AUTO_ENABLED};
- } else if(ATTRIBUTE_ENVIRONMENT.equals(name)){
- return new String[]{BuilderFactory.ENVIRONMENT};
- } else if(ATTRIBUTE_APPEND_ENVIRONMENT.equals(name)){
- return new String[]{BuilderFactory.BUILD_APPEND_ENVIRONMENT};
- } else if(ATTRIBUTE_CUSTOMIZED_ERROR_PARSERS.equals(name)){
- return new String[]{ErrorParserManager.PREF_ERROR_PARSER};
- }
-
+ // return getCommand();
+ //}
+ else if (ATTRIBUTE_INCREMENTAL_ENABLED.equals(name)) {
+ return new String[] { BuilderFactory.BUILD_INCREMENTAL_ENABLED, BuilderFactory.BUILD_FULL_ENABLED };
+ } else if (ATTRIBUTE_CLEAN_ENABLED.equals(name)) {
+ return new String[] { BuilderFactory.BUILD_CLEAN_ENABLED };
+ } else if (ATTRIBUTE_AUTO_ENABLED.equals(name)) {
+ return new String[] { BuilderFactory.BUILD_AUTO_ENABLED };
+ } else if (ATTRIBUTE_ENVIRONMENT.equals(name)) {
+ return new String[] { BuilderFactory.ENVIRONMENT };
+ } else if (ATTRIBUTE_APPEND_ENVIRONMENT.equals(name)) {
+ return new String[] { BuilderFactory.BUILD_APPEND_ENVIRONMENT };
+ } else if (ATTRIBUTE_CUSTOMIZED_ERROR_PARSERS.equals(name)) {
+ return new String[] { ErrorParserManager.PREF_ERROR_PARSER };
+ }
+
return new String[0];
}
-
+
public static String toBuilderAttribute(String name) {
- if(BUILD_TARGET_INCREMENTAL.equals(name)
- || BuilderFactory.BUILD_TARGET_INCREMENTAL.equals(name)
- || BUILD_TARGET_FULL.equals(name)
- || BuilderFactory.BUILD_TARGET_FULL.equals(name)){
+ if (BUILD_TARGET_INCREMENTAL.equals(name) || BuilderFactory.BUILD_TARGET_INCREMENTAL.equals(name)
+ || BUILD_TARGET_FULL.equals(name) || BuilderFactory.BUILD_TARGET_FULL.equals(name)) {
return ATTRIBUTE_TARGET_INCREMENTAL;
- } else if (BUILD_TARGET_AUTO.equals(name)
- || BuilderFactory.BUILD_TARGET_AUTO.equals(name)) {
+ } else if (BUILD_TARGET_AUTO.equals(name) || BuilderFactory.BUILD_TARGET_AUTO.equals(name)) {
return ATTRIBUTE_TARGET_AUTO;
- } else if (BUILD_TARGET_CLEAN.equals(name)
- || BuilderFactory.BUILD_TARGET_CLEAN.equals(name)) {
+ } else if (BUILD_TARGET_CLEAN.equals(name) || BuilderFactory.BUILD_TARGET_CLEAN.equals(name)) {
return ATTRIBUTE_TARGET_CLEAN;
- } else if (BUILD_LOCATION.equals(name)
- || BuilderFactory.BUILD_LOCATION.equals(name)) {
+ } else if (BUILD_LOCATION.equals(name) || BuilderFactory.BUILD_LOCATION.equals(name)) {
return ATTRIBUTE_BUILD_PATH;
- } else if (BUILD_COMMAND.equals(name)
- || BuilderFactory.BUILD_COMMAND.equals(name)) {
+ } else if (BUILD_COMMAND.equals(name) || BuilderFactory.BUILD_COMMAND.equals(name)) {
return COMMAND;
- } else if (BUILD_ARGUMENTS.equals(name)
- || BuilderFactory.BUILD_ARGUMENTS.equals(name)) {
+ } else if (BUILD_ARGUMENTS.equals(name) || BuilderFactory.BUILD_ARGUMENTS.equals(name)) {
return ARGUMENTS;
} else if (BuilderFactory.STOP_ON_ERROR.equals(name)) {
return ATTRIBUTE_STOP_ON_ERR;
} //TODO else if(BuilderFactory.USE_DEFAULT_BUILD_CMD.equals(name)){
- // return getCommand();
- //}
+ // return getCommand();
+ //}
else if (BuilderFactory.BUILD_INCREMENTAL_ENABLED.equals(name)
- || BuilderFactory.BUILD_FULL_ENABLED.equals(name)) {
+ || BuilderFactory.BUILD_FULL_ENABLED.equals(name)) {
return ATTRIBUTE_INCREMENTAL_ENABLED;
- } else if (BuilderFactory.BUILD_CLEAN_ENABLED.equals(name)){
+ } else if (BuilderFactory.BUILD_CLEAN_ENABLED.equals(name)) {
return ATTRIBUTE_CLEAN_ENABLED;
} else if (BuilderFactory.BUILD_AUTO_ENABLED.equals(name)) {
return ATTRIBUTE_AUTO_ENABLED;
} else if (BuilderFactory.ENVIRONMENT.equals(name)) {
return ATTRIBUTE_ENVIRONMENT;
- } else if (BuilderFactory.BUILD_APPEND_ENVIRONMENT.equals(name)){
+ } else if (BuilderFactory.BUILD_APPEND_ENVIRONMENT.equals(name)) {
return ATTRIBUTE_APPEND_ENVIRONMENT;
} else if (ErrorParserManager.PREF_ERROR_PARSER.equals(name)) {
return ATTRIBUTE_CUSTOMIZED_ERROR_PARSERS;
}
return null;
}
-
@Override
public Map<String, String> getEnvironment() {
- if(customizedEnvironment != null)
+ if (customizedEnvironment != null)
return cloneMap(customizedEnvironment);
return null;
}
@Override
public Map<String, String> getExpandedEnvironment() throws CoreException {
- if(customizedEnvironment != null){
+ if (customizedEnvironment != null) {
Map<String, String> expanded = cloneMap(customizedEnvironment);
ICdtVariableManager mngr = CCorePlugin.getDefault().getCdtVariableManager();
String separator = CCorePlugin.getDefault().getBuildEnvironmentManager().getDefaultDelimiter();
- ICConfigurationDescription cfgDes = ManagedBuildManager.getDescriptionForConfiguration(getParent().getParent());
+ ICConfigurationDescription cfgDes = ManagedBuildManager
+ .getDescriptionForConfiguration(getParent().getParent());
Set<Entry<String, String>> entrySet = expanded.entrySet();
for (Entry<String, String> entry : entrySet) {
String value = entry.getValue();
try {
value = mngr.resolveValue(value, "", separator, cfgDes); //$NON-NLS-1$
entry.setValue(value);
- } catch (CdtVariableException e){
+ } catch (CdtVariableException e) {
}
}
-
+
return expanded;
}
return null;
@@ -2302,69 +2299,63 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
}
@Override
- public void setBuildAttribute(String name, String value)
- throws CoreException {
- if(BUILD_TARGET_INCREMENTAL.equals(name)){
+ public void setBuildAttribute(String name, String value) throws CoreException {
+ if (BUILD_TARGET_INCREMENTAL.equals(name)) {
incrementalBuildTarget = value;
- } else if(BUILD_TARGET_AUTO.equals(name)){
+ } else if (BUILD_TARGET_AUTO.equals(name)) {
autoBuildTarget = value;
- } else if(BUILD_TARGET_CLEAN.equals(name)){
+ } else if (BUILD_TARGET_CLEAN.equals(name)) {
cleanBuildTarget = value;
- } else if(BUILD_LOCATION.equals(name)){
+ } else if (BUILD_LOCATION.equals(name)) {
buildPath = value;
- } else if(BUILD_COMMAND.equals(name)){
+ } else if (BUILD_COMMAND.equals(name)) {
command = value;
- } else if(BUILD_ARGUMENTS.equals(name)){
+ } else if (BUILD_ARGUMENTS.equals(name)) {
args = value;
- } else if(BuilderFactory.BUILD_COMMAND.equals(name)){
+ } else if (BuilderFactory.BUILD_COMMAND.equals(name)) {
command = value;
- } else if(BuilderFactory.BUILD_LOCATION.equals(name)){
+ } else if (BuilderFactory.BUILD_LOCATION.equals(name)) {
buildPath = value;
- } else if(BuilderFactory.STOP_ON_ERROR.equals(name)){
+ } else if (BuilderFactory.STOP_ON_ERROR.equals(name)) {
stopOnErr = Boolean.valueOf(value);
- } else if(BuilderFactory.USE_DEFAULT_BUILD_CMD.equals(name)){
- if(value == null || Boolean.parseBoolean(value)){
- if(superClass != null)
+ } else if (BuilderFactory.USE_DEFAULT_BUILD_CMD.equals(name)) {
+ if (value == null || Boolean.parseBoolean(value)) {
+ if (superClass != null)
command = null;
}
- } else if(BuilderFactory.BUILD_TARGET_AUTO.equals(name)){
+ } else if (BuilderFactory.BUILD_TARGET_AUTO.equals(name)) {
autoBuildTarget = value;
- } else if(BuilderFactory.BUILD_TARGET_INCREMENTAL.equals(name)){
+ } else if (BuilderFactory.BUILD_TARGET_INCREMENTAL.equals(name)) {
incrementalBuildTarget = value;
- } else if(BuilderFactory.BUILD_TARGET_FULL.equals(name)){
+ } else if (BuilderFactory.BUILD_TARGET_FULL.equals(name)) {
autoBuildTarget = value;
- } else if(BuilderFactory.BUILD_TARGET_CLEAN.equals(name)){
+ } else if (BuilderFactory.BUILD_TARGET_CLEAN.equals(name)) {
cleanBuildTarget = value;
- } else if(BuilderFactory.BUILD_FULL_ENABLED.equals(name)){
- autoBuildEnabled = value != null ?
- Boolean.valueOf(value) : null;
- } else if(BuilderFactory.BUILD_CLEAN_ENABLED.equals(name)){
- cleanBuildEnabled = value != null ?
- Boolean.valueOf(value) : null;
- } else if(BuilderFactory.BUILD_INCREMENTAL_ENABLED.equals(name)){
- incrementalBuildEnabled = value != null ?
- Boolean.valueOf(value) : null;
- } else if(BuilderFactory.BUILD_AUTO_ENABLED.equals(name)){
- autoBuildEnabled = value != null ?
- Boolean.valueOf(value) : null;
- } else if(BuilderFactory.BUILD_ARGUMENTS.equals(name)){
+ } else if (BuilderFactory.BUILD_FULL_ENABLED.equals(name)) {
+ autoBuildEnabled = value != null ? Boolean.valueOf(value) : null;
+ } else if (BuilderFactory.BUILD_CLEAN_ENABLED.equals(name)) {
+ cleanBuildEnabled = value != null ? Boolean.valueOf(value) : null;
+ } else if (BuilderFactory.BUILD_INCREMENTAL_ENABLED.equals(name)) {
+ incrementalBuildEnabled = value != null ? Boolean.valueOf(value) : null;
+ } else if (BuilderFactory.BUILD_AUTO_ENABLED.equals(name)) {
+ autoBuildEnabled = value != null ? Boolean.valueOf(value) : null;
+ } else if (BuilderFactory.BUILD_ARGUMENTS.equals(name)) {
args = value;
- } else if(BuilderFactory.ENVIRONMENT.equals(name)){
- if(value == null){
+ } else if (BuilderFactory.ENVIRONMENT.equals(name)) {
+ if (value == null) {
customizedEnvironment = null;
} else {
customizedEnvironment = MapStorageElement.decodeMap(value);
}
- } else if(BuilderFactory.BUILD_APPEND_ENVIRONMENT.equals(name)){
- appendEnvironment = value != null ?
- Boolean.valueOf(value) : null;
+ } else if (BuilderFactory.BUILD_APPEND_ENVIRONMENT.equals(name)) {
+ appendEnvironment = value != null ? Boolean.valueOf(value) : null;
} else {
getCustomBuildPropertiesMap().put(name, value);
}
}
-
- private Map<String, String> getCustomBuildPropertiesMap(){
- if(customBuildProperties == null){
+
+ private Map<String, String> getCustomBuildPropertiesMap() {
+ if (customBuildProperties == null) {
customBuildProperties = new HashMap<String, String>();
}
return customBuildProperties;
@@ -2377,13 +2368,13 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public boolean isCustomBuilder() {
- if(!isExtensionBuilder && getParent().getBuilder() != this)
+ if (!isExtensionBuilder && getParent().getBuilder() != this)
return true;
return false;
}
- public IConfiguration getConfguration(){
- if(getParent() != null)
+ public IConfiguration getConfguration() {
+ if (getParent() != null)
return getParent().getParent();
return null;
}
@@ -2391,23 +2382,23 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public boolean isManagedBuildOn() {
IConfiguration cfg = getConfguration();
- if(cfg != null){
- if(!cfg.supportsBuild(true))
+ if (cfg != null) {
+ if (!cfg.supportsBuild(true))
return false;
- else if(!cfg.supportsBuild(false))
+ else if (!cfg.supportsBuild(false))
return true;
}
-
+
Boolean attr = getManagedBuildOnAttribute();
- if(attr != null)
+ if (attr != null)
return attr.booleanValue();
return true;
}
-
- public Boolean getManagedBuildOnAttribute(){
- if(managedBuildOn == null){
- if(superClass != null)
- return ((Builder)superClass).getManagedBuildOnAttribute();
+
+ public Boolean getManagedBuildOnAttribute() {
+ if (managedBuildOn == null) {
+ if (superClass != null)
+ return ((Builder) superClass).getManagedBuildOnAttribute();
return null;
}
return managedBuildOn;
@@ -2425,8 +2416,8 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public boolean keepEnvironmentVariablesInBuildfile() {
- if(keepEnvVarInBuildfile == null){
- if(superClass != null)
+ if (keepEnvVarInBuildfile == null) {
+ if (superClass != null)
return getSuperClass().keepEnvironmentVariablesInBuildfile();
return false;
}
@@ -2440,47 +2431,47 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public boolean supportsCustomizedBuild() {
- if(fSupportsCustomizedBuild == null){
+ if (fSupportsCustomizedBuild == null) {
IManagedBuilderMakefileGenerator makeGen = getBuildFileGenerator();
- if(makeGen instanceof IManagedBuilderMakefileGenerator2)
+ if (makeGen instanceof IManagedBuilderMakefileGenerator2)
fSupportsCustomizedBuild = true;
else
fSupportsCustomizedBuild = false;
}
return fSupportsCustomizedBuild.booleanValue();
}
-
+
@Override
public boolean supportsBuild(boolean managed) {
- if(supportsManagedBuild == null){
- if(superClass != null)
+ if (supportsManagedBuild == null) {
+ if (superClass != null)
return getSuperClass().supportsBuild(managed);
return managed || !isInternalBuilder();
}
return supportsManagedBuild.booleanValue();
}
-
- public void setParent(IToolChain toolChain){
+
+ public void setParent(IToolChain toolChain) {
parent = toolChain;
}
@Override
- public boolean matches(IBuilder builder){
- if(builder == this)
+ public boolean matches(IBuilder builder) {
+ if (builder == this)
return true;
-
+
IBuilder rBld = ManagedBuildManager.getRealBuilder(this);
- if(rBld == null)
+ if (rBld == null)
return false;
-
+
return rBld == ManagedBuildManager.getRealBuilder(builder);
}
@Override
public MatchKey<Builder> getMatchKey() {
- if(isAbstract())
+ if (isAbstract())
return null;
- if(!isExtensionBuilder)
+ if (!isExtensionBuilder)
return null;
return new MatchKey<Builder>(this);
}
@@ -2490,10 +2481,10 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
identicalList = list;
}
- public String getNameAndVersion(){
+ public String getNameAndVersion() {
String name = getName();
String version = ManagedBuildManager.getVersionFromIdAndVersion(getId());
- if(version != null && version.length() != 0){
+ if (version != null && version.length() != 0) {
return new StringBuilder().append(name).append(" (").append(version).append("").toString(); //$NON-NLS-1$ //$NON-NLS-2$
}
return name;
@@ -2507,8 +2498,8 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public boolean isInternalBuilder() {
IBuilder internalBuilder = ManagedBuildManager.getInternalBuilder();
- for(IBuilder builder = this; builder != null; builder = builder.getSuperClass()){
- if(internalBuilder == builder)
+ for (IBuilder builder = this; builder != null; builder = builder.getSuperClass()) {
+ if (internalBuilder == builder)
return true;
}
return false;
@@ -2517,7 +2508,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
/**
* Returns the optimal number of parallel jobs.
* The number is the number of available processors on the machine.
- *
+ *
* The function never returns number smaller than 1.
*/
public int getOptimalParallelJobNum() {
@@ -2529,17 +2520,17 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
else
return j;
}
-
+
/**
* Returns the internal representation of maximum number of parallel jobs
* to be used for a build.
* Note that negative number represents "optimal" value.
- *
+ *
* The value of the number is encoded as follows:
* <pre>
* Status Returns
- * No parallel 1
- * Optimal -CPU# (negative number of processors)
+ * No parallel 1
+ * Optimal -CPU# (negative number of processors)
* Specific >0 (positive number)
* Unlimited Builder.UNLIMITED_JOBS
* </pre>
@@ -2547,10 +2538,10 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
public int getParallelizationNumAttribute() {
if (!isParallelBuildOn())
return 1;
-
- if(parallelNumberAttribute == null){
- if(superClass != null){
- return ((Builder)superClass).getParallelizationNumAttribute();
+
+ if (parallelNumberAttribute == null) {
+ if (superClass != null) {
+ return ((Builder) superClass).getParallelizationNumAttribute();
}
return 1;
}
@@ -2574,7 +2565,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
/**
* {@inheritDoc}
- *
+ *
* @param jobs - maximum number of jobs. There are 2 special cases:
* <br>- any number <=0 is interpreted as setting "optimal" property,
* the value of the number itself is ignored in this case
@@ -2600,31 +2591,31 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public boolean supportsParallelBuild() {
- if(isInternalBuilder())
+ if (isInternalBuilder())
return true;
return getParrallelBuildCmd().length() != 0;
}
@Override
public boolean supportsStopOnError(boolean on) {
- if(isInternalBuilder())
+ if (isInternalBuilder())
return true;
-
- if(!on)
+
+ if (!on)
return getIgnoreErrCmdAttribute().length() != 0;
return true;
}
-
- public String getStopOnErrCmd(boolean stop){
- if(!stop)
+
+ public String getStopOnErrCmd(boolean stop) {
+ if (!stop)
return getIgnoreErrCmdAttribute();
return EMPTY_STRING;
}
-
- public String getIgnoreErrCmdAttribute(){
- if(ignoreErrCmd == null){
- if(superClass != null){
- return ((Builder)superClass).getIgnoreErrCmdAttribute();
+
+ public String getIgnoreErrCmdAttribute() {
+ if (ignoreErrCmd == null) {
+ if (superClass != null) {
+ return ((Builder) superClass).getIgnoreErrCmdAttribute();
}
return EMPTY_STRING;
}
@@ -2657,7 +2648,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
/**
* {@inheritDoc}
- *
+ *
* @param on - the flag to enable or disable parallel mode.
* <br>{@code true} to enable, in this case the maximum number of jobs
* will be set to "optimal" number, see {@link #getOptimalParallelJobNum()}.
@@ -2673,54 +2664,54 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
}
}
- public Set<String> contributeErrorParsers(Set<String> set){
- if(getErrorParserIds() != null){
- if(set == null)
+ public Set<String> contributeErrorParsers(Set<String> set) {
+ if (getErrorParserIds() != null) {
+ if (set == null)
set = new HashSet<String>();
-
+
String ids[] = getErrorParserList();
- if(ids.length != 0)
+ if (ids.length != 0)
set.addAll(Arrays.asList(ids));
}
return set;
}
- public void resetErrorParsers(){
+ public void resetErrorParsers() {
errorParserIds = null;
}
-
- void removeErrorParsers(Set<String> set){
+
+ void removeErrorParsers(Set<String> set) {
Set<String> oldSet = contributeErrorParsers(null);
if (oldSet == null)
oldSet = new HashSet<String>();
oldSet.removeAll(set);
setErrorParserList(oldSet.toArray(new String[oldSet.size()]));
}
-
+
public void setErrorParserList(String[] ids) {
- if (ids == null){
+ if (ids == null) {
errorParserIds = null;
- } else if(ids.length == 0){
+ } else if (ids.length == 0) {
errorParserIds = EMPTY_STRING;
} else {
StringBuilder buf = new StringBuilder();
buf.append(ids[0]);
- for(int i = 1; i < ids.length; i++){
+ for (int i = 1; i < ids.length; i++) {
buf.append(";").append(ids[i]); //$NON-NLS-1$
}
errorParserIds = buf.toString();
}
}
-
+
@Override
public boolean isSystemObject() {
- if(isTest)
+ if (isTest)
return true;
-
- if(getConvertToId().length() != 0)
+
+ if (getConvertToId().length() != 0)
return true;
-
- if(getParent() != null)
+
+ if (getParent() != null)
return getParent().isSystemObject();
return false;
}
@@ -2728,70 +2719,72 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public String getUniqueRealName() {
String name = getName();
- if(name == null){
+ if (name == null) {
name = getId();
} else {
String version = ManagedBuildManager.getVersionFromIdAndVersion(getId());
- if(version != null){
- StringBuilder buf = new StringBuilder();
- buf.append(name);
- buf.append(" (v").append(version).append(")"); //$NON-NLS-1$ //$NON-NLS-2$
- name = buf.toString();
+ if (version != null) {
+ StringBuilder buf = new StringBuilder();
+ buf.append(name);
+ buf.append(" (v").append(version).append(")"); //$NON-NLS-1$ //$NON-NLS-2$
+ name = buf.toString();
}
}
return name;
}
-
- public ICOutputEntry[] getOutputEntries(){
- if(isManagedBuildOn()){
+
+ public ICOutputEntry[] getOutputEntries() {
+ if (isManagedBuildOn()) {
return getDefaultOutputSettings();
}
ICOutputEntry[] entries = getOutputEntrySettings();
- if(entries == null || entries.length == 0){
+ if (entries == null || entries.length == 0) {
entries = getDefaultOutputSettings();
}
return entries;
}
-
- private ICOutputEntry[] getDefaultOutputSettings(){
- Configuration cfg = (Configuration)getConfguration();
- if(cfg == null || cfg.isPreference() || cfg.isExtensionElement()){
- return new ICOutputEntry[]{new COutputEntry(Path.EMPTY, null, ICLanguageSettingEntry.VALUE_WORKSPACE_PATH | ICLanguageSettingEntry.RESOLVED)};
+
+ private ICOutputEntry[] getDefaultOutputSettings() {
+ Configuration cfg = (Configuration) getConfguration();
+ if (cfg == null || cfg.isPreference() || cfg.isExtensionElement()) {
+ return new ICOutputEntry[] { new COutputEntry(Path.EMPTY, null,
+ ICLanguageSettingEntry.VALUE_WORKSPACE_PATH | ICLanguageSettingEntry.RESOLVED) };
}
-
+
IPath path = ManagedBuildManager.getBuildFullPath(cfg, this);
IProject proj = cfg.getOwner().getProject();
- IPath projFullPath = proj.getFullPath();
- if(path != null && projFullPath.isPrefixOf(path)){
+ IPath projFullPath = proj.getFullPath();
+ if (path != null && projFullPath.isPrefixOf(path)) {
path = path.removeFirstSegments(projFullPath.segmentCount()).makeRelative();
} else {
path = Path.EMPTY;
}
-
- return new ICOutputEntry[]{new COutputEntry(path, null, ICLanguageSettingEntry.VALUE_WORKSPACE_PATH | ICLanguageSettingEntry.RESOLVED)};
+
+ return new ICOutputEntry[] { new COutputEntry(path, null,
+ ICLanguageSettingEntry.VALUE_WORKSPACE_PATH | ICLanguageSettingEntry.RESOLVED) };
}
- public ICOutputEntry[] getOutputEntrySettings(){
- if(outputEntries == null){
- if(superClass != null){
- return ((Builder)superClass).getOutputEntrySettings();
+ public ICOutputEntry[] getOutputEntrySettings() {
+ if (outputEntries == null) {
+ if (superClass != null) {
+ return ((Builder) superClass).getOutputEntrySettings();
}
return null;
-
+
}
return outputEntries.clone();
}
- public void setOutputEntries(ICOutputEntry[] entries){
- if(entries != null)
+ public void setOutputEntries(ICOutputEntry[] entries) {
+ if (entries != null)
outputEntries = entries.clone();
else
outputEntries = null;
}
-
- private int getSuperClassNum(){
+
+ private int getSuperClassNum() {
int num = 0;
- for(IBuilder superTool = getSuperClass(); superTool != null; superTool = superTool.getSuperClass()){
+ for (IBuilder superTool = getSuperClass(); superTool != null; superTool = superTool.getSuperClass()) {
num++;
}
return num;
@@ -2799,30 +2792,30 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public int compareTo(Builder other) {
- if(other.isSystemObject() != isSystemObject())
+ if (other.isSystemObject() != isSystemObject())
return isSystemObject() ? 1 : -1;
-
+
return getSuperClassNum() - other.getSuperClassNum();
}
@Override
public IRealBuildObjectAssociation getExtensionObject() {
- return (Builder)ManagedBuildManager.getExtensionBuilder(this);
+ return (Builder) ManagedBuildManager.getExtensionBuilder(this);
}
@Override
public IRealBuildObjectAssociation[] getIdenticBuildObjects() {
- return (IRealBuildObjectAssociation[])ManagedBuildManager.findIdenticalBuilders(this);
+ return (IRealBuildObjectAssociation[]) ManagedBuildManager.findIdenticalBuilders(this);
}
@Override
public IRealBuildObjectAssociation getRealBuildObject() {
- return (Builder)ManagedBuildManager.getRealBuilder(this);
+ return (Builder) ManagedBuildManager.getRealBuilder(this);
}
@Override
public IRealBuildObjectAssociation getSuperClassObject() {
- return (Builder)getSuperClass();
+ return (Builder) getSuperClass();
}
@Override
@@ -2839,6 +2832,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
public boolean isExtensionBuildObject() {
return isExtensionElement();
}
+
@Override
public String toString() {
return getUniqueRealName();
@@ -2846,23 +2840,24 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
@Override
public ICommandLauncher getCommandLauncher() {
- if(fCommandLauncher != null)
+ if (fCommandLauncher != null)
return fCommandLauncher;
-
- if(fCommandLauncher == null && fCommandLauncherElement != null){
- try{
- fCommandLauncher = (ICommandLauncher)fCommandLauncherElement.createExecutableExtension(ATTRIBUTE_COMMAND_LAUNCHER);
+
+ if (fCommandLauncher == null && fCommandLauncherElement != null) {
+ try {
+ fCommandLauncher = (ICommandLauncher) fCommandLauncherElement
+ .createExecutableExtension(ATTRIBUTE_COMMAND_LAUNCHER);
return fCommandLauncher;
- }catch(CoreException e){
+ } catch (CoreException e) {
e.printStackTrace();
}
}
- if(fCommandLauncher == null && superClass != null)
+ if (fCommandLauncher == null && superClass != null)
return getSuperClass().getCommandLauncher();
-
- else if(fCommandLauncher == null) // catch all for backwards compatibility
+
+ else if (fCommandLauncher == null) // catch all for backwards compatibility
fCommandLauncher = CommandLauncherManager.getInstance().getCommandLauncher();
-
+
return fCommandLauncher;
}
@@ -2871,21 +2866,21 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
// Already defined
if (fBuildRunner != null)
return fBuildRunner;
-
+
// Instantiate from model
if (fBuildRunnerElement != null) {
- fBuildRunner = (AbstractBuildRunner)fBuildRunnerElement.createExecutableExtension(ATTRIBUTE_BUILD_RUNNER);
+ fBuildRunner = (AbstractBuildRunner) fBuildRunnerElement.createExecutableExtension(ATTRIBUTE_BUILD_RUNNER);
return fBuildRunner;
}
-
+
// Check with superClass
if (superClass != null)
return getSuperClass().getBuildRunner();
-
+
// Default internal or external builder
if (isInternalBuilder())
return new InternalBuildRunner();
-
+
return new ExternalBuildRunner();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuilderFactory.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuilderFactory.java
index 939fe92832d..65d7f4de7ff 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuilderFactory.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/BuilderFactory.java
@@ -41,7 +41,7 @@ import org.eclipse.core.runtime.Status;
public class BuilderFactory {
private static final String PREFIX = "org.eclipse.cdt.make.core"; //$NON-NLS-1$
-// private static final String PREFIX_WITH_DOT = PREFIX + '.'; //$NON-NLS-1$
+ // private static final String PREFIX_WITH_DOT = PREFIX + '.'; //$NON-NLS-1$
static final String BUILD_COMMAND = PREFIX + ".buildCommand"; //$NON-NLS-1$
static final String BUILD_LOCATION = PREFIX + ".buildLocation"; //$NON-NLS-1$
@@ -57,21 +57,21 @@ public class BuilderFactory {
static final String BUILD_AUTO_ENABLED = PREFIX + ".enableAutoBuild"; //$NON-NLS-1$
static final String BUILD_ARGUMENTS = PREFIX + ".buildArguments"; //$NON-NLS-1$
static final String ENVIRONMENT = PREFIX + ".environment"; //$NON-NLS-1$
- static final String BUILD_APPEND_ENVIRONMENT = PREFIX + ".append_environment"; //$NON-NLS-1$
+ static final String BUILD_APPEND_ENVIRONMENT = PREFIX + ".append_environment"; //$NON-NLS-1$
- static final String CONTENTS = PREFIX + ".contents"; //$NON-NLS-1$
- static final String CONTENTS_BUILDER = PREFIX + ".builder"; //$NON-NLS-1$
- static final String CONTENTS_BUILDER_CUSTOMIZATION = PREFIX + ".builderCustomization"; //$NON-NLS-1$
- static final String CONTENTS_CONFIGURATION_IDS = PREFIX + ".configurationIds"; //$NON-NLS-1$
+ static final String CONTENTS = PREFIX + ".contents"; //$NON-NLS-1$
+ static final String CONTENTS_BUILDER = PREFIX + ".builder"; //$NON-NLS-1$
+ static final String CONTENTS_BUILDER_CUSTOMIZATION = PREFIX + ".builderCustomization"; //$NON-NLS-1$
+ static final String CONTENTS_CONFIGURATION_IDS = PREFIX + ".configurationIds"; //$NON-NLS-1$
-// static final String IDS = PREFIX + ".ids"; //$NON-NLS-1$
+ // static final String IDS = PREFIX + ".ids"; //$NON-NLS-1$
static final String CONFIGURATION_IDS = PREFIX + ".configurationIds"; //$NON-NLS-1$
-
+
static final IBuilder[] EMPTY_BUILDERS_ARRAY = new IBuilder[0];
static final String[] EMPTY_STRING_ARRAY = new String[0];
static final IConfiguration[] EMPTY_CFG_ARAY = new IConfiguration[0];
- private static class BuildArgsStorageElement extends MapStorageElement{
+ private static class BuildArgsStorageElement extends MapStorageElement {
public BuildArgsStorageElement(Map<String, String> map, MapStorageElement parent) {
super(map, parent);
@@ -84,32 +84,32 @@ public class BuilderFactory {
@Override
public String getAttribute(String name) {
String value = super.getAttribute(name);
- if(value == null){
+ if (value == null) {
String keys[] = Builder.toBuildAttributes(name);
- for(int i = 0; i < keys.length; i++){
+ for (int i = 0; i < keys.length; i++) {
value = super.getAttribute(keys[i]);
- if(value != null)
+ if (value != null)
break;
}
}
return value;
}
-// protected String getMapKey(String name) {
-// if(name.indexOf('.') == -1)
-// return PREFIX_WITH_DOT + name;
-// return super.getMapKey(name);
-// }
+ // protected String getMapKey(String name) {
+ // if(name.indexOf('.') == -1)
+ // return PREFIX_WITH_DOT + name;
+ // return super.getMapKey(name);
+ // }
@Override
public void setAttribute(String name, String value) {
String[] names = Builder.toBuildAttributes(name);
- String attrName = names.length != 0 ? names[names.length - 1] : null;
+ String attrName = names.length != 0 ? names[names.length - 1] : null;
- if(attrName == null && BuilderFactory.USE_DEFAULT_BUILD_CMD.equals(name))
+ if (attrName == null && BuilderFactory.USE_DEFAULT_BUILD_CMD.equals(name))
attrName = BuilderFactory.USE_DEFAULT_BUILD_CMD;
-
- if(attrName != null)
+
+ if (attrName != null)
super.setAttribute(attrName, value);
}
@@ -124,82 +124,82 @@ public class BuilderFactory {
}
}
-/* public static IMakeBuilderInfo create(Preferences prefs, String builderID, boolean useDefaults) {
- return new BuildInfoPreference(prefs, builderID, useDefaults);
- }
+ /* public static IMakeBuilderInfo create(Preferences prefs, String builderID, boolean useDefaults) {
+ return new BuildInfoPreference(prefs, builderID, useDefaults);
+ }
- public static IMakeBuilderInfo create(IProject project, String builderID) throws CoreException {
- return new BuildInfoProject(project, builderID);
- }
+ public static IMakeBuilderInfo create(IProject project, String builderID) throws CoreException {
+ return new BuildInfoProject(project, builderID);
+ }
- public static IMakeBuilderInfo create(Map args, String builderID) {
- return new BuildInfoMap(args, builderID);
- }
- */
-/*
- private static IBuilder customizeBuilder(IBuilder builder, Map args){
- if(args.get(IBuilder.ID) == null){
- args = new HashMap(args);
- String id = builder.getSuperClass().getId();
- id = ManagedBuildManager.calculateChildId(id, null);
- args.put(IBuilder.ID, id);
+ public static IMakeBuilderInfo create(Map args, String builderID) {
+ return new BuildInfoMap(args, builderID);
}
- MapStorageElement el = new MapStorageElement(args, null);
-
- Builder builder = new Builder(builder.getParent(), )
-
-
- }
-*/
-
- public static Map<String, String> createBuildArgs(IConfiguration cfgs[], IBuilder builder){
+ */
+ /*
+ private static IBuilder customizeBuilder(IBuilder builder, Map args){
+ if(args.get(IBuilder.ID) == null){
+ args = new HashMap(args);
+ String id = builder.getSuperClass().getId();
+ id = ManagedBuildManager.calculateChildId(id, null);
+ args.put(IBuilder.ID, id);
+ }
+ MapStorageElement el = new MapStorageElement(args, null);
+
+ Builder builder = new Builder(builder.getParent(), )
+
+
+ }
+ */
+
+ public static Map<String, String> createBuildArgs(IConfiguration cfgs[], IBuilder builder) {
Map<String, String> map = builderToMap(builder);
cfgsToMap(cfgs, map);
map.put(CONTENTS, /*CONTENTS_BUILDER_CUSTOMIZATION*/CONTENTS_BUILDER);
return map;
}
- public static Map<String, String> createBuildArgs(IConfiguration cfgs[]){
+ public static Map<String, String> createBuildArgs(IConfiguration cfgs[]) {
Map<String, String> map = new HashMap<String, String>();
cfgsToMap(cfgs, map);
map.put(CONTENTS, CONTENTS_CONFIGURATION_IDS);
return map;
}
-
- private static Map<String, String> cfgIdsToMap(String ids[], Map<String, String> map){
+
+ private static Map<String, String> cfgIdsToMap(String ids[], Map<String, String> map) {
map.put(CONFIGURATION_IDS, MapStorageElement.encodeList(Arrays.asList(ids)));
return map;
}
-
- private static String[] cfgIdsFromMap(Map<String, String> map){
+
+ private static String[] cfgIdsFromMap(Map<String, String> map) {
String idsString = map.get(CONFIGURATION_IDS);
- if(idsString != null){
+ if (idsString != null) {
List<String> list = MapStorageElement.decodeList(idsString);
return list.toArray(new String[list.size()]);
}
return EMPTY_STRING_ARRAY;
}
-
- private static IConfiguration[] configsFromMap(Map<String, String> map, IManagedBuildInfo info){
+
+ private static IConfiguration[] configsFromMap(Map<String, String> map, IManagedBuildInfo info) {
String ids[] = cfgIdsFromMap(map);
- if(ids.length == 0){
+ if (ids.length == 0) {
IConfiguration cfg = info.getDefaultConfiguration();
- if(cfg != null)
- return new IConfiguration[]{cfg};
+ if (cfg != null)
+ return new IConfiguration[] { cfg };
return EMPTY_CFG_ARAY;
}
IManagedProject mProj = info.getManagedProject();
- if(mProj != null)
+ if (mProj != null)
return idsToConfigurations(ids, mProj.getConfigurations());
return EMPTY_CFG_ARAY;
}
-
- private static IConfiguration[] idsToConfigurations(String ids[], IConfiguration allCfgs[]){
+
+ private static IConfiguration[] idsToConfigurations(String ids[], IConfiguration allCfgs[]) {
List<IConfiguration> list = new ArrayList<IConfiguration>(ids.length);
- for(int i = 0; i < ids.length; i++){
+ for (int i = 0; i < ids.length; i++) {
String id = ids[i];
- for(int j = 0; j < allCfgs.length; j++){
- if(allCfgs[j].getId().equals(id)){
+ for (int j = 0; j < allCfgs.length; j++) {
+ if (allCfgs[j].getId().equals(id)) {
list.add(allCfgs[j]);
break;
}
@@ -208,106 +208,104 @@ public class BuilderFactory {
return list.toArray(new IConfiguration[list.size()]);
}
- private static Map<String, String> cfgsToMap(IConfiguration cfgs[], Map<String, String> map){
+ private static Map<String, String> cfgsToMap(IConfiguration cfgs[], Map<String, String> map) {
String ids[] = getCfgIds(cfgs);
return cfgIdsToMap(ids, map);
}
- private static String[] getCfgIds(IConfiguration cfgs[]){
+ private static String[] getCfgIds(IConfiguration cfgs[]) {
String ids[] = new String[cfgs.length];
- for(int i = 0; i < cfgs.length; i++){
+ for (int i = 0; i < cfgs.length; i++) {
ids[i] = cfgs[i].getId();
}
return ids;
}
-
- private static Map<String, String> builderToMap(IBuilder builder){
+
+ private static Map<String, String> builderToMap(IBuilder builder) {
MapStorageElement el = new MapStorageElement("", null); //$NON-NLS-1$
- ((Builder)builder).serialize(el, false);
-
+ ((Builder) builder).serialize(el, false);
+
return el.toStringMap();
}
- public static IBuilder createCustomBuilder(IConfiguration cfg, String builderId) throws CoreException{
+ public static IBuilder createCustomBuilder(IConfiguration cfg, String builderId) throws CoreException {
IBuilder builder = cfg.getBuilder();
- if(!builderId.equals(builder.getId())){
+ if (!builderId.equals(builder.getId())) {
builder = ManagedBuildManager.getExtensionBuilder(builderId);
}
-
- if(builder != null)
+
+ if (builder != null)
return createCustomBuilder(cfg, builder);
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
ManagedMakeMessages.getResourceString("BuilderFactory.1"), null)); //$NON-NLS-1$
}
- public static IBuilder createCustomBuilder(IConfiguration cfg, IBuilder base){
+ public static IBuilder createCustomBuilder(IConfiguration cfg, IBuilder base) {
String subId;
String subName = base.getName();
if (base.getSuperClass() != null) {
- subId = ManagedBuildManager.calculateChildId(
- base.getSuperClass().getId(),
- null);
+ subId = ManagedBuildManager.calculateChildId(base.getSuperClass().getId(), null);
} else {
- subId = ManagedBuildManager.calculateChildId(
- base.getId(),
- null);
+ subId = ManagedBuildManager.calculateChildId(base.getId(), null);
}
- return new Builder(cfg.getToolChain(), subId, subName, (Builder)base);
+ return new Builder(cfg.getToolChain(), subId, subName, (Builder) base);
}
-
- public static IBuilder createBuilderFromCommand(IConfiguration cfg, ICommand command){
+
+ public static IBuilder createBuilderFromCommand(IConfiguration cfg, ICommand command) {
Map<String, String> args = command.getArguments();
- if(!args.containsKey(IBuilder.ID)){
+ if (!args.containsKey(IBuilder.ID)) {
args.put(IBuilder.ID, ManagedBuildManager.calculateChildId(command.getBuilderName(), null));
}
-
+
//TODO: do we need a to check for the non-customization case ?
return createBuilder(cfg, args, cfg.getBuilder() != null);
}
-
- public static IBuilder createBuilderForEclipseBuilder(IConfiguration cfg, String eclipseBuilderID) throws CoreException {
+
+ public static IBuilder createBuilderForEclipseBuilder(IConfiguration cfg, String eclipseBuilderID)
+ throws CoreException {
IProject project = cfg.getOwner().getProject();
ICommand command = getBuildSpec(project.getDescription(), eclipseBuilderID);
if (command == null) {
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
- ManagedMakeMessages.getResourceString("BuildInfoFactory.Missing_Builder") + eclipseBuilderID, null)); //$NON-NLS-1$
+ ManagedMakeMessages.getResourceString("BuildInfoFactory.Missing_Builder") + eclipseBuilderID, //$NON-NLS-1$
+ null));
}
-
+
return createBuilderFromCommand(cfg, command);
-// Map args = command.getArguments();
-// if(!args.containsKey(IBuilder.ID)){
-// args.put(IBuilder.ID, ManagedBuildManager.calculateChildId(eclipseBuilderID, null));
-// }
-//
-// return createBuilder(cfg, args);
+ // Map args = command.getArguments();
+ // if(!args.containsKey(IBuilder.ID)){
+ // args.put(IBuilder.ID, ManagedBuildManager.calculateChildId(eclipseBuilderID, null));
+ // }
+ //
+ // return createBuilder(cfg, args);
}
-
+
/**
* Creates a new build-command containing data dynamically obtained from the Builder.
*/
public static ICommand createCommandFromBuilder(IBuilder builder) throws CoreException {
IProject project = builder.getParent().getParent().getOwner().getProject();
ICommand command = getBuildSpec(project.getDescription(), CommonBuilder.BUILDER_ID);
- if(command == null)
+ if (command == null)
return null;
- MapStorageElement el = new BuildArgsStorageElement("", null); //$NON-NLS-1$
- ((Builder)builder).serializeRawData(el);
-
+ MapStorageElement el = new BuildArgsStorageElement("", null); //$NON-NLS-1$
+ ((Builder) builder).serializeRawData(el);
+
// always set to false - the raw data will always explicitly contain the build-command
el.setAttribute(BuilderFactory.USE_DEFAULT_BUILD_CMD, Boolean.FALSE.toString());
-
+
command.setArguments(el.toStringMap());
command.setBuilding(IncrementalProjectBuilder.AUTO_BUILD, builder.isAutoBuildEnable());
command.setBuilding(IncrementalProjectBuilder.FULL_BUILD, builder.isFullBuildEnabled());
command.setBuilding(IncrementalProjectBuilder.INCREMENTAL_BUILD, builder.isIncrementalBuildEnabled());
command.setBuilding(IncrementalProjectBuilder.CLEAN_BUILD, builder.isCleanBuildEnabled());
-
+
return command;
}
-
+
public static ICommand getBuildSpec(IProjectDescription description, String builderID) {
ICommand[] commands = description.getBuildSpec();
for (int i = 0; i < commands.length; ++i) {
@@ -319,22 +317,22 @@ public class BuilderFactory {
}
@SuppressWarnings("deprecation")
- private static IBuilder createBuilder(IConfiguration cfg, Map<String, String> args, boolean customization){
+ private static IBuilder createBuilder(IConfiguration cfg, Map<String, String> args, boolean customization) {
IToolChain tCh = cfg.getToolChain();
IBuilder cfgBuilder = cfg.getEditableBuilder();
Builder builder;
- if(customization){
- builder = (Builder)createCustomBuilder(cfg, cfgBuilder);
+ if (customization) {
+ builder = (Builder) createCustomBuilder(cfg, cfgBuilder);
//adjusting settings
String tmp = args.get(ErrorParserManager.PREF_ERROR_PARSER);
- if(tmp != null && tmp.length() == 0)
+ if (tmp != null && tmp.length() == 0)
args.remove(ErrorParserManager.PREF_ERROR_PARSER);
-
+
tmp = args.get(USE_DEFAULT_BUILD_CMD);
- if(tmp != null){
- if(Boolean.valueOf(tmp).equals(Boolean.TRUE)){
+ if (tmp != null) {
+ if (Boolean.valueOf(tmp).equals(Boolean.TRUE)) {
args.remove(IMakeCommonBuildInfo.BUILD_COMMAND);
args.remove(IMakeCommonBuildInfo.BUILD_ARGUMENTS);
} else {
@@ -343,63 +341,63 @@ public class BuilderFactory {
}
}
//end adjusting settings
-
+
MapStorageElement el = new BuildArgsStorageElement(args, null);
builder.loadFromProject(el);
} else {
- if(args.get(IBuilder.ID) == null){
+ if (args.get(IBuilder.ID) == null) {
args.put(IBuilder.ID, ManagedBuildManager.calculateChildId(cfg.getId(), null));
}
MapStorageElement el = new BuildArgsStorageElement(args, null);
builder = new Builder(tCh, el, ManagedBuildManager.getVersion().toString());
}
-
+
return builder;
}
- public static IBuilder[] createBuilders(IProject project, Map<String, String> args){
+ public static IBuilder[] createBuilders(IProject project, Map<String, String> args) {
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
IBuilder[] builders = null;
- if(info != null){
- if(args == null){
+ if (info != null) {
+ if (args == null) {
IConfiguration cfg = info.getDefaultConfiguration();
IBuilder builder = cfg.getEditableBuilder();
- builders = new IBuilder[]{builder};
-
+ builders = new IBuilder[] { builder };
+
} else {
String type = args.get(CONTENTS);
- if(type == null || CONTENTS_BUILDER_CUSTOMIZATION.equals(type)){
+ if (type == null || CONTENTS_BUILDER_CUSTOMIZATION.equals(type)) {
IConfiguration cfg = info.getDefaultConfiguration();
IBuilder builder;
- if(args.size() == 0){
+ if (args.size() == 0) {
builder = cfg.getEditableBuilder();
} else {
builder = createBuilder(cfg, args, true);
}
- builders = new IBuilder[]{builder};
-
- } else if (CONTENTS_BUILDER.equals(type)){
+ builders = new IBuilder[] { builder };
+
+ } else if (CONTENTS_BUILDER.equals(type)) {
IConfiguration cfgs[] = configsFromMap(args, info);
- if(cfgs.length != 0){
+ if (cfgs.length != 0) {
List<IBuilder> list = new ArrayList<IBuilder>(cfgs.length);
- for(int i = 0; i < cfgs.length; i++){
+ for (int i = 0; i < cfgs.length; i++) {
IBuilder builder = createBuilder(cfgs[i], args, false);
- if(builder != null)
+ if (builder != null)
list.add(builder);
}
builders = list.toArray(new IBuilder[list.size()]);
}
- } else if (CONTENTS_CONFIGURATION_IDS.equals(type)){
+ } else if (CONTENTS_CONFIGURATION_IDS.equals(type)) {
IConfiguration cfgs[] = configsFromMap(args, info);
- if(cfgs.length != 0){
+ if (cfgs.length != 0) {
List<IBuilder> list = new ArrayList<IBuilder>(cfgs.length);
- for(int i = 0; i < cfgs.length; i++){
+ for (int i = 0; i < cfgs.length; i++) {
list.add(cfgs[i].getEditableBuilder());
}
builders = list.toArray(new IBuilder[list.size()]);
}
-
+
} else if ("org.eclipse.cdt.make.core.activeConfigSettings".equals(type)) { //$NON-NLS-1$
/* NOTE: Here, only for backwards-compatibility support, since bug 340219 was fixed.
* Existing projects will still be going through this execution path, but new
@@ -408,8 +406,8 @@ public class BuilderFactory {
*/
IConfiguration cfg = info.getDefaultConfiguration();
IBuilder builder = cfg.getEditableBuilder();
- builders = new IBuilder[]{builder};
-
+ builders = new IBuilder[] { builder };
+
} /*else if (CONTENTS_BUILDER_CUSTOMIZATION.equals(type)){
String idsString = (String)args.get(CONFIGURATION_IDS);
if(idsString != null){
@@ -428,51 +426,51 @@ public class BuilderFactory {
builders = (IBuilder[])list.toArray(new IBuilder[list.size()]);
}
}
- }*/
+ }*/
}
}
-
- if(builders != null)
+
+ if (builders != null)
return builders;
return EMPTY_BUILDERS_ARRAY;
}
- public static int applyBuilder(IProjectDescription eDes, IBuilder builder){
+ public static int applyBuilder(IProjectDescription eDes, IBuilder builder) {
return applyBuilder(eDes, CommonBuilder.BUILDER_ID, builder);
}
public static final int CMD_UNDEFINED = -1;
public static final int NO_CHANGES = 0;
public static final int CMD_CHANGED = 1;
-
- private static int applyBuilder(IProjectDescription eDes, String eBuilderId, IBuilder builder){
+
+ private static int applyBuilder(IProjectDescription eDes, String eBuilderId, IBuilder builder) {
ICommand cmd = ManagedCProjectNature.getBuildSpec(eDes, eBuilderId);
- if(cmd == null)
+ if (cmd == null)
return CMD_UNDEFINED;
-
- if(applyBuilder(cmd, builder)){
+
+ if (applyBuilder(cmd, builder)) {
ManagedCProjectNature.setBuildSpec(eDes, cmd);
- return CMD_CHANGED;
+ return CMD_CHANGED;
}
return NO_CHANGES;
}
-
+
private static boolean applyBuilder(ICommand cmd, IBuilder builder) {
boolean changesMade = false;
-
- if(cmd.isBuilding(IncrementalProjectBuilder.AUTO_BUILD) != builder.isAutoBuildEnable()) {
+
+ if (cmd.isBuilding(IncrementalProjectBuilder.AUTO_BUILD) != builder.isAutoBuildEnable()) {
cmd.setBuilding(IncrementalProjectBuilder.AUTO_BUILD, builder.isAutoBuildEnable());
changesMade = true;
}
- if(cmd.isBuilding(IncrementalProjectBuilder.FULL_BUILD) != builder.isFullBuildEnabled()) {
+ if (cmd.isBuilding(IncrementalProjectBuilder.FULL_BUILD) != builder.isFullBuildEnabled()) {
cmd.setBuilding(IncrementalProjectBuilder.FULL_BUILD, builder.isFullBuildEnabled());
changesMade = true;
}
- if(cmd.isBuilding(IncrementalProjectBuilder.INCREMENTAL_BUILD) != builder.isIncrementalBuildEnabled()) {
+ if (cmd.isBuilding(IncrementalProjectBuilder.INCREMENTAL_BUILD) != builder.isIncrementalBuildEnabled()) {
cmd.setBuilding(IncrementalProjectBuilder.INCREMENTAL_BUILD, builder.isIncrementalBuildEnabled());
changesMade = true;
}
- if(cmd.isBuilding(IncrementalProjectBuilder.CLEAN_BUILD) != builder.isCleanBuildEnabled()) {
+ if (cmd.isBuilding(IncrementalProjectBuilder.CLEAN_BUILD) != builder.isCleanBuildEnabled()) {
cmd.setBuilding(IncrementalProjectBuilder.CLEAN_BUILD, builder.isCleanBuildEnabled());
changesMade = true;
}
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 ae8c057c26b..dc69cbb60cd 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
@@ -84,10 +84,10 @@ import org.eclipse.core.runtime.jobs.Job;
public class CommonBuilder extends ACBuilder {
public final static String BUILDER_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".genmakebuilder"; //$NON-NLS-1$
- private static final String ERROR_HEADER = "GeneratedmakefileBuilder error ["; //$NON-NLS-1$
- private static final String NEWLINE = System.getProperty("line.separator"); //$NON-NLS-1$
- private static final String TRACE_FOOTER = "]: "; //$NON-NLS-1$
- private static final String TRACE_HEADER = "GeneratedmakefileBuilder trace ["; //$NON-NLS-1$
+ private static final String ERROR_HEADER = "GeneratedmakefileBuilder error ["; //$NON-NLS-1$
+ private static final String NEWLINE = System.getProperty("line.separator"); //$NON-NLS-1$
+ private static final String TRACE_FOOTER = "]: "; //$NON-NLS-1$
+ private static final String TRACE_HEADER = "GeneratedmakefileBuilder trace ["; //$NON-NLS-1$
public static boolean VERBOSE = false;
private static final int PROGRESS_MONITOR_SCALE = 100;
@@ -118,80 +118,82 @@ public class CommonBuilder extends ACBuilder {
private static class CfgBuildSet {
Map<IProject, Set<String>> fMap = new HashMap<IProject, Set<String>>();
- public Set<String> getCfgIdSet(IProject project, boolean create){
+ public Set<String> getCfgIdSet(IProject project, boolean create) {
Set<String> set = fMap.get(project);
- if(set == null && create){
+ if (set == null && create) {
set = new HashSet<String>();
fMap.put(project, set);
}
return set;
}
- public void start(CommonBuilder bld){
+ public void start(CommonBuilder bld) {
checkClean(bld);
}
- private boolean checkClean(CommonBuilder bld){
+ private boolean checkClean(CommonBuilder bld) {
IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
for (IProject wproject : projects) {
- if(bld.hasBeenBuilt(wproject)){
- if(VERBOSE)
- outputTrace(null, "checking clean: the project " + wproject.getName() +" was built, no clean needed"); //$NON-NLS-1$ //$NON-NLS-2$
+ if (bld.hasBeenBuilt(wproject)) {
+ if (VERBOSE)
+ outputTrace(null,
+ "checking clean: the project " + wproject.getName() + " was built, no clean needed"); //$NON-NLS-1$ //$NON-NLS-2$
return false;
}
}
- if(VERBOSE)
+ if (VERBOSE)
outputTrace(null, "checking clean: no projects were built.. cleanning"); //$NON-NLS-1$
fMap.clear();
return true;
}
}
+
private static class CfgBuildInfo {
private final IProject fProject;
private final IManagedBuildInfo fBuildInfo;
private final IConfiguration fCfg;
private final IBuilder fBuilder;
private IConsole fConsole;
- CfgBuildInfo(IBuilder builder, boolean isForegound){
+
+ CfgBuildInfo(IBuilder builder, boolean isForegound) {
this.fBuilder = builder;
this.fCfg = builder.getParent().getParent();
this.fProject = this.fCfg.getOwner().getProject();
this.fBuildInfo = ManagedBuildManager.getBuildInfo(this.fProject);
}
- public IProject getProject(){
+ public IProject getProject() {
return fProject;
}
- public IConsole getConsole(){
- if(fConsole == null){
+ public IConsole getConsole() {
+ if (fConsole == null) {
fConsole = CCorePlugin.getDefault().getConsole();
fConsole.start(fProject);
}
return fConsole;
}
-// public boolean isForeground(){
-// return fIsForeground;
-// }
+ // public boolean isForeground(){
+ // return fIsForeground;
+ // }
- public IBuilder getBuilder(){
+ public IBuilder getBuilder() {
return fBuilder;
}
- public IConfiguration getConfiguration(){
+ public IConfiguration getConfiguration() {
return fCfg;
}
- public IManagedBuildInfo getBuildInfo(){
+ public IManagedBuildInfo getBuildInfo() {
return fBuildInfo;
}
}
-
public class ResourceDeltaVisitor implements IResourceDeltaVisitor {
private String buildGoalName;
private final IProject project;
@@ -203,33 +205,27 @@ public class CommonBuilder extends ACBuilder {
public ResourceDeltaVisitor(IConfiguration cfg, IConfiguration allConfigs[]) {
this.project = cfg.getOwner().getProject();
buildPaths = new IPath[allConfigs.length];
- for(int i = 0; i < buildPaths.length; i++){
+ for (int i = 0; i < buildPaths.length; i++) {
buildPaths[i] = ManagedBuildManager.getBuildFullPath(allConfigs[i], allConfigs[i].getBuilder());
}
String ext = cfg.getArtifactExtension();
//try to resolve build macros in the build artifact extension
- try{
- ext = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
- ext,
- "", //$NON-NLS-1$
+ try {
+ ext = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(ext, "", //$NON-NLS-1$
" ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- cfg);
- } catch (BuildMacroException e){
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, cfg);
+ } catch (BuildMacroException e) {
}
String name = cfg.getArtifactName();
//try to resolve build macros in the build artifact name
- try{
- String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
- name,
- "", //$NON-NLS-1$
+ try {
+ String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(name, "", //$NON-NLS-1$
" ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- cfg);
- if((resolved = resolved.trim()).length() > 0)
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, cfg);
+ if ((resolved = resolved.trim()).length() > 0)
name = resolved;
- } catch (BuildMacroException e){
+ } catch (BuildMacroException e) {
}
if (ext.length() > 0) {
@@ -237,14 +233,14 @@ public class CommonBuilder extends ACBuilder {
} else {
buildGoalName = name;
}
- reservedNames = Arrays.asList(new String[]{".cdtbuild", ".cdtproject", ".project"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ reservedNames = Arrays.asList(new String[] { ".cdtbuild", ".cdtproject", ".project" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
private boolean isGeneratedResource(IResource resource) {
// Is this a generated directory ...
IPath path = resource.getFullPath();
for (IPath buildPath : buildPaths) {
- if(buildPath != null && buildPath.isPrefixOf(path)){
+ if (buildPath != null && buildPath.isPrefixOf(path)) {
return true;
}
}
@@ -268,16 +264,14 @@ public class CommonBuilder extends ACBuilder {
IResource resource = delta.getResource();
// If the project has changed, then a build is needed and we can stop
if (resource != null && resource.getProject() == project) {
- switch(resource.getType()){
+ switch (resource.getType()) {
case IResource.FILE:
String name = resource.getName();
if ((!name.equals(buildGoalName) &&
- // TODO: Also need to check for secondary outputs
- (resource.isDerived() ||
- (isProjectFile(resource)) ||
- (isGeneratedResource(resource))))) {
+ // TODO: Also need to check for secondary outputs
+ (resource.isDerived() || (isProjectFile(resource)) || (isGeneratedResource(resource))))) {
// The resource that changed has attributes which make it uninteresting,
- // so don't do anything
+ // so don't do anything
} else {
// TODO: Should we do extra checks here to determine if a build is really needed,
// or do you just do exclusion checks like above?
@@ -294,20 +288,20 @@ public class CommonBuilder extends ACBuilder {
//if (resourceName.equals(buildGoalName) ||
// (buildInfo.buildsFileType(ext) || buildInfo.isHeaderFile(ext))) {
- // We need to do an incremental build, at least
- incrBuildNeeded = true;
- if (delta.getKind() == IResourceDelta.REMOVED) {
- // If a meaningful resource was removed, then force a full build
- // This is required because an incremental build will trigger make to
- // do nothing for a missing source, since the state after the file
- // removal is uptodate, as far as make is concerned
- // A full build will clean, and ultimately trigger a relink without
- // the object generated from the deleted source, which is what we want
- fullBuildNeeded = true;
- // There is no point in checking anything else since we have
- // decided to do a full build anyway
- break;
- }
+ // We need to do an incremental build, at least
+ incrBuildNeeded = true;
+ if (delta.getKind() == IResourceDelta.REMOVED) {
+ // If a meaningful resource was removed, then force a full build
+ // This is required because an incremental build will trigger make to
+ // do nothing for a missing source, since the state after the file
+ // removal is uptodate, as far as make is concerned
+ // A full build will clean, and ultimately trigger a relink without
+ // the object generated from the deleted source, which is what we want
+ fullBuildNeeded = true;
+ // There is no point in checking anything else since we have
+ // decided to do a full build anyway
+ break;
+ }
//}
}
@@ -321,36 +315,35 @@ public class CommonBuilder extends ACBuilder {
private static class OtherConfigVerifier implements IResourceDeltaVisitor {
IPath buildFullPaths[];
-// IConfiguration buildConfigs[];
+ // IConfiguration buildConfigs[];
Configuration otherConfigs[];
int resourceChangeState;
- private static final IPath[] ignoreList = {
- new Path(".cdtproject"), //$NON-NLS-1$
- new Path(".cproject"), //$NON-NLS-1$
- new Path(".cdtbuild"), //$NON-NLS-1$
- new Path(".settings"), //$NON-NLS-1$
+ private static final IPath[] ignoreList = { new Path(".cdtproject"), //$NON-NLS-1$
+ new Path(".cproject"), //$NON-NLS-1$
+ new Path(".cdtbuild"), //$NON-NLS-1$
+ new Path(".settings"), //$NON-NLS-1$
};
- OtherConfigVerifier(IBuilder builders[], IConfiguration allCfgs[]){
+ OtherConfigVerifier(IBuilder builders[], IConfiguration allCfgs[]) {
Set<IConfiguration> buildCfgSet = new HashSet<IConfiguration>();
for (IBuilder builder : builders) {
buildCfgSet.add(builder.getParent().getParent());
}
@SuppressWarnings("unchecked")
List<Configuration> othersList = ListComparator.getAdded(allCfgs, buildCfgSet.toArray());
- if(othersList != null)
+ if (othersList != null)
otherConfigs = othersList.toArray(new Configuration[othersList.size()]);
else
otherConfigs = new Configuration[0];
List<IPath> list = new ArrayList<IPath>(builders.length);
-// buildFullPaths = new IPath[builders.length];
+ // buildFullPaths = new IPath[builders.length];
for (IBuilder builder : builders) {
IPath path = ManagedBuildManager.getBuildFullPath(builder.getParent().getParent(), builder);
- if(path != null)
+ if (path != null)
list.add(path);
-// buildFullPaths[i] = ManagedBuildManager.getBuildFullPath(builders[i].getParent().getParent(), builders[i]);
+ // buildFullPaths[i] = ManagedBuildManager.getBuildFullPath(builders[i].getParent().getParent(), builders[i]);
}
buildFullPaths = list.toArray(new IPath[list.size()]);
@@ -360,23 +353,23 @@ public class CommonBuilder extends ACBuilder {
public boolean visit(IResourceDelta delta) throws CoreException {
IResource rc = delta.getResource();
- if(rc.getType() == IResource.FILE){
- if(isResourceValuable(rc))
+ if (rc.getType() == IResource.FILE) {
+ if (isResourceValuable(rc))
resourceChangeState |= delta.getKind();
return false;
}
- if(!isResourceValuable(rc))
+ if (!isResourceValuable(rc))
return false;
for (IPath buildFullPath : buildFullPaths) {
- if(buildFullPath.isPrefixOf(rc.getFullPath()))
+ if (buildFullPath.isPrefixOf(rc.getFullPath()))
return false;
}
return true;
}
- public void updateOtherConfigs(IResourceDelta delta){
- if(delta == null)
+ public void updateOtherConfigs(IResourceDelta delta) {
+ if (delta == null)
resourceChangeState = ~0;
else {
try {
@@ -389,48 +382,50 @@ public class CommonBuilder extends ACBuilder {
setResourceChangeStateForOtherConfigs();
}
- private void setResourceChangeStateForOtherConfigs(){
+ private void setResourceChangeStateForOtherConfigs() {
for (Configuration otherConfig : otherConfigs) {
otherConfig.addResourceChangeState(resourceChangeState);
}
}
- private boolean isResourceValuable(IResource rc){
+ private boolean isResourceValuable(IResource rc) {
IPath path = rc.getProjectRelativePath();
for (IPath ignoredPath : ignoreList) {
- if(ignoredPath.equals(path))
+ if (ignoredPath.equals(path))
return false;
}
return true;
}
}
- protected boolean isCdtProjectCreated(IProject project){
+ protected boolean isCdtProjectCreated(IProject project) {
ICProjectDescription des = CoreModel.getDefault().getProjectDescription(project, false);
return des != null && !des.isCdtProjectCreating();
}
private class MyBoolean {
- private boolean value;
+ private boolean value;
- public MyBoolean (boolean value) {
- this.value = value;
- }
+ public MyBoolean(boolean value) {
+ this.value = value;
+ }
- public boolean getValue() {
- return value;
- }
+ public boolean getValue() {
+ return value;
+ }
- public void setValue(boolean value) {
- this.value = value;
- }
+ public void setValue(boolean value) {
+ this.value = value;
+ }
}
+
/**
* @see IncrementalProjectBuilder#build
*/
@Override
- protected IProject[] build(int kind, @SuppressWarnings("rawtypes") Map argsMap, IProgressMonitor monitor) throws CoreException {
+ protected IProject[] build(int kind, @SuppressWarnings("rawtypes") Map argsMap, IProgressMonitor monitor)
+ throws CoreException {
@SuppressWarnings("unchecked")
Map<String, String> args = argsMap;
if (DEBUG_EVENTS)
@@ -440,10 +435,10 @@ public class CommonBuilder extends ACBuilder {
IProject project = getProject();
- if(!isCdtProjectCreated(project))
+ if (!isCdtProjectCreated(project))
return project.getReferencedProjects();
- if(VERBOSE)
+ if (VERBOSE)
outputTrace(project.getName(), ">>build requested, type = " + kind); //$NON-NLS-1$
IProject[] projects = null;
@@ -462,93 +457,100 @@ public class CommonBuilder extends ACBuilder {
projects = build(kind, project, builders, true, monitor, new MyBoolean(false));
}
- if(VERBOSE)
+ if (VERBOSE)
outputTrace(project.getName(), "<<done build requested, type = " + kind); //$NON-NLS-1$
return projects;
}
- protected IProject[] build(int kind, IProject project, IBuilder[] builders, boolean isForeground, IProgressMonitor monitor) throws CoreException{
+ protected IProject[] build(int kind, IProject project, IBuilder[] builders, boolean isForeground,
+ IProgressMonitor monitor) throws CoreException {
return build(kind, project, builders, isForeground, monitor, new MyBoolean(false));
}
- private IProject[] build(int kind, IProject project, IBuilder[] builders, boolean isForeground, IProgressMonitor monitor, MyBoolean isBuild) throws CoreException{
- if(!isCdtProjectCreated(project))
+ private IProject[] build(int kind, IProject project, IBuilder[] builders, boolean isForeground,
+ IProgressMonitor monitor, MyBoolean isBuild) throws CoreException {
+ if (!isCdtProjectCreated(project))
return project.getReferencedProjects();
int num = builders.length;
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
IConfiguration activeCfg = info.getDefaultConfiguration();
IProject[] refProjects = project.getReferencedProjects();
- if(num != 0){
+ if (num != 0) {
MultiStatus status = checkBuilders(builders, activeCfg);
- if(status.getSeverity() != IStatus.OK)
+ if (status.getSeverity() != IStatus.OK)
throw new CoreException(status);
IConfiguration rcfgs[] = getReferencedConfigs(builders);
monitor.beginTask("", num + rcfgs.length); //$NON-NLS-1$
- if(rcfgs.length != 0){
+ if (rcfgs.length != 0) {
Set<IProject> set = buildReferencedConfigs(rcfgs, new SubProgressMonitor(monitor, 1), isBuild);// = getProjectsSet(cfgs);
- if(set.size() != 0){
+ if (set.size() != 0) {
set.addAll(Arrays.asList(refProjects));
refProjects = set.toArray(new IProject[set.size()]);
}
}
- for(int i = 0; i < num; i++){
- //bug 219337
- if (kind == INCREMENTAL_BUILD || kind == AUTO_BUILD ) {
- if (buildConfigResourceChanges()) { //only build projects with project resource changes
- IResourceDelta delta = getDelta(project);
- if (delta != null && delta.getAffectedChildren().length > 0) { //project resource has changed within Eclipse, need to build this configuration
- isBuild.setValue(true);
- build(kind, new CfgBuildInfo(builders[i], isForeground), new SubProgressMonitor(monitor, 1));
- }
- else if (isBuild.getValue()) { //one of its dependencies have rebuilt, need to rebuild this configuration
- build(kind, new CfgBuildInfo(builders[i], isForeground), new SubProgressMonitor(monitor, 1));
- }
- } else { //the default behaviour: 'make' is invoked on all configurations and incremental build is handled by 'make'
- build(kind, new CfgBuildInfo(builders[i], isForeground), new SubProgressMonitor(monitor, 1));
- }
- } else { //FULL_BUILD or CLEAN
- build(kind, new CfgBuildInfo(builders[i], isForeground), new SubProgressMonitor(monitor, 1));
- }
+ for (int i = 0; i < num; i++) {
+ //bug 219337
+ if (kind == INCREMENTAL_BUILD || kind == AUTO_BUILD) {
+ if (buildConfigResourceChanges()) { //only build projects with project resource changes
+ IResourceDelta delta = getDelta(project);
+ if (delta != null && delta.getAffectedChildren().length > 0) { //project resource has changed within Eclipse, need to build this configuration
+ isBuild.setValue(true);
+ build(kind, new CfgBuildInfo(builders[i], isForeground),
+ new SubProgressMonitor(monitor, 1));
+ } else if (isBuild.getValue()) { //one of its dependencies have rebuilt, need to rebuild this configuration
+ build(kind, new CfgBuildInfo(builders[i], isForeground),
+ new SubProgressMonitor(monitor, 1));
+ }
+ } else { //the default behaviour: 'make' is invoked on all configurations and incremental build is handled by 'make'
+ build(kind, new CfgBuildInfo(builders[i], isForeground), new SubProgressMonitor(monitor, 1));
+ }
+ } else { //FULL_BUILD or CLEAN
+ build(kind, new CfgBuildInfo(builders[i], isForeground), new SubProgressMonitor(monitor, 1));
+ }
}
}
- if(isForeground)
+ if (isForeground)
updateOtherConfigs(info, builders, kind);
monitor.done();
return refProjects;
}
- private Set<IProject> buildReferencedConfigs(IConfiguration[] cfgs, IProgressMonitor monitor, MyBoolean refConfigChanged){
+ private Set<IProject> buildReferencedConfigs(IConfiguration[] cfgs, IProgressMonitor monitor,
+ MyBoolean refConfigChanged) {
Set<IProject> projSet = getProjectsSet(cfgs);
cfgs = filterConfigsToBuild(cfgs);
MyBoolean nextConfigChanged = new MyBoolean(false);
- if(cfgs.length != 0){
+ if (cfgs.length != 0) {
monitor.beginTask(ManagedMakeMessages.getResourceString("CommonBuilder.22"), cfgs.length); //$NON-NLS-1$
for (IConfiguration cfg : cfgs) {
IProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1);
nextConfigChanged.setValue(false);
try {
IBuilder builder = cfg.getEditableBuilder();
-// CfgBuildInfo bInfo = new CfgBuildInfo(builder, false);
+ // CfgBuildInfo bInfo = new CfgBuildInfo(builder, false);
- if(VERBOSE)
- outputTrace(cfg.getOwner().getProject().getName(), ">>>>building reference cfg " + cfg.getName()); //$NON-NLS-1$
+ if (VERBOSE)
+ outputTrace(cfg.getOwner().getProject().getName(),
+ ">>>>building reference cfg " + cfg.getName()); //$NON-NLS-1$
- IProject[] projs = build(INCREMENTAL_BUILD, cfg.getOwner().getProject(), new IBuilder[]{builder}, false, subMonitor, nextConfigChanged);
+ IProject[] projs = build(INCREMENTAL_BUILD, cfg.getOwner().getProject(), new IBuilder[] { builder },
+ false, subMonitor, nextConfigChanged);
- if(VERBOSE)
- outputTrace(cfg.getOwner().getProject().getName(), "<<<<done building reference cfg " + cfg.getName()); //$NON-NLS-1$
+ if (VERBOSE)
+ outputTrace(cfg.getOwner().getProject().getName(),
+ "<<<<done building reference cfg " + cfg.getName()); //$NON-NLS-1$
projSet.addAll(Arrays.asList(projs));
- } catch (CoreException e){
+ } catch (CoreException e) {
ManagedBuilderCorePlugin.log(e);
} finally {
subMonitor.done();
@@ -562,34 +564,35 @@ public class CommonBuilder extends ACBuilder {
return projSet;
}
- private IConfiguration[] filterConfigsToBuild(IConfiguration[] cfgs){
+ private IConfiguration[] filterConfigsToBuild(IConfiguration[] cfgs) {
List<IConfiguration> cfgList = new ArrayList<IConfiguration>(cfgs.length);
for (IConfiguration cfg : cfgs) {
IProject project = cfg.getOwner().getProject();
Set<String> set = fBuildSet.getCfgIdSet(project, true);
- if(set.add(cfg.getId())){
- if(VERBOSE){
- outputTrace(cfg.getOwner().getProject().getName(), "set: adding cfg " + cfg.getName() + " ( id=" + cfg.getId() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- outputTrace(cfg.getOwner().getProject().getName(), "filtering regs: adding cfg " + cfg.getName() + " ( id=" + cfg.getId() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ if (set.add(cfg.getId())) {
+ if (VERBOSE) {
+ outputTrace(cfg.getOwner().getProject().getName(),
+ "set: adding cfg " + cfg.getName() + " ( id=" + cfg.getId() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ outputTrace(cfg.getOwner().getProject().getName(),
+ "filtering regs: adding cfg " + cfg.getName() + " ( id=" + cfg.getId() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
cfgList.add(cfg);
- } else if(VERBOSE)
- outputTrace(cfg.getOwner().getProject().getName(), "filtering regs: excluding cfg " + cfg.getName() + " ( id=" + cfg.getId() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ } else if (VERBOSE)
+ outputTrace(cfg.getOwner().getProject().getName(),
+ "filtering regs: excluding cfg " + cfg.getName() + " ( id=" + cfg.getId() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return cfgList.toArray(new IConfiguration[cfgList.size()]);
}
-
-
@Override
protected void startupOnInitialize() {
super.startupOnInitialize();
}
- private IConfiguration[] getReferencedConfigs(IBuilder[] builders){
+ private IConfiguration[] getReferencedConfigs(IBuilder[] builders) {
Set<IConfiguration> set = new HashSet<IConfiguration>();
for (IBuilder builder : builders) {
IConfiguration cfg = builder.getParent().getParent();
@@ -601,8 +604,8 @@ public class CommonBuilder extends ACBuilder {
return set.toArray(new Configuration[set.size()]);
}
- private Set<IProject> getProjectsSet(IConfiguration[] cfgs){
- if(cfgs.length == 0)
+ private Set<IProject> getProjectsSet(IConfiguration[] cfgs) {
+ if (cfgs.length == 0)
return new HashSet<IProject>(0);
Set<IProject> set = new HashSet<IProject>();
@@ -613,42 +616,29 @@ public class CommonBuilder extends ACBuilder {
return set;
}
- protected MultiStatus checkBuilders(IBuilder builders[], IConfiguration activeCfg){
+ protected MultiStatus checkBuilders(IBuilder builders[], IConfiguration activeCfg) {
MultiStatus status = null;
for (IBuilder builder : builders) {
boolean supportsCustomization = builder.supportsCustomizedBuild();
boolean isManagedBuildOn = builder.isManagedBuildOn();
- if(isManagedBuildOn && !supportsCustomization){
- if(builder.isCustomBuilder()){
- if(status == null){
- status = new MultiStatus(
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
- IStatus.ERROR,
- "", //$NON-NLS-1$
+ if (isManagedBuildOn && !supportsCustomization) {
+ if (builder.isCustomBuilder()) {
+ if (status == null) {
+ status = new MultiStatus(ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.ERROR, "", //$NON-NLS-1$
null);
}
- status.add(new Status (
- IStatus.ERROR,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
- 0,
+ status.add(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), 0,
ManagedMakeMessages.getResourceString("CommonBuilder.1"), //$NON-NLS-1$
null));
- }
- else if(builder.getParent().getParent() != activeCfg){
- if(status == null){
- status = new MultiStatus(
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
- IStatus.ERROR,
- "", //$NON-NLS-1$
+ } else if (builder.getParent().getParent() != activeCfg) {
+ if (status == null) {
+ status = new MultiStatus(ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.ERROR, "", //$NON-NLS-1$
null);
}
- status.add(new Status (
- IStatus.ERROR,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
- 0,
+ status.add(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), 0,
ManagedMakeMessages.getResourceString("CommonBuilder.2"), //$NON-NLS-1$
null));
@@ -656,20 +646,18 @@ public class CommonBuilder extends ACBuilder {
}
}
- if(status == null){
- status = new MultiStatus(
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
- IStatus.OK,
- "", //$NON-NLS-1$
+ if (status == null) {
+ status = new MultiStatus(ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.OK, "", //$NON-NLS-1$
null);
}
return status;
}
- private void updateOtherConfigs(IManagedBuildInfo info, IBuilder builders[], int buildKind){
+ private void updateOtherConfigs(IManagedBuildInfo info, IBuilder builders[], int buildKind) {
IConfiguration allCfgs[] = info.getManagedProject().getConfigurations();
- new OtherConfigVerifier(builders, allCfgs).updateOtherConfigs(buildKind == FULL_BUILD ? null : getDelta(info.getManagedProject().getOwner().getProject()));
+ new OtherConfigVerifier(builders, allCfgs).updateOtherConfigs(
+ buildKind == FULL_BUILD ? null : getDelta(info.getManagedProject().getOwner().getProject()));
}
protected class BuildStatus {
@@ -679,124 +667,117 @@ public class CommonBuilder extends ACBuilder {
private final List<String> fConsoleMessages = new ArrayList<String>();
private IManagedBuilderMakefileGenerator fMakeGen;
- public BuildStatus(IBuilder builder){
+ public BuildStatus(IBuilder builder) {
fManagedBuildOn = builder.isManagedBuildOn();
}
- public void setRebuild(){
+ public void setRebuild() {
fRebuild = true;
}
- public boolean isRebuild(){
+ public boolean isRebuild() {
return fRebuild;
}
- public boolean isManagedBuildOn(){
+ public boolean isManagedBuildOn() {
return fManagedBuildOn;
}
- public boolean isBuild(){
+ public boolean isBuild() {
return fBuild;
}
- public void cancelBuild(){
+ public void cancelBuild() {
fBuild = false;
}
- public List<String> getConsoleMessagesList(){
+ public List<String> getConsoleMessagesList() {
return fConsoleMessages;
}
- public IManagedBuilderMakefileGenerator getMakeGen(){
+ public IManagedBuilderMakefileGenerator getMakeGen() {
return fMakeGen;
}
- public void setMakeGen(IManagedBuilderMakefileGenerator makeGen){
+ public void setMakeGen(IManagedBuilderMakefileGenerator makeGen) {
fMakeGen = makeGen;
}
}
- protected void build(int kind, CfgBuildInfo bInfo, IProgressMonitor monitor) throws CoreException{
- if(VERBOSE)
- outputTrace(bInfo.getProject().getName(), "building cfg " + bInfo.getConfiguration().getName() + " with builder " + bInfo.getBuilder().getName()); //$NON-NLS-1$ //$NON-NLS-2$
+ protected void build(int kind, CfgBuildInfo bInfo, IProgressMonitor monitor) throws CoreException {
+ if (VERBOSE)
+ outputTrace(bInfo.getProject().getName(), "building cfg " + bInfo.getConfiguration().getName() //$NON-NLS-1$
+ + " with builder " + bInfo.getBuilder().getName()); //$NON-NLS-1$
IBuilder builder = bInfo.getBuilder();
BuildStatus status = new BuildStatus(builder);
if (!shouldBuild(kind, builder)) {
return;
}
-// if (kind == IncrementalProjectBuilder.AUTO_BUILD) {
-// IResourceDelta delta = getDelta(getProject());
-// if (delta != null) {
-// IResource res = delta.getResource();
-// if (res != null) {
-// bPerformBuild = res.getProject().equals(getProject());
-// }
-// } else {
-// bPerformBuild = false;
-// }
-// }
+ // if (kind == IncrementalProjectBuilder.AUTO_BUILD) {
+ // IResourceDelta delta = getDelta(getProject());
+ // if (delta != null) {
+ // IResource res = delta.getResource();
+ // if (res != null) {
+ // bPerformBuild = res.getProject().equals(getProject());
+ // }
+ // } else {
+ // bPerformBuild = false;
+ // }
+ // }
if (status.isBuild()) {
IConfiguration cfg = bInfo.getConfiguration();
- if(!builder.isCustomBuilder()){
+ if (!builder.isCustomBuilder()) {
Set<String> set = fBuildSet.getCfgIdSet(bInfo.getProject(), true);
- if(VERBOSE)
- outputTrace(bInfo.getProject().getName(), "set: adding cfg " + cfg.getName() + " ( id=" + cfg.getId() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ if (VERBOSE)
+ outputTrace(bInfo.getProject().getName(),
+ "set: adding cfg " + cfg.getName() + " ( id=" + cfg.getId() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
set.add(cfg.getId());
}
- if(status.isManagedBuildOn()){
+ if (status.isManagedBuildOn()) {
status = performPrebuildGeneration(kind, bInfo, status, monitor);
}
- if(status.isBuild()){
+ if (status.isBuild()) {
try {
- boolean isClean = builder.getBuildRunner().invokeBuild(
- kind,
- bInfo.getProject(),
- bInfo.getConfiguration(),
- builder,
- bInfo.getConsole(),
- this,
- this,
- monitor);
+ boolean isClean = builder.getBuildRunner().invokeBuild(kind, bInfo.getProject(),
+ bInfo.getConfiguration(), builder, bInfo.getConsole(), this, this, monitor);
if (isClean) {
forgetLastBuiltState();
cfg.setRebuildState(true);
} else {
- if(status.isManagedBuildOn()){
+ if (status.isManagedBuildOn()) {
performPostbuildGeneration(kind, bInfo, status, monitor);
}
cfg.setRebuildState(false);
}
- } catch(CoreException e){
+ } catch (CoreException e) {
cfg.setRebuildState(true);
throw e;
}
PropertyManager.getInstance().serialize(cfg);
- } else if(status.getConsoleMessagesList().size() != 0) {
+ } else if (status.getConsoleMessagesList().size() != 0) {
emitMessage(bInfo, concatMessages(status.getConsoleMessagesList()));
}
}
checkCancel(monitor);
}
-
-
- private String concatMessages(List<String> msgs){
+ private String concatMessages(List<String> msgs) {
int size = msgs.size();
- if(size == 0){
+ if (size == 0) {
return ""; //$NON-NLS-1$
- } else if(size == 1){
+ } else if (size == 1) {
return msgs.get(0);
}
StringBuilder buf = new StringBuilder();
buf.append(msgs.get(0));
- for(int i = 1; i < size; i++){
+ for (int i = 1; i < size; i++) {
buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
buf.append(msgs.get(i));
}
@@ -818,16 +799,16 @@ public class CommonBuilder extends ACBuilder {
consoleHeader[0] = ManagedMakeMessages.getResourceString("ManagedMakeBuider.type.incremental"); //$NON-NLS-1$
} else {
consoleHeader[0] = ""; //$NON-NLS-1$
- outputError(projName, "The given build type is not supported in this context"); //$NON-NLS-1$
+ outputError(projName, "The given build type is not supported in this context"); //$NON-NLS-1$
}
consoleHeader[1] = configName;
consoleHeader[2] = projName;
- buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
buf.append(ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.console.header", consoleHeader)); //$NON-NLS-1$
- buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
- buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
buf.append(status.getMessage());
- buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$//$NON-NLS-2$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$//$NON-NLS-2$
return buf.toString();
}
@@ -842,18 +823,19 @@ public class CommonBuilder extends ACBuilder {
} catch (CoreException e) {
// Throw the exception back to the builder
throw e;
- } catch (IOException io) { // Ignore console failures...
+ } catch (IOException io) { // Ignore console failures...
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
io.getLocalizedMessage(), io));
}
}
- protected BuildStatus performPostbuildGeneration(int kind, CfgBuildInfo bInfo, BuildStatus buildStatus, IProgressMonitor monitor) throws CoreException{
+ protected BuildStatus performPostbuildGeneration(int kind, CfgBuildInfo bInfo, BuildStatus buildStatus,
+ IProgressMonitor monitor) throws CoreException {
IBuilder builder = bInfo.getBuilder();
- if(builder.isInternalBuilder())
+ if (builder.isInternalBuilder())
return buildStatus;
- if(buildStatus.isRebuild()){
+ if (buildStatus.isRebuild()) {
buildStatus.getMakeGen().regenerateDependencies(false);
} else {
buildStatus.getMakeGen().generateDependencies();
@@ -862,14 +844,15 @@ public class CommonBuilder extends ACBuilder {
return buildStatus;
}
- protected BuildStatus performPrebuildGeneration(int kind, CfgBuildInfo bInfo, BuildStatus buildStatus, IProgressMonitor monitor) throws CoreException{
+ protected BuildStatus performPrebuildGeneration(int kind, CfgBuildInfo bInfo, BuildStatus buildStatus,
+ IProgressMonitor monitor) throws CoreException {
IBuilder builder = bInfo.getBuilder();
- if(builder.isInternalBuilder())
+ if (builder.isInternalBuilder())
return buildStatus;
buildStatus = performCleanning(kind, bInfo, buildStatus, monitor);
IManagedBuilderMakefileGenerator generator = builder.getBuildFileGenerator();
- if(generator != null){
+ if (generator != null) {
initializeGenerator(generator, kind, bInfo, monitor);
buildStatus.setMakeGen(generator);
@@ -879,31 +862,31 @@ public class CommonBuilder extends ACBuilder {
for (int index = 0; index < kids.length; ++index) {
// One possibility is that there is nothing to build
IStatus status = kids[index];
-// if(messages == null){
-// messages = new MultiStatus(
-// ManagedBuilderCorePlugin.getUniqueIdentifier(),
-// IStatus.INFO,
-// "",
-// null);
-//
-// }
+ // if(messages == null){
+ // messages = new MultiStatus(
+ // ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ // IStatus.INFO,
+ // "",
+ // null);
+ //
+ // }
if (status.getCode() == IManagedBuilderMakefileGenerator.NO_SOURCE_FOLDERS) {
-// performBuild = false;
+ // performBuild = false;
buildStatus.getConsoleMessagesList().add(createNoSourceMessage(kind, status, bInfo));
buildStatus.cancelBuild();
-// break;
+ // break;
} else {
// Stick this in the list of stuff to warn the user about
- //TODO: messages.add(status);
+ //TODO: messages.add(status);
}
}
- } else if (result.getCode() == IStatus.ERROR){
+ } else if (result.getCode() == IStatus.ERROR) {
StringBuilder buf = new StringBuilder();
buf.append(ManagedMakeMessages.getString("CommonBuilder.23")).append(NEWLINE); //$NON-NLS-1$
String message = result.getMessage();
- if(message != null && message.length() != 0){
+ if (message != null && message.length() != 0) {
buf.append(message).append(NEWLINE);
}
@@ -915,33 +898,32 @@ public class CommonBuilder extends ACBuilder {
checkCancel(monitor);
-
-
-// if(result.getSeverity() != IStatus.OK)
-// throw new CoreException(result);
- } else {
+ // if(result.getSeverity() != IStatus.OK)
+ // throw new CoreException(result);
+ } else {
buildStatus.cancelBuild();
}
-// if(messages == null){
-// messages = createMultiStatus(IStatus.OK);
-// }
+ // if(messages == null){
+ // messages = createMultiStatus(IStatus.OK);
+ // }
return buildStatus;
}
- protected BuildStatus performCleanning(int kind, CfgBuildInfo bInfo, BuildStatus status, IProgressMonitor monitor) throws CoreException{
+ protected BuildStatus performCleanning(int kind, CfgBuildInfo bInfo, BuildStatus status, IProgressMonitor monitor)
+ throws CoreException {
IConfiguration cfg = bInfo.getConfiguration();
IProject curProject = bInfo.getProject();
-// IBuilder builder = bInfo.getBuilder();
+ // IBuilder builder = bInfo.getBuilder();
boolean makefileRegenerationNeeded = false;
//perform necessary cleaning and build type calculation
- if(cfg.needsFullRebuild()){
+ if (cfg.needsFullRebuild()) {
//configuration rebuild state is set to true,
//full rebuild is needed in any case
//clean first, then make a full build
- outputTrace(curProject.getName(), "config rebuild state is set to true, making a full rebuild"); //$NON-NLS-1$
+ outputTrace(curProject.getName(), "config rebuild state is set to true, making a full rebuild"); //$NON-NLS-1$
clean(bInfo, new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN));
makefileRegenerationNeeded = true;
} else {
@@ -949,33 +931,35 @@ public class CommonBuilder extends ACBuilder {
IBuildDescription des = null;
IResourceDelta delta = kind == FULL_BUILD ? null : getDelta(curProject);
- if(delta == null)
+ if (delta == null)
makefileRegenerationNeeded = true;
- if(cfg.needsRebuild() || delta != null){
+ if (cfg.needsRebuild() || delta != null) {
//use a build desacription model to calculate the resources to be cleaned
//only in case there are some changes to the project sources or build information
- try{
- int flags = BuildDescriptionManager.REBUILD | BuildDescriptionManager.DEPFILES | BuildDescriptionManager.DEPS;
- if(delta != null)
+ try {
+ int flags = BuildDescriptionManager.REBUILD | BuildDescriptionManager.DEPFILES
+ | BuildDescriptionManager.DEPS;
+ if (delta != null)
flags |= BuildDescriptionManager.REMOVED;
- outputTrace(curProject.getName(), "using a build description.."); //$NON-NLS-1$
+ outputTrace(curProject.getName(), "using a build description.."); //$NON-NLS-1$
des = BuildDescriptionManager.createBuildDescription(cfg, getDelta(curProject), flags);
BuildDescriptionManager.cleanGeneratedRebuildResources(des);
- } catch (Throwable e){
+ } catch (Throwable e) {
//TODO: log error
- outputError(curProject.getName(), "error occured while build description calculation: " + e.getLocalizedMessage()); //$NON-NLS-1$
+ outputError(curProject.getName(),
+ "error occured while build description calculation: " + e.getLocalizedMessage()); //$NON-NLS-1$
//in case an error occured, make it behave in the old stile:
- if(cfg.needsRebuild()){
+ if (cfg.needsRebuild()) {
//make a full clean if an info needs a rebuild
clean(new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN));
makefileRegenerationNeeded = true;
- }
- else if(delta != null && !makefileRegenerationNeeded){
+ } else if (delta != null && !makefileRegenerationNeeded) {
// Create a delta visitor to detect the build type
- ResourceDeltaVisitor visitor = new ResourceDeltaVisitor(cfg, bInfo.getBuildInfo().getManagedProject().getConfigurations());
+ ResourceDeltaVisitor visitor = new ResourceDeltaVisitor(cfg,
+ bInfo.getBuildInfo().getManagedProject().getConfigurations());
delta.accept(visitor);
if (visitor.shouldBuildFull()) {
clean(new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN));
@@ -986,13 +970,14 @@ public class CommonBuilder extends ACBuilder {
}
}
- if(makefileRegenerationNeeded){
+ if (makefileRegenerationNeeded) {
status.setRebuild();
}
return status;
}
- protected MultiStatus performMakefileGeneration(CfgBuildInfo bInfo, IManagedBuilderMakefileGenerator generator, BuildStatus buildStatus, IProgressMonitor monitor) throws CoreException {
+ protected MultiStatus performMakefileGeneration(CfgBuildInfo bInfo, IManagedBuilderMakefileGenerator generator,
+ BuildStatus buildStatus, IProgressMonitor monitor) throws CoreException {
// Need to report status to the user
IProject curProject = bInfo.getProject();
if (monitor == null) {
@@ -1001,11 +986,12 @@ public class CommonBuilder extends ACBuilder {
// Ask the makefile generator to generate any makefiles needed to build delta
checkCancel(monitor);
- String statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.update.makefiles", curProject.getName()); //$NON-NLS-1$
+ String statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.update.makefiles", //$NON-NLS-1$
+ curProject.getName());
monitor.subTask(statusMsg);
MultiStatus result;
- if(buildStatus.isRebuild()){
+ if (buildStatus.isRebuild()) {
result = generator.regenerateMakefiles();
} else {
result = generator.generateMakefiles(getDelta(curProject));
@@ -1014,18 +1000,18 @@ public class CommonBuilder extends ACBuilder {
return result;
}
-// private MultiStatus createMultiStatus(int severity){
-// return new MultiStatus(
-// ManagedBuilderCorePlugin.getUniqueIdentifier(),
-// severity,
-// "", //$NON-NLS-1$
-// null);
-// }
-
-
- protected void initializeGenerator(IManagedBuilderMakefileGenerator generator, int kind, CfgBuildInfo bInfo, IProgressMonitor monitor){
- if(generator instanceof IManagedBuilderMakefileGenerator2){
- IManagedBuilderMakefileGenerator2 gen2 = (IManagedBuilderMakefileGenerator2)generator;
+ // private MultiStatus createMultiStatus(int severity){
+ // return new MultiStatus(
+ // ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ // severity,
+ // "", //$NON-NLS-1$
+ // null);
+ // }
+
+ protected void initializeGenerator(IManagedBuilderMakefileGenerator generator, int kind, CfgBuildInfo bInfo,
+ IProgressMonitor monitor) {
+ if (generator instanceof IManagedBuilderMakefileGenerator2) {
+ IManagedBuilderMakefileGenerator2 gen2 = (IManagedBuilderMakefileGenerator2) generator;
gen2.initialize(kind, bInfo.getConfiguration(), bInfo.getBuilder(), monitor);
} else {
generator.initialize(bInfo.getProject(), bInfo.getBuildInfo(), monitor);
@@ -1040,7 +1026,7 @@ public class CommonBuilder extends ACBuilder {
IProject curProject = getProject();
- if(!isCdtProjectCreated(curProject))
+ if (!isCdtProjectCreated(curProject))
return;
IBuilder[] builders = ManagedBuilderCorePlugin.createBuilders(curProject, null);
@@ -1051,52 +1037,51 @@ public class CommonBuilder extends ACBuilder {
}
@Override
- public void addMarker(IResource file, int lineNumber, String errorDesc,
- int severity, String errorVar) {
+ public void addMarker(IResource file, int lineNumber, String errorDesc, int severity, String errorVar) {
super.addMarker(file, lineNumber, errorDesc, severity, errorVar);
- if(severity == IStatus.ERROR)
+ if (severity == IStatus.ERROR)
fBuildErrOccured = true;
}
@Override
public void addMarker(ProblemMarkerInfo problemMarkerInfo) {
super.addMarker(problemMarkerInfo);
- if(problemMarkerInfo.severity == IStatus.ERROR)
+ if (problemMarkerInfo.severity == IStatus.ERROR)
fBuildErrOccured = true;
}
- protected void clean(CfgBuildInfo bInfo, IProgressMonitor monitor) throws CoreException{
+ protected void clean(CfgBuildInfo bInfo, IProgressMonitor monitor) throws CoreException {
if (shouldBuild(CLEAN_BUILD, bInfo.getBuilder())) {
BuildStateManager bsMngr = BuildStateManager.getInstance();
IProject project = bInfo.getProject();
IConfiguration cfg = bInfo.getConfiguration();
IProjectBuildState pbs = bsMngr.getProjectBuildState(project);
IConfigurationBuildState cbs = pbs.getConfigurationBuildState(cfg.getId(), false);
- if(cbs != null){
+ if (cbs != null) {
pbs.removeConfigurationBuildState(cfg.getId());
bsMngr.setProjectBuildState(project, pbs);
}
- if(!cfg.getEditableBuilder().isManagedBuildOn()){
+ if (!cfg.getEditableBuilder().isManagedBuildOn()) {
performExternalClean(bInfo, false, monitor);
} else {
boolean programmatically = true;
IPath path = ManagedBuildManager.getBuildFullPath(cfg, bInfo.getBuilder());
IResource rc = path != null ? ResourcesPlugin.getWorkspace().getRoot().findMember(path) : null;
- if(path == null || (rc != null && rc.getType() != IResource.FILE)){
- if(!cfg.getEditableBuilder().isInternalBuilder()){
+ if (path == null || (rc != null && rc.getType() != IResource.FILE)) {
+ if (!cfg.getEditableBuilder().isInternalBuilder()) {
fBuildErrOccured = false;
try {
performExternalClean(bInfo, false, monitor);
} catch (CoreException e) {
fBuildErrOccured = true;
}
- if(!fBuildErrOccured)
+ if (!fBuildErrOccured)
programmatically = false;
}
- if(programmatically){
+ if (programmatically) {
try {
cleanWithInternalBuilder(bInfo, monitor);
} catch (CoreException e) {
@@ -1109,12 +1094,13 @@ public class CommonBuilder extends ACBuilder {
}
- protected void performExternalClean(final CfgBuildInfo bInfo, boolean separateJob, IProgressMonitor monitor) throws CoreException {
- IResourceRuleFactory ruleFactory= ResourcesPlugin.getWorkspace().getRuleFactory();
+ protected void performExternalClean(final CfgBuildInfo bInfo, boolean separateJob, IProgressMonitor monitor)
+ throws CoreException {
+ IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
final ISchedulingRule rule = ruleFactory.modifyRule(bInfo.getProject());
- if(separateJob){
- Job backgroundJob = new Job("CDT Common Builder"){ //$NON-NLS-1$
+ if (separateJob) {
+ Job backgroundJob = new Job("CDT Common Builder") { //$NON-NLS-1$
/* (non-Javadoc)
* @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
*/
@@ -1125,15 +1111,9 @@ public class CommonBuilder extends ACBuilder {
@Override
public void run(IProgressMonitor monitor) throws CoreException {
- bInfo.fBuilder.getBuildRunner().invokeBuild(
- CLEAN_BUILD,
- bInfo.getProject(),
- bInfo.getConfiguration(),
- bInfo.getBuilder(),
- bInfo.getConsole(),
- CommonBuilder.this,
- CommonBuilder.this,
- monitor);
+ bInfo.fBuilder.getBuildRunner().invokeBuild(CLEAN_BUILD, bInfo.getProject(),
+ bInfo.getConfiguration(), bInfo.getBuilder(), bInfo.getConsole(),
+ CommonBuilder.this, CommonBuilder.this, monitor);
}
}, rule, IWorkspace.AVOID_UPDATE, monitor);
} catch (CoreException e) {
@@ -1143,44 +1123,37 @@ public class CommonBuilder extends ACBuilder {
return returnStatus;
}
-
};
backgroundJob.setRule(rule);
backgroundJob.schedule();
} else {
- bInfo.fBuilder.getBuildRunner().invokeBuild(
- CLEAN_BUILD,
- bInfo.getProject(),
- bInfo.getConfiguration(),
- bInfo.getBuilder(),
- bInfo.getConsole(),
- this,
- this,
- monitor);
+ bInfo.fBuilder.getBuildRunner().invokeBuild(CLEAN_BUILD, bInfo.getProject(), bInfo.getConfiguration(),
+ bInfo.getBuilder(), bInfo.getConsole(), this, this, monitor);
}
}
- protected boolean shouldCleanProgrammatically(CfgBuildInfo bInfo){
- if(!bInfo.getBuilder().isManagedBuildOn())
+ protected boolean shouldCleanProgrammatically(CfgBuildInfo bInfo) {
+ if (!bInfo.getBuilder().isManagedBuildOn())
return false;
return true;
-// IConfiguration cfg = builder.getParent().getParent();
-// IPath path = ManagedBuildManager.getBuildFullPath(cfg, builder);
-// if(path == null)
-// return false;
-//
-// return cfg.getOwner().getProject().getFullPath().isPrefixOf(path);
+ // IConfiguration cfg = builder.getParent().getParent();
+ // IPath path = ManagedBuildManager.getBuildFullPath(cfg, builder);
+ // if(path == null)
+ // return false;
+ //
+ // return cfg.getOwner().getProject().getFullPath().isPrefixOf(path);
}
protected void cleanWithInternalBuilder(CfgBuildInfo bInfo, IProgressMonitor monitor) throws CoreException {
-// referencedProjects = getProject().getReferencedProjects();
+ // referencedProjects = getProject().getReferencedProjects();
IProject project = bInfo.getProject();
- outputTrace(project.getName(), "Clean build with Internal Builder requested"); //$NON-NLS-1$
+ outputTrace(project.getName(), "Clean build with Internal Builder requested"); //$NON-NLS-1$
IConfiguration configuration = bInfo.getConfiguration();
int flags = BuildDescriptionManager.DEPFILES;
- BuildDescription des = (BuildDescription)BuildDescriptionManager.createBuildDescription(configuration, null, null, flags);
+ BuildDescription des = (BuildDescription) BuildDescriptionManager.createBuildDescription(configuration, null,
+ null, flags);
IBuildStep cleanStep = des.getCleanStep();
@@ -1200,7 +1173,8 @@ public class CommonBuilder extends ACBuilder {
URI workingDirectoryURI = ManagedBuildManager.getBuildLocationURI(configuration, builder);
ErrorParserManager epm = new ErrorParserManager(project, workingDirectoryURI, this, errorParsers);
- buildRunnerHelper.prepareStreams(epm, null, console, new SubProgressMonitor(monitor, TICKS_STREAM_PROGRESS_MONITOR));
+ buildRunnerHelper.prepareStreams(epm, null, console,
+ new SubProgressMonitor(monitor, TICKS_STREAM_PROGRESS_MONITOR));
OutputStream stdout = buildRunnerHelper.getOutputStream();
OutputStream stderr = buildRunnerHelper.getErrorStream();
@@ -1209,7 +1183,7 @@ public class CommonBuilder extends ACBuilder {
boolean isConfigurationSupported = configuration.isSupported();
buildRunnerHelper.greeting(CLEAN_BUILD, cfgName, toolchainName, isConfigurationSupported);
- int status = sBuilder.build(stdout, stderr, new SubProgressMonitor(monitor, TICKS_EXECUTE_COMMAND));
+ int status = sBuilder.build(stdout, stderr, new SubProgressMonitor(monitor, TICKS_EXECUTE_COMMAND));
buildRunnerHelper.close();
buildRunnerHelper.goodbye();
@@ -1218,9 +1192,9 @@ public class CommonBuilder extends ACBuilder {
}
//Throw a core exception indicating that the clean command failed
- if(status == IBuildModelBuilder.STATUS_ERROR_LAUNCH)
- {
- Status st = new Status(IStatus.INFO, ManagedBuilderCorePlugin.PLUGIN_ID, "Failed to execute delete command"); //$NON-NLS-1$
+ if (status == IBuildModelBuilder.STATUS_ERROR_LAUNCH) {
+ Status st = new Status(IStatus.INFO, ManagedBuilderCorePlugin.PLUGIN_ID,
+ "Failed to execute delete command"); //$NON-NLS-1$
throw new CoreException(st);
}
} catch (Exception e) {
@@ -1239,39 +1213,35 @@ public class CommonBuilder extends ACBuilder {
}
protected void cleanProgrammatically(CfgBuildInfo bInfo, IProgressMonitor monitor) throws CoreException {
-// referencedProjects = getProject().getReferencedProjects();
+ // referencedProjects = getProject().getReferencedProjects();
IProject project = bInfo.getProject();
- outputTrace(project.getName(), "Clean build requested"); //$NON-NLS-1$
+ outputTrace(project.getName(), "Clean build requested"); //$NON-NLS-1$
IBuilder builder = bInfo.getBuilder();
IConfiguration configuration = bInfo.getConfiguration();
IPath buildPath = ManagedBuildManager.getBuildFullPath(configuration, builder);
- if(buildPath == null){
- throw new CoreException(new Status(IStatus.ERROR,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ if (buildPath == null) {
+ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
ManagedMakeMessages.getResourceString("CommonBuilder.0"))); //$NON-NLS-1$
}
IPath projectFullPath = project.getFullPath();
- if(!projectFullPath.isPrefixOf(buildPath)){
- throw new CoreException(new Status(IStatus.ERROR,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ if (!projectFullPath.isPrefixOf(buildPath)) {
+ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
ManagedMakeMessages.getResourceString("CommonBuilder.16"))); //$NON-NLS-1$
}
IWorkspace workspace = CCorePlugin.getWorkspace();
IResource rc = workspace.getRoot().findMember(buildPath);
- if(rc != null){
- if(rc.getType() != IResource.FOLDER){
- throw new CoreException(new Status(IStatus.ERROR,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ if (rc != null) {
+ if (rc.getType() != IResource.FOLDER) {
+ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
ManagedMakeMessages.getResourceString("CommonBuilder.12"))); //$NON-NLS-1$
}
- IFolder buildDir = (IFolder)rc;
- if (!buildDir.isAccessible()){
- outputError(buildDir.getName(), "Could not delete the build directory"); //$NON-NLS-1$
- throw new CoreException(new Status(IStatus.ERROR,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ IFolder buildDir = (IFolder) rc;
+ if (!buildDir.isAccessible()) {
+ outputError(buildDir.getName(), "Could not delete the build directory"); //$NON-NLS-1$
+ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
ManagedMakeMessages.getResourceString("CommonBuilder.13"))); //$NON-NLS-1$
}
@@ -1283,7 +1253,8 @@ public class CommonBuilder extends ACBuilder {
monitor.beginTask("", TICKS_STREAM_PROGRESS_MONITOR + TICKS_DELETE_OUTPUTS); //$NON-NLS-1$
// try the brute force approach first
- String status = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.clean.deleting.output", buildDir.getName()); //$NON-NLS-1$
+ String status = ManagedMakeMessages
+ .getFormattedString("ManagedMakeBuilder.message.clean.deleting.output", buildDir.getName()); //$NON-NLS-1$
monitor.subTask(status);
IConsole console = bInfo.getConsole();
@@ -1292,14 +1263,16 @@ public class CommonBuilder extends ACBuilder {
URI workingDirectoryURI = ManagedBuildManager.getBuildLocationURI(configuration, builder);
ErrorParserManager epm = new ErrorParserManager(project, workingDirectoryURI, this, errorParsers);
- buildRunnerHelper.prepareStreams(epm, null, console, new SubProgressMonitor(monitor, TICKS_STREAM_PROGRESS_MONITOR));
+ buildRunnerHelper.prepareStreams(epm, null, console,
+ new SubProgressMonitor(monitor, TICKS_STREAM_PROGRESS_MONITOR));
String cfgName = configuration.getName();
String toolchainName = configuration.getToolChain().getName();
boolean isConfigurationSupported = configuration.isSupported();
buildRunnerHelper.greeting(CLEAN_BUILD, cfgName, toolchainName, isConfigurationSupported);
- workspace.delete(new IResource[]{buildDir}, true, new SubProgressMonitor(monitor, TICKS_DELETE_OUTPUTS));
+ workspace.delete(new IResource[] { buildDir }, true,
+ new SubProgressMonitor(monitor, TICKS_DELETE_OUTPUTS));
buildRunnerHelper.close();
buildRunnerHelper.goodbye();
@@ -1328,13 +1301,13 @@ public class CommonBuilder extends ACBuilder {
protected boolean shouldBuild(int kind, IMakeBuilderInfo info) {
switch (kind) {
- case IncrementalProjectBuilder.AUTO_BUILD :
- return info.isAutoBuildEnable();
- case IncrementalProjectBuilder.INCREMENTAL_BUILD : // now treated as the same!
- case IncrementalProjectBuilder.FULL_BUILD :
- return info.isFullBuildEnabled() | info.isIncrementalBuildEnabled() ;
- case IncrementalProjectBuilder.CLEAN_BUILD :
- return info.isCleanBuildEnabled();
+ case IncrementalProjectBuilder.AUTO_BUILD:
+ return info.isAutoBuildEnable();
+ case IncrementalProjectBuilder.INCREMENTAL_BUILD: // now treated as the same!
+ case IncrementalProjectBuilder.FULL_BUILD:
+ return info.isFullBuildEnabled() | info.isIncrementalBuildEnabled();
+ case IncrementalProjectBuilder.CLEAN_BUILD:
+ return info.isCleanBuildEnabled();
}
return true;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
index bbf36b29271..6243e28dd7d 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
@@ -92,10 +92,11 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.Version;
-public class Configuration extends BuildObject implements IConfiguration, IBuildPropertiesRestriction, IBuildPropertyChangeListener, IRealBuildObjectAssociation {
+public class Configuration extends BuildObject implements IConfiguration, IBuildPropertiesRestriction,
+ IBuildPropertyChangeListener, IRealBuildObjectAssociation {
- private static final String EMPTY_STRING = ""; //$NON-NLS-1$
- private static final String EMPTY_CFG_ID = "org.eclipse.cdt.build.core.emptycfg"; //$NON-NLS-1$
+ private static final String EMPTY_STRING = ""; //$NON-NLS-1$
+ private static final String EMPTY_CFG_ID = "org.eclipse.cdt.build.core.emptycfg"; //$NON-NLS-1$
private static final String LANGUAGE_SETTINGS_PROVIDER_DELIMITER = ";"; //$NON-NLS-1$
private static final String LANGUAGE_SETTINGS_PROVIDER_NEGATION_SIGN = "-"; //$NON-NLS-1$
private static final String $TOOLCHAIN = "${Toolchain}"; //$NON-NLS-1$
@@ -111,10 +112,10 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
private String errorParserIds;
private String defaultLanguageSettingsProvidersAttribute;
private String[] defaultLanguageSettingsProviderIds;
- private String prebuildStep;
- private String postbuildStep;
- private String preannouncebuildStep;
- private String postannouncebuildStep;
+ private String prebuildStep;
+ private String postbuildStep;
+ private String preannouncebuildStep;
+ private String postannouncebuildStep;
private String description;
private ICSourceEntry[] sourceEntries;
private BuildObjectProperties buildProperties;
@@ -136,15 +137,15 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
private FolderInfo rootFolderInfo;
private BuildConfigurationData fCfgData;
private ICConfigurationDescription fCfgDes;
-// private IScannerConfigBuilderInfo2 scannerCfgBuilderInfo;
-// private IDiscoveredPathManager.IDiscoveredPathInfo discoveredInfo;
-// private Boolean isPerResourceDiscovery;
+ // private IScannerConfigBuilderInfo2 scannerCfgBuilderInfo;
+ // private IDiscoveredPathManager.IDiscoveredPathInfo discoveredInfo;
+ // private Boolean isPerResourceDiscovery;
private ICfgScannerConfigBuilderInfo2Set cfgScannerInfo;
private boolean isPreferenceConfig;
private List<IPath> excludeList;
//property name for holding the rebuild state
- private static final String REBUILD_STATE = "rebuildState"; //$NON-NLS-1$
+ private static final String REBUILD_STATE = "rebuildState"; //$NON-NLS-1$
//The resource delta passed to the builder is not always up-to-date
//for the given configuration because between two builds of the same configuration
@@ -161,7 +162,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
//for tracking delta, e.g calculate the pre-cinfiguration resource delta, etc.
//
//property for holding the resource change state
- private static final String RC_CHANGE_STATE = "rcState"; //$NON-NLS-1$
+ private static final String RC_CHANGE_STATE = "rcState"; //$NON-NLS-1$
//resource change state
private int resourceChangeState = -1;
@@ -171,27 +172,27 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
//as a special Builder object of the tool-chain and implement the internal
//builder enabling/disabling as the Builder substitution functionality
//
-// private static final String INTERNAL_BUILDER = "internalBuilder"; //$NON-NLS-1$
+ // private static final String INTERNAL_BUILDER = "internalBuilder"; //$NON-NLS-1$
//preference key that holds the Internal Builder enable state
-// private static final String INTERNAL_BUILDER_ENABLED = "enabled"; //$NON-NLS-1$
+ // private static final String INTERNAL_BUILDER_ENABLED = "enabled"; //$NON-NLS-1$
//preference key that holds the internal builder mode
-// private static final String INTERNAL_BUILDER_IGNORE_ERR = "ignoreErr"; //$NON-NLS-1$
+ // private static final String INTERNAL_BUILDER_IGNORE_ERR = "ignoreErr"; //$NON-NLS-1$
//preference key that holds the internal builder mode
-// private static final String INTERNAL_BUILDER_PARALLEL = "parallel"; //$NON-NLS-1$
+ // private static final String INTERNAL_BUILDER_PARALLEL = "parallel"; //$NON-NLS-1$
//preference key that holds the internal builder mode
-// private static final String INTERNAL_BUILDER_PARALLEL_DEF = "paralleldef"; //$NON-NLS-1$
+ // private static final String INTERNAL_BUILDER_PARALLEL_DEF = "paralleldef"; //$NON-NLS-1$
//preference key that holds the internal builder mode
-// private static final String INTERNAL_BUILDER_PARALLELNUMBER = "parallelnumber"; //$NON-NLS-1$
+ // private static final String INTERNAL_BUILDER_PARALLELNUMBER = "parallelnumber"; //$NON-NLS-1$
//Internal Builder enable state
-// private boolean internalBuilderEnabled;
+ // private boolean internalBuilderEnabled;
//Internal Builder mode
-// private boolean internalBuilderIgnoreErr = true;
+ // private boolean internalBuilderIgnoreErr = true;
//Internal Builder parallel mode
-// private boolean internalBuilderParallel = true;
+ // private boolean internalBuilderParallel = true;
//Internal Builder parallel mode - default jobs #
-// private boolean internalBuilderParallelDef = true;
+ // private boolean internalBuilderParallelDef = true;
//Number of parallel threads
-// private int internalBuilderParallelNumber = 1; // default value
+ // private int internalBuilderParallelNumber = 1; // default value
/*
* C O N S T R U C T O R S
*/
@@ -223,10 +224,9 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
IManagedConfigElement enablements[] = element.getChildren(OptionEnablementExpression.NAME);
- if(enablements.length > 0)
+ if (enablements.length > 0)
booleanExpressionCalculator = new BooleanExpressionApplicabilityCalculator(enablements);
-
// Load the children
IManagedConfigElement[] configElements = element.getChildren();
List<IPath> srcPathList = new ArrayList<IPath>();
@@ -243,14 +243,15 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|| IResourceConfiguration.RESOURCE_CONFIGURATION_ELEMENT_NAME.equals(configElement.getName())) {
ResourceConfiguration resConfig = new ResourceConfiguration(this, configElement, managedBuildRevision);
addResourceConfiguration(resConfig);
- } else if (SourcePath.ELEMENT_NAME.equals(configElement.getName())){
+ } else if (SourcePath.ELEMENT_NAME.equals(configElement.getName())) {
SourcePath p = new SourcePath(configElement);
- if(p.getPath() != null)
+ if (p.getPath() != null)
srcPathList.add(p.getPath());
- } else if (configElement.getName().equals(SupportedProperties.SUPPORTED_PROPERTIES)){
+ } else if (configElement.getName().equals(SupportedProperties.SUPPORTED_PROPERTIES)) {
loadProperties(configElement);
- } else if (SOURCE_ENTRIES.equals(configElement.getName())){
- List<ICSettingEntry> seList = LanguageSettingEntriesSerializer.loadEntriesList(new ManagedConfigStorageElement(configElement), ICSettingEntry.SOURCE_PATH);
+ } else if (SOURCE_ENTRIES.equals(configElement.getName())) {
+ List<ICSettingEntry> seList = LanguageSettingEntriesSerializer
+ .loadEntriesList(new ManagedConfigStorageElement(configElement), ICSettingEntry.SOURCE_PATH);
sourceEntries = seList.toArray(new ICSourceEntry[seList.size()]);
}
}
@@ -259,20 +260,20 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
excludeList = null;
- if(rootFolderInfo == null)
+ if (rootFolderInfo == null)
createRootFolderInfo();
String props = SafeStringInterner.safeIntern(element.getAttribute(BUILD_PROPERTIES));
- if(props != null)
+ if (props != null)
buildProperties = new BuildObjectProperties(props, this, this);
String optionalProps = SafeStringInterner.safeIntern(element.getAttribute(OPTIONAL_BUILD_PROPERTIES));
- if(optionalProps != null)
+ if (optionalProps != null)
optionalBuildProperties = new OptionalBuildProperties(optionalProps);
String artType = SafeStringInterner.safeIntern(element.getAttribute(BUILD_ARTEFACT_TYPE));
- if(artType != null){
- if(buildProperties == null)
+ if (artType != null) {
+ if (buildProperties == null)
buildProperties = new BuildObjectProperties(this, this);
try {
@@ -282,12 +283,12 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
}
- if(projectType != null && projectType.buildProperties != null){
- if(buildProperties == null){
+ if (projectType != null && projectType.buildProperties != null) {
+ if (buildProperties == null) {
buildProperties = new BuildObjectProperties(projectType.buildProperties, this, this);
} else {
IBuildProperty properties[] = projectType.buildProperties.getProperties();
- for(int i = 0; i < properties.length; i++){
+ for (int i = 0; i < properties.length; i++) {
try {
buildProperties.internalSetProperty(properties[i].getPropertyType().getId(),
properties[i].getValue().getId());
@@ -300,31 +301,30 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
setDirty(false);
}
- private static ICSourceEntry[] createSourceEntries(ICSourceEntry[] curEntries, List<IPath> pathList, List<IPath> excludeList){
- for(int i = 0; i < excludeList.size(); i++){
+ private static ICSourceEntry[] createSourceEntries(ICSourceEntry[] curEntries, List<IPath> pathList,
+ List<IPath> excludeList) {
+ for (int i = 0; i < excludeList.size(); i++) {
IPath path = excludeList.get(i);
- if(path.segmentCount() == 0)
+ if (path.segmentCount() == 0)
excludeList.remove(i);
}
- if(pathList.size() == 0)
+ if (pathList.size() == 0)
pathList.add(Path.EMPTY);
- if(pathList.size() == 1
- && pathList.get(0).equals(Path.EMPTY)
- && excludeList.size() == 0)
+ if (pathList.size() == 1 && pathList.get(0).equals(Path.EMPTY) && excludeList.size() == 0)
return curEntries;
int pathSize = pathList.size();
Map<IPath, ICSourceEntry> map = new LinkedHashMap<IPath, ICSourceEntry>();
- for(int i = 0; i < pathSize; i++){
+ for (int i = 0; i < pathSize; i++) {
IPath path = pathList.get(i);
ICSourceEntry entry = map.get(path);
- if(entry == null)
+ if (entry == null)
entry = new CSourceEntry(path, null, ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED);
entry = CDataUtil.addExcludePaths(entry, excludeList, true);
- if(entry != null)
+ if (entry != null)
map.put(path, entry);
}
@@ -399,7 +399,8 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
* @param element The XML element that contains the configuration settings.
*
*/
- public Configuration(ManagedProject managedProject, ICStorageElement element, String managedBuildRevision, boolean isPreference) {
+ public Configuration(ManagedProject managedProject, ICStorageElement element, String managedBuildRevision,
+ boolean isPreference) {
this.managedProject = managedProject;
this.isPreferenceConfig = isPreference;
isExtensionConfig = false;
@@ -411,7 +412,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
loadFromProject(element);
// Hook me up
- if(managedProject != null)
+ if (managedProject != null)
managedProject.addConfiguration(this);
ICStorageElement configElements[] = element.getChildren();
@@ -429,12 +430,13 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|| IResourceConfiguration.RESOURCE_CONFIGURATION_ELEMENT_NAME.equals(configElement.getName())) {
ResourceConfiguration resConfig = new ResourceConfiguration(this, configElement, managedBuildRevision);
addResourceConfiguration(resConfig);
- } else if (SourcePath.ELEMENT_NAME.equals(configElement.getName())){
+ } else if (SourcePath.ELEMENT_NAME.equals(configElement.getName())) {
SourcePath p = new SourcePath(configElement);
- if(p.getPath() != null)
+ if (p.getPath() != null)
srcPathList.add(p.getPath());
- } else if (SOURCE_ENTRIES.equals(configElement.getName())){
- List<ICSettingEntry> seList = LanguageSettingEntriesSerializer.loadEntriesList(configElement, ICSettingEntry.SOURCE_PATH);
+ } else if (SOURCE_ENTRIES.equals(configElement.getName())) {
+ List<ICSettingEntry> seList = LanguageSettingEntriesSerializer.loadEntriesList(configElement,
+ ICSettingEntry.SOURCE_PATH);
sourceEntries = seList.toArray(new ICSourceEntry[seList.size()]);
}
}
@@ -447,58 +449,58 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
PropertyManager mngr = PropertyManager.getInstance();
String rebuild = mngr.getProperty(this, REBUILD_STATE);
- if(rebuild == null || Boolean.valueOf(rebuild).booleanValue())
+ if (rebuild == null || Boolean.valueOf(rebuild).booleanValue())
rebuildNeeded = true;
String rcChangeState = mngr.getProperty(this, RC_CHANGE_STATE);
- if(rcChangeState == null)
+ if (rcChangeState == null)
resourceChangeState = ~0;
else {
try {
- resourceChangeState = Integer.parseInt(rcChangeState);
- } catch (NumberFormatException e){
+ resourceChangeState = Integer.parseInt(rcChangeState);
+ } catch (NumberFormatException e) {
resourceChangeState = ~0;
}
}
setDirty(false);
-// Preferences prefs = getPreferences(INTERNAL_BUILDER);
-//
-// internalBuilderEnabled = prefs != null ?
-// prefs.getBoolean(INTERNAL_BUILDER_ENABLED, false) : false;
-// internalBuilderIgnoreErr = prefs != null ?
-// prefs.getBoolean(INTERNAL_BUILDER_IGNORE_ERR, true) : true;
+ // Preferences prefs = getPreferences(INTERNAL_BUILDER);
+ //
+ // internalBuilderEnabled = prefs != null ?
+ // prefs.getBoolean(INTERNAL_BUILDER_ENABLED, false) : false;
+ // internalBuilderIgnoreErr = prefs != null ?
+ // prefs.getBoolean(INTERNAL_BUILDER_IGNORE_ERR, true) : true;
}
public Configuration(ManagedProject managedProject, ToolChain tCh, String id, String name) {
setId(id);
setName(name);
-// this.description = cloneConfig.getDescription();
+ // this.description = cloneConfig.getDescription();
this.managedProject = managedProject;
isExtensionConfig = false;
- if(tCh == null){
+ if (tCh == null) {
//create configuration based upon the preference config
IConfiguration cfg = ManagedBuildManager.getPreferenceConfiguration(false);
- if(cfg != null)
- copySettingsFrom((Configuration)cfg, true);
+ if (cfg != null)
+ copySettingsFrom((Configuration) cfg, true);
} else {
- Configuration baseCfg = (Configuration)ManagedBuildManager.getExtensionConfiguration(EMPTY_CFG_ID);
- // this.isTemporary = temporary;
+ Configuration baseCfg = (Configuration) ManagedBuildManager.getExtensionConfiguration(EMPTY_CFG_ID);
+ // this.isTemporary = temporary;
fCfgData = new BuildConfigurationData(this);
- if(baseCfg.buildProperties != null)
+ if (baseCfg.buildProperties != null)
this.buildProperties = new BuildObjectProperties(baseCfg.buildProperties, this, this);
if (baseCfg.optionalBuildProperties != null)
this.optionalBuildProperties = new OptionalBuildProperties(baseCfg.optionalBuildProperties);
-
+
// set managedBuildRevision
setManagedBuildRevision(baseCfg.getManagedBuildRevision());
- // if(!baseCfg.isExtensionConfig)
- // cloneChildren = true;
+ // if(!baseCfg.isExtensionConfig)
+ // cloneChildren = true;
// If this constructor is called to clone an existing
// configuration, the parent of the cloning config should be stored.
parent = baseCfg.isExtensionConfig || baseCfg.getParent() == null ? baseCfg : baseCfg.getParent();
@@ -514,21 +516,21 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
preannouncebuildStep = baseCfg.preannouncebuildStep;
postannouncebuildStep = baseCfg.postannouncebuildStep;
- if(baseCfg.sourceEntries != null)
+ if (baseCfg.sourceEntries != null)
sourceEntries = baseCfg.sourceEntries.clone();
defaultLanguageSettingsProvidersAttribute = baseCfg.defaultLanguageSettingsProvidersAttribute;
- if(baseCfg.defaultLanguageSettingsProviderIds != null) {
+ if (baseCfg.defaultLanguageSettingsProviderIds != null) {
defaultLanguageSettingsProviderIds = baseCfg.defaultLanguageSettingsProviderIds.clone();
}
- // enableInternalBuilder(baseCfg.isInternalBuilderEnabled());
- // setInternalBuilderIgnoreErr(baseCfg.getInternalBuilderIgnoreErr());
- // setInternalBuilderParallel(baseCfg.getInternalBuilderParallel());
- // setParallelDef(baseCfg.getParallelDef());
- // setParallelNumber(baseCfg.getParallelNumber());
- // internalBuilderEnabled = cloneConfig.internalBuilderEnabled;
- // internalBuilderIgnoreErr = cloneConfig.internalBuilderIgnoreErr;
+ // enableInternalBuilder(baseCfg.isInternalBuilderEnabled());
+ // setInternalBuilderIgnoreErr(baseCfg.getInternalBuilderIgnoreErr());
+ // setInternalBuilderParallel(baseCfg.getInternalBuilderParallel());
+ // setParallelDef(baseCfg.getParallelDef());
+ // setParallelNumber(baseCfg.getParallelNumber());
+ // internalBuilderEnabled = cloneConfig.internalBuilderEnabled;
+ // internalBuilderIgnoreErr = cloneConfig.internalBuilderIgnoreErr;
// Clone the configuration's children
// Tool Chain
@@ -549,50 +551,50 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
// original tool element as its superClass.
String subId;
ITool[] tools = tCh.getTools();
- for (int i=0; i<tools.length; i++) {
- Tool toolChild = (Tool)tools[i];
- subId = ManagedBuildManager.calculateChildId(toolChild.getId(),null);
- newChain.createTool(toolChild, subId, toolChild.getName(), false);
+ for (int i = 0; i < tools.length; i++) {
+ Tool toolChild = (Tool) tools[i];
+ subId = ManagedBuildManager.calculateChildId(toolChild.getId(), null);
+ newChain.createTool(toolChild, subId, toolChild.getName(), false);
}
ITargetPlatform tpBase = tCh.getTargetPlatform();
ITargetPlatform extTp = tpBase;
- for(;extTp != null && !extTp.isExtensionElement();extTp = extTp.getSuperClass()) {}
+ for (; extTp != null && !extTp.isExtensionElement(); extTp = extTp.getSuperClass()) {
+ }
TargetPlatform tp;
- if(extTp != null){
+ if (extTp != null) {
int nnn = ManagedBuildManager.getRandomNumber();
- subId = extTp.getId() + "." + nnn; //$NON-NLS-1$
-// subName = tpBase.getName();
- tp = new TargetPlatform(newChain, subId, tpBase.getName(), (TargetPlatform)tpBase);
+ subId = extTp.getId() + "." + nnn; //$NON-NLS-1$
+ // subName = tpBase.getName();
+ tp = new TargetPlatform(newChain, subId, tpBase.getName(), (TargetPlatform) tpBase);
} else {
subId = ManagedBuildManager.calculateChildId(getId(), null);
String subName = EMPTY_STRING;
- tp = new TargetPlatform((ToolChain)newChain, null, subId, subName, false);
+ tp = new TargetPlatform((ToolChain) newChain, null, subId, subName, false);
}
- ((ToolChain)newChain).setTargetPlatform(tp);
-
+ ((ToolChain) newChain).setTargetPlatform(tp);
- // if(cloneChildren){
- //copy expand build macros setting
- // BuildMacroProvider macroProvider = (BuildMacroProvider)ManagedBuildManager.getBuildMacroProvider();
- // macroProvider.expandMacrosInBuildfile(this,
- // macroProvider.areMacrosExpandedInBuildfile(baseCfg));
+ // if(cloneChildren){
+ //copy expand build macros setting
+ // BuildMacroProvider macroProvider = (BuildMacroProvider)ManagedBuildManager.getBuildMacroProvider();
+ // macroProvider.expandMacrosInBuildfile(this,
+ // macroProvider.areMacrosExpandedInBuildfile(baseCfg));
- //copy user-defined build macros
- /* UserDefinedMacroSupplier userMacros = BuildMacroProvider.fUserDefinedMacroSupplier;
- userMacros.setMacros(
- userMacros.getMacros(BuildMacroProvider.CONTEXT_CONFIGURATION,cloneConfig),
- BuildMacroProvider.CONTEXT_CONFIGURATION,
- this);
- */
- //copy user-defined environment
- // UserDefinedEnvironmentSupplier userEnv = EnvironmentVariableProvider.fUserSupplier;
- // userEnv.setVariables(
- // userEnv.getVariables(cloneConfig), this);
+ //copy user-defined build macros
+ /* UserDefinedMacroSupplier userMacros = BuildMacroProvider.fUserDefinedMacroSupplier;
+ userMacros.setMacros(
+ userMacros.getMacros(BuildMacroProvider.CONTEXT_CONFIGURATION,cloneConfig),
+ BuildMacroProvider.CONTEXT_CONFIGURATION,
+ this);
+ */
+ //copy user-defined environment
+ // UserDefinedEnvironmentSupplier userEnv = EnvironmentVariableProvider.fUserSupplier;
+ // userEnv.setVariables(
+ // userEnv.getVariables(cloneConfig), this);
- // }
+ // }
// Hook me up
managedProject.addConfiguration(this);
@@ -609,7 +611,8 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
setRebuildState(true);
}
- public Configuration(ManagedProject managedProject, Configuration cloneConfig, String id, boolean cloneChildren, boolean temporary) {
+ public Configuration(ManagedProject managedProject, Configuration cloneConfig, String id, boolean cloneChildren,
+ boolean temporary) {
this(managedProject, cloneConfig, id, cloneChildren, temporary, false);
}
@@ -621,7 +624,8 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
* @param id A unique ID for the new configuration.
* @param cloneChildren If <code>true</code>, the configuration's tools are cloned
*/
- public Configuration(ManagedProject managedProject, Configuration cloneConfig, String id, boolean cloneChildren, boolean temporary, boolean isPreferenceConfig) {
+ public Configuration(ManagedProject managedProject, Configuration cloneConfig, String id, boolean cloneChildren,
+ boolean temporary, boolean isPreferenceConfig) {
setId(id);
setName(cloneConfig.getName());
this.isPreferenceConfig = isPreferenceConfig;
@@ -632,12 +636,12 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
copySettingsFrom(cloneConfig, cloneChildren);
}
- private void copySettingsFrom(Configuration cloneConfig, boolean cloneChildren){
+ private void copySettingsFrom(Configuration cloneConfig, boolean cloneChildren) {
fCfgData = new BuildConfigurationData(this);
- if(cloneConfig.buildProperties != null) {
+ if (cloneConfig.buildProperties != null) {
this.buildProperties = new BuildObjectProperties(cloneConfig.buildProperties, this, this);
}
-
+
if (cloneConfig.optionalBuildProperties != null) {
this.optionalBuildProperties = new OptionalBuildProperties(cloneConfig.optionalBuildProperties);
}
@@ -647,11 +651,12 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
// set managedBuildRevision
setManagedBuildRevision(cloneConfig.getManagedBuildRevision());
- if(!cloneConfig.isExtensionConfig)
+ if (!cloneConfig.isExtensionConfig)
cloneChildren = true;
// If this constructor is called to clone an existing
// configuration, the parent of the cloning config should be stored.
- parent = cloneConfig.isExtensionConfig || cloneConfig.getParent() == null ? cloneConfig : cloneConfig.getParent();
+ parent = cloneConfig.isExtensionConfig || cloneConfig.getParent() == null ? cloneConfig
+ : cloneConfig.getParent();
parentId = parent.getId();
// Copy the remaining attributes
@@ -664,21 +669,21 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
postbuildStep = cloneConfig.postbuildStep;
preannouncebuildStep = cloneConfig.preannouncebuildStep;
postannouncebuildStep = cloneConfig.postannouncebuildStep;
- if(cloneConfig.sourceEntries != null) {
+ if (cloneConfig.sourceEntries != null) {
sourceEntries = cloneConfig.sourceEntries.clone();
}
defaultLanguageSettingsProvidersAttribute = cloneConfig.defaultLanguageSettingsProvidersAttribute;
- if(cloneConfig.defaultLanguageSettingsProviderIds != null) {
+ if (cloneConfig.defaultLanguageSettingsProviderIds != null) {
defaultLanguageSettingsProviderIds = cloneConfig.defaultLanguageSettingsProviderIds.clone();
}
-// enableInternalBuilder(cloneConfig.isInternalBuilderEnabled());
-// setInternalBuilderIgnoreErr(cloneConfig.getInternalBuilderIgnoreErr());
-// setInternalBuilderParallel(cloneConfig.getInternalBuilderParallel());
-// setParallelDef(cloneConfig.getParallelDef());
-// setParallelNumber(cloneConfig.getParallelNumber());
-// internalBuilderEnabled = cloneConfig.internalBuilderEnabled;
-// internalBuilderIgnoreErr = cloneConfig.internalBuilderIgnoreErr;
+ // enableInternalBuilder(cloneConfig.isInternalBuilderEnabled());
+ // setInternalBuilderIgnoreErr(cloneConfig.getInternalBuilderIgnoreErr());
+ // setInternalBuilderParallel(cloneConfig.getInternalBuilderParallel());
+ // setParallelDef(cloneConfig.getParallelDef());
+ // setParallelNumber(cloneConfig.getParallelNumber());
+ // internalBuilderEnabled = cloneConfig.internalBuilderEnabled;
+ // internalBuilderIgnoreErr = cloneConfig.internalBuilderIgnoreErr;
// Clone the configuration's children
// Tool Chain
@@ -687,16 +692,19 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
// Resource Configurations
Map<IPath, Map<String, String>> toolIdMap = new HashMap<IPath, Map<String, String>>();
IResourceInfo infos[] = cloneConfig.rcInfos.getResourceInfos();
- for(int i = 0; i < infos.length; i++){
- if(infos[i] instanceof FolderInfo){
- FolderInfo folderInfo = (FolderInfo)infos[i];
- subId = copyIds ? folderInfo.getId() : ManagedBuildManager.calculateChildId(getId(), folderInfo.getPath().toString());
+ for (int i = 0; i < infos.length; i++) {
+ if (infos[i] instanceof FolderInfo) {
+ FolderInfo folderInfo = (FolderInfo) infos[i];
+ subId = copyIds ? folderInfo.getId()
+ : ManagedBuildManager.calculateChildId(getId(), folderInfo.getPath().toString());
FolderInfo newFolderInfo = new FolderInfo(this, folderInfo, subId, toolIdMap, cloneChildren);
addResourceConfiguration(newFolderInfo);
} else {
- ResourceConfiguration fileInfo = (ResourceConfiguration)infos[i];
- subId = copyIds ? fileInfo.getId() : ManagedBuildManager.calculateChildId(getId(), fileInfo.getPath().toString());
- ResourceConfiguration newResConfig = new ResourceConfiguration(this, fileInfo, subId, toolIdMap, cloneChildren);
+ ResourceConfiguration fileInfo = (ResourceConfiguration) infos[i];
+ subId = copyIds ? fileInfo.getId()
+ : ManagedBuildManager.calculateChildId(getId(), fileInfo.getPath().toString());
+ ResourceConfiguration newResConfig = new ResourceConfiguration(this, fileInfo, subId, toolIdMap,
+ cloneChildren);
addResourceConfiguration(newResConfig);
}
@@ -704,41 +712,40 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
resolveProjectReferences(false);
- if(cloneChildren){
+ if (cloneChildren) {
//copy expand build macros setting
- BuildMacroProvider macroProvider = (BuildMacroProvider)ManagedBuildManager.getBuildMacroProvider();
- macroProvider.expandMacrosInBuildfile(this,
- macroProvider.areMacrosExpandedInBuildfile(cloneConfig));
+ BuildMacroProvider macroProvider = (BuildMacroProvider) ManagedBuildManager.getBuildMacroProvider();
+ macroProvider.expandMacrosInBuildfile(this, macroProvider.areMacrosExpandedInBuildfile(cloneConfig));
//copy user-defined build macros
-/* UserDefinedMacroSupplier userMacros = BuildMacroProvider.fUserDefinedMacroSupplier;
- userMacros.setMacros(
- userMacros.getMacros(BuildMacroProvider.CONTEXT_CONFIGURATION,cloneConfig),
- BuildMacroProvider.CONTEXT_CONFIGURATION,
- this);
-*/
+ /* UserDefinedMacroSupplier userMacros = BuildMacroProvider.fUserDefinedMacroSupplier;
+ userMacros.setMacros(
+ userMacros.getMacros(BuildMacroProvider.CONTEXT_CONFIGURATION,cloneConfig),
+ BuildMacroProvider.CONTEXT_CONFIGURATION,
+ this);
+ */
//copy user-defined environment
-// UserDefinedEnvironmentSupplier userEnv = EnvironmentVariableProvider.fUserSupplier;
-// userEnv.setVariables(
-// userEnv.getVariables(cloneConfig), this);
+ // UserDefinedEnvironmentSupplier userEnv = EnvironmentVariableProvider.fUserSupplier;
+ // userEnv.setVariables(
+ // userEnv.getVariables(cloneConfig), this);
}
// Hook me up
- if(managedProject != null){
+ if (managedProject != null) {
managedProject.addConfiguration(this);
}
- if(cloneConfig.isExtensionConfig){
+ if (cloneConfig.isExtensionConfig) {
propertiesChanged();
}
- if(copyIds){
+ if (copyIds) {
rebuildNeeded = cloneConfig.rebuildNeeded;
resourceChangeState = cloneConfig.resourceChangeState;
isDirty = cloneConfig.isDirty;
} else {
- if(cloneConfig.isExtensionConfig)
+ if (cloneConfig.isExtensionConfig)
exportArtifactInfo();
setDirty(true);
setRebuildState(true);
@@ -746,7 +753,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
- public void applyToManagedProject(ManagedProject mProj){
+ public void applyToManagedProject(ManagedProject mProj) {
managedProject = mProj;
isPreferenceConfig = false;
isTemporary = false;
@@ -778,10 +785,10 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
// parent
parentId = SafeStringInterner.safeIntern(element.getAttribute(IConfiguration.PARENT));
-// if (parentID != null) {
-// // Lookup the parent configuration by ID
-// parent = ManagedBuildManager.getExtensionConfiguration(parentID);
-// }
+ // if (parentID != null) {
+ // // Lookup the parent configuration by ID
+ // parent = ManagedBuildManager.getExtensionConfiguration(parentID);
+ // }
// Get the name of the build artifact associated with configuration
artifactName = SafeStringInterner.safeIntern(element.getAttribute(ARTIFACT_NAME));
@@ -790,7 +797,8 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
errorParserIds = SafeStringInterner.safeIntern(element.getAttribute(ERROR_PARSERS));
// Get the initial/default language settings providers IDs
- defaultLanguageSettingsProvidersAttribute = SafeStringInterner.safeIntern(element.getAttribute(LANGUAGE_SETTINGS_PROVIDERS));
+ defaultLanguageSettingsProvidersAttribute = SafeStringInterner
+ .safeIntern(element.getAttribute(LANGUAGE_SETTINGS_PROVIDERS));
// Get the artifact extension
artifactExtension = SafeStringInterner.safeIntern(element.getAttribute(EXTENSION));
@@ -798,17 +806,17 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
// Get the clean command
cleanCommand = SafeStringInterner.safeIntern(element.getAttribute(CLEAN_COMMAND));
- // Get the pre-build and post-build commands
- prebuildStep = SafeStringInterner.safeIntern(element.getAttribute(PREBUILD_STEP));
- postbuildStep = SafeStringInterner.safeIntern(element.getAttribute(POSTBUILD_STEP));
+ // Get the pre-build and post-build commands
+ prebuildStep = SafeStringInterner.safeIntern(element.getAttribute(PREBUILD_STEP));
+ postbuildStep = SafeStringInterner.safeIntern(element.getAttribute(POSTBUILD_STEP));
- // Get the pre-build and post-build announcements
- preannouncebuildStep = SafeStringInterner.safeIntern(element.getAttribute(PREANNOUNCEBUILD_STEP));
- postannouncebuildStep = SafeStringInterner.safeIntern(element.getAttribute(POSTANNOUNCEBUILD_STEP));
+ // Get the pre-build and post-build announcements
+ preannouncebuildStep = SafeStringInterner.safeIntern(element.getAttribute(PREANNOUNCEBUILD_STEP));
+ postannouncebuildStep = SafeStringInterner.safeIntern(element.getAttribute(POSTANNOUNCEBUILD_STEP));
- String tmp = element.getAttribute(IS_SYSTEM);
- if(tmp != null)
- isTest = Boolean.valueOf(tmp).booleanValue();
+ String tmp = element.getAttribute(IS_SYSTEM);
+ if (tmp != null)
+ isTest = Boolean.valueOf(tmp).booleanValue();
}
/**
@@ -832,16 +840,16 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
description = SafeStringInterner.safeIntern(element.getAttribute(IConfiguration.DESCRIPTION));
String props = element.getAttribute(BUILD_PROPERTIES);
- if(props != null)
+ if (props != null)
buildProperties = new BuildObjectProperties(props, this, this);
String optionalProps = element.getAttribute(OPTIONAL_BUILD_PROPERTIES);
if (optionalProps != null)
optionalBuildProperties = new OptionalBuildProperties(optionalProps);
-
+
String artType = SafeStringInterner.safeIntern(element.getAttribute(BUILD_ARTEFACT_TYPE));
- if(artType != null){
- if(buildProperties == null)
+ if (artType != null) {
+ if (buildProperties == null)
buildProperties = new BuildObjectProperties(this, this);
try {
@@ -851,16 +859,16 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
}
-
if (element.getAttribute(IConfiguration.PARENT) != null) {
// See if the parent belongs to the same project
- if(managedProject != null)
+ if (managedProject != null)
parent = managedProject.getConfiguration(element.getAttribute(IConfiguration.PARENT));
// If not, then try the extension configurations
if (parent == null) {
parent = ManagedBuildManager.getExtensionConfiguration(element.getAttribute(IConfiguration.PARENT));
- if (parent==null) {
- String message = NLS.bind(ManagedMakeMessages.getResourceString("Configuration.orphaned"), getId(), element.getAttribute(IConfiguration.PARENT)); //$NON-NLS-1$
+ if (parent == null) {
+ String message = NLS.bind(ManagedMakeMessages.getResourceString("Configuration.orphaned"), getId(), //$NON-NLS-1$
+ element.getAttribute(IConfiguration.PARENT));
ManagedBuilderCorePlugin.error(message);
}
}
@@ -918,17 +926,17 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
if (description != null)
element.setAttribute(IConfiguration.DESCRIPTION, description);
- if(buildProperties != null){
+ if (buildProperties != null) {
element.setAttribute(BUILD_PROPERTIES, buildProperties.toString());
IBuildProperty prop = buildProperties.getProperty(ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID);
- if(prop != null){
+ if (prop != null) {
IBuildPropertyValue val = prop.getValue();
element.setAttribute(BUILD_ARTEFACT_TYPE, val.getId());
}
}
- if(optionalBuildProperties != null){
+ if (optionalBuildProperties != null) {
element.setAttribute(OPTIONAL_BUILD_PROPERTIES, optionalBuildProperties.toString());
}
@@ -961,17 +969,17 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
// Serialize my children
IResourceInfo infos[] = rcInfos.getResourceInfos();
- for(int i = 0; i < infos.length; i++){
- String elementName = infos[i].getKind() == ICSettingBase.SETTING_FILE ? IFileInfo.FILE_INFO_ELEMENT_NAME :
- IFolderInfo.FOLDER_INFO_ELEMENT_NAME;
+ for (int i = 0; i < infos.length; i++) {
+ String elementName = infos[i].getKind() == ICSettingBase.SETTING_FILE ? IFileInfo.FILE_INFO_ELEMENT_NAME
+ : IFolderInfo.FOLDER_INFO_ELEMENT_NAME;
ICStorageElement resElement = element.createChild(elementName);
- ((ResourceInfo)infos[i]).serialize(resElement);
+ ((ResourceInfo) infos[i]).serialize(resElement);
}
PropertyManager.getInstance().serialize(this);
- if(sourceEntries != null && sourceEntries.length > 0){
+ if (sourceEntries != null && sourceEntries.length > 0) {
ICStorageElement el = element.createChild(SOURCE_ENTRIES);
LanguageSettingEntriesSerializer.serializeEntries(sourceEntries, el);
}
@@ -993,7 +1001,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
if (managedProject != null)
return managedProject.getOwner();
else {
- return null; // Extension configurations don't have an "owner"
+ return null; // Extension configurations don't have an "owner"
}
}
@@ -1009,14 +1017,14 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
@Override
public IToolChain createToolChain(IToolChain superClass, String Id, String name, boolean isExtensionElement) {
- if(rootFolderInfo == null){
+ if (rootFolderInfo == null) {
createRootFolderInfo();
}
return rootFolderInfo.createToolChain(superClass, Id, name, isExtensionElement);
}
- private IFolderInfo createRootFolderInfo(){
+ private IFolderInfo createRootFolderInfo() {
String id = ManagedBuildManager.calculateChildId(this.id, null);
String name = "/"; //$NON-NLS-1$
@@ -1024,15 +1032,16 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
addResourceConfiguration(rootFolderInfo);
return rootFolderInfo;
}
-/*
- public IFolderInfo createFolderInfo(IPath path, IToolChain superClass, String Id, String name){
- }
+ /*
+ public IFolderInfo createFolderInfo(IPath path, IToolChain superClass, String Id, String name){
+
+ }
- public IFolderInfo createFolderInfo(IPath path, IFolderInfo baseFolderInfo, String Id, String name){
+ public IFolderInfo createFolderInfo(IPath path, IFolderInfo baseFolderInfo, String Id, String name){
- }
-*/
+ }
+ */
@Override
public IToolChain getToolChain() {
return rootFolderInfo.getToolChain();
@@ -1040,7 +1049,8 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
@Override
public IResourceConfiguration[] getResourceConfigurations() {
- return (IResourceConfiguration[])rcInfos.getResourceInfos(ICSettingBase.SETTING_FILE, IResourceConfiguration.class);
+ return (IResourceConfiguration[]) rcInfos.getResourceInfos(ICSettingBase.SETTING_FILE,
+ IResourceConfiguration.class);
}
@Override
@@ -1071,15 +1081,16 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
@Override
public ITool getTargetTool() {
String[] targetToolIds = rootFolderInfo.getToolChain().getTargetToolList();
- if (targetToolIds == null || targetToolIds.length == 0) return null;
+ if (targetToolIds == null || targetToolIds.length == 0)
+ return null;
// For each target tool id, in list order,
// look for a tool with this ID, or a tool with a superclass with this id.
// Stop when we find a match
ITool[] tools = getFilteredTools();
- for (int i=0; i<targetToolIds.length; i++) {
+ for (int i = 0; i < targetToolIds.length; i++) {
String targetToolId = targetToolIds[i];
- for (int j=0; j<tools.length; j++) {
+ for (int j = 0; j < tools.length; j++) {
ITool targetTool = tools[j];
ITool tool = targetTool;
do {
@@ -1124,20 +1135,19 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
* Adds the Resource Configuration to the Resource Configuration list and map
*/
void addResourceConfiguration(IResourceInfo resConfig) {
- if(resConfig.getPath().segmentCount() == 0)
- rootFolderInfo = (FolderInfo)resConfig;
+ if (resConfig.getPath().segmentCount() == 0)
+ rootFolderInfo = (FolderInfo) resConfig;
rcInfos.addResourceInfo(resConfig);
isDirty = true;
-// rebuildNeeded = true;
+ // rebuildNeeded = true;
}
@Override
public void removeResourceConfiguration(IResourceInfo resConfig) {
- ManagedBuildManager.performValueHandlerEvent(resConfig,
- IManagedOptionValueHandler.EVENT_CLOSE);
+ ManagedBuildManager.performValueHandlerEvent(resConfig, IManagedOptionValueHandler.EVENT_CLOSE);
ITool tools[] = resConfig.getTools();
rcInfos.removeResourceInfo(resConfig.getPath());
- ((ResourceInfo)resConfig).removed();
+ ((ResourceInfo) resConfig).removed();
BuildSettingsUtil.disconnectDepentents(this, tools);
isDirty = true;
rebuildNeeded = true;
@@ -1188,7 +1198,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
IToolChain tc = getToolChain();
IBuilder builder = tc.getBuilder();
if (builder != null) {
- return builder.getArguments();
+ return builder.getArguments();
}
return "-k"; //$NON-NLS-1$
}
@@ -1198,7 +1208,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
IToolChain tc = getToolChain();
IBuilder builder = tc.getBuilder();
if (builder != null) {
- return builder.getCommand();
+ return builder.getCommand();
}
return "make"; //$NON-NLS-1$
}
@@ -1325,7 +1335,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
// If I have a parent, ask it
String errorParsers = null;
if (parent != null) {
- errorParsers = ((Configuration)parent).getErrorParserIdsAttribute();
+ errorParsers = ((Configuration) parent).getErrorParserIdsAttribute();
}
return errorParsers;
@@ -1334,7 +1344,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
@Override
public String[] getErrorParserList() {
Set<String> set = contributeErrorParsers(null, true);
- if(set != null){
+ if (set != null) {
String result[] = new String[set.size()];
set.toArray(result);
return result;
@@ -1344,10 +1354,10 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public Set<String> contributeErrorParsers(Set<String> set, boolean includeChildren) {
String parserIDs = getErrorParserIdsAttribute();
- if (parserIDs != null){
- if(set == null)
+ if (parserIDs != null) {
+ if (set == null)
set = new LinkedHashSet<String>();
- if(parserIDs.length() != 0) {
+ if (parserIDs.length() != 0) {
StringTokenizer tok = new StringTokenizer(parserIDs, ";"); //$NON-NLS-1$
while (tok.hasMoreElements()) {
set.add(tok.nextToken());
@@ -1355,10 +1365,10 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
}
- if(includeChildren){
+ if (includeChildren) {
IResourceInfo[] rcInfos = getResourceInfos();
- for(int i = 0; i < rcInfos.length; i++){
- ResourceInfo rcInfo = (ResourceInfo)rcInfos[i];
+ for (int i = 0; i < rcInfos.length; i++) {
+ ResourceInfo rcInfo = (ResourceInfo) rcInfos[i];
set = rcInfo.contributeErrorParsers(set);
}
}
@@ -1371,7 +1381,8 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
*/
private String getDefaultLanguageSettingsProvidersAttribute() {
if (defaultLanguageSettingsProvidersAttribute == null && parent instanceof Configuration) {
- defaultLanguageSettingsProvidersAttribute = ((Configuration) parent).getDefaultLanguageSettingsProvidersAttribute();
+ defaultLanguageSettingsProvidersAttribute = ((Configuration) parent)
+ .getDefaultLanguageSettingsProvidersAttribute();
}
return defaultLanguageSettingsProvidersAttribute;
@@ -1389,7 +1400,8 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
defaultLanguageSettingsProvidersAttribute = getDefaultLanguageSettingsProvidersAttribute();
if (defaultLanguageSettingsProvidersAttribute != null) {
List<String> ids = new ArrayList<String>();
- String[] defaultIds = defaultLanguageSettingsProvidersAttribute.split(LANGUAGE_SETTINGS_PROVIDER_DELIMITER);
+ String[] defaultIds = defaultLanguageSettingsProvidersAttribute
+ .split(LANGUAGE_SETTINGS_PROVIDER_DELIMITER);
for (String id : defaultIds) {
if (id != null && !id.isEmpty()) {
if (id.startsWith(LANGUAGE_SETTINGS_PROVIDER_NEGATION_SIGN)) {
@@ -1401,7 +1413,8 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
if (toolchain != null) {
String toolchainProvidersIds = toolchain.getDefaultLanguageSettingsProviderIds();
if (toolchainProvidersIds != null) {
- ids.addAll(Arrays.asList(toolchainProvidersIds.split(LANGUAGE_SETTINGS_PROVIDER_DELIMITER)));
+ ids.addAll(Arrays.asList(
+ toolchainProvidersIds.split(LANGUAGE_SETTINGS_PROVIDER_DELIMITER)));
}
}
} else {
@@ -1422,41 +1435,46 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
@Override
public void setArtifactExtension(String extension) {
- if (extension == null && artifactExtension == null) return;
+ if (extension == null && artifactExtension == null)
+ return;
if (artifactExtension == null || extension == null || !artifactExtension.equals(extension)) {
artifactExtension = extension;
-// rebuildNeeded = true;
- if(!isExtensionElement()){
+ // rebuildNeeded = true;
+ if (!isExtensionElement()) {
ITool tool = calculateTargetTool();
- if(tool != null){
+ if (tool != null) {
tool.setRebuildState(true);
} else {
setRebuildState(true);
}
}
isDirty = true;
-// exportArtifactInfo();
+ // exportArtifactInfo();
}
}
@Override
public void setArtifactName(String name) {
- if (name == null && artifactName == null) return;
+ if (name == null && artifactName == null)
+ return;
if (artifactName == null || name == null || !artifactName.equals(name)) {
if (canExportedArtifactInfo()) {
// Remove existing exported library, if it exists
ICConfigurationDescription des = ManagedBuildManager.getDescriptionForConfiguration(this);
- ICSettingEntry[] unresolved = new ICSettingEntry[] {CDataUtil.createCLibraryFileEntry(getArtifactName(), 0)};
+ ICSettingEntry[] unresolved = new ICSettingEntry[] {
+ CDataUtil.createCLibraryFileEntry(getArtifactName(), 0) };
ICSettingEntry[] libs = CDataUtil.resolveEntries(unresolved, des);
if (libs.length > 0) {
for (ICExternalSetting setting : des.getExternalSettings()) {
- Set<ICSettingEntry> entries = new LinkedHashSet<ICSettingEntry>(Arrays.asList(setting.getEntries()));
+ Set<ICSettingEntry> entries = new LinkedHashSet<ICSettingEntry>(
+ Arrays.asList(setting.getEntries()));
for (ICSettingEntry lib : libs) {
if (entries.contains(lib)) {
entries.remove(lib);
des.removeExternalSetting(setting);
- des.createExternalSetting(setting.getCompatibleLanguageIds(), setting.getCompatibleContentTypeIds(),
- setting.getCompatibleExtensions(), entries.toArray(new ICSettingEntry[entries.size()]));
+ des.createExternalSetting(setting.getCompatibleLanguageIds(),
+ setting.getCompatibleContentTypeIds(), setting.getCompatibleExtensions(),
+ entries.toArray(new ICSettingEntry[entries.size()]));
}
}
}
@@ -1464,15 +1482,15 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
artifactName = name;
- if(!isExtensionElement()){
+ if (!isExtensionElement()) {
ITool tool = calculateTargetTool();
- if(tool != null) {
+ if (tool != null) {
tool.setRebuildState(true);
} else {
setRebuildState(true);
}
}
-// rebuildNeeded = true;
+ // rebuildNeeded = true;
isDirty = true;
exportArtifactInfo();
}
@@ -1481,7 +1499,8 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
@Override
public void setErrorParserIds(String ids) {
String currentIds = getErrorParserIds();
- if (ids == null && currentIds == null) return;
+ if (ids == null && currentIds == null)
+ return;
if (currentIds == null || ids == null || !(currentIds.equals(ids))) {
errorParserIds = ids;
isDirty = true;
@@ -1490,7 +1509,8 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
@Override
public void setCleanCommand(String command) {
- if (command == null && cleanCommand == null) return;
+ if (command == null && cleanCommand == null)
+ return;
if (cleanCommand == null || command == null || !cleanCommand.equals(command)) {
cleanCommand = command;
isDirty = true;
@@ -1499,30 +1519,31 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
@Override
public void setDescription(String description) {
- if (description == null && this.description == null) return;
- if (this.description == null || description == null || !description.equals(this.description)) {
- this.description = description;
- isDirty = true;
- }
+ if (description == null && this.description == null)
+ return;
+ if (this.description == null || description == null || !description.equals(this.description)) {
+ this.description = description;
+ isDirty = true;
+ }
}
@Override
public void setBuildArguments(String makeArgs) {
IToolChain tc = getToolChain();
IBuilder builder = tc.getBuilder();
- if(makeArgs == null){ //resetting the build arguments
- if(!builder.isExtensionElement()){
+ if (makeArgs == null) { //resetting the build arguments
+ if (!builder.isExtensionElement()) {
builder.setArguments(makeArgs);
-// rebuildNeeded = true;
+ // rebuildNeeded = true;
}
- }else if(!makeArgs.equals(builder.getArguments())){
+ } else if (!makeArgs.equals(builder.getArguments())) {
if (builder.isExtensionElement()) {
String subId = ManagedBuildManager.calculateChildId(builder.getId(), null);
- String builderName = builder.getName() + "." + getName(); //$NON-NLS-1$
+ String builderName = builder.getName() + "." + getName(); //$NON-NLS-1$
builder = getToolChain().createBuilder(builder, subId, builderName, false);
}
builder.setArguments(makeArgs);
-// rebuildNeeded = true;
+ // rebuildNeeded = true;
}
}
@@ -1530,71 +1551,75 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public void setBuildCommand(String command) {
IToolChain tc = getToolChain();
IBuilder builder = tc.getBuilder();
- if(command == null){ //resetting the build command
- if(!builder.isExtensionElement()){
+ if (command == null) { //resetting the build command
+ if (!builder.isExtensionElement()) {
builder.setCommand(command);
-// rebuildNeeded = true;
+ // rebuildNeeded = true;
}
- } else if(!command.equals(builder.getCommand())){
+ } else if (!command.equals(builder.getCommand())) {
if (builder.isExtensionElement()) {
String subId = ManagedBuildManager.calculateChildId(builder.getId(), null);
- String builderName = builder.getName() + "." + getName(); //$NON-NLS-1$
+ String builderName = builder.getName() + "." + getName(); //$NON-NLS-1$
builder = getToolChain().createBuilder(builder, subId, builderName, false);
}
builder.setCommand(command);
-// rebuildNeeded = true;
+ // rebuildNeeded = true;
}
}
- @Override
+ @Override
public void setPrebuildStep(String step) {
- String currentPrebuildStep = getPrebuildStep();
- if (step == null && prebuildStep == null) return;
- if (currentPrebuildStep == null || step == null || !currentPrebuildStep.equals(step)) {
- prebuildStep = step;
-// rebuildNeeded = true;
- isDirty = true;
- }
- }
-
+ String currentPrebuildStep = getPrebuildStep();
+ if (step == null && prebuildStep == null)
+ return;
+ if (currentPrebuildStep == null || step == null || !currentPrebuildStep.equals(step)) {
+ prebuildStep = step;
+ // rebuildNeeded = true;
+ isDirty = true;
+ }
+ }
- @Override
+ @Override
public void setPostbuildStep(String step) {
- String currentPostbuildStep = getPostbuildStep();
- if (step == null && postbuildStep == null) return;
- if (currentPostbuildStep == null || step == null || !currentPostbuildStep.equals(step)) {
- postbuildStep = step;
-// rebuildNeeded = true;
- isDirty = true;
- }
- }
-
- @Override
+ String currentPostbuildStep = getPostbuildStep();
+ if (step == null && postbuildStep == null)
+ return;
+ if (currentPostbuildStep == null || step == null || !currentPostbuildStep.equals(step)) {
+ postbuildStep = step;
+ // rebuildNeeded = true;
+ isDirty = true;
+ }
+ }
+
+ @Override
public void setPreannouncebuildStep(String announceStep) {
- String currentPreannouncebuildStep = getPreannouncebuildStep();
- if (announceStep == null && preannouncebuildStep == null) return;
- if (currentPreannouncebuildStep == null || announceStep == null || !currentPreannouncebuildStep.equals(announceStep)) {
- preannouncebuildStep = announceStep;
-// rebuildNeeded = true;
- isDirty = true;
- }
- }
-
- @Override
+ String currentPreannouncebuildStep = getPreannouncebuildStep();
+ if (announceStep == null && preannouncebuildStep == null)
+ return;
+ if (currentPreannouncebuildStep == null || announceStep == null
+ || !currentPreannouncebuildStep.equals(announceStep)) {
+ preannouncebuildStep = announceStep;
+ // rebuildNeeded = true;
+ isDirty = true;
+ }
+ }
+
+ @Override
public void setPostannouncebuildStep(String announceStep) {
- String currentAnnounceStep = getPostannouncebuildStep();
- if (announceStep == null && postannouncebuildStep == null) return;
- if (currentAnnounceStep == null || announceStep == null || !currentAnnounceStep.equals(announceStep)) {
- postannouncebuildStep = announceStep;
-// rebuildNeeded = true;
- isDirty = true;
- }
- }
+ String currentAnnounceStep = getPostannouncebuildStep();
+ if (announceStep == null && postannouncebuildStep == null)
+ return;
+ if (currentAnnounceStep == null || announceStep == null || !currentAnnounceStep.equals(announceStep)) {
+ postannouncebuildStep = announceStep;
+ // rebuildNeeded = true;
+ isDirty = true;
+ }
+ }
@Override
- public boolean isSupported(){
+ public boolean isSupported() {
IFolderInfo foInfo = getRootFolderInfo();
- if(foInfo != null)
+ if (foInfo != null)
return foInfo.isSupported();
return false;
}
@@ -1616,16 +1641,18 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
@Override
public boolean isDirty() {
// This shouldn't be called for an extension configuration
- if (isExtensionConfig) return false;
+ if (isExtensionConfig)
+ return false;
// If I need saving, just say yes
- if (isDirty) return true;
+ if (isDirty)
+ return true;
// Otherwise see if any children need saving
IResourceInfo infos[] = rcInfos.getResourceInfos();
- for(int i = 0; i < infos.length; i++){
- if(infos[i].isDirty())
+ for (int i = 0; i < infos.length; i++) {
+ if (infos[i].isDirty())
return true;
}
return isDirty;
@@ -1644,13 +1671,13 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public boolean needsRebuild(boolean checkChildren) {
boolean needRebuild = rebuildNeeded || resourceChangesRequireRebuild();
- if(needRebuild || !checkChildren)
+ if (needRebuild || !checkChildren)
return needRebuild;
IResourceInfo infos[] = rcInfos.getResourceInfos();
- for(int i = 0; i < infos.length; i++){
- if(infos[i].needsRebuild())
+ for (int i = 0; i < infos.length; i++) {
+ if (infos[i].needsRebuild())
return true;
}
@@ -1665,7 +1692,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
if (!isDirty) {
IResourceInfo infos[] = rcInfos.getResourceInfos();
- for(int i = 0; i < infos.length; i++){
+ for (int i = 0; i < infos.length; i++) {
infos[i].setDirty(false);
}
}
@@ -1673,20 +1700,20 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
@Override
public void setRebuildState(boolean rebuild) {
- if(isExtensionElement() && rebuild)
+ if (isExtensionElement() && rebuild)
return;
- if(rebuildNeeded != rebuild){
+ if (rebuildNeeded != rebuild) {
rebuildNeeded = rebuild;
saveRebuildState();
}
- if(!rebuildNeeded){
+ if (!rebuildNeeded) {
setResourceChangeState(0);
IResourceInfo infos[] = rcInfos.getResourceInfos();
- for(int i = 0; i < infos.length; i++){
+ for (int i = 0; i < infos.length; i++) {
infos[i].setRebuildState(false);
}
}
@@ -1726,9 +1753,9 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
resolved = true;
// call resolve references on any children
- ResourceInfo infos[] = (ResourceInfo[])rcInfos.getResourceInfos(ResourceInfo.class);
+ ResourceInfo infos[] = (ResourceInfo[]) rcInfos.getResourceInfos(ResourceInfo.class);
- for(int i = 0; i < infos.length; i++){
+ for (int i = 0; i < infos.length; i++) {
infos[i].resolveReferences();
}
@@ -1744,45 +1771,44 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
* Reset the configuration's, tools', options
*/
public void reset() {
- ((FolderInfo)getRootFolderInfo()).resetOptionSettings();
+ ((FolderInfo) getRootFolderInfo()).resetOptionSettings();
}
/**
* Create a resource configuration object for the passed-in file
*/
@Override
- public IResourceConfiguration createResourceConfiguration(IFile file)
- {
+ public IResourceConfiguration createResourceConfiguration(IFile file) {
return createFileInfo(file.getFullPath().removeFirstSegments(1));
}
@Override
- public IFileInfo createFileInfo(IPath path){
+ public IFileInfo createFileInfo(IPath path) {
String resourceName = path.lastSegment();
String id = ManagedBuildManager.calculateChildId(getId(), path.toString());
return createFileInfo(path, id, resourceName);
}
@Override
- public IFileInfo createFileInfo(IPath path, String id, String name){
+ public IFileInfo createFileInfo(IPath path, String id, String name) {
IResourceInfo info = getResourceInfo(path, false);
IFileInfo fileInfo = null;
- if(info instanceof IFileInfo){
- fileInfo = (IFileInfo)info;
- } else if (info instanceof IFolderInfo){
- IFolderInfo base = (IFolderInfo)info;
+ if (info instanceof IFileInfo) {
+ fileInfo = (IFileInfo) info;
+ } else if (info instanceof IFolderInfo) {
+ IFolderInfo base = (IFolderInfo) info;
fileInfo = createFileInfo(path, base, null, id, name);
}
return fileInfo;
}
@Override
- public IFileInfo createFileInfo(IPath path, IFolderInfo base, ITool baseTool, String id, String name){
- if(base.getPath().equals(path))
+ public IFileInfo createFileInfo(IPath path, IFolderInfo base, ITool baseTool, String id, String name) {
+ if (base.getPath().equals(path))
return null;
- IFileInfo fileInfo = new ResourceConfiguration((FolderInfo)base, baseTool, id, name, path);
+ IFileInfo fileInfo = new ResourceConfiguration((FolderInfo) base, baseTool, id, name, path);
addResourceConfiguration(fileInfo);
ManagedBuildManager.performValueHandlerEvent(fileInfo, IManagedOptionValueHandler.EVENT_OPEN);
@@ -1790,11 +1816,11 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
@Override
- public IFileInfo createFileInfo(IPath path, IFileInfo base, String id, String name){
- if(base.getPath().equals(path))
+ public IFileInfo createFileInfo(IPath path, IFileInfo base, String id, String name) {
+ if (base.getPath().equals(path))
return null;
- IFileInfo fileInfo = new ResourceConfiguration((ResourceConfiguration)base, path, id, name);
+ IFileInfo fileInfo = new ResourceConfiguration((ResourceConfiguration) base, path, id, name);
addResourceConfiguration(fileInfo);
ManagedBuildManager.performValueHandlerEvent(fileInfo, IManagedOptionValueHandler.EVENT_OPEN);
@@ -1802,9 +1828,9 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
@Override
- public IConfigurationEnvironmentVariableSupplier getEnvironmentVariableSupplier(){
+ public IConfigurationEnvironmentVariableSupplier getEnvironmentVariableSupplier() {
IToolChain toolChain = getToolChain();
- if(toolChain != null)
+ if (toolChain != null)
return toolChain.getEnvironmentVariableSupplier();
return null;
}
@@ -1814,8 +1840,8 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
*/
@Override
public Version getVersion() {
- if ( version == null) {
- if ( rootFolderInfo.getToolChain() != null) {
+ if (version == null) {
+ if (rootFolderInfo.getToolChain() != null) {
return rootFolderInfo.getToolChain().getVersion();
}
}
@@ -1828,32 +1854,32 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
@Override
- public IConfigurationBuildMacroSupplier getBuildMacroSupplier(){
+ public IConfigurationBuildMacroSupplier getBuildMacroSupplier() {
IToolChain toolChain = getToolChain();
- if(toolChain != null)
+ if (toolChain != null)
return toolChain.getBuildMacroSupplier();
return null;
}
@Override
- public boolean isTemporary(){
+ public boolean isTemporary() {
return isTemporary;
}
@Override
- public void updateManagedBuildRevision(String revision){
+ public void updateManagedBuildRevision(String revision) {
super.updateManagedBuildRevision(revision);
- ResourceInfo infos[] = (ResourceInfo[])rcInfos.getResourceInfos(ResourceInfo.class);
+ ResourceInfo infos[] = (ResourceInfo[]) rcInfos.getResourceInfos(ResourceInfo.class);
- for(int i = 0; i < infos.length; i++){
+ for (int i = 0; i < infos.length; i++) {
infos[i].updateManagedBuildRevision(revision);
}
}
public void setParent(IConfiguration parent) {
- if ( this.parent != parent) {
+ if (this.parent != parent) {
this.parent = parent;
if (!isExtensionElement())
setDirty(true);
@@ -1861,21 +1887,19 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
@Override
- public ITool calculateTargetTool(){
+ public ITool calculateTargetTool() {
ITool tool = getTargetTool();
- if(tool == null){
+ if (tool == null) {
tool = getToolFromOutputExtension(getArtifactExtension());
}
- if(tool == null){
+ if (tool == null) {
IConfiguration extCfg;
- for(extCfg = this;
- extCfg != null && !extCfg.isExtensionElement();
- extCfg = extCfg.getParent()){
+ for (extCfg = this; extCfg != null && !extCfg.isExtensionElement(); extCfg = extCfg.getParent()) {
}
- if(extCfg != null){
+ if (extCfg != null) {
tool = getToolFromOutputExtension(extCfg.getArtifactExtension());
}
}
@@ -1915,28 +1939,27 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
* for tracking delta, e.g calculate the pre-cinfiguration resource delta, etc.
*
*/
- public void addResourceChangeState(int state){
+ public void addResourceChangeState(int state) {
setResourceChangeState(state | resourceChangeState);
}
- private void setResourceChangeState(int state){
- if(resourceChangeState != state){
+ private void setResourceChangeState(int state) {
+ if (resourceChangeState != state) {
resourceChangeState = state;
saveResourceChangeState();
}
}
- private boolean resourceChangesRequireRebuild(){
- return isInternalBuilderEnabled() ?
- resourceChangeState != 0 :
- (resourceChangeState & IResourceDelta.REMOVED) == IResourceDelta.REMOVED;
+ private boolean resourceChangesRequireRebuild() {
+ return isInternalBuilderEnabled() ? resourceChangeState != 0
+ : (resourceChangeState & IResourceDelta.REMOVED) == IResourceDelta.REMOVED;
}
- private void saveRebuildState(){
+ private void saveRebuildState() {
PropertyManager.getInstance().setProperty(this, REBUILD_STATE, Boolean.toString(rebuildNeeded));
}
- private void saveResourceChangeState(){
+ private void saveResourceChangeState() {
PropertyManager.getInstance().setProperty(this, RC_CHANGE_STATE, Integer.toString(resourceChangeState));
}
@@ -1949,44 +1972,42 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
*
*/
-/* public void setInternalBuilderBoolean(boolean value, String pref) {
- Preferences prefs = getPreferences(INTERNAL_BUILDER);
- if(prefs != null){
- prefs.putBoolean(pref, value);
- try {
- prefs.flush();
- } catch (BackingStoreException e) {}
+ /* public void setInternalBuilderBoolean(boolean value, String pref) {
+ Preferences prefs = getPreferences(INTERNAL_BUILDER);
+ if(prefs != null){
+ prefs.putBoolean(pref, value);
+ try {
+ prefs.flush();
+ } catch (BackingStoreException e) {}
+ }
}
- }
-*/
-/* public boolean getInternalBuilderBoolean(String pref, boolean defaultValue) {
- Preferences prefs = getPreferences(INTERNAL_BUILDER);
- return prefs != null ?
- prefs.getBoolean(pref, false) : defaultValue;
- }
-*/
+ */
+ /* public boolean getInternalBuilderBoolean(String pref, boolean defaultValue) {
+ Preferences prefs = getPreferences(INTERNAL_BUILDER);
+ return prefs != null ?
+ prefs.getBoolean(pref, false) : defaultValue;
+ }
+ */
/**
* this method is used for enabling/disabling the internal builder
* for the given configuration
*
* @param enable boolean
*/
- public void enableInternalBuilder(boolean enable){
- if(enable == isInternalBuilderEnabled())
+ public void enableInternalBuilder(boolean enable) {
+ if (enable == isInternalBuilderEnabled())
return;
IBuilder builder = getBuilderForInternalBuilderEnablement(enable, true);
- if(builder != null){
- if(enable){
+ if (builder != null) {
+ if (enable) {
savePrevBuilderId(getBuilder());
}
- changeBuilder(builder,
- ManagedBuildManager.calculateChildId(builder.getId(), null),
- builder.getName(),
+ changeBuilder(builder, ManagedBuildManager.calculateChildId(builder.getId(), null), builder.getName(),
true);
- if(enable){
+ if (enable) {
try {
setManagedBuildOn(true);
} catch (BuildException e) {
@@ -1995,39 +2016,40 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
}
- public boolean canEnableInternalBuilder(boolean enable){
+ public boolean canEnableInternalBuilder(boolean enable) {
return getBuilderForInternalBuilderEnablement(enable, true) != null;
}
- private IBuilder getBuilderForInternalBuilderEnablement(boolean enable, boolean checkCompatibility){
+ private IBuilder getBuilderForInternalBuilderEnablement(boolean enable, boolean checkCompatibility) {
IBuilder newBuilder = null;
- if(enable){
- if(supportsBuild(true, false)){
+ if (enable) {
+ if (supportsBuild(true, false)) {
IBuilder b = ManagedBuildManager.getInternalBuilder();
- if(b != null){
- if(!checkCompatibility || isBuilderCompatible(b))
- newBuilder = b;
+ if (b != null) {
+ if (!checkCompatibility || isBuilderCompatible(b))
+ newBuilder = b;
}
}
} else {
String id = getPrevBuilderId();
- if(id != null){
+ if (id != null) {
IBuilder b = ManagedBuildManager.getExtensionBuilder(id);
- if(b != null){
- if(!checkCompatibility || isBuilderCompatible(b))
- newBuilder = b;
+ if (b != null) {
+ if (!checkCompatibility || isBuilderCompatible(b))
+ newBuilder = b;
}
}
- if(newBuilder == null){
- for(IToolChain tc = getToolChain(); tc != null; tc = tc.getSuperClass()){
+ if (newBuilder == null) {
+ for (IToolChain tc = getToolChain(); tc != null; tc = tc.getSuperClass()) {
IBuilder b = tc.getBuilder();
- if(b.isInternalBuilder())
+ if (b.isInternalBuilder())
continue;
- for(;b != null && !b.isExtensionElement(); b = b.getSuperClass()) {}
+ for (; b != null && !b.isExtensionElement(); b = b.getSuperClass()) {
+ }
- if(b != null){
- if(!checkCompatibility || isBuilderCompatible(b)){
+ if (b != null) {
+ if (!checkCompatibility || isBuilderCompatible(b)) {
newBuilder = b;
break;
}
@@ -2035,49 +2057,50 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
}
-// if(newBuilder == null){
-// IBuilder builders[] = ManagedBuildManager.getRealBuilders();
-// IBuilder tmpB = null;
-// for(int i = 0; i < builders.length; i++){
-// IBuilder b = builders[i];
-// if(b.isInternalBuilder())
-// continue;
-//
-//
-// if(isBuilderCompatible(b)){
-// newBuilder = b;
-// break;
-// } else if(!checkCompatibility){
-// tmpB = b;
-// }
-// }
-//
-// if(newBuilder == null){
-// if(tmpB != null)
-// newBuilder = tmpB;
-// }
-// }
+ // if(newBuilder == null){
+ // IBuilder builders[] = ManagedBuildManager.getRealBuilders();
+ // IBuilder tmpB = null;
+ // for(int i = 0; i < builders.length; i++){
+ // IBuilder b = builders[i];
+ // if(b.isInternalBuilder())
+ // continue;
+ //
+ //
+ // if(isBuilderCompatible(b)){
+ // newBuilder = b;
+ // break;
+ // } else if(!checkCompatibility){
+ // tmpB = b;
+ // }
+ // }
+ //
+ // if(newBuilder == null){
+ // if(tmpB != null)
+ // newBuilder = tmpB;
+ // }
+ // }
}
return newBuilder;
}
- private void savePrevBuilderId(IBuilder builder){
+ private void savePrevBuilderId(IBuilder builder) {
IBuilder b = builder;
- for(;b != null && !b.isExtensionElement(); b = b.getSuperClass()) {}
+ for (; b != null && !b.isExtensionElement(); b = b.getSuperClass()) {
+ }
- if(b == null)
+ if (b == null)
b = builder;
- ToolChain tc = (ToolChain)getToolChain();
- if(tc != null)
+ ToolChain tc = (ToolChain) getToolChain();
+ if (tc != null)
tc.setNonInternalBuilderId(b.getId());
}
- private String getPrevBuilderId(){
- ToolChain tc = (ToolChain)getToolChain();
- if(tc != null)
+ private String getPrevBuilderId() {
+ ToolChain tc = (ToolChain) getToolChain();
+ if (tc != null)
return tc.getNonInternalBuilderId();
return null;
}
@@ -2086,7 +2109,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
* returns whether the internal builder is enabled
* @return boolean
*/
- public boolean isInternalBuilderEnabled(){
+ public boolean isInternalBuilderEnabled() {
return getBuilder().isInternalBuilder();
}
@@ -2098,7 +2121,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
* build errors while building,
* otherwise it will stop at the first build error
*/
- public void setInternalBuilderIgnoreErr(boolean ignore){
+ public void setInternalBuilderIgnoreErr(boolean ignore) {
try {
getEditableBuilder().setStopOnError(!ignore);
} catch (CoreException e) {
@@ -2112,7 +2135,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
*
* @return boolean
*/
- public boolean getInternalBuilderIgnoreErr(){
+ public boolean getInternalBuilderIgnoreErr() {
return !getBuilder().isStopOnError();
}
@@ -2123,7 +2146,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
* @deprecated since CDT 9.0. Use {@link #setParallelDef(boolean)}
*/
@Deprecated
- public void setInternalBuilderParallel(boolean parallel){
+ public void setInternalBuilderParallel(boolean parallel) {
setParallelDef(parallel);
}
@@ -2136,7 +2159,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
* @deprecated since CDT 9.0. Use {@link #getParallelDef()}
*/
@Deprecated
- public boolean getInternalBuilderParallel(){
+ public boolean getInternalBuilderParallel() {
return getParallelDef();
}
@@ -2146,8 +2169,8 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
*
* @param parallel - the flag to enable or disable parallel mode.
*/
- public void setParallelDef(boolean parallel){
- if(getParallelDef() == parallel)
+ public void setParallelDef(boolean parallel) {
+ if (getParallelDef() == parallel)
return;
try {
@@ -2161,7 +2184,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
* Check if the configuration's builder is operating in parallel mode.
* @return {@code true} if parallel mode is enabled, {@code false} otherwise.
*/
- public boolean getParallelDef(){
+ public boolean getParallelDef() {
return getBuilder().isParallelBuildOn();
}
@@ -2171,7 +2194,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
* @param jobs - maximum number of jobs or threads. For details how
* the number is interpreted see {@link Builder#setParallelizationNum(int)}.
*/
- public void setParallelNumber(int jobs){
+ public void setParallelNumber(int jobs) {
try {
getEditableBuilder().setParallelizationNum(jobs);
} catch (CoreException e) {
@@ -2185,27 +2208,27 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
*
* @return - maximum number of parallel threads or jobs used by the builder.
*/
- public int getParallelNumber(){
+ public int getParallelNumber() {
return getBuilder().getParallelizationNum();
}
-// private Preferences getPreferences(String name){
-// if(isTemporary)
-// return null;
-//
-// IProject project = (IProject)getOwner();
-//
-// if(project == null || !project.exists() || !project.isOpen())
-// return null;
-//
-// Preferences prefs = new ProjectScope(project).getNode(ManagedBuilderCorePlugin.getUniqueIdentifier());
-// if(prefs != null){
-// prefs = prefs.node(getId());
-// if(prefs != null && name != null)
-// prefs = prefs.node(name);
-// }
-// return prefs;
-// }
+ // private Preferences getPreferences(String name){
+ // if(isTemporary)
+ // return null;
+ //
+ // IProject project = (IProject)getOwner();
+ //
+ // if(project == null || !project.exists() || !project.isOpen())
+ // return null;
+ //
+ // Preferences prefs = new ProjectScope(project).getNode(ManagedBuilderCorePlugin.getUniqueIdentifier());
+ // if(prefs != null){
+ // prefs = prefs.node(getId());
+ // if(prefs != null && name != null)
+ // prefs = prefs.node(name);
+ // }
+ // return prefs;
+ // }
@Override
public IResourceInfo[] getResourceInfos() {
@@ -2220,8 +2243,8 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
@Override
public IResourceInfo getResourceInfoById(String id) {
IResourceInfo infos[] = rcInfos.getResourceInfos();
- for(int i = 0; i < infos.length; i++){
- if(id.equals(infos[i].getId()))
+ for (int i = 0; i < infos.length; i++) {
+ if (id.equals(infos[i].getId()))
return infos[i];
}
return null;
@@ -2232,20 +2255,20 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
return rootFolderInfo;
}
- ResourceInfoContainer getRcInfoContainer(IResourceInfo rcInfo){
+ ResourceInfoContainer getRcInfoContainer(IResourceInfo rcInfo) {
PathSettingsContainer cr = pathSettings.getChildContainer(rcInfo.getPath(), true, true);
return new ResourceInfoContainer(cr, false);
}
@Override
- public CConfigurationData getConfigurationData(){
+ public CConfigurationData getConfigurationData() {
return fCfgData;
}
@Override
public void removeResourceInfo(IPath path) {
IResourceInfo info = getResourceInfo(path, true);
- if(info != null)
+ if (info != null)
removeResourceConfiguration(info);
}
@@ -2260,10 +2283,10 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public IFolderInfo createFolderInfo(IPath path, String id, String name) {
IResourceInfo info = getResourceInfo(path, false);
IFolderInfo folderInfo = null;
- if(info instanceof IFileInfo){
-// folderInfo = null;
- } else if (info instanceof IFolderInfo){
- IFolderInfo base = (IFolderInfo)info;
+ if (info instanceof IFileInfo) {
+ // folderInfo = null;
+ } else if (info instanceof IFolderInfo) {
+ IFolderInfo base = (IFolderInfo) info;
folderInfo = createFolderInfo(path, base, id, name);
}
return folderInfo;
@@ -2271,10 +2294,10 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
@Override
public IFolderInfo createFolderInfo(IPath path, IFolderInfo base, String id, String name) {
- if(base.getPath().equals(path))
+ if (base.getPath().equals(path))
return null;
- FolderInfo folderInfo = new FolderInfo((FolderInfo)base, id, name, path);
+ FolderInfo folderInfo = new FolderInfo((FolderInfo) base, id, name, path);
addResourceConfiguration(folderInfo);
folderInfo.propertiesChanged();
ManagedBuildManager.performValueHandlerEvent(folderInfo, IManagedOptionValueHandler.EVENT_OPEN);
@@ -2284,10 +2307,11 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
@Override
public ICSourceEntry[] getSourceEntries() {
- if(sourceEntries == null || sourceEntries.length == 0){
- if(parent != null && sourceEntries == null)
+ if (sourceEntries == null || sourceEntries.length == 0) {
+ if (parent != null && sourceEntries == null)
return parent.getSourceEntries();
- return new ICSourceEntry[]{new CSourceEntry(Path.EMPTY, null, ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED)};
+ return new ICSourceEntry[] {
+ new CSourceEntry(Path.EMPTY, null, ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED) };
}
return sourceEntries.clone();
@@ -2300,27 +2324,27 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public void setSourceEntries(ICSourceEntry[] entries, boolean setRebuildState) {
exportArtifactInfo();
- if(Arrays.equals(getSourceEntries(), entries))
+ if (Arrays.equals(getSourceEntries(), entries))
return;
- sourceEntries = entries != null ? (ICSourceEntry[])entries.clone() : null;
-// for(int i = 0; i < sourcePaths.length; i++){
-// sourcePaths[i] = sourcePaths[i].makeRelative();
-// }
- if(setRebuildState){
+ sourceEntries = entries != null ? (ICSourceEntry[]) entries.clone() : null;
+ // for(int i = 0; i < sourcePaths.length; i++){
+ // sourcePaths[i] = sourcePaths[i].makeRelative();
+ // }
+ if (setRebuildState) {
setDirty(true);
setRebuildState(true);
}
}
public void setErrorParserAttribute(String[] ids) {
- if(ids == null){
+ if (ids == null) {
setErrorParserIds(null);
- } else if(ids.length == 0){
+ } else if (ids.length == 0) {
setErrorParserIds(EMPTY_STRING);
} else {
StringBuilder buf = new StringBuilder();
buf.append(ids[0]);
- for(int i = 1; i < ids.length; i++){
+ for (int i = 1; i < ids.length; i++) {
buf.append(";").append(ids[i]); //$NON-NLS-1$
}
setErrorParserIds(buf.toString());
@@ -2329,7 +2353,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
@Override
public void setErrorParserList(String[] ids) {
- if(ids == null){
+ if (ids == null) {
//reset
resetErrorParsers();
} else {
@@ -2337,16 +2361,16 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
}
- public void resetErrorParsers(){
+ public void resetErrorParsers() {
errorParserIds = null;
IResourceInfo rcInfos[] = getResourceInfos();
- for(int i = 0; i < rcInfos.length; i++){
- ResourceInfo rcInfo = (ResourceInfo)rcInfos[i];
+ for (int i = 0; i < rcInfos.length; i++) {
+ ResourceInfo rcInfo = (ResourceInfo) rcInfos[i];
rcInfo.resetErrorParsers();
}
}
- void removeErrorParsers(Set<String> set){
+ void removeErrorParsers(Set<String> set) {
if (set != null && set.isEmpty()) {
Set<String> oldSet = contributeErrorParsers(null, false);
if (oldSet == null)
@@ -2369,19 +2393,19 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
@Override
- public IBuilder getEditableBuilder(){
+ public IBuilder getEditableBuilder() {
IToolChain tc = getToolChain();
IBuilder builder = tc.getBuilder();
- if(builder.isExtensionElement()){
+ if (builder.isExtensionElement()) {
String subId = ManagedBuildManager.calculateChildId(builder.getId(), null);
- String builderName = builder.getName() + "." + getName(); //$NON-NLS-1$
+ String builderName = builder.getName() + "." + getName(); //$NON-NLS-1$
builder = getToolChain().createBuilder(builder, subId, builderName, false);
}
return builder;
}
@Override
- public IBuilder getBuilder(){
+ public IBuilder getBuilder() {
return getToolChain().getBuilder();
}
@@ -2402,19 +2426,19 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
return flags;
}
- public ICConfigurationDescription getConfigurationDescription(){
+ public ICConfigurationDescription getConfigurationDescription() {
return fCfgDes;
}
- public void setConfigurationDescription(ICConfigurationDescription cfgDes){
+ public void setConfigurationDescription(ICConfigurationDescription cfgDes) {
fCfgDes = cfgDes;
}
@Override
public IBuildObjectProperties getBuildProperties() {
- if(buildProperties == null){
+ if (buildProperties == null) {
BuildObjectProperties parentProps = findBuildProperties();
- if(parentProps != null)
+ if (parentProps != null)
buildProperties = new BuildObjectProperties(parentProps, this, this);
else
buildProperties = new BuildObjectProperties(this, this);
@@ -2424,9 +2448,9 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
@Override
public IOptionalBuildProperties getOptionalBuildProperties() {
- if (optionalBuildProperties == null){
+ if (optionalBuildProperties == null) {
OptionalBuildProperties parentProps = findOptionalBuildProperties();
- if(parentProps != null)
+ if (parentProps != null)
optionalBuildProperties = new OptionalBuildProperties(parentProps);
else
optionalBuildProperties = new OptionalBuildProperties();
@@ -2434,20 +2458,20 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
return optionalBuildProperties;
}
- private BuildObjectProperties findBuildProperties(){
- if(buildProperties == null){
- if(parent != null){
- return ((Configuration)parent).findBuildProperties();
+ private BuildObjectProperties findBuildProperties() {
+ if (buildProperties == null) {
+ if (parent != null) {
+ return ((Configuration) parent).findBuildProperties();
}
return null;
}
return buildProperties;
}
-
- private OptionalBuildProperties findOptionalBuildProperties(){
- if (optionalBuildProperties == null){
- if (parent != null){
- return ((Configuration)parent).findOptionalBuildProperties();
+
+ private OptionalBuildProperties findOptionalBuildProperties() {
+ if (optionalBuildProperties == null) {
+ if (parent != null) {
+ return ((Configuration) parent).findOptionalBuildProperties();
}
return null;
}
@@ -2458,30 +2482,29 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
return supportsType(type.getId());
}
- public boolean supportsValue(IBuildPropertyType type,
- IBuildPropertyValue value) {
+ public boolean supportsValue(IBuildPropertyType type, IBuildPropertyValue value) {
return supportsValue(type.getId(), value.getId());
}
@Override
public void propertiesChanged() {
- if(isExtensionConfig)
+ if (isExtensionConfig)
return;
BooleanExpressionApplicabilityCalculator calculator = getBooleanExpressionCalculator();
- if(calculator != null)
+ if (calculator != null)
calculator.adjustConfiguration(this, false);
IResourceInfo infos[] = getResourceInfos();
- for(int i = 0; i < infos.length; i++){
- ((ResourceInfo)infos[i]).propertiesChanged();
+ for (int i = 0; i < infos.length; i++) {
+ ((ResourceInfo) infos[i]).propertiesChanged();
}
}
- public BooleanExpressionApplicabilityCalculator getBooleanExpressionCalculator(){
- if(booleanExpressionCalculator == null){
- if(parent != null){
- return ((Configuration)parent).getBooleanExpressionCalculator();
+ public BooleanExpressionApplicabilityCalculator getBooleanExpressionCalculator() {
+ if (booleanExpressionCalculator == null) {
+ if (parent != null) {
+ return ((Configuration) parent).getBooleanExpressionCalculator();
}
}
return booleanExpressionCalculator;
@@ -2489,10 +2512,10 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
@Override
public boolean isSystemObject() {
- if(isTest)
+ if (isTest)
return true;
- if(getProjectType() != null)
+ if (getProjectType() != null)
return getProjectType().isSystemObject();
return false;
@@ -2522,53 +2545,43 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
@Override
- public IManagedCommandLineInfo generateToolCommandLineInfo( String sourceExtension, String[] flags,
- String outputFlag, String outputPrefix, String outputName, String[] inputResources, IPath inputLocation, IPath outputLocation ){
+ public IManagedCommandLineInfo generateToolCommandLineInfo(String sourceExtension, String[] flags,
+ String outputFlag, String outputPrefix, String outputName, String[] inputResources, IPath inputLocation,
+ IPath outputLocation) {
ITool[] tools = getFilteredTools();
for (int index = 0; index < tools.length; index++) {
ITool tool = tools[index];
if (tool.buildsFileType(sourceExtension)) {
String cmd = tool.getToolCommand();
//try to resolve the build macros in the tool command
- try{
+ try {
String resolvedCommand = null;
if ((inputLocation != null && inputLocation.toString().indexOf(" ") != -1) || //$NON-NLS-1$
- (outputLocation != null && outputLocation.toString().indexOf(" ") != -1) ) //$NON-NLS-1$
+ (outputLocation != null && outputLocation.toString().indexOf(" ") != -1)) //$NON-NLS-1$
{
- resolvedCommand = ManagedBuildManager
- .getBuildMacroProvider().resolveValue(
- cmd,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(inputLocation,
- outputLocation, null,
- tool));
+ resolvedCommand = ManagedBuildManager.getBuildMacroProvider().resolveValue(cmd, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(inputLocation, outputLocation, null, tool));
}
else {
- resolvedCommand = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveValueToMakefileFormat(
- cmd,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(inputLocation,
- outputLocation, null,
- tool));
+ resolvedCommand = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(cmd,
+ "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(inputLocation, outputLocation, null, tool));
}
- if((resolvedCommand = resolvedCommand.trim()).length() > 0)
+ if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
cmd = resolvedCommand;
- } catch (BuildMacroException e){
+ } catch (BuildMacroException e) {
}
IManagedCommandLineGenerator gen = tool.getCommandLineGenerator();
- return gen.generateCommandLineInfo( tool, cmd,
- flags, outputFlag, outputPrefix, outputName, inputResources,
- tool.getCommandLinePattern() );
+ return gen.generateCommandLineInfo(tool, cmd, flags, outputFlag, outputPrefix, outputName,
+ inputResources, tool.getCommandLinePattern());
}
}
return null;
@@ -2578,40 +2591,39 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public String[] getUserObjects(String extension) {
Vector<String> objs = new Vector<String>();
ITool tool = calculateTargetTool();
- if(tool == null)
+ if (tool == null)
tool = getToolFromOutputExtension(extension);
- if(tool != null){
- IOption[] opts = tool.getOptions();
- // Look for the user object option type
- for (int i = 0; i < opts.length; i++) {
- IOption option = opts[i];
- try {
- if (option.getValueType() == IOption.OBJECTS) {
- String unresolved[] = option.getUserObjects();
- if(unresolved != null && unresolved.length > 0){
- for(int k = 0; k < unresolved.length; k++){
- try {
- String resolved[] = ManagedBuildManager.getBuildMacroProvider().resolveStringListValueToMakefileFormat(
- unresolved[k],
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_OPTION,
- new OptionContextData(option, tool));
- if(resolved != null && resolved.length > 0)
- objs.addAll(Arrays.asList(resolved));
- } catch (BuildMacroException e) {
- // TODO: report error
- continue;
- }
+ if (tool != null) {
+ IOption[] opts = tool.getOptions();
+ // Look for the user object option type
+ for (int i = 0; i < opts.length; i++) {
+ IOption option = opts[i];
+ try {
+ if (option.getValueType() == IOption.OBJECTS) {
+ String unresolved[] = option.getUserObjects();
+ if (unresolved != null && unresolved.length > 0) {
+ for (int k = 0; k < unresolved.length; k++) {
+ try {
+ String resolved[] = ManagedBuildManager.getBuildMacroProvider()
+ .resolveStringListValueToMakefileFormat(unresolved[k], "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_OPTION,
+ new OptionContextData(option, tool));
+ if (resolved != null && resolved.length > 0)
+ objs.addAll(Arrays.asList(resolved));
+ } catch (BuildMacroException e) {
+ // TODO: report error
+ continue;
}
}
}
- } catch (BuildException e) {
- // TODO: report error
- continue;
}
+ } catch (BuildException e) {
+ // TODO: report error
+ continue;
}
+ }
}
return objs.toArray(new String[objs.size()]);
}
@@ -2620,53 +2632,51 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public String[] getLibs(String extension) {
Vector<String> libs = new Vector<String>();
ITool tool = calculateTargetTool();
- if(tool == null)
+ if (tool == null)
tool = getToolFromOutputExtension(extension);
- if(tool != null){
- IOption[] opts = tool.getOptions();
- // Look for the lib option type
- for (int i = 0; i < opts.length; i++) {
- IOption option = opts[i];
- try {
- if (option.getValueType() == IOption.LIBRARIES) {
-
- // check to see if the option has an applicability calculator
- IOptionApplicability applicabilitytCalculator = option.getApplicabilityCalculator();
-
- if (applicabilitytCalculator == null
- || applicabilitytCalculator.isOptionUsedInCommandLine(this, tool, option)) {
- String command = option.getCommand();
- String[] allLibs = option.getLibraries();
- for (int j = 0; j < allLibs.length; j++)
- {
- try {
- String resolved[] = ManagedBuildManager.getBuildMacroProvider().resolveStringListValueToMakefileFormat(
- allLibs[j],
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_OPTION,
- new OptionContextData(option, tool));
- if(resolved != null && resolved.length > 0){
- for(int k = 0; k < resolved.length; k++){
- String string = resolved[k];
- if(string.length() > 0)
- libs.add(command + string);
- }
+ if (tool != null) {
+ IOption[] opts = tool.getOptions();
+ // Look for the lib option type
+ for (int i = 0; i < opts.length; i++) {
+ IOption option = opts[i];
+ try {
+ if (option.getValueType() == IOption.LIBRARIES) {
+
+ // check to see if the option has an applicability calculator
+ IOptionApplicability applicabilitytCalculator = option.getApplicabilityCalculator();
+
+ if (applicabilitytCalculator == null
+ || applicabilitytCalculator.isOptionUsedInCommandLine(this, tool, option)) {
+ String command = option.getCommand();
+ String[] allLibs = option.getLibraries();
+ for (int j = 0; j < allLibs.length; j++) {
+ try {
+ String resolved[] = ManagedBuildManager.getBuildMacroProvider()
+ .resolveStringListValueToMakefileFormat(allLibs[j], "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_OPTION,
+ new OptionContextData(option, tool));
+ if (resolved != null && resolved.length > 0) {
+ for (int k = 0; k < resolved.length; k++) {
+ String string = resolved[k];
+ if (string.length() > 0)
+ libs.add(command + string);
}
- } catch (BuildMacroException e) {
- // TODO: report error
- continue;
}
-
+ } catch (BuildMacroException e) {
+ // TODO: report error
+ continue;
}
+
}
}
- } catch (BuildException e) {
- // TODO: report error
- continue;
}
+ } catch (BuildException e) {
+ // TODO: report error
+ continue;
}
+ }
}
return libs.toArray(new String[libs.size()]);
}
@@ -2688,7 +2698,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
if (prop == null)
return false;
String valueId = prop.getValue().getId();
- if(!ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_SHAREDLIB.equals(valueId)
+ if (!ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_SHAREDLIB.equals(valueId)
&& !ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_STATICLIB.equals(valueId))
return false;
ICConfigurationDescription des = ManagedBuildManager.getDescriptionForConfiguration(this);
@@ -2702,12 +2712,12 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
* In this case it returns Include, Library path & Library File settings
* to be used be references for linking the output of this library project
*/
- public void exportArtifactInfo(){
+ public void exportArtifactInfo() {
if (!canExportedArtifactInfo())
return;
ICConfigurationDescription des = ManagedBuildManager.getDescriptionForConfiguration(this);
- if(des != null && !des.isReadOnly()){
+ if (des != null && !des.isReadOnly()) {
ICOutputEntry entries[] = getConfigurationData().getBuildData().getOutputDirectories();
IPath path = getOwner().getFullPath();
@@ -2718,19 +2728,21 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
// Add Build output path as an exported library path
entries = CDataUtil.resolveEntries(entries, des);
- for(int i = 0; i < entries.length; i++){
+ for (int i = 0; i < entries.length; i++) {
ICOutputEntry out = entries[i];
String value = out.getValue();
IPath p = new Path(value);
- if(!p.isAbsolute())
+ if (!p.isAbsolute())
value = getOwner().getFullPath().append(value).toString();
- ICLibraryPathEntry lib = CDataUtil.createCLibraryPathEntry(value, out.getFlags() & (~ICSettingEntry.RESOLVED));
+ ICLibraryPathEntry lib = CDataUtil.createCLibraryPathEntry(value,
+ out.getFlags() & (~ICSettingEntry.RESOLVED));
list.add(lib);
}
// Add 'libs' artifact names themselves
- ICSettingEntry[] unresolved = new ICSettingEntry[] {CDataUtil.createCLibraryFileEntry(getArtifactName(), 0)};
+ ICSettingEntry[] unresolved = new ICSettingEntry[] {
+ CDataUtil.createCLibraryFileEntry(getArtifactName(), 0) };
ICSettingEntry[] libFiles = CDataUtil.resolveEntries(unresolved, des);
list.add(libFiles[0]);
@@ -2746,14 +2758,14 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public boolean supportsBuild(boolean managed, boolean checkBuilder) {
IResourceInfo[] rcs = getResourceInfos();
- for(int i = 0; i < rcs.length; i++){
- if(!rcs[i].supportsBuild(managed))
+ for (int i = 0; i < rcs.length; i++) {
+ if (!rcs[i].supportsBuild(managed))
return false;
}
- if(checkBuilder){
+ if (checkBuilder) {
IBuilder builder = getBuilder();
- if(builder != null && !builder.supportsBuild(managed))
+ if (builder != null && !builder.supportsBuild(managed))
return false;
}
@@ -2764,12 +2776,12 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public boolean supportsType(String typeId) {
SupportedProperties props = findSupportedProperties();
boolean supports = false;
- if(props != null){
+ if (props != null) {
supports = props.supportsType(typeId);
}
- if(!supports)
- supports = ((ToolChain)getToolChain()).supportsType(typeId);
+ if (!supports)
+ supports = ((ToolChain) getToolChain()).supportsType(typeId);
return supports;
}
@@ -2778,26 +2790,26 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public boolean supportsValue(String typeId, String valueId) {
SupportedProperties props = findSupportedProperties();
boolean supports = false;
- if(props != null){
+ if (props != null) {
supports = props.supportsValue(typeId, valueId);
}
- if(!supports)
- supports = ((ToolChain)getToolChain()).supportsValue(typeId, valueId);
+ if (!supports)
+ supports = ((ToolChain) getToolChain()).supportsValue(typeId, valueId);
return supports;
}
- private SupportedProperties findSupportedProperties(){
- if(supportedProperties == null){
- if(parent != null){
- return ((Configuration)parent).findSupportedProperties();
+ private SupportedProperties findSupportedProperties() {
+ if (supportedProperties == null) {
+ if (parent != null) {
+ return ((Configuration) parent).findSupportedProperties();
}
}
return supportedProperties;
}
- private void loadProperties(IManagedConfigElement el){
+ private void loadProperties(IManagedConfigElement el) {
supportedProperties = new SupportedProperties(el);
}
@@ -2805,11 +2817,11 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public String[] getRequiredTypeIds() {
SupportedProperties props = findSupportedProperties();
List<String> list = new ArrayList<String>();
- if(props != null){
+ if (props != null) {
list.addAll(Arrays.asList(props.getRequiredTypeIds()));
}
- list.addAll(Arrays.asList(((ToolChain)getToolChain()).getRequiredTypeIds()));
+ list.addAll(Arrays.asList(((ToolChain) getToolChain()).getRequiredTypeIds()));
return list.toArray(new String[list.size()]);
}
@@ -2818,11 +2830,11 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public String[] getSupportedTypeIds() {
SupportedProperties props = findSupportedProperties();
List<String> list = new ArrayList<String>();
- if(props != null){
+ if (props != null) {
list.addAll(Arrays.asList(props.getSupportedTypeIds()));
}
- list.addAll(Arrays.asList(((ToolChain)getToolChain()).getSupportedTypeIds()));
+ list.addAll(Arrays.asList(((ToolChain) getToolChain()).getSupportedTypeIds()));
return list.toArray(new String[list.size()]);
}
@@ -2831,11 +2843,11 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public String[] getSupportedValueIds(String typeId) {
SupportedProperties props = findSupportedProperties();
List<String> list = new ArrayList<String>();
- if(props != null){
+ if (props != null) {
list.addAll(Arrays.asList(props.getSupportedValueIds(typeId)));
}
- list.addAll(Arrays.asList(((ToolChain)getToolChain()).getSupportedValueIds(typeId)));
+ list.addAll(Arrays.asList(((ToolChain) getToolChain()).getSupportedValueIds(typeId)));
return list.toArray(new String[list.size()]);
}
@@ -2844,12 +2856,12 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
public boolean requiresType(String typeId) {
SupportedProperties props = findSupportedProperties();
boolean requires = false;
- if(props != null){
+ if (props != null) {
requires = props.requiresType(typeId);
}
- if(!requires)
- requires = ((ToolChain)getToolChain()).requiresType(typeId);
+ if (!requires)
+ requires = ((ToolChain) getToolChain()).requiresType(typeId);
return requires;
}
@@ -2869,23 +2881,25 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
@Override
- public void changeBuilder(IBuilder newBuilder, String id, String name){
+ public void changeBuilder(IBuilder newBuilder, String id, String name) {
changeBuilder(newBuilder, id, name, false);
}
- public void changeBuilder(IBuilder newBuilder, String id, String name, boolean allBuildSettings){
- ToolChain tc = (ToolChain)getToolChain();
- Builder cur = (Builder)getEditableBuilder();
+ public void changeBuilder(IBuilder newBuilder, String id, String name, boolean allBuildSettings) {
+ ToolChain tc = (ToolChain) getToolChain();
+ Builder cur = (Builder) getEditableBuilder();
Builder newCfgBuilder = null;
- if(newBuilder.getParent() == tc){
- newCfgBuilder = (Builder)newBuilder;
+ if (newBuilder.getParent() == tc) {
+ newCfgBuilder = (Builder) newBuilder;
} else {
IBuilder curReal = ManagedBuildManager.getRealBuilder(cur);
IBuilder newReal = ManagedBuildManager.getRealBuilder(newBuilder);
- if(newReal != curReal){
+ if (newReal != curReal) {
IBuilder extBuilder = newBuilder;
- for(;extBuilder != null && !extBuilder.isExtensionElement(); extBuilder = extBuilder.getSuperClass()) {}
- if(extBuilder == null)
+ for (; extBuilder != null
+ && !extBuilder.isExtensionElement(); extBuilder = extBuilder.getSuperClass()) {
+ }
+ if (extBuilder == null)
extBuilder = newBuilder;
newCfgBuilder = new Builder(tc, extBuilder, id, name, false);
@@ -2893,98 +2907,98 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
}
}
- if(newCfgBuilder != null){
+ if (newCfgBuilder != null) {
tc.setBuilder(newCfgBuilder);
}
}
@Override
- public boolean isBuilderCompatible(IBuilder builder){
+ public boolean isBuilderCompatible(IBuilder builder) {
return builder.supportsBuild(isManagedBuildOn());
}
- ITool findToolById(String id){
+ ITool findToolById(String id) {
IResourceInfo[] rcInfos = getResourceInfos();
ITool tool = null;
- for(int i = 0; i < rcInfos.length; i++){
- ResourceInfo info = (ResourceInfo)rcInfos[i];
+ for (int i = 0; i < rcInfos.length; i++) {
+ ResourceInfo info = (ResourceInfo) rcInfos[i];
tool = info.getToolById(id);
- if(tool != null)
+ if (tool != null)
break;
}
return tool;
}
- void resolveProjectReferences(boolean onLoad){
+ void resolveProjectReferences(boolean onLoad) {
IResourceInfo[] rcInfos = getResourceInfos();
- for(int i = 0; i < rcInfos.length; i++){
- ResourceInfo info = (ResourceInfo)rcInfos[i];
+ for (int i = 0; i < rcInfos.length; i++) {
+ ResourceInfo info = (ResourceInfo) rcInfos[i];
info.resolveProjectReferences(onLoad);
}
}
- public boolean isPerRcTypeDiscovery(){
- ToolChain tc = (ToolChain)getRootFolderInfo().getToolChain();
+ public boolean isPerRcTypeDiscovery() {
+ ToolChain tc = (ToolChain) getRootFolderInfo().getToolChain();
return tc.isPerRcTypeDiscovery();
}
- public void setPerRcTypeDiscovery(boolean on){
- ToolChain tc = (ToolChain)getRootFolderInfo().getToolChain();
+ public void setPerRcTypeDiscovery(boolean on) {
+ ToolChain tc = (ToolChain) getRootFolderInfo().getToolChain();
tc.setPerRcTypeDiscovery(on);
}
-// public IScannerConfigBuilderInfo2 getScannerConfigInfo(){
-// ToolChain tc = (ToolChain)getRootFolderInfo().getToolChain();
-// return tc.getScannerConfigBuilderInfo();
-// }
+ // public IScannerConfigBuilderInfo2 getScannerConfigInfo(){
+ // ToolChain tc = (ToolChain)getRootFolderInfo().getToolChain();
+ // return tc.getScannerConfigBuilderInfo();
+ // }
-// public IScannerConfigBuilderInfo2 setScannerConfigInfo(IScannerConfigBuilderInfo2 info){
-// ToolChain tc = (ToolChain)getRootFolderInfo().getToolChain();
-// return tc.setScannerConfigBuilderInfo(info);
-// }
+ // public IScannerConfigBuilderInfo2 setScannerConfigInfo(IScannerConfigBuilderInfo2 info){
+ // ToolChain tc = (ToolChain)getRootFolderInfo().getToolChain();
+ // return tc.setScannerConfigBuilderInfo(info);
+ // }
- public PathInfoCache setDiscoveredPathInfo(PathInfoCache info){
- ToolChain tc = (ToolChain)getRootFolderInfo().getToolChain();
+ public PathInfoCache setDiscoveredPathInfo(PathInfoCache info) {
+ ToolChain tc = (ToolChain) getRootFolderInfo().getToolChain();
return tc.setDiscoveredPathInfo(info);
}
- public PathInfoCache getDiscoveredPathInfo(){
- ToolChain tc = (ToolChain)getRootFolderInfo().getToolChain();
+ public PathInfoCache getDiscoveredPathInfo() {
+ ToolChain tc = (ToolChain) getRootFolderInfo().getToolChain();
return tc.getDiscoveredPathInfo();
}
- public String getDiscoveryProfileId(){
- ToolChain tc = (ToolChain)getRootFolderInfo().getToolChain();
+ public String getDiscoveryProfileId() {
+ ToolChain tc = (ToolChain) getRootFolderInfo().getToolChain();
return tc.getScannerConfigDiscoveryProfileId();
}
- public PathInfoCache clearDiscoveredPathInfo(){
- ToolChain tc = (ToolChain)getRootFolderInfo().getToolChain();
+ public PathInfoCache clearDiscoveredPathInfo() {
+ ToolChain tc = (ToolChain) getRootFolderInfo().getToolChain();
return tc.clearDiscoveredPathInfo();
}
- public ICfgScannerConfigBuilderInfo2Set getCfgScannerConfigInfo(){
+ public ICfgScannerConfigBuilderInfo2Set getCfgScannerConfigInfo() {
return cfgScannerInfo;
}
- public void setCfgScannerConfigInfo(ICfgScannerConfigBuilderInfo2Set info){
+ public void setCfgScannerConfigInfo(ICfgScannerConfigBuilderInfo2Set info) {
cfgScannerInfo = info;
}
- public void clearCachedData(){
+ public void clearCachedData() {
cfgScannerInfo = null;
}
- public boolean isPreference(){
+ public boolean isPreference() {
return isPreferenceConfig;
}
@Override
public IBuildPropertyValue getBuildArtefactType() {
IBuildObjectProperties props = findBuildProperties();
- if(props != null){
+ if (props != null) {
IBuildProperty prop = props.getProperty(ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID);
- if(prop != null)
+ if (prop != null)
return prop.getValue();
}
return null;
@@ -2995,34 +3009,34 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
IBuildObjectProperties props = getBuildProperties();
try {
props.setProperty(ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID, id);
- } catch (CoreException e){
+ } catch (CoreException e) {
throw new BuildException(e.getLocalizedMessage());
}
// May need to update the exports paths & symbols after artifact type change
exportArtifactInfo();
}
- boolean isExcluded(IPath path){
-// if(path.segmentCount() == 0)
-// return false;
+ boolean isExcluded(IPath path) {
+ // if(path.segmentCount() == 0)
+ // return false;
ICSourceEntry[] entries = getSourceEntries();
return CDataUtil.isExcluded(path, entries);
}
- void setExcluded(IPath path, boolean isFolder, boolean excluded){
-// if(path.segmentCount() == 0)
-// return;
- if(excludeList == null) {
+ void setExcluded(IPath path, boolean isFolder, boolean excluded) {
+ // if(path.segmentCount() == 0)
+ // return;
+ if (excludeList == null) {
ICSourceEntry[] newEntries = getUpdatedEntries(path, isFolder, excluded);
- if(newEntries != null)
+ if (newEntries != null)
setSourceEntries(newEntries, false);
- } else{
- if(excluded)
+ } else {
+ if (excluded)
excludeList.add(path);
}
}
- private ICSourceEntry[] getUpdatedEntries(IPath path, boolean isFolder, boolean excluded){
+ private ICSourceEntry[] getUpdatedEntries(IPath path, boolean isFolder, boolean excluded) {
try {
ICSourceEntry[] entries = getSourceEntries();
return CDataUtil.setExcluded(path, isFolder, excluded, entries, false);
@@ -3032,12 +3046,12 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
return null;
}
- boolean canExclude(IPath path, boolean isFolder, boolean excluded){
- if(excludeList == null) {
+ boolean canExclude(IPath path, boolean isFolder, boolean excluded) {
+ if (excludeList == null) {
ICSourceEntry[] newEntries = getUpdatedEntries(path, isFolder, excluded);
return newEntries != null;
- } else{
- if(excluded)
+ } else {
+ if (excluded)
excludeList.add(path);
return true;
}
@@ -3045,12 +3059,12 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
@Override
public IRealBuildObjectAssociation getExtensionObject() {
- return isExtensionConfig ? this : (Configuration)getParent();
+ return isExtensionConfig ? this : (Configuration) getParent();
}
@Override
public IRealBuildObjectAssociation[] getIdenticBuildObjects() {
- return new Configuration[]{(Configuration)getExtensionObject()};
+ return new Configuration[] { (Configuration) getExtensionObject() };
}
@Override
@@ -3060,7 +3074,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
@Override
public IRealBuildObjectAssociation getSuperClassObject() {
- return (IRealBuildObjectAssociation)getParent();
+ return (IRealBuildObjectAssociation) getParent();
}
@Override
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 44b13f46927..d8e58e1a87e 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
@@ -29,14 +29,13 @@ public class ConfigurationNameProvider implements IConfigurationNameProvider {
* @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) {
+ public String getNewConfigurationName(IConfiguration configuration, String[] usedConfigurationNames) {
// TODO Auto-generated method stub
return null;
}
public static ConfigurationNameProvider getConfigurationNameProvider() {
- if( configurationNameProvider == null)
+ if (configurationNameProvider == null)
configurationNameProvider = new ConfigurationNameProvider();
return 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 b4b700a4261..6ca2cd399df 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
@@ -75,8 +75,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
// If so, then get my parent from it
if (targetParent != null) {
parent = targetParent.getConfiguration(element.getAttribute(IConfigurationV2.PARENT));
- }
- else {
+ } else {
parent = null;
}
}
@@ -85,7 +84,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
for (int i = 0; i < configElements.getLength(); ++i) {
Node configElement = configElements.item(i);
if (configElement.getNodeName().equals(IConfigurationV2.TOOLREF_ELEMENT_NAME)) {
- new ToolReference(this, (Element)configElement);
+ new ToolReference(this, (Element) configElement);
}
}
@@ -114,7 +113,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
// Get the tool references from the target and parent
List<IToolReference> allToolRefs = new Vector<IToolReference>(target.getLocalToolReferences());
- allToolRefs.addAll(((ConfigurationV2)parentConfig).getLocalToolReferences());
+ allToolRefs.addAll(((ConfigurationV2) parentConfig).getLocalToolReferences());
for (IToolReference toolRef : allToolRefs) {
// Make a new ToolReference based on the tool in the ref
ITool parentTool = toolRef.getTool();
@@ -131,31 +130,31 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
IOption opt = optRef.getOption();
try {
switch (opt.getValueType()) {
- case IOption.BOOLEAN:
- new OptionReference(newRef, opt).setValue(optRef.getBooleanValue());
- break;
- case IOption.STRING:
- case IOption.TREE:
- new OptionReference(newRef, opt).setValue(optRef.getStringValue());
- break;
- case IOption.ENUMERATED:
- new OptionReference(newRef, opt).setValue(optRef.getSelectedEnum());
- break;
- case IOption.STRING_LIST :
- new OptionReference(newRef, opt).setValue(optRef.getStringListValue());
- break;
- case IOption.INCLUDE_PATH :
- new OptionReference(newRef, opt).setValue(optRef.getIncludePaths());
- break;
- case IOption.PREPROCESSOR_SYMBOLS :
- new OptionReference(newRef, opt).setValue(optRef.getDefinedSymbols());
- break;
- case IOption.LIBRARIES :
+ case IOption.BOOLEAN:
+ new OptionReference(newRef, opt).setValue(optRef.getBooleanValue());
+ break;
+ case IOption.STRING:
+ case IOption.TREE:
+ new OptionReference(newRef, opt).setValue(optRef.getStringValue());
+ break;
+ case IOption.ENUMERATED:
+ new OptionReference(newRef, opt).setValue(optRef.getSelectedEnum());
+ break;
+ case IOption.STRING_LIST:
+ new OptionReference(newRef, opt).setValue(optRef.getStringListValue());
+ break;
+ case IOption.INCLUDE_PATH:
+ new OptionReference(newRef, opt).setValue(optRef.getIncludePaths());
+ break;
+ case IOption.PREPROCESSOR_SYMBOLS:
+ new OptionReference(newRef, opt).setValue(optRef.getDefinedSymbols());
+ break;
+ case IOption.LIBRARIES:
new OptionReference(newRef, opt).setValue(optRef.getLibraries());
- break;
- case IOption.OBJECTS :
+ break;
+ case IOption.OBJECTS:
new OptionReference(newRef, opt).setValue(optRef.getUserObjects());
- break;
+ break;
}
} catch (BuildException e) {
continue;
@@ -210,10 +209,10 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
public void resolveReferences() {
if (!resolved) {
resolved = true;
-// IManagedConfigElement element = ManagedBuildManager.getConfigElement(this);
+ // IManagedConfigElement element = ManagedBuildManager.getConfigElement(this);
List<IToolReference> localToolReferences = getLocalToolReferences();
for (IToolReference ref : localToolReferences) {
- ((ToolReference)ref).resolveReferences();
+ ((ToolReference) ref).resolveReferences();
}
}
}
@@ -246,7 +245,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
// The option may already be a reference created to hold user settings
if (option instanceof OptionReference) {
// The option reference belongs to an existing tool reference
- OptionReference optionRef = (OptionReference)option;
+ OptionReference optionRef = (OptionReference) option;
searchRef = optionRef.getToolReference();
// That tool reference may belong to a target or to the configuration
@@ -265,9 +264,9 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
// Find out if a tool reference already exists.
// Note: as in MBS 2.0 the ITool == IHoldsOptions was always
// true, just up-cast the pointers.
- searchRef = (ToolReference) getToolReference((ITool)option.getOptionHolder());
+ searchRef = (ToolReference) getToolReference((ITool) option.getOptionHolder());
if (searchRef == null) {
- answer = new ToolReference(this, (ITool)option.getOptionHolder());
+ answer = new ToolReference(this, (ITool) option.getOptionHolder());
} else {
// The reference may belong to the target
if (!searchRef.ownedByConfiguration(this)) {
@@ -306,21 +305,22 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
try {
// Make sure the tool is right for the project
switch (tool.getNatureFilter()) {
- case ITool.FILTER_C:
- if (project.hasNature(CProjectNature.C_NATURE_ID) && !project.hasNature(CCProjectNature.CC_NATURE_ID)) {
- tools.add(tool);
- }
- break;
- case ITool.FILTER_CC:
- if (project.hasNature(CCProjectNature.CC_NATURE_ID)) {
- tools.add(tool);
- }
- break;
- case ITool.FILTER_BOTH:
+ case ITool.FILTER_C:
+ if (project.hasNature(CProjectNature.C_NATURE_ID)
+ && !project.hasNature(CCProjectNature.CC_NATURE_ID)) {
tools.add(tool);
- break;
- default:
- break;
+ }
+ break;
+ case ITool.FILTER_CC:
+ if (project.hasNature(CCProjectNature.CC_NATURE_ID)) {
+ tools.add(tool);
+ }
+ break;
+ case ITool.FILTER_BOTH:
+ tools.add(tool);
+ break;
+ default:
+ break;
}
} catch (CoreException e) {
continue;
@@ -357,12 +357,10 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
*/
@Override
public ITool[] getTools() {
- ITool[] tools = parent != null
- ? parent.getTools()
- : target.getTools();
+ ITool[] tools = parent != null ? parent.getTools() : target.getTools();
// Validate that the tools correspond to the nature
- IProject project = (IProject)target.getOwner();
+ IProject project = (IProject) target.getOwner();
if (project != null) {
List<ITool> validTools = new ArrayList<ITool>();
@@ -371,27 +369,28 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
ITool tool = tools[i];
// Make sure the tool filter and project nature agree
switch (tool.getNatureFilter()) {
- case ITool.FILTER_C:
- try {
- if (project.hasNature(CProjectNature.C_NATURE_ID) && !project.hasNature(CCProjectNature.CC_NATURE_ID)) {
- validTools.add(tool);
- }
- } catch (CoreException e) {
- continue;
+ case ITool.FILTER_C:
+ try {
+ if (project.hasNature(CProjectNature.C_NATURE_ID)
+ && !project.hasNature(CCProjectNature.CC_NATURE_ID)) {
+ validTools.add(tool);
}
- break;
- case ITool.FILTER_CC:
- try {
- if (project.hasNature(CCProjectNature.CC_NATURE_ID)) {
- validTools.add(tool);
- }
- } catch (CoreException e) {
- continue;
+ } catch (CoreException e) {
+ continue;
+ }
+ break;
+ case ITool.FILTER_CC:
+ try {
+ if (project.hasNature(CCProjectNature.CC_NATURE_ID)) {
+ validTools.add(tool);
}
- break;
- case ITool.FILTER_BOTH:
- validTools.add(tool);
- break;
+ } catch (CoreException e) {
+ continue;
+ }
+ break;
+ case ITool.FILTER_BOTH:
+ validTools.add(tool);
+ break;
}
}
// Now put the valid tools back into the array
@@ -414,12 +413,14 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
@Override
public boolean isDirty() {
// If I need saving, just say yes
- if (isDirty) return true;
+ 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;
+ if (ref.isDirty())
+ return true;
}
return isDirty;
@@ -457,7 +458,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
// See if there is anything that my parents add that I don't
if (parent != null) {
- List<OptionReference> temp = ((ConfigurationV2)parent).getOptionReferences(tool);
+ List<OptionReference> temp = ((ConfigurationV2) parent).getOptionReferences(tool);
for (OptionReference ref : temp) {
if (!references.contains(ref)) {
references.add(ref);
@@ -473,9 +474,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
*/
@Override
public ITool getToolById(String id) {
- ITool[] tools = parent != null
- ? parent.getTools()
- : target.getTools();
+ ITool[] tools = parent != null ? parent.getTools() : target.getTools();
// Replace tools with local overrides
for (int i = 0; i < tools.length; ++i) {
@@ -519,7 +518,8 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
*/
private IToolReference getToolReference(ITool tool) {
// Sanity
- if (tool == null) return null;
+ if (tool == null)
+ return null;
// See if the receiver has a reference to the tool
List<IToolReference> localToolReferences = getLocalToolReferences();
@@ -534,8 +534,8 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
for (int index = targetTools.length - 1; index >= 0; --index) {
ITool targetTool = targetTools[index];
if (targetTool instanceof ToolReference) {
- if (((ToolReference)targetTool).references(tool)) {
- return (ToolReference)targetTool;
+ if (((ToolReference) targetTool).references(tool)) {
+ return (ToolReference) targetTool;
}
}
}
@@ -573,7 +573,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
for (IToolReference toolRef : localToolReferences) {
Element toolRefElement = doc.createElement(IConfigurationV2.TOOLREF_ELEMENT_NAME);
element.appendChild(toolRefElement);
- ((ToolReference)toolRef).serialize(doc, toolRefElement);
+ ((ToolReference) toolRef).serialize(doc, toolRefElement);
}
// I am clean now
@@ -590,7 +590,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
// And do the same for the tool references
List<IToolReference> localToolReferences = getLocalToolReferences();
for (IToolReference toolRef : localToolReferences) {
- ((ToolReference)toolRef).setDirty(isDirty);
+ ((ToolReference) toolRef).setDirty(isDirty);
}
}
@@ -616,8 +616,7 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
// Check whether this is an enumerated option
if (option.getValueType() == IOption.ENUMERATED) {
oldValue = option.getSelectedEnum();
- }
- else {
+ } else {
oldValue = option.getStringValue();
}
if (oldValue != null && !oldValue.equals(value)) {
@@ -635,26 +634,26 @@ public class ConfigurationV2 extends BuildObject implements IConfigurationV2 {
// Is there a delta
String[] oldValue;
switch (option.getValueType()) {
- case IOption.STRING_LIST :
- oldValue = option.getStringListValue();
- break;
- case IOption.INCLUDE_PATH :
- oldValue = option.getIncludePaths();
- break;
- case IOption.PREPROCESSOR_SYMBOLS :
- oldValue = option.getDefinedSymbols();
- break;
- case IOption.LIBRARIES :
- oldValue = option.getLibraries();
- break;
- case IOption.OBJECTS :
- oldValue = option.getUserObjects();
- break;
- default :
- oldValue = new String[0];
- break;
+ case IOption.STRING_LIST:
+ oldValue = option.getStringListValue();
+ break;
+ case IOption.INCLUDE_PATH:
+ oldValue = option.getIncludePaths();
+ break;
+ case IOption.PREPROCESSOR_SYMBOLS:
+ oldValue = option.getDefinedSymbols();
+ break;
+ case IOption.LIBRARIES:
+ oldValue = option.getLibraries();
+ break;
+ case IOption.OBJECTS:
+ oldValue = option.getUserObjects();
+ break;
+ default:
+ oldValue = new String[0];
+ break;
}
- if(!Arrays.equals(value, oldValue)) {
+ if (!Arrays.equals(value, oldValue)) {
createOptionReference(option).setValue(value);
isDirty = true;
rebuildNeeded = true;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ConverterInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ConverterInfo.java
index df0d102c28d..9dd1e8dbd35 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ConverterInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ConverterInfo.java
@@ -29,23 +29,24 @@ public class ConverterInfo {
private IBuildObject fToObject;
private boolean fIsConversionPerformed;
private IResourceInfo fRcInfo;
-
- public ConverterInfo(IResourceInfo rcInfo, IBuildObject fromObject, IBuildObject toObject, IConfigurationElement el){
+
+ public ConverterInfo(IResourceInfo rcInfo, IBuildObject fromObject, IBuildObject toObject,
+ IConfigurationElement el) {
fFromObject = fromObject;
fToObject = toObject;
fRcInfo = rcInfo;
}
-
- public IBuildObject getFromObject(){
+
+ public IBuildObject getFromObject() {
return fFromObject;
}
- public IBuildObject getToObject(){
+ public IBuildObject getToObject() {
return fToObject;
}
-
- public IBuildObject getConvertedFromObject(){
- if(!fIsConversionPerformed){
+
+ public IBuildObject getConvertedFromObject() {
+ if (!fIsConversionPerformed) {
ManagedProject mProj = getManagedProject();
IConfiguration[] cfgs = mProj.getConfigurations();
fConvertedFromObject = ManagedBuildManager.convert(fFromObject, fToObject.getId(), true);
@@ -55,20 +56,20 @@ public class ConverterInfo {
Set<IConfiguration> oldSetCopy = new HashSet<IConfiguration>(oldSet);
oldSet.removeAll(updatedSet);
updatedSet.removeAll(oldSetCopy);
- if(updatedSet.size() != 0)
- for(IConfiguration cfg : updatedSet)
+ if (updatedSet.size() != 0)
+ for (IConfiguration cfg : updatedSet)
mProj.removeConfiguration(cfg.getId());
- if(oldSet.size() != 0)
- for(IConfiguration cfg : oldSet)
- mProj.applyConfiguration((Configuration)cfg);
+ if (oldSet.size() != 0)
+ for (IConfiguration cfg : oldSet)
+ mProj.applyConfiguration((Configuration) cfg);
fIsConversionPerformed = true;
}
return fConvertedFromObject;
}
-
- private ManagedProject getManagedProject(){
- if(fRcInfo != null)
- return (ManagedProject)fRcInfo.getParent().getManagedProject();
+
+ private ManagedProject getManagedProject() {
+ if (fRcInfo != null)
+ return (ManagedProject) fRcInfo.getParent().getManagedProject();
return null;
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/DbgUtilBase.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/DbgUtilBase.java
index 00828c36f53..d746efd0f3b 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/DbgUtilBase.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/DbgUtilBase.java
@@ -19,25 +19,25 @@ public abstract class DbgUtilBase {
protected int fFlags = ~0;
protected PrintStream fOut = System.out;
protected boolean fDbgOn;
-
- public void traceln(int flags, String str){
- if(dbgOn(flags))
+
+ public void traceln(int flags, String str) {
+ if (dbgOn(flags))
doTraceln(str);
}
-
- protected void doTraceln(String str){
+
+ protected void doTraceln(String str) {
fOut.println(str);
}
- protected boolean dbgOn(int flags){
- return fDbgOn && checkFlags(flags);
+ protected boolean dbgOn(int flags) {
+ return fDbgOn && checkFlags(flags);
}
- protected boolean checkFlags(int check){
+ protected boolean checkFlags(int check) {
return checkFlags(fFlags, check);
}
- protected static boolean checkFlags(int flags, int check){
+ protected static boolean checkFlags(int flags, int check) {
return (flags & check) == check;
}
}
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 54e003fe151..c039fae06eb 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
@@ -79,9 +79,7 @@ public class DefaultManagedConfigElement implements IManagedConfigElement {
* Convenience method for converting an array of IConfigurationElements
* into an array of IManagedConfigElements.
*/
- public static IManagedConfigElement[] convertArray(
- IConfigurationElement[] elements,
- IExtension extension) {
+ public static IManagedConfigElement[] convertArray(IConfigurationElement[] elements, IExtension extension) {
IManagedConfigElement[] ret = new IManagedConfigElement[elements.length];
for (int i = 0; i < elements.length; i++) {
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 20fd3e9ec69..3cf12b87422 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
@@ -23,8 +23,7 @@ import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
-public class EnvVarBuildPath implements
- IEnvVarBuildPath {
+public class EnvVarBuildPath implements IEnvVarBuildPath {
private int fType;
private String fVariableNames[];
@@ -32,7 +31,6 @@ public class EnvVarBuildPath implements
private IBuildPathResolver fBuildPathResolver;
private IConfigurationElement fBuildPathResolverElement;
-
/**
* Constructor to create an EnvVarBuildPath based on an element from the plugin
* manifest.
@@ -59,7 +57,7 @@ public class EnvVarBuildPath implements
// 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();
}
}
@@ -68,7 +66,7 @@ public class EnvVarBuildPath implements
return fType;
}
- public void setType(int type){
+ public void setType(int type) {
this.fType = type;
}
@@ -77,17 +75,17 @@ public class EnvVarBuildPath implements
return fVariableNames;
}
- public void setVariableNames(String names[]){
+ public void setVariableNames(String names[]) {
fVariableNames = names;
fVariableNames = SafeStringInterner.safeIntern(fVariableNames);
}
- public void setVariableNames(String names){
+ public void setVariableNames(String names) {
setVariableNames(getNamesFromString(names));
}
- public String[] getNamesFromString(String names){
- if(names == null)
+ public String[] getNamesFromString(String names) {
+ if (names == null)
return null;
return names.split(NAME_SEPARATOR);
}
@@ -98,25 +96,27 @@ public class EnvVarBuildPath implements
}
public void setPathDelimiter(String delimiter) {
- if(delimiter == null)
+ if (delimiter == null)
delimiter = ManagedBuildManager.getEnvironmentVariableProvider().getDefaultDelimiter();
fPathDelimiter = SafeStringInterner.safeIntern(delimiter);
}
- private int convertPathTypeToInt(String pathType){
- if(pathType != null && TYPE_LIBRARY.equals(pathType))
+ private int convertPathTypeToInt(String pathType) {
+ if (pathType != null && TYPE_LIBRARY.equals(pathType))
return BUILDPATH_LIBRARY;
return BUILDPATH_INCLUDE;
}
@Override
public IBuildPathResolver getBuildPathResolver() {
- if(fBuildPathResolver == null && fBuildPathResolverElement != null){
+ if (fBuildPathResolver == null && fBuildPathResolverElement != null) {
try {
if (fBuildPathResolverElement.getAttribute(BUILD_PATH_RESOLVER) != null) {
- fBuildPathResolver = (IBuildPathResolver) fBuildPathResolverElement.createExecutableExtension(BUILD_PATH_RESOLVER);
+ fBuildPathResolver = (IBuildPathResolver) fBuildPathResolverElement
+ .createExecutableExtension(BUILD_PATH_RESOLVER);
}
- } catch (CoreException e) {}
+ } catch (CoreException e) {
+ }
}
return fBuildPathResolver;
}
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 f34af50ab4a..387702382b8 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
@@ -68,19 +68,19 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
private boolean isExtensionElement;
private boolean containsDiscoveredScannerInfo = true;
- public FolderInfo(FolderInfo folderInfo, String id, String resourceName, IPath path){
+ public FolderInfo(FolderInfo folderInfo, String id, String resourceName, IPath path) {
super(folderInfo, path, id, resourceName);
isExtensionElement = folderInfo.isExtensionElement();
- if(!isExtensionElement)
+ if (!isExtensionElement)
setResourceData(new BuildFolderData(this));
- if ( folderInfo.getParent() != null)
+ if (folderInfo.getParent() != null)
setManagedBuildRevision(folderInfo.getParent().getManagedBuildRevision());
IToolChain parTc = folderInfo.getToolChain();
IToolChain extTc = ManagedBuildManager.getExtensionToolChain(parTc);
- if(extTc == null)
+ if (extTc == null)
extTc = parTc;
String tcId = ManagedBuildManager.calculateChildId(extTc.getId(), null);
@@ -93,7 +93,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
String subId = ""; //$NON-NLS-1$
for (ITool tool : tools) {
ITool extTool = ManagedBuildManager.getExtensionTool(tool);
- if(extTool == null)
+ if (extTool == null)
extTool = tool;
subId = ManagedBuildManager.calculateChildId(extTool.getId(), null);
@@ -103,23 +103,24 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
setRebuildState(true);
}
- public FolderInfo(IConfiguration parent, IManagedConfigElement element, String managedBuildRevision, boolean hasBody) {
+ public FolderInfo(IConfiguration parent, IManagedConfigElement element, String managedBuildRevision,
+ boolean hasBody) {
super(parent, element, hasBody);
isExtensionElement = true;
IManagedConfigElement tcEl = null;
- if(!hasBody){
+ if (!hasBody) {
setPath(Path.ROOT);
setId(ManagedBuildManager.calculateChildId(parent.getId(), null));
setName("/"); //$NON-NLS-1$
tcEl = element;
} else {
IManagedConfigElement children[] = element.getChildren(IToolChain.TOOL_CHAIN_ELEMENT_NAME);
- if(children.length > 0)
+ if (children.length > 0)
tcEl = children[0];
}
- if(tcEl != null)
+ if (tcEl != null)
toolChain = new ToolChain(this, tcEl, managedBuildRevision);
}
@@ -130,7 +131,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
isExtensionElement = false;
setResourceData(new BuildFolderData(this));
ICStorageElement tcEl = null;
- if(!hasBody){
+ if (!hasBody) {
setPath(Path.ROOT);
setId(ManagedBuildManager.calculateChildId(parent.getId(), null));
setName("/"); //$NON-NLS-1$
@@ -138,59 +139,59 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
} else {
ICStorageElement nodes[] = element.getChildren();
for (ICStorageElement node : nodes) {
- if(IToolChain.TOOL_CHAIN_ELEMENT_NAME.equals(node.getName()))
+ if (IToolChain.TOOL_CHAIN_ELEMENT_NAME.equals(node.getName()))
tcEl = node;
}
}
- if(tcEl != null)
+ if (tcEl != null)
toolChain = new ToolChain(this, tcEl, managedBuildRevision);
}
-/*TODO
- public FolderInfo(FolderInfo base, IPath path, String id, String name) {
- super(base, path, id, name);
- }
-*/
+
+ /*TODO
+ public FolderInfo(FolderInfo base, IPath path, String id, String name) {
+ super(base, path, id, name);
+ }
+ */
public FolderInfo(IConfiguration parent, IPath path, String id, String name, boolean isExtensionElement) {
super(parent, path, id, name);
this.isExtensionElement = isExtensionElement;
- if(!isExtensionElement)
+ if (!isExtensionElement)
setResourceData(new BuildFolderData(this));
}
- public FolderInfo(IConfiguration cfg, FolderInfo cloneInfo, String id, Map<IPath, Map<String, String>> superIdMap, boolean cloneChildren) {
+ public FolderInfo(IConfiguration cfg, FolderInfo cloneInfo, String id, Map<IPath, Map<String, String>> superIdMap,
+ boolean cloneChildren) {
super(cfg, cloneInfo, id);
isExtensionElement = cfg.isExtensionElement();
- if(!isExtensionElement)
+ if (!isExtensionElement)
setResourceData(new BuildFolderData(this));
String subName;
- if(!cloneInfo.isExtensionElement)
+ if (!cloneInfo.isExtensionElement)
cloneChildren = true;
boolean copyIds = cloneChildren && id.equals(cloneInfo.id);
IToolChain cloneToolChain = cloneInfo.getToolChain();
IToolChain extToolChain = ManagedBuildManager.getExtensionToolChain(cloneToolChain);
- if (extToolChain==null)
+ if (extToolChain == null)
extToolChain = cloneToolChain;
subName = cloneToolChain.getName();
if (cloneChildren) {
- String subId = copyIds ? cloneToolChain.getId() : ManagedBuildManager.calculateChildId(extToolChain.getId(),
- null);
- toolChain = new ToolChain(this, subId, subName, superIdMap, (ToolChain)cloneToolChain);
+ String subId = copyIds ? cloneToolChain.getId()
+ : ManagedBuildManager.calculateChildId(extToolChain.getId(), null);
+ toolChain = new ToolChain(this, subId, subName, superIdMap, (ToolChain) cloneToolChain);
} else {
// Add a tool-chain element that specifies as its superClass the
// tool-chain that is the child of the configuration.
- String subId = ManagedBuildManager.calculateChildId(
- extToolChain.getId(),
- null);
+ String subId = ManagedBuildManager.calculateChildId(extToolChain.getId(), null);
IToolChain newChain = createToolChain(extToolChain, subId, extToolChain.getName(), false);
// For each option/option category child of the tool-chain that is
@@ -205,35 +206,35 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
// original tool element as its superClass.
ITool[] tools = extToolChain.getTools();
for (ITool tool : tools) {
- Tool toolChild = (Tool)tool;
- subId = ManagedBuildManager.calculateChildId(toolChild.getId(),null);
- newChain.createTool(toolChild, subId, toolChild.getName(), false);
+ Tool toolChild = (Tool) tool;
+ subId = ManagedBuildManager.calculateChildId(toolChild.getId(), null);
+ newChain.createTool(toolChild, subId, toolChild.getName(), false);
}
ITargetPlatform tpBase = cloneInfo.getToolChain().getTargetPlatform();
ITargetPlatform extTp = tpBase;
- for(;extTp != null && !extTp.isExtensionElement();extTp = extTp.getSuperClass()) {
+ for (; extTp != null && !extTp.isExtensionElement(); extTp = extTp.getSuperClass()) {
// empty body, loop is to find extension element only
}
TargetPlatform tp;
- if(extTp != null){
+ if (extTp != null) {
int nnn = ManagedBuildManager.getRandomNumber();
- subId = copyIds ? tpBase.getId() : extTp.getId() + "." + nnn; //$NON-NLS-1$
- tp = new TargetPlatform(newChain, subId, tpBase.getName(), (TargetPlatform)tpBase);
+ subId = copyIds ? tpBase.getId() : extTp.getId() + "." + nnn; //$NON-NLS-1$
+ tp = new TargetPlatform(newChain, subId, tpBase.getName(), (TargetPlatform) tpBase);
} else {
subId = copyIds ? tpBase.getId() : ManagedBuildManager.calculateChildId(getId(), null);
subName = tpBase != null ? tpBase.getName() : ""; //$NON-NLS-1$
- tp = new TargetPlatform((ToolChain)newChain, null, subId, subName, false);
+ tp = new TargetPlatform((ToolChain) newChain, null, subId, subName, false);
}
- ((ToolChain)newChain).setTargetPlatform(tp);
+ ((ToolChain) newChain).setTargetPlatform(tp);
}
- if(isRoot())
+ if (isRoot())
containsDiscoveredScannerInfo = cloneInfo.containsDiscoveredScannerInfo;
- if(copyIds){
+ if (copyIds) {
isDirty = cloneInfo.isDirty;
needsRebuild = cloneInfo.needsRebuild;
} else {
@@ -243,34 +244,34 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
}
- private boolean conflictsWithRootTools(ITool tool){
+ private boolean conflictsWithRootTools(ITool tool) {
IFolderInfo rf = getParent().getRootFolderInfo();
ITool[] rootTools = rf.getFilteredTools();
ITool tt = getParent().getTargetTool();
for (ITool rootTool : rootTools) {
- if(rootTool == tt || getMultipleOfType(rootTool) != null){
- if(getConflictingInputExts(rootTool, tool).length != 0)
+ if (rootTool == tt || getMultipleOfType(rootTool) != null) {
+ if (getConflictingInputExts(rootTool, tool).length != 0)
return true;
}
}
return false;
}
- private IInputType getMultipleOfType(ITool tool){
+ private IInputType getMultipleOfType(ITool tool) {
IInputType[] types = tool.getInputTypes();
IInputType mType = null;
boolean foundNonMultiplePrimary = false;
for (IInputType type : types) {
- if(type.getMultipleOfType()){
- if(type.getPrimaryInput() == true){
+ if (type.getMultipleOfType()) {
+ if (type.getPrimaryInput() == true) {
foundNonMultiplePrimary = false;
mType = type;
break;
- } else if (mType == null){
+ } else if (mType == null) {
mType = type;
}
} else {
- if(type.getPrimaryInput() == true){
+ if (type.getPrimaryInput() == true) {
foundNonMultiplePrimary = true;
}
}
@@ -284,34 +285,35 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
// If this is not associated with a project, then there is nothing to filter with
return localTools;
}
- IProject project = (IProject)manProj.getOwner();
+ IProject project = (IProject) manProj.getOwner();
Vector<Tool> tools = new Vector<Tool>(localTools.length);
for (ITool t : localTools) {
- Tool tool = (Tool)t;
- if(!tool.isEnabled(this))
+ Tool tool = (Tool) t;
+ if (!tool.isEnabled(this))
continue;
- if(!isRoot() && conflictsWithRootTools(tool))
+ if (!isRoot() && conflictsWithRootTools(tool))
continue;
try {
// Make sure the tool is right for the project
switch (tool.getNatureFilter()) {
- case ITool.FILTER_C:
- if (project.hasNature(CProjectNature.C_NATURE_ID) && !project.hasNature(CCProjectNature.CC_NATURE_ID)) {
- tools.add(tool);
- }
- break;
- case ITool.FILTER_CC:
- if (project.hasNature(CCProjectNature.CC_NATURE_ID)) {
- tools.add(tool);
- }
- break;
- case ITool.FILTER_BOTH:
+ case ITool.FILTER_C:
+ if (project.hasNature(CProjectNature.C_NATURE_ID)
+ && !project.hasNature(CCProjectNature.CC_NATURE_ID)) {
tools.add(tool);
- break;
- default:
- break;
+ }
+ break;
+ case ITool.FILTER_CC:
+ if (project.hasNature(CCProjectNature.CC_NATURE_ID)) {
+ tools.add(tool);
+ }
+ break;
+ case ITool.FILTER_BOTH:
+ tools.add(tool);
+ break;
+ default:
+ break;
}
} catch (CoreException e) {
continue;
@@ -339,17 +341,18 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
@Override
public boolean isDirty() {
- if(super.isDirty())
+ if (super.isDirty())
return true;
- if (toolChain.isDirty()) return true;
+ if (toolChain.isDirty())
+ return true;
return false;
}
@Override
public boolean needsRebuild() {
- if(super.needsRebuild() || toolChain.needsRebuild())
+ if (super.needsRebuild() || toolChain.needsRebuild())
return true;
else
return false;
@@ -359,7 +362,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
public void setRebuildState(boolean rebuild) {
super.setRebuildState(rebuild);
- if(!rebuild)
+ if (!rebuild)
toolChain.setRebuildState(false);
}
@@ -390,7 +393,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
}
@Override
- void serialize(ICStorageElement element){
+ void serialize(ICStorageElement element) {
super.serialize(element);
ICStorageElement toolChainElement = element.createChild(IToolChain.TOOL_CHAIN_ELEMENT_NAME);
@@ -398,40 +401,40 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
}
@Override
- void resolveReferences(){
- if(toolChain != null)
+ void resolveReferences() {
+ if (toolChain != null)
toolChain.resolveReferences();
}
@Override
- public void updateManagedBuildRevision(String revision){
+ public void updateManagedBuildRevision(String revision) {
super.updateManagedBuildRevision(revision);
- if(toolChain != null)
+ if (toolChain != null)
toolChain.updateManagedBuildRevision(revision);
}
@Override
- public boolean isExtensionElement(){
+ public boolean isExtensionElement() {
return isExtensionElement;
}
- public String getErrorParserIds(){
- if(toolChain != null)
+ public String getErrorParserIds() {
+ if (toolChain != null)
return toolChain.getErrorParserIds(getParent());
return null;
}
@Override
- public CFolderData getFolderData(){
- return (CFolderData)getResourceData();
+ public CFolderData getFolderData() {
+ return (CFolderData) getResourceData();
}
@Override
public CLanguageData[] getCLanguageDatas() {
List<CLanguageData> list = new ArrayList<CLanguageData>();
- for(ITool t : getFilteredTools())
- for(CLanguageData d : t.getCLanguageDatas())
+ for (ITool t : getFilteredTools())
+ for (CLanguageData d : t.getCLanguageDatas())
list.add(d);
return list.toArray(new BuildLanguageData[list.size()]);
}
@@ -464,7 +467,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
@Override
public void propertiesChanged() {
- if(isExtensionElement)
+ if (isExtensionElement)
return;
toolChain.propertiesChanged();
super.propertiesChanged();
@@ -472,51 +475,54 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
@Override
public void setDirty(boolean isDirty) {
- if (isExtensionElement && isDirty) return;
+ if (isExtensionElement && isDirty)
+ return;
- super.setDirty(isDirty);
+ super.setDirty(isDirty);
- // Propagate "false" to the children
+ // Propagate "false" to the children
if (!isDirty) {
- if(toolChain != null)
+ if (toolChain != null)
toolChain.setDirty(false);
}
}
- private Map<String, String> typeIdsToMap(String [] ids, IBuildObjectProperties props){
+ private Map<String, String> typeIdsToMap(String[] ids, IBuildObjectProperties props) {
Map<String, String> map = new HashMap<String, String>(ids.length);
- for(String id : ids){
+ for (String id : ids) {
IBuildProperty prop = props.getProperty(id);
map.put(id, prop.getValue().getId());
}
return map;
}
- private Map<String, String> propsToMap(IBuildProperty props[]){
+ private Map<String, String> propsToMap(IBuildProperty props[]) {
Map<String, String> map = new HashMap<String, String>(props.length);
- for(IBuildProperty p : props)
+ for (IBuildProperty p : props)
map.put(p.getPropertyType().getId(), p.getValue().getId());
return map;
}
- private boolean checkPropertiesModificationCompatibility(IBuildPropertiesRestriction r, Map<String, String> unspecifiedRequiredProps, Map<String, String> unspecifiedProps, Set<String> undefinedSet){
+ private boolean checkPropertiesModificationCompatibility(IBuildPropertiesRestriction r,
+ Map<String, String> unspecifiedRequiredProps, Map<String, String> unspecifiedProps,
+ Set<String> undefinedSet) {
IBuildObjectProperties props = null;
IConfiguration cfg = getParent();
- if(cfg != null){
+ if (cfg != null) {
props = cfg.getBuildProperties();
}
unspecifiedProps.clear();
unspecifiedRequiredProps.clear();
- if(props != null && props.getSupportedTypeIds().length != 0){
+ if (props != null && props.getSupportedTypeIds().length != 0) {
String[] requiredIds = props.getRequiredTypeIds();
IBuildPropertyType[] supportedTypes = props.getSupportedTypes();
- if(supportedTypes.length != 0 || requiredIds.length != 0){
- if(requiredIds.length == 0){
- if(props.getProperty(ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID) != null){
- requiredIds = new String[]{ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID};
+ if (supportedTypes.length != 0 || requiredIds.length != 0) {
+ if (requiredIds.length == 0) {
+ if (props.getProperty(ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID) != null) {
+ requiredIds = new String[] { ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID };
}
}
@@ -533,36 +539,39 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
return false;
}
- private void getUnsupportedProperties(Map<String, String> props, IBuildPropertiesRestriction restriction, Map<String, String> unsupported, Set<String> inexistent){
+ private void getUnsupportedProperties(Map<String, String> props, IBuildPropertiesRestriction restriction,
+ Map<String, String> unsupported, Set<String> inexistent) {
BuildPropertyManager mngr = BuildPropertyManager.getInstance();
- for(Map.Entry<String, String> entry : props.entrySet()){
+ for (Map.Entry<String, String> entry : props.entrySet()) {
String propId = entry.getKey();
String valueId = entry.getValue();
IBuildPropertyType type = mngr.getPropertyType(propId);
- if(type == null){
- if(inexistent != null){
+ if (type == null) {
+ if (inexistent != null) {
inexistent.add(propId);
}
}
- if(!restriction.supportsType(propId)){
+ if (!restriction.supportsType(propId)) {
unsupported.put(propId, null);
- } else if (!restriction.supportsValue(propId, valueId)){
+ } else if (!restriction.supportsValue(propId, valueId)) {
unsupported.put(propId, valueId);
}
}
}
- 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(){
+ 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))
+ if (tc.supportsType(typeId, false))
return true;
for (ITool tool : tools) {
- if(((Tool)tool).supportsType(typeId))
+ if (((Tool) tool).supportsType(typeId))
return true;
}
return false;
@@ -570,11 +579,11 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
@Override
public boolean supportsValue(String typeId, String valueId) {
- if(tc.supportsValue(typeId, valueId, false))
+ if (tc.supportsValue(typeId, valueId, false))
return true;
for (ITool tool : tools) {
- if(((Tool)tool).supportsValue(typeId, valueId))
+ if (((Tool) tool).supportsValue(typeId, valueId))
return true;
}
return false;
@@ -587,7 +596,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
list.addAll(Arrays.asList(tc.getRequiredTypeIds(false)));
for (ITool tool : tools) {
- list.addAll(Arrays.asList(((Tool)tool).getRequiredTypeIds()));
+ list.addAll(Arrays.asList(((Tool) tool).getRequiredTypeIds()));
}
return list.toArray(new String[list.size()]);
@@ -600,7 +609,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
list.addAll(Arrays.asList(tc.getSupportedTypeIds(false)));
for (ITool tool : tools) {
- list.addAll(Arrays.asList(((Tool)tool).getSupportedTypeIds()));
+ list.addAll(Arrays.asList(((Tool) tool).getSupportedTypeIds()));
}
return list.toArray(new String[list.size()]);
@@ -613,7 +622,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
list.addAll(Arrays.asList(tc.getSupportedValueIds(typeId, false)));
for (ITool tool : tools) {
- list.addAll(Arrays.asList(((Tool)tool).getSupportedValueIds(typeId)));
+ list.addAll(Arrays.asList(((Tool) tool).getSupportedValueIds(typeId)));
}
return list.toArray(new String[list.size()]);
@@ -621,11 +630,11 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
@Override
public boolean requiresType(String typeId) {
- if(tc.requiresType(typeId, false))
+ if (tc.requiresType(typeId, false))
return true;
for (ITool tool : tools) {
- if(((Tool)tool).requiresType(typeId))
+ if (((Tool) tool).requiresType(typeId))
return true;
}
return false;
@@ -635,97 +644,99 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
checkPropertiesModificationCompatibility(r, unspecifiedRequiredProps, unspecifiedProps, undefinedSet);
}
- public boolean checkPropertiesModificationCompatibility(IToolChain tc, Map<String, String> unspecifiedRequiredProps, Map<String, String> unspecifiedProps, Set<String> undefinedSet){
- return checkPropertiesModificationCompatibility((IBuildPropertiesRestriction)tc, unspecifiedRequiredProps, unspecifiedProps, undefinedSet);
+ public boolean checkPropertiesModificationCompatibility(IToolChain tc, Map<String, String> unspecifiedRequiredProps,
+ Map<String, String> unspecifiedProps, Set<String> undefinedSet) {
+ return checkPropertiesModificationCompatibility((IBuildPropertiesRestriction) tc, unspecifiedRequiredProps,
+ unspecifiedProps, undefinedSet);
}
- public boolean isPropertiesModificationCompatible(IToolChain tc){
+ public boolean isPropertiesModificationCompatible(IToolChain tc) {
Map<String, String> requiredMap = new HashMap<String, String>();
Map<String, String> unsupportedMap = new HashMap<String, String>();
Set<String> undefinedSet = new HashSet<String>();
- if(!checkPropertiesModificationCompatibility(tc, requiredMap, unsupportedMap, undefinedSet))
+ if (!checkPropertiesModificationCompatibility(tc, requiredMap, unsupportedMap, undefinedSet))
return false;
return true;
}
- private Set<String> getRequiredUnspecifiedProperties(){
+ private Set<String> getRequiredUnspecifiedProperties() {
IBuildObjectProperties props = null;
Set<String> set = new HashSet<String>();
IConfiguration cfg = getParent();
- if(cfg != null)
+ if (cfg != null)
props = cfg.getBuildProperties();
- if(props != null)
- for(String s : props.getRequiredTypeIds())
- if(props.getProperty(s) == null)
+ if (props != null)
+ for (String s : props.getRequiredTypeIds())
+ if (props.getProperty(s) == null)
set.add(s);
return set;
}
@Override
- public boolean isToolChainCompatible(IToolChain tCh){
+ public boolean isToolChainCompatible(IToolChain tCh) {
return isToolChainCompatible(toolChain, tCh);
}
- public boolean isToolChainCompatible(ToolChain fromTc, IToolChain tCh){
+ public boolean isToolChainCompatible(ToolChain fromTc, IToolChain tCh) {
boolean compatible = false;
- if(tCh == fromTc)
+ if (tCh == fromTc)
return true;
- if(tCh == null){
+ if (tCh == null) {
tCh = ManagedBuildManager.getExtensionToolChain(ConfigurationDataProvider.PREF_TC_ID);
}
- if(tCh == null)
+ if (tCh == null)
return false;
IToolChain curReal = ManagedBuildManager.getRealToolChain(fromTc);
IToolChain newReal = ManagedBuildManager.getRealToolChain(tCh);
- if(curReal == newReal)
+ if (curReal == newReal)
return true;
- if(getToolChainConverterInfo(fromTc, tCh) != null)
+ if (getToolChainConverterInfo(fromTc, tCh) != null)
compatible = true;
- if(!compatible)
+ if (!compatible)
compatible = isPropertiesModificationCompatible(tCh);
return compatible;
}
@Override
- public IToolChain changeToolChain(IToolChain newSuperClass, String Id, String name) throws BuildException{
+ public IToolChain changeToolChain(IToolChain newSuperClass, String Id, String name) throws BuildException {
boolean usePrefTc = false;
- if(newSuperClass == null){
+ if (newSuperClass == null) {
newSuperClass = ManagedBuildManager.getExtensionToolChain(ConfigurationDataProvider.PREF_TC_ID);
usePrefTc = true;
}
- if(newSuperClass == null)
+ if (newSuperClass == null)
return toolChain;
IToolChain curReal = ManagedBuildManager.getRealToolChain(toolChain);
IToolChain newReal = ManagedBuildManager.getRealToolChain(newSuperClass);
- if(Id == null){
+ if (Id == null) {
Id = ManagedBuildManager.calculateChildId(newSuperClass.getId(), null);
}
- if(name == null){
+ if (name == null) {
name = newSuperClass.getName();
}
- if(newReal != curReal){
+ if (newReal != curReal) {
IToolChain extTc = ManagedBuildManager.getExtensionToolChain(newSuperClass);
- if(extTc != null)
+ if (extTc != null)
newSuperClass = extTc;
ToolChain oldToolChain = toolChain;
ConverterInfo cInfo = getToolChainConverterInfo(toolChain, newSuperClass);
ITool oldTools[] = oldToolChain.getTools();
- if(cInfo != null){
+ if (cInfo != null) {
updateToolChainWithConverter(cInfo, Id, name);
} else {
updateToolChainWithProperties(usePrefTc ? null : newSuperClass, Id, name);
@@ -736,8 +747,8 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
}
void updateToolChainWithProperties(IToolChain newSuperClass, String Id, String name) {
- ToolChain oldTc = (ToolChain)getToolChain();
- if(newSuperClass != null) {
+ ToolChain oldTc = (ToolChain) getToolChain();
+ if (newSuperClass != null) {
createToolChain(newSuperClass, Id, name, false);
// For each option/option category child of the tool-chain that is
@@ -753,24 +764,21 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
String subId;
ITool[] tools = newSuperClass.getTools();
for (ITool tool : tools) {
- Tool toolChild = (Tool)tool;
- subId = ManagedBuildManager.calculateChildId(toolChild.getId(),null);
- toolChain.createTool(toolChild, subId, toolChild.getName(), false);
+ Tool toolChild = (Tool) tool;
+ subId = ManagedBuildManager.calculateChildId(toolChild.getId(), null);
+ toolChain.createTool(toolChild, subId, toolChild.getName(), false);
}
} else {
Configuration cfg = ConfigurationDataProvider.getClearPreference(null);
- ToolChain prefTch = (ToolChain)cfg.getRootFolderInfo().getToolChain();
+ ToolChain prefTch = (ToolChain) cfg.getRootFolderInfo().getToolChain();
- toolChain = new ToolChain(this,
- ManagedBuildManager.calculateChildId(prefTch.getSuperClass().getId(), null),
- prefTch.getName(),
- new HashMap<IPath, Map<String, String>>(),
- prefTch);
+ toolChain = new ToolChain(this, ManagedBuildManager.calculateChildId(prefTch.getSuperClass().getId(), null),
+ prefTch.getName(), new HashMap<IPath, Map<String, String>>(), prefTch);
}
- if(isRoot()){
- Builder oldBuilder = (Builder)oldTc.getBuilder();
- Builder newBuilder = (Builder)getParent().getEditableBuilder();
+ if (isRoot()) {
+ Builder oldBuilder = (Builder) oldTc.getBuilder();
+ Builder newBuilder = (Builder) getParent().getEditableBuilder();
newBuilder.copySettings(oldBuilder, false);
}
@@ -783,123 +791,123 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
toolChain.propertiesChanged();
}
- private void copySettings(ITool[] fromTools, ITool[] toTools){
+ private void copySettings(ITool[] fromTools, ITool[] toTools) {
ITool[][] matches = getBestMatches(fromTools, toTools);
for (ITool[] match : matches) {
BuildSettingsUtil.copyCommonSettings(match[0], match[1]);
}
}
- private ITool[][] getBestMatches(ITool[] tools1, ITool[] tools2){
+ private ITool[][] getBestMatches(ITool[] tools1, ITool[] tools2) {
HashSet<ITool> set = new HashSet<ITool>(Arrays.asList(tools2));
List<ITool[]> list = new ArrayList<ITool[]>(tools1.length);
- for(ITool tool1 : tools1){
+ for (ITool tool1 : tools1) {
ITool bestMatchTool = null;
int num = 0;
- for(ITool tool2 : set){
+ for (ITool tool2 : set) {
int extsNum = getConflictingInputExts(tool1, tool2).length;
- if(extsNum > num){
+ if (extsNum > num) {
bestMatchTool = tool2;
num = extsNum;
}
}
- if(bestMatchTool != null){
- list.add(new ITool[]{tool1, bestMatchTool});
+ if (bestMatchTool != null) {
+ list.add(new ITool[] { tool1, bestMatchTool });
set.remove(bestMatchTool);
}
}
return list.toArray(new ITool[list.size()][]);
}
- void updateToolChainWithConverter(ConverterInfo cInfo, String Id, String name) throws BuildException{
+ void updateToolChainWithConverter(ConverterInfo cInfo, String Id, String name) throws BuildException {
IBuildObject bo = cInfo.getConvertedFromObject();
ToolChain updatedToolChain = null;
- if(bo instanceof Configuration){
- Configuration cfg = (Configuration)bo;
- if(cfg != getParent()){
+ if (bo instanceof Configuration) {
+ Configuration cfg = (Configuration) bo;
+ if (cfg != getParent()) {
IResourceInfo rcInfo = cfg.getResourceInfo(getPath(), true);
- if(rcInfo instanceof FolderInfo){
- IToolChain tc = ((FolderInfo)rcInfo).getToolChain();
- IToolChain realToToolChain = ManagedBuildManager.getRealToolChain((IToolChain)cInfo.getToObject());
- if(ManagedBuildManager.getRealToolChain(tc) == realToToolChain){
- updatedToolChain = (ToolChain)tc;
+ if (rcInfo instanceof FolderInfo) {
+ IToolChain tc = ((FolderInfo) rcInfo).getToolChain();
+ IToolChain realToToolChain = ManagedBuildManager.getRealToolChain((IToolChain) cInfo.getToObject());
+ if (ManagedBuildManager.getRealToolChain(tc) == realToToolChain) {
+ updatedToolChain = (ToolChain) tc;
}
}
- if(updatedToolChain == null){
- updatedToolChain = (ToolChain)cfg.getRootFolderInfo().getToolChain();
+ if (updatedToolChain == null) {
+ updatedToolChain = (ToolChain) cfg.getRootFolderInfo().getToolChain();
}
} else {
updatedToolChain = toolChain;
}
- } else if(bo instanceof ToolChain){
- updatedToolChain = (ToolChain)bo;
+ } else if (bo instanceof ToolChain) {
+ updatedToolChain = (ToolChain) bo;
} else {
throw new BuildException(ManagedMakeMessages.getResourceString("FolderInfo.4")); //$NON-NLS-1$
}
- if(updatedToolChain != null && toolChain != updatedToolChain){
+ if (updatedToolChain != null && toolChain != updatedToolChain) {
setUpdatedToolChain(updatedToolChain);
}
toolChain.setName(name);
}
- void setUpdatedToolChain(ToolChain tch){
+ void setUpdatedToolChain(ToolChain tch) {
tch.copyNonoverriddenSettings(toolChain);
toolChain = tch;
tch.updateParentFolderInfo(this);
}
- private ConverterInfo getToolChainConverterInfo(ToolChain fromTc, IToolChain toTc){
+ private ConverterInfo getToolChainConverterInfo(ToolChain fromTc, IToolChain toTc) {
IConfigurationElement el = getToolChainConverterElement(fromTc, toTc);
IToolChain foundToTc = toTc;
- if(el == null){
+ if (el == null) {
IToolChain[] tcs = ManagedBuildManager.findIdenticalToolChains(toTc);
for (IToolChain tc : tcs) {
foundToTc = tc;
- if(foundToTc == toTc)
+ if (foundToTc == toTc)
continue;
el = getToolChainConverterElement(fromTc, foundToTc);
- if(el != null)
+ if (el != null)
break;
}
}
- if(el != null)
+ if (el != null)
return new ConverterInfo(this, getToolChain(), foundToTc, el);
return null;
}
- private IConfigurationElement getToolChainConverterElement(ToolChain fromTc, IToolChain tCh){
- if(tCh == null)
+ private IConfigurationElement getToolChainConverterElement(ToolChain fromTc, IToolChain tCh) {
+ if (tCh == null)
return null;
- if(fromTc != null)
+ if (fromTc != null)
return fromTc.getConverterModificationElement(tCh);
else
return null;
}
@SuppressWarnings("unchecked")
- private ITool[][] checkDups(ITool[] removed, ITool[] added){
+ private ITool[][] checkDups(ITool[] removed, ITool[] added) {
LinkedHashMap<Object, ITool> removedMap = createRealToExtToolMap(removed, false);
LinkedHashMap<Object, ITool> addedMap = createRealToExtToolMap(added, true);
- LinkedHashMap<Object, ITool> rmCopy = (LinkedHashMap<Object, ITool>)removedMap.clone();
+ LinkedHashMap<Object, ITool> rmCopy = (LinkedHashMap<Object, ITool>) removedMap.clone();
removedMap.keySet().removeAll(addedMap.keySet());
addedMap.keySet().removeAll(rmCopy.keySet());
- if(removedMap.size() != 0){
+ if (removedMap.size() != 0) {
LinkedHashMap<Object, ITool> curMap = createRealToExtToolMap(getTools(), false);
- for(Iterator<Map.Entry<Object, ITool>> iter = removedMap.entrySet().iterator(); iter.hasNext();){
+ for (Iterator<Map.Entry<Object, ITool>> iter = removedMap.entrySet().iterator(); iter.hasNext();) {
Map.Entry<Object, ITool> entry = iter.next();
Object key = entry.getKey();
Object curTool = curMap.get(key);
- if(curTool != null)
- entry.setValue((ITool)curTool);
+ if (curTool != null)
+ entry.setValue((ITool) curTool);
else
iter.remove();
}
@@ -910,103 +918,104 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
return result;
}
- private LinkedHashMap<Object, ITool> createRealToExtToolMap(ITool[] tools, boolean extValues){
+ private LinkedHashMap<Object, ITool> createRealToExtToolMap(ITool[] tools, boolean extValues) {
LinkedHashMap<Object, ITool> map = new LinkedHashMap<Object, ITool>();
- for(ITool t : tools){
- Tool realTool = (Tool)ManagedBuildManager.getRealTool(t);
+ for (ITool t : tools) {
+ Tool realTool = (Tool) ManagedBuildManager.getRealTool(t);
MatchKey<Tool> key = realTool.getMatchKey();
ITool toolValue = extValues ? ManagedBuildManager.getExtensionTool(t) : t;
- if(toolValue != null)
+ if (toolValue != null)
map.put(key, toolValue);
}
return map;
}
@Override
- public void modifyToolChain(ITool[] removed, ITool[] added){
- ToolListModificationInfo info = ToolChainModificationHelper.getModificationInfo(this, getTools(), added, removed);
+ public void modifyToolChain(ITool[] removed, ITool[] added) {
+ ToolListModificationInfo info = ToolChainModificationHelper.getModificationInfo(this, getTools(), added,
+ removed);
info.apply();
return;
-// ITool[][] checked = checkDups(removed, added);
-// removed = checked[0];
-// added = checked[1];
-// if(added.length == 0 && removed.length == 0)
-// return;
-//
-// List<ITool> remainingRemoved = new ArrayList<ITool>();
-// List<ITool> remainingAdded = new ArrayList<ITool>();
-// Map<ITool, ConverterInfo> converterMap =
-// calculateConverterTools(removed, added, remainingRemoved, remainingAdded);
-// invokeConverters(converterMap);
-// List<Tool> newTools = new ArrayList<Tool>(added.length);
-// for(ConverterInfo info : converterMap.values()){
-// if(info.getConvertedFromObject() instanceof Tool){
-// Tool newTool = (Tool)info.getConvertedFromObject();
-// newTool.updateParent(getToolChain());
-// newTools.add(newTool);
-// } else {
-// remainingAdded.add((ITool)info.getToObject());
-// }
-// }
-//
-// for(ITool t : remainingAdded){
-// newTools.add(
-// new Tool(
-// toolChain,
-// t,
-// ManagedBuildManager.calculateChildId(t.getId(), null),
-// t.getName(),
-// false)
-// );
-// }
-//
-// performToolChainModification(removed, newTools.toArray(new Tool[newTools.size()]));
- }
-
-// private void performToolChainModification(ITool removed[], ITool[] added){
-// BuildSettingsUtil.disconnectDepentents(getParent(), removed);
-//
-// for (ITool tool : removed) {
-// toolChain.removeTool((Tool)tool);
-// }
-//
-// for (ITool tool : added) {
-// toolChain.addTool((Tool)tool);
-// }
-//
-// adjustTargetTools(removed, added);
-//
-// toolChain.propertiesChanged();
-// }
-
- private void adjustTargetTools(ITool removed[], ITool added[]){
- if(!isRoot())
+ // ITool[][] checked = checkDups(removed, added);
+ // removed = checked[0];
+ // added = checked[1];
+ // if(added.length == 0 && removed.length == 0)
+ // return;
+ //
+ // List<ITool> remainingRemoved = new ArrayList<ITool>();
+ // List<ITool> remainingAdded = new ArrayList<ITool>();
+ // Map<ITool, ConverterInfo> converterMap =
+ // calculateConverterTools(removed, added, remainingRemoved, remainingAdded);
+ // invokeConverters(converterMap);
+ // List<Tool> newTools = new ArrayList<Tool>(added.length);
+ // for(ConverterInfo info : converterMap.values()){
+ // if(info.getConvertedFromObject() instanceof Tool){
+ // Tool newTool = (Tool)info.getConvertedFromObject();
+ // newTool.updateParent(getToolChain());
+ // newTools.add(newTool);
+ // } else {
+ // remainingAdded.add((ITool)info.getToObject());
+ // }
+ // }
+ //
+ // for(ITool t : remainingAdded){
+ // newTools.add(
+ // new Tool(
+ // toolChain,
+ // t,
+ // ManagedBuildManager.calculateChildId(t.getId(), null),
+ // t.getName(),
+ // false)
+ // );
+ // }
+ //
+ // performToolChainModification(removed, newTools.toArray(new Tool[newTools.size()]));
+ }
+
+ // private void performToolChainModification(ITool removed[], ITool[] added){
+ // BuildSettingsUtil.disconnectDepentents(getParent(), removed);
+ //
+ // for (ITool tool : removed) {
+ // toolChain.removeTool((Tool)tool);
+ // }
+ //
+ // for (ITool tool : added) {
+ // toolChain.addTool((Tool)tool);
+ // }
+ //
+ // adjustTargetTools(removed, added);
+ //
+ // toolChain.propertiesChanged();
+ // }
+
+ private void adjustTargetTools(ITool removed[], ITool added[]) {
+ if (!isRoot())
return;
Set<String> set = new HashSet<String>();
- String [] ids = toolChain.getTargetToolList();
+ String[] ids = toolChain.getTargetToolList();
boolean targetToolsModified = false;
set.addAll(Arrays.asList(ids));
for (ITool tool : removed) {
Object[] tInfo = getTargetTool(tool);
- if(tInfo == null)
+ if (tInfo == null)
continue;
- ITool target = (ITool)tInfo[0];
- String tId = (String)tInfo[1];
+ ITool target = (ITool) tInfo[0];
+ String tId = (String) tInfo[1];
- if(BuildSettingsUtil.calcDependentTools(added, target, null).size() != 0)
+ if (BuildSettingsUtil.calcDependentTools(added, target, null).size() != 0)
continue;
ITool newTargetTool = findCompatibleTargetTool(target, added);
- if(newTargetTool == null)
+ if (newTargetTool == null)
continue;
newTargetTool = ManagedBuildManager.getExtensionTool(newTargetTool);
- if(newTargetTool == null)
+ if (newTargetTool == null)
continue;
set.remove(tId);
@@ -1014,43 +1023,43 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
targetToolsModified = true;
}
- if(targetToolsModified){
+ if (targetToolsModified) {
toolChain.setTargetToolIds(CDataUtil.arrayToString(set.toArray(new String[set.size()]), ";")); //$NON-NLS-1$
}
}
- private ITool findCompatibleTargetTool(ITool tool, ITool allTools[]){
+ private ITool findCompatibleTargetTool(ITool tool, ITool allTools[]) {
IProject project = getParent().getOwner().getProject();
- String exts[] = ((Tool)tool).getAllOutputExtensions(project);
+ String exts[] = ((Tool) tool).getAllOutputExtensions(project);
Set<String> extsSet = new HashSet<String>(Arrays.asList(exts));
ITool compatibleTool = null;
for (ITool t : allTools) {
- String otherExts[] = ((Tool)t).getAllOutputExtensions(project);
+ String otherExts[] = ((Tool) t).getAllOutputExtensions(project);
for (String otherExt : otherExts) {
- if(extsSet.contains(otherExt)){
+ if (extsSet.contains(otherExt)) {
compatibleTool = t;
break;
}
}
- if(compatibleTool != null)
+ if (compatibleTool != null)
break;
}
- if(compatibleTool == null){
+ if (compatibleTool == null) {
//try to match build output variable
Set<String> set = getToolOutputVars(tool);
- for (ITool t: allTools) {
+ for (ITool t : allTools) {
IOutputType types[] = t.getOutputTypes();
for (IOutputType type : types) {
String var = type.getBuildVariable();
- if(var != null && set.contains(var)){
+ if (var != null && set.contains(var)) {
compatibleTool = t;
break;
}
}
- if(compatibleTool != null)
+ if (compatibleTool != null)
break;
}
}
@@ -1058,13 +1067,13 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
return compatibleTool;
}
- private Set<String> getToolOutputVars(ITool tool){
+ private Set<String> getToolOutputVars(ITool tool) {
Set<String> set = new HashSet<String>();
IOutputType types[] = tool.getOutputTypes();
for (IOutputType type : types) {
String var = type.getBuildVariable();
- if(var != null)
+ if (var != null)
set.add(var);
}
@@ -1072,77 +1081,77 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
return set;
}
- private Object[] getTargetTool(ITool tool){
- String [] ids = toolChain.getTargetToolList();
+ private Object[] getTargetTool(ITool tool) {
+ String[] ids = toolChain.getTargetToolList();
for (String id : ids) {
ITool target = tool;
- for(; target != null; target = target.getSuperClass()){
- if(id.equals(target.getId()))
+ for (; target != null; target = target.getSuperClass()) {
+ if (id.equals(target.getId()))
break;
}
- if(target != null)
- return new Object[]{target, id};
+ if (target != null)
+ return new Object[] { target, id };
}
return null;
}
-// private List<ConverterInfo> invokeConverters(Map<?, ConverterInfo> converterMap){
-// List<ConverterInfo> failed = new ArrayList<ConverterInfo>();
-// for(ConverterInfo info : converterMap.values()){
-// IBuildObject converted = info.getConvertedFromObject();
-// if(converted == null ||
-// !converted.getClass().equals(info.getFromObject().getClass())){
-// failed.add(info);
-// }
-// }
-// return failed;
-// }
-
-// private Map<ITool, ConverterInfo> calculateConverterTools(ITool[] removed, ITool[] added, List<ITool> remainingRemoved, List<ITool> remainingAdded){
-// if(remainingAdded == null)
-// remainingAdded = new ArrayList<ITool>(added.length);
-// if(remainingRemoved == null)
-// remainingRemoved = new ArrayList<ITool>(removed.length);
-//
-// remainingAdded.clear();
-// remainingRemoved.clear();
-//
-// remainingAdded.addAll(Arrays.asList(added));
-// remainingRemoved.addAll(Arrays.asList(removed));
-//
-// Map<ITool, ConverterInfo> resultMap = new HashMap<ITool, ConverterInfo>();
-//
-// for(Iterator<ITool> rIter = remainingRemoved.iterator(); rIter.hasNext();){
-// ITool r = rIter.next();
-//
-// if(r.getParentResourceInfo() != this)
-// continue;
-//
-// if(ManagedBuildManager.getConversionElements(r).size() == 0)
-// continue;
-//
-// for(Iterator<ITool> aIter = remainingAdded.iterator(); aIter.hasNext();){
-// ITool a = aIter.next();
-//
-// if(a.getParentResourceInfo() == this)
-// continue;
-//
-// IConfigurationElement el = getToolConverterElement(r, a);
-// if(el != null){
-// resultMap.put(r, new ConverterInfo(this, r, a, el));
-// rIter.remove();
-// aIter.remove();
-// break;
-// }
-// }
-// }
-//
-// return resultMap;
-// }
-
- private ITool[] calculateToolsArray(ITool[] removed, ITool[] added){
+ // private List<ConverterInfo> invokeConverters(Map<?, ConverterInfo> converterMap){
+ // List<ConverterInfo> failed = new ArrayList<ConverterInfo>();
+ // for(ConverterInfo info : converterMap.values()){
+ // IBuildObject converted = info.getConvertedFromObject();
+ // if(converted == null ||
+ // !converted.getClass().equals(info.getFromObject().getClass())){
+ // failed.add(info);
+ // }
+ // }
+ // return failed;
+ // }
+
+ // private Map<ITool, ConverterInfo> calculateConverterTools(ITool[] removed, ITool[] added, List<ITool> remainingRemoved, List<ITool> remainingAdded){
+ // if(remainingAdded == null)
+ // remainingAdded = new ArrayList<ITool>(added.length);
+ // if(remainingRemoved == null)
+ // remainingRemoved = new ArrayList<ITool>(removed.length);
+ //
+ // remainingAdded.clear();
+ // remainingRemoved.clear();
+ //
+ // remainingAdded.addAll(Arrays.asList(added));
+ // remainingRemoved.addAll(Arrays.asList(removed));
+ //
+ // Map<ITool, ConverterInfo> resultMap = new HashMap<ITool, ConverterInfo>();
+ //
+ // for(Iterator<ITool> rIter = remainingRemoved.iterator(); rIter.hasNext();){
+ // ITool r = rIter.next();
+ //
+ // if(r.getParentResourceInfo() != this)
+ // continue;
+ //
+ // if(ManagedBuildManager.getConversionElements(r).size() == 0)
+ // continue;
+ //
+ // for(Iterator<ITool> aIter = remainingAdded.iterator(); aIter.hasNext();){
+ // ITool a = aIter.next();
+ //
+ // if(a.getParentResourceInfo() == this)
+ // continue;
+ //
+ // IConfigurationElement el = getToolConverterElement(r, a);
+ // if(el != null){
+ // resultMap.put(r, new ConverterInfo(this, r, a, el));
+ // rIter.remove();
+ // aIter.remove();
+ // break;
+ // }
+ // }
+ // }
+ //
+ // return resultMap;
+ // }
+
+ private ITool[] calculateToolsArray(ITool[] removed, ITool[] added) {
LinkedHashMap<Object, ITool> map = createRealToExtToolMap(getTools(), false);
LinkedHashMap<Object, ITool> removedMap = createRealToExtToolMap(removed, false);
@@ -1153,25 +1162,25 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
}
@SuppressWarnings("unchecked")
- private ITool[][] calculateConflictingTools(ITool[] newTools){
+ private ITool[][] calculateConflictingTools(ITool[] newTools) {
HashSet<ITool> set = new HashSet<ITool>();
set.addAll(Arrays.asList(newTools));
List<ITool[]> result = new ArrayList<ITool[]>();
- for(Iterator<ITool> iter = set.iterator(); iter.hasNext();){
+ for (Iterator<ITool> iter = set.iterator(); iter.hasNext();) {
ITool t = iter.next();
iter.remove();
- HashSet<ITool> tmp = (HashSet<ITool>)set.clone();
+ HashSet<ITool> tmp = (HashSet<ITool>) set.clone();
List<ITool> list = new ArrayList<ITool>();
- for(Iterator<ITool> tmpIt = tmp.iterator(); tmpIt.hasNext();){
+ for (Iterator<ITool> tmpIt = tmp.iterator(); tmpIt.hasNext();) {
ITool other = tmpIt.next();
String conflicts[] = getConflictingInputExts(t, other);
- if(conflicts.length != 0){
+ if (conflicts.length != 0) {
list.add(other);
tmpIt.remove();
}
}
- if(list.size() != 0){
+ if (list.size() != 0) {
list.add(t);
result.add(list.toArray(new Tool[list.size()]));
}
@@ -1182,22 +1191,21 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
return result.toArray(new ITool[result.size()][]);
}
- private String[] getConflictingInputExts(ITool tool1, ITool tool2){
+ private String[] getConflictingInputExts(ITool tool1, ITool tool2) {
IProject project = getParent().getOwner().getProject();
- String ext1[] = ((Tool)tool1).getAllInputExtensions(project);
- String ext2[] = ((Tool)tool2).getAllInputExtensions(project);
+ String ext1[] = ((Tool) tool1).getAllInputExtensions(project);
+ String ext2[] = ((Tool) tool2).getAllInputExtensions(project);
Set<String> set1 = new HashSet<String>(Arrays.asList(ext1));
Set<String> result = new HashSet<String>();
- for(String e : ext2){
- if(set1.remove(e))
+ for (String e : ext2) {
+ if (set1.remove(e))
result.add(e);
}
return result.toArray(new String[result.size()]);
}
-
@Override
- public IModificationStatus getToolChainModificationStatus(ITool[] removed, ITool[] added){
+ public IModificationStatus getToolChainModificationStatus(ITool[] removed, ITool[] added) {
ITool[][] checked = checkDups(removed, added);
removed = checked[0];
added = checked[1];
@@ -1208,29 +1216,30 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
Set<String> undefinedSet = new HashSet<String>();
IConfiguration cfg = getParent();
ITool[] nonManagedTools = null;
- if(cfg.isManagedBuildOn() && cfg.supportsBuild(true)){
+ if (cfg.isManagedBuildOn() && cfg.supportsBuild(true)) {
List<ITool> list = new ArrayList<ITool>();
- for(ITool t : newTools)
- if(!t.supportsBuild(true))
+ for (ITool t : newTools)
+ if (!t.supportsBuild(true))
list.add(t);
- if(list.size() != 0)
+ if (list.size() != 0)
nonManagedTools = list.toArray(new Tool[list.size()]);
}
- return new ModificationStatus(unspecifiedRequiredProps, unspecifiedProps, undefinedSet, conflicting, nonManagedTools);
+ return new ModificationStatus(unspecifiedRequiredProps, unspecifiedProps, undefinedSet, conflicting,
+ nonManagedTools);
}
@Override
public boolean supportsBuild(boolean managed) {
- if(getRequiredUnspecifiedProperties().size() != 0)
+ if (getRequiredUnspecifiedProperties().size() != 0)
return false;
- ToolChain tCh = (ToolChain)getToolChain();
- if(tCh == null || !tCh.getSupportsManagedBuildAttribute())
+ ToolChain tCh = (ToolChain) getToolChain();
+ if (tCh == null || !tCh.getSupportsManagedBuildAttribute())
return !managed;
ITool tools[] = getFilteredTools();
- for(int i = 0; i < tools.length; i++){
- if(!tools[i].supportsBuild(managed))
+ for (int i = 0; i < tools.length; i++) {
+ if (!tools[i].supportsBuild(managed))
return false;
}
@@ -1268,7 +1277,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
IManagedProject manProj = getParent().getManagedProject();
IProject project = null;
if (manProj != null) {
- project = (IProject)manProj.getOwner();
+ project = (IProject) manProj.getOwner();
}
ITool[] tools = getFilteredTools();
for (ITool tool : tools) {
@@ -1276,18 +1285,19 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
if (project != null) {
// Make sure the tool is right for the project
switch (tool.getNatureFilter()) {
- case ITool.FILTER_C:
- if (project.hasNature(CProjectNature.C_NATURE_ID) && !project.hasNature(CCProjectNature.CC_NATURE_ID)) {
- return tool.isHeaderFile(ext);
- }
- break;
- case ITool.FILTER_CC:
- if (project.hasNature(CCProjectNature.CC_NATURE_ID)) {
- return tool.isHeaderFile(ext);
- }
- break;
- case ITool.FILTER_BOTH:
+ case ITool.FILTER_C:
+ if (project.hasNature(CProjectNature.C_NATURE_ID)
+ && !project.hasNature(CCProjectNature.CC_NATURE_ID)) {
return tool.isHeaderFile(ext);
+ }
+ break;
+ case ITool.FILTER_CC:
+ if (project.hasNature(CCProjectNature.CC_NATURE_ID)) {
+ return tool.isHeaderFile(ext);
+ }
+ break;
+ case ITool.FILTER_BOTH:
+ return tool.isHeaderFile(ext);
}
} else {
return tool.isHeaderFile(ext);
@@ -1300,34 +1310,34 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
}
@Override
- public Set<String> contributeErrorParsers(Set<String> set){
- if(toolChain != null)
+ public Set<String> contributeErrorParsers(Set<String> set) {
+ if (toolChain != null)
set = toolChain.contributeErrorParsers(this, set, true);
return set;
}
@Override
public void resetErrorParsers() {
- if(toolChain != null)
+ if (toolChain != null)
toolChain.resetErrorParsers(this);
}
@Override
void removeErrorParsers(Set<String> set) {
- if(toolChain != null)
+ if (toolChain != null)
toolChain.removeErrorParsers(this, set);
}
@Override
public ITool getToolById(String id) {
- if(toolChain != null)
+ if (toolChain != null)
return toolChain.getTool(id);
return null;
}
@Override
- void resolveProjectReferences(boolean onLoad){
- if(toolChain != null)
+ void resolveProjectReferences(boolean onLoad) {
+ if (toolChain != null)
toolChain.resolveProjectReferences(onLoad);
}
@@ -1344,11 +1354,11 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
}
if (val instanceof Boolean) {
- ManagedBuildManager.setOption(toolChain.getParent(), holder, opt, (Boolean)val);
+ ManagedBuildManager.setOption(toolChain.getParent(), holder, opt, (Boolean) val);
} else if (val instanceof String[]) {
- ManagedBuildManager.setOption(toolChain.getParent(), holder, opt, (String[])val);
- } else if (val instanceof String){
- ManagedBuildManager.setOption(toolChain.getParent(), holder, opt, (String)val);
+ ManagedBuildManager.setOption(toolChain.getParent(), holder, opt, (String[]) val);
+ } else if (val instanceof String) {
+ ManagedBuildManager.setOption(toolChain.getParent(), holder, opt, (String) val);
} else if (val == null) {
holder.removeOption(opt);
} else {
@@ -1356,7 +1366,7 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
}
}
}
-
+
public void resetOptionSettings() {
// (Bug 438367) Removing all the options and relying on automatic creating when modifying/using the option
// will result in problems in the following cases:
@@ -1374,26 +1384,26 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
// Send out the event to notify the options that they are about to be removed.
// Do not do this for the child resource configurations as they are handled when
// the configuration itself is destroyed.
-// ManagedBuildManager.performValueHandlerEvent(this, IManagedOptionValueHandler.EVENT_CLOSE, false);
-// rebuildNeeded = true;
+ // ManagedBuildManager.performValueHandlerEvent(this, IManagedOptionValueHandler.EVENT_CLOSE, false);
+ // rebuildNeeded = true;
}
@Override
- public boolean hasCustomSettings(){
+ public boolean hasCustomSettings() {
IFolderInfo parentFo = getParentFolderInfo();
- if(parentFo == null)
+ if (parentFo == null)
return true;
- return toolChain.hasCustomSettings((ToolChain)parentFo.getToolChain());
+ return toolChain.hasCustomSettings((ToolChain) parentFo.getToolChain());
}
- public boolean containsDiscoveredScannerInfo(){
- if(!isRoot())
+ public boolean containsDiscoveredScannerInfo() {
+ if (!isRoot())
return true;
return containsDiscoveredScannerInfo;
}
- public void setContainsDiscoveredScannerInfo(boolean contains){
+ public void setContainsDiscoveredScannerInfo(boolean contains) {
containsDiscoveredScannerInfo = contains;
}
@@ -1410,36 +1420,34 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
}
@Override
- void applyToolsInternal(ITool[] resultingTools,
- ToolListModificationInfo info) {
+ void applyToolsInternal(ITool[] resultingTools, ToolListModificationInfo info) {
ITool[] removedTools = info.getRemovedTools();
for (ITool tool : removedTools) {
ITool extTool = ManagedBuildManager.getExtensionTool(tool);
- if(extTool.getParent() == toolChain.getSuperClass())
+ if (extTool.getParent() == toolChain.getSuperClass())
toolChain.addUnusedChild(extTool);
}
toolChain.setToolsInternal(resultingTools);
-
adjustTargetTools(removedTools, info.getAddedTools(true));
setRebuildState(true);
}
@Override
- public boolean isSupported(){
- if(toolChain != null)
+ public boolean isSupported() {
+ if (toolChain != null)
return toolChain.isSupported();
return false;
}
-// private IConfigurationElement getToolConverterElement(ITool fromTool, ITool toTool){
-// ToolChain curTc = (ToolChain)getToolChain();
-// if(curTc != null){
-// return curTc.getConverterModificationElement(fromTool, toTool);
-// }
-// return null;
-// }
+ // private IConfigurationElement getToolConverterElement(ITool fromTool, ITool toTool){
+ // ToolChain curTc = (ToolChain)getToolChain();
+ // if(curTc != null){
+ // return curTc.getConverterModificationElement(fromTool, toTool);
+ // }
+ // return null;
+ // }
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
index 4991ffb09d3..1d0120df986 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
@@ -100,28 +100,22 @@ public class GeneratedMakefileBuilder extends ACBuilder {
buildInfo = info;
String ext = buildInfo.getBuildArtifactExtension();
//try to resolve build macros in the build artifact extension
- try{
- ext = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
- ext,
- "", //$NON-NLS-1$
+ try {
+ ext = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(ext, "", //$NON-NLS-1$
" ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- info.getDefaultConfiguration());
- } catch (BuildMacroException e){
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, info.getDefaultConfiguration());
+ } catch (BuildMacroException e) {
}
String name = buildInfo.getBuildArtifactName();
//try to resolve build macros in the build artifact name
- try{
- String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
- name,
- "", //$NON-NLS-1$
+ try {
+ String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(name, "", //$NON-NLS-1$
" ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- info.getDefaultConfiguration());
- if((resolved = resolved.trim()).length() > 0)
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, info.getDefaultConfiguration());
+ if ((resolved = resolved.trim()).length() > 0)
name = resolved;
- } catch (BuildMacroException e){
+ } catch (BuildMacroException e) {
}
if (ext.length() > 0) {
@@ -129,7 +123,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
} else {
buildGoalName = name;
}
- reservedNames = Arrays.asList(new String[]{".cdtbuild", ".cdtproject", ".project"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ reservedNames = Arrays.asList(new String[] { ".cdtbuild", ".cdtproject", ".project" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
private boolean isGeneratedResource(IResource resource) {
@@ -140,7 +134,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
String name = configNames[i];
IPath root = new Path(name);
// It is if it is a root of the resource pathname
- if (root.isPrefixOf(path)) return true;
+ if (root.isPrefixOf(path))
+ return true;
}
return false;
}
@@ -162,18 +157,15 @@ public class GeneratedMakefileBuilder extends ACBuilder {
IResource resource = delta.getResource();
// If the project has changed, then a build is needed and we can stop
if (resource != null && resource.getProject() == getProject()) {
- switch(resource.getType()){
+ switch (resource.getType()) {
case IResource.FILE:
String name = resource.getName();
if ((!name.equals(buildGoalName) &&
- // TODO: Also need to check for secondary outputs
- (resource.isDerived() ||
- (isProjectFile(resource)) ||
- (isGeneratedResource(resource))))) {
- // The resource that changed has attributes which make it uninteresting,
- // so don't do anything
- }
- else {
+ // TODO: Also need to check for secondary outputs
+ (resource.isDerived() || (isProjectFile(resource)) || (isGeneratedResource(resource))))) {
+ // The resource that changed has attributes which make it uninteresting,
+ // so don't do anything
+ } else {
// TODO: Should we do extra checks here to determine if a build is really needed,
// or do you just do exclusion checks like above?
// We could check for:
@@ -189,20 +181,20 @@ public class GeneratedMakefileBuilder extends ACBuilder {
//if (resourceName.equals(buildGoalName) ||
// (buildInfo.buildsFileType(ext) || buildInfo.isHeaderFile(ext))) {
- // We need to do an incremental build, at least
- incrBuildNeeded = true;
- if (delta.getKind() == IResourceDelta.REMOVED) {
- // If a meaningful resource was removed, then force a full build
- // This is required because an incremental build will trigger make to
- // do nothing for a missing source, since the state after the file
- // removal is uptodate, as far as make is concerned
- // A full build will clean, and ultimately trigger a relink without
- // the object generated from the deleted source, which is what we want
- fullBuildNeeded = true;
- // There is no point in checking anything else since we have
- // decided to do a full build anyway
- break;
- }
+ // We need to do an incremental build, at least
+ incrBuildNeeded = true;
+ if (delta.getKind() == IResourceDelta.REMOVED) {
+ // If a meaningful resource was removed, then force a full build
+ // This is required because an incremental build will trigger make to
+ // do nothing for a missing source, since the state after the file
+ // removal is uptodate, as far as make is concerned
+ // A full build will clean, and ultimately trigger a relink without
+ // the object generated from the deleted source, which is what we want
+ fullBuildNeeded = true;
+ // There is no point in checking anything else since we have
+ // decided to do a full build anyway
+ break;
+ }
//}
}
@@ -220,21 +212,20 @@ public class GeneratedMakefileBuilder extends ACBuilder {
Configuration otherConfigs[];
int resourceChangeState;
- private static final IPath[] ignoreList = {
- new Path(".cdtproject"), //$NON-NLS-1$
- new Path(".cproject"), //$NON-NLS-1$
- new Path(".cdtbuild"), //$NON-NLS-1$
- new Path(".settings"), //$NON-NLS-1$
+ private static final IPath[] ignoreList = { new Path(".cdtproject"), //$NON-NLS-1$
+ new Path(".cproject"), //$NON-NLS-1$
+ new Path(".cdtbuild"), //$NON-NLS-1$
+ new Path(".settings"), //$NON-NLS-1$
};
- OtherConfigVerifier(IConfiguration cfg){
+ OtherConfigVerifier(IConfiguration cfg) {
config = cfg;
configs = cfg.getManagedProject().getConfigurations();
otherConfigs = new Configuration[configs.length - 1];
int counter = 0;
- for(int i = 0; i < configs.length; i++){
- if(configs[i] != config)
- otherConfigs[counter++] = (Configuration)configs[i];
+ for (int i = 0; i < configs.length; i++) {
+ if (configs[i] != config)
+ otherConfigs[counter++] = (Configuration) configs[i];
}
}
@@ -242,16 +233,16 @@ public class GeneratedMakefileBuilder extends ACBuilder {
public boolean visit(IResourceDelta delta) throws CoreException {
IResource rc = delta.getResource();
- if(rc.getType() == IResource.FILE){
- if(isResourceValuable(rc))
+ if (rc.getType() == IResource.FILE) {
+ if (isResourceValuable(rc))
resourceChangeState |= delta.getKind();
return false;
}
return !isGeneratedForConfig(rc, config) && isResourceValuable(rc);
}
- public void updateOtherConfigs(IResourceDelta delta){
- if(delta == null)
+ public void updateOtherConfigs(IResourceDelta delta) {
+ if (delta == null)
resourceChangeState = ~0;
else {
try {
@@ -264,8 +255,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
setResourceChangeStateForOtherConfigs();
}
- private void setResourceChangeStateForOtherConfigs(){
- for(int i = 0; i < otherConfigs.length; i++){
+ private void setResourceChangeStateForOtherConfigs() {
+ for (int i = 0; i < otherConfigs.length; i++) {
otherConfigs[i].addResourceChangeState(resourceChangeState);
}
}
@@ -280,10 +271,10 @@ public class GeneratedMakefileBuilder extends ACBuilder {
return false;
}
- private boolean isResourceValuable(IResource rc){
+ private boolean isResourceValuable(IResource rc) {
IPath path = rc.getProjectRelativePath();
- for(int i = 0; i < ignoreList.length; i++){
- if(ignoreList[i].equals(path))
+ for (int i = 0; i < ignoreList.length; i++) {
+ if (ignoreList[i].equals(path))
return false;
}
return true;
@@ -291,28 +282,28 @@ public class GeneratedMakefileBuilder extends ACBuilder {
}
// String constants
- private static final String BUILD_ERROR = "ManagedMakeBuilder.message.error"; //$NON-NLS-1$
- private static final String BUILD_FINISHED = "ManagedMakeBuilder.message.finished"; //$NON-NLS-1$
- private static final String CONSOLE_HEADER = "ManagedMakeBuilder.message.console.header"; //$NON-NLS-1$
- private static final String ERROR_HEADER = "GeneratedmakefileBuilder error ["; //$NON-NLS-1$
- private static final String MAKE = "ManagedMakeBuilder.message.make"; //$NON-NLS-1$
- private static final String MARKERS = "ManagedMakeBuilder.message.creating.markers"; //$NON-NLS-1$
+ private static final String BUILD_ERROR = "ManagedMakeBuilder.message.error"; //$NON-NLS-1$
+ private static final String BUILD_FINISHED = "ManagedMakeBuilder.message.finished"; //$NON-NLS-1$
+ private static final String CONSOLE_HEADER = "ManagedMakeBuilder.message.console.header"; //$NON-NLS-1$
+ private static final String ERROR_HEADER = "GeneratedmakefileBuilder error ["; //$NON-NLS-1$
+ private static final String MAKE = "ManagedMakeBuilder.message.make"; //$NON-NLS-1$
+ private static final String MARKERS = "ManagedMakeBuilder.message.creating.markers"; //$NON-NLS-1$
private static final String NEWLINE = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
- private static final String NOTHING_BUILT = "ManagedMakeBuilder.message.no.build"; //$NON-NLS-1$
- private static final String REFRESH = "ManagedMakeBuilder.message.updating"; //$NON-NLS-1$
- private static final String REFRESH_ERROR = BUILD_ERROR + ".refresh"; //$NON-NLS-1$
- private static final String TRACE_FOOTER = "]: "; //$NON-NLS-1$
- private static final String TRACE_HEADER = "GeneratedmakefileBuilder trace ["; //$NON-NLS-1$
- private static final String TYPE_CLEAN = "ManagedMakeBuilder.type.clean"; //$NON-NLS-1$
- private static final String TYPE_INC = "ManagedMakeBuider.type.incremental"; //$NON-NLS-1$
- private static final String WARNING_UNSUPPORTED_CONFIGURATION = "ManagedMakeBuilder.warning.unsupported.configuration"; //$NON-NLS-1$
- private static final String BUILD_CANCELLED = "ManagedMakeBuilder.message.cancelled"; //$NON-NLS-1$
- private static final String BUILD_FINISHED_WITH_ERRS = "ManagedMakeBuilder.message.finished.with.errs"; //$NON-NLS-1$
- private static final String BUILD_FAILED_ERR = "ManagedMakeBuilder.message.internal.builder.error"; //$NON-NLS-1$
- private static final String BUILD_STOPPED_ERR = "ManagedMakeBuilder.message.stopped.error"; //$NON-NLS-1$
- private static final String INTERNAL_BUILDER_HEADER_NOTE = "ManagedMakeBuilder.message.internal.builder.header.note"; //$NON-NLS-1$
- private static final String TYPE_REBUILD = "ManagedMakeBuider.type.rebuild"; //$NON-NLS-1$
- private static final String INTERNAL_BUILDER = "ManagedMakeBuilder.message.internal.builder"; //$NON-NLS-1$
+ private static final String NOTHING_BUILT = "ManagedMakeBuilder.message.no.build"; //$NON-NLS-1$
+ private static final String REFRESH = "ManagedMakeBuilder.message.updating"; //$NON-NLS-1$
+ private static final String REFRESH_ERROR = BUILD_ERROR + ".refresh"; //$NON-NLS-1$
+ private static final String TRACE_FOOTER = "]: "; //$NON-NLS-1$
+ private static final String TRACE_HEADER = "GeneratedmakefileBuilder trace ["; //$NON-NLS-1$
+ private static final String TYPE_CLEAN = "ManagedMakeBuilder.type.clean"; //$NON-NLS-1$
+ private static final String TYPE_INC = "ManagedMakeBuider.type.incremental"; //$NON-NLS-1$
+ private static final String WARNING_UNSUPPORTED_CONFIGURATION = "ManagedMakeBuilder.warning.unsupported.configuration"; //$NON-NLS-1$
+ private static final String BUILD_CANCELLED = "ManagedMakeBuilder.message.cancelled"; //$NON-NLS-1$
+ private static final String BUILD_FINISHED_WITH_ERRS = "ManagedMakeBuilder.message.finished.with.errs"; //$NON-NLS-1$
+ private static final String BUILD_FAILED_ERR = "ManagedMakeBuilder.message.internal.builder.error"; //$NON-NLS-1$
+ private static final String BUILD_STOPPED_ERR = "ManagedMakeBuilder.message.stopped.error"; //$NON-NLS-1$
+ private static final String INTERNAL_BUILDER_HEADER_NOTE = "ManagedMakeBuilder.message.internal.builder.header.note"; //$NON-NLS-1$
+ private static final String TYPE_REBUILD = "ManagedMakeBuider.type.rebuild"; //$NON-NLS-1$
+ private static final String INTERNAL_BUILDER = "ManagedMakeBuilder.message.internal.builder"; //$NON-NLS-1$
private static final int PROGRESS_MONITOR_SCALE = 100;
private static final int TICKS_STREAM_PROGRESS_MONITOR = 1 * PROGRESS_MONITOR_SCALE;
@@ -325,6 +316,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
protected IProject[] referencedProjects;
protected List<IResource> resourcesToBuild;
private IConsole console;
+
public static void outputTrace(String resourceName, String message) {
if (VERBOSE) {
System.out.println(TRACE_HEADER + resourceName + TRACE_FOOTER + message + NEWLINE);
@@ -351,7 +343,9 @@ public class GeneratedMakefileBuilder extends ACBuilder {
IStatus stat = iter.next();
IResource location = root.findMember(stat.getMessage());
if (stat.getCode() == IManagedBuilderMakefileGenerator.SPACES_IN_PATH) {
- epm.generateMarker(location, -1, ManagedMakeMessages.getResourceString("MakefileGenerator.error.spaces"), IMarkerGenerator.SEVERITY_WARNING, null); //$NON-NLS-1$
+ epm.generateMarker(location, -1,
+ ManagedMakeMessages.getResourceString("MakefileGenerator.error.spaces"), //$NON-NLS-1$
+ IMarkerGenerator.SEVERITY_WARNING, null);
}
}
}
@@ -374,7 +368,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
consoleHeader[0] = ManagedMakeMessages.getResourceString(TYPE_INC);
} else {
consoleHeader[0] = ""; //$NON-NLS-1$
- outputError(getProject().getName(), "The given build type is not supported in this context"); //$NON-NLS-1$
+ outputError(getProject().getName(), "The given build type is not supported in this context"); //$NON-NLS-1$
}
consoleHeader[1] = configName;
consoleHeader[2] = getProject().getName();
@@ -388,7 +382,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
} catch (CoreException e) {
// Throw the exception back to the builder
throw e;
- } catch (IOException io) { // Ignore console failures...
+ } catch (IOException io) { // Ignore console failures...
}
}
@@ -407,7 +401,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
* @see org.eclipse.core.internal.events.InternalBuilder#build(int, java.util.Map, org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
- protected IProject[] build(int kind, @SuppressWarnings("rawtypes") Map argsMap, IProgressMonitor monitor) throws CoreException {
+ protected IProject[] build(int kind, @SuppressWarnings("rawtypes") Map argsMap, IProgressMonitor monitor)
+ throws CoreException {
@SuppressWarnings("unchecked")
Map<String, String> args = argsMap;
if (DEBUG_EVENTS)
@@ -419,11 +414,11 @@ public class GeneratedMakefileBuilder extends ACBuilder {
// Get the build information
IManagedBuildInfo info = getBuildInfo();
if (info == null) {
- outputError(getProject().getName(), "Build information was not found"); //$NON-NLS-1$
+ outputError(getProject().getName(), "Build information was not found"); //$NON-NLS-1$
return referencedProjects;
}
if (!info.isValid()) {
- outputError(getProject().getName(), "Build information is not valid"); //$NON-NLS-1$
+ outputError(getProject().getName(), "Build information is not valid"); //$NON-NLS-1$
return referencedProjects;
}
@@ -431,14 +426,15 @@ public class GeneratedMakefileBuilder extends ACBuilder {
if (needAllConfigBuild()) {
cfgs = info.getManagedProject().getConfigurations();
} else {
- cfgs = new IConfiguration[] {info.getDefaultConfiguration() };
+ cfgs = new IConfiguration[] { info.getDefaultConfiguration() };
}
for (IConfiguration cfg : cfgs) {
updateOtherConfigs(cfg, kind);
- if(((Configuration)cfg).isInternalBuilderEnabled()){
- invokeInternalBuilder(cfg, kind != FULL_BUILD, ((Configuration)cfg).getInternalBuilderIgnoreErr(), monitor);
+ if (((Configuration) cfg).isInternalBuilderEnabled()) {
+ invokeInternalBuilder(cfg, kind != FULL_BUILD, ((Configuration) cfg).getInternalBuilderIgnoreErr(),
+ monitor);
// Scrub the build info the project
info.setRebuildState(false);
@@ -446,15 +442,16 @@ public class GeneratedMakefileBuilder extends ACBuilder {
}
// Create a makefile generator for the build
- IManagedBuilderMakefileGenerator generator = ManagedBuildManager.getBuildfileGenerator(info.getDefaultConfiguration());
+ IManagedBuilderMakefileGenerator generator = ManagedBuildManager
+ .getBuildfileGenerator(info.getDefaultConfiguration());
generator.initialize(getProject(), info, monitor);
//perform necessary cleaning and build type calculation
- if(cfg.needsFullRebuild()){
+ if (cfg.needsFullRebuild()) {
//configuration rebuild state is set to true,
//full rebuild is needed in any case
//clean first, then make a full build
- outputTrace(getProject().getName(), "config rebuild state is set to true, making a full rebuild"); //$NON-NLS-1$
+ outputTrace(getProject().getName(), "config rebuild state is set to true, making a full rebuild"); //$NON-NLS-1$
clean(new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN));
fullBuild(info, generator, monitor);
} else {
@@ -462,31 +459,33 @@ public class GeneratedMakefileBuilder extends ACBuilder {
IBuildDescription des = null;
IResourceDelta delta = kind == FULL_BUILD ? null : getDelta(getProject());
- if(delta == null)
+ if (delta == null)
fullBuildNeeded = true;
- if(cfg.needsRebuild() || delta != null){
+ if (cfg.needsRebuild() || delta != null) {
//use a build description model to calculate the resources to be cleaned
//only in case there are some changes to the project sources or build information
- try{
- int flags = BuildDescriptionManager.REBUILD | BuildDescriptionManager.DEPFILES | BuildDescriptionManager.DEPS;
- if(delta != null)
+ try {
+ int flags = BuildDescriptionManager.REBUILD | BuildDescriptionManager.DEPFILES
+ | BuildDescriptionManager.DEPS;
+ if (delta != null)
flags |= BuildDescriptionManager.REMOVED;
- outputTrace(getProject().getName(), "using a build description.."); //$NON-NLS-1$
+ outputTrace(getProject().getName(), "using a build description.."); //$NON-NLS-1$
- des = BuildDescriptionManager.createBuildDescription(info.getDefaultConfiguration(), getDelta(getProject()), flags);
+ des = BuildDescriptionManager.createBuildDescription(info.getDefaultConfiguration(),
+ getDelta(getProject()), flags);
BuildDescriptionManager.cleanGeneratedRebuildResources(des);
- } catch (Throwable e){
+ } catch (Throwable e) {
//TODO: log error
- outputError(getProject().getName(), "error occured while build description calculation: " + e.getLocalizedMessage()); //$NON-NLS-1$
+ outputError(getProject().getName(),
+ "error occured while build description calculation: " + e.getLocalizedMessage()); //$NON-NLS-1$
//in case an error occured, make it behave in the old stile:
- if(info.needsRebuild()){
+ if (info.needsRebuild()) {
//make a full clean if an info needs a rebuild
clean(new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN));
fullBuildNeeded = true;
- }
- else if(delta != null && !fullBuildNeeded){
+ } else if (delta != null && !fullBuildNeeded) {
// Create a delta visitor to detect the build type
ResourceDeltaVisitor visitor = new ResourceDeltaVisitor(info);
delta.accept(visitor);
@@ -498,11 +497,11 @@ public class GeneratedMakefileBuilder extends ACBuilder {
}
}
- if(fullBuildNeeded){
- outputTrace(getProject().getName(), "performing a full build"); //$NON-NLS-1$
+ if (fullBuildNeeded) {
+ outputTrace(getProject().getName(), "performing a full build"); //$NON-NLS-1$
fullBuild(info, generator, monitor);
} else {
- outputTrace(getProject().getName(), "performing an incremental build"); //$NON-NLS-1$
+ outputTrace(getProject().getName(), "performing an incremental build"); //$NON-NLS-1$
incrementalBuild(delta, info, generator, monitor);
}
}
@@ -568,7 +567,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
return referencedProjects;
}
- private void updateOtherConfigs(IConfiguration cfg, int buildKind){
+ private void updateOtherConfigs(IConfiguration cfg, int buildKind) {
new OtherConfigVerifier(cfg).updateOtherConfigs(buildKind == FULL_BUILD ? null : getDelta(getProject()));
}
@@ -580,7 +579,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
*/
public void checkCancel(IProgressMonitor monitor) {
if (monitor != null && monitor.isCanceled()) {
- outputTrace(getProject().getName(), "Build cancelled"); //$NON-NLS-1$
+ outputTrace(getProject().getName(), "Build cancelled"); //$NON-NLS-1$
forgetLastBuiltState();
throw new OperationCanceledException();
}
@@ -595,29 +594,30 @@ public class GeneratedMakefileBuilder extends ACBuilder {
printEvent(IncrementalProjectBuilder.CLEAN_BUILD, null);
referencedProjects = getProject().getReferencedProjects();
- outputTrace(getProject().getName(), "Clean build requested"); //$NON-NLS-1$
+ outputTrace(getProject().getName(), "Clean build requested"); //$NON-NLS-1$
IManagedBuildInfo info = getBuildInfo();
if (info == null) {
- outputError(getProject().getName(), "Build information was not found"); //$NON-NLS-1$
+ outputError(getProject().getName(), "Build information was not found"); //$NON-NLS-1$
return;
}
if (!info.isValid()) {
- outputError(getProject().getName(), "Build information is not valid"); //$NON-NLS-1$
+ outputError(getProject().getName(), "Build information is not valid"); //$NON-NLS-1$
return;
}
IPath buildDirPath = getProject().getLocation().append(info.getConfigurationName());
IWorkspace workspace = CCorePlugin.getWorkspace();
IContainer buildDir = workspace.getRoot().getContainerForLocation(buildDirPath);
- if (buildDir == null || !buildDir.isAccessible()){
- outputError(buildDir == null ? "null" : buildDir.getName(), "Could not delete the build directory"); //$NON-NLS-1$ //$NON-NLS-2$
+ if (buildDir == null || !buildDir.isAccessible()) {
+ outputError(buildDir == null ? "null" : buildDir.getName(), "Could not delete the build directory"); //$NON-NLS-1$ //$NON-NLS-2$
return;
}
String status;
try {
// try the brute force approach first
- status = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.clean.deleting.output", buildDir.getName()); //$NON-NLS-1$
+ status = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.clean.deleting.output", //$NON-NLS-1$
+ buildDir.getName());
monitor.subTask(status);
- workspace.delete(new IResource[]{buildDir}, true, monitor);
+ workspace.delete(new IResource[] { buildDir }, true, monitor);
StringBuilder buf = new StringBuilder();
// write to the console
IConsole console = CCorePlugin.getDefault().getConsole();
@@ -640,12 +640,15 @@ public class GeneratedMakefileBuilder extends ACBuilder {
consoleOutStream.close();
} catch (CoreException e) {
// Create a makefile generator for the build
- status = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.clean.build.clean", buildDir.getName()); //$NON-NLS-1$
+ status = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.clean.build.clean", //$NON-NLS-1$
+ buildDir.getName());
monitor.subTask(status);
- IManagedBuilderMakefileGenerator generator = ManagedBuildManager.getBuildfileGenerator(info.getDefaultConfiguration());
+ IManagedBuilderMakefileGenerator generator = ManagedBuildManager
+ .getBuildfileGenerator(info.getDefaultConfiguration());
generator.initialize(getProject(), info, monitor);
cleanBuild(info, generator, monitor);
- } catch (IOException io) {} // Ignore console failures...
+ } catch (IOException io) {
+ } // Ignore console failures...
}
/* (non-Javadoc)
@@ -653,7 +656,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
* @param generator
* @param monitor
*/
- protected void cleanBuild(IManagedBuildInfo info, IManagedBuilderMakefileGenerator generator, IProgressMonitor monitor) {
+ protected void cleanBuild(IManagedBuildInfo info, IManagedBuilderMakefileGenerator generator,
+ IProgressMonitor monitor) {
// Make sure that there is a top level directory and a set of makefiles
IPath buildDir = generator.getBuildWorkingDir();
if (buildDir == null) {
@@ -665,7 +669,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
if (makefile != null && makefile.isAccessible()) {
// invoke make with the clean argument
- String statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.starting", getProject().getName()); //$NON-NLS-1$
+ String statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.starting", //$NON-NLS-1$
+ getProject().getName());
monitor.subTask(statusMsg);
checkCancel(monitor);
invokeMake(CLEAN_BUILD, buildDir, info, generator, monitor);
@@ -677,7 +682,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
* @param generator
* @param monitor
*/
- protected void fullBuild(IManagedBuildInfo info, IManagedBuilderMakefileGenerator generator, IProgressMonitor monitor) throws CoreException {
+ protected void fullBuild(IManagedBuildInfo info, IManagedBuilderMakefileGenerator generator,
+ IProgressMonitor monitor) throws CoreException {
// Always need one of these bad boys
if (monitor == null) {
monitor = new NullProgressMonitor();
@@ -688,11 +694,12 @@ public class GeneratedMakefileBuilder extends ACBuilder {
//in case one or more of the generated makefiles (e.g. dep files) are corrupted,
//the builder invocation might fail because of the possible syntax errors, so e.g. "make clean" will not work
//we need to explicitly clean the generated directories
-// clean(new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN));
+ // clean(new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN));
// Regenerate the makefiles for this project
checkCancel(monitor);
- String statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.rebuild.makefiles", getProject().getName()); //$NON-NLS-1$
+ String statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.rebuild.makefiles", //$NON-NLS-1$
+ getProject().getName());
monitor.subTask(statusMsg);
//generator = ManagedBuildManager.getBuildfileGenerator(info.getDefaultConfiguration());
generator.initialize(getProject(), info, monitor);
@@ -710,7 +717,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
emitNoSourceMessage(FULL_BUILD, status, info.getConfigurationName());
} catch (CoreException e) {
// Throw the exception back to the builder
- throw e;
+ throw e;
}
// Dude, we're done
return;
@@ -723,7 +730,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
// Now call make
checkCancel(monitor);
- statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.starting", getProject().getName()); //$NON-NLS-1$
+ statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.starting", //$NON-NLS-1$
+ getProject().getName());
monitor.subTask(statusMsg);
IPath topBuildDir = generator.getBuildWorkingDir();
if (topBuildDir != null) {
@@ -736,7 +744,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
// Now regenerate the dependencies
checkCancel(monitor);
- statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.regen.deps", getProject().getName()); //$NON-NLS-1$
+ statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.regen.deps", //$NON-NLS-1$
+ getProject().getName());
monitor.subTask(statusMsg);
try {
generator.regenerateDependencies(false);
@@ -763,7 +772,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
/* (non-javadoc)
* Answers an array of strings with the proper make targets
- * for a build with no custom prebuild/postbuild steps
+ * for a build with no custom prebuild/postbuild steps
*
* @param fullBuild
* @return
@@ -771,13 +780,13 @@ public class GeneratedMakefileBuilder extends ACBuilder {
protected String[] getMakeTargets(int buildType) {
List<String> args = new ArrayList<String>();
switch (buildType) {
- case CLEAN_BUILD:
- args.add("clean"); //$NON-NLS-1$
- break;
- case FULL_BUILD:
- case INCREMENTAL_BUILD:
- args.add("all"); //$NON-NLS-1$
- break;
+ case CLEAN_BUILD:
+ args.add("clean"); //$NON-NLS-1$
+ break;
+ case FULL_BUILD:
+ case INCREMENTAL_BUILD:
+ args.add("all"); //$NON-NLS-1$
+ break;
}
return args.toArray(new String[args.size()]);
}
@@ -802,7 +811,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
* @param monitor
* @throws CoreException
*/
- protected void incrementalBuild(IResourceDelta delta, IManagedBuildInfo info, IManagedBuilderMakefileGenerator generator, IProgressMonitor monitor) throws CoreException {
+ protected void incrementalBuild(IResourceDelta delta, IManagedBuildInfo info,
+ IManagedBuilderMakefileGenerator generator, IProgressMonitor monitor) throws CoreException {
// Need to report status to the user
if (monitor == null) {
monitor = new NullProgressMonitor();
@@ -810,7 +820,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
// Ask the makefile generator to generate any makefiles needed to build delta
checkCancel(monitor);
- String statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.update.makefiles", getProject().getName()); //$NON-NLS-1$
+ String statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.update.makefiles", //$NON-NLS-1$
+ getProject().getName());
monitor.subTask(statusMsg);
MultiStatus result = generator.generateMakefiles(delta);
if (result.getCode() == IStatus.WARNING || result.getCode() == IStatus.INFO) {
@@ -826,7 +837,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
emitNoSourceMessage(INCREMENTAL_BUILD, status, info.getConfigurationName());
} catch (CoreException e) {
// Throw the exception back to the builder
- throw e;
+ throw e;
}
// Dude, we're done
return;
@@ -839,7 +850,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
// Run the build
checkCancel(monitor);
- statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.starting", getProject().getName()); //$NON-NLS-1$
+ statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.starting", //$NON-NLS-1$
+ getProject().getName());
monitor.subTask(statusMsg);
IPath buildDir = generator.getBuildWorkingDir();
if (buildDir != null) {
@@ -852,7 +864,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
// Generate the dependencies for all changes
checkCancel(monitor);
- statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.updating.deps", getProject().getName()); //$NON-NLS-1$
+ statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.updating.deps", //$NON-NLS-1$
+ getProject().getName());
monitor.subTask(statusMsg);
try {
generator.generateDependencies();
@@ -863,16 +876,17 @@ public class GeneratedMakefileBuilder extends ACBuilder {
// Build finished message
statusMsg = ManagedMakeMessages.getFormattedString(BUILD_FINISHED, getProject().getName());
monitor.subTask(statusMsg);
-}
+ }
/* (non-Javadoc)
- * @param buildType
+ * @param buildType
* @param buildDir
* @param info
- * @param generator
+ * @param generator
* @param monitor
*/
- protected void invokeMake(int buildType, IPath buildDir, IManagedBuildInfo info, IManagedBuilderMakefileGenerator generator, IProgressMonitor monitor) {
+ protected void invokeMake(int buildType, IPath buildDir, IManagedBuildInfo info,
+ IManagedBuilderMakefileGenerator generator, IProgressMonitor monitor) {
// Get the project and make sure there's a monitor to cancel the build
IProject project = getProject();
if (monitor == null) {
@@ -883,8 +897,9 @@ public class GeneratedMakefileBuilder extends ACBuilder {
// Figure out the working directory for the build and make sure there is a makefile there
final URI workingDirectoryURI = getProject().getFolder(buildDir).getLocationURI();
final String pathFromURI = EFSExtensionManager.getDefault().getPathFromURI(workingDirectoryURI);
- if(pathFromURI == null) {
- throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, ManagedMakeMessages.getString("ManagedMakeBuilder.message.error"), null)); //$NON-NLS-1$
+ if (pathFromURI == null) {
+ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID,
+ ManagedMakeMessages.getString("ManagedMakeBuilder.message.error"), null)); //$NON-NLS-1$
}
IPath workingDirectory = new Path(pathFromURI);
@@ -905,16 +920,13 @@ public class GeneratedMakefileBuilder extends ACBuilder {
// Flag to the user that make is about to be called
String makeCmd = info.getBuildCommand();
//try to resolve the build macros in the builder command
- try{
- String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
- makeCmd,
- "", //$NON-NLS-1$
+ try {
+ String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(makeCmd, "", //$NON-NLS-1$
" ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- info.getDefaultConfiguration());
- if((resolved = resolved.trim()).length() > 0)
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, info.getDefaultConfiguration());
+ if ((resolved = resolved.trim()).length() > 0)
makeCmd = resolved;
- } catch (BuildMacroException e){
+ } catch (BuildMacroException e) {
}
IPath makeCommand = new Path(makeCmd);
@@ -930,13 +942,13 @@ public class GeneratedMakefileBuilder extends ACBuilder {
ConsoleOutputStream consoleOutStream = console.getOutputStream();
String[] consoleHeader = new String[3];
switch (buildType) {
- case FULL_BUILD:
- case INCREMENTAL_BUILD:
- consoleHeader[0] = ManagedMakeMessages.getResourceString(TYPE_INC);
- break;
- case CLEAN_BUILD:
- consoleHeader[0] = ManagedMakeMessages.getResourceString(TYPE_CLEAN);
- break;
+ case FULL_BUILD:
+ case INCREMENTAL_BUILD:
+ consoleHeader[0] = ManagedMakeMessages.getResourceString(TYPE_INC);
+ break;
+ case CLEAN_BUILD:
+ consoleHeader[0] = ManagedMakeMessages.getResourceString(TYPE_CLEAN);
+ break;
}
consoleHeader[1] = info.getConfigurationName();
@@ -946,8 +958,9 @@ public class GeneratedMakefileBuilder extends ACBuilder {
buf.append(NEWLINE);
IConfiguration cfg = info.getDefaultConfiguration();
- if(!cfg.isSupported()){
- String msg = ManagedMakeMessages.getFormattedString(WARNING_UNSUPPORTED_CONFIGURATION,new String[] {cfg.getName(),cfg.getToolChain().getName()});
+ if (!cfg.isSupported()) {
+ String msg = ManagedMakeMessages.getFormattedString(WARNING_UNSUPPORTED_CONFIGURATION,
+ new String[] { cfg.getName(), cfg.getToolChain().getName() });
buf.append(msg).append(NEWLINE);
buf.append(NEWLINE);
}
@@ -965,12 +978,13 @@ public class GeneratedMakefileBuilder extends ACBuilder {
launcher.showCommand(true);
// Set the environmennt
- IBuildEnvironmentVariable variables[] = ManagedBuildManager.getEnvironmentVariableProvider().getVariables(cfg,true,true);
+ IBuildEnvironmentVariable variables[] = ManagedBuildManager.getEnvironmentVariableProvider()
+ .getVariables(cfg, true, true);
String[] envp = null;
ArrayList<String> envList = new ArrayList<String>();
if (variables != null) {
- for(int i = 0; i < variables.length; i++){
- envList.add(variables[i].getName() + "=" + variables[i].getValue()); //$NON-NLS-1$
+ for (int i = 0; i < variables.length; i++) {
+ envList.add(variables[i].getName() + "=" + variables[i].getValue()); //$NON-NLS-1$
}
envp = envList.toArray(new String[envList.size()]);
}
@@ -996,14 +1010,12 @@ public class GeneratedMakefileBuilder extends ACBuilder {
String[] makeTargets;
String prebuildStep = info.getPrebuildStep();
//try to resolve the build macros in the prebuildStep
- try{
- prebuildStep = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
- prebuildStep,
+ try {
+ prebuildStep = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(prebuildStep,
"", //$NON-NLS-1$
" ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- cfg);
- } catch (BuildMacroException e){
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, cfg);
+ } catch (BuildMacroException e) {
}
boolean prebuildStepPresent = (prebuildStep.length() > 0);
Process proc = null;
@@ -1032,8 +1044,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
} catch (IOException e) {
}
if (launcher.waitAndRead(epm.getOutputStream(), epm.getOutputStream(),
- new SubProgressMonitor(monitor,
- IProgressMonitor.UNKNOWN)) != ICommandLauncher.OK) {
+ new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN)) != ICommandLauncher.OK) {
errMsg = launcher.getErrorMessage();
}
} else {
@@ -1051,7 +1062,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
// If the status value returned from "make -q" is 0, then the build state is up-to-date
isuptodate = true;
// Report that the build was up to date, and thus nothing needs to be built
- String uptodateMsg = ManagedMakeMessages.getFormattedString(NOTHING_BUILT, project.getName());
+ String uptodateMsg = ManagedMakeMessages.getFormattedString(NOTHING_BUILT,
+ project.getName());
buf = new StringBuilder();
buf.append(NEWLINE);
buf.append(uptodateMsg).append(NEWLINE);
@@ -1069,7 +1081,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
break;
}
case FULL_BUILD: {
-// makeArgs.add("clean"); //$NON-NLS-1$
+ // makeArgs.add("clean"); //$NON-NLS-1$
makeArgs.add("pre-build"); //$NON-NLS-1$
makeArgs.add("main-build"); //$NON-NLS-1$
break;
@@ -1099,12 +1111,11 @@ public class GeneratedMakefileBuilder extends ACBuilder {
}
int state = launcher.waitAndRead(epm.getOutputStream(), epm.getOutputStream(),
- new SubProgressMonitor(monitor,
- IProgressMonitor.UNKNOWN));
- if(state != ICommandLauncher.OK){
+ new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN));
+ if (state != ICommandLauncher.OK) {
errMsg = launcher.getErrorMessage();
- if(state == ICommandLauncher.COMMAND_CANCELED){
+ if (state == ICommandLauncher.COMMAND_CANCELED) {
//TODO: the better way of handling cancel is needed
//currently the rebuild state is set to true forcing the full rebuild
//on the next builder invocation
@@ -1115,8 +1126,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
// Force a resync of the projects without allowing the user to cancel.
// This is probably unkind, but short of this there is no way to insure
// the UI is up-to-date with the build results
- monitor.subTask(ManagedMakeMessages
- .getResourceString(REFRESH));
+ monitor.subTask(ManagedMakeMessages.getResourceString(REFRESH));
try {
//currentProject.refreshLocal(IResource.DEPTH_INFINITE, null);
@@ -1125,8 +1135,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
IWorkspaceRunnable runnable = refreshManager.getRefreshRunnable(project, cfg.getName());
ResourcesPlugin.getWorkspace().run(runnable, null, IWorkspace.AVOID_UPDATE, null);
} catch (CoreException e) {
- monitor.subTask(ManagedMakeMessages
- .getResourceString(REFRESH_ERROR));
+ monitor.subTask(ManagedMakeMessages.getResourceString(REFRESH_ERROR));
}
} else {
errMsg = launcher.getErrorMessage();
@@ -1138,8 +1147,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
buf.append(errMsg).append(NEWLINE);
} else {
// Report a successful build
- String successMsg = ManagedMakeMessages.getFormattedString(BUILD_FINISHED,
- project.getName());
+ String successMsg = ManagedMakeMessages.getFormattedString(BUILD_FINISHED, project.getName());
buf.append(successMsg).append(NEWLINE);
}
@@ -1168,7 +1176,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
*/
@SuppressWarnings("restriction")
private void removeAllMarkers(IProject project) {
- if (project == null || !project.isAccessible()) return;
+ if (project == null || !project.isAccessible())
+ return;
// Clear out the problem markers
IWorkspace workspace = project.getWorkspace();
@@ -1201,12 +1210,10 @@ public class GeneratedMakefileBuilder extends ACBuilder {
* If false the build will stop on the first error
* @param monitor monitor
*/
- protected void invokeInternalBuilder(IConfiguration cfg,
- boolean buildIncrementaly,
- boolean resumeOnErr,
+ protected void invokeInternalBuilder(IConfiguration cfg, boolean buildIncrementaly, boolean resumeOnErr,
IProgressMonitor monitor) {
- boolean isParallel = ((Configuration)cfg).getParallelDef();
+ boolean isParallel = ((Configuration) cfg).getParallelDef();
// Get the project and make sure there's a monitor to cancel the build
IProject currentProject = cfg.getOwner().getProject();
@@ -1225,8 +1232,9 @@ public class GeneratedMakefileBuilder extends ACBuilder {
int flags = 0;
IResourceDelta delta = null;
- if(buildIncrementaly){
- flags = BuildDescriptionManager.REBUILD | BuildDescriptionManager.REMOVED | BuildDescriptionManager.DEPS;
+ if (buildIncrementaly) {
+ flags = BuildDescriptionManager.REBUILD | BuildDescriptionManager.REMOVED
+ | BuildDescriptionManager.DEPS;
delta = getDelta(currentProject);
}
@@ -1242,7 +1250,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
console.start(currentProject);
consoleOutStream = console.getOutputStream();
String[] consoleHeader = new String[3];
- if(buildIncrementaly)
+ if (buildIncrementaly)
consoleHeader[0] = ManagedMakeMessages.getResourceString(TYPE_INC);
else
consoleHeader[0] = ManagedMakeMessages.getResourceString(TYPE_REBUILD);
@@ -1256,21 +1264,23 @@ public class GeneratedMakefileBuilder extends ACBuilder {
buf.append(ManagedMakeMessages.getResourceString(INTERNAL_BUILDER_HEADER_NOTE));
buf.append("\n"); //$NON-NLS-1$
- if(!cfg.isSupported()){
- String msg = ManagedMakeMessages.getFormattedString(WARNING_UNSUPPORTED_CONFIGURATION,new String[] {cfg.getName(),cfg.getToolChain().getName()});
+ if (!cfg.isSupported()) {
+ String msg = ManagedMakeMessages.getFormattedString(WARNING_UNSUPPORTED_CONFIGURATION,
+ new String[] { cfg.getName(), cfg.getToolChain().getName() });
buf.append(msg).append(NEWLINE);
buf.append(NEWLINE);
}
consoleOutStream.write(buf.toString().getBytes());
consoleOutStream.flush();
- if(isParallel || builder.getNumCommands() > 0) {
+ if (isParallel || builder.getNumCommands() > 0) {
// Remove all markers for this project
removeAllMarkers(currentProject);
// Hook up an error parser manager
String[] errorParsers = cfg.getErrorParserList();
- ErrorParserManager epm = new ErrorParserManager(getProject(), des.getDefaultBuildDirLocationURI(), this, errorParsers);
+ ErrorParserManager epm = new ErrorParserManager(getProject(), des.getDefaultBuildDirLocationURI(), this,
+ errorParsers);
epm.setOutputStream(consoleOutStream);
// This variable is necessary to ensure that the EPM stream stay open
// until we explicitly close it. See bug#123302.
@@ -1280,7 +1290,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
long t1 = System.currentTimeMillis();
if (isParallel)
- status = ParallelBuilder.build(des, null, null, epmOutputStream, epmOutputStream, monitor, resumeOnErr, buildIncrementaly);
+ status = ParallelBuilder.build(des, null, null, epmOutputStream, epmOutputStream, monitor,
+ resumeOnErr, buildIncrementaly);
else
status = builder.build(epmOutputStream, epmOutputStream, monitor);
long t2 = System.currentTimeMillis();
@@ -1288,47 +1299,44 @@ public class GeneratedMakefileBuilder extends ACBuilder {
// Report either the success or failure of our mission
buf = new StringBuilder();
- switch(status){
+ switch (status) {
case IBuildModelBuilder.STATUS_OK:
- buf.append(ManagedMakeMessages
- .getFormattedString(BUILD_FINISHED,
- currentProject.getName()));
+ buf.append(ManagedMakeMessages.getFormattedString(BUILD_FINISHED, currentProject.getName()));
break;
case IBuildModelBuilder.STATUS_CANCELLED:
- buf.append(ManagedMakeMessages
- .getResourceString(BUILD_CANCELLED));
+ buf.append(ManagedMakeMessages.getResourceString(BUILD_CANCELLED));
break;
case IBuildModelBuilder.STATUS_ERROR_BUILD:
- String msg = resumeOnErr ?
- ManagedMakeMessages.getResourceString(BUILD_FINISHED_WITH_ERRS) :
- ManagedMakeMessages.getResourceString(BUILD_STOPPED_ERR);
+ String msg = resumeOnErr ? ManagedMakeMessages.getResourceString(BUILD_FINISHED_WITH_ERRS)
+ : ManagedMakeMessages.getResourceString(BUILD_STOPPED_ERR);
buf.append(msg);
break;
case IBuildModelBuilder.STATUS_ERROR_LAUNCH:
default:
- buf.append(ManagedMakeMessages
- .getResourceString(BUILD_FAILED_ERR));
+ buf.append(ManagedMakeMessages.getResourceString(BUILD_FAILED_ERR));
break;
}
buf.append(NEWLINE);
// Report time and number of threads used
-// buf.append("Time consumed: ");
-// buf.append(t2 - t1);
-// buf.append(" ms. ");
-// if (isParallel) {
-// buf.append("Parallel threads used: ");
-// buf.append(ParallelBuilder.lastThreadsUsed);
-// }
-// buf.append("\n");
+ // buf.append("Time consumed: ");
+ // buf.append(t2 - t1);
+ // buf.append(" ms. ");
+ // if (isParallel) {
+ // buf.append("Parallel threads used: ");
+ // buf.append(ParallelBuilder.lastThreadsUsed);
+ // }
+ // buf.append("\n");
// Report time and number of threads used
- buf.append(ManagedMakeMessages.getFormattedString("CommonBuilder.6", Integer.toString((int)(t2 - t1)))); //$NON-NLS-1$
-// buf.append(t2 - t1);
-// buf.append(" ms. ");
+ buf.append(
+ ManagedMakeMessages.getFormattedString("CommonBuilder.6", Integer.toString((int) (t2 - t1)))); //$NON-NLS-1$
+ // buf.append(t2 - t1);
+ // buf.append(" ms. ");
if (isParallel) {
- buf.append(ManagedMakeMessages.getFormattedString("CommonBuilder.7", Integer.toString(ParallelBuilder.lastThreadsUsed))); //$NON-NLS-1$
-// buf.append(ParallelBuilder.lastThreadsUsed);
+ buf.append(ManagedMakeMessages.getFormattedString("CommonBuilder.7", //$NON-NLS-1$
+ Integer.toString(ParallelBuilder.lastThreadsUsed)));
+ // buf.append(ParallelBuilder.lastThreadsUsed);
}
buf.append(NEWLINE);
@@ -1342,13 +1350,14 @@ public class GeneratedMakefileBuilder extends ACBuilder {
addBuilderMarkers(epm);
} else {
buf = new StringBuilder();
- buf.append(ManagedMakeMessages.getFormattedString(NOTHING_BUILT, getProject().getName())).append(NEWLINE);
+ buf.append(ManagedMakeMessages.getFormattedString(NOTHING_BUILT, getProject().getName()))
+ .append(NEWLINE);
consoleOutStream.write(buf.toString().getBytes());
consoleOutStream.flush();
}
} catch (Exception e) {
- if(consoleOutStream != null){
+ if (consoleOutStream != null) {
StringBuilder buf = new StringBuilder();
String errorDesc = ManagedMakeMessages.getResourceString(BUILD_ERROR);
buf.append(errorDesc).append(NEWLINE);
@@ -1362,13 +1371,13 @@ public class GeneratedMakefileBuilder extends ACBuilder {
}
forgetLastBuiltState();
} finally {
- if(epmOutputStream != null){
+ if (epmOutputStream != null) {
try {
epmOutputStream.close();
} catch (IOException e) {
}
}
- if(consoleOutStream != null){
+ if (consoleOutStream != null) {
try {
consoleOutStream.close();
} catch (IOException e) {
@@ -1414,8 +1423,10 @@ public class GeneratedMakefileBuilder extends ACBuilder {
for (List<IFile> filesInProject : projectMap.values()) {
IProject project = filesInProject.get(0).getProject();
setCurrentProject(project);
- monitor.subTask(ManagedMakeMessages.getFormattedString("GeneratedMakefileBuilder.buildingProject", project.getName())); //$NON-NLS-1$
- invokeInternalBuilderForOneProject(filesInProject, new SubProgressMonitor(monitor, 1 * PROGRESS_MONITOR_SCALE, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
+ monitor.subTask(ManagedMakeMessages.getFormattedString("GeneratedMakefileBuilder.buildingProject", //$NON-NLS-1$
+ project.getName()));
+ invokeInternalBuilderForOneProject(filesInProject, new SubProgressMonitor(monitor,
+ 1 * PROGRESS_MONITOR_SCALE, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
}
} finally {
if (monitor.isCanceled()) {
@@ -1431,8 +1442,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
BuildRunnerHelper buildRunnerHelper = new BuildRunnerHelper(project);
try {
- monitor.beginTask(ManagedMakeMessages.getFormattedString("GeneratedMakefileBuilder.buildingProject", project.getName()) + ':', //$NON-NLS-1$
- TICKS_STREAM_PROGRESS_MONITOR + files.size() * PROGRESS_MONITOR_SCALE);
+ monitor.beginTask(ManagedMakeMessages.getFormattedString("GeneratedMakefileBuilder.buildingProject", //$NON-NLS-1$
+ project.getName()) + ':', TICKS_STREAM_PROGRESS_MONITOR + files.size() * PROGRESS_MONITOR_SCALE);
// Get a build console for the project
console = CCorePlugin.getDefault().getConsole();
@@ -1448,14 +1459,19 @@ public class GeneratedMakefileBuilder extends ACBuilder {
IBuildDescription des = BuildDescriptionManager.createBuildDescription(configuration, null, 0);
String[] errorParsers = configuration.getErrorParserList();
- ErrorParserManager epm = new ErrorParserManager(project, des.getDefaultBuildDirLocationURI(), this, errorParsers);
+ ErrorParserManager epm = new ErrorParserManager(project, des.getDefaultBuildDirLocationURI(), this,
+ errorParsers);
- buildRunnerHelper.prepareStreams(epm, null, console, new SubProgressMonitor(monitor, TICKS_STREAM_PROGRESS_MONITOR));
+ buildRunnerHelper.prepareStreams(epm, null, console,
+ new SubProgressMonitor(monitor, TICKS_STREAM_PROGRESS_MONITOR));
OutputStream stdout = buildRunnerHelper.getOutputStream();
OutputStream stderr = buildRunnerHelper.getErrorStream();
- buildRunnerHelper.greeting(ManagedMakeMessages.getResourceString("GeneratedMakefileBuilder.buildingSelectedFiles"), cfgName, toolchainName, isSupported); //$NON-NLS-1$
- buildRunnerHelper.printLine(ManagedMakeMessages.getResourceString("ManagedMakeBuilder.message.internal.builder.header.note")); //$NON-NLS-1$
+ buildRunnerHelper.greeting(
+ ManagedMakeMessages.getResourceString("GeneratedMakefileBuilder.buildingSelectedFiles"), cfgName, //$NON-NLS-1$
+ toolchainName, isSupported);
+ buildRunnerHelper.printLine(
+ ManagedMakeMessages.getResourceString("ManagedMakeBuilder.message.internal.builder.header.note")); //$NON-NLS-1$
// Build artifacts for each file in the project
for (IFile file : files) {
@@ -1470,17 +1486,20 @@ public class GeneratedMakefileBuilder extends ACBuilder {
Set<IBuildStep> dependentSteps = new HashSet<IBuildStep>();
IBuildIOType depTypes[] = buildResource.getDependentIOTypes();
for (IBuildIOType btype : depTypes) {
- if(btype != null && btype.getStep() != null)
+ if (btype != null && btype.getStep() != null)
dependentSteps.add(btype.getStep());
}
- SubProgressMonitor monitor2 = new SubProgressMonitor(monitor, 1 * PROGRESS_MONITOR_SCALE, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK);
+ SubProgressMonitor monitor2 = new SubProgressMonitor(monitor, 1 * PROGRESS_MONITOR_SCALE,
+ SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK);
try {
- monitor2.beginTask("", TICKS_DELETE_MARKERS + dependentSteps.size()*PROGRESS_MONITOR_SCALE); //$NON-NLS-1$
+ monitor2.beginTask("", TICKS_DELETE_MARKERS + dependentSteps.size() * PROGRESS_MONITOR_SCALE); //$NON-NLS-1$
// Remove problem markers for the file
- monitor2.subTask(ManagedMakeMessages.getFormattedString("GeneratedMakefileBuilder.removingResourceMarkers", filePath)); //$NON-NLS-1$
- buildRunnerHelper.removeOldMarkers(file, new SubProgressMonitor(monitor2, TICKS_DELETE_MARKERS, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));
+ monitor2.subTask(ManagedMakeMessages
+ .getFormattedString("GeneratedMakefileBuilder.removingResourceMarkers", filePath)); //$NON-NLS-1$
+ buildRunnerHelper.removeOldMarkers(file, new SubProgressMonitor(monitor2, TICKS_DELETE_MARKERS,
+ SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));
// Build dependent steps
for (IBuildStep step : dependentSteps) {
@@ -1490,9 +1509,11 @@ public class GeneratedMakefileBuilder extends ACBuilder {
monitor2.subTask(filePath);
StepBuilder stepBuilder = new StepBuilder(step, null);
- stepBuilder.build(stdout, stderr, new SubProgressMonitor(monitor2, 1 * PROGRESS_MONITOR_SCALE, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));
+ stepBuilder.build(stdout, stderr, new SubProgressMonitor(monitor2,
+ 1 * PROGRESS_MONITOR_SCALE, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));
- monitor2.subTask(ManagedMakeMessages.getFormattedString("GeneratedMakefileBuilder.refreshingArtifacts", filePath)); //$NON-NLS-1$
+ monitor2.subTask(ManagedMakeMessages
+ .getFormattedString("GeneratedMakefileBuilder.refreshingArtifacts", filePath)); //$NON-NLS-1$
IBuildIOType[] outputIOTypes = step.getOutputIOTypes();
for (IBuildIOType type : outputIOTypes) {
for (IBuildResource outResource : type.getResources()) {
@@ -1507,7 +1528,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
}
} catch (Exception e) {
- ManagedBuilderCorePlugin.log(new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "CDT Build Error", e))); //$NON-NLS-1$
+ ManagedBuilderCorePlugin.log(new CoreException(
+ new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "CDT Build Error", e))); //$NON-NLS-1$
}
}
@@ -1515,14 +1537,16 @@ public class GeneratedMakefileBuilder extends ACBuilder {
buildRunnerHelper.goodbye();
} catch (Exception e) {
- ManagedBuilderCorePlugin.log(new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "CDT Build Error", e))); //$NON-NLS-1$
+ ManagedBuilderCorePlugin.log(new CoreException(
+ new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "CDT Build Error", e))); //$NON-NLS-1$
forgetLastBuiltState();
} finally {
getGenerationProblems().clear();
try {
buildRunnerHelper.close();
} catch (IOException e) {
- ManagedBuilderCorePlugin.log(new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "CDT Build Error", e))); //$NON-NLS-1$
+ ManagedBuilderCorePlugin.log(new CoreException(
+ new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "CDT Build Error", e))); //$NON-NLS-1$
}
monitor.done();
}
@@ -1540,8 +1564,10 @@ public class GeneratedMakefileBuilder extends ACBuilder {
for (List<IFile> filesInProject : projectMap.values()) {
IProject project = filesInProject.get(0).getProject();
- monitor.subTask(ManagedMakeMessages.getFormattedString("GeneratedMakefileBuilder.cleaningProject", project.getName())); //$NON-NLS-1$
- cleanFilesForOneProject(filesInProject, new SubProgressMonitor(monitor, 1 * PROGRESS_MONITOR_SCALE, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
+ monitor.subTask(ManagedMakeMessages.getFormattedString("GeneratedMakefileBuilder.cleaningProject", //$NON-NLS-1$
+ project.getName()));
+ cleanFilesForOneProject(filesInProject, new SubProgressMonitor(monitor, 1 * PROGRESS_MONITOR_SCALE,
+ SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
}
} finally {
if (monitor.isCanceled()) {
@@ -1558,8 +1584,8 @@ public class GeneratedMakefileBuilder extends ACBuilder {
int countDeleted = 0;
try {
- monitor.beginTask(ManagedMakeMessages.getFormattedString("GeneratedMakefileBuilder.cleaningProject", project.getName()) + ':', //$NON-NLS-1$
- TICKS_STREAM_PROGRESS_MONITOR + files.size() * PROGRESS_MONITOR_SCALE);
+ monitor.beginTask(ManagedMakeMessages.getFormattedString("GeneratedMakefileBuilder.cleaningProject", //$NON-NLS-1$
+ project.getName()) + ':', TICKS_STREAM_PROGRESS_MONITOR + files.size() * PROGRESS_MONITOR_SCALE);
// Get a build console for the project
console = CCorePlugin.getDefault().getConsole();
@@ -1578,11 +1604,16 @@ public class GeneratedMakefileBuilder extends ACBuilder {
IBuildDescription des = BuildDescriptionManager.createBuildDescription(configuration, delta, flags);
String[] errorParsers = configuration.getErrorParserList();
- ErrorParserManager epm = new ErrorParserManager(project, des.getDefaultBuildDirLocationURI(), this, errorParsers);
- buildRunnerHelper.prepareStreams(epm, null , console, new SubProgressMonitor(monitor, TICKS_STREAM_PROGRESS_MONITOR));
+ ErrorParserManager epm = new ErrorParserManager(project, des.getDefaultBuildDirLocationURI(), this,
+ errorParsers);
+ buildRunnerHelper.prepareStreams(epm, null, console,
+ new SubProgressMonitor(monitor, TICKS_STREAM_PROGRESS_MONITOR));
- buildRunnerHelper.greeting(ManagedMakeMessages.getResourceString("GeneratedMakefileBuilder.cleanSelectedFiles"), cfgName, toolchainName, isSupported); //$NON-NLS-1$
- buildRunnerHelper.printLine(ManagedMakeMessages.getResourceString("ManagedMakeBuilder.message.internal.builder.header.note")); //$NON-NLS-1$
+ buildRunnerHelper.greeting(
+ ManagedMakeMessages.getResourceString("GeneratedMakefileBuilder.cleanSelectedFiles"), cfgName, //$NON-NLS-1$
+ toolchainName, isSupported);
+ buildRunnerHelper.printLine(
+ ManagedMakeMessages.getResourceString("ManagedMakeBuilder.message.internal.builder.header.note")); //$NON-NLS-1$
for (IFile file : files) {
if (monitor.isCanceled()) {
@@ -1600,13 +1631,17 @@ public class GeneratedMakefileBuilder extends ACBuilder {
dependentSteps.add(btype.getStep());
}
- SubProgressMonitor monitor2 = new SubProgressMonitor(monitor, 1 * PROGRESS_MONITOR_SCALE, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK);
+ SubProgressMonitor monitor2 = new SubProgressMonitor(monitor, 1 * PROGRESS_MONITOR_SCALE,
+ SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK);
try {
- monitor2.beginTask("", TICKS_DELETE_MARKERS + dependentSteps.size()*PROGRESS_MONITOR_SCALE); //$NON-NLS-1$
+ monitor2.beginTask("", //$NON-NLS-1$
+ TICKS_DELETE_MARKERS + dependentSteps.size() * PROGRESS_MONITOR_SCALE);
// Remove problem markers for the file
- monitor2.subTask(ManagedMakeMessages.getFormattedString("GeneratedMakefileBuilder.removingResourceMarkers", filePath)); //$NON-NLS-1$
- buildRunnerHelper.removeOldMarkers(file, new SubProgressMonitor(monitor2, TICKS_DELETE_MARKERS, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));
+ monitor2.subTask(ManagedMakeMessages
+ .getFormattedString("GeneratedMakefileBuilder.removingResourceMarkers", filePath)); //$NON-NLS-1$
+ buildRunnerHelper.removeOldMarkers(file, new SubProgressMonitor(monitor2,
+ TICKS_DELETE_MARKERS, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));
// iterate through all build steps
for (IBuildStep step : dependentSteps) {
@@ -1620,11 +1655,13 @@ public class GeneratedMakefileBuilder extends ACBuilder {
for (IBuildIOType ioType : outputIOTypes) {
for (IBuildResource rc : ioType.getResources()) {
- IResource outputFile = project.findMember(rc.getFullPath().removeFirstSegments(1)); // strip project name
+ IResource outputFile = project
+ .findMember(rc.getFullPath().removeFirstSegments(1)); // strip project name
if (outputFile != null) {
outputFile.delete(true, null);
countDeleted++;
- buildRunnerHelper.printLine(ManagedMakeMessages.getFormattedString("GeneratedMakefileBuilder.fileDeleted", //$NON-NLS-1$
+ buildRunnerHelper.printLine(ManagedMakeMessages.getFormattedString(
+ "GeneratedMakefileBuilder.fileDeleted", //$NON-NLS-1$
outputFile.getProjectRelativePath().toString()));
}
}
@@ -1637,23 +1674,27 @@ public class GeneratedMakefileBuilder extends ACBuilder {
}
}
} catch (Exception e) {
- ManagedBuilderCorePlugin.log(new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "CDT Build Error", e))); //$NON-NLS-1$
+ ManagedBuilderCorePlugin.log(new CoreException(
+ new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "CDT Build Error", e))); //$NON-NLS-1$
}
}
if (countDeleted == 0) {
- buildRunnerHelper.printLine(ManagedMakeMessages.getResourceString("GeneratedMakefileBuilder.nothingToClean")); //$NON-NLS-1$
+ buildRunnerHelper
+ .printLine(ManagedMakeMessages.getResourceString("GeneratedMakefileBuilder.nothingToClean")); //$NON-NLS-1$
}
buildRunnerHelper.close();
buildRunnerHelper.goodbye();
} catch (Exception e) {
- ManagedBuilderCorePlugin.log(new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "CDT Build Error", e))); //$NON-NLS-1$
+ ManagedBuilderCorePlugin.log(new CoreException(
+ new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "CDT Build Error", e))); //$NON-NLS-1$
} finally {
try {
buildRunnerHelper.close();
} catch (IOException e) {
- ManagedBuilderCorePlugin.log(new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "CDT Build Error", e))); //$NON-NLS-1$
+ ManagedBuilderCorePlugin.log(new CoreException(
+ new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "CDT Build Error", e))); //$NON-NLS-1$
}
monitor.done();
}
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 f2944e92382..a3868182709 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
@@ -23,8 +23,7 @@ public class GnuConfigurationNameProvider implements IConfigurationNameProvider
* @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) {
+ public String getNewConfigurationName(IConfiguration configuration, String[] usedConfigurationNames) {
// TODO Auto-generated method stub
return null;
}
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 a6cd20bcf04..2a8d001a2bd 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
@@ -203,13 +203,14 @@ public class HeadlessBuilder implements IApplication {
/*
* Find all project build configurations that match the regular expression ("project/config")
*/
- protected Map<IProject, Set<ICConfigurationDescription>> matchConfigurations(String regularExpression, IProject[] projectList, Map<IProject, Set<ICConfigurationDescription>> cfgMap) {
+ protected Map<IProject, Set<ICConfigurationDescription>> matchConfigurations(String regularExpression,
+ IProject[] projectList, Map<IProject, Set<ICConfigurationDescription>> cfgMap) {
try {
int separatorIndex = regularExpression.indexOf('/');
String projectRegEx;
String configRegEx;
- if(separatorIndex == -1 || separatorIndex == regularExpression.length()-1) {
+ if (separatorIndex == -1 || separatorIndex == regularExpression.length() - 1) {
// build all configurations for this project
projectRegEx = regularExpression;
configRegEx = MATCH_ALL_CONFIGS;
@@ -224,27 +225,28 @@ public class HeadlessBuilder implements IApplication {
// Find the projects that match the regular expression
boolean projectMatched = false;
boolean configMatched = false;
- for(IProject project : projectList) {
+ for (IProject project : projectList) {
Matcher projectMatcher = projectPattern.matcher(project.getName());
- if(projectMatcher.matches()) {
+ if (projectMatcher.matches()) {
projectMatched = true;
// Find the configurations that match the regular expression
ICProjectDescription desc = CoreModel.getDefault().getProjectDescription(project, false);
if (desc == null) {
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_project + project.getName() + HeadlessBuildMessages.HeadlessBuilder_Not_CDT_Proj);
+ System.err.println(HeadlessBuildMessages.HeadlessBuilder_project + project.getName()
+ + HeadlessBuildMessages.HeadlessBuilder_Not_CDT_Proj);
continue;
}
ICConfigurationDescription[] cfgs = desc.getConfigurations();
- for(ICConfigurationDescription cfg : cfgs) {
+ for (ICConfigurationDescription cfg : cfgs) {
Matcher cfgMatcher = configPattern.matcher(cfg.getName());
- if(cfgMatcher.matches()) {
+ if (cfgMatcher.matches()) {
configMatched = true;
// Build this configuration for this project
Set<ICConfigurationDescription> set = cfgMap.get(project);
- if(set == null)
+ if (set == null)
set = new HashSet<ICConfigurationDescription>();
set.add(cfg);
cfgMap.put(project, set);
@@ -253,12 +255,15 @@ public class HeadlessBuilder implements IApplication {
}
}
if (!projectMatched)
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_NoProjectMatched + regularExpression + HeadlessBuildMessages.HeadlessBuilder_Skipping2);
+ System.err.println(HeadlessBuildMessages.HeadlessBuilder_NoProjectMatched + regularExpression
+ + HeadlessBuildMessages.HeadlessBuilder_Skipping2);
else if (!configMatched)
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_NoConfigMatched + regularExpression + HeadlessBuildMessages.HeadlessBuilder_Skipping2);
+ System.err.println(HeadlessBuildMessages.HeadlessBuilder_NoConfigMatched + regularExpression
+ + HeadlessBuildMessages.HeadlessBuilder_Skipping2);
} catch (PatternSyntaxException e) {
System.err.println(HeadlessBuildMessages.HeadlessBuilder_RegExSyntaxError + e.toString());
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_Skipping + regularExpression + HeadlessBuildMessages.HeadlessBuilder_Quote);
+ System.err.println(HeadlessBuildMessages.HeadlessBuilder_Skipping + regularExpression
+ + HeadlessBuildMessages.HeadlessBuilder_Quote);
}
return cfgMap;
}
@@ -266,7 +271,8 @@ public class HeadlessBuilder implements IApplication {
/*
* Build the given configurations using the specified build type (FULL, CLEAN, INCREMENTAL)
*/
- protected void buildConfigurations(Map<IProject, Set<ICConfigurationDescription>> projConfigs, final IProgressMonitor monitor, final int buildType) throws CoreException {
+ protected void buildConfigurations(Map<IProject, Set<ICConfigurationDescription>> projConfigs,
+ final IProgressMonitor monitor, final int buildType) throws CoreException {
for (Map.Entry<IProject, Set<ICConfigurationDescription>> entry : projConfigs.entrySet()) {
Set<ICConfigurationDescription> cfgDescs = entry.getValue();
@@ -304,7 +310,7 @@ public class HeadlessBuilder implements IApplication {
// Handle relative paths as relative to cwd
if (project_uri.getScheme() == null) {
- String cwd = System.getProperty("user.dir"); //$NON-NLS-1$
+ String cwd = System.getProperty("user.dir"); //$NON-NLS-1$
p = new Path(cwd).addTrailingSeparator();
p = p.append(projURIStr);
project_uri = URIUtil.toURI(p);
@@ -317,7 +323,8 @@ public class HeadlessBuilder implements IApplication {
if (recurse) {
if (!EFS.getStore(project_uri).fetchInfo().exists()) {
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_Directory + project_uri + HeadlessBuildMessages.HeadlessBuilder_cant_be_found);
+ System.err.println(HeadlessBuildMessages.HeadlessBuilder_Directory + project_uri
+ + HeadlessBuildMessages.HeadlessBuilder_cant_be_found);
return ERROR;
}
for (IFileStore info : EFS.getStore(project_uri).childStores(EFS.NONE, monitor)) {
@@ -333,7 +340,8 @@ public class HeadlessBuilder implements IApplication {
IFileStore fstore = EFS.getStore(project_uri).getChild(".project"); //$NON-NLS-1$
if (!fstore.fetchInfo().exists()) {
if (!recurse) {
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_project + project_uri + HeadlessBuildMessages.HeadlessBuilder_cant_be_found);
+ System.err.println(HeadlessBuildMessages.HeadlessBuilder_project + project_uri
+ + HeadlessBuildMessages.HeadlessBuilder_cant_be_found);
return ERROR;
}
// .project not found; OK if we're not recursing
@@ -351,20 +359,23 @@ public class HeadlessBuilder implements IApplication {
project.open(monitor);
return OK;
}
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_project + desc.getName() + HeadlessBuildMessages.HeadlessBuilder_already_exists_in_workspace);
+ System.err.println(HeadlessBuildMessages.HeadlessBuilder_project + desc.getName()
+ + HeadlessBuildMessages.HeadlessBuilder_already_exists_in_workspace);
return ERROR;
}
// Create and open the project
// Note that if the project exists directly under the workspace root, we can't #setLocationURI(...)
- if (!URIUtil.equals(org.eclipse.core.runtime.URIUtil.append(
- ResourcesPlugin.getWorkspace().getRoot().getLocationURI(),
- org.eclipse.core.runtime.URIUtil.lastSegment(project_uri)), project_uri))
+ if (!URIUtil.equals(
+ org.eclipse.core.runtime.URIUtil.append(ResourcesPlugin.getWorkspace().getRoot().getLocationURI(),
+ org.eclipse.core.runtime.URIUtil.lastSegment(project_uri)),
+ project_uri))
desc.setLocationURI(project_uri);
else
project_uri = null;
// Check the URI is valid for a project in this workspace
if (!root.getWorkspace().validateProjectLocationURI(project, project_uri).equals(Status.OK_STATUS)) {
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_URI + project_uri + HeadlessBuildMessages.HeadlessBuilder_is_not_valid_in_workspace);
+ System.err.println(HeadlessBuildMessages.HeadlessBuilder_URI + project_uri
+ + HeadlessBuildMessages.HeadlessBuilder_is_not_valid_in_workspace);
return ERROR;
}
@@ -374,7 +385,8 @@ public class HeadlessBuilder implements IApplication {
try {
if (in != null)
in.close();
- } catch (IOException e2) { /* don't care */ }
+ } catch (IOException e2) {
+ /* don't care */ }
}
return OK;
}
@@ -435,12 +447,13 @@ public class HeadlessBuilder implements IApplication {
}
if (!root.isAccessible()) {
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_Workspace + root.getLocationURI().toString() + HeadlessBuildMessages.HeadlessBuilder_is_not_accessible);
+ System.err.println(HeadlessBuildMessages.HeadlessBuilder_Workspace + root.getLocationURI().toString()
+ + HeadlessBuildMessages.HeadlessBuilder_is_not_accessible);
return ERROR;
}
// Handle user provided arguments
- if (!getArguments((String[])context.getArguments().get(IApplicationContext.APPLICATION_ARGS)))
+ if (!getArguments((String[]) context.getArguments().get(IApplicationContext.APPLICATION_ARGS)))
return ERROR;
if (markerTypesDefault || markerTypesAll) {
@@ -535,7 +548,7 @@ public class HeadlessBuilder implements IApplication {
System.out.println(HeadlessBuildMessages.HeadlessBuilder_building_all);
root.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, monitor);
- for(IProject p : root.getProjects()) {
+ for (IProject p : root.getProjects()) {
buildSuccessful = buildSuccessful && isProjectSuccesfullyBuild(p);
if (printErrorMarkers) {
accumulateErrorMarkers(p, allBuildErrors);
@@ -547,7 +560,7 @@ public class HeadlessBuilder implements IApplication {
matchConfigurations(regEx, allProjects, configsToBuild);
// Build the list of configurations
buildConfigurations(configsToBuild, monitor, IncrementalProjectBuilder.FULL_BUILD);
- for(IProject p : configsToBuild.keySet()) {
+ for (IProject p : configsToBuild.keySet()) {
buildSuccessful = buildSuccessful && isProjectSuccesfullyBuild(p);
if (printErrorMarkers) {
accumulateErrorMarkers(p, allBuildErrors);
@@ -639,7 +652,7 @@ public class HeadlessBuilder implements IApplication {
* -I {include_path} additional include_path to add to tools
* -include {include_file} additional include_file to pass to tools
* -D {prepoc_define} addition preprocessor defines to pass to the tools
- * -E {var=value} replace/add value to environment variable when running all tools
+ * -E {var=value} replace/add value to environment variable when running all tools
* -Ea {var=value} append value to environment variable when running all tools
* -Ep {var=value} prepend value to environment variable when running all tools
* -Er {var} remove/unset the given environment variable
@@ -677,11 +690,14 @@ public class HeadlessBuilder implements IApplication {
macroVal = macro.substring(macro.indexOf('=') + 1);
macro = macro.substring(0, macro.indexOf('='));
}
- HeadlessBuilderExternalSettingsProvider.additionalSettings.add(CDataUtil.createCMacroEntry(macro, macroVal, 0));
+ HeadlessBuilderExternalSettingsProvider.additionalSettings
+ .add(CDataUtil.createCMacroEntry(macro, macroVal, 0));
} else if ("-I".equals(args[i])) { //$NON-NLS-1$
- HeadlessBuilderExternalSettingsProvider.additionalSettings.add(CDataUtil.createCIncludePathEntry(args[++i], 0));
+ HeadlessBuilderExternalSettingsProvider.additionalSettings
+ .add(CDataUtil.createCIncludePathEntry(args[++i], 0));
} else if ("-include".equals(args[i])) { //$NON-NLS-1$
- HeadlessBuilderExternalSettingsProvider.additionalSettings.add(CDataUtil.createCIncludeFileEntry(args[++i], 0));
+ HeadlessBuilderExternalSettingsProvider.additionalSettings
+ .add(CDataUtil.createCIncludeFileEntry(args[++i], 0));
} else if ("-E".equals(args[i])) { //$NON-NLS-1$
addEnvironmentVariable(args[++i], IEnvironmentVariable.ENVVAR_REPLACE);
} else if ("-Ea".equals(args[i])) { //$NON-NLS-1$
@@ -718,7 +734,8 @@ public class HeadlessBuilder implements IApplication {
}
} catch (Exception e) {
// Print usage
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_invalid_argument + args != null ? Arrays.toString(args) : ""); //$NON-NLS-1$
+ System.err.println(
+ HeadlessBuildMessages.HeadlessBuilder_invalid_argument + args != null ? Arrays.toString(args) : ""); //$NON-NLS-1$
System.err.println(HeadlessBuildMessages.HeadlessBuilder_Error + e.getMessage());
System.err.println(HeadlessBuildMessages.HeadlessBuilder_usage);
System.err.println(HeadlessBuildMessages.HeadlessBuilder_usage_import);
@@ -809,61 +826,62 @@ public class HeadlessBuilder implements IApplication {
savedToolOptionsSet.add(new SavedToolOption(tool.getId(), option.getId(), option.getValue()));
// Update the value of the tool option in a type-dependent manner
switch (option.getValueType()) {
- case IOption.BOOLEAN:
- boolean booleanValue = (Boolean) option.getDefaultValue();
- if (toolOption.operation != ToolOption.REMOVE)
+ case IOption.BOOLEAN:
+ boolean booleanValue = (Boolean) option.getDefaultValue();
+ if (toolOption.operation != ToolOption.REMOVE)
booleanValue = Boolean.parseBoolean(toolOption.value);
- ManagedBuildManager.setOption(configuration, tool, option, booleanValue);
+ ManagedBuildManager.setOption(configuration, tool, option, booleanValue);
+ break;
+ case IOption.STRING_LIST:
+ case IOption.INCLUDE_PATH:
+ case IOption.PREPROCESSOR_SYMBOLS:
+ case IOption.LIBRARIES:
+ case IOption.OBJECTS:
+ case IOption.INCLUDE_FILES:
+ case IOption.LIBRARY_PATHS:
+ case IOption.LIBRARY_FILES:
+ case IOption.MACRO_FILES:
+ case IOption.UNDEF_INCLUDE_PATH:
+ case IOption.UNDEF_PREPROCESSOR_SYMBOLS:
+ case IOption.UNDEF_INCLUDE_FILES:
+ case IOption.UNDEF_LIBRARY_PATHS:
+ case IOption.UNDEF_LIBRARY_FILES:
+ case IOption.UNDEF_MACRO_FILES:
+ List<String> listValue = new ArrayList<String>();
+ switch (toolOption.operation) {
+ case ToolOption.APPEND:
+ listValue.addAll((List<String>) option.getValue());
+ listValue.addAll(Arrays.asList(toolOption.value.split(","))); //$NON-NLS-1$
break;
- case IOption.STRING_LIST:
- case IOption.INCLUDE_PATH:
- case IOption.PREPROCESSOR_SYMBOLS:
- case IOption.LIBRARIES:
- case IOption.OBJECTS:
- case IOption.INCLUDE_FILES:
- case IOption.LIBRARY_PATHS:
- case IOption.LIBRARY_FILES:
- case IOption.MACRO_FILES:
- case IOption.UNDEF_INCLUDE_PATH:
- case IOption.UNDEF_PREPROCESSOR_SYMBOLS:
- case IOption.UNDEF_INCLUDE_FILES:
- case IOption.UNDEF_LIBRARY_PATHS:
- case IOption.UNDEF_LIBRARY_FILES:
- case IOption.UNDEF_MACRO_FILES:
- List<String> listValue = new ArrayList<String>();
- switch (toolOption.operation) {
- case ToolOption.APPEND:
- listValue.addAll((List<String>) option.getValue());
- listValue.addAll(Arrays.asList(toolOption.value.split(","))); //$NON-NLS-1$
- break;
- case ToolOption.PREPEND:
- listValue.addAll(Arrays.asList(toolOption.value.split(","))); //$NON-NLS-1$
- listValue.addAll((List<String>) option.getValue());
- break;
- case ToolOption.REMOVE:
- listValue = (List<String>) option.getDefaultValue();
- break;
- default:
- listValue = Arrays.asList(toolOption.value.split(",")); //$NON-NLS-1$
- break;
- }
- ManagedBuildManager.setOption(configuration, tool, option, listValue == null ? new String[0] : listValue.toArray(new String[listValue.size()]));
+ case ToolOption.PREPEND:
+ listValue.addAll(Arrays.asList(toolOption.value.split(","))); //$NON-NLS-1$
+ listValue.addAll((List<String>) option.getValue());
break;
- default: // IOption.ENUMERATED, IOption.STRING
- String stringValue = toolOption.value;
- switch (toolOption.operation) {
- case ToolOption.APPEND:
- stringValue = option.getValue() + stringValue;
- break;
- case ToolOption.PREPEND:
- stringValue = stringValue + option.getValue();
- break;
- case ToolOption.REMOVE:
- stringValue = (String) option.getDefaultValue();
- break;
- }
- ManagedBuildManager.setOption(configuration, tool, option, stringValue);
+ case ToolOption.REMOVE:
+ listValue = (List<String>) option.getDefaultValue();
break;
+ default:
+ listValue = Arrays.asList(toolOption.value.split(",")); //$NON-NLS-1$
+ break;
+ }
+ ManagedBuildManager.setOption(configuration, tool, option,
+ listValue == null ? new String[0] : listValue.toArray(new String[listValue.size()]));
+ break;
+ default: // IOption.ENUMERATED, IOption.STRING
+ String stringValue = toolOption.value;
+ switch (toolOption.operation) {
+ case ToolOption.APPEND:
+ stringValue = option.getValue() + stringValue;
+ break;
+ case ToolOption.PREPEND:
+ stringValue = stringValue + option.getValue();
+ break;
+ case ToolOption.REMOVE:
+ stringValue = (String) option.getDefaultValue();
+ break;
+ }
+ ManagedBuildManager.setOption(configuration, tool, option, stringValue);
+ break;
}
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilderExternalSettingsProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilderExternalSettingsProvider.java
index 52f34bcbb1b..d6c8af7843d 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilderExternalSettingsProvider.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilderExternalSettingsProvider.java
@@ -48,7 +48,8 @@ public class HeadlessBuilderExternalSettingsProvider extends CExternalSettingPro
public CExternalSetting[] getSettings(IProject project, ICConfigurationDescription cfg) {
if (additionalSettings.isEmpty())
return new CExternalSetting[0];
- return new CExternalSetting[] { new CExternalSetting(null, null, null, additionalSettings.toArray(new ICSettingEntry[additionalSettings.size()])) };
+ return new CExternalSetting[] { new CExternalSetting(null, null, null,
+ additionalSettings.toArray(new ICSettingEntry[additionalSettings.size()])) };
}
/**
@@ -90,7 +91,8 @@ public class HeadlessBuilderExternalSettingsProvider extends CExternalSettingPro
if (desc == null)
continue;
for (ICConfigurationDescription cfg : desc.getConfigurations()) {
- ArrayList<String> extSettingIds = new ArrayList<String>(Arrays.asList(cfg.getExternalSettingsProviderIds()));
+ ArrayList<String> extSettingIds = new ArrayList<String>(
+ Arrays.asList(cfg.getExternalSettingsProviderIds()));
for (Iterator<String> it = extSettingIds.iterator(); it.hasNext();)
if (ID.equals(it.next()))
it.remove();
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 8aedc418677..9ba47bae536 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
@@ -57,7 +57,8 @@ import org.eclipse.core.runtime.Status;
*
* @since 3.0
*/
-public abstract class HoldsOptions extends BuildObject implements IHoldsOptions, IBuildPropertiesRestriction, IBuildPropertyChangeListener {
+public abstract class HoldsOptions extends BuildObject
+ implements IHoldsOptions, IBuildPropertiesRestriction, IBuildPropertyChangeListener {
private static final IOptionCategory[] EMPTY_CATEGORIES = new IOptionCategory[0];
@@ -107,10 +108,10 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
String subId;
String subName;
if (option.getSuperClass() != null) {
- subId = copyIds ? option.getId() : option.getSuperClass().getId() + "." + nnn; //$NON-NLS-1$
+ subId = copyIds ? option.getId() : option.getSuperClass().getId() + "." + nnn; //$NON-NLS-1$
subName = option.getSuperClass().getName();
} else {
- subId = copyIds ? option.getId() : option.getId() + "." + nnn; //$NON-NLS-1$
+ subId = copyIds ? option.getId() : option.getId() + "." + nnn; //$NON-NLS-1$
subName = option.getName();
}
Option newOption = new Option(this, subId, subName, option);
@@ -118,30 +119,30 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
}
}
- if(copyIds){
+ if (copyIds) {
isDirty = source.isDirty;
rebuildState = source.rebuildState;
}
}
- void copyNonoverriddenSettings(HoldsOptions ho){
+ 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))
+ for (int i = 0; i < options.length; i++) {
+ if (!options[i].getParent().equals(ho))
continue;
- Option option = (Option)options[i];
+ Option option = (Option) options[i];
int nnn = ManagedBuildManager.getRandomNumber();
String subId;
String subName;
if (option.getSuperClass() != null) {
- subId = option.getSuperClass().getId() + "." + nnn; //$NON-NLS-1$
+ subId = option.getSuperClass().getId() + "." + nnn; //$NON-NLS-1$
subName = option.getSuperClass().getName();
} else {
- subId = option.getId() + "." + nnn; //$NON-NLS-1$
+ subId = option.getId() + "." + nnn; //$NON-NLS-1$
subName = option.getName();
}
Option newOption = new Option(this, subId, subName, option);
@@ -200,7 +201,7 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
if (childOptionCategories != null) {
for (IOptionCategory optCat : childOptionCategories) {
ICStorageElement optCatElement = element.createChild(OPTION);
- ((OptionCategory)optCat).serialize(optCatElement);
+ ((OptionCategory) optCat).serialize(optCatElement);
}
}
@@ -209,7 +210,7 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
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
@@ -222,7 +223,7 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
public IOption createOption(IOption superClass, String Id, String name, boolean isExtensionElement) {
Option option = new Option(this, superClass, Id, name, isExtensionElement);
addOption(option);
- if(!isExtensionElement){
+ if (!isExtensionElement) {
setDirty(true);
setRebuildState(true);
}
@@ -234,9 +235,9 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
*/
@Override
public void createOptions(IHoldsOptions superClass) {
- for (Option optionChild : ((HoldsOptions)superClass).getOptionCollection()) {
+ for (Option optionChild : ((HoldsOptions) superClass).getOptionCollection()) {
int nnn = ManagedBuildManager.getRandomNumber();
- String subId = optionChild.getId() + "." + nnn; //$NON-NLS-1$
+ String subId = optionChild.getId() + "." + nnn; //$NON-NLS-1$
createOption(optionChild, subId, optionChild.getName(), false);
}
}
@@ -246,15 +247,15 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
*/
@Override
public void removeOption(IOption option) {
- if(option.getParent() != this)
+ if (option.getParent() != this)
return;
-// throw new IllegalArgumentException();
+ // throw new IllegalArgumentException();
getOptionMap().remove(option.getId());
setDirty(true);
setRebuildState(true);
- if(!isExtensionElement()){
+ if (!isExtensionElement()) {
NotificationManager.getInstance().optionRemoved(getParentResourceInfo(), this, option);
}
}
@@ -266,56 +267,54 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
public IOption[] getOptions() {
Collection<IOption> opts = doGetOptions().values();
return opts.toArray(new IOption[opts.size()]);
- }
-
+ }
+
/**
* This method returns an intermediate object, ultimately used by {@link #getOptions()}.
- *
+ *
* NOTE: The keys in the returned map are only used to efficiently override the values as this method
* is invoked recursively. Once the recursion unwinds, the keys in the resulting map are a mixture of
- * actual option IDs and option superClass IDs. So the keys of the resulting map should not be relied
- * upon - only the values hold significance at this point.
+ * actual option IDs and option superClass IDs. So the keys of the resulting map should not be relied
+ * upon - only the values hold significance at this point.
*/
- private Map<String,IOption> doGetOptions() {
- Map<String,IOption> map = null;
-
- if(this.superClass == null) {
- map = new LinkedHashMap<String,IOption>(); // LinkedHashMap ensures we maintain option ordering
-
- for(Option ourOpt : getOptionCollection()) {
- if(ourOpt.isValid()) {
+ private Map<String, IOption> doGetOptions() {
+ Map<String, IOption> map = null;
+
+ if (this.superClass == null) {
+ map = new LinkedHashMap<String, IOption>(); // LinkedHashMap ensures we maintain option ordering
+
+ for (Option ourOpt : getOptionCollection()) {
+ if (ourOpt.isValid()) {
map.put(ourOpt.getId(), ourOpt);
}
}
- }
- else {
-
+ } else {
+
// 1. Get the option-map from superClass.
- map = ((HoldsOptions)this.superClass).doGetOptions();
-
+ map = ((HoldsOptions) this.superClass).doGetOptions();
+
// 2. Override the superClass' options with ours, maintaining the option ordering
- for(Option ourOpt : getOptionCollection()) {
+ for (Option ourOpt : getOptionCollection()) {
String key = ourOpt.getId();
-
- for(IOption superOpt = ourOpt.getSuperClass(); superOpt != null; superOpt = superOpt.getSuperClass()) {
- if(map.containsKey(superOpt.getId())) {
+
+ for (IOption superOpt = ourOpt.getSuperClass(); superOpt != null; superOpt = superOpt.getSuperClass()) {
+ if (map.containsKey(superOpt.getId())) {
key = superOpt.getId();
break;
}
}
-
- if(ourOpt.isValid()) {
+
+ if (ourOpt.isValid()) {
map.put(key, ourOpt);
- }
- else {
+ } else {
map.remove(key);
}
}
}
-
+
return map;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#getOption(java.lang.String)
*/
@@ -335,7 +334,8 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
return superClass.getOptionById(id);
}
}
- if (opt == null) return null;
+ if (opt == null)
+ return null;
return opt.isValid() ? opt : null;
}
@@ -344,32 +344,33 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
*/
@Override
public IOption getOptionBySuperClassId(String optionId) {
- if (optionId == null) return null;
+ if (optionId == null)
+ return null;
- // 1. Try a quick look-up - at first iteration in the recursion, this will yield nothing, but once
+ // 1. Try a quick look-up - at first iteration in the recursion, this will yield nothing, but once
// we go into recursion (step 3), this look-up would efficiently find non-overridden options.
IOption option = getOptionMap().get(optionId);
- if(option != null) {
+ if (option != null) {
return option;
}
// 2. Try to find the option among those that we override.
- for(Option ourOpt : getOptionCollection()) {
- for(IOption superOpt = ourOpt.getSuperClass(); superOpt != null; superOpt = superOpt.getSuperClass()) {
- if(optionId.equals(superOpt.getId())) {
- return ourOpt.isValid()? ourOpt: null;
+ for (Option ourOpt : getOptionCollection()) {
+ for (IOption superOpt = ourOpt.getSuperClass(); superOpt != null; superOpt = superOpt.getSuperClass()) {
+ if (optionId.equals(superOpt.getId())) {
+ return ourOpt.isValid() ? ourOpt : null;
}
}
}
-
+
// 3. If not found in step 2, recurse into superClass.
- if(this.superClass != null) {
+ if (this.superClass != null) {
return this.superClass.getOptionBySuperClassId(optionId);
}
-
+
return null;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IHoldsOptions#getChildCategories()
*/
@@ -384,17 +385,17 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
if (superClass != null) {
superCats = superClass.getChildCategories();
}
- if ( childOptionCategories != null ) {
+ if (childOptionCategories != null) {
ourCats = childOptionCategories.toArray(new IOptionCategory[childOptionCategories.size()]);
}
// Add the two arrays together;
- if (superCats.length > 0 || ourCats.length > 0) {
+ if (superCats.length > 0 || ourCats.length > 0) {
IOptionCategory[] allCats = new IOptionCategory[superCats.length + ourCats.length];
int j;
- for (j=0; j < superCats.length; j++)
+ for (j = 0; j < superCats.length; j++)
allCats[j] = superCats[j];
- for (j=0; j < ourCats.length; j++)
- allCats[j+superCats.length] = ourCats[j];
+ for (j = 0; j < ourCats.length; j++)
+ allCats[j + superCats.length] = ourCats[j];
return allCats;
}
// Nothing found, return EMPTY_CATEGORIES
@@ -424,6 +425,7 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
public void addOption(Option option) {
getOptionMap().put(option.getId(), option);
}
+
/**
* Memory-safe way to access the map of category IDs to categories
*/
@@ -439,9 +441,10 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
*/
private Collection<Option> getOptionCollection() {
// no need to store all the options twice, get them out of the map
- if(optionMap != null)
+ if (optionMap != null)
return optionMap.values();
- else return Collections.emptyList();
+ else
+ return Collections.emptyList();
}
/**
@@ -471,7 +474,7 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
@Override
public IOptionCategory getOptionCategory(String id) {
IOptionCategory cat = getCategoryMap().get(id);
- if (cat == null && superClass != null) {
+ if (cat == null && superClass != null) {
// Look up the holders superclasses to find the category
return superClass.getOptionCategory(id);
}
@@ -507,7 +510,7 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
// Propagate "false" to the children
if (!isDirty) {
for (Option option : getOptionCollection())
- if(!option.isExtensionElement())
+ if (!option.isExtensionElement())
option.setDirty(false);
}
}
@@ -527,11 +530,11 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
for (String id : getCategoryIds()) {
IOptionCategory current = getCategoryMap().get(id);
if (current instanceof Tool) {
- ((Tool)current).resolveReferences();
+ ((Tool) current).resolveReferences();
} else if (current instanceof ToolChain) {
- ((ToolChain)current).resolveReferences();
+ ((ToolChain) current).resolveReferences();
} else if (current instanceof OptionCategory) {
- ((OptionCategory)current).resolveReferences();
+ ((OptionCategory) current).resolveReferences();
}
}
}
@@ -541,26 +544,22 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
* @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{
+ public IOption getOptionToSet(IOption option, boolean adjustExtension) throws BuildException {
IOption setOption = null;
// start changes
- if(option.getOptionHolder() != this) {
+ if (option.getOptionHolder() != this) {
// option = getOptionBySuperClassId(option.getId());
IOption op = getOptionBySuperClassId(option.getId());
if (op == null && option.getSuperClass() != null) {
op = getOptionBySuperClassId(option.getSuperClass().getId());
if (op == null) {
- ManagedBuilderCorePlugin.log(
- new Status(
- 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)
- );
+ ManagedBuilderCorePlugin
+ .log(new Status(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));
} else
option = op;
} else
@@ -568,46 +567,48 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
}
// end changes
- if(adjustExtension){
- for(; option != null && !option.isExtensionElement(); option=option.getSuperClass()){}
+ if (adjustExtension) {
+ for (; option != null && !option.isExtensionElement(); option = option.getSuperClass()) {
+ }
- if(option != null){
+ if (option != null) {
IHoldsOptions holder = option.getOptionHolder();
- if(holder == this)
+ if (holder == this)
setOption = option;
else {
IOption newSuperClass = option;
- if (((Option)option).wasOptRef()) {
+ if (((Option) option).wasOptRef()) {
newSuperClass = option.getSuperClass();
}
// Create a new extension Option element
String subId;
String version = ManagedBuildManager.getVersionFromIdAndVersion(newSuperClass.getId());
String baseId = ManagedBuildManager.getIdFromIdAndVersion(newSuperClass.getId());
- if ( version != null) {
- subId = baseId + ".adjusted." + Integer.toString(ManagedBuildManager.getRandomNumber()) + "_" + version; //$NON-NLS-1$ //$NON-NLS-2$
+ if (version != null) {
+ subId = baseId + ".adjusted." + Integer.toString(ManagedBuildManager.getRandomNumber()) + "_" //$NON-NLS-1$//$NON-NLS-2$
+ + version;
} else {
subId = baseId + ".adjusted." + Integer.toString(ManagedBuildManager.getRandomNumber()); //$NON-NLS-1$
}
setOption = createOption(newSuperClass, subId, null, true);
- ((Option)setOption).setAdjusted(true);
+ ((Option) setOption).setAdjusted(true);
setOption.setValueType(option.getValueType());
}
}
} else {
- if(option.getOptionHolder() == this && !option.isExtensionElement()){
+ if (option.getOptionHolder() == this && !option.isExtensionElement()) {
setOption = option;
} else {
IOption newSuperClass = option;
- for(;
- newSuperClass != null && !newSuperClass.isExtensionElement();
- newSuperClass = newSuperClass.getSuperClass()){}
+ for (; newSuperClass != null
+ && !newSuperClass.isExtensionElement(); newSuperClass = newSuperClass.getSuperClass()) {
+ }
- if (((Option)newSuperClass).wasOptRef()) {
+ if (((Option) newSuperClass).wasOptRef()) {
newSuperClass = newSuperClass.getSuperClass();
}
- if(((Option)newSuperClass).isAdjustedExtension()){
+ if (((Option) newSuperClass).isAdjustedExtension()) {
newSuperClass = newSuperClass.getSuperClass();
}
// Create an Option element for the managed build project file (.CDTBUILD)
@@ -625,7 +626,7 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
*/
@Override
public boolean needsRebuild() {
- if(rebuildState)
+ if (rebuildState)
return true;
// Otherwise see if any options need saving
@@ -650,28 +651,27 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
// Propagate "false" to the children
if (!rebuildState)
for (Option option : getOptionCollection())
- if(!option.isExtensionElement())
+ if (!option.isExtensionElement())
option.setRebuildState(false);
}
@Override
public void propertiesChanged() {
- if(isExtensionElement())
+ if (isExtensionElement())
return;
adjustOptions(false);
}
- public void adjustOptions(boolean extensions){
+ public void adjustOptions(boolean extensions) {
IOption options[] = getOptions();
for (IOption opt : options) {
if (opt.isExtensionElement()) {
- Option option = (Option)opt;
- BooleanExpressionApplicabilityCalculator calc =
- option.getBooleanExpressionCalculator(extensions);
+ Option option = (Option) opt;
+ BooleanExpressionApplicabilityCalculator calc = option.getBooleanExpressionCalculator(extensions);
- if(calc != null)
- calc.adjustOption(getParentResourceInfo(),this,option, extensions);
+ if (calc != null)
+ calc.adjustOption(getParentResourceInfo(), this, option, extensions);
}
}
}
@@ -681,8 +681,8 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
IOption options[] = getOptions();
boolean supports = false;
for (IOption opt : options) {
- Option option = (Option)opt;
- if(option.supportsType(type)){
+ Option option = (Option) opt;
+ if (option.supportsType(type)) {
supports = true;
break;
}
@@ -695,12 +695,12 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
}
@Override
- public boolean supportsValue(String type, String value){
+ public boolean supportsValue(String type, String value) {
IOption options[] = getOptions();
boolean supports = false;
for (IOption opt : options) {
- Option option = (Option)opt;
- if(option.supportsValue(type, value)){
+ Option option = (Option) opt;
+ if (option.supportsValue(type, value)) {
supports = true;
break;
}
@@ -708,8 +708,7 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
return supports;
}
- public boolean supportsValue(IBuildPropertyType type,
- IBuildPropertyValue value) {
+ public boolean supportsValue(IBuildPropertyType type, IBuildPropertyValue value) {
return supportsValue(type.getId(), value.getId());
}
@@ -720,24 +719,24 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
@Override
public String[] getRequiredTypeIds() {
List<String> list = new ArrayList<String>();
- for(IOption op : getOptions())
- list.addAll(Arrays.asList(((Option)op).getRequiredTypeIds()));
+ for (IOption op : getOptions())
+ list.addAll(Arrays.asList(((Option) op).getRequiredTypeIds()));
return list.toArray(new String[list.size()]);
}
@Override
public String[] getSupportedTypeIds() {
List<String> list = new ArrayList<String>();
- for(IOption op : getOptions())
- list.addAll(Arrays.asList(((Option)op).getSupportedTypeIds()));
+ for (IOption op : getOptions())
+ list.addAll(Arrays.asList(((Option) op).getSupportedTypeIds()));
return list.toArray(new String[list.size()]);
}
@Override
public String[] getSupportedValueIds(String typeId) {
List<String> list = new ArrayList<String>();
- for(IOption op : getOptions())
- list.addAll(Arrays.asList(((Option)op).getSupportedValueIds(typeId)));
+ for (IOption op : getOptions())
+ list.addAll(Arrays.asList(((Option) op).getSupportedValueIds(typeId)));
return list.toArray(new String[list.size()]);
}
@@ -746,8 +745,8 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
IOption options[] = getOptions();
boolean requires = false;
for (IOption opt : options) {
- Option option = (Option)opt;
- if(option.requiresType(typeId)){
+ Option option = (Option) opt;
+ if (option.requiresType(typeId)) {
requires = true;
break;
}
@@ -755,13 +754,13 @@ public abstract class HoldsOptions extends BuildObject implements IHoldsOptions,
return requires;
}
- boolean hasCustomSettings(){
- if(superClass == null)
+ boolean hasCustomSettings() {
+ if (superClass == null)
return true;
- if(optionMap != null && optionMap.size() != 0){
- for(Option option : getOptionCollection())
- if(option.hasCustomSettings())
+ if (optionMap != null && optionMap.size() != 0) {
+ for (Option option : getOptionCollection())
+ if (option.hasCustomSettings())
return true;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/IMatchKeyProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/IMatchKeyProvider.java
index e6f86e4e644..0e6a72b4da3 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/IMatchKeyProvider.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/IMatchKeyProvider.java
@@ -17,7 +17,7 @@ import java.util.List;
public interface IMatchKeyProvider<T extends BuildObject> extends Comparable<T> {
MatchKey<T> getMatchKey();
-
+
void setIdenticalList(List<T> list);
List<T> getIdenticalList();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/IRealBuildObjectAssociation.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/IRealBuildObjectAssociation.java
index 4d50c7fe9f2..0e243e9e36c 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/IRealBuildObjectAssociation.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/IRealBuildObjectAssociation.java
@@ -24,17 +24,17 @@ public interface IRealBuildObjectAssociation extends IBuildObject {
int OBJECT_CONFIGURATION = 1 << 5;
int getType();
-
+
IRealBuildObjectAssociation getRealBuildObject();
IRealBuildObjectAssociation getExtensionObject();
boolean isRealBuildObject();
-
+
boolean isExtensionBuildObject();
-
+
IRealBuildObjectAssociation[] getIdenticBuildObjects();
-
+
IRealBuildObjectAssociation getSuperClassObject();
String getUniqueRealName();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ISettingsChangeListener.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ISettingsChangeListener.java
index b683b67fec6..973440d7a50 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ISettingsChangeListener.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ISettingsChangeListener.java
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.internal.core;
-
public interface ISettingsChangeListener {
void settingsChanged(SettingsChangeEvent event);
}
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 21984a0b1f2..d03131f5781 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
@@ -132,10 +132,10 @@ public class InputOrder implements IInputOrder {
fOrder = SafeStringInterner.safeIntern(element.getAttribute(IInputOrder.ORDER));
// excluded
- String isEx = element.getAttribute(IInputOrder.EXCLUDED);
- if (isEx != null){
- fExcluded = Boolean.parseBoolean(isEx);
- }
+ String isEx = element.getAttribute(IInputOrder.EXCLUDED);
+ if (isEx != null) {
+ fExcluded = Boolean.parseBoolean(isEx);
+ }
}
/* (non-Javadoc)
@@ -158,7 +158,7 @@ public class InputOrder implements IInputOrder {
// excluded
if (element.getAttribute(IInputOrder.EXCLUDED) != null) {
String isEx = element.getAttribute(IInputOrder.EXCLUDED);
- if (isEx != null){
+ if (isEx != null) {
fExcluded = Boolean.parseBoolean(isEx);
}
}
@@ -213,7 +213,8 @@ public class InputOrder implements IInputOrder {
*/
@Override
public void setPath(String newPath) {
- if (fPath == null && newPath == null) return;
+ if (fPath == null && newPath == null)
+ return;
if (fPath == null || newPath == null || !(fPath.equals(newPath))) {
fPath = newPath;
fIsDirty = true;
@@ -234,7 +235,8 @@ public class InputOrder implements IInputOrder {
*/
@Override
public void setOrder(String newOrder) {
- if (fOrder == null && newOrder == null) return;
+ if (fOrder == null && newOrder == null)
+ return;
if (fOrder == null || newOrder == null || !(fOrder.equals(newOrder))) {
fOrder = newOrder;
fIsDirty = true;
@@ -262,7 +264,6 @@ 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
*/
@@ -280,7 +281,8 @@ public class InputOrder implements IInputOrder {
@Override
public boolean isDirty() {
// This shouldn't be called for an extension InputOrder
- if (fIsExtensionInputOrder) return false;
+ if (fIsExtensionInputOrder)
+ return false;
return fIsDirty;
}
@@ -301,12 +303,12 @@ public class InputOrder implements IInputOrder {
}
}
- public boolean needsRebuild(){
+ public boolean needsRebuild() {
return fRebuildState;
}
- public void setRebuildState(boolean rebuild){
- if(isExtensionElement() && rebuild)
+ 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 76bb4498c9a..895dd6ac90b 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
@@ -95,20 +95,20 @@ public class InputType extends BuildObject implements IInputType {
private boolean resolved = true;
private boolean rebuildState;
-// private class DefaultLanguageInfoCalculator implements ILanguageInfoCalculator {
-//
-// public String getLanguageId(IResourceInfo rcInfo, ITool tool, IInputType type) {
-// if(languageId == null && superClass != null)
-// return ((InputType)superClass).getLanguageInfoCalculator().getLanguageId(rcInfo, tool, type);
-// return languageId;
-// }
-//
-// public String getLanguageName(IResourceInfo rcInfo, ITool tool, IInputType type) {
-// if(languageName == null && superClass != null)
-// return ((InputType)superClass).getLanguageInfoCalculator().getLanguageName(rcInfo, tool, type);
-// return languageName;
-// }
-// }
+ // private class DefaultLanguageInfoCalculator implements ILanguageInfoCalculator {
+ //
+ // public String getLanguageId(IResourceInfo rcInfo, ITool tool, IInputType type) {
+ // if(languageId == null && superClass != null)
+ // return ((InputType)superClass).getLanguageInfoCalculator().getLanguageId(rcInfo, tool, type);
+ // return languageId;
+ // }
+ //
+ // public String getLanguageName(IResourceInfo rcInfo, ITool tool, IInputType type) {
+ // if(languageName == null && superClass != null)
+ // return ((InputType)superClass).getLanguageInfoCalculator().getLanguageName(rcInfo, tool, type);
+ // return languageName;
+ // }
+ // }
/*
* C O N S T R U C T O R S
*/
@@ -131,7 +131,7 @@ public class InputType extends BuildObject implements IInputType {
loadFromManifest(element);
IManagedConfigElement enablements[] = element.getChildren(OptionEnablementExpression.NAME);
- if(enablements.length > 0)
+ if (enablements.length > 0)
booleanExpressionCalculator = new BooleanExpressionApplicabilityCalculator(enablements);
// Hook me up to the Managed Build Manager
@@ -232,7 +232,7 @@ public class InputType extends BuildObject implements IInputType {
if (inputType.sourceContentTypeIds != null) {
sourceContentTypeIds = inputType.sourceContentTypeIds.clone();
}
- if(inputType.sourceContentTypes != null) {
+ if (inputType.sourceContentTypes != null) {
sourceContentTypes = inputType.sourceContentTypes.clone();
}
if (inputType.inputExtensions != null) {
@@ -293,7 +293,7 @@ public class InputType extends BuildObject implements IInputType {
}
}
- if (copyIds){
+ if (copyIds) {
isDirty = inputType.isDirty;
rebuildState = inputType.rebuildState;
} else {
@@ -327,12 +327,12 @@ public class InputType extends BuildObject implements IInputType {
// sourceContentType
List<String> list = new ArrayList<String>();
String ids = element.getAttribute(IInputType.SOURCE_CONTENT_TYPE);
- if (ids != null){
+ if (ids != null) {
StringTokenizer tokenizer = new StringTokenizer(ids, DEFAULT_SEPARATOR);
while (tokenizer.hasMoreElements()) {
list.add(SafeStringInterner.safeIntern(tokenizer.nextToken()));
}
- if(list.size() != 0){
+ if (list.size() != 0) {
sourceContentTypeIds = list.toArray(new String[list.size()]);
list.clear();
}
@@ -354,12 +354,12 @@ public class InputType extends BuildObject implements IInputType {
// headerContentType
ids = element.getAttribute(IInputType.HEADER_CONTENT_TYPE);
- if (ids != null){
+ if (ids != null) {
StringTokenizer tokenizer = new StringTokenizer(ids, DEFAULT_SEPARATOR);
while (tokenizer.hasMoreElements()) {
list.add(SafeStringInterner.safeIntern(tokenizer.nextToken()));
}
- if (list.size() != 0){
+ if (list.size() != 0) {
headerContentTypeIds = list.toArray(new String[list.size()]);
list.clear();
}
@@ -373,7 +373,7 @@ public class InputType extends BuildObject implements IInputType {
list.add(SafeStringInterner.safeIntern(tokenizer.nextToken()));
}
- if (list.size() != 0){
+ if (list.size() != 0) {
headerExtensions = list.toArray(new String[list.size()]);
list.clear();
}
@@ -398,16 +398,16 @@ public class InputType extends BuildObject implements IInputType {
assignToOptionId = SafeStringInterner.safeIntern(element.getAttribute(IInputType.ASSIGN_TO_OPTION));
// multipleOfType
- String isMOT = element.getAttribute(IInputType.MULTIPLE_OF_TYPE);
- if (isMOT != null){
- multipleOfType = Boolean.parseBoolean(isMOT);
- }
+ String isMOT = element.getAttribute(IInputType.MULTIPLE_OF_TYPE);
+ if (isMOT != null) {
+ multipleOfType = Boolean.parseBoolean(isMOT);
+ }
// primaryInput
- String isPI = element.getAttribute(IInputType.PRIMARY_INPUT);
- if (isPI != null){
+ String isPI = element.getAttribute(IInputType.PRIMARY_INPUT);
+ if (isPI != null) {
primaryInput = Boolean.parseBoolean(isPI);
- }
+ }
// buildVariable
buildVariable = SafeStringInterner.safeIntern(element.getAttribute(IInputType.BUILD_VARIABLE));
@@ -415,17 +415,17 @@ public class InputType extends BuildObject implements IInputType {
languageId = SafeStringInterner.safeIntern(element.getAttribute(LANGUAGE_ID));
languageName = SafeStringInterner.safeIntern(element.getAttribute(LANGUAGE_NAME));
if (element.getAttribute(LANGUAGE_INFO_CALCULATOR) != null && element instanceof DefaultManagedConfigElement) {
- languageInfoCalculatorElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
+ languageInfoCalculatorElement = ((DefaultManagedConfigElement) element).getConfigurationElement();
}
-// else {
-// languageInfoCalculator = new DefaultLanguageInfoCalculator();
-// }
+ // else {
+ // languageInfoCalculator = new DefaultLanguageInfoCalculator();
+ // }
buildInfoDicsoveryProfileId = SafeStringInterner.safeIntern(element.getAttribute(SCANNER_CONFIG_PROFILE_ID));
// Store the configuration element IFF there is a dependency generator defined
String depGenerator = element.getAttribute(ITool.DEP_CALC_ID);
if (depGenerator != null && element instanceof DefaultManagedConfigElement) {
- dependencyGeneratorElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
+ dependencyGeneratorElement = ((DefaultManagedConfigElement) element).getConfigurationElement();
}
}
@@ -465,27 +465,27 @@ public class InputType extends BuildObject implements IInputType {
list.add(SafeStringInterner.safeIntern(tokenizer.nextToken()));
}
- if (list.size() != 0){
+ if (list.size() != 0) {
sourceContentTypeIds = list.toArray(new String[list.size()]);
list.clear();
}
- if(sourceContentTypeIds != null){
+ if (sourceContentTypeIds != null) {
List<IContentType> types = new ArrayList<IContentType>();
for (String sourceContentTypeId : sourceContentTypeIds) {
IContentType type = manager.getContentType(sourceContentTypeId);
- if(type != null)
+ if (type != null)
types.add(type);
}
- if (types.size() != 0){
+ if (types.size() != 0) {
sourceContentTypes = types.toArray(new IContentType[types.size()]);
}
}
}
}
- // sources
+ // sources
if (element.getAttribute(IInputType.SOURCES) != null) {
String inputs = element.getAttribute(ITool.SOURCES);
if (inputs != null) {
@@ -494,7 +494,7 @@ public class InputType extends BuildObject implements IInputType {
list.add(SafeStringInterner.safeIntern(tokenizer.nextToken()));
}
- if (list.size() != 0){
+ if (list.size() != 0) {
inputExtensions = list.toArray(new String[list.size()]);
list.clear();
}
@@ -510,27 +510,27 @@ public class InputType extends BuildObject implements IInputType {
list.add(SafeStringInterner.safeIntern(tokenizer.nextToken()));
}
- if (list.size() != 0){
+ if (list.size() != 0) {
headerContentTypeIds = list.toArray(new String[list.size()]);
list.clear();
}
- if (headerContentTypeIds != null){
+ if (headerContentTypeIds != null) {
List<IContentType> types = new ArrayList<>();
for (String headerContentTypeId : headerContentTypeIds) {
IContentType type = manager.getContentType(headerContentTypeId);
- if(type != null)
+ if (type != null)
types.add(type);
}
- if (types.size() != 0){
+ if (types.size() != 0) {
headerContentTypes = types.toArray(new IContentType[types.size()]);
}
}
}
}
- // headers
+ // headers
if (element.getAttribute(IInputType.HEADERS) != null) {
String inputs = element.getAttribute(HEADERS);
if (inputs != null) {
@@ -539,7 +539,7 @@ public class InputType extends BuildObject implements IInputType {
list.add(SafeStringInterner.safeIntern(tokenizer.nextToken()));
}
- if (list.size() != 0){
+ if (list.size() != 0) {
headerExtensions = list.toArray(new String[list.size()]);
list.clear();
}
@@ -579,17 +579,17 @@ public class InputType extends BuildObject implements IInputType {
// multipleOfType
if (element.getAttribute(IInputType.MULTIPLE_OF_TYPE) != null) {
String isMOT = element.getAttribute(IInputType.MULTIPLE_OF_TYPE);
- if (isMOT != null){
+ if (isMOT != null) {
multipleOfType = Boolean.parseBoolean(isMOT);
}
}
// primaryInput
if (element.getAttribute(IInputType.PRIMARY_INPUT) != null) {
- String isPI = element.getAttribute(IInputType.PRIMARY_INPUT);
- if (isPI != null){
+ String isPI = element.getAttribute(IInputType.PRIMARY_INPUT);
+ if (isPI != null) {
primaryInput = Boolean.parseBoolean(isPI);
- }
+ }
}
// buildVariable
@@ -610,7 +610,7 @@ public class InputType extends BuildObject implements IInputType {
return true;
}
- private String composeString(String array[], String separator){
+ private String composeString(String array[], String separator) {
if (array == null)
return null;
if (array.length == 0)
@@ -618,7 +618,7 @@ public class InputType extends BuildObject implements IInputType {
StringBuilder buf = new StringBuilder();
buf.append(array[0]);
- for (int i = 1; i < array.length; i++){
+ for (int i = 1; i < array.length; i++) {
buf.append(separator).append(array[i]);
}
@@ -669,9 +669,9 @@ public class InputType extends BuildObject implements IInputType {
// dependency (header file) extensions
if (getDependencyExtensionsList().size() > 0) {
- String headers=""; //$NON-NLS-1$
+ String headers = ""; //$NON-NLS-1$
for (String header : getDependencyExtensionsList()) {
- if (headers.length()>0)
+ if (headers.length() > 0)
headers += DEFAULT_SEPARATOR;
headers += header;
}
@@ -805,7 +805,7 @@ public class InputType extends BuildObject implements IInputType {
}
IAdditionalInput createAdditionalInput(IAdditionalInput base) {
- AdditionalInput newAdditionalInput = new AdditionalInput(this, (AdditionalInput)base);
+ AdditionalInput newAdditionalInput = new AdditionalInput(this, (AdditionalInput) base);
getAdditionalInputList().add(newAdditionalInput);
setDirty(true);
return newAdditionalInput;
@@ -851,7 +851,8 @@ public class InputType extends BuildObject implements IInputType {
@Override
public void removeAdditionalInput(String path) {
IAdditionalInput input = getAdditionalInput(path);
- if (input != null) removeAdditionalInput(input);
+ if (input != null)
+ removeAdditionalInput(input);
}
/* (non-Javadoc)
@@ -871,8 +872,8 @@ public class InputType extends BuildObject implements IInputType {
List<IPath> deps = new ArrayList<IPath>();
for (AdditionalInput additionalInput : getAdditionalInputList()) {
int kind = additionalInput.getKind();
- if (kind == IAdditionalInput.KIND_ADDITIONAL_DEPENDENCY ||
- kind == IAdditionalInput.KIND_ADDITIONAL_INPUT_DEPENDENCY) {
+ if (kind == IAdditionalInput.KIND_ADDITIONAL_DEPENDENCY
+ || kind == IAdditionalInput.KIND_ADDITIONAL_INPUT_DEPENDENCY) {
String[] paths = additionalInput.getPaths();
if (paths != null) {
for (String path : paths) {
@@ -894,8 +895,8 @@ public class InputType extends BuildObject implements IInputType {
List<IPath> ins = new ArrayList<IPath>();
for (AdditionalInput additionalInput : getAdditionalInputList()) {
int kind = additionalInput.getKind();
- if (kind == IAdditionalInput.KIND_ADDITIONAL_INPUT ||
- kind == IAdditionalInput.KIND_ADDITIONAL_INPUT_DEPENDENCY) {
+ if (kind == IAdditionalInput.KIND_ADDITIONAL_INPUT
+ || kind == IAdditionalInput.KIND_ADDITIONAL_INPUT_DEPENDENCY) {
String[] paths = additionalInput.getPaths();
if (paths != null) {
for (String path : paths) {
@@ -929,7 +930,6 @@ public class InputType extends BuildObject implements IInputType {
return additionalInputList;
}
-
/*
* M O D E L A T T R I B U T E A C C E S S O R S
*/
@@ -971,7 +971,8 @@ public class InputType extends BuildObject implements IInputType {
*/
@Override
public void setBuildVariable(String variableName) {
- if (variableName == null && buildVariable == null) return;
+ if (variableName == null && buildVariable == null)
+ return;
if (buildVariable == null || variableName == null || !(variableName.equals(buildVariable))) {
buildVariable = variableName;
setDirty(true);
@@ -1053,25 +1054,25 @@ public class InputType extends BuildObject implements IInputType {
// Use content type if specified and registered with Eclipse
IContentType type = getDependencyContentType();
if (type != null) {
- String[] exts = ((Tool)tool).getContentTypeFileSpecs(type);
+ String[] exts = ((Tool) tool).getContentTypeFileSpecs(type);
// TODO: This is a temporary hack until we decide how to specify the langauge (C vs. C++)
// of a .h file. If the content type is the CDT-defined C/C++ content type, then
// add "h" to the list if it is not already there.
- if (type.getId().compareTo("org.eclipse.cdt.core.cxxHeader") == 0) { //$NON-NLS-1$
+ if (type.getId().compareTo("org.eclipse.cdt.core.cxxHeader") == 0) { //$NON-NLS-1$
boolean h_found = false;
for (String ext : exts) {
- if (ext.compareTo("h") == 0) { //$NON-NLS-1$
+ if (ext.compareTo("h") == 0) { //$NON-NLS-1$
h_found = true;
break;
}
}
if (!h_found) {
- String[] cppexts = new String[exts.length+1];
+ String[] cppexts = new String[exts.length + 1];
int i = 0;
- for (; i<exts.length; i++) {
+ for (; i < exts.length; i++) {
cppexts[i] = exts[i];
}
- cppexts[i] = "h"; //$NON-NLS-1$
+ cppexts[i] = "h"; //$NON-NLS-1$
return cppexts;
}
}
@@ -1087,7 +1088,8 @@ public class InputType extends BuildObject implements IInputType {
public boolean isDependencyExtension(ITool tool, String ext) {
String[] exts = getDependencyExtensions(tool);
for (String depExt : exts) {
- if (ext.equals(depExt)) return true;
+ if (ext.equals(depExt))
+ return true;
}
return false;
}
@@ -1111,10 +1113,12 @@ public class InputType extends BuildObject implements IInputType {
if (element != null) {
try {
if (element.getAttribute(ITool.DEP_CALC_ID) != null) {
- dependencyGenerator = (IManagedDependencyGeneratorType) element.createExecutableExtension(ITool.DEP_CALC_ID);
+ dependencyGenerator = (IManagedDependencyGeneratorType) element
+ .createExecutableExtension(ITool.DEP_CALC_ID);
return dependencyGenerator;
}
- } catch (CoreException e) {}
+ } catch (CoreException e) {
+ }
}
return null;
}
@@ -1125,7 +1129,7 @@ public class InputType extends BuildObject implements IInputType {
public IConfigurationElement getDependencyGeneratorElement() {
if (dependencyGeneratorElement == null) {
if (superClass != null) {
- return ((InputType)superClass).getDependencyGeneratorElement();
+ return ((InputType) superClass).getDependencyGeneratorElement();
}
}
return dependencyGeneratorElement;
@@ -1149,7 +1153,7 @@ public class InputType extends BuildObject implements IInputType {
if (superClass != null) {
return superClass.getMultipleOfType();
} else {
- return false; // default is false
+ return false; // default is false
}
}
return multipleOfType.booleanValue();
@@ -1176,7 +1180,7 @@ public class InputType extends BuildObject implements IInputType {
if (superClass != null) {
return superClass.getPrimaryInput();
} else {
- return false; // default is false
+ return false; // default is false
}
}
return primaryInput.booleanValue();
@@ -1214,7 +1218,8 @@ public class InputType extends BuildObject implements IInputType {
*/
@Override
public void setOptionId(String id) {
- if (id == null && optionId == null) return;
+ if (id == null && optionId == null)
+ return;
if (id == null || optionId == null || !(optionId.equals(id))) {
optionId = id;
setDirty(true);
@@ -1242,7 +1247,8 @@ public class InputType extends BuildObject implements IInputType {
*/
@Override
public void setAssignToOptionId(String id) {
- if (id == null && assignToOptionId == null) return;
+ if (id == null && assignToOptionId == null)
+ return;
if (id == null || assignToOptionId == null || !(assignToOptionId.equals(id))) {
assignToOptionId = id;
setDirty(true);
@@ -1257,7 +1263,7 @@ public class InputType extends BuildObject implements IInputType {
public IContentType getSourceContentType() {
IContentType[] types = getSourceContentTypes();
- if(types != null && types.length != 0) {
+ if (types != null && types.length != 0) {
return types[0];
}
return null;
@@ -1299,8 +1305,6 @@ public class InputType extends BuildObject implements IInputType {
return headerExtensions.clone();
}
-
-
@Override
public String[] getHeaderContentTypeIds() {
if (headerContentTypeIds == null) {
@@ -1327,9 +1331,8 @@ public class InputType extends BuildObject implements IInputType {
@Override
public void setHeaderContentTypeIds(String[] ids) {
- if(!Arrays.equals(headerContentTypeIds, ids)){
- headerContentTypeIds = ids != null ?
- (String[])ids.clone() : null;
+ if (!Arrays.equals(headerContentTypeIds, ids)) {
+ headerContentTypeIds = ids != null ? (String[]) ids.clone() : null;
setDirty(true);
setRebuildState(true);
@@ -1338,9 +1341,8 @@ public class InputType extends BuildObject implements IInputType {
@Override
public void setHeaderExtensionsAttribute(String[] extensions) {
- if(!Arrays.equals(headerExtensions, extensions)){
- headerExtensions = extensions != null ?
- (String[])extensions.clone() : null;
+ if (!Arrays.equals(headerExtensions, extensions)) {
+ headerExtensions = extensions != null ? (String[]) extensions.clone() : null;
setDirty(true);
setRebuildState(true);
@@ -1349,9 +1351,8 @@ public class InputType extends BuildObject implements IInputType {
@Override
public void setSourceContentTypeIds(String[] ids) {
- if(!Arrays.equals(sourceContentTypeIds, ids)){
- sourceContentTypeIds = ids != null ?
- (String[])ids.clone() : null;
+ if (!Arrays.equals(sourceContentTypeIds, ids)) {
+ sourceContentTypeIds = ids != null ? (String[]) ids.clone() : null;
setDirty(true);
setRebuildState(true);
@@ -1360,9 +1361,8 @@ public class InputType extends BuildObject implements IInputType {
@Override
public void setSourceExtensionsAttribute(String[] extensions) {
- if(!Arrays.equals(inputExtensions, extensions)){
- inputExtensions = extensions != null ?
- (String[])extensions.clone() : null;
+ if (!Arrays.equals(inputExtensions, extensions)) {
+ inputExtensions = extensions != null ? (String[]) extensions.clone() : null;
setDirty(true);
setRebuildState(true);
@@ -1374,17 +1374,15 @@ public class InputType extends BuildObject implements IInputType {
*/
@Override
public void setSourceContentType(IContentType type) {
- if(type == null){
- if(sourceContentTypes != null){
+ if (type == null) {
+ if (sourceContentTypes != null) {
sourceContentTypes = null;
sourceContentTypeIds = null;
setDirty(true);
setRebuildState(true);
}
} else {
- if(sourceContentTypes == null
- || sourceContentTypes.length != 1
- || sourceContentTypes[0] != type){
+ if (sourceContentTypes == null || sourceContentTypes.length != 1 || sourceContentTypes[0] != type) {
sourceContentTypes = new IContentType[1];
sourceContentTypes[0] = type;
sourceContentTypeIds = new String[1];
@@ -1392,13 +1390,13 @@ public class InputType extends BuildObject implements IInputType {
setDirty(true);
setRebuildState(true);
}
- return;
+ return;
}
}
public void setSourceContentTypes(IContentType types[]) {
- if(types == null){
- if(sourceContentTypes != null){
+ if (types == null) {
+ if (sourceContentTypes != null) {
sourceContentTypes = null;
sourceContentTypeIds = null;
setDirty(true);
@@ -1407,7 +1405,7 @@ public class InputType extends BuildObject implements IInputType {
} else {
sourceContentTypes = types.clone();
sourceContentTypeIds = new String[types.length];
- for(int i = 0; i < types.length; i++){
+ for (int i = 0; i < types.length; i++) {
sourceContentTypeIds[i] = types[i].getId();
}
setDirty(true);
@@ -1415,13 +1413,12 @@ 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 (inputExtensions == null) {
// If I have a superClass, ask it
if (superClass != null) {
return superClass.getSourceExtensionsAttribute();
@@ -1437,8 +1434,8 @@ public class InputType extends BuildObject implements IInputType {
*/
@Override
public void setSourceExtensionsAttribute(String extensions) {
- if(extensions == null){
- if(inputExtensions != null){
+ if (extensions == null) {
+ if (inputExtensions != null) {
inputExtensions = null;
setDirty(true);
setRebuildState(true);
@@ -1451,7 +1448,7 @@ public class InputType extends BuildObject implements IInputType {
}
String[] newExts = list.toArray(new String[list.size()]);
- if(!Arrays.equals(newExts, inputExtensions)){
+ if (!Arrays.equals(newExts, inputExtensions)) {
inputExtensions = newExts;
setDirty(true);
setRebuildState(true);
@@ -1464,19 +1461,19 @@ public class InputType extends BuildObject implements IInputType {
*/
@Override
public String[] getSourceExtensions(ITool tool) {
- return getSourceExtensions(tool, ((Tool)tool).getProject());
-// // Use content type if specified and registered with Eclipse
-// IContentType types[] = getSourceContentTypes();
-// if (types.length != 0) {
-// IContentType type;
-// List list = new ArrayList();
-// for(int i = 0; i < types.length; i++){
-// type = types[i];
-// list.addAll(Arrays.asList(((Tool)tool).getContentTypeFileSpecs(type)));
-// }
-// return (String[])list.toArray(new String[list.size()]);
-// }
-// return getSourceExtensionsAttribute();
+ return getSourceExtensions(tool, ((Tool) tool).getProject());
+ // // Use content type if specified and registered with Eclipse
+ // IContentType types[] = getSourceContentTypes();
+ // if (types.length != 0) {
+ // IContentType type;
+ // List list = new ArrayList();
+ // for(int i = 0; i < types.length; i++){
+ // type = types[i];
+ // list.addAll(Arrays.asList(((Tool)tool).getContentTypeFileSpecs(type)));
+ // }
+ // return (String[])list.toArray(new String[list.size()]);
+ // }
+ // return getSourceExtensionsAttribute();
}
public String[] getSourceExtensions(ITool tool, IProject project) {
@@ -1485,21 +1482,20 @@ public class InputType extends BuildObject implements IInputType {
if (types.length != 0) {
List<String> list = new ArrayList<String>();
for (IContentType type : types) {
- list.addAll(Arrays.asList(((Tool)tool).getContentTypeFileSpecs(type, project)));
+ list.addAll(Arrays.asList(((Tool) tool).getContentTypeFileSpecs(type, project)));
}
return list.toArray(new String[list.size()]);
}
return getSourceExtensionsAttribute();
}
-
@Override
public String[] getHeaderExtensions(ITool tool) {
IContentType types[] = getHeaderContentTypes();
if (types.length != 0) {
List<String> list = new ArrayList<String>();
for (IContentType type : types) {
- list.addAll(Arrays.asList(((Tool)tool).getContentTypeFileSpecs(type)));
+ list.addAll(Arrays.asList(((Tool) tool).getContentTypeFileSpecs(type)));
}
return list.toArray(new String[list.size()]);
}
@@ -1511,13 +1507,14 @@ public class InputType extends BuildObject implements IInputType {
*/
@Override
public boolean isSourceExtension(ITool tool, String ext) {
- return isSourceExtension(tool, ext, ((Tool)tool).getProject());
+ return isSourceExtension(tool, ext, ((Tool) tool).getProject());
}
public boolean isSourceExtension(ITool tool, String ext, IProject project) {
String[] exts = getSourceExtensions(tool, project);
for (String srcExt : exts) {
- if (ext.equals(srcExt)) return true;
+ if (ext.equals(srcExt))
+ return true;
}
return false;
}
@@ -1540,14 +1537,17 @@ public class InputType extends BuildObject implements IInputType {
@Override
public boolean isDirty() {
// This shouldn't be called for an extension InputType
- if (isExtensionInputType) return false;
+ if (isExtensionInputType)
+ return false;
// Check my children
for (InputOrder inputOrder : getInputOrderList()) {
- if (inputOrder.isDirty()) return true;
+ if (inputOrder.isDirty())
+ return true;
}
for (AdditionalInput additionalInput : getAdditionalInputList()) {
- if (additionalInput.isDirty()) return true;
+ if (additionalInput.isDirty())
+ return true;
}
return isDirty;
@@ -1581,10 +1581,8 @@ public class InputType extends BuildObject implements IInputType {
superClass = ManagedBuildManager.getExtensionInputType(superClassId);
if (superClass == null) {
// Report error
- ManagedBuildManager.outputResolveError(
- "superClass", //$NON-NLS-1$
- superClassId,
- "inputType", //$NON-NLS-1$
+ ManagedBuildManager.outputResolveError("superClass", //$NON-NLS-1$
+ superClassId, "inputType", //$NON-NLS-1$
getId());
}
}
@@ -1595,10 +1593,10 @@ public class InputType extends BuildObject implements IInputType {
if (sourceContentTypeIds != null) {
for (String sourceContentTypeId : sourceContentTypeIds) {
IContentType type = manager.getContentType(sourceContentTypeId);
- if(type != null)
+ if (type != null)
list.add(type);
}
- if(list.size() != 0){
+ if (list.size() != 0) {
sourceContentTypes = list.toArray(new IContentType[list.size()]);
list.clear();
} else {
@@ -1609,10 +1607,10 @@ public class InputType extends BuildObject implements IInputType {
if (headerContentTypeIds != null) {
for (String headerContentTypeId : headerContentTypeIds) {
IContentType type = manager.getContentType(headerContentTypeId);
- if(type != null)
+ if (type != null)
list.add(type);
}
- if(list.size() != 0){
+ if (list.size() != 0) {
headerContentTypes = list.toArray(new IContentType[list.size()]);
list.clear();
} else {
@@ -1639,8 +1637,8 @@ public class InputType extends BuildObject implements IInputType {
*/
@Override
public String getManagedBuildRevision() {
- if ( managedBuildRevision == null) {
- if ( getParent() != null) {
+ if (managedBuildRevision == null) {
+ if (getParent() != null) {
return getParent().getManagedBuildRevision();
}
}
@@ -1652,8 +1650,8 @@ public class InputType extends BuildObject implements IInputType {
*/
@Override
public Version getVersion() {
- if ( version == null) {
- if ( getParent() != null) {
+ if (version == null) {
+ if (getParent() != null) {
return getParent().getVersion();
}
}
@@ -1665,22 +1663,24 @@ public class InputType extends BuildObject implements IInputType {
// Do nothing
}
- public boolean needsRebuild(){
- if(rebuildState)
+ public boolean needsRebuild() {
+ if (rebuildState)
return true;
for (InputOrder inputOrder : getInputOrderList()) {
- if (inputOrder.needsRebuild()) return true;
+ if (inputOrder.needsRebuild())
+ return true;
}
for (AdditionalInput additionalInput : getAdditionalInputList()) {
- if (additionalInput.needsRebuild()) return true;
+ if (additionalInput.needsRebuild())
+ return true;
}
return rebuildState;
}
- public void setRebuildState(boolean rebuild){
- if(isExtensionElement() && rebuild)
+ public void setRebuildState(boolean rebuild) {
+ if (isExtensionElement() && rebuild)
return;
rebuildState = rebuild;
@@ -1698,44 +1698,44 @@ public class InputType extends BuildObject implements IInputType {
public IResourceInfo getRcInfo(ITool tool) {
IBuildObject parent = tool.getParent();
- if(parent instanceof IFileInfo)
- return (IFileInfo)parent;
- else if(parent instanceof IToolChain)
- return ((IToolChain)parent).getParentFolderInfo();
+ if (parent instanceof IFileInfo)
+ return (IFileInfo) parent;
+ else if (parent instanceof IToolChain)
+ return ((IToolChain) parent).getParentFolderInfo();
return null;
}
- private ILanguageInfoCalculator getLanguageInfoCalculator(){
- if(languageInfoCalculator == null){
- if(languageInfoCalculatorElement != null){
+ private ILanguageInfoCalculator getLanguageInfoCalculator() {
+ if (languageInfoCalculator == null) {
+ if (languageInfoCalculatorElement != null) {
try {
Object ex = languageInfoCalculatorElement.createExecutableExtension(LANGUAGE_INFO_CALCULATOR);
- if(ex instanceof ILanguageInfoCalculator)
- languageInfoCalculator = (ILanguageInfoCalculator)ex;
+ if (ex instanceof ILanguageInfoCalculator)
+ languageInfoCalculator = (ILanguageInfoCalculator) ex;
} catch (CoreException e) {
}
}
-// if(languageInfoCalculator == null)
-// languageInfoCalculator = new DefaultLanguageInfoCalculator();
+ // if(languageInfoCalculator == null)
+ // languageInfoCalculator = new DefaultLanguageInfoCalculator();
}
return languageInfoCalculator;
}
- public String getLanguageIdAttribute(){
- if(languageId == null){
- if(superClass != null){
- return ((InputType)superClass).getLanguageIdAttribute();
+ public String getLanguageIdAttribute() {
+ if (languageId == null) {
+ if (superClass != null) {
+ return ((InputType) superClass).getLanguageIdAttribute();
}
return null;
}
return languageId;
}
- public String getLanguageNameAttribute(){
- if(languageName == null){
- if(superClass != null){
- return ((InputType)superClass).getLanguageNameAttribute();
+ public String getLanguageNameAttribute() {
+ if (languageName == null) {
+ if (superClass != null) {
+ return ((InputType) superClass).getLanguageNameAttribute();
}
return null;
}
@@ -1743,24 +1743,24 @@ public class InputType extends BuildObject implements IInputType {
}
@Override
- public String getLanguageId(ITool tool){
+ public String getLanguageId(ITool tool) {
IResourceInfo rcInfo = getRcInfo(tool);
String langId = this.languageId;
- if(langId == null || isExtensionInputType){
+ if (langId == null || isExtensionInputType) {
ILanguageInfoCalculator calc = getLanguageInfoCalculator();
- if(calc != null)
+ if (calc != null)
langId = calc.getLanguageId(rcInfo, tool, this);
}
- if(langId == null){
+ if (langId == null) {
langId = getLanguageIdAttribute();
}
- if(langId == null){
+ if (langId == null) {
IContentType contentType = getSourceContentType();
- if (contentType!=null) {
+ if (contentType != null) {
ILanguage language = LanguageManager.getInstance().getLanguage(contentType);
- if (language!=null)
+ if (language != null)
langId = language.getId();
}
}
@@ -1769,32 +1769,32 @@ public class InputType extends BuildObject implements IInputType {
}
@Override
- public String getLanguageName(ITool tool){
+ public String getLanguageName(ITool tool) {
IResourceInfo rcInfo = getRcInfo(tool);
String langName = this.languageName;
- if(langName == null || isExtensionInputType){
+ if (langName == null || isExtensionInputType) {
ILanguageInfoCalculator calc = getLanguageInfoCalculator();
- if(calc != null)
+ if (calc != null)
langName = calc.getLanguageName(rcInfo, tool, this);
}
- if(langName == null){
+ if (langName == null) {
langName = getLanguageNameAttribute();
- if(langName == null){
+ if (langName == null) {
IContentType types[] = getSourceContentTypes();
for (IContentType type : types) {
String name = type.getName();
- if(name != null && name.length() != 0){
+ if (name != null && name.length() != 0) {
langName = name;
break;
}
}
- if(langName == null){
+ if (langName == null) {
types = getHeaderContentTypes();
for (IContentType type : types) {
String name = type.getName();
- if(name != null && name.length() != 0){
+ if (name != null && name.length() != 0) {
langName = name;
break;
}
@@ -1803,22 +1803,22 @@ public class InputType extends BuildObject implements IInputType {
}
}
- if(langName == null){
+ if (langName == null) {
String[] exts = getSourceExtensions(tool);
- if(exts.length != 0){
+ if (exts.length != 0) {
langName = CDataUtil.arrayToString(exts, ","); //$NON-NLS-1$
} else {
exts = getHeaderExtensions(tool);
- if(exts.length != 0)
+ if (exts.length != 0)
langName = CDataUtil.arrayToString(exts, ","); //$NON-NLS-1$
}
}
- if(langName == null){
+ if (langName == null) {
langName = getName();
- if(langName == null){
+ if (langName == null) {
langName = tool.getName();
- if(langName == null){
+ if (langName == null) {
langName = getId();
}
}
@@ -1830,12 +1830,12 @@ public class InputType extends BuildObject implements IInputType {
@Override
public String getDiscoveryProfileId(ITool tool) {
String id = getDiscoveryProfileIdAttribute();
- if(id == null){
- id = ((Tool)tool).getDiscoveryProfileId();
+ if (id == null) {
+ id = ((Tool) tool).getDiscoveryProfileId();
}
// if there is more than one ('|'-separated), return the first one
// TODO: expand interface with String[] getDiscoveryProfileIds(ITool tool)
- if(null != id) {
+ if (null != id) {
int nPos = id.indexOf('|');
if (nPos > 0)
id = id.substring(0, nPos);
@@ -1851,13 +1851,15 @@ public class InputType extends BuildObject implements IInputType {
ITool tool = getParent();
if (tool != null) {
IBuildObject toolchain = tool.getParent();
- if (toolchain instanceof IToolChain && ((IToolChain) toolchain).getDefaultLanguageSettingsProviderIds() != null) {
+ if (toolchain instanceof IToolChain
+ && ((IToolChain) toolchain).getDefaultLanguageSettingsProviderIds() != null) {
IConfiguration cfg = ((IToolChain) toolchain).getParent();
if (cfg != null && cfg.getDefaultLanguageSettingsProviderIds() != null) {
IResource rc = cfg.getOwner();
if (rc != null) {
IProject project = rc.getProject();
- useLegacy = !ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityEnabled(project);
+ useLegacy = !ScannerDiscoveryLegacySupport
+ .isLanguageSettingsProvidersFunctionalityEnabled(project);
}
}
}
@@ -1874,7 +1876,7 @@ public class InputType extends BuildObject implements IInputType {
if (profileId == null) {
profileId = ScannerDiscoveryLegacySupport.getDeprecatedLegacyProfiles(id);
if (profileId == null && superClass instanceof InputType) {
- profileId = ((InputType)superClass).getLegacyDiscoveryProfileIdAttribute();
+ profileId = ((InputType) superClass).getLegacyDiscoveryProfileIdAttribute();
}
}
return profileId;
@@ -1894,7 +1896,7 @@ public class InputType extends BuildObject implements IInputType {
*/
private String getDiscoveryProfileIdAttributeInternal() {
if (buildInfoDicsoveryProfileId == null && superClass instanceof InputType) {
- return ((InputType)superClass).getDiscoveryProfileIdAttributeInternal();
+ return ((InputType) superClass).getDiscoveryProfileIdAttributeInternal();
}
return buildInfoDicsoveryProfileId;
}
@@ -1909,38 +1911,38 @@ public class InputType extends BuildObject implements IInputType {
languageName = name;
}
- public BooleanExpressionApplicabilityCalculator getBooleanExpressionCalculator(){
- if(booleanExpressionCalculator == null){
- if(superClass != null){
- return ((InputType)superClass).getBooleanExpressionCalculator();
+ public BooleanExpressionApplicabilityCalculator getBooleanExpressionCalculator() {
+ if (booleanExpressionCalculator == null) {
+ if (superClass != null) {
+ return ((InputType) superClass).getBooleanExpressionCalculator();
}
}
return booleanExpressionCalculator;
}
public boolean isEnabled(ITool tool) {
- if(tool.isExtensionElement())
+ if (tool.isExtensionElement())
return true;
BooleanExpressionApplicabilityCalculator calc = getBooleanExpressionCalculator();
- if(calc == null)
+ if (calc == null)
return true;
return calc.isInputTypeEnabled(tool, this);
}
- public boolean hasScannerConfigSettings(){
+ public boolean hasScannerConfigSettings() {
- if(getDiscoveryProfileIdAttribute() != null)
+ if (getDiscoveryProfileIdAttribute() != null)
return true;
- if (superClass!=null && superClass instanceof InputType)
- return ((InputType)superClass).hasScannerConfigSettings();
+ if (superClass != null && superClass instanceof InputType)
+ return ((InputType) superClass).hasScannerConfigSettings();
return false;
}
- public boolean hasCustomSettings(){
+ public boolean hasCustomSettings() {
//TODO:
return false;
}
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 b561b5fe6c2..e61e8349825 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
@@ -72,8 +72,9 @@ import org.w3c.dom.Element;
*/
public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
// The path container used for all managed projects
- public static final IContainerEntry containerEntry = CoreModel.newContainerEntry(new Path("org.eclipse.cdt.managedbuilder.MANAGED_CONTAINER")); //$NON-NLS-1$
-// private static final QualifiedName defaultConfigProperty = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), DEFAULT_CONFIGURATION);
+ public static final IContainerEntry containerEntry = CoreModel
+ .newContainerEntry(new Path("org.eclipse.cdt.managedbuilder.MANAGED_CONTAINER")); //$NON-NLS-1$
+ // private static final QualifiedName defaultConfigProperty = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), DEFAULT_CONFIGURATION);
//private static final QualifiedName defaultTargetProperty = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), DEFAULT_TARGET);
private volatile IManagedProject managedProject;
@@ -93,7 +94,6 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
private volatile boolean isReadOnly = false;
private volatile boolean bIsContainerInited = false;
-
/**
* Basic constructor used when the project is brand new.
*/
@@ -110,14 +110,15 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
* 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) {
+ 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?
for (int projIndex = projNodes.length - 1; projIndex >= 0; --projIndex) {
- if(IManagedProject.MANAGED_PROJECT_ELEMENT_NAME.equals(projNodes[projIndex].getName())){
+ if (IManagedProject.MANAGED_PROJECT_ELEMENT_NAME.equals(projNodes[projIndex].getName())) {
ManagedProject proj = new ManagedProject(this, projNodes[projIndex], loadConfigs, managedBuildRevision);
if (!proj.resolveReferences())
proj.setValid(false);
@@ -231,34 +232,34 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
@Override
public IConfiguration getDefaultConfiguration() {
// Get the default config associated with the project
-/* if (defaultConfig == null) {
- if (managedProject != null) {
- if (defaultConfigId != null) {
- defaultConfig = managedProject.getConfiguration(defaultConfigId);
- }
- if (defaultConfig == null) {
- IConfiguration[] configs = managedProject.getConfigurations();
- for (int i = 0; i < configs.length; i++){
- if (configs[i].isSupported()){
- defaultConfig = configs[i];
- defaultConfigId = defaultConfig.getId();
- break;
+ /* if (defaultConfig == null) {
+ if (managedProject != null) {
+ if (defaultConfigId != null) {
+ defaultConfig = managedProject.getConfiguration(defaultConfigId);
+ }
+ if (defaultConfig == null) {
+ IConfiguration[] configs = managedProject.getConfigurations();
+ for (int i = 0; i < configs.length; i++){
+ if (configs[i].isSupported()){
+ defaultConfig = configs[i];
+ defaultConfigId = defaultConfig.getId();
+ break;
+ }
+ }
+ if (defaultConfig == null && configs.length > 0) {
+ defaultConfig = configs[0];
+ defaultConfigId = defaultConfig.getId();
+ }
}
- }
- if (defaultConfig == null && configs.length > 0) {
- defaultConfig = configs[0];
- defaultConfigId = defaultConfig.getId();
}
}
- }
- }
- return defaultConfig;
-*/
+ return defaultConfig;
+ */
IConfiguration activeCfg = findExistingDefaultConfiguration(null);
- if(activeCfg == null){
+ if (activeCfg == null) {
IConfiguration cfgs[] = managedProject.getConfigurations();
- if(cfgs.length != 0)
+ if (cfgs.length != 0)
activeCfg = cfgs[0];
}
@@ -267,10 +268,10 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
}
private IConfiguration findExistingDefaultConfiguration(ICProjectDescription des) {
- if(des == null)
+ if (des == null)
des = CoreModel.getDefault().getProjectDescription(getOwner().getProject(), false);
IConfiguration activeCfg = null;
- if(des != null){
+ if (des != null) {
ICConfigurationDescription cfgDes = des.getActiveConfiguration();
activeCfg = managedProject.getConfiguration(cfgDes.getId());
}
@@ -298,7 +299,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
if (getDefaultConfiguration() != null) {
ITool[] tools = getDefaultConfiguration().getFilteredTools();
for (int index = 0; index < tools.length; ++index) {
- if(tools[index].buildsFileType(sourceExtension)) {
+ if (tools[index].buildsFileType(sourceExtension)) {
return tools[index].getDependencyGeneratorForExtension(sourceExtension);
}
}
@@ -327,21 +328,21 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
*/
@Override
public String getFlagsForSource(String extension) {
- return getToolFlagsForSource(extension,null,null);
+ 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){
+ public String getToolFlagsForSource(String extension, IPath inputLocation, IPath outputLocation) {
// Get all the tools for the current config
ITool[] tools = getFilteredTools();
for (int index = 0; index < tools.length; index++) {
ITool tool = tools[index];
if (tool != null && tool.buildsFileType(extension)) {
try {
- return tool.getToolCommandFlagsString(inputLocation,outputLocation);
+ return tool.getToolCommandFlagsString(inputLocation, outputLocation);
} catch (BuildException e) {
return null;
}
@@ -362,7 +363,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
* @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){
+ public String getToolFlagsForConfiguration(String extension, IPath inputLocation, IPath outputLocation) {
// Treat null extensions as an empty string
String ext = extension == null ? "" : extension; //$NON-NLS-1$
@@ -372,7 +373,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
ITool tool = tools[index];
if (tool.producesFileType(ext)) {
try {
- return tool.getToolCommandFlagsString(inputLocation,outputLocation);
+ return tool.getToolCommandFlagsString(inputLocation, outputLocation);
} catch (BuildException e) {
return null;
}
@@ -454,7 +455,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
IToolChain toolChain = getDefaultConfiguration().getToolChain();
IBuilder builder = toolChain.getBuilder();
if (builder != null) {
- return builder.getArguments();
+ return builder.getArguments();
}
}
return "-k"; //$NON-NLS-1$
@@ -469,7 +470,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
IToolChain toolChain = getDefaultConfiguration().getToolChain();
IBuilder builder = toolChain.getBuilder();
if (builder != null) {
- return builder.getCommand();
+ return builder.getCommand();
}
}
return "make"; //$NON-NLS-1$
@@ -630,20 +631,21 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
* @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,
+ public IManagedCommandLineInfo generateCommandLineInfo(String sourceExtension, String[] flags, String outputFlag,
String outputPrefix, String outputName, String[] inputResources) {
- return generateToolCommandLineInfo( sourceExtension, flags,
- outputFlag, outputPrefix, outputName, inputResources, null, null );
+ 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)
*/
@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);
+ 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);
}
/* (non-Javadoc)
@@ -666,10 +668,11 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
*
*/
public void initializePathEntries() {
- if (!isValid()) return;
+ if (!isValid())
+ return;
try {
IPathEntryContainer container = new ManagedBuildCPathEntryContainer(getOwner().getProject());
- CoreModel.setPathEntryContainer(new ICProject[]{cProject}, container, new NullProgressMonitor());
+ CoreModel.setPathEntryContainer(new ICProject[] { cProject }, container, new NullProgressMonitor());
} catch (CModelException e) {
}
}
@@ -704,7 +707,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#isReadOnly()
*/
@Override
- public boolean isReadOnly(){
+ public boolean isReadOnly() {
return isReadOnly;
}
@@ -731,7 +734,8 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
*/
@Override
public boolean needsRebuild() {
- if (rebuildNeeded) return true;
+ if (rebuildNeeded)
+ return true;
if (getDefaultConfiguration() != null) {
return getDefaultConfiguration().needsRebuild();
@@ -742,17 +746,17 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
/* (non-Javadoc)
*
*/
-/* private void persistDefaultConfiguration() {
- // Persist the default configuration
- IProject project = owner.getProject();
- try {
- if(defaultConfigId != null)
- project.setPersistentProperty(defaultConfigProperty, defaultConfigId.toString().trim());
- } catch (CoreException e) {
- // Too bad
+ /* private void persistDefaultConfiguration() {
+ // Persist the default configuration
+ IProject project = owner.getProject();
+ try {
+ if(defaultConfigId != null)
+ project.setPersistentProperty(defaultConfigProperty, defaultConfigId.toString().trim());
+ } catch (CoreException e) {
+ // Too bad
+ }
}
- }
-*/
+ */
/**
* Write the contents of the build model to the persistent store
* specified in the argument.
@@ -762,27 +766,25 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
public void serializeLegacy(Document doc, Element element) {
// Write out the managed build project
- if(managedProject != null){
+ if (managedProject != null) {
Element projElement = doc.createElement(IManagedProject.MANAGED_PROJECT_ELEMENT_NAME);
element.appendChild(projElement);
- ((ManagedProject)managedProject).serialize(XmlStorageUtil.createCStorageTree(projElement), true);
- }
- else{
+ ((ManagedProject) managedProject).serialize(XmlStorageUtil.createCStorageTree(projElement), true);
+ } else {
Iterator<ITarget> iter = getTargets().listIterator();
while (iter.hasNext()) {
// Get the target
- Target targ = (Target)iter.next();
+ Target targ = (Target) iter.next();
// Create an XML element to hold the target settings
Element targetElement = doc.createElement(ITarget.TARGET_ELEMENT_NAME);
element.appendChild(targetElement);
targ.serialize(doc, targetElement);
}
-// persistDefaultTarget();
+ // persistDefaultTarget();
}
-
// Remember the default configuration
-// persistDefaultConfiguration();
+ // persistDefaultConfiguration();
// I'm clean now
setDirty(false);
@@ -796,7 +798,8 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
// 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.
// Sanity
- if (configuration == null || configuration.isExtensionElement()) return;
+ if (configuration == null || configuration.isExtensionElement())
+ return;
ICProjectDescription des = null;
try {
@@ -807,19 +810,20 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
if (!configuration.equals(findExistingDefaultConfiguration(des))) {
IProject project = owner.getProject();
- if(des == null)
+ if (des == null)
des = CoreModel.getDefault().getProjectDescription(project);
- if(des != null){
+ if (des != null) {
ICConfigurationDescription activeCfgDes = des.getConfigurationById(configuration.getId());
- if(activeCfgDes == null){
+ if (activeCfgDes == null) {
try {
- activeCfgDes = des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, configuration.getConfigurationData());
+ activeCfgDes = des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID,
+ configuration.getConfigurationData());
} catch (WriteAccessException e) {
} catch (CoreException e) {
}
}
- if(activeCfgDes != null){
+ if (activeCfgDes != null) {
des.setActiveConfiguration(activeCfgDes);
} else {
des = null;
@@ -827,7 +831,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
}
}
- if(des != null){
+ if (des != null) {
try {
BuildSettingsUtil.checkApplyDescription(owner.getProject(), des);
} catch (CoreException e) {
@@ -881,8 +885,8 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#setReadOnly(boolean)
*/
@Override
- public void setReadOnly(boolean readOnly){
- if(!readOnly && isReadOnly)
+ public void setReadOnly(boolean readOnly) {
+ if (!readOnly && isReadOnly)
setDirty(true);
isReadOnly = readOnly;
}
@@ -905,17 +909,17 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
updateRevision(version);
if (version != null && !version.equals(this.version))
this.version = version;
- //setDirty(true); - It is primarily up to the ManagedProject to maintain the dirty state
+ //setDirty(true); - It is primarily up to the ManagedProject to maintain the dirty state
}
public void setContainerInited(boolean bInited) {
- bIsContainerInited = bInited;
+ bIsContainerInited = bInited;
}
@Override
public String toString() {
// Just print out the name of the project
- return "Managed build information for " + owner.getName(); //$NON-NLS-1$
+ return "Managed build information for " + owner.getName(); //$NON-NLS-1$
}
/**
@@ -927,7 +931,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
if (resource != null) {
if (!owner.equals(resource)) {
// Update owner on the managed project
- if(managedProject != null)
+ if (managedProject != null)
managedProject.updateOwner(resource);
// And finally update the cModelElement
cProject = CoreModel.getDefault().create(resource.getProject());
@@ -1019,29 +1023,33 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
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('\\','/'); }
+ IBuildEnvironmentVariable cwdvar = ManagedBuildManager.getEnvironmentVariableProvider().getVariable("CWD", //$NON-NLS-1$
+ getDefaultConfiguration(), false, true);
+ 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$
+ final String EMPTY = ""; //$NON-NLS-1$
if (path != null) {
if (context != 0) {
try {
- String paths[] = ManagedBuildManager.getBuildMacroProvider().resolveStringListValue(path, EMPTY, " ", context, obj); //$NON-NLS-1$
+ String paths[] = ManagedBuildManager.getBuildMacroProvider().resolveStringListValue(path, EMPTY,
+ " ", context, obj); //$NON-NLS-1$
if (paths != null) {
- for(int i = 0; i < paths.length; i++){
+ for (int i = 0; i < paths.length; i++) {
// Check for registered path converter
if (obj instanceof OptionContextData) {
OptionContextData optionContext = (OptionContextData) obj;
- IBuildObject buildObject = optionContext.getParent() ;
+ IBuildObject buildObject = optionContext.getParent();
IOptionPathConverter optionPathConverter = getPathConverter(buildObject);
- if (null!=optionPathConverter) {
- IPath platformPath = optionPathConverter
- .convertToPlatformLocation(paths[i], null, null);
+ if (null != optionPathConverter) {
+ IPath platformPath = optionPathConverter.convertToPlatformLocation(paths[i], null,
+ null);
paths[i] = platformPath.toOSString();
}
}
@@ -1057,32 +1065,37 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
return list;
}
- private IOptionPathConverter getPathConverter(IBuildObject buildObject) {
- IOptionPathConverter converter = null ;
+ private IOptionPathConverter getPathConverter(IBuildObject buildObject) {
+ IOptionPathConverter converter = null;
if (buildObject instanceof ITool) {
ITool tool = (ITool) buildObject;
- converter = tool.getOptionPathConverter() ;
+ converter = tool.getOptionPathConverter();
}
- return converter ;
+ return converter;
}
- private String checkPath(String p){
+
+ private String checkPath(String p) {
final String QUOTE = "\""; //$NON-NLS-1$
- final String EMPTY = ""; //$NON-NLS-1$
+ final String EMPTY = ""; //$NON-NLS-1$
- if(p == null)
+ if (p == null)
return EMPTY;
- if (p.length()> 1 && p.startsWith(QUOTE) && p.endsWith(QUOTE)) {
- p = p.substring(1, p.length()-1);
+ if (p.length() > 1 && p.startsWith(QUOTE) && p.endsWith(QUOTE)) {
+ p = p.substring(1, p.length() - 1);
}
- if ( ".".equals(p) ) { //$NON-NLS-1$
+ if (".".equals(p)) { //$NON-NLS-1$
String cwd = getCWD();
- if (cwd.length()>0) { p = cwd; }
+ if (cwd.length() > 0) {
+ p = cwd;
+ }
}
if (!(new Path(p)).isAbsolute()) {
String cwd = getCWD();
- if (cwd.length()>0) { p = cwd + "/" + p; } //$NON-NLS-1$
+ if (cwd.length() > 0) {
+ p = cwd + "/" + p; //$NON-NLS-1$
+ }
}
return p;
@@ -1094,13 +1107,22 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
*/
public IPathEntry[] getManagedBuildValues() {
List<IPathEntry> entries = new ArrayList<IPathEntry>();
- int i=0;
+ 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()]);
}
@@ -1110,13 +1132,22 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
*/
public IPathEntry[] getManagedBuildBuiltIns() {
List<IPathEntry> entries = new ArrayList<IPathEntry>();
- int i=0;
+ 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()]);
}
@@ -1127,7 +1158,9 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
// 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);
+ entries = addIncludes(entries,
+ env.getBuildPaths(getDefaultConfiguration(), IEnvVarBuildPath.BUILDPATH_INCLUDE), Path.EMPTY, 0,
+ null);
}
return entries.toArray(new IPathEntry[entries.size()]);
}
@@ -1148,12 +1181,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
IConfiguration cfg = getDefaultConfiguration();
// process config toolchain's options
- entries = readToolsOptions(
- entryType,
- entries,
- builtIns,
- cfg);
-
+ entries = readToolsOptions(entryType, entries, builtIns, cfg);
// code below (obtaining of resource config values)
// is now commented because resource-related include
@@ -1162,19 +1190,19 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
// project's "includes" folder.
//
// 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,
- rescfgs[i]);
- }
- }
-*/
+ /*
+ // process resource configurations
+ IResourceConfiguration[] rescfgs = cfg.getResourceConfigurations();
+ if (rescfgs != null) {
+ for (int i=0; i<rescfgs.length; i++) {
+ entries = readToolsOptions(
+ entryType,
+ entries,
+ builtIns,
+ rescfgs[i]);
+ }
+ }
+ */
return entries;
}
@@ -1185,102 +1213,119 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
* @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) {
+ private List<IPathEntry> readToolsOptions(int entryType, List<IPathEntry> entries, boolean builtIns,
+ IBuildObject obj) {
ITool[] t = null;
IPath resPath = Path.EMPTY;
// 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
-//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; }
+ //TODO: we need to implement the proper CDT_LIBRARY handling
+ //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();
+ 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
- if (t == null) { return entries; }
+ t = ((IConfiguration) obj).getFilteredTools();
+ } 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++) {
+ for (int i = 0; i < t.length; i++) {
IOption[] op = t[i].getOptions();
- for (int j=0; j<op.length; j++) {
+ 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;
+ 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]);
- 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)
- {
+ 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) {
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)
- {
+ 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) {
OptionContextData ocd = new OptionContextData(op[j], t[i]);
- addSymbols(entries, builtIns ? op[j].getBuiltIns() : op[j].getDefinedSymbols(), resPath, IBuildMacroProvider.CONTEXT_OPTION, ocd);
- } else { continue; }
- } catch (BuildException e) {}
+ addSymbols(entries, builtIns ? op[j].getBuiltIns() : op[j].getDefinedSymbols(), resPath,
+ IBuildMacroProvider.CONTEXT_OPTION, ocd);
+ } else {
+ continue;
+ }
+ } catch (BuildException e) {
+ }
}
}
return entries;
}
- protected List<IPathEntry> addIncludes(List<IPathEntry> entries, String[] values, IPath resPath, int context ,Object obj) {
+ 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){
+ 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++) {
+ for (int k = 0; k < values.length; k++) {
processPath(list, values[k], context, obj);
}
Iterator<String> iter = list.iterator();
- while(iter.hasNext()){
+ while (iter.hasNext()) {
IPathEntry entry = null;
- switch(type){
+ switch (type) {
case IPathEntry.CDT_INCLUDE:
entry = CoreModel.newIncludeEntry(resPath, Path.EMPTY, new Path(iter.next()), true);
break;
case IPathEntry.CDT_LIBRARY:
- entry = CoreModel.newLibraryEntry(resPath, Path.EMPTY, new Path(iter.next()), null, null, null, true);
+ entry = CoreModel.newLibraryEntry(resPath, Path.EMPTY, new Path(iter.next()), null, null, null,
+ true);
break;
}
- if (entry != null && !entries.contains(entry)) { entries.add(entry); }
+ if (entry != null && !entries.contains(entry)) {
+ entries.add(entry);
+ }
}
}
return entries;
}
- protected List<IPathEntry> addLibraries(List<IPathEntry> entries, String[] values, IPath resPath, int context, Object obj) {
+ 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++) {
+ 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++) {
try {
- String res[] = ManagedBuildManager.getBuildMacroProvider().resolveStringListValue(values[i],
- "", " ", context, obj); //$NON-NLS-1$ //$NON-NLS-2$
- if(res != null){
- for(int k = 0; k < res.length; k++)
+ String res[] = ManagedBuildManager.getBuildMacroProvider().resolveStringListValue(values[i], "", " ", //$NON-NLS-1$//$NON-NLS-2$
+ context, obj);
+ if (res != null) {
+ for (int k = 0; k < res.length; k++)
createMacroEntry(entries, res[k], resPath);
}
} catch (BuildMacroException e) {
@@ -1289,8 +1334,8 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
return entries;
}
- private List<IPathEntry> createMacroEntry(List<IPathEntry> entries, String val, IPath resPath){
- if (val != null && val.length() != 0){
+ private List<IPathEntry> createMacroEntry(List<IPathEntry> entries, String val, IPath resPath) {
+ if (val != null && val.length() != 0) {
String[] tokens = val.split("="); //$NON-NLS-1$
String key = tokens[0].trim();
@@ -1301,21 +1346,23 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
while (entryIter.hasNext()) {
IPathEntry entry = entryIter.next();
if (entry.getEntryKind() == IPathEntry.CDT_MACRO) {
- if (((IMacroEntry)entry).getMacroName().equals(key) &&
- ((IMacroEntry)entry).getMacroValue().equals(value)) {
+ if (((IMacroEntry) entry).getMacroName().equals(key)
+ && ((IMacroEntry) entry).getMacroValue().equals(value)) {
add = false;
break;
}
}
}
- if (add) { entries.add(CoreModel.newMacroEntry(resPath, key, value)); }
+ if (add) {
+ entries.add(CoreModel.newMacroEntry(resPath, key, value));
+ }
}
return entries;
}
- public void updateRevision(String revision){
- if(managedProject != null)
- ((ManagedProject)managedProject).updateManagedBuildRevision(revision);
+ 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 b7996f3e636..6e52fc3b789 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
@@ -17,23 +17,22 @@ import org.eclipse.cdt.managedbuilder.core.IManagedCommandLineGenerator;
import org.eclipse.cdt.managedbuilder.core.IManagedCommandLineInfo;
import org.eclipse.cdt.managedbuilder.core.ITool;
-public class ManagedCommandLineGenerator implements
- IManagedCommandLineGenerator {
-
- public final String AT = "@"; //$NON-NLS-1$
- public final String COLON = ":"; //$NON-NLS-1$
- public final String DOT = "."; //$NON-NLS-1$
- public final String ECHO = "echo"; //$NON-NLS-1$
- public final String IN_MACRO = "$<"; //$NON-NLS-1$
- public final String LINEBREAK = "\\\n"; //$NON-NLS-1$
- public final String NEWLINE = System.getProperty("line.separator"); //$NON-NLS-1$
- public final String OUT_MACRO = "$@"; //$NON-NLS-1$
- public final String SEPARATOR = "/"; //$NON-NLS-1$
- public final String SINGLE_QUOTE = "'"; //$NON-NLS-1$
+public class ManagedCommandLineGenerator implements IManagedCommandLineGenerator {
+
+ public final String AT = "@"; //$NON-NLS-1$
+ public final String COLON = ":"; //$NON-NLS-1$
+ public final String DOT = "."; //$NON-NLS-1$
+ public final String ECHO = "echo"; //$NON-NLS-1$
+ public final String IN_MACRO = "$<"; //$NON-NLS-1$
+ public final String LINEBREAK = "\\\n"; //$NON-NLS-1$
+ public final String NEWLINE = System.getProperty("line.separator"); //$NON-NLS-1$
+ public final String OUT_MACRO = "$@"; //$NON-NLS-1$
+ public final String SEPARATOR = "/"; //$NON-NLS-1$
+ public final String SINGLE_QUOTE = "'"; //$NON-NLS-1$
public final String DOUBLE_QUOTE = "\""; //$NON-NLS-1$
- public final String TAB = "\t"; //$NON-NLS-1$
- public final String WHITESPACE = " "; //$NON-NLS-1$
- public final String WILDCARD = "%"; //$NON-NLS-1$
+ public final String TAB = "\t"; //$NON-NLS-1$
+ public final String WHITESPACE = " "; //$NON-NLS-1$
+ public final String WILDCARD = "%"; //$NON-NLS-1$
public final String UNDERLINE = "_"; //$NON-NLS-1$
public final String EMPTY = ""; //$NON-NLS-1$
@@ -56,36 +55,35 @@ public class ManagedCommandLineGenerator implements
}
public static ManagedCommandLineGenerator getCommandLineGenerator() {
- if( cmdLineGen == null ) cmdLineGen = new ManagedCommandLineGenerator();
+ if (cmdLineGen == null)
+ cmdLineGen = new ManagedCommandLineGenerator();
return cmdLineGen;
}
private String makeVariable(String variableName) {
- return "${"+variableName+"}"; //$NON-NLS-1$ //$NON-NLS-2$
+ return "${" + variableName + "}"; //$NON-NLS-1$ //$NON-NLS-2$
}
/* (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)
- {
- if( commandLinePattern == null || commandLinePattern.length() <= 0 )
+ public IManagedCommandLineInfo generateCommandLineInfo(ITool tool, String commandName, String[] flags,
+ String outputFlag, 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$
+ if (outputName.length() > 0 && outputName.indexOf("$(") != 0) //$NON-NLS-1$
outputName = DOUBLE_QUOTE + outputName + DOUBLE_QUOTE;
- String inputsStr=""; //$NON-NLS-1$
- if (inputResources!=null) {
+ String inputsStr = ""; //$NON-NLS-1$
+ if (inputResources != null) {
for (String inp : inputResources) {
- if(inp!=null && inp.length()>0) {
+ if (inp != null && inp.length() > 0) {
// if the input resource isn't a variable then quote it
- if(inp.indexOf("$(") != 0) { //$NON-NLS-1$
+ if (inp.indexOf("$(") != 0) { //$NON-NLS-1$
inp = DOUBLE_QUOTE + inp + DOUBLE_QUOTE;
}
inputsStr = inputsStr + inp + WHITESPACE;
@@ -116,11 +114,12 @@ public class ManagedCommandLineGenerator implements
outputFlag, outputPrefix, outputName, stringArrayToString(inputResources));
}
- private String stringArrayToString( String[] array ) {
- if( array == null || array.length <= 0 ) return ""; //$NON-NLS-1$
+ private String stringArrayToString(String[] array) {
+ if (array == null || array.length <= 0)
+ return ""; //$NON-NLS-1$
StringBuilder sb = new StringBuilder();
- for( int i = 0; i < array.length; i++ ) {
- if(i > 0) // we add whitespace after each but not first so .trim() is a no-op
+ for (int i = 0; i < array.length; i++) {
+ if (i > 0) // we add whitespace after each but not first so .trim() is a no-op
sb.append(WHITESPACE);
sb.append(array[i]);
}
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 d7d669baaa7..c90d4e726ab 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
@@ -15,8 +15,7 @@ package org.eclipse.cdt.managedbuilder.internal.core;
import org.eclipse.cdt.managedbuilder.core.IManagedCommandLineInfo;
-public class ManagedCommandLineInfo implements
- IManagedCommandLineInfo {
+public class ManagedCommandLineInfo implements IManagedCommandLineInfo {
private String commandLine;
private String commandLinePattern;
@@ -27,8 +26,8 @@ public class ManagedCommandLineInfo implements
private String outputName;
private String inputResources;
- public ManagedCommandLineInfo( String commandLine, String commandLinePattern, String commandName, String flags, String outputFlag,
- String outputPrefix, String outputName, String inputResources) {
+ public ManagedCommandLineInfo(String commandLine, String commandLinePattern, String commandName, String flags,
+ String outputFlag, String outputPrefix, String outputName, String inputResources) {
this.commandLine = commandLine;
this.commandLinePattern = commandLinePattern;
this.commandName = commandName;
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 96e9426f833..ea4832ffc58 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
@@ -27,11 +27,12 @@ public class ManagedConfigStorageElement implements ICStorageElement {
private IManagedConfigElement fElement;
private List<IManagedConfigElement> fChildList;
private ManagedConfigStorageElement fParent;
- public ManagedConfigStorageElement(IManagedConfigElement el){
+
+ public ManagedConfigStorageElement(IManagedConfigElement el) {
this(el, null);
}
- public ManagedConfigStorageElement(IManagedConfigElement el, ManagedConfigStorageElement parent){
+ public ManagedConfigStorageElement(IManagedConfigElement el, ManagedConfigStorageElement parent) {
fElement = el;
fParent = parent;
}
@@ -62,8 +63,8 @@ public class ManagedConfigStorageElement implements ICStorageElement {
return list.toArray(new ManagedConfigStorageElement[list.size()]);
}
- private List<IManagedConfigElement> getChildList(boolean create){
- if(fChildList == null && create){
+ private List<IManagedConfigElement> getChildList(boolean create) {
+ if (fChildList == null && create) {
IManagedConfigElement children[] = fElement.getChildren();
fChildList = new ArrayList<IManagedConfigElement>(children.length);
@@ -102,8 +103,7 @@ public class ManagedConfigStorageElement implements ICStorageElement {
}
@Override
- public ICStorageElement importChild(ICStorageElement el)
- throws UnsupportedOperationException {
+ public ICStorageElement importChild(ICStorageElement el) throws UnsupportedOperationException {
throw new WriteAccessException();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedMakeMessages.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedMakeMessages.java
index 2262a164a38..df62ea1a206 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedMakeMessages.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedMakeMessages.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM - Initial API and implementation
*******************************************************************************/
@@ -57,7 +57,7 @@ public class ManagedMakeMessages {
}
/**
- *
+ *
*/
private ManagedMakeMessages() {
// No constructor
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 182056e792e..180cb064bf8 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
@@ -41,18 +41,18 @@ public class ManagedMakeProject implements ICOwner {
cproject.remove(CCorePlugin.BUILDER_MODEL_ID);
cproject.remove(CCorePlugin.BINARY_PARSER_UNIQ_ID);
-// updateIndexers(cproject);
+ // updateIndexers(cproject);
}
@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);
- }
-*/
+ /* if (extensionID.equals(CCorePlugin.BINARY_PARSER_UNIQ_ID)) {
+ updateBinaryParsers(cproject);
+ }
+
+ if (extensionID.equals(CCorePlugin.INDEXER_UNIQ_ID)) {
+ updateIndexers(cproject);
+ }
+ */
}
}
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 e1854576b3b..af3928ac836 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
@@ -43,22 +43,24 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.osgi.framework.Version;
-public class ManagedProject extends BuildObject implements IManagedProject, IBuildPropertiesRestriction, IBuildPropertyChangeListener {
+public class ManagedProject extends BuildObject
+ implements IManagedProject, IBuildPropertiesRestriction, IBuildPropertyChangeListener {
// Parent and children
private IProjectType projectType;
private String projectTypeId;
private IResource owner;
-// private List configList; // Configurations of this project type
- private Map<String, Configuration> configMap = Collections.synchronizedMap(new LinkedHashMap<String, Configuration>());
+ // private List configList; // Configurations of this project type
+ private Map<String, Configuration> configMap = Collections
+ .synchronizedMap(new LinkedHashMap<String, Configuration>());
// Miscellaneous
private boolean isDirty = false;
private boolean isValid = true;
private boolean resolved = true;
//holds the user-defined macros
-// private StorableMacros userDefinedMacros;
+ // private StorableMacros userDefinedMacros;
//holds user-defined environment
-// private StorableEnvironment userDefinedEnvironment;
+ // private StorableEnvironment userDefinedEnvironment;
private BuildObjectProperties buildProperties;
private OptionalBuildProperties optionalBuildProperties;
@@ -89,7 +91,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
// Copy the parent's identity
this.projectType = projectType;
int id = ManagedBuildManager.getRandomNumber();
- setId(owner.getName() + "." + projectType.getId() + "." + id); //$NON-NLS-1$ //$NON-NLS-2$
+ setId(owner.getName() + "." + projectType.getId() + "." + id); //$NON-NLS-1$ //$NON-NLS-2$
setName(projectType.getName());
setManagedBuildRevision(projectType.getManagedBuildRevision());
@@ -105,17 +107,17 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
this(des.getProject());
// Copy the parent's identity
-// this.projectType = projectType;
+ // this.projectType = projectType;
int id = ManagedBuildManager.getRandomNumber();
- setId(owner.getName() + "." + des.getId() + "." + id); //$NON-NLS-1$ //$NON-NLS-2$
+ setId(owner.getName() + "." + des.getId() + "." + id); //$NON-NLS-1$ //$NON-NLS-2$
setName(des.getName());
-// setManagedBuildRevision(projectType.getManagedBuildRevision());
+ // setManagedBuildRevision(projectType.getManagedBuildRevision());
// Hook me up
-// IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(owner);
-// buildInfo.setManagedProject(this);
-// setDirty(true);
+ // IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(owner);
+ // buildInfo.setManagedProject(this);
+ // setDirty(true);
}
/**
@@ -123,7 +125,8 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
*
* @param managedBuildRevision the fileVersion of Managed Build System
*/
- public ManagedProject(ManagedBuildInfo buildInfo, ICStorageElement element, boolean loadConfigs, String managedBuildRevision) {
+ public ManagedProject(ManagedBuildInfo buildInfo, ICStorageElement element, boolean loadConfigs,
+ String managedBuildRevision) {
this(buildInfo.getOwner());
setManagedBuildRevision(managedBuildRevision);
@@ -137,22 +140,22 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
setValid(false);
}
- if(loadConfigs){
+ if (loadConfigs) {
// Load children
StorableCdtVariables vars = null;
ICStorageElement configElements[] = element.getChildren();
for (ICStorageElement configElement : configElements) {
if (configElement.getName().equals(IConfiguration.CONFIGURATION_ELEMENT_NAME)) {
Configuration config = new Configuration(this, configElement, managedBuildRevision, false);
- } else if (configElement.getName().equals("macros")) { //$NON-NLS-1$
+ } else if (configElement.getName().equals("macros")) { //$NON-NLS-1$
vars = new StorableCdtVariables(configElement, false);
}
}
- if(vars != null){
+ if (vars != null) {
for (Configuration cfg : getConfigurationCollection()) {
- ((ToolChain)cfg.getToolChain()).addProjectVariables(vars);
+ ((ToolChain) cfg.getToolChain()).addProjectVariables(vars);
}
}
}
@@ -194,16 +197,16 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
}
String props = element.getAttribute(BUILD_PROPERTIES);
- if(props != null && props.length() != 0)
+ if (props != null && props.length() != 0)
buildProperties = new BuildObjectProperties(props, this, this);
-
+
String optionalProps = element.getAttribute(OPTIONAL_BUILD_PROPERTIES);
if (optionalProps != null && optionalProps.length() != 0)
optionalBuildProperties = new OptionalBuildProperties(optionalProps);
String artType = element.getAttribute(BUILD_ARTEFACT_TYPE);
- if(artType != null){
- if(buildProperties == null)
+ if (artType != null) {
+ if (buildProperties == null)
buildProperties = new BuildObjectProperties(this, this);
try {
@@ -237,7 +240,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
public void serialize(ICStorageElement element, boolean saveChildren) {
serializeProjectInfo(element);
- if(saveChildren){
+ if (saveChildren) {
for (Configuration cfg : getConfigurationCollection()) {
ICStorageElement configElement = element.createChild(IConfiguration.CONFIGURATION_ELEMENT_NAME);
cfg.serialize(configElement);
@@ -245,16 +248,16 @@ 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);
-// }
+ // //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);
+ // }
// I am clean now
isDirty = false;
@@ -296,7 +299,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
*/
@Override
public IConfiguration createConfiguration(IConfiguration parent, String id) {
- Configuration config = new Configuration(this, (Configuration)parent, id, false, false, false);
+ Configuration config = new Configuration(this, (Configuration) parent, id, false, false, false);
ManagedBuildManager.performValueHandlerEvent(config, IManagedOptionValueHandler.EVENT_OPEN);
return config;
}
@@ -306,7 +309,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
*/
@Override
public IConfiguration createConfigurationClone(IConfiguration parent, String id) {
- Configuration config = new Configuration(this, (Configuration)parent, id, true, false, false);
+ Configuration config = new Configuration(this, (Configuration) parent, id, true, false, false);
// Inform all options in the configuration and all its resource configurations
ManagedBuildManager.performValueHandlerEvent(config, IManagedOptionValueHandler.EVENT_OPEN);
return config;
@@ -338,63 +341,63 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
final String removeId = id;
//handle the case of temporary configuration
- if(!configMap.containsKey(id))
+ if (!configMap.containsKey(id))
return;
configMap.remove(removeId);
-//
-// IWorkspaceRunnable remover = new IWorkspaceRunnable() {
-// public void run(IProgressMonitor monitor) throws CoreException {
-// // Remove the specified configuration from the list and map
-// Iterator iter = getConfigurationCollection().iterator();
-// while (iter.hasNext()) {
-// IConfiguration config = (IConfiguration)iter.next();
-// if (config.getId().equals(removeId)) {
-// // TODO: For now we clean the entire project. This may be overkill, but
-// // it avoids a problem with leaving the configuration output directory
-// // around and having the outputs try to be used by the makefile generator code.
-// IResource proj = config.getOwner();
-// IManagedBuildInfo info = null;
-// if (proj instanceof IProject) {
-// info = ManagedBuildManager.getBuildInfo(proj);
-// }
-// IConfiguration currentConfig = null;
-// boolean isCurrent = true;
-// if (info != null) {
-// currentConfig = info.getDefaultConfiguration();
-// if (!currentConfig.getId().equals(removeId)) {
-// info.setDefaultConfiguration(config);
-// isCurrent = false;
-// }
-// }
-// ((IProject)proj).build(IncrementalProjectBuilder.CLEAN_BUILD, monitor);
-//
-// ManagedBuildManager.performValueHandlerEvent(config,
-// IManagedOptionValueHandler.EVENT_CLOSE);
-// PropertyManager.getInstance().clearProperties(config);
-//// getConfigurationList().remove(config);
-// getConfigurationMap().remove(removeId);
-//
-// if (info != null) {
-// if (!isCurrent) {
-// info.setDefaultConfiguration(currentConfig);
-// } else {
-// // If the current default config is the one being removed, reset the default config
-// String[] configs = info.getConfigurationNames();
-// if (configs.length > 0) {
-// info.setDefaultConfiguration(configs[0]);
-// }
-// }
-// }
-// break;
-// }
-// }
-// }
-// };
-// try {
-// ResourcesPlugin.getWorkspace().run( remover, null );
-// }
-// catch( CoreException e ) {}
+ //
+ // IWorkspaceRunnable remover = new IWorkspaceRunnable() {
+ // public void run(IProgressMonitor monitor) throws CoreException {
+ // // Remove the specified configuration from the list and map
+ // Iterator iter = getConfigurationCollection().iterator();
+ // while (iter.hasNext()) {
+ // IConfiguration config = (IConfiguration)iter.next();
+ // if (config.getId().equals(removeId)) {
+ // // TODO: For now we clean the entire project. This may be overkill, but
+ // // it avoids a problem with leaving the configuration output directory
+ // // around and having the outputs try to be used by the makefile generator code.
+ // IResource proj = config.getOwner();
+ // IManagedBuildInfo info = null;
+ // if (proj instanceof IProject) {
+ // info = ManagedBuildManager.getBuildInfo(proj);
+ // }
+ // IConfiguration currentConfig = null;
+ // boolean isCurrent = true;
+ // if (info != null) {
+ // currentConfig = info.getDefaultConfiguration();
+ // if (!currentConfig.getId().equals(removeId)) {
+ // info.setDefaultConfiguration(config);
+ // isCurrent = false;
+ // }
+ // }
+ // ((IProject)proj).build(IncrementalProjectBuilder.CLEAN_BUILD, monitor);
+ //
+ // ManagedBuildManager.performValueHandlerEvent(config,
+ // IManagedOptionValueHandler.EVENT_CLOSE);
+ // PropertyManager.getInstance().clearProperties(config);
+ //// getConfigurationList().remove(config);
+ // getConfigurationMap().remove(removeId);
+ //
+ // if (info != null) {
+ // if (!isCurrent) {
+ // info.setDefaultConfiguration(currentConfig);
+ // } else {
+ // // If the current default config is the one being removed, reset the default config
+ // String[] configs = info.getConfigurationNames();
+ // if (configs.length > 0) {
+ // info.setDefaultConfiguration(configs[0]);
+ // }
+ // }
+ // }
+ // break;
+ // }
+ // }
+ // }
+ // };
+ // try {
+ // ResourcesPlugin.getWorkspace().run( remover, null );
+ // }
+ // catch( CoreException e ) {}
setDirty(true);
}
@@ -404,7 +407,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
* @param Tool
*/
public void addConfiguration(Configuration configuration) {
- if(!configuration.isTemporary())
+ if (!configuration.isTemporary())
configMap.put(configuration.getId(), configuration);
}
@@ -431,7 +434,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
* @see org.eclipse.cdt.managedbuilder.core.IManagedProject#(getDefaultArtifactName)
*/
@Override
- public String getDefaultArtifactName(){
+ public String getDefaultArtifactName() {
return CdtVariableResolver.createVariableReference(CdtVariableResolver.VAR_PROJ_NAME);
}
@@ -462,16 +465,16 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
@Override
public boolean isDirty() {
// If I need saving, just say yes
- if (isDirty) return true;
+ if (isDirty)
+ return true;
//check whether the project - specific macros are dirty
-// if(userDefinedMacros != null && userDefinedMacros.isDirty())
-// return true;
+ // if(userDefinedMacros != null && userDefinedMacros.isDirty())
+ // return true;
//check whether the project - specific environment is dirty
-// if(userDefinedEnvironment != null && userDefinedEnvironment.isDirty())
-// return true;
-
+ // if(userDefinedEnvironment != null && userDefinedEnvironment.isDirty())
+ // return true;
// Otherwise see if any configurations need saving
for (IConfiguration cfg : getConfigurationCollection())
@@ -516,12 +519,12 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
*/
@Override
public Version getVersion() {
- if (version == null) {
- if ( getProjectType() != null) {
- return getProjectType().getVersion();
- }
+ if (version == null) {
+ if (getProjectType() != null) {
+ return getProjectType().getVersion();
}
- return version;
+ }
+ return version;
}
@Override
@@ -533,25 +536,25 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
* this method is called by the UserDefinedMacroSupplier to obtain user-defined
* macros available for this managed project
*/
-/* public StorableMacros getUserDefinedMacros(){
- if(userDefinedMacros == null)
- userDefinedMacros = new StorableMacros();
- return userDefinedMacros;
- }
-*/
-// public StorableEnvironment getUserDefinedEnvironmet(){
-// return userDefinedEnvironment;
-// }
-//
-// public void setUserDefinedEnvironmet(StorableEnvironment env){
-// userDefinedEnvironment = env;
-// }
+ /* public StorableMacros getUserDefinedMacros(){
+ if(userDefinedMacros == null)
+ userDefinedMacros = new StorableMacros();
+ return userDefinedMacros;
+ }
+ */
+ // public StorableEnvironment getUserDefinedEnvironmet(){
+ // return userDefinedEnvironment;
+ // }
+ //
+ // public void setUserDefinedEnvironmet(StorableEnvironment env){
+ // userDefinedEnvironment = env;
+ // }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.internal.core.BuildObject#updateManagedBuildRevision(java.lang.String)
*/
@Override
- public void updateManagedBuildRevision(String revision){
+ public void updateManagedBuildRevision(String revision) {
super.updateManagedBuildRevision(revision);
for (Configuration cfg : getConfigurationCollection()) {
cfg.updateManagedBuildRevision(revision);
@@ -559,9 +562,9 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
}
public void setProjectType(IProjectType projectType) {
- if ( this.projectType != projectType ) {
+ if (this.projectType != projectType) {
this.projectType = projectType;
- if ( this.projectType == null) {
+ if (this.projectType == null) {
projectTypeId = null;
} else {
projectTypeId = this.projectType.getId();
@@ -569,15 +572,15 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
}
}
- public void applyConfiguration(Configuration cfg){
+ public void applyConfiguration(Configuration cfg) {
cfg.applyToManagedProject(this);
}
@Override
public IBuildObjectProperties getBuildProperties() {
- if(buildProperties == null){
+ if (buildProperties == null) {
BuildObjectProperties parentProps = findBuildProperties();
- if(parentProps != null)
+ if (parentProps != null)
buildProperties = new BuildObjectProperties(parentProps, this, this);
else
buildProperties = new BuildObjectProperties(this, this);
@@ -587,9 +590,9 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
@Override
public IOptionalBuildProperties getOptionalBuildProperties() {
- if(optionalBuildProperties == null){
+ if (optionalBuildProperties == null) {
OptionalBuildProperties parentProps = findOptionalBuildProperties();
- if(parentProps != null)
+ if (parentProps != null)
optionalBuildProperties = new OptionalBuildProperties(parentProps);
else
optionalBuildProperties = new OptionalBuildProperties();
@@ -597,20 +600,20 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
return optionalBuildProperties;
}
- private BuildObjectProperties findBuildProperties(){
- if(buildProperties == null){
- if(projectType != null){
- return ((ProjectType)projectType).findBuildProperties();
+ private BuildObjectProperties findBuildProperties() {
+ if (buildProperties == null) {
+ if (projectType != null) {
+ return ((ProjectType) projectType).findBuildProperties();
}
return null;
}
return buildProperties;
}
- private OptionalBuildProperties findOptionalBuildProperties(){
- if(optionalBuildProperties == null){
- if(projectType != null){
- return ((ProjectType)projectType).findOptionalBuildProperties();
+ private OptionalBuildProperties findOptionalBuildProperties() {
+ if (optionalBuildProperties == null) {
+ if (projectType != null) {
+ return ((ProjectType) projectType).findOptionalBuildProperties();
}
return null;
}
@@ -621,7 +624,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
public void propertiesChanged() {
IConfiguration cfgs[] = getConfigurations();
for (IConfiguration cfg : cfgs) {
- ((Configuration)cfg).propertiesChanged();
+ ((Configuration) cfg).propertiesChanged();
}
}
@@ -629,8 +632,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
return supportsType(type.getId());
}
- public boolean supportsValue(IBuildPropertyType type,
- IBuildPropertyValue value) {
+ public boolean supportsValue(IBuildPropertyType type, IBuildPropertyValue value) {
return supportsValue(type.getId(), value.getId());
}
@@ -638,7 +640,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
public boolean supportsType(String typeId) {
IConfiguration cfgs[] = getConfigurations();
for (IConfiguration cfg : cfgs) {
- if(((Configuration)cfg).supportsType(typeId))
+ if (((Configuration) cfg).supportsType(typeId))
return true;
}
return false;
@@ -648,7 +650,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
public boolean supportsValue(String typeId, String valueId) {
IConfiguration cfgs[] = getConfigurations();
for (IConfiguration cfg : cfgs) {
- if(((Configuration)cfg).supportsValue(typeId, valueId))
+ if (((Configuration) cfg).supportsValue(typeId, valueId))
return true;
}
return false;
@@ -659,7 +661,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
List<String> result = new ArrayList<String>();
IConfiguration cfgs[] = getConfigurations();
for (IConfiguration cfg : cfgs) {
- result.addAll(Arrays.asList(((Configuration)cfg).getRequiredTypeIds()));
+ result.addAll(Arrays.asList(((Configuration) cfg).getRequiredTypeIds()));
}
return result.toArray(new String[result.size()]);
}
@@ -669,7 +671,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
List<String> result = new ArrayList<String>();
IConfiguration cfgs[] = getConfigurations();
for (IConfiguration cfg : cfgs) {
- result.addAll(Arrays.asList(((Configuration)cfg).getSupportedTypeIds()));
+ result.addAll(Arrays.asList(((Configuration) cfg).getSupportedTypeIds()));
}
return result.toArray(new String[result.size()]);
}
@@ -679,7 +681,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
List<String> result = new ArrayList<String>();
IConfiguration cfgs[] = getConfigurations();
for (IConfiguration cfg : cfgs) {
- result.addAll(Arrays.asList(((Configuration)cfg).getSupportedValueIds(typeId)));
+ result.addAll(Arrays.asList(((Configuration) cfg).getSupportedValueIds(typeId)));
}
return result.toArray(new String[result.size()]);
}
@@ -688,7 +690,7 @@ public class ManagedProject extends BuildObject implements IManagedProject, IBui
public boolean requiresType(String typeId) {
IConfiguration cfgs[] = getConfigurations();
for (IConfiguration cfg : cfgs) {
- if(((Configuration)cfg).requiresType(typeId))
+ if (((Configuration) cfg).requiresType(typeId))
return true;
}
return false;
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 cb514536fd1..66f07285bb8 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
@@ -37,24 +37,24 @@ public class MapStorageElement implements ICStorageElement {
private List<MapStorageElement> fChildren = new ArrayList<MapStorageElement>();
private String fValue;
- public MapStorageElement(String name, MapStorageElement parent){
+ public MapStorageElement(String name, MapStorageElement parent) {
fName = name;
fParent = parent;
fMap = new HashMap<String, String>();
}
- public MapStorageElement(Map<String, String> map, MapStorageElement parent){
+ public MapStorageElement(Map<String, String> map, MapStorageElement parent) {
fName = map.get(getMapKey(NAME_KEY));
fValue = map.get(getMapKey(VALUE_KEY));
fMap = new HashMap<String, String>(map);
fParent = parent;
String children = map.get(getMapKey(CHILDREN_KEY));
- if(children != null){
+ if (children != null) {
List<String> childrenStrList = decodeList(children);
int size = childrenStrList.size();
- if(size != 0){
- for(int i = 0; i < size; i++){
+ if (size != 0) {
+ for (int i = 0; i < size; i++) {
Map<String, String> childMap = decodeMap(childrenStrList.get(i));
MapStorageElement child = createChildElement(childMap);
fChildren.add(child);
@@ -63,31 +63,31 @@ public class MapStorageElement implements ICStorageElement {
}
}
- protected MapStorageElement createChildElement(Map<String, String> childMap){
+ protected MapStorageElement createChildElement(Map<String, String> childMap) {
return new MapStorageElement(childMap, this);
}
- protected String getMapKey(String name){
+ protected String getMapKey(String name) {
return name;
}
- public Map<String, String> toStringMap(){
+ public Map<String, String> toStringMap() {
@SuppressWarnings("unchecked")
- Map<String, String> map = (Map<String, String>)fMap.clone();
- if(fName != null)
+ Map<String, String> map = (Map<String, String>) fMap.clone();
+ if (fName != null)
map.put(getMapKey(NAME_KEY), fName);
else
map.remove(getMapKey(NAME_KEY));
- if(fValue != null)
+ if (fValue != null)
map.put(getMapKey(VALUE_KEY), fValue);
else
map.remove(getMapKey(VALUE_KEY));
int size = fChildren.size();
- if(size != 0){
+ if (size != 0) {
List<String> childrenStrList = new ArrayList<String>(size);
- for(int i = 0; i < size; i++){
+ for (int i = 0; i < size; i++) {
MapStorageElement child = fChildren.get(i);
Map<String, String> childStrMap = child.toStringMap();
String str = encodeMap(childStrMap);
@@ -103,7 +103,7 @@ public class MapStorageElement implements ICStorageElement {
return map;
}
- protected boolean isSystemKey(String key){
+ protected boolean isSystemKey(String key) {
return key.indexOf('?') == 0 && key.lastIndexOf('?') == key.length() - 1;
}
@@ -119,15 +119,15 @@ public class MapStorageElement implements ICStorageElement {
return child;
}
- protected MapStorageElement createChildElement(String name){
+ protected MapStorageElement createChildElement(String name) {
return new MapStorageElement(name, this);
}
@Override
public String getAttribute(String name) {
Object o = fMap.get(getMapKey(name));
- if(o instanceof String)
- return (String)o;
+ if (o instanceof String)
+ return (String) o;
return null;
}
@@ -166,10 +166,10 @@ public class MapStorageElement implements ICStorageElement {
}
@Override
- public void removeChild(ICStorageElement child){
+ public void removeChild(ICStorageElement child) {
fChildren.remove(child);
- if(child instanceof MapStorageElement){
- ((MapStorageElement)child).removed();
+ if (child instanceof MapStorageElement) {
+ ((MapStorageElement) child).removed();
}
}
@@ -192,7 +192,7 @@ public class MapStorageElement implements ICStorageElement {
HashMap<String, String> map = new HashMap<String, String>();
char escapeChar = '\\';
- for(int i = 0; i < list.size(); i++){
+ for (int i = 0; i < list.size(); i++) {
StringBuilder line = new StringBuilder(list.get(i));
int lndx = 0;
while (lndx < line.length()) {
@@ -206,7 +206,8 @@ public class MapStorageElement implements ICStorageElement {
}
lndx++;
}
- map.put(SafeStringInterner.safeIntern(line.substring(0, lndx)), SafeStringInterner.safeIntern(line.substring(lndx + 1)));
+ map.put(SafeStringInterner.safeIntern(line.substring(0, lndx)),
+ SafeStringInterner.safeIntern(line.substring(lndx + 1)));
}
return map;
@@ -237,19 +238,19 @@ public class MapStorageElement implements ICStorageElement {
ndx++;
}
StringBuilder line = new StringBuilder(envStr.substring(0, ndx));
-/* int lndx = 0;
- while (lndx < line.length()) {
- if (line.charAt(lndx) == '=') {
- if (line.charAt(lndx - 1) == escapeChar) {
- // escaped '=' - remove '\' and continue on.
- line.deleteCharAt(lndx - 1);
- } else {
- break;
- }
- }
- lndx++;
- }
-*/
+ /* int lndx = 0;
+ while (lndx < line.length()) {
+ if (line.charAt(lndx) == '=') {
+ if (line.charAt(lndx - 1) == escapeChar) {
+ // escaped '=' - remove '\' and continue on.
+ line.deleteCharAt(lndx - 1);
+ } else {
+ break;
+ }
+ }
+ lndx++;
+ }
+ */
list.add(SafeStringInterner.safeIntern(line.toString()));
envStr.delete(0, ndx + 1);
}
@@ -305,8 +306,7 @@ public class MapStorageElement implements ICStorageElement {
}
@Override
- public ICStorageElement importChild(ICStorageElement el)
- throws UnsupportedOperationException {
+ public ICStorageElement importChild(ICStorageElement el) throws UnsupportedOperationException {
// TODO
throw new UnsupportedOperationException();
}
@@ -317,7 +317,7 @@ public class MapStorageElement implements ICStorageElement {
Set<Entry<String, String>> entrySet = fMap.entrySet();
for (Entry<String, String> entry : entrySet) {
String key = entry.getKey();
- if(!isSystemKey(key)){
+ if (!isSystemKey(key)) {
list.add(key);
}
}
@@ -326,7 +326,7 @@ public class MapStorageElement implements ICStorageElement {
}
@Override
- public ICStorageElement createCopy() throws UnsupportedOperationException, CoreException {
+ public ICStorageElement createCopy() throws UnsupportedOperationException, CoreException {
throw new UnsupportedOperationException();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MatchKey.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MatchKey.java
index 63a44d6ce1a..395e8a139ed 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MatchKey.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MatchKey.java
@@ -17,74 +17,74 @@ import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
public class MatchKey<T extends BuildObject> {
private T buildObject;
-
+
public MatchKey(T builder) {
this.buildObject = builder;
}
-
+
@Override
public boolean equals(Object obj) {
- if(obj == this)
+ if (obj == this)
return true;
- if(!(obj instanceof MatchKey))
+ if (!(obj instanceof MatchKey))
return false;
@SuppressWarnings("unchecked")
- MatchKey<T> other = (MatchKey<T>)obj;
+ MatchKey<T> other = (MatchKey<T>) obj;
return performMatchComparison(other.buildObject);
}
@Override
public int hashCode() {
String name = buildObject.getName();
- if(name == null)
+ if (name == null)
name = buildObject.getId();
int code = name.hashCode();
String version = ManagedBuildManager.getVersionFromIdAndVersion(buildObject.getId());
- if(version != null)
+ if (version != null)
code += version.hashCode();
return code;
}
-
- boolean performMatchComparison(T bo){
- if(bo == null)
+
+ boolean performMatchComparison(T bo) {
+ if (bo == null)
return false;
-
- if(bo == buildObject)
+
+ if (bo == buildObject)
return true;
-
-// if(bo.isReal() && buildObject.isReal())
-// return false;
-// if(!bo.getToolCommand().equals(buildObject.getToolCommand()))
-// return false;
-
- if(!bo.getName().equals(buildObject.getName()))
+
+ // if(bo.isReal() && buildObject.isReal())
+ // return false;
+ // if(!bo.getToolCommand().equals(buildObject.getToolCommand()))
+ // return false;
+
+ if (!bo.getName().equals(buildObject.getName()))
return false;
String thisVersion = ManagedBuildManager.getVersionFromIdAndVersion(buildObject.getId());
String otherVersion = ManagedBuildManager.getVersionFromIdAndVersion(bo.getId());
- if(thisVersion == null || thisVersion.length() == 0){
- if(otherVersion != null && otherVersion.length() != 0)
+ if (thisVersion == null || thisVersion.length() == 0) {
+ if (otherVersion != null && otherVersion.length() != 0)
return false;
} else {
- if(!thisVersion.equals(otherVersion))
+ if (!thisVersion.equals(otherVersion))
return false;
}
return true;
-/* IOption options[] = buildObject.getOptions();
- IOption otherOptions[] = bo.getOptions();
-
- if(!ListComparator.match(options,
- otherOptions,
- new Comparator(){
- public boolean equal(Object o1, Object o2){
- return ((Option)o1).matches((Option)o2);
- }
- }))
- return false;
-
- return true;
- */
+ /* IOption options[] = buildObject.getOptions();
+ IOption otherOptions[] = bo.getOptions();
+
+ if(!ListComparator.match(options,
+ otherOptions,
+ new Comparator(){
+ public boolean equal(Object o1, Object o2){
+ return ((Option)o1).matches((Option)o2);
+ }
+ }))
+ return false;
+
+ return true;
+ */
}
}
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 0068447b2ea..2f79fc761be 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
@@ -33,63 +33,60 @@ public class ModificationStatus extends Status implements IModificationStatus {
public static final ModificationStatus OK = new ModificationStatus(IStatus.OK, "", null); //$NON-NLS-1$
- ModificationStatus(String msg){
+ ModificationStatus(String msg) {
this(msg, null);
}
- ModificationStatus(String msg, Throwable t){
+ ModificationStatus(String msg, Throwable t) {
this(IStatus.ERROR, msg, t);
}
- ModificationStatus(int severity, String msg, Throwable t){
+ ModificationStatus(int severity, String msg, Throwable t) {
super(severity, ManagedBuilderCorePlugin.getUniqueIdentifier(), msg, t);
fToolConflicts = new ITool[0][];
fNonManagedBuildTools = new ITool[0];
}
- ModificationStatus(Map<String, String> unsupportedRequiredProps,
- Map<String, String> unsupportedProps,
- Set<String> undefinedProps,
- ITool[][] conflicts,
- ITool nonMbsTools[]){
+ ModificationStatus(Map<String, String> unsupportedRequiredProps, Map<String, String> unsupportedProps,
+ Set<String> undefinedProps, ITool[][] conflicts, ITool nonMbsTools[]) {
super(IStatus.OK, ManagedBuilderCorePlugin.getUniqueIdentifier(), ""); //$NON-NLS-1$
int severity = IStatus.OK;
int flags = 0;
- if(unsupportedRequiredProps != null && unsupportedRequiredProps.size() != 0){
+ if (unsupportedRequiredProps != null && unsupportedRequiredProps.size() != 0) {
fUnsupportedRequiredProperties.putAll(unsupportedRequiredProps);
fUnsupportedProperties.putAll(unsupportedRequiredProps);
flags |= REQUIRED_PROPS_NOT_SUPPORTED | PROPS_NOT_DEFINED;
severity = IStatus.ERROR;
}
- if(unsupportedProps != null && unsupportedProps.size() != 0){
+ if (unsupportedProps != null && unsupportedProps.size() != 0) {
fUnsupportedProperties.putAll(unsupportedProps);
flags |= PROPS_NOT_SUPPORTED;
- if(severity == IStatus.OK)
+ if (severity == IStatus.OK)
severity = IStatus.WARNING;
}
- if(undefinedProps != null && undefinedProps.size() != 0){
+ if (undefinedProps != null && undefinedProps.size() != 0) {
fUndefinedProperties.addAll(undefinedProps);
flags |= PROPS_NOT_DEFINED;
- if(severity == IStatus.OK)
+ if (severity == IStatus.OK)
severity = IStatus.WARNING;
}
- if(conflicts != null && conflicts.length != 0){
+ if (conflicts != null && conflicts.length != 0) {
fToolConflicts = new ITool[conflicts.length][];
- for(int i = 0; i < conflicts.length; i++){
+ for (int i = 0; i < conflicts.length; i++) {
fToolConflicts[i] = conflicts[i].clone();
}
flags |= TOOLS_CONFLICT;
- if(severity == IStatus.OK)
+ if (severity == IStatus.OK)
severity = IStatus.WARNING;
} else {
fToolConflicts = new ITool[0][];
}
- if(nonMbsTools != null && nonMbsTools.length != 0){
+ if (nonMbsTools != null && nonMbsTools.length != 0) {
fNonManagedBuildTools = nonMbsTools.clone();
flags |= TOOLS_DONT_SUPPORT_MANAGED_BUILD;
severity = IStatus.ERROR;
@@ -97,11 +94,11 @@ public class ModificationStatus extends Status implements IModificationStatus {
fNonManagedBuildTools = new ITool[0];
}
- if(flags != 0){
+ if (flags != 0) {
setCode(flags);
}
- if(severity != IStatus.OK){
+ if (severity != IStatus.OK) {
setSeverity(severity);
}
@@ -109,33 +106,33 @@ public class ModificationStatus extends Status implements IModificationStatus {
@Override
@SuppressWarnings("unchecked")
- public Map<String, String> getUnsupportedProperties(){
- return (HashMap<String, String>)fUnsupportedProperties.clone();
+ 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();
+ public Map<String, String> getUnsupportedRequiredProperties() {
+ return (HashMap<String, String>) fUnsupportedRequiredProperties.clone();
}
@Override
@SuppressWarnings("unchecked")
- public Set<String> getUndefinedProperties(){
- return (HashSet<String>)fUndefinedProperties.clone();
+ public Set<String> getUndefinedProperties() {
+ return (HashSet<String>) fUndefinedProperties.clone();
}
@Override
- public ITool[][] getToolsConflicts(){
+ public ITool[][] getToolsConflicts() {
ITool[][] copy = new ITool[fToolConflicts.length][];
- for(int i = 0; i < fToolConflicts.length; i++){
+ for (int i = 0; i < fToolConflicts.length; i++) {
copy[i] = fToolConflicts[i].clone();
}
return copy;
}
@Override
- public ITool[] getNonManagedBuildTools(){
+ public ITool[] getNonManagedBuildTools() {
return fNonManagedBuildTools.clone();
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiConfiguration.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiConfiguration.java
index 3d9b40b406a..e46fa64c5b1 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiConfiguration.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/MultiConfiguration.java
@@ -57,8 +57,7 @@ import org.osgi.framework.Version;
* This class represents a set of configurations
* to be edited simultaneously on property pages.
*/
-public class MultiConfiguration extends MultiItemsHolder implements
- IMultiConfiguration {
+public class MultiConfiguration extends MultiItemsHolder implements IMultiConfiguration {
private static final String[] EMPTY_STR_ARRAY = new String[0];
protected IConfiguration[] fCfgs = null;
@@ -66,8 +65,8 @@ public class MultiConfiguration extends MultiItemsHolder implements
public MultiConfiguration(IConfiguration[] cfs) {
fCfgs = cfs;
- for (int i=0; i<fCfgs.length; i++)
- if (((Configuration)fCfgs[i]).getConfigurationDescription().isActive()) {
+ for (int i = 0; i < fCfgs.length; i++)
+ if (((Configuration) fCfgs[i]).getConfigurationDescription().isActive()) {
curr = i;
break;
}
@@ -79,12 +78,11 @@ public class MultiConfiguration extends MultiItemsHolder implements
public static IConfiguration[] cfds2cfs(ICConfigurationDescription[] cfgds) {
IConfiguration[] cfs = new IConfiguration[cfgds.length];
- for (int i=0; i<cfgds.length; i++)
+ for (int i = 0; i < cfgds.length; i++)
cfs[i] = ManagedBuildManager.getConfigurationForDescription(cfgds[i]);
return cfs;
}
-
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.MultiItemsHolder#getItems()
*/
@@ -114,7 +112,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public void changeBuilder(IBuilder newBuilder, String id, String name) {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
fCfgs[i].changeBuilder(newBuilder, id, name);
}
@@ -142,8 +140,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#createFileInfo(org.eclipse.core.runtime.IPath, org.eclipse.cdt.managedbuilder.core.IFolderInfo, org.eclipse.cdt.managedbuilder.core.ITool, java.lang.String, java.lang.String)
*/
@Override
- public IFileInfo createFileInfo(IPath path, IFolderInfo base,
- ITool baseTool, String id, String name) {
+ public IFileInfo createFileInfo(IPath path, IFolderInfo base, ITool baseTool, String id, String name) {
if (DEBUG)
System.out.println("Bad multi access: MultiConfiguration.createFileInfo(5)"); //$NON-NLS-1$
return null; // curr().createFileInfo(path, base, baseTool, id, name);
@@ -203,10 +200,9 @@ public class MultiConfiguration extends MultiItemsHolder implements
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#createToolChain(org.eclipse.cdt.managedbuilder.core.IToolChain, java.lang.String, java.lang.String, boolean)
*/
@Override
- public IToolChain createToolChain(IToolChain superClass, String Id,
- String name, boolean isExtensionElement) {
+ public IToolChain createToolChain(IToolChain superClass, String Id, String name, boolean isExtensionElement) {
if (DEBUG)
- System.out.println("Bad multi access: MultiConfiguration.createToolChain()"); //$NON-NLS-1$
+ System.out.println("Bad multi access: MultiConfiguration.createToolChain()"); //$NON-NLS-1$
return null; // do nothing
}
@@ -214,26 +210,13 @@ public class MultiConfiguration extends MultiItemsHolder implements
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#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)
*/
@Override
- public IManagedCommandLineInfo generateToolCommandLineInfo(
- String sourceExtension,
- String[] flags,
- String outputFlag,
- String outputPrefix,
- String outputName,
- String[] inputResources,
- IPath inputLocation,
+ public IManagedCommandLineInfo generateToolCommandLineInfo(String sourceExtension, String[] flags,
+ String outputFlag, String outputPrefix, String outputName, String[] inputResources, IPath inputLocation,
IPath outputLocation) {
if (DEBUG)
System.out.println("Strange multi access: MultiConfiguration.generateToolCommandLineInfo()"); //$NON-NLS-1$
- return curr().generateToolCommandLineInfo(
- sourceExtension,
- flags,
- outputFlag,
- outputPrefix,
- outputName,
- inputResources,
- inputLocation,
- outputLocation);
+ return curr().generateToolCommandLineInfo(sourceExtension, flags, outputFlag, outputPrefix, outputName,
+ inputResources, inputLocation, outputLocation);
}
/* (non-Javadoc)
@@ -242,15 +225,15 @@ public class MultiConfiguration extends MultiItemsHolder implements
@Override
public String getArtifactExtension() {
String s = fCfgs[0].getArtifactExtension();
- for (int i=1; i<fCfgs.length; i++)
- if (! s.equals(fCfgs[i].getArtifactExtension()))
+ for (int i = 1; i < fCfgs.length; i++)
+ if (!s.equals(fCfgs[i].getArtifactExtension()))
return EMPTY_STR;
return s;
}
public String[] getArtifactExtensions() {
String[] s = new String[fCfgs.length];
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
s[i] = fCfgs[i].getArtifactExtension();
return s;
}
@@ -261,14 +244,15 @@ public class MultiConfiguration extends MultiItemsHolder implements
@Override
public String getArtifactName() {
String s = fCfgs[0].getArtifactName();
- for (int i=1; i<fCfgs.length; i++)
- if (! s.equals(fCfgs[i].getArtifactName()))
+ for (int i = 1; i < fCfgs.length; i++)
+ if (!s.equals(fCfgs[i].getArtifactName()))
return EMPTY_STR;
return s;
}
+
public String[] getArtifactNames() {
String[] s = new String[fCfgs.length];
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
s[i] = fCfgs[i].getArtifactName();
return s;
}
@@ -301,8 +285,8 @@ public class MultiConfiguration extends MultiItemsHolder implements
IBuildPropertyValue b = fCfgs[0].getBuildArtefactType();
if (b == null)
return null;
- for (int i=1; i<fCfgs.length; i++)
- if (! b.equals(fCfgs[i].getBuildArtefactType()))
+ for (int i = 1; i < fCfgs.length; i++)
+ if (!b.equals(fCfgs[i].getBuildArtefactType()))
return null;
return b;
}
@@ -315,8 +299,8 @@ public class MultiConfiguration extends MultiItemsHolder implements
String s = fCfgs[0].getBuildCommand();
if (s == null || s.length() == 0)
return EMPTY_STR;
- for (int i=1; i<fCfgs.length; i++)
- if (! s.equals(fCfgs[i].getBuildCommand()))
+ for (int i = 1; i < fCfgs.length; i++)
+ if (!s.equals(fCfgs[i].getBuildCommand()))
return EMPTY_STR;
return s;
}
@@ -339,8 +323,8 @@ public class MultiConfiguration extends MultiItemsHolder implements
IConfigurationBuildMacroSupplier ms = fCfgs[0].getBuildMacroSupplier();
if (ms == null)
return null;
- for (int i=1; i<fCfgs.length; i++)
- if (! ms.equals(fCfgs[i].getBuildMacroSupplier()))
+ for (int i = 1; i < fCfgs.length; i++)
+ if (!ms.equals(fCfgs[i].getBuildMacroSupplier()))
return null;
return ms;
}
@@ -353,8 +337,8 @@ public class MultiConfiguration extends MultiItemsHolder implements
IBuilder b = fCfgs[0].getBuilder();
if (b == null)
return null;
- for (int i=1; i<fCfgs.length; i++)
- if (! b.matches(fCfgs[i].getBuilder()))
+ for (int i = 1; i < fCfgs.length; i++)
+ if (!b.matches(fCfgs[i].getBuilder()))
return null;
return b;
}
@@ -365,8 +349,8 @@ public class MultiConfiguration extends MultiItemsHolder implements
@Override
public String getCleanCommand() {
String s = fCfgs[0].getCleanCommand();
- for (int i=1; i<fCfgs.length; i++)
- if (! s.equals(fCfgs[i].getCleanCommand()))
+ for (int i = 1; i < fCfgs.length; i++)
+ if (!s.equals(fCfgs[i].getCleanCommand()))
return EMPTY_STR;
return s;
}
@@ -387,8 +371,8 @@ public class MultiConfiguration extends MultiItemsHolder implements
@Override
public String getDescription() {
String s = fCfgs[0].getDescription();
- for (int i=1; i<fCfgs.length; i++)
- if (! s.equals(fCfgs[i].getDescription()))
+ for (int i = 1; i < fCfgs.length; i++)
+ if (!s.equals(fCfgs[i].getDescription()))
return EMPTY_STR;
return s;
}
@@ -409,8 +393,8 @@ public class MultiConfiguration extends MultiItemsHolder implements
IConfigurationEnvironmentVariableSupplier vs = fCfgs[0].getEnvironmentVariableSupplier();
if (vs == null)
return null;
- for (int i=1; i<fCfgs.length; i++)
- if (! vs.equals(fCfgs[i].getEnvironmentVariableSupplier()))
+ for (int i = 1; i < fCfgs.length; i++)
+ if (!vs.equals(fCfgs[i].getEnvironmentVariableSupplier()))
return null;
return vs;
}
@@ -424,8 +408,8 @@ public class MultiConfiguration extends MultiItemsHolder implements
String s = fCfgs[0].getErrorParserIds();
if (s == null || s.length() == 0)
return EMPTY_STR;
- for (int i=1; i<fCfgs.length; i++)
- if (! s.equals(fCfgs[i].getErrorParserIds()))
+ for (int i = 1; i < fCfgs.length; i++)
+ if (!s.equals(fCfgs[i].getErrorParserIds()))
return EMPTY_STR;
return s;
}
@@ -438,15 +422,16 @@ public class MultiConfiguration extends MultiItemsHolder implements
String[] s = fCfgs[0].getErrorParserList();
if (s == null || s.length == 0)
return EMPTY_STR_ARRAY;
- for (int i=1; i<fCfgs.length; i++)
- if (! Arrays.equals(s, fCfgs[i].getErrorParserList()))
+ for (int i = 1; i < fCfgs.length; i++)
+ if (!Arrays.equals(s, fCfgs[i].getErrorParserList()))
return EMPTY_STR_ARRAY;
return s;
}
@Override
public String[] getDefaultLanguageSettingsProviderIds() {
- ManagedBuilderCorePlugin.error("Default Language Settings Providers are not supported in multiconfiguration mode"); //$NON-NLS-1$
+ ManagedBuilderCorePlugin
+ .error("Default Language Settings Providers are not supported in multiconfiguration mode"); //$NON-NLS-1$
return null;
}
@@ -467,8 +452,8 @@ public class MultiConfiguration extends MultiItemsHolder implements
String[] s = fCfgs[0].getLibs(extension);
if (s == null || s.length == 0)
return EMPTY_STR_ARRAY;
- for (int i=1; i<fCfgs.length; i++)
- if (! Arrays.equals(s, fCfgs[i].getLibs(extension)))
+ for (int i = 1; i < fCfgs.length; i++)
+ if (!Arrays.equals(s, fCfgs[i].getLibs(extension)))
return EMPTY_STR_ARRAY;
return s;
}
@@ -481,8 +466,8 @@ public class MultiConfiguration extends MultiItemsHolder implements
IManagedProject s = fCfgs[0].getManagedProject();
if (s == null)
return null;
- for (int i=1; i<fCfgs.length; i++)
- if (! s.equals(fCfgs[i].getManagedProject()))
+ for (int i = 1; i < fCfgs.length; i++)
+ if (!s.equals(fCfgs[i].getManagedProject()))
return null;
return s;
}
@@ -495,8 +480,8 @@ public class MultiConfiguration extends MultiItemsHolder implements
String s = fCfgs[0].getOutputExtension(resourceExtension);
if (s == null || s.length() == 0)
return EMPTY_STR;
- for (int i=1; i<fCfgs.length; i++)
- if (! s.equals(fCfgs[i].getOutputExtension(resourceExtension)))
+ for (int i = 1; i < fCfgs.length; i++)
+ if (!s.equals(fCfgs[i].getOutputExtension(resourceExtension)))
return EMPTY_STR;
return s;
}
@@ -509,8 +494,8 @@ public class MultiConfiguration extends MultiItemsHolder implements
String s = fCfgs[0].getOutputFlag(outputExt);
if (s == null || s.length() == 0)
return EMPTY_STR;
- for (int i=1; i<fCfgs.length; i++)
- if (! s.equals(fCfgs[i].getOutputFlag(outputExt)))
+ for (int i = 1; i < fCfgs.length; i++)
+ if (!s.equals(fCfgs[i].getOutputFlag(outputExt)))
return EMPTY_STR;
return s;
}
@@ -523,8 +508,8 @@ public class MultiConfiguration extends MultiItemsHolder implements
String s = fCfgs[0].getOutputPrefix(outputExtension);
if (s == null || s.length() == 0)
return EMPTY_STR;
- for (int i=1; i<fCfgs.length; i++)
- if (! s.equals(fCfgs[i].getOutputPrefix(outputExtension)))
+ for (int i = 1; i < fCfgs.length; i++)
+ if (!s.equals(fCfgs[i].getOutputPrefix(outputExtension)))
return EMPTY_STR;
return s;
}
@@ -537,8 +522,8 @@ public class MultiConfiguration extends MultiItemsHolder implements
IResource s = fCfgs[0].getOwner();
if (s == null)
return null;
- for (int i=1; i<fCfgs.length; i++)
- if (! s.equals(fCfgs[i].getOwner()))
+ for (int i = 1; i < fCfgs.length; i++)
+ if (!s.equals(fCfgs[i].getOwner()))
return null;
return s;
}
@@ -561,8 +546,8 @@ public class MultiConfiguration extends MultiItemsHolder implements
String s = fCfgs[0].getPostannouncebuildStep();
if (s == null || s.length() == 0)
return EMPTY_STR;
- for (int i=1; i<fCfgs.length; i++)
- if (! s.equals(fCfgs[i].getPostannouncebuildStep()))
+ for (int i = 1; i < fCfgs.length; i++)
+ if (!s.equals(fCfgs[i].getPostannouncebuildStep()))
return EMPTY_STR;
return s;
}
@@ -575,8 +560,8 @@ public class MultiConfiguration extends MultiItemsHolder implements
String s = fCfgs[0].getPostbuildStep();
if (s == null || s.length() == 0)
return EMPTY_STR;
- for (int i=1; i<fCfgs.length; i++)
- if (! s.equals(fCfgs[i].getPostbuildStep()))
+ for (int i = 1; i < fCfgs.length; i++)
+ if (!s.equals(fCfgs[i].getPostbuildStep()))
return EMPTY_STR;
return s;
}
@@ -589,8 +574,8 @@ public class MultiConfiguration extends MultiItemsHolder implements
String s = fCfgs[0].getPreannouncebuildStep();
if (s == null || s.length() == 0)
return EMPTY_STR;
- for (int i=1; i<fCfgs.length; i++)
- if (! s.equals(fCfgs[i].getPreannouncebuildStep()))
+ for (int i = 1; i < fCfgs.length; i++)
+ if (!s.equals(fCfgs[i].getPreannouncebuildStep()))
return EMPTY_STR;
return s;
}
@@ -603,8 +588,8 @@ public class MultiConfiguration extends MultiItemsHolder implements
String s = fCfgs[0].getPrebuildStep();
if (s == null || s.length() == 0)
return EMPTY_STR;
- for (int i=1; i<fCfgs.length; i++)
- if (! s.equals(fCfgs[i].getPrebuildStep()))
+ for (int i = 1; i < fCfgs.length; i++)
+ if (!s.equals(fCfgs[i].getPrebuildStep()))
return EMPTY_STR;
return s;
}
@@ -646,9 +631,9 @@ public class MultiConfiguration extends MultiItemsHolder implements
public IResourceInfo getResourceInfo(IPath path, boolean exactPath) {
IResourceInfo ris[] = new IResourceInfo[fCfgs.length];
boolean isFolder = true;
- for (int i=0; i<fCfgs.length; i++) {
+ for (int i = 0; i < fCfgs.length; i++) {
ris[i] = fCfgs[i].getResourceInfo(path, exactPath);
- if (! (ris[i] instanceof IFolderInfo))
+ if (!(ris[i] instanceof IFolderInfo))
isFolder = false;
}
if (isFolder) {
@@ -675,7 +660,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
@Override
public IResourceInfo[] getResourceInfos() {
ArrayList<IResourceInfo> ri = new ArrayList<IResourceInfo>();
- for (int i=0; i<fCfgs.length; i++) {
+ for (int i = 0; i < fCfgs.length; i++) {
IResourceInfo[] ris = fCfgs[i].getResourceInfos();
ri.addAll(Arrays.asList(ris));
}
@@ -688,7 +673,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
@Override
public IFolderInfo getRootFolderInfo() {
IFolderInfo ris[] = new IFolderInfo[fCfgs.length];
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
ris[i] = fCfgs[i].getRootFolderInfo();
return new MultiFolderInfo(ris, this);
}
@@ -794,7 +779,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public boolean hasOverriddenBuildCommand() {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
if (fCfgs[i].hasOverriddenBuildCommand())
return true;
return false;
@@ -805,8 +790,8 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public boolean isBuilderCompatible(IBuilder builder) {
- for (int i=0; i<fCfgs.length; i++)
- if (! fCfgs[i].isBuilderCompatible(builder))
+ for (int i = 0; i < fCfgs.length; i++)
+ if (!fCfgs[i].isBuilderCompatible(builder))
return false;
return true;
}
@@ -816,7 +801,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public boolean isDirty() {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
if (fCfgs[i].isDirty())
return true;
return false;
@@ -847,15 +832,15 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public boolean isManagedBuildOn() {
- for (int i=0; i<fCfgs.length; i++)
- if (! fCfgs[i].isManagedBuildOn())
+ for (int i = 0; i < fCfgs.length; i++)
+ if (!fCfgs[i].isManagedBuildOn())
return false;
return true;
}
public boolean[] isManagedBuildOnMulti() {
boolean[] b = new boolean[fCfgs.length];
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
b[i] = fCfgs[i].isManagedBuildOn();
return b;
}
@@ -865,7 +850,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public boolean isSupported() {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
if (fCfgs[i].isSupported())
return true;
return false;
@@ -876,8 +861,8 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public boolean isSystemObject() {
- for (int i=0; i<fCfgs.length; i++)
- if (! fCfgs[i].isSystemObject())
+ for (int i = 0; i < fCfgs.length; i++)
+ if (!fCfgs[i].isSystemObject())
return false;
return true;
}
@@ -887,8 +872,8 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public boolean isTemporary() {
- for (int i=0; i<fCfgs.length; i++)
- if (! fCfgs[i].isTemporary())
+ for (int i = 0; i < fCfgs.length; i++)
+ if (!fCfgs[i].isTemporary())
return false;
return true;
}
@@ -898,7 +883,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public boolean needsFullRebuild() {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
if (fCfgs[i].needsFullRebuild())
return true;
return false;
@@ -909,7 +894,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public boolean needsRebuild() {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
if (fCfgs[i].needsRebuild())
return true;
return false;
@@ -920,7 +905,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public void removeResourceConfiguration(IResourceInfo resConfig) {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
fCfgs[i].removeResourceConfiguration(resConfig);
}
@@ -929,7 +914,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public void removeResourceInfo(IPath path) {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
fCfgs[i].removeResourceInfo(path);
}
@@ -938,7 +923,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public void setArtifactExtension(String extension) {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
fCfgs[i].setArtifactExtension(extension);
}
@@ -947,7 +932,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public void setArtifactName(String name) {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
fCfgs[i].setArtifactName(name);
}
@@ -956,7 +941,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public void setBuildArguments(String makeArgs) {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
fCfgs[i].setBuildArguments(makeArgs);
}
@@ -965,7 +950,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public void setBuildArtefactType(String id) throws BuildException {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
fCfgs[i].setBuildArtefactType(id);
}
@@ -974,7 +959,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public void setBuildCommand(String command) {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
fCfgs[i].setBuildCommand(command);
}
@@ -983,7 +968,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public void setCleanCommand(String command) {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
fCfgs[i].setCleanCommand(command);
}
@@ -992,7 +977,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public void setDescription(String description) {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
fCfgs[i].setDescription(description);
}
@@ -1001,7 +986,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public void setDirty(boolean isDirty) {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
fCfgs[i].setDirty(isDirty);
}
@@ -1010,7 +995,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public void setErrorParserIds(String ids) {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
fCfgs[i].setErrorParserIds(ids);
}
@@ -1019,7 +1004,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public void setErrorParserList(String[] ids) {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
fCfgs[i].setErrorParserList(ids);
}
@@ -1028,7 +1013,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public void setManagedBuildOn(boolean on) throws BuildException {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
fCfgs[i].setManagedBuildOn(on);
}
@@ -1036,17 +1021,17 @@ public class MultiConfiguration extends MultiItemsHolder implements
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setName(java.lang.String)
*/
@Override
- public void setName(String name) {} // do nothing
+ public void setName(String name) {
+ } // do nothing
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#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 {
+ public IOption setOption(IHoldsOptions parent, IOption option, boolean value) throws BuildException {
IOption op = null;
- for (int i=0; i<fCfgs.length; i++)
- op = fCfgs[i].setOption(parent, option, value);
+ for (int i = 0; i < fCfgs.length; i++)
+ op = fCfgs[i].setOption(parent, option, value);
return op;
}
@@ -1054,11 +1039,10 @@ public class MultiConfiguration extends MultiItemsHolder implements
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#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 {
+ public IOption setOption(IHoldsOptions parent, IOption option, String value) throws BuildException {
IOption op = null;
- for (int i=0; i<fCfgs.length; i++)
- op = fCfgs[i].setOption(parent, option, value);
+ for (int i = 0; i < fCfgs.length; i++)
+ op = fCfgs[i].setOption(parent, option, value);
return op;
}
@@ -1066,11 +1050,10 @@ public class MultiConfiguration extends MultiItemsHolder implements
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#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 {
+ public IOption setOption(IHoldsOptions parent, IOption option, String[] value) throws BuildException {
IOption op = null;
- for (int i=0; i<fCfgs.length; i++)
- op = fCfgs[i].setOption(parent, option, value);
+ for (int i = 0; i < fCfgs.length; i++)
+ op = fCfgs[i].setOption(parent, option, value);
return op;
}
@@ -1079,7 +1062,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public void setPostannouncebuildStep(String announceStep) {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
fCfgs[i].setPostannouncebuildStep(announceStep);
}
@@ -1088,7 +1071,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public void setPostbuildStep(String step) {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
fCfgs[i].setPostbuildStep(step);
}
@@ -1097,7 +1080,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public void setPreannouncebuildStep(String announceStep) {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
fCfgs[i].setPreannouncebuildStep(announceStep);
}
@@ -1106,7 +1089,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public void setPrebuildStep(String step) {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
fCfgs[i].setPrebuildStep(step);
}
@@ -1115,7 +1098,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public void setRebuildState(boolean rebuild) {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
fCfgs[i].setRebuildState(rebuild);
}
@@ -1124,7 +1107,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public void setSourceEntries(ICSourceEntry[] entries) {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
fCfgs[i].setSourceEntries(entries);
}
@@ -1133,7 +1116,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public void setToolCommand(ITool tool, String command) {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
fCfgs[i].setToolCommand(tool, command);
}
@@ -1142,8 +1125,8 @@ public class MultiConfiguration extends MultiItemsHolder implements
*/
@Override
public boolean supportsBuild(boolean managed) {
- for (int i=0; i<fCfgs.length; i++)
- if (! fCfgs[i].supportsBuild(managed))
+ for (int i = 0; i < fCfgs.length; i++)
+ if (!fCfgs[i].supportsBuild(managed))
return false;
return true;
}
@@ -1198,7 +1181,8 @@ public class MultiConfiguration extends MultiItemsHolder implements
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#setVersion(org.eclipse.core.runtime.PluginVersionIdentifier)
*/
@Override
- public void setVersion(Version version) {} // do nothing
+ public void setVersion(Version version) {
+ } // do nothing
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IBuildObjectPropertiesContainer#getBuildProperties()
@@ -1220,7 +1204,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
public boolean getParallelDef() {
for (IConfiguration cfg : fCfgs) {
if (cfg instanceof Configuration) {
- if (!((Configuration)cfg).getParallelDef())
+ if (!((Configuration) cfg).getParallelDef())
return false;
} else
return false;
@@ -1232,7 +1216,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
public void setParallelDef(boolean parallel) {
for (IConfiguration cfg : fCfgs) {
if (cfg instanceof Configuration)
- ((Configuration)cfg).setParallelDef(parallel);
+ ((Configuration) cfg).setParallelDef(parallel);
}
}
@@ -1241,7 +1225,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
int res = 0;
for (IConfiguration cfg : fCfgs) {
if (cfg instanceof Configuration) {
- int num = ((Configuration)cfg).getParallelNumber();
+ int num = ((Configuration) cfg).getParallelNumber();
Assert.isTrue(num != 0); // can't be 0, see IMakeCommonBuildInfo.getParallelizationNum()
if (res == 0)
@@ -1258,7 +1242,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
public void setParallelNumber(int num) {
for (IConfiguration cfg : fCfgs) {
if (cfg instanceof Configuration)
- ((Configuration)cfg).setParallelNumber(num);
+ ((Configuration) cfg).setParallelNumber(num);
}
}
@@ -1269,9 +1253,9 @@ public class MultiConfiguration extends MultiItemsHolder implements
@Override
public boolean isInternalBuilderEnabled() {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
if (fCfgs[i] instanceof Configuration) {
- if (!((Configuration)fCfgs[i]).isInternalBuilderEnabled())
+ if (!((Configuration) fCfgs[i]).isInternalBuilderEnabled())
return false;
} else
return false;
@@ -1280,9 +1264,9 @@ public class MultiConfiguration extends MultiItemsHolder implements
@Override
public boolean canEnableInternalBuilder(boolean v) {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
if (fCfgs[i] instanceof Configuration) {
- if (!((Configuration)fCfgs[i]).canEnableInternalBuilder(v))
+ if (!((Configuration) fCfgs[i]).canEnableInternalBuilder(v))
return false;
} else
return false;
@@ -1291,9 +1275,9 @@ public class MultiConfiguration extends MultiItemsHolder implements
@Override
public void enableInternalBuilder(boolean v) {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
if (fCfgs[i] instanceof Configuration)
- ((Configuration)fCfgs[i]).enableInternalBuilder(v);
+ ((Configuration) fCfgs[i]).enableInternalBuilder(v);
}
/**
@@ -1308,27 +1292,25 @@ public class MultiConfiguration extends MultiItemsHolder implements
String s = fCfgs[0].calculateTargetTool().getOutputPrefix();
if (s == null || s.length() == 0)
return EMPTY_STR;
- for (int i=1; i<fCfgs.length; i++)
- if (! s.equals(fCfgs[i].calculateTargetTool().getOutputPrefix()))
+ for (int i = 1; i < fCfgs.length; i++)
+ if (!s.equals(fCfgs[i].calculateTargetTool().getOutputPrefix()))
return EMPTY_STR;
return s;
}
@Override
public void setOutputPrefixForPrimaryOutput(String pref) {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
fCfgs[i].calculateTargetTool().setOutputPrefixForPrimaryOutput(pref);
}
@Override
public IBuildProperty getBuildProperty(String id) {
IBuildProperty b = fCfgs[0].getBuildProperties().getProperty(id);
- if (b == null )
+ if (b == null)
return null;
- for (int i=1; i<fCfgs.length; i++)
- if (! b.getValue().getId().equals(
- fCfgs[i].getBuildProperties().getProperty(id).getValue().getId())
- )
+ for (int i = 1; i < fCfgs.length; i++)
+ if (!b.getValue().getId().equals(fCfgs[i].getBuildProperties().getProperty(id).getValue().getId()))
return null;
return b;
}
@@ -1340,13 +1322,13 @@ public class MultiConfiguration extends MultiItemsHolder implements
if (a == null || a.length == 0)
return new IBuildPropertyValue[0];
int cnt = a.length;
- for (int i=1; i<fCfgs.length; i++) {
+ for (int i = 1; i < fCfgs.length; i++) {
IBuildPropertyValue[] b = fCfgs[i].getBuildProperties().getSupportedValues(id);
- for (int x=0; x<a.length; x++) {
+ for (int x = 0; x < a.length; x++) {
if (a[x] == null)
continue;
boolean found = false;
- for (int y=0; y<b.length; y++) {
+ for (int y = 0; y < b.length; y++) {
if (a[x].equals(b[y])) {
found = true;
break;
@@ -1361,7 +1343,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
if (cnt > 0) {
IBuildPropertyValue[] b = new IBuildPropertyValue[cnt];
int pos = 0;
- for (int x=0; x<a.length && pos < cnt; x++) {
+ for (int x = 0; x < a.length && pos < cnt; x++) {
if (a[x] != null)
b[pos++] = a[x];
}
@@ -1374,7 +1356,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
@Override
public void setBuildProperty(String id, String val) {
try {
- for (int i=0; i<fCfgs.length; i++)
+ for (int i = 0; i < fCfgs.length; i++)
fCfgs[i].getBuildProperties().setProperty(id, val);
} catch (CoreException e) {
ManagedBuilderCorePlugin.log(e);
@@ -1386,10 +1368,10 @@ public class MultiConfiguration extends MultiItemsHolder implements
IBuilder b = fCfgs[0].getBuilder();
if (b != null)
res = b.getBuildAttribute(name, defValue);
- for (int i=1; i<fCfgs.length; i++) {
+ for (int i = 1; i < fCfgs.length; i++) {
b = fCfgs[i].getBuilder();
if (b != null)
- if (! res.equals(b.getBuildAttribute(name, defValue)))
+ if (!res.equals(b.getBuildAttribute(name, defValue)))
return defValue;
}
return res;
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 c9a4db4eaf4..de509d8ab8b 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
@@ -35,19 +35,18 @@ public class MultiFileInfo extends MultiResourceInfo implements IFileInfo {
*/
@Override
public CFileData getFileData() {
- return ((IFileInfo)fRis[curr]).getFileData();
+ return ((IFileInfo) fRis[curr]).getFileData();
}
/* (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) {
+ public ITool createTool(ITool superClass, String Id, String name, boolean isExtensionElement) {
ITool t = null;
for (IResourceInfo ri : fRis) {
if (ri instanceof IFileInfo) {
- IFileInfo fi = (IFileInfo)ri;
+ IFileInfo fi = (IFileInfo) ri;
t = fi.createTool(superClass, Id, name, isExtensionElement);
}
}
@@ -59,7 +58,7 @@ public class MultiFileInfo extends MultiResourceInfo implements IFileInfo {
*/
@Override
public IResource getOwner() {
- return ((IFileInfo)fRis[curr]).getOwner();
+ return ((IFileInfo) fRis[curr]).getOwner();
}
/* (non-Javadoc)
@@ -67,7 +66,7 @@ public class MultiFileInfo extends MultiResourceInfo implements IFileInfo {
*/
@Override
public int getRcbsApplicability() {
- return ((IFileInfo)fRis[curr]).getRcbsApplicability();
+ return ((IFileInfo) fRis[curr]).getRcbsApplicability();
}
/* (non-Javadoc)
@@ -75,7 +74,7 @@ public class MultiFileInfo extends MultiResourceInfo implements IFileInfo {
*/
@Override
public String getResourcePath() {
- return ((IFileInfo)fRis[curr]).getResourcePath();
+ return ((IFileInfo) fRis[curr]).getResourcePath();
}
/* (non-Javadoc)
@@ -83,7 +82,7 @@ public class MultiFileInfo extends MultiResourceInfo implements IFileInfo {
*/
@Override
public ITool getTool(String id) {
- return ((IFileInfo)fRis[curr]).getTool(id);
+ return ((IFileInfo) fRis[curr]).getTool(id);
}
/* (non-Javadoc)
@@ -91,7 +90,7 @@ public class MultiFileInfo extends MultiResourceInfo implements IFileInfo {
*/
@Override
public ITool[] getToolsToInvoke() {
- return ((IFileInfo)fRis[curr]).getToolsToInvoke();
+ return ((IFileInfo) fRis[curr]).getToolsToInvoke();
}
/* (non-Javadoc)
@@ -102,7 +101,7 @@ public class MultiFileInfo extends MultiResourceInfo implements IFileInfo {
System.out.println("MultiFileInfo.removeTool() does not work OK !"); //$NON-NLS-1$
for (IResourceInfo ri : fRis) {
if (ri instanceof IFileInfo) {
- IFileInfo fi = (IFileInfo)ri;
+ IFileInfo fi = (IFileInfo) ri;
fi.removeTool(tool);
}
}
@@ -115,7 +114,7 @@ public class MultiFileInfo extends MultiResourceInfo implements IFileInfo {
public void setRcbsApplicability(int value) {
for (IResourceInfo ri : fRis) {
if (ri instanceof IFileInfo) {
- IFileInfo fi = (IFileInfo)ri;
+ IFileInfo fi = (IFileInfo) ri;
fi.setRcbsApplicability(value);
}
}
@@ -128,7 +127,7 @@ public class MultiFileInfo extends MultiResourceInfo implements IFileInfo {
public void setResourcePath(String path) {
for (IResourceInfo ri : fRis) {
if (ri instanceof IFileInfo) {
- IFileInfo fi = (IFileInfo)ri;
+ IFileInfo fi = (IFileInfo) ri;
fi.setResourcePath(path);
}
}
@@ -142,7 +141,7 @@ public class MultiFileInfo extends MultiResourceInfo implements IFileInfo {
System.out.println("MultiFileInfo.setToolCommand() does not work OK !"); //$NON-NLS-1$
for (IResourceInfo ri : fRis) {
if (ri instanceof IFileInfo) {
- IFileInfo fi = (IFileInfo)ri;
+ IFileInfo fi = (IFileInfo) ri;
fi.setToolCommand(tool, command);
}
}
@@ -155,7 +154,7 @@ public class MultiFileInfo extends MultiResourceInfo implements IFileInfo {
public void setTools(ITool[] tools) {
for (IResourceInfo ri : fRis) {
if (ri instanceof IFileInfo) {
- IFileInfo fi = (IFileInfo)ri;
+ IFileInfo fi = (IFileInfo) ri;
fi.setTools(tools);
}
}
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 7459f5c9c79..afddd1a64e9 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
@@ -36,81 +36,78 @@ public class MultiFolderInfo extends MultiResourceInfo implements IFolderInfo {
@Override
public boolean buildsFileType(String srcExt) {
- for (int i=0; i<fRis.length; i++)
- if (! ((IFolderInfo)fRis[i]).buildsFileType(srcExt))
+ for (int i = 0; i < fRis.length; i++)
+ if (!((IFolderInfo) fRis[i]).buildsFileType(srcExt))
return false;
return true;
}
@Override
- public IToolChain changeToolChain(IToolChain newSuperClass, String Id,
- String name) throws BuildException {
+ public IToolChain changeToolChain(IToolChain newSuperClass, String Id, String name) throws BuildException {
IToolChain t = null;
- for (int i=0; i<fRis.length; i++)
- t = ((IFolderInfo)fRis[i]).changeToolChain(newSuperClass, Id, name);
+ for (int i = 0; i < fRis.length; i++)
+ t = ((IFolderInfo) fRis[i]).changeToolChain(newSuperClass, Id, name);
return t;
}
@Override
public ITool[] getFilteredTools() {
- return ((IFolderInfo)fRis[curr]).getFilteredTools();
+ return ((IFolderInfo) fRis[curr]).getFilteredTools();
}
@Override
public CFolderData getFolderData() {
- return ((IFolderInfo)fRis[curr]).getFolderData();
+ return ((IFolderInfo) fRis[curr]).getFolderData();
}
@Override
public String getOutputExtension(String resourceExtension) {
- return ((IFolderInfo)fRis[curr]).getOutputExtension(resourceExtension);
+ return ((IFolderInfo) fRis[curr]).getOutputExtension(resourceExtension);
}
@Override
public ITool getTool(String id) {
- return ((IFolderInfo)fRis[curr]).getTool(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);
+ public IModificationStatus getToolChainModificationStatus(ITool[] removed, ITool[] added) {
+ return ((IFolderInfo) fRis[curr]).getToolChainModificationStatus(removed, added);
}
@Override
public ITool getToolFromInputExtension(String sourceExtension) {
- return ((IFolderInfo)fRis[curr]).getToolFromInputExtension(sourceExtension);
+ return ((IFolderInfo) fRis[curr]).getToolFromInputExtension(sourceExtension);
}
@Override
public ITool getToolFromOutputExtension(String extension) {
- return ((IFolderInfo)fRis[curr]).getToolFromOutputExtension(extension);
+ return ((IFolderInfo) fRis[curr]).getToolFromOutputExtension(extension);
}
@Override
public ITool[] getToolsBySuperClassId(String id) {
- return ((IFolderInfo)fRis[curr]).getToolsBySuperClassId(id);
+ return ((IFolderInfo) fRis[curr]).getToolsBySuperClassId(id);
}
@Override
public boolean isHeaderFile(String ext) {
- return ((IFolderInfo)fRis[curr]).isHeaderFile(ext);
+ return ((IFolderInfo) fRis[curr]).isHeaderFile(ext);
}
@Override
public boolean isToolChainCompatible(IToolChain ch) {
- return ((IFolderInfo)fRis[curr]).isToolChainCompatible(ch);
+ return ((IFolderInfo) fRis[curr]).isToolChainCompatible(ch);
}
@Override
- public void modifyToolChain(ITool[] removed, ITool[] added)
- throws BuildException {
- ((IFolderInfo)fRis[curr]).modifyToolChain(removed, added);
+ 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 89ad7a1debe..6f06b902b8a 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
@@ -33,14 +33,13 @@ import org.osgi.framework.Version;
* belonging to different configurations while they are
* edited simultaneously.
*/
-public abstract class MultiResourceInfo extends MultiItemsHolder implements
- IResourceInfo {
+public abstract class MultiResourceInfo extends MultiItemsHolder implements IResourceInfo {
private static final int MODE_BOOL = 0;
- private static final int MODE_STR = 1;
- private static final int MODE_SAR = 2;
- private static final int MODE_OSV = 3;
- private static final int MODE_CMDLINE = 4;
- private static final int MODE_COMMAND = 5;
+ private static final int MODE_STR = 1;
+ private static final int MODE_SAR = 2;
+ 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;
@@ -49,10 +48,10 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
public MultiResourceInfo(IResourceInfo[] ris, IConfiguration _parent) {
fRis = ris;
parent = _parent;
- for (int i=0; i<fRis.length; i++) {
- if (! (fRis[i].getParent() instanceof Configuration))
+ for (int i = 0; i < fRis.length; i++) {
+ if (!(fRis[i].getParent() instanceof Configuration))
continue;
- Configuration cfg = (Configuration)fRis[i].getParent();
+ Configuration cfg = (Configuration) fRis[i].getParent();
if (cfg.getConfigurationDescription().isActive()) {
curr = i;
break;
@@ -65,8 +64,8 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
*/
@Override
public boolean canExclude(boolean exclude) {
- for (int i=0; i<fRis.length; i++)
- if (! fRis[i].canExclude(exclude))
+ for (int i = 0; i < fRis.length; i++)
+ if (!fRis[i].canExclude(exclude))
return false;
return true;
}
@@ -126,7 +125,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
*/
@Override
public boolean isDirty() {
- for (int i=0; i<fRis.length; i++)
+ for (int i = 0; i < fRis.length; i++)
if (fRis[i].isDirty())
return true;
return false;
@@ -137,7 +136,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
*/
@Override
public boolean isExcluded() {
- for (int i=0; i<fRis.length; i++)
+ for (int i = 0; i < fRis.length; i++)
if (fRis[i].isExcluded())
return true;
return false;
@@ -148,7 +147,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
*/
@Override
public boolean isExtensionElement() {
- for (int i=0; i<fRis.length; i++)
+ for (int i = 0; i < fRis.length; i++)
if (fRis[i].isExtensionElement())
return true;
return false;
@@ -159,7 +158,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
*/
@Override
public boolean isSupported() {
- for (int i=0; i<fRis.length; i++)
+ for (int i = 0; i < fRis.length; i++)
if (fRis[i].isSupported())
return true;
return false;
@@ -170,7 +169,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
*/
@Override
public boolean isValid() {
- for (int i=0; i<fRis.length; i++)
+ for (int i = 0; i < fRis.length; i++)
if (!fRis[i].isValid())
return false;
return true;
@@ -181,7 +180,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
*/
@Override
public boolean needsRebuild() {
- for (int i=0; i<fRis.length; i++)
+ for (int i = 0; i < fRis.length; i++)
if (fRis[i].needsRebuild())
return true;
return false;
@@ -192,7 +191,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
*/
@Override
public void setDirty(boolean dirty) {
- for (int i=0; i<fRis.length; i++)
+ for (int i = 0; i < fRis.length; i++)
fRis[i].setDirty(dirty);
}
@@ -201,14 +200,14 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
*/
@Override
public void setExclude(boolean excluded) {
- for (int i=0; i<fRis.length; i++)
+ for (int i = 0; i < fRis.length; i++)
fRis[i].setExclude(excluded);
}
private String getSuperClassId(IOption op) {
String s = null;
- while (op != null){
- s = op.getId();
+ while (op != null) {
+ s = op.getId();
op = op.getSuperClass();
}
return s;
@@ -224,11 +223,10 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
private void setTool(ITool tool, String s, int mode) {
String ext = tool.getDefaultInputExtension();
- for (int i=0; i<fRis.length; i++) {
+ for (int i = 0; i < fRis.length; i++) {
ITool[] ts = fRis[i].getTools();
- for (int j=0; j<ts.length; j++) {
- if (ext != null &&
- ! ext.equals(ts[j].getDefaultInputExtension()))
+ for (int j = 0; j < ts.length; j++) {
+ if (ext != null && !ext.equals(ts[j].getDefaultInputExtension()))
continue;
switch (mode) {
case MODE_COMMAND:
@@ -242,40 +240,39 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
}
}
- private IOption setOption(IHoldsOptions parent, IOption option, Object value, int mode)
- throws BuildException {
+ 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 ext = parent instanceof ITool ? ((ITool) parent).getDefaultInputExtension() : null;
String sid = getSuperClassId(option);
- for (int i=0; i<fRis.length; i++) {
+ for (int i = 0; i < fRis.length; i++) {
IHoldsOptions[] hos;
if (parent instanceof ITool)
hos = fRis[i].getTools();
else if (parent instanceof IToolChain)
// If parent is an IToolChain then the resource infos must be at folder level
- hos = new IHoldsOptions[] {((IFolderInfo)fRis[i]).getToolChain()};
+ hos = new IHoldsOptions[] { ((IFolderInfo) fRis[i]).getToolChain() };
else // Shouldn't happen
- throw new BuildException(ManagedMakeMessages.getString("MultiResourceInfo.MultiResourceInfo.UnhandledIHoldsOptionsType")); //$NON-NLS-1$
+ throw new BuildException(ManagedMakeMessages
+ .getString("MultiResourceInfo.MultiResourceInfo.UnhandledIHoldsOptionsType")); //$NON-NLS-1$
- for (int j=0; j<hos.length; j++) {
- if (ext != null &&
- ! ext.equals(((ITool)hos[j]).getDefaultInputExtension()))
+ for (int j = 0; j < hos.length; j++) {
+ if (ext != null && !ext.equals(((ITool) hos[j]).getDefaultInputExtension()))
continue;
IOption op2 = hos[j].getOptionBySuperClassId(sid);
if (op2 != null) {
switch (mode) {
case MODE_BOOL:
- op = fRis[i].setOption(hos[j], op2, ((Boolean)value).booleanValue());
+ op = fRis[i].setOption(hos[j], op2, ((Boolean) value).booleanValue());
break;
case MODE_STR:
- op = fRis[i].setOption(hos[j], op2, (String)value);
+ op = fRis[i].setOption(hos[j], op2, (String) value);
break;
case MODE_SAR:
- op = fRis[i].setOption(hos[j], op2, (String[])value);
+ op = fRis[i].setOption(hos[j], op2, (String[]) value);
break;
case MODE_OSV:
- op = fRis[i].setOption(hos[j], op2, (OptionStringValue[])value);
+ op = fRis[i].setOption(hos[j], op2, (OptionStringValue[]) value);
break;
}
}
@@ -288,8 +285,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
* @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 {
+ public IOption setOption(IHoldsOptions parent, IOption option, boolean value) throws BuildException {
return setOption(parent, option, Boolean.valueOf(value), MODE_BOOL);
}
@@ -297,8 +293,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
* @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 {
+ public IOption setOption(IHoldsOptions parent, IOption option, String value) throws BuildException {
return setOption(parent, option, value, MODE_STR);
}
@@ -306,8 +301,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
* @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 {
+ public IOption setOption(IHoldsOptions parent, IOption option, String[] value) throws BuildException {
return setOption(parent, option, value, MODE_SAR);
}
@@ -315,8 +309,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
* @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 {
+ public IOption setOption(IHoldsOptions parent, IOption option, OptionStringValue[] value) throws BuildException {
return setOption(parent, option, value, MODE_OSV);
}
@@ -325,7 +318,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
*/
@Override
public void setPath(IPath path) {
- for (int i=0; i<fRis.length; i++)
+ for (int i = 0; i < fRis.length; i++)
fRis[i].setPath(path);
}
@@ -334,7 +327,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
*/
@Override
public void setRebuildState(boolean rebuild) {
- for (int i=0; i<fRis.length; i++)
+ for (int i = 0; i < fRis.length; i++)
fRis[i].setRebuildState(rebuild);
}
@@ -391,7 +384,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
*/
@Override
public void setVersion(Version version) {
- for (int i=0; i<fRis.length; i++)
+ for (int i = 0; i < fRis.length; i++)
fRis[i].setVersion(version);
}
@@ -401,7 +394,7 @@ public abstract class MultiResourceInfo extends MultiItemsHolder implements
}
public boolean isRoot() {
- return ((ResourceInfo)fRis[curr]).isRoot();
+ return ((ResourceInfo) fRis[curr]).isRoot();
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/NotificationManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/NotificationManager.java
index b1d3e132122..fa0def6bbc3 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/NotificationManager.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/NotificationManager.java
@@ -20,16 +20,16 @@ import org.eclipse.cdt.managedbuilder.core.IHoldsOptions;
import org.eclipse.cdt.managedbuilder.core.IOption;
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
-public class NotificationManager /*implements ISettingsChangeListener */{
+public class NotificationManager /*implements ISettingsChangeListener */ {
private static NotificationManager fInstance;
private List<ISettingsChangeListener> fListeners;
-
- private NotificationManager(){
+
+ private NotificationManager() {
fListeners = new CopyOnWriteArrayList<ISettingsChangeListener>();
}
-
- public static NotificationManager getInstance(){
- if(fInstance == null)
+
+ public static NotificationManager getInstance() {
+ if (fInstance == null)
fInstance = new NotificationManager();
return fInstance;
}
@@ -43,26 +43,28 @@ public class NotificationManager /*implements ISettingsChangeListener */{
SettingsChangeEvent event = createOptionChangedEvent(rcInfo, holder, option, oldValue);
notifyListeners(event);
}
-
- private void notifyListeners(SettingsChangeEvent event){
+
+ private void notifyListeners(SettingsChangeEvent event) {
for (ISettingsChangeListener listener : fListeners)
listener.settingsChanged(event);
}
-
- private static SettingsChangeEvent createOptionChangedEvent(IResourceInfo rcInfo, IHoldsOptions holder, IOption option, Object oldValue){
+
+ private static SettingsChangeEvent createOptionChangedEvent(IResourceInfo rcInfo, IHoldsOptions holder,
+ IOption option, Object oldValue) {
return new SettingsChangeEvent(SettingsChangeEvent.CHANGED, rcInfo, holder, option, oldValue);
}
- private static SettingsChangeEvent createOptionRemovedEvent(IResourceInfo rcInfo, IHoldsOptions holder, IOption option){
+ private static SettingsChangeEvent createOptionRemovedEvent(IResourceInfo rcInfo, IHoldsOptions holder,
+ IOption option) {
return new SettingsChangeEvent(SettingsChangeEvent.REMOVED, rcInfo, holder, option, null);
}
- public void subscribe(ISettingsChangeListener listener){
+ public void subscribe(ISettingsChangeListener listener) {
fListeners.add(listener);
}
-
- public void unsubscribe(ISettingsChangeListener listener){
+
+ public void unsubscribe(ISettingsChangeListener listener) {
fListeners.remove(listener);
}
-
+
}
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 ee88babdb49..2eba61ef9f9 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
@@ -193,7 +193,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
* @param name New name for the option.
* @param option The existing option to clone, except for the above fields.
*/
- public Option(IHoldsOptions parent, String Id, String name, Option option){
+ public Option(IHoldsOptions parent, String Id, String name, Option option) {
this.holder = parent;
superClass = option.superClass;
if (superClass != null) {
@@ -296,12 +296,14 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
case UNDEF_MACRO_FILES:
if (option.value != null) {
@SuppressWarnings("unchecked")
- ArrayList<OptionStringValue> list = new ArrayList<OptionStringValue>((ArrayList<OptionStringValue>)option.value);
+ ArrayList<OptionStringValue> list = new ArrayList<OptionStringValue>(
+ (ArrayList<OptionStringValue>) option.value);
value = list;
}
if (option.defaultValue != null) {
@SuppressWarnings("unchecked")
- ArrayList<OptionStringValue> list = new ArrayList<OptionStringValue>((ArrayList<OptionStringValue>)option.defaultValue);
+ ArrayList<OptionStringValue> list = new ArrayList<OptionStringValue>(
+ (ArrayList<OptionStringValue>) option.defaultValue);
defaultValue = list;
}
break;
@@ -338,7 +340,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
fieldEditorExtraArgument = option.fieldEditorExtraArgument;
}
- if(copyIds){
+ if (copyIds) {
isDirty = option.isDirty;
rebuildState = option.rebuildState;
} else {
@@ -374,7 +376,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
// isAbstract
String isAbs = element.getAttribute(IProjectType.IS_ABSTRACT);
- if (isAbs != null){
+ if (isAbs != null) {
isAbstract = Boolean.parseBoolean(isAbs);
}
@@ -390,7 +392,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
// Get the command-generator, if any
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
@@ -398,7 +400,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
// isForScannerDiscovery
String isForSD = element.getAttribute(USE_BY_SCANNER_DISCOVERY);
- if (isForSD != null){
+ if (isForSD != null) {
isForScannerDiscovery = Boolean.parseBoolean(isForSD);
}
@@ -463,14 +465,14 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
//get enablements
IManagedConfigElement enablements[] = element.getChildren(OptionEnablementExpression.NAME);
- if(enablements.length > 0) {
+ if (enablements.length > 0) {
booleanExpressionCalculator = new BooleanExpressionApplicabilityCalculator(enablements);
}
// get the applicability calculator, if any
String applicabilityCalculatorStr = element.getAttribute(APPLICABILITY_CALCULATOR);
if (applicabilityCalculatorStr != null && element instanceof DefaultManagedConfigElement) {
- applicabilityCalculatorElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
+ applicabilityCalculatorElement = ((DefaultManagedConfigElement) element).getConfigurationElement();
} else {
applicabilityCalculator = booleanExpressionCalculator;
}
@@ -479,7 +481,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
// 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));
@@ -522,7 +524,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
// isAbstract
if (element.getAttribute(IProjectType.IS_ABSTRACT) != null) {
String isAbs = element.getAttribute(IProjectType.IS_ABSTRACT);
- if (isAbs != null){
+ if (isAbs != null) {
isAbstract = Boolean.parseBoolean(isAbs);
}
}
@@ -540,7 +542,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
// isForScannerDiscovery
if (element.getAttribute(USE_BY_SCANNER_DISCOVERY) != null) {
String isForSD = element.getAttribute(USE_BY_SCANNER_DISCOVERY);
- if (isForSD != null){
+ if (isForSD != null) {
isForScannerDiscovery = Boolean.parseBoolean(isForSD);
}
}
@@ -602,12 +604,13 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
if (i == 0) {
applicableValuesList = new ArrayList<String>();
if (defaultValue == null) {
- defaultValue = optId; // Default value to be overridden is default is specified
+ defaultValue = optId; // Default value to be overridden is default is specified
}
}
applicableValuesList.add(optId);
if (configElement.getAttribute(COMMAND) != null) {
- getCommandMap().put(optId, SafeStringInterner.safeIntern(configElement.getAttribute(COMMAND)));
+ getCommandMap().put(optId,
+ SafeStringInterner.safeIntern(configElement.getAttribute(COMMAND)));
} else {
getCommandMap().put(optId, EMPTY_STRING);
}
@@ -653,44 +656,44 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
for (ICStorageElement veNode : configElements) {
if (veNode.getName().equals(LIST_VALUE)) {
OptionStringValue ve = new OptionStringValue(veNode);
- if(ve.isBuiltIn()) {
+ if (ve.isBuiltIn()) {
biList.add(ve);
} else {
vList.add(ve);
}
}
}
-
+
//Assume not empty unless specificaly flagged
boolean isValueEmpty = false;
boolean isBuiltinEmpty = false;
-
+
if (element.getAttribute(IS_VALUE_EMPTY) != null) {
Boolean isEmpty = new Boolean(element.getAttribute(IS_VALUE_EMPTY));
if (isEmpty.booleanValue()) {
isValueEmpty = true;
}
- }
+ }
if (element.getAttribute(IS_BUILTIN_EMPTY) != null) {
Boolean isEmpty = new Boolean(element.getAttribute(IS_BUILTIN_EMPTY));
if (isEmpty.booleanValue()) {
isBuiltinEmpty = true;
}
}
-
- if(vList.size() != 0 || isValueEmpty) {
+
+ if (vList.size() != 0 || isValueEmpty) {
value = vList;
} else {
value = null;
}
- if(biList.size() != 0 || isBuiltinEmpty) {
+ if (biList.size() != 0 || isBuiltinEmpty) {
builtIns = biList;
} else {
builtIns = null;
}
break;
- default :
+ default:
break;
}
} catch (BuildException e) {
@@ -725,7 +728,8 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
if (element.getAttribute(BROWSE_FILTER_EXTENSIONS) != null) {
String browseFilterExtensionsStr = element.getAttribute(BROWSE_FILTER_EXTENSIONS);
if (browseFilterExtensionsStr != null) {
- this.browseFilterExtensions = SafeStringInterner.safeIntern(browseFilterExtensionsStr.split("\\s*,\\s*")); //$NON-NLS-1$
+ this.browseFilterExtensions = SafeStringInterner
+ .safeIntern(browseFilterExtensionsStr.split("\\s*,\\s*")); //$NON-NLS-1$
}
}
@@ -759,7 +763,8 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
// valueHandlerExtraArgument
if (element.getAttribute(VALUE_HANDLER_EXTRA_ARGUMENT) != null) {
- valueHandlerExtraArgument = SafeStringInterner.safeIntern(element.getAttribute(VALUE_HANDLER_EXTRA_ARGUMENT));
+ valueHandlerExtraArgument = SafeStringInterner
+ .safeIntern(element.getAttribute(VALUE_HANDLER_EXTRA_ARGUMENT));
}
}
@@ -807,7 +812,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
return TREE;
} else {
ManagedBuilderCorePlugin.log(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID,
- "Invalid option type=\"" + valueTypeStr + "\" specified for option " + getId() )); //$NON-NLS-1$ //$NON-NLS-2$
+ "Invalid option type=\"" + valueTypeStr + "\" specified for option " + getId())); //$NON-NLS-1$ //$NON-NLS-2$
// This was the CDT 2.0 default
return PREPROCESSOR_SYMBOLS;
}
@@ -870,12 +875,12 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
storeValueType = true;
switch (getValueType()) {
case BOOLEAN:
- element.setAttribute(VALUE, ((Boolean)value).toString());
+ element.setAttribute(VALUE, ((Boolean) value).toString());
break;
case STRING:
case ENUMERATED:
case TREE:
- element.setAttribute(VALUE, (String)value);
+ element.setAttribute(VALUE, (String) value);
break;
case STRING_LIST:
case INCLUDE_PATH:
@@ -894,37 +899,37 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
case UNDEF_MACRO_FILES:
if (value != null) {
@SuppressWarnings("unchecked")
- ArrayList<OptionStringValue> stringList = (ArrayList<OptionStringValue>)value;
+ ArrayList<OptionStringValue> stringList = (ArrayList<OptionStringValue>) value;
for (OptionStringValue optValue : stringList) {
ICStorageElement valueElement = element.createChild(LIST_VALUE);
optValue.serialize(valueElement);
}
-
- if(stringList.isEmpty()) {
- element.setAttribute(IS_VALUE_EMPTY, Boolean.TRUE.toString());
+
+ if (stringList.isEmpty()) {
+ element.setAttribute(IS_VALUE_EMPTY, Boolean.TRUE.toString());
} else {
- element.setAttribute(IS_VALUE_EMPTY, Boolean.FALSE.toString());
+ element.setAttribute(IS_VALUE_EMPTY, Boolean.FALSE.toString());
}
} else {
- element.setAttribute(IS_VALUE_EMPTY, Boolean.FALSE.toString());
+ element.setAttribute(IS_VALUE_EMPTY, Boolean.FALSE.toString());
}
-
+
// Serialize the built-ins that have been overridden
if (builtIns != null) {
for (OptionStringValue optionValue : builtIns) {
ICStorageElement valueElement = element.createChild(LIST_VALUE);
optionValue.serialize(valueElement);
}
-
- if(builtIns.isEmpty()) {
- element.setAttribute(IS_BUILTIN_EMPTY, Boolean.TRUE.toString());
+
+ if (builtIns.isEmpty()) {
+ element.setAttribute(IS_BUILTIN_EMPTY, Boolean.TRUE.toString());
} else {
- element.setAttribute(IS_BUILTIN_EMPTY, Boolean.FALSE.toString());
+ element.setAttribute(IS_BUILTIN_EMPTY, Boolean.FALSE.toString());
}
} else {
- element.setAttribute(IS_BUILTIN_EMPTY, Boolean.FALSE.toString());
+ element.setAttribute(IS_BUILTIN_EMPTY, Boolean.FALSE.toString());
}
-
+
break;
}
}
@@ -934,12 +939,12 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
storeValueType = true;
switch (getValueType()) {
case BOOLEAN:
- element.setAttribute(DEFAULT_VALUE, ((Boolean)defaultValue).toString());
+ element.setAttribute(DEFAULT_VALUE, ((Boolean) defaultValue).toString());
break;
case STRING:
case ENUMERATED:
case TREE:
- element.setAttribute(DEFAULT_VALUE, (String)defaultValue);
+ element.setAttribute(DEFAULT_VALUE, (String) defaultValue);
break;
default:
break;
@@ -1042,7 +1047,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
// browse filter extensions
if (browseFilterExtensions != null) {
StringBuilder sb = new StringBuilder();
- for(String ext : browseFilterExtensions) {
+ for (String ext : browseFilterExtensions) {
sb.append(ext).append(',');
}
element.setAttribute(BROWSE_FILTER_EXTENSIONS, sb.toString());
@@ -1142,7 +1147,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
} else {
// Return the elements in the order they are specified in the manifest
String[] enumNames = new String[applicableValuesList.size()];
- for (int index = 0; index < applicableValuesList.size(); ++ index) {
+ for (int index = 0; index < applicableValuesList.size(); ++index) {
enumNames[index] = getNameMap().get(applicableValuesList.get(index));
}
return enumNames;
@@ -1151,7 +1156,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
@Override
public boolean getBooleanValue() {
- return ((Boolean)getValue()).booleanValue();
+ return ((Boolean) getValue()).booleanValue();
}
@Override
@@ -1202,14 +1207,13 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
return resourceFilter.intValue();
}
-
public IConfigurationElement getApplicabilityCalculatorElement() {
-/* if (applicabilityCalculatorElement == null) {
- if (superClass != null) {
- return ((Option)superClass).getApplicabilityCalculatorElement();
- }
- }
-*/
+ /* if (applicabilityCalculatorElement == null) {
+ if (superClass != null) {
+ return ((Option)superClass).getApplicabilityCalculatorElement();
+ }
+ }
+ */
return applicabilityCalculatorElement;
}
@@ -1225,8 +1229,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
} catch (CoreException e) {
ManagedBuilderCorePlugin.log(e);
}
- }
- else if(superClass != null) {
+ } else if (superClass != null) {
applicabilityCalculator = superClass.getApplicabilityCalculator();
}
}
@@ -1240,7 +1243,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
List<OptionStringValue> list = getExactBuiltinsList();
List<String> valueList = listValueListToValueList(list);
- if(valueList == null) {
+ if (valueList == null) {
return EMPTY_STRING_ARRAY;
}
return valueList.toArray(new String[valueList.size()]);
@@ -1250,7 +1253,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
// Return the list of built-ins as an array
if (builtIns == null) {
if (superClass != null) {
- return ((Option)superClass).getExactBuiltinsList();
+ return ((Option) superClass).getExactBuiltinsList();
} else {
return null;
}
@@ -1266,7 +1269,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
return superClass.getCategory();
} else {
if (getOptionHolder() instanceof ITool) {
- return ((ITool)getOptionHolder()).getTopOptionCategory();
+ return ((ITool) getOptionHolder()).getTopOptionCategory();
} else {
return null;
}
@@ -1319,8 +1322,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
} catch (CoreException e) {
ManagedBuilderCorePlugin.log(e);
}
- }
- else if(superClass != null) {
+ } else if (superClass != null) {
commandGenerator = superClass.getCommandGenerator();
}
}
@@ -1378,7 +1380,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
@SuppressWarnings("unchecked")
- ArrayList<String> v = (ArrayList<String>)getValue();
+ ArrayList<String> v = (ArrayList<String>) getValue();
if (v == null) {
return EMPTY_STRING_ARRAY;
} else {
@@ -1402,7 +1404,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
return EMPTY_STRING;
}
}
- if (getValueType() != ENUMERATED && getValueType() != TREE) {
+ if (getValueType() != ENUMERATED && getValueType() != TREE) {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
@@ -1525,7 +1527,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
@SuppressWarnings("unchecked")
- ArrayList<String> v = (ArrayList<String>)getValue();
+ ArrayList<String> v = (ArrayList<String>) getValue();
if (v == null) {
return EMPTY_STRING_ARRAY;
} else {
@@ -1540,7 +1542,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
@SuppressWarnings("unchecked")
- ArrayList<String> v = (ArrayList<String>)getValue();
+ ArrayList<String> v = (ArrayList<String>) getValue();
if (v == null) {
return EMPTY_STRING_ARRAY;
} else {
@@ -1555,7 +1557,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
@SuppressWarnings("unchecked")
- ArrayList<String> v = (ArrayList<String>)getValue();
+ ArrayList<String> v = (ArrayList<String>) getValue();
if (v == null) {
return EMPTY_STRING_ARRAY;
} else {
@@ -1570,7 +1572,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
@SuppressWarnings("unchecked")
- ArrayList<String> v = (ArrayList<String>)getValue();
+ ArrayList<String> v = (ArrayList<String>) getValue();
if (v == null) {
return EMPTY_STRING_ARRAY;
} else {
@@ -1593,7 +1595,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
@SuppressWarnings("unchecked")
- ArrayList<String> v = (ArrayList<String>)getValue();
+ ArrayList<String> v = (ArrayList<String>) getValue();
if (v == null) {
return EMPTY_STRING_ARRAY;
} else {
@@ -1607,7 +1609,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
if (getValueType() != STRING && getValueType() != ENUMERATED && getValueType() != TREE) {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
- return getValue() == null ? EMPTY_STRING : (String)getValue();
+ return getValue() == null ? EMPTY_STRING : (String) getValue();
}
@Override
@@ -1617,7 +1619,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
}
// This is the right puppy, so return its list value
@SuppressWarnings("unchecked")
- ArrayList<String> v = (ArrayList<String>)getValue();
+ ArrayList<String> v = (ArrayList<String>) getValue();
if (v == null) {
return EMPTY_STRING_ARRAY;
} else {
@@ -1769,9 +1771,9 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
*/
public Object getRawValue() {
Object ev = getExactRawValue();
- if(ev instanceof List<?>) {
+ if (ev instanceof List<?>) {
@SuppressWarnings("unchecked")
- List<String> evList = listValueListToValueList((List<OptionStringValue>)ev);
+ List<String> evList = listValueListToValueList((List<OptionStringValue>) ev);
return evList;
}
return ev;
@@ -1780,49 +1782,48 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
public Object getExactRawValue() {
if (value == null) {
if (superClass != null) {
- Option mySuperClass = (Option)superClass;
+ Option mySuperClass = (Option) superClass;
return mySuperClass.getExactRawValue();
}
}
return value;
}
- private List<String> listValueListToValueList(List<OptionStringValue> list){
- if(list == null) {
+ 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++){
+ for (int i = 0; i < list.size(); i++) {
OptionStringValue el = list.get(i);
valueList.add(el.getValue());
}
return valueList;
}
- private List<OptionStringValue> valueListToListValueList(List<String> list, boolean builtIn){
- if(list == null) {
+ 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++){
+ for (int i = 0; i < list.size(); i++) {
String v = list.get(i);
lvList.add(new OptionStringValue(v, builtIn));
}
return lvList;
}
-
/**
* Gets the raw default value.
*/
@Override
public Object getDefaultValue() {
Object ev = getExactDefaultValue();
- if(ev instanceof List<?>) {
+ if (ev instanceof List<?>) {
@SuppressWarnings("unchecked")
- List<String> evList = listValueListToValueList((List<OptionStringValue>)ev);
+ List<String> evList = listValueListToValueList((List<OptionStringValue>) ev);
return evList;
}
return ev;
@@ -1832,7 +1833,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
// Note: string-list options do not have a default value
if (defaultValue == null) {
if (superClass != null) {
- return ((Option)superClass).getExactDefaultValue();
+ return ((Option) superClass).getExactDefaultValue();
}
}
return defaultValue;
@@ -1840,14 +1841,14 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
@Override
public void setDefaultValue(Object v) {
- if(v instanceof List<?>) {
+ if (v instanceof List<?>) {
@SuppressWarnings("unchecked")
- List<OptionStringValue> vList = valueListToListValueList((List<String>)v, false);
+ List<OptionStringValue> vList = valueListToListValueList((List<String>) v, false);
defaultValue = vList;
} else {
defaultValue = v;
}
- if(!isExtensionElement()){
+ if (!isExtensionElement()) {
setDirty(true);
rebuildState = true;
}
@@ -1862,7 +1863,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
} else {
categoryId = null;
}
- if(!isExtensionElement()){
+ if (!isExtensionElement()) {
setDirty(true);
rebuildState = true;
}
@@ -1876,7 +1877,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
}
if (cmd == null || command == null || !cmd.equals(command)) {
command = cmd;
- if(!isExtensionElement()){
+ if (!isExtensionElement()) {
isDirty = true;
rebuildState = true;
}
@@ -1890,7 +1891,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
}
if (cmd == null || commandFalse == null || !cmd.equals(commandFalse)) {
commandFalse = cmd;
- if(!isExtensionElement()){
+ if (!isExtensionElement()) {
isDirty = true;
rebuildState = true;
}
@@ -1904,7 +1905,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
}
if (tooltip == null || tip == null || !tooltip.equals(tip)) {
tip = tooltip;
- if(!isExtensionElement()){
+ if (!isExtensionElement()) {
isDirty = true;
rebuildState = true;
}
@@ -1918,7 +1919,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
}
if (id == null || contextId == null || !id.equals(contextId)) {
contextId = id;
- if(!isExtensionElement()){
+ if (!isExtensionElement()) {
isDirty = true;
rebuildState = true;
}
@@ -1929,7 +1930,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
public void setResourceFilter(int filter) {
if (resourceFilter == null || !(filter == resourceFilter.intValue())) {
resourceFilter = Integer.valueOf(filter);
- if(!isExtensionElement()){
+ if (!isExtensionElement()) {
isDirty = true;
rebuildState = true;
}
@@ -1940,7 +1941,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
public void setBrowseType(int type) {
if (browseType == null || !(type == browseType.intValue())) {
browseType = Integer.valueOf(type);
- if(!isExtensionElement()){
+ if (!isExtensionElement()) {
isDirty = true;
rebuildState = true;
}
@@ -1951,7 +1952,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
public void setBrowseFilterPath(String path) {
if (browseFilterPath == null || !(browseFilterPath.equals(path))) {
browseFilterPath = path;
- if(!isExtensionElement()) {
+ if (!isExtensionElement()) {
isDirty = true;
rebuildState = true;
}
@@ -1962,7 +1963,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
public void setBrowseFilterExtensions(String[] extensions) {
if (browseFilterExtensions == null || !(browseFilterExtensions.equals(extensions))) {
browseFilterExtensions = extensions;
- if(!isExtensionElement()) {
+ if (!isExtensionElement()) {
isDirty = true;
rebuildState = true;
}
@@ -1971,97 +1972,74 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
@Override
public void setValue(boolean value) throws BuildException {
- if (/*!isExtensionElement() && */getValueType() == BOOLEAN){
+ if (/*!isExtensionElement() && */getValueType() == BOOLEAN) {
this.value = value;
} else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
- if(!isExtensionElement()){
+ if (!isExtensionElement()) {
setDirty(true);
rebuildState = true;
}
}
-
@Override
public void setValue(String value) throws BuildException {
// Note that we can still set the human-readable value here
- if (/*!isExtensionElement() && */(getValueType() == STRING || getValueType() == ENUMERATED || getValueType() == TREE)) {
+ if (/*!isExtensionElement() && */(getValueType() == STRING || getValueType() == ENUMERATED
+ || getValueType() == TREE)) {
this.value = value;
} else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
- if(!isExtensionElement()){
+ if (!isExtensionElement()) {
setDirty(true);
rebuildState = true;
}
}
-
@Override
- public void setValue(String [] value) throws BuildException {
+ public void setValue(String[] value) throws BuildException {
if (/*!isExtensionElement() && */
- (getValueType() == STRING_LIST
- || getValueType() == INCLUDE_PATH
- || getValueType() == PREPROCESSOR_SYMBOLS
- || getValueType() == LIBRARIES
- || getValueType() == OBJECTS
- || getValueType() == INCLUDE_FILES
- || getValueType() == LIBRARY_PATHS
- || getValueType() == LIBRARY_FILES
- || getValueType() == MACRO_FILES
- || getValueType() == UNDEF_INCLUDE_PATH
- || getValueType() == UNDEF_PREPROCESSOR_SYMBOLS
- || getValueType() == UNDEF_INCLUDE_FILES
- || getValueType() == UNDEF_LIBRARY_PATHS
- || getValueType() == UNDEF_LIBRARY_FILES
- || getValueType() == UNDEF_MACRO_FILES
- )) {
+ (getValueType() == STRING_LIST || getValueType() == INCLUDE_PATH || getValueType() == PREPROCESSOR_SYMBOLS
+ || getValueType() == LIBRARIES || getValueType() == OBJECTS || getValueType() == INCLUDE_FILES
+ || getValueType() == LIBRARY_PATHS || getValueType() == LIBRARY_FILES || getValueType() == MACRO_FILES
+ || getValueType() == UNDEF_INCLUDE_PATH || getValueType() == UNDEF_PREPROCESSOR_SYMBOLS
+ || getValueType() == UNDEF_INCLUDE_FILES || getValueType() == UNDEF_LIBRARY_PATHS
+ || getValueType() == UNDEF_LIBRARY_FILES || getValueType() == UNDEF_MACRO_FILES)) {
// Just replace what the option reference is holding onto
- if(value == null) {
+ if (value == null) {
this.value = null;
} else {
this.value = valueListToListValueList(Arrays.asList(value), false);
}
- }
- else {
+ } else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
- if(!isExtensionElement()){
+ if (!isExtensionElement()) {
setDirty(true);
rebuildState = true;
}
}
- public void setValue(OptionStringValue [] value) throws BuildException {
+ public void setValue(OptionStringValue[] value) throws BuildException {
if (/*!isExtensionElement() && */
- (getValueType() == STRING_LIST
- || getValueType() == INCLUDE_PATH
- || getValueType() == PREPROCESSOR_SYMBOLS
- || getValueType() == LIBRARIES
- || getValueType() == OBJECTS
- || getValueType() == INCLUDE_FILES
- || getValueType() == LIBRARY_PATHS
- || getValueType() == LIBRARY_FILES
- || getValueType() == MACRO_FILES
- || getValueType() == UNDEF_INCLUDE_PATH
- || getValueType() == UNDEF_PREPROCESSOR_SYMBOLS
- || getValueType() == UNDEF_INCLUDE_FILES
- || getValueType() == UNDEF_LIBRARY_PATHS
- || getValueType() == UNDEF_LIBRARY_FILES
- || getValueType() == UNDEF_MACRO_FILES
- )) {
+ (getValueType() == STRING_LIST || getValueType() == INCLUDE_PATH || getValueType() == PREPROCESSOR_SYMBOLS
+ || getValueType() == LIBRARIES || getValueType() == OBJECTS || getValueType() == INCLUDE_FILES
+ || getValueType() == LIBRARY_PATHS || getValueType() == LIBRARY_FILES || getValueType() == MACRO_FILES
+ || getValueType() == UNDEF_INCLUDE_PATH || getValueType() == UNDEF_PREPROCESSOR_SYMBOLS
+ || getValueType() == UNDEF_INCLUDE_FILES || getValueType() == UNDEF_LIBRARY_PATHS
+ || getValueType() == UNDEF_LIBRARY_FILES || getValueType() == UNDEF_MACRO_FILES)) {
// Just replace what the option reference is holding onto
- if(value == null) {
+ if (value == null) {
this.value = null;
} else {
this.value = new ArrayList<OptionStringValue>(Arrays.asList(value));
}
- }
- else {
+ } else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
- if(!isExtensionElement()){
+ if (!isExtensionElement()) {
setDirty(true);
rebuildState = true;
}
@@ -2069,14 +2047,14 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
@Override
public void setValue(Object v) {
- if(v instanceof List<?>) {
+ if (v instanceof List<?>) {
@SuppressWarnings("unchecked")
- List<OptionStringValue> vList = valueListToListValueList((List<String>)v, false);
+ List<OptionStringValue> vList = valueListToListValueList((List<String>) v, false);
value = vList;
} else {
value = v;
}
- if(!isExtensionElement()){
+ if (!isExtensionElement()) {
setDirty(true);
rebuildState = true;
}
@@ -2087,7 +2065,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
// TODO: Verify that this is a valid type
if (valueType == null || valueType.intValue() != type) {
valueType = Integer.valueOf(type);
- if(!isExtensionElement()){
+ if (!isExtensionElement()) {
setDirty(true);
rebuildState = true;
}
@@ -2097,7 +2075,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
public IConfigurationElement getValueHandlerElement() {
if (valueHandlerElement == null) {
if (superClass != null) {
- return ((Option)superClass).getValueHandlerElement();
+ return ((Option) superClass).getValueHandlerElement();
}
}
return valueHandlerElement;
@@ -2105,7 +2083,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
public void setValueHandlerElement(IConfigurationElement element) {
valueHandlerElement = element;
- if(!isExtensionElement()){
+ if (!isExtensionElement()) {
setDirty(true);
rebuildState = true;
}
@@ -2151,11 +2129,10 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
if (extraArgument == null && valueHandlerExtraArgument == null) {
return;
}
- if (extraArgument == null ||
- valueHandlerExtraArgument == null ||
- !extraArgument.equals(valueHandlerExtraArgument)) {
+ if (extraArgument == null || valueHandlerExtraArgument == null
+ || !extraArgument.equals(valueHandlerExtraArgument)) {
valueHandlerExtraArgument = extraArgument;
- if(!isExtensionElement()){
+ if (!isExtensionElement()) {
isDirty = true;
rebuildState = true;
}
@@ -2166,7 +2143,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
public String getFieldEditorId() {
if (fieldEditorId == null) {
if (superClass != null) {
- return ((Option)superClass).getFieldEditorId();
+ return ((Option) superClass).getFieldEditorId();
}
}
return fieldEditorId;
@@ -2189,18 +2166,16 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
if (extraArgument == null && fieldEditorExtraArgument == null) {
return;
}
- if (extraArgument == null ||
- fieldEditorExtraArgument == null ||
- !extraArgument.equals(fieldEditorExtraArgument)) {
+ if (extraArgument == null || fieldEditorExtraArgument == null
+ || !extraArgument.equals(fieldEditorExtraArgument)) {
fieldEditorExtraArgument = extraArgument;
- if(!isExtensionElement()){
+ if (!isExtensionElement()) {
isDirty = true;
rebuildState = true;
}
}
}
-
/*
* O B J E C T S T A T E M A I N T E N A N C E
*/
@@ -2230,25 +2205,21 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
superClass = ManagedBuildManager.getExtensionOption(superClassId);
if (superClass == null) {
// Report error
- ManagedBuildManager.outputResolveError(
- "superClass", //$NON-NLS-1$
- superClassId,
- "option", //$NON-NLS-1$
+ ManagedBuildManager.outputResolveError("superClass", //$NON-NLS-1$
+ superClassId, "option", //$NON-NLS-1$
getId());
} else {
// All of our superclasses must be resolved in order to call
// getValueType below.
- ((Option)superClass).resolveReferences();
+ ((Option) superClass).resolveReferences();
}
}
if (categoryId != null) {
category = holder.getOptionCategory(categoryId);
if (category == null) {
// Report error
- ManagedBuildManager.outputResolveError(
- "category", //$NON-NLS-1$
- categoryId,
- "option", //$NON-NLS-1$
+ ManagedBuildManager.outputResolveError("category", //$NON-NLS-1$
+ categoryId, "option", //$NON-NLS-1$
getId());
}
}
@@ -2286,11 +2257,12 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
if (i == 0) {
applicableValuesList = new ArrayList<String>();
if (defaultValue == null) {
- defaultValue = optId; // Default value to be overridden if default is specified
+ defaultValue = optId; // Default value to be overridden if default is specified
}
}
applicableValuesList.add(optId);
- getCommandMap().put(optId, SafeStringInterner.safeIntern(enumElements[i].getAttribute(COMMAND)));
+ getCommandMap().put(optId,
+ SafeStringInterner.safeIntern(enumElements[i].getAttribute(COMMAND)));
getNameMap().put(optId, SafeStringInterner.safeIntern(enumElements[i].getAttribute(NAME)));
Boolean isDefault = Boolean.valueOf(enumElements[i].getAttribute(IS_DEFAULT));
if (isDefault.booleanValue()) {
@@ -2310,7 +2282,8 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
iterateOnTree(treeRoot, new ITreeNodeIterator() {
@Override
- public void iterateOnNode(ITreeOption node) {}
+ public void iterateOnNode(ITreeOption node) {
+ }
@Override
public void iterateOnLeaf(ITreeOption leafNode) {
@@ -2343,21 +2316,20 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
List<OptionStringValue> vList = null;
IManagedConfigElement[] vElements = element.getChildren(LIST_VALUE);
for (IManagedConfigElement vElement : vElements) {
- if (vList==null) {
+ if (vList == null) {
vList = new ArrayList<OptionStringValue>();
builtIns = new ArrayList<OptionStringValue>();
}
OptionStringValue ve = new OptionStringValue(vElement);
- if(ve.isBuiltIn()) {
+ if (ve.isBuiltIn()) {
builtIns.add(ve);
- }
- else {
+ } else {
vList.add(ve);
}
}
value = vList;
break;
- default :
+ default:
break;
}
} catch (BuildException e) {
@@ -2371,8 +2343,8 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
*/
@Override
public String getManagedBuildRevision() {
- if ( managedBuildRevision == null) {
- if ( getParent() != null) {
+ if (managedBuildRevision == null) {
+ if (getParent() != null) {
return getParent().getManagedBuildRevision();
}
}
@@ -2388,7 +2360,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
if (isAbstract != null) {
return isAbstract.booleanValue();
} else {
- return false; // Note: no inheritance from superClass
+ return false; // Note: no inheritance from superClass
}
}
@@ -2410,7 +2382,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
}
verified = true;
// Ignore elements that are superclasses
- if ( getOptionHolder() instanceof IToolChain && isAbstract() == false ) {
+ if (getOptionHolder() instanceof IToolChain && isAbstract() == false) {
// Check for error (a)
if (getCategory() == null) {
ManagedBuildManager.optionValidError(ManagedBuildManager.ERROR_CATEGORY, getId());
@@ -2420,8 +2392,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
// 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 )
- {
+ if (resourceFilter != null) {
switch (getResourceFilter()) {
case IOption.FILTER_FILE:
// TODO: Cannot differentiate between "all" and attribute not
@@ -2445,7 +2416,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
// The trade-off is that errors in the MBS grammar may not be
// detected on load, but only when a particular grammar element
// is used, say in the GUI.
- if (verified == false && resolved == true) {
+ if (verified == false && resolved == true) {
verify();
}
return isValid;
@@ -2468,8 +2439,8 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
*/
@Override
public Version getVersion() {
- if ( version == null) {
- if ( getParent() != null) {
+ if (version == null) {
+ if (getParent() != null) {
return getParent().getVersion();
}
}
@@ -2481,16 +2452,16 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
// Do nothing
}
- public BooleanExpressionApplicabilityCalculator getBooleanExpressionCalculator(boolean isExtensionAdjustment){
- if(booleanExpressionCalculator == null && !isExtensionAdjustment){
- if(superClass != null){
- return ((Option)superClass).getBooleanExpressionCalculator(isExtensionAdjustment);
+ public BooleanExpressionApplicabilityCalculator getBooleanExpressionCalculator(boolean isExtensionAdjustment) {
+ if (booleanExpressionCalculator == null && !isExtensionAdjustment) {
+ if (superClass != null) {
+ return ((Option) superClass).getBooleanExpressionCalculator(isExtensionAdjustment);
}
}
return booleanExpressionCalculator;
}
- public boolean isAdjustedExtension(){
+ public boolean isAdjustedExtension() {
return isUdjusted;
}
@@ -2499,15 +2470,15 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
}
public void setSuperClass(IOption superClass) {
- if ( this.superClass != superClass ) {
+ if (this.superClass != superClass) {
this.superClass = superClass;
- if ( this.superClass == null) {
+ if (this.superClass == null) {
superClassId = null;
} else {
superClassId = this.superClass.getId();
}
- if(!isExtensionElement()) {
+ if (!isExtensionElement()) {
setDirty(true);
}
}
@@ -2518,20 +2489,20 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
}
public void setRebuildState(boolean rebuild) {
- if(isExtensionElement() && rebuild) {
+ if (isExtensionElement() && rebuild) {
return;
}
rebuildState = rebuild;
}
- public boolean matches(IOption option){
+ public boolean matches(IOption option) {
try {
- if(option.getValueType() != getValueType()) {
+ if (option.getValueType() != getValueType()) {
return false;
}
- if(!option.getName().equals(getName())) {
+ if (!option.getName().equals(getName())) {
return false;
}
} catch (BuildException e) {
@@ -2551,11 +2522,11 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
String referenced[] = null;
BooleanExpressionApplicabilityCalculator calc = getBooleanExpressionCalculator(false);
- if(calc != null){
+ if (calc != null) {
referenced = calc.getReferencedPropertyIds();
}
- if(referenced == null) {
+ if (referenced == null) {
referenced = new String[0];
}
return referenced;
@@ -2566,11 +2537,11 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
String referenced[] = null;
BooleanExpressionApplicabilityCalculator calc = getBooleanExpressionCalculator(false);
- if(calc != null){
+ if (calc != null) {
referenced = calc.getReferencedValueIds(typeId);
}
- if(referenced == null) {
+ if (referenced == null) {
referenced = new String[0];
}
return referenced;
@@ -2586,8 +2557,8 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
boolean supports = false;
BooleanExpressionApplicabilityCalculator calc = getBooleanExpressionCalculator(false);
- if(calc != null){
- if(calc.referesProperty(id)){
+ if (calc != null) {
+ if (calc.referesProperty(id)) {
supports = true;
}
}
@@ -2599,8 +2570,8 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
boolean supports = false;
BooleanExpressionApplicabilityCalculator calc = getBooleanExpressionCalculator(false);
- if(calc != null){
- if(calc.referesPropertyValue(typeId, valueId)){
+ if (calc != null) {
+ if (calc.referesPropertyValue(typeId, valueId)) {
supports = true;
}
}
@@ -2613,7 +2584,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
@SuppressWarnings("unchecked")
- ArrayList<String> v = (ArrayList<String>)getValue();
+ ArrayList<String> v = (ArrayList<String>) getValue();
if (v == null) {
return EMPTY_STRING_ARRAY;
}
@@ -2627,7 +2598,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
@SuppressWarnings("unchecked")
- ArrayList<OptionStringValue> v = (ArrayList<OptionStringValue>)getExactValue();
+ ArrayList<OptionStringValue> v = (ArrayList<OptionStringValue>) getExactValue();
if (v == null) {
return EMPTY_LV_ARRAY;
}
@@ -2635,10 +2606,9 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
return v.toArray(new OptionStringValue[v.size()]);
}
-
@Override
public int getBasicValueType() throws BuildException {
- switch(getValueType()){
+ switch (getValueType()) {
case IOption.BOOLEAN:
return IOption.BOOLEAN;
case IOption.STRING:
@@ -2652,20 +2622,20 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
}
}
- public boolean hasCustomSettings(){
- if(superClass == null) {
+ public boolean hasCustomSettings() {
+ if (superClass == null) {
return true;
}
- if(value != null && !value.equals(superClass.getValue())){
+ if (value != null && !value.equals(superClass.getValue())) {
return true;
}
return false;
}
- public static int getOppositeType(int type){
- switch(type){
+ public static int getOppositeType(int type) {
+ switch (type) {
case INCLUDE_PATH:
return UNDEF_INCLUDE_PATH;
case PREPROCESSOR_SYMBOLS:
@@ -2696,6 +2666,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
public static class TreeRoot extends TreeOption implements ITreeRoot {
private boolean selectLeafOnly = true;
+
TreeRoot(IManagedConfigElement element, IManagedConfigElement buildOption, boolean readTool) {
super(element, null, readTool);
String leaf = element.getAttribute(SELECT_LEAF_ONLY);
@@ -2724,7 +2695,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
@Override
public ITreeOption findNode(String id) {
- if(id == null) {
+ if (id == null) {
return null;
}
return find(id, children);
@@ -2738,7 +2709,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
found = child;
break;
}
- found = find(id, ((TreeOption)child).children);
+ found = find(id, ((TreeOption) child).children);
if (found != null) {
break;
}
@@ -2911,7 +2882,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
@Override
public void remove() {
- ((TreeOption)parent).children.remove(this);
+ ((TreeOption) parent).children.remove(this);
}
@@ -2941,6 +2912,7 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
public interface ITreeNodeIterator {
void iterateOnNode(ITreeOption node);
+
void iterateOnLeaf(ITreeOption leafNode);
}
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 6f3b1cd2d56..403b53905d4 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
@@ -50,11 +50,11 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
// Parent and children
private IHoldsOptions holder;
- private List<OptionCategory> children; // Note: These are logical Option Category children, not "model" children
+ private List<OptionCategory> children; // Note: These are logical Option Category children, not "model" children
// Managed Build model attributes
- private IOptionCategory owner; // The logical Option Category parent
+ private IOptionCategory owner; // The logical Option Category parent
private String ownerId;
- private URL iconPathURL;
+ private URL iconPathURL;
private IConfigurationElement applicabilityCalculatorElement = null;
private IOptionCategoryApplicability applicabilityCalculator = null;
@@ -135,21 +135,21 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
ownerId = SafeStringInterner.safeIntern(element.getAttribute(IOptionCategory.OWNER));
// icon
- if ( element.getAttribute(IOptionCategory.ICON) != null && element instanceof DefaultManagedConfigElement)
- {
- String icon = element.getAttribute(IOptionCategory.ICON);
- iconPathURL = ManagedBuildManager.getURLInBuildDefinitions( (DefaultManagedConfigElement)element, new Path(icon) );
+ if (element.getAttribute(IOptionCategory.ICON) != null && element instanceof DefaultManagedConfigElement) {
+ 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)
+ if (enablements.length > 0)
booleanExpressionCalculator = new BooleanExpressionApplicabilityCalculator(enablements);
// get the applicability calculator, if any
String applicabilityCalculatorStr = element.getAttribute(APPLICABILITY_CALCULATOR);
if (applicabilityCalculatorStr != null && element instanceof DefaultManagedConfigElement) {
- applicabilityCalculatorElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
+ applicabilityCalculatorElement = ((DefaultManagedConfigElement) element).getConfigurationElement();
} else {
applicabilityCalculator = booleanExpressionCalculator;
}
@@ -195,11 +195,11 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
// Hook me in
if (owner == null)
- ((HoldsOptions)holder).addChildCategory(this);
+ ((HoldsOptions) holder).addChildCategory(this);
else if (owner instanceof Tool)
- ((Tool)owner).addChildCategory(this);
+ ((Tool) owner).addChildCategory(this);
else
- ((OptionCategory)owner).addChildCategory(this);
+ ((OptionCategory) owner).addChildCategory(this);
}
private IOptionCategory getNullOptionCategory() {
@@ -207,7 +207,7 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
// the fact that Tool implements IOptionCategory. If so,
// the holder is in fact a parent category to this category.
if (holder instanceof IOptionCategory) {
- return (IOptionCategory)holder;
+ return (IOptionCategory) holder;
}
return null;
}
@@ -296,9 +296,9 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
optionHolders[0] = optionHolder;
boolean isRoot = false;
if (resinfo instanceof ResourceInfo)
- isRoot = ((ResourceInfo)resinfo).isRoot();
+ isRoot = ((ResourceInfo) resinfo).isRoot();
else if (resinfo instanceof MultiResourceInfo)
- isRoot = ((MultiResourceInfo)resinfo).isRoot();
+ isRoot = ((MultiResourceInfo) resinfo).isRoot();
return getOptions(optionHolders, isRoot ? FILTER_PROJECT : FILTER_FILE);
}
@@ -328,9 +328,9 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
private IHoldsOptions getOptionHoldersSuperClass(IHoldsOptions optionHolder) {
if (optionHolder instanceof ITool)
- return ((ITool)optionHolder).getSuperClass();
+ return ((ITool) optionHolder).getSuperClass();
else if (optionHolder instanceof IToolChain)
- return ((IToolChain)optionHolder).getSuperClass();
+ return ((IToolChain) optionHolder).getSuperClass();
return null;
}
@@ -349,7 +349,8 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
break;
}
} while ((current = getOptionHoldersSuperClass(current)) != null);
- if (optionHolder != null) break;
+ if (optionHolder != null)
+ break;
}
}
if (optionHolder == null) {
@@ -366,7 +367,7 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
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) ) {
+ if ((option.getResourceFilter() == FILTER_ALL) || (option.getResourceFilter() == filterValue)) {
myOptions[index] = new Object[2];
myOptions[index][0] = optionHolder;
myOptions[index][1] = option;
@@ -407,9 +408,8 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
public ITool getTool() {
// This will stop at the tool's top category
IHoldsOptions parent = owner.getOptionHolder();
- if (parent instanceof ITool)
- {
- return (ITool)parent;
+ if (parent instanceof ITool) {
+ return (ITool) parent;
}
return null;
}
@@ -439,7 +439,8 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
@Override
public boolean isDirty() {
// This shouldn't be called for an extension OptionCategory
- if (isExtensionOptionCategory) return false;
+ if (isExtensionOptionCategory)
+ return false;
return isDirty;
}
@@ -461,18 +462,14 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
if (holder instanceof IOptionCategory) {
// Report error, only if the parent is a tool and thus also
// an option category.
- ManagedBuildManager.outputResolveError(
- "owner", //$NON-NLS-1$
- ownerId,
- "optionCategory", //$NON-NLS-1$
+ ManagedBuildManager.outputResolveError("owner", //$NON-NLS-1$
+ ownerId, "optionCategory", //$NON-NLS-1$
getId());
error = true;
- } else if ( false == holder.getId().equals(ownerId) ) {
+ } else if (false == holder.getId().equals(ownerId)) {
// Report error, if the holder ID does not match the owner's ID.
- ManagedBuildManager.outputResolveError(
- "owner", //$NON-NLS-1$
- ownerId,
- "optionCategory", //$NON-NLS-1$
+ ManagedBuildManager.outputResolveError("owner", //$NON-NLS-1$
+ ownerId, "optionCategory", //$NON-NLS-1$
getId());
error = true;
}
@@ -483,12 +480,12 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
}
// Hook me in
- if (owner == null && error == false)
- ((HoldsOptions)holder).addChildCategory(this);
+ if (owner == null && error == false)
+ ((HoldsOptions) holder).addChildCategory(this);
else if (owner instanceof Tool)
- ((Tool)owner).addChildCategory(this);
+ ((Tool) owner).addChildCategory(this);
else
- ((OptionCategory)owner).addChildCategory(this);
+ ((OptionCategory) owner).addChildCategory(this);
}
}
@@ -497,8 +494,8 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
*/
@Override
public String getManagedBuildRevision() {
- if ( managedBuildRevision == null) {
- if ( getOptionHolder() != null) {
+ if (managedBuildRevision == null) {
+ if (getOptionHolder() != null) {
return getOptionHolder().getManagedBuildRevision();
}
}
@@ -510,8 +507,8 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
*/
@Override
public Version getVersion() {
- if ( version == null) {
- if ( getOptionHolder() != null) {
+ if (version == null) {
+ if (getOptionHolder() != null) {
return getOptionHolder().getVersion();
}
}
@@ -537,9 +534,10 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
// Build the match name.
do {
catName = catOrTool.getName() + "|" + catName; //$NON-NLS-1$
- if (catOrTool instanceof ITool) break;
+ if (catOrTool instanceof ITool)
+ break;
else if (catOrTool instanceof IOptionCategory) {
- catOrTool = ((IOptionCategory)catOrTool).getOwner();
+ catOrTool = ((IOptionCategory) catOrTool).getOwner();
} else
break;
} while (catOrTool != null);
@@ -559,7 +557,7 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
static public Object findOptionCategoryByMatchName(String matchName, IOptionCategory[] cats) {
Object primary = null;
- for (int j=0; j<cats.length; j++) {
+ for (int j = 0; j < cats.length; j++) {
IBuildObject catOrTool = cats[j];
// Build the match name
String catName = makeMatchName(catOrTool);
@@ -589,7 +587,7 @@ public class OptionCategory extends BuildObject implements IOptionCategory {
try {
if (applicabilityCalculatorElement.getAttribute(APPLICABILITY_CALCULATOR) != null)
applicabilityCalculator = (IOptionCategoryApplicability) applicabilityCalculatorElement
- .createExecutableExtension(APPLICABILITY_CALCULATOR);
+ .createExecutableExtension(APPLICABILITY_CALCULATOR);
} catch (CoreException e) {
ManagedBuilderCorePlugin.log(e);
}
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 07380f28a8a..208e34b6ca1 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
@@ -111,7 +111,9 @@ public class OptionReference implements IOption {
int optValType;
try {
optValType = option.getValueType();
- } catch (BuildException e) {return;}
+ } catch (BuildException e) {
+ return;
+ }
// Hook the reference up
owner.addOptionReference(this);
@@ -148,11 +150,11 @@ public class OptionReference implements IOption {
for (int i = 0; i < nodes.getLength(); ++i) {
Node node = nodes.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
- Boolean isBuiltIn = Boolean.valueOf(((Element)node).getAttribute(LIST_ITEM_BUILTIN));
+ Boolean isBuiltIn = Boolean.valueOf(((Element) node).getAttribute(LIST_ITEM_BUILTIN));
if (isBuiltIn.booleanValue()) {
- getBuiltInList().add(((Element)node).getAttribute(LIST_ITEM_VALUE));
+ getBuiltInList().add(((Element) node).getAttribute(LIST_ITEM_VALUE));
} else {
- valueList.add(((Element)node).getAttribute(LIST_ITEM_VALUE));
+ valueList.add(((Element) node).getAttribute(LIST_ITEM_VALUE));
}
}
}
@@ -175,9 +177,9 @@ public class OptionReference implements IOption {
return;
}
if (option instanceof Option) {
- ((Option)option).resolveReferences();
+ ((Option) option).resolveReferences();
} else if (option instanceof OptionReference) {
- ((OptionReference)option).resolveReferences();
+ ((OptionReference) option).resolveReferences();
}
// Note: The "value" loaded here when the optionReference is read from the manifest file.
@@ -185,7 +187,9 @@ public class OptionReference implements IOption {
int optValType;
try {
optValType = option.getValueType();
- } catch (BuildException e) {return;}
+ } catch (BuildException e) {
+ return;
+ }
// value
switch (optValType) {
@@ -223,8 +227,7 @@ public class OptionReference implements IOption {
Boolean isBuiltIn = Boolean.valueOf(valueElement.getAttribute(LIST_ITEM_BUILTIN));
if (isBuiltIn.booleanValue()) {
getBuiltInList().add(SafeStringInterner.safeIntern(valueElement.getAttribute(LIST_ITEM_VALUE)));
- }
- else {
+ } else {
valueList.add(SafeStringInterner.safeIntern(valueElement.getAttribute(LIST_ITEM_VALUE)));
}
}
@@ -251,12 +254,12 @@ public class OptionReference implements IOption {
// value
switch (optValType) {
case BOOLEAN:
- element.setAttribute(DEFAULT_VALUE, ((Boolean)value).toString());
+ element.setAttribute(DEFAULT_VALUE, ((Boolean) value).toString());
break;
case STRING:
case TREE:
case ENUMERATED:
- element.setAttribute(DEFAULT_VALUE, (String)value);
+ element.setAttribute(DEFAULT_VALUE, (String) value);
break;
case STRING_LIST:
case INCLUDE_PATH:
@@ -274,7 +277,7 @@ public class OptionReference implements IOption {
case UNDEF_LIBRARY_FILES:
case UNDEF_MACRO_FILES:
@SuppressWarnings("unchecked")
- ArrayList<String> stringList = (ArrayList<String>)value;
+ ArrayList<String> stringList = (ArrayList<String>) value;
for (String val : stringList) {
Element valueElement = doc.createElement(LIST_VALUE);
valueElement.setAttribute(LIST_ITEM_VALUE, val);
@@ -340,10 +343,9 @@ public class OptionReference implements IOption {
return option.getDefinedSymbols();
} else if (getValueType() == PREPROCESSOR_SYMBOLS) {
@SuppressWarnings("unchecked")
- ArrayList<String> list = (ArrayList<String>)value;
+ ArrayList<String> list = (ArrayList<String>) value;
return list.toArray(new String[list.size()]);
- }
- else {
+ } else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
}
@@ -357,7 +359,8 @@ public class OptionReference implements IOption {
try {
String command = option.getEnumCommand(id);
return command;
- } catch (BuildException e) {}
+ } catch (BuildException e) {
+ }
}
return ""; //$NON-NLS-1$
}
@@ -371,7 +374,8 @@ public class OptionReference implements IOption {
try {
String command = option.getCommand(id);
return command;
- } catch (BuildException e) {}
+ } catch (BuildException e) {
+ }
}
return ""; //$NON-NLS-1$
}
@@ -385,7 +389,8 @@ public class OptionReference implements IOption {
try {
String name = option.getEnumName(id);
return name;
- } catch (BuildException e) {}
+ } catch (BuildException e) {
+ }
}
return ""; //$NON-NLS-1$
}
@@ -399,7 +404,8 @@ public class OptionReference implements IOption {
try {
String name = option.getName(id);
return name;
- } catch (BuildException e) {}
+ } catch (BuildException e) {
+ }
}
return ""; //$NON-NLS-1$
}
@@ -413,7 +419,8 @@ public class OptionReference implements IOption {
try {
String id = option.getEnumeratedId(name);
return id;
- } catch (BuildException e) {}
+ } catch (BuildException e) {
+ }
}
return ""; //$NON-NLS-1$
}
@@ -427,7 +434,8 @@ public class OptionReference implements IOption {
try {
String id = option.getId(name);
return id;
- } catch (BuildException e) {}
+ } catch (BuildException e) {
+ }
}
return ""; //$NON-NLS-1$
}
@@ -450,10 +458,9 @@ public class OptionReference implements IOption {
return option.getIncludePaths();
} else if (getValueType() == INCLUDE_PATH) {
@SuppressWarnings("unchecked")
- ArrayList<String> list = (ArrayList<String>)value;
+ ArrayList<String> list = (ArrayList<String>) value;
return list.toArray(new String[list.size()]);
- }
- else {
+ } else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
}
@@ -464,10 +471,9 @@ public class OptionReference implements IOption {
return option.getLibraries();
} else if (getValueType() == LIBRARIES) {
@SuppressWarnings("unchecked")
- ArrayList<String> list = (ArrayList<String>)value;
+ ArrayList<String> list = (ArrayList<String>) value;
return list.toArray(new String[list.size()]);
- }
- else {
+ } else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
}
@@ -478,10 +484,9 @@ public class OptionReference implements IOption {
return option.getLibraryFiles();
} else if (getValueType() == LIBRARY_FILES) {
@SuppressWarnings("unchecked")
- ArrayList<String> list = (ArrayList<String>)value;
+ ArrayList<String> list = (ArrayList<String>) value;
return list.toArray(new String[list.size()]);
- }
- else {
+ } else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
}
@@ -492,10 +497,9 @@ public class OptionReference implements IOption {
return option.getLibraryPaths();
} else if (getValueType() == LIBRARY_PATHS) {
@SuppressWarnings("unchecked")
- ArrayList<String> list = (ArrayList<String>)value;
+ ArrayList<String> list = (ArrayList<String>) value;
return list.toArray(new String[list.size()]);
- }
- else {
+ } else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
}
@@ -508,10 +512,9 @@ public class OptionReference implements IOption {
@Override
public boolean getBooleanValue() throws BuildException {
- if (value == null){
+ if (value == null) {
return option.getBooleanValue();
- }
- else if (getValueType() == BOOLEAN) {
+ } else if (getValueType() == BOOLEAN) {
Boolean bool = (Boolean) value;
return bool.booleanValue();
} else {
@@ -591,10 +594,9 @@ public class OptionReference implements IOption {
return option.getStringListValue();
} else if (getValueType() == STRING_LIST) {
@SuppressWarnings("unchecked")
- ArrayList<String> list = (ArrayList<String>)value;
+ ArrayList<String> list = (ArrayList<String>) value;
return list.toArray(new String[list.size()]);
- }
- else {
+ } else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
}
@@ -604,9 +606,8 @@ public class OptionReference implements IOption {
if (value == null) {
return option.getStringValue();
} else if (getValueType() == STRING) {
- return (String)value;
- }
- else {
+ return (String) value;
+ } else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
}
@@ -636,10 +637,9 @@ public class OptionReference implements IOption {
return option.getDefinedSymbols();
} else if (getValueType() == OBJECTS) {
@SuppressWarnings("unchecked")
- ArrayList<String> list = (ArrayList<String>)value;
+ ArrayList<String> list = (ArrayList<String>) value;
return list.toArray(new String[list.size()]);
- }
- else {
+ } else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
}
@@ -649,7 +649,9 @@ public class OptionReference implements IOption {
int optValType;
try {
optValType = option.getValueType();
- } catch (BuildException e) {return -1;}
+ } catch (BuildException e) {
+ return -1;
+ }
return optValType;
}
@@ -669,7 +671,7 @@ public class OptionReference implements IOption {
return true;
} else if (option instanceof OptionReference) {
// check the reference we are overriding
- return ((OptionReference)option).references(target);
+ return ((OptionReference) option).references(target);
} else {
// the real reference
return option.equals(target);
@@ -685,8 +687,7 @@ public class OptionReference implements IOption {
public void setValue(boolean value) throws BuildException {
if (getValueType() == BOOLEAN) {
this.value = value;
- }
- else {
+ } else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
}
@@ -707,27 +708,16 @@ public class OptionReference implements IOption {
* @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
- || getValueType() == PREPROCESSOR_SYMBOLS
- || getValueType() == LIBRARIES
- || getValueType() == OBJECTS
- || getValueType() == INCLUDE_FILES
- || getValueType() == LIBRARY_PATHS
- || getValueType() == LIBRARY_FILES
- || getValueType() == MACRO_FILES
- || getValueType() == UNDEF_INCLUDE_PATH
- || getValueType() == UNDEF_PREPROCESSOR_SYMBOLS
- || getValueType() == UNDEF_INCLUDE_FILES
- || getValueType() == UNDEF_LIBRARY_PATHS
- || getValueType() == UNDEF_LIBRARY_FILES
- || getValueType() == UNDEF_MACRO_FILES
- ) {
+ public void setValue(String[] value) throws BuildException {
+ if (getValueType() == STRING_LIST || getValueType() == INCLUDE_PATH || getValueType() == PREPROCESSOR_SYMBOLS
+ || getValueType() == LIBRARIES || getValueType() == OBJECTS || getValueType() == INCLUDE_FILES
+ || getValueType() == LIBRARY_PATHS || getValueType() == LIBRARY_FILES || getValueType() == MACRO_FILES
+ || getValueType() == UNDEF_INCLUDE_PATH || getValueType() == UNDEF_PREPROCESSOR_SYMBOLS
+ || getValueType() == UNDEF_INCLUDE_FILES || getValueType() == UNDEF_LIBRARY_PATHS
+ || getValueType() == UNDEF_LIBRARY_FILES || getValueType() == UNDEF_MACRO_FILES) {
// Just replace what the option reference is holding onto
this.value = new ArrayList<String>(Arrays.asList(value));
- }
- else {
+ } else {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
}
@@ -736,7 +726,7 @@ public class OptionReference implements IOption {
public String toString() {
String answer = ""; //$NON-NLS-1$
if (option != null) {
- answer += "Reference to " + option.getName(); //$NON-NLS-1$
+ answer += "Reference to " + option.getName(); //$NON-NLS-1$
}
if (answer.length() > 0) {
@@ -897,7 +887,7 @@ public class OptionReference implements IOption {
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
@SuppressWarnings("unchecked")
- ArrayList<String> v = (ArrayList<String>)getValue();
+ ArrayList<String> v = (ArrayList<String>) getValue();
if (v == null) {
return new String[0];
}
@@ -907,7 +897,7 @@ public class OptionReference implements IOption {
@Override
public int getBasicValueType() throws BuildException {
- switch(getValueType()){
+ switch (getValueType()) {
case IOption.BOOLEAN:
return IOption.BOOLEAN;
case IOption.STRING:
@@ -922,11 +912,10 @@ public class OptionReference implements IOption {
}
@Override
- public OptionStringValue[] getBasicStringListValueElements()
- throws BuildException {
+ public OptionStringValue[] getBasicStringListValueElements() throws BuildException {
String[] str = getBasicStringListValue();
OptionStringValue[] ve = new OptionStringValue[str.length];
- for(int i = 0; i < str.length; i++){
+ for (int i = 0; i < str.length; i++) {
ve[i] = new OptionStringValue(str[i]);
}
return ve;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionalBuildProperties.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionalBuildProperties.java
index 652114336f1..e4d5ed722fb 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionalBuildProperties.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/OptionalBuildProperties.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Red Hat Inc. - initial contribution
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.internal.core;
@@ -23,36 +23,36 @@ import org.eclipse.cdt.internal.core.SafeStringInterner;
import org.eclipse.cdt.managedbuilder.buildproperties.IOptionalBuildProperties;
public class OptionalBuildProperties implements IOptionalBuildProperties {
-
- public static final String PROPERTY_VALUE_SEPARATOR = "="; //$NON-NLS-1$
+
+ public static final String PROPERTY_VALUE_SEPARATOR = "="; //$NON-NLS-1$
public static final String PROPERTIES_SEPARATOR = ","; //$NON-NLS-1$
-
+
private Map<String, String> fProperties = new HashMap<>();
-
+
public OptionalBuildProperties() {
}
-
+
public OptionalBuildProperties(String properties) {
StringTokenizer t = new StringTokenizer(properties, PROPERTIES_SEPARATOR);
- while(t.hasMoreTokens()){
+ while (t.hasMoreTokens()) {
String property = t.nextToken();
int index = property.indexOf(PROPERTY_VALUE_SEPARATOR);
String id, value;
- if(index != -1){
+ if (index != -1) {
id = SafeStringInterner.safeIntern(property.substring(0, index));
value = SafeStringInterner.safeIntern(property.substring(index + 1));
} else {
id = SafeStringInterner.safeIntern(property);
value = null;
}
- fProperties.put(id, value);
+ fProperties.put(id, value);
}
}
public OptionalBuildProperties(OptionalBuildProperties properties) {
fProperties.putAll(properties.fProperties);
}
-
+
@Override
public String getProperty(String id) {
return fProperties.get(id);
@@ -62,27 +62,27 @@ public class OptionalBuildProperties implements IOptionalBuildProperties {
public void setProperty(String id, String value) {
fProperties.put(id, value);
}
-
+
@Override
- public String[] getProperties(){
+ public String[] getProperties() {
return fProperties.values().toArray(new String[fProperties.size()]);
}
-
+
@Override
public void removeProperty(String id) {
fProperties.remove(id);
}
-
+
@Override
- public String toString(){
+ public String toString() {
int size = fProperties.size();
- Set<Entry<String,String>> entries = fProperties.entrySet();
- if(size == 0)
+ Set<Entry<String, String>> entries = fProperties.entrySet();
+ if (size == 0)
return ""; //$NON-NLS-1$
StringBuilder buf = new StringBuilder();
- Iterator<Entry<String,String>> iterator = entries.iterator();
- Entry<String,String> entry = iterator.next();
+ Iterator<Entry<String, String>> iterator = entries.iterator();
+ Entry<String, String> entry = iterator.next();
buf.append(entry.getKey() + PROPERTY_VALUE_SEPARATOR + entry.getValue());
while (iterator.hasNext()) {
@@ -103,5 +103,4 @@ public class OptionalBuildProperties implements IOptionalBuildProperties {
fProperties.clear();
}
-
}
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 5474a522840..584d3062458 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
@@ -89,7 +89,7 @@ public class OutputType extends BuildObject implements IOutputType {
loadFromManifest(element);
IManagedConfigElement enablements[] = element.getChildren(OptionEnablementExpression.NAME);
- if(enablements.length > 0)
+ if (enablements.length > 0)
booleanExpressionCalculator = new BooleanExpressionApplicabilityCalculator(enablements);
// Hook me up to the Managed Build Manager
@@ -197,7 +197,7 @@ public class OutputType extends BuildObject implements IOutputType {
nameProviderElement = outputType.nameProviderElement;
nameProvider = outputType.nameProvider;
- if(copyIds) {
+ if (copyIds) {
isDirty = outputType.isDirty;
rebuildState = outputType.rebuildState;
} else {
@@ -238,19 +238,19 @@ public class OutputType extends BuildObject implements IOutputType {
optionId = SafeStringInterner.safeIntern(element.getAttribute(IOutputType.OPTION));
// multipleOfType
- String isMOT = element.getAttribute(IOutputType.MULTIPLE_OF_TYPE);
- if (isMOT != null){
- multipleOfType = Boolean.parseBoolean(isMOT);
- }
+ String isMOT = element.getAttribute(IOutputType.MULTIPLE_OF_TYPE);
+ if (isMOT != null) {
+ multipleOfType = Boolean.parseBoolean(isMOT);
+ }
// primaryInputType
primaryInputTypeId = SafeStringInterner.safeIntern(element.getAttribute(IOutputType.PRIMARY_INPUT_TYPE));
// primaryOutput
- String isPO = element.getAttribute(IOutputType.PRIMARY_OUTPUT);
- if (isPO != null){
- primaryOutput = Boolean.parseBoolean(isPO);
- }
+ String isPO = element.getAttribute(IOutputType.PRIMARY_OUTPUT);
+ if (isPO != null) {
+ primaryOutput = Boolean.parseBoolean(isPO);
+ }
// outputPrefix
outputPrefix = SafeStringInterner.safeIntern(element.getAttribute(IOutputType.OUTPUT_PREFIX));
@@ -267,7 +267,7 @@ public class OutputType extends BuildObject implements IOutputType {
// 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();
}
}
@@ -314,7 +314,7 @@ public class OutputType extends BuildObject implements IOutputType {
// multipleOfType
if (element.getAttribute(IOutputType.MULTIPLE_OF_TYPE) != null) {
String isMOT = element.getAttribute(IOutputType.MULTIPLE_OF_TYPE);
- if (isMOT != null){
+ if (isMOT != null) {
multipleOfType = Boolean.parseBoolean(isMOT);
}
}
@@ -326,12 +326,12 @@ public class OutputType extends BuildObject implements IOutputType {
}
// primaryOutput
- if (element.getAttribute(IOutputType.PRIMARY_OUTPUT) != null) {
+ if (element.getAttribute(IOutputType.PRIMARY_OUTPUT) != null) {
String isPO = element.getAttribute(IOutputType.PRIMARY_OUTPUT);
- if (isPO != null){
+ if (isPO != null) {
primaryOutput = Boolean.parseBoolean(isPO);
}
- }
+ }
// outputPrefix
if (element.getAttribute(IOutputType.OUTPUT_PREFIX) != null) {
@@ -471,8 +471,8 @@ public class OutputType extends BuildObject implements IOutputType {
name = getId();
}
String defaultName = name.toUpperCase();
- defaultName = defaultName.replaceAll("\\W", "_"); //$NON-NLS-1$ //$NON-NLS-2$
- defaultName += "_OUTPUTS"; //$NON-NLS-1$
+ defaultName = defaultName.replaceAll("\\W", "_"); //$NON-NLS-1$ //$NON-NLS-2$
+ defaultName += "_OUTPUTS"; //$NON-NLS-1$
return defaultName;
}
}
@@ -484,7 +484,8 @@ public class OutputType extends BuildObject implements IOutputType {
*/
@Override
public void setBuildVariable(String variableName) {
- if (variableName == null && buildVariable == null) return;
+ if (variableName == null && buildVariable == null)
+ return;
if (buildVariable == null || variableName == null || !(variableName.equals(buildVariable))) {
buildVariable = variableName;
setDirty(true);
@@ -501,7 +502,7 @@ public class OutputType extends BuildObject implements IOutputType {
if (superClass != null) {
return superClass.getMultipleOfType();
} else {
- return false; // default is false
+ return false; // default is false
}
}
return multipleOfType.booleanValue();
@@ -540,7 +541,8 @@ public class OutputType extends BuildObject implements IOutputType {
*/
@Override
public void setNamePattern(String pattern) {
- if (pattern == null && namePattern == null) return;
+ if (pattern == null && namePattern == null)
+ return;
if (namePattern == null || pattern == null || !(pattern.equals(namePattern))) {
namePattern = pattern;
setDirty(true);
@@ -554,7 +556,7 @@ public class OutputType extends BuildObject implements IOutputType {
public IConfigurationElement getNameProviderElement() {
if (nameProviderElement == null) {
if (superClass != null) {
- return ((OutputType)superClass).getNameProviderElement();
+ return ((OutputType) superClass).getNameProviderElement();
}
}
return nameProviderElement;
@@ -584,7 +586,8 @@ public class OutputType extends BuildObject implements IOutputType {
nameProvider = (IManagedOutputNameProvider) element.createExecutableExtension(NAME_PROVIDER);
return nameProvider;
}
- } catch (CoreException e) {}
+ } catch (CoreException e) {
+ }
}
return null;
}
@@ -609,7 +612,8 @@ public class OutputType extends BuildObject implements IOutputType {
*/
@Override
public void setOptionId(String id) {
- if (id == null && optionId == null) return;
+ if (id == null && optionId == null)
+ return;
if (id == null || optionId == null || !(optionId.equals(id))) {
optionId = id;
setDirty(true);
@@ -669,7 +673,8 @@ public class OutputType extends BuildObject implements IOutputType {
*/
@Override
public void setOutputExtensionsAttribute(String exts) {
- if (exts == null && outputs == null) return;
+ if (exts == null && outputs == null)
+ return;
if (outputs == null || exts == null || !(exts.equals(outputs))) {
outputs = exts;
setDirty(true);
@@ -681,7 +686,7 @@ public class OutputType extends BuildObject implements IOutputType {
// Use content type if specified and registered with Eclipse
IContentType type = getOutputContentType();
if (type != null) {
- return ((Tool)tool).getContentTypeFileSpecs(type, project);
+ return ((Tool) tool).getContentTypeFileSpecs(type, project);
}
return getOutputExtensionsAttribute();
}
@@ -691,7 +696,7 @@ public class OutputType extends BuildObject implements IOutputType {
*/
@Override
public String[] getOutputExtensions(ITool tool) {
- return getOutputExtensions(tool, ((Tool)tool).getProject());
+ return getOutputExtensions(tool, ((Tool) tool).getProject());
}
/* (non-Javadoc)
@@ -701,8 +706,9 @@ public class OutputType extends BuildObject implements IOutputType {
public boolean isOutputExtension(ITool tool, String ext) {
String[] exts = getOutputExtensions(tool);
if (exts != null) {
- for (int i=0; i<exts.length; i++) {
- if (ext.equals(exts[i])) return true;
+ for (int i = 0; i < exts.length; i++) {
+ if (ext.equals(exts[i]))
+ return true;
}
}
return false;
@@ -729,7 +735,8 @@ public class OutputType extends BuildObject implements IOutputType {
*/
@Override
public void setOutputPrefix(String prefix) {
- if (prefix == null && outputPrefix == null) return;
+ if (prefix == null && outputPrefix == null)
+ return;
if (outputPrefix == null || prefix == null || !(prefix.equals(outputPrefix))) {
outputPrefix = prefix;
setDirty(true);
@@ -754,13 +761,13 @@ public class OutputType extends BuildObject implements IOutputType {
return nameTokens;
}
-
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOuputType#setOutputNames()
*/
@Override
public void setOutputNames(String names) {
- if (names == null && outputNames == null) return;
+ if (names == null && outputNames == null)
+ return;
if (outputNames == null || names == null || !(names.equals(outputNames))) {
outputNames = names;
setDirty(true);
@@ -811,7 +818,7 @@ public class OutputType extends BuildObject implements IOutputType {
if (superClass != null) {
return superClass.getPrimaryOutput();
} else {
- return false; // default is false
+ return false; // default is false
}
}
return primaryOutput.booleanValue();
@@ -847,7 +854,8 @@ public class OutputType extends BuildObject implements IOutputType {
@Override
public boolean isDirty() {
// This shouldn't be called for an extension OutputType
- if (isExtensionOutputType) return false;
+ if (isExtensionOutputType)
+ return false;
return isDirty;
}
@@ -870,10 +878,8 @@ public class OutputType extends BuildObject implements IOutputType {
superClass = ManagedBuildManager.getExtensionOutputType(superClassId);
if (superClass == null) {
// Report error
- ManagedBuildManager.outputResolveError(
- "superClass", //$NON-NLS-1$
- superClassId,
- "outputType", //$NON-NLS-1$
+ ManagedBuildManager.outputResolveError("superClass", //$NON-NLS-1$
+ superClassId, "outputType", //$NON-NLS-1$
getId());
}
}
@@ -896,8 +902,8 @@ public class OutputType extends BuildObject implements IOutputType {
*/
@Override
public String getManagedBuildRevision() {
- if ( managedBuildRevision == null) {
- if ( getParent() != null) {
+ if (managedBuildRevision == null) {
+ if (getParent() != null) {
return getParent().getManagedBuildRevision();
}
}
@@ -909,8 +915,8 @@ public class OutputType extends BuildObject implements IOutputType {
*/
@Override
public Version getVersion() {
- if ( version == null) {
- if ( getParent() != null) {
+ if (version == null) {
+ if (getParent() != null) {
return getParent().getVersion();
}
}
@@ -922,38 +928,38 @@ public class OutputType extends BuildObject implements IOutputType {
// Do nothing
}
- public boolean needsRebuild(){
+ public boolean needsRebuild() {
return rebuildState;
}
- public void setRebuildState(boolean rebuild){
- if(isExtensionElement() && rebuild)
+ public void setRebuildState(boolean rebuild) {
+ if (isExtensionElement() && rebuild)
return;
rebuildState = rebuild;
}
- public BooleanExpressionApplicabilityCalculator getBooleanExpressionCalculator(){
- if(booleanExpressionCalculator == null){
- if(superClass != null){
- return ((OutputType)superClass).getBooleanExpressionCalculator();
+ public BooleanExpressionApplicabilityCalculator getBooleanExpressionCalculator() {
+ if (booleanExpressionCalculator == null) {
+ if (superClass != null) {
+ return ((OutputType) superClass).getBooleanExpressionCalculator();
}
}
return booleanExpressionCalculator;
}
public boolean isEnabled(ITool tool) {
- if(tool.isExtensionElement())
+ if (tool.isExtensionElement())
return true;
BooleanExpressionApplicabilityCalculator calc = getBooleanExpressionCalculator();
- if(calc == null)
+ if (calc == null)
return true;
return calc.isOutputTypeEnabled(tool, this);
}
- public boolean hasCustomSettings(){
+ public boolean hasCustomSettings() {
//TODO:
return false;
}
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 93e4c020340..069db10bb44 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
@@ -43,8 +43,8 @@ import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.Platform;
import org.osgi.framework.Version;
-
-public class ProjectType extends BuildObject implements IProjectType, IBuildPropertiesRestriction, IBuildPropertyChangeListener {
+public class ProjectType extends BuildObject
+ implements IProjectType, IBuildPropertiesRestriction, IBuildPropertyChangeListener {
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
//private static final IConfiguration[] emptyConfigs = new IConfiguration[0];
@@ -53,7 +53,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
private IProjectType superClass;
private String superClassId;
// Parent and children
- private List<Configuration> configList; // Configurations of this project type
+ private List<Configuration> configList; // Configurations of this project type
private Map<String, IConfiguration> configMap;
// Managed Build model attributes
private Boolean isAbstract;
@@ -72,7 +72,6 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
BuildObjectProperties buildProperties;
OptionalBuildProperties optionalBuildProperties;
-
// Miscellaneous
private boolean resolved = true;
private IConfigurationElement previousMbsVersionConversionElement;
@@ -100,10 +99,10 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
// Load the configuration children
IManagedConfigElement[] configs = element.getChildren(IConfiguration.CONFIGURATION_ELEMENT_NAME);
- String [] usedConfigNames = new String[configs.length];
+ String[] usedConfigNames = new String[configs.length];
IConfigurationNameProvider configurationNameProvder = getConfigurationNameProvider();
- if ( configurationNameProvder != null ) {
+ if (configurationNameProvder != null) {
// Tool Integrator provided 'ConfigurationNameProvider' class
// to get configuration names dynamically based architecture, os, toolchain version etc.
for (int n = 0; n < configs.length; ++n) {
@@ -170,12 +169,12 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
superClassId = SafeStringInterner.safeIntern(element.getAttribute(SUPERCLASS));
String props = SafeStringInterner.safeIntern(element.getAttribute(BUILD_PROPERTIES));
- if(props != null)
+ if (props != null)
buildProperties = new BuildObjectProperties(props, this, this);
String artType = SafeStringInterner.safeIntern(element.getAttribute(BUILD_ARTEFACT_TYPE));
- if(artType != null){
- if(buildProperties == null)
+ if (artType != null) {
+ if (buildProperties == null)
buildProperties = new BuildObjectProperties(this, this);
try {
@@ -185,37 +184,37 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
}
}
-
// Get the unused children, if any
unusedChildren = SafeStringInterner.safeIntern(element.getAttribute(UNUSED_CHILDREN));
// isAbstract
- String isAbs = element.getAttribute(IS_ABSTRACT);
- if (isAbs != null){
- isAbstract = Boolean.parseBoolean(isAbs);
- }
+ String isAbs = element.getAttribute(IS_ABSTRACT);
+ if (isAbs != null) {
+ isAbstract = Boolean.parseBoolean(isAbs);
+ }
// Is this a test project type
String isTestStr = element.getAttribute(IS_TEST);
- if (isTestStr != null){
- isTest = Boolean.parseBoolean(isTestStr);
- }
+ if (isTestStr != null) {
+ isTest = Boolean.parseBoolean(isTestStr);
+ }
// 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();
+ if (element.getAttribute(CONFIGURATION_NAME_PROVIDER) != null
+ && element instanceof DefaultManagedConfigElement) {
+ configurationNameProviderElement = ((DefaultManagedConfigElement) element).getConfigurationElement();
}
// Get the environmentVariableSupplier configuration element
String environmentVariableSupplier = element.getAttribute(PROJECT_ENVIRONMENT_SUPPLIER);
- if(environmentVariableSupplier != null && element instanceof DefaultManagedConfigElement){
- environmentVariableSupplierElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
+ if (environmentVariableSupplier != null && element instanceof DefaultManagedConfigElement) {
+ environmentVariableSupplierElement = ((DefaultManagedConfigElement) element).getConfigurationElement();
}
// Get the buildMacroSupplier configuration element
String buildMacroSupplier = element.getAttribute(PROJECT_MACRO_SUPPLIER);
- if(buildMacroSupplier != null && element instanceof DefaultManagedConfigElement){
- buildMacroSupplierElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
+ if (buildMacroSupplier != null && element instanceof DefaultManagedConfigElement) {
+ buildMacroSupplierElement = ((DefaultManagedConfigElement) element).getConfigurationElement();
}
// Get the 'convertToId' attribute if it is available
@@ -232,7 +231,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
@Override
public IConfiguration createConfiguration(IConfiguration parent, String id, String name) {
Configuration config = new Configuration(this, parent, id, name);
-// ManagedBuildManager.performValueHandlerEvent(config, IManagedOptionValueHandler.EVENT_OPEN);
+ // ManagedBuildManager.performValueHandlerEvent(config, IManagedOptionValueHandler.EVENT_OPEN);
return config;
}
@@ -261,12 +260,12 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
// Remove the specified configuration from the list and map
Iterator<Configuration> iter = getConfigurationList().listIterator();
while (iter.hasNext()) {
- IConfiguration config = iter.next();
- if (config.getId().equals(id)) {
- getConfigurationList().remove(config);
+ IConfiguration config = iter.next();
+ if (config.getId().equals(id)) {
+ getConfigurationList().remove(config);
getConfigurationMap().remove(id);
- break;
- }
+ break;
+ }
}
}
@@ -274,7 +273,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
* Adds the Configuration to the Configuration list and map
*/
public void addConfiguration(Configuration configuration) {
- if(!configuration.isTemporary()){
+ if (!configuration.isTemporary()) {
getConfigurationList().add(configuration);
getConfigurationMap().put(configuration.getId(), configuration);
}
@@ -312,10 +311,10 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
@Override
public String getName() {
String name = getNameAttribute();
- if(name.length() == 0){
+ if (name.length() == 0) {
IBuildObjectProperties props = getBuildProperties();
IBuildProperty prop = props.getProperty(ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID);
- if(prop != null)
+ if (prop != null)
name = prop.getValue().getName();
}
return name;
@@ -351,7 +350,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
if (isAbstract != null) {
return isAbstract.booleanValue();
} else {
- return false; // Note: no inheritance from superClass
+ return false; // Note: no inheritance from superClass
}
}
@@ -363,7 +362,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
if (unusedChildren != null) {
return unusedChildren;
} else
- return EMPTY_STRING; // Note: no inheritance from superClass
+ return EMPTY_STRING; // Note: no inheritance from superClass
}
/* (non-Javadoc)
@@ -412,34 +411,33 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
superClass = ManagedBuildManager.getExtensionProjectType(superClassId);
if (superClass == null) {
// Report error
- ManagedBuildManager.outputResolveError(
- "superClass", //$NON-NLS-1$
- superClassId,
- "projectType", //$NON-NLS-1$
+ ManagedBuildManager.outputResolveError("superClass", //$NON-NLS-1$
+ superClassId, "projectType", //$NON-NLS-1$
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: {
- IConfiguration[] currentConfigs = getConfigurations();
- for (int j = 0; j < currentConfigs.length; j++) {
- IConfiguration config = currentConfigs[j];
- while (config.getParent() != null) {
- if (config.getParent().getId().equals(superId)) break check;
- config = config.getParent();
- }
- }
- addConfiguration((Configuration)superConfigs[i]);
- } // end check
-
- }
+ ((ProjectType) superClass).resolveReferences();
+ IConfiguration[] superConfigs = superClass.getConfigurations();
+ for (int i = 0; i < superConfigs.length; i++) {
+ String superId = superConfigs[i].getId();
+
+ check: {
+ IConfiguration[] currentConfigs = getConfigurations();
+ for (int j = 0; j < currentConfigs.length; j++) {
+ IConfiguration config = currentConfigs[j];
+ while (config.getParent() != null) {
+ if (config.getParent().getId().equals(superId))
+ break check;
+ config = config.getParent();
+ }
+ }
+ addConfiguration((Configuration) superConfigs[i]);
+ } // end check
+
+ }
}
// Call resolve references on any children
@@ -454,10 +452,10 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
* @see org.eclipse.cdt.core.build.managed.IProjectType#isSupported()
*/
@Override
- public boolean isSupported(){
+ public boolean isSupported() {
List<Configuration> configurationList = getConfigurationList();
for (Configuration current : configurationList) {
- if(current.isSupported())
+ if (current.isSupported())
return true;
}
return false;
@@ -467,9 +465,9 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
* @see org.eclipse.cdt.core.build.managed.IProjectType#getConfigurationNameProviderElement()
*/
public IConfigurationElement getConfigurationNameProviderElement() {
- if(configurationNameProviderElement == null){
- if(superClass != null) {
- ProjectType tmpSuperClass = (ProjectType)superClass;
+ if (configurationNameProviderElement == null) {
+ if (superClass != null) {
+ ProjectType tmpSuperClass = (ProjectType) superClass;
return tmpSuperClass.getConfigurationNameProviderElement();
}
}
@@ -498,10 +496,12 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
if (element != null) {
try {
if (element.getAttribute(CONFIGURATION_NAME_PROVIDER) != null) {
- configurationNameProvider = (IConfigurationNameProvider) element.createExecutableExtension(CONFIGURATION_NAME_PROVIDER);
+ configurationNameProvider = (IConfigurationNameProvider) element
+ .createExecutableExtension(CONFIGURATION_NAME_PROVIDER);
return configurationNameProvider;
}
- } catch (CoreException e) {}
+ } catch (CoreException e) {
+ }
}
return null;
}
@@ -511,21 +511,20 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
*
* @return IConfigurationElement
*/
- public IConfigurationElement getEnvironmentVariableSupplierElement(){
+ public IConfigurationElement getEnvironmentVariableSupplierElement() {
if (environmentVariableSupplierElement == null) {
if (superClass != null && superClass instanceof ProjectType) {
- return ((ProjectType)superClass).getEnvironmentVariableSupplierElement();
+ return ((ProjectType) superClass).getEnvironmentVariableSupplierElement();
}
}
return environmentVariableSupplierElement;
}
-
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IProjectType#getEnvironmentVariableSupplier()
*/
@Override
- public IProjectEnvironmentVariableSupplier getEnvironmentVariableSupplier(){
+ public IProjectEnvironmentVariableSupplier getEnvironmentVariableSupplier() {
if (environmentVariableSupplier != null) {
return environmentVariableSupplier;
}
@@ -533,10 +532,12 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
if (element != null) {
try {
if (element.getAttribute(PROJECT_ENVIRONMENT_SUPPLIER) != null) {
- environmentVariableSupplier = (IProjectEnvironmentVariableSupplier) element.createExecutableExtension(PROJECT_ENVIRONMENT_SUPPLIER);
+ environmentVariableSupplier = (IProjectEnvironmentVariableSupplier) element
+ .createExecutableExtension(PROJECT_ENVIRONMENT_SUPPLIER);
return environmentVariableSupplier;
}
- } catch (CoreException e) {}
+ } catch (CoreException e) {
+ }
}
return null;
}
@@ -546,21 +547,20 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
*
* @return IConfigurationElement
*/
- public IConfigurationElement getBuildMacroSupplierElement(){
+ public IConfigurationElement getBuildMacroSupplierElement() {
if (buildMacroSupplierElement == null) {
if (superClass != null && superClass instanceof ProjectType) {
- return ((ProjectType)superClass).getBuildMacroSupplierElement();
+ return ((ProjectType) superClass).getBuildMacroSupplierElement();
}
}
return buildMacroSupplierElement;
}
-
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IProjectType#getBuildMacroSupplier()
*/
@Override
- public IProjectBuildMacroSupplier getBuildMacroSupplier(){
+ public IProjectBuildMacroSupplier getBuildMacroSupplier() {
if (buildMacroSupplier != null) {
return buildMacroSupplier;
}
@@ -568,15 +568,16 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
if (element != null) {
try {
if (element.getAttribute(PROJECT_MACRO_SUPPLIER) != null) {
- buildMacroSupplier = (IProjectBuildMacroSupplier) element.createExecutableExtension(PROJECT_MACRO_SUPPLIER);
+ buildMacroSupplier = (IProjectBuildMacroSupplier) element
+ .createExecutableExtension(PROJECT_MACRO_SUPPLIER);
return buildMacroSupplier;
}
- } catch (CoreException e) {}
+ } catch (CoreException e) {
+ }
}
return null;
}
-
@Override
public String getConvertToId() {
if (convertToId == null) {
@@ -590,10 +591,10 @@ 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)
+ return;
if (convertToId == null || this.convertToId == null || !convertToId.equals(this.convertToId)) {
this.convertToId = convertToId;
}
@@ -611,17 +612,17 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
String convertToId = getConvertToId();
if ((convertToId == null) || (convertToId.isEmpty())) {
- // It means there is no 'convertToId' attribute available and
- // the project type is still actively
- // supported by the tool integrator. So do nothing, just return
- return true;
+ // It means there is no 'convertToId' attribute available and
+ // the project type is still actively
+ // supported by the tool integrator. So do nothing, just return
+ return true;
} else {
- // In case the 'convertToId' attribute is available,
- // it means that Tool integrator currently does not support this
- // project type.
- // Look for the converters available for this project type.
+ // In case the 'convertToId' attribute is available,
+ // it means that Tool integrator currently does not support this
+ // project type.
+ // Look for the converters available for this project type.
- return getConverter(convertToId);
+ return getConverter(convertToId);
}
}
@@ -632,16 +633,15 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
String toId = null;
// Get the Converter Extension Point
- IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
- .getExtensionPoint("org.eclipse.cdt.managedbuilder.core", //$NON-NLS-1$
- "projectConverter"); //$NON-NLS-1$
+ IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(
+ "org.eclipse.cdt.managedbuilder.core", //$NON-NLS-1$
+ "projectConverter"); //$NON-NLS-1$
if (extensionPoint != null) {
// Get the extensions
IExtension[] extensions = extensionPoint.getExtensions();
for (int i = 0; i < extensions.length; i++) {
// Get the configuration elements of each extension
- IConfigurationElement[] configElements = extensions[i]
- .getConfigurationElements();
+ IConfigurationElement[] configElements = extensions[i].getConfigurationElements();
for (int j = 0; j < configElements.length; j++) {
IConfigurationElement element = configElements[j];
@@ -653,16 +653,13 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
// Check whether the current converter can be used for
// the selected project type
- if (fromId.equals(getId())
- && toId.equals(convertToId)) {
+ if (fromId.equals(getId()) && toId.equals(convertToId)) {
// If it matches
- String mbsVersion = element
- .getAttribute("mbsVersion"); //$NON-NLS-1$
- Version currentMbsVersion = ManagedBuildManager
- .getBuildInfoVersion();
+ String mbsVersion = element.getAttribute("mbsVersion"); //$NON-NLS-1$
+ Version currentMbsVersion = ManagedBuildManager.getBuildInfoVersion();
// set the converter element based on the MbsVersion
- if (currentMbsVersion.compareTo(new Version(mbsVersion))>0) {
+ if (currentMbsVersion.compareTo(new Version(mbsVersion)) > 0) {
previousMbsVersionConversionElement = element;
} else {
currentMbsVersionConversionElement = element;
@@ -681,7 +678,6 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
return false;
}
-
public IConfigurationElement getPreviousMbsVersionConversionElement() {
return previousMbsVersionConversionElement;
}
@@ -692,9 +688,9 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
@Override
public IBuildObjectProperties getBuildProperties() {
- if(buildProperties == null){
+ if (buildProperties == null) {
BuildObjectProperties parentProps = findBuildProperties();
- if(parentProps != null)
+ if (parentProps != null)
buildProperties = new BuildObjectProperties(parentProps, this, this);
else
buildProperties = new BuildObjectProperties(this, this);
@@ -702,10 +698,10 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
return buildProperties;
}
- BuildObjectProperties findBuildProperties(){
- if(buildProperties == null){
- if(superClass != null){
- return ((ProjectType)superClass).findBuildProperties();
+ BuildObjectProperties findBuildProperties() {
+ if (buildProperties == null) {
+ if (superClass != null) {
+ return ((ProjectType) superClass).findBuildProperties();
}
return null;
}
@@ -714,9 +710,9 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
@Override
public IOptionalBuildProperties getOptionalBuildProperties() {
- if(optionalBuildProperties == null){
+ if (optionalBuildProperties == null) {
OptionalBuildProperties parentProps = findOptionalBuildProperties();
- if(parentProps != null)
+ if (parentProps != null)
optionalBuildProperties = new OptionalBuildProperties(parentProps);
else
optionalBuildProperties = new OptionalBuildProperties();
@@ -724,10 +720,10 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
return optionalBuildProperties;
}
- OptionalBuildProperties findOptionalBuildProperties(){
- if(optionalBuildProperties == null){
- if(superClass != null){
- return ((ProjectType)superClass).findOptionalBuildProperties();
+ OptionalBuildProperties findOptionalBuildProperties() {
+ if (optionalBuildProperties == null) {
+ if (superClass != null) {
+ return ((ProjectType) superClass).findOptionalBuildProperties();
}
return null;
}
@@ -737,7 +733,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
@Override
public void propertiesChanged() {
List<Configuration> list = getConfigurationList();
- for(int i = 0; i < list.size(); i++){
+ for (int i = 0; i < list.size(); i++) {
list.get(i).propertiesChanged();
}
}
@@ -746,16 +742,15 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
return supportsType(type.getId());
}
- public boolean supportsValue(IBuildPropertyType type,
- IBuildPropertyValue value) {
+ public boolean supportsValue(IBuildPropertyType type, IBuildPropertyValue value) {
return supportsValue(type.getId(), value.getId());
}
@Override
public boolean supportsType(String typeId) {
List<Configuration> list = getConfigurationList();
- for(int i = 0; i < list.size(); i++){
- if(list.get(i).supportsType(typeId))
+ for (int i = 0; i < list.size(); i++) {
+ if (list.get(i).supportsType(typeId))
return true;
}
return false;
@@ -764,8 +759,8 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
@Override
public boolean supportsValue(String typeId, String valueId) {
List<Configuration> list = getConfigurationList();
- for(int i = 0; i < list.size(); i++){
- if(list.get(i).supportsValue(typeId, valueId))
+ for (int i = 0; i < list.size(); i++) {
+ if (list.get(i).supportsValue(typeId, valueId))
return true;
}
return false;
@@ -775,7 +770,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
public String[] getRequiredTypeIds() {
List<String> result = new ArrayList<String>();
List<Configuration> list = getConfigurationList();
- for(int i = 0; i < list.size(); i++){
+ for (int i = 0; i < list.size(); i++) {
result.addAll(Arrays.asList((list.get(i)).getRequiredTypeIds()));
}
return result.toArray(new String[result.size()]);
@@ -785,7 +780,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
public String[] getSupportedTypeIds() {
List<String> result = new ArrayList<String>();
List<Configuration> list = getConfigurationList();
- for(int i = 0; i < list.size(); i++){
+ for (int i = 0; i < list.size(); i++) {
result.addAll(Arrays.asList((list.get(i)).getSupportedTypeIds()));
}
return result.toArray(new String[result.size()]);
@@ -795,7 +790,7 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
public String[] getSupportedValueIds(String typeId) {
List<String> result = new ArrayList<String>();
List<Configuration> list = getConfigurationList();
- for(int i = 0; i < list.size(); i++){
+ for (int i = 0; i < list.size(); i++) {
result.addAll(Arrays.asList((list.get(i)).getSupportedValueIds(typeId)));
}
return result.toArray(new String[result.size()]);
@@ -804,8 +799,8 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
@Override
public boolean requiresType(String typeId) {
List<Configuration> list = getConfigurationList();
- for(int i = 0; i < list.size(); i++){
- if(list.get(i).requiresType(typeId))
+ for (int i = 0; i < list.size(); i++) {
+ if (list.get(i).requiresType(typeId))
return true;
}
return false;
@@ -814,9 +809,9 @@ public class ProjectType extends BuildObject implements IProjectType, IBuildProp
@Override
public IBuildPropertyValue getBuildArtefactType() {
IBuildObjectProperties props = findBuildProperties();
- if(props != null){
+ if (props != null) {
IBuildProperty prop = props.getProperty(ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID);
- if(prop != null)
+ if (prop != null)
return prop.getValue();
}
return null;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PropertyManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PropertyManager.java
index a84718d8571..ad4ea33fc02 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PropertyManager.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PropertyManager.java
@@ -47,242 +47,242 @@ import org.osgi.service.prefs.Preferences;
*
*/
public class PropertyManager {
-// private static final String PROPS_PROPERTY = "properties"; //$NON-NLS-1$
-// private static final QualifiedName propsSessionProperty = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), PROPS_PROPERTY);
+ // private static final String PROPS_PROPERTY = "properties"; //$NON-NLS-1$
+ // private static final QualifiedName propsSessionProperty = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), PROPS_PROPERTY);
+
+ private static final String NODE_NAME = "properties"; //$NON-NLS-1$
- private static final String NODE_NAME = "properties"; //$NON-NLS-1$
-
private static PropertyManager fInstance;
-
+
private LoaddedInfo fLoaddedInfo;
-
+
private static class LoaddedInfo {
private final IProject fProject;
private final String fCfgId;
// one of Map<String, String> or Map<String, Map<String, Properties>>
private final Map<String, Object> fCfgPropertyMap;
-
- LoaddedInfo(IProject project, String cfgId, Map<String, Object> cfgPropertyMap){
+
+ LoaddedInfo(IProject project, String cfgId, Map<String, Object> cfgPropertyMap) {
fProject = project;
fCfgId = cfgId;
fCfgPropertyMap = cfgPropertyMap;
}
-
- public IConfiguration getConfiguration(){
+
+ public IConfiguration getConfiguration() {
return PropertyManager.getConfigurationFromId(fProject, fCfgId);
}
- public IProject getProject(){
+ public IProject getProject() {
return fProject;
}
- public String getConfigurationId(){
+ public String getConfigurationId() {
return fCfgId;
}
- public Map<String, Object> getProperties(){
+ public Map<String, Object> getProperties() {
return fCfgPropertyMap;
}
-
- public boolean cfgMatch(IConfiguration cfg){
- if(fCfgId == null || fProject == null)
+
+ public boolean cfgMatch(IConfiguration cfg) {
+ if (fCfgId == null || fProject == null)
return false;
-
- if(!fCfgId.equals(cfg.getId()))
+
+ if (!fCfgId.equals(cfg.getId()))
return false;
-
- if(!fProject.equals(PropertyManager.getProject(cfg)))
+
+ if (!fProject.equals(PropertyManager.getProject(cfg)))
return false;
-
+
return true;
}
}
- private PropertyManager(){
+ private PropertyManager() {
}
-
- public static PropertyManager getInstance(){
- if(fInstance == null)
+
+ public static PropertyManager getInstance() {
+ if (fInstance == null)
fInstance = new PropertyManager();
return fInstance;
}
- protected void setProperty(IConfiguration cfg, IBuildObject bo, String prop, String value){
- if(((Configuration)cfg).isPreference())
+ protected void setProperty(IConfiguration cfg, IBuildObject bo, String prop, String value) {
+ if (((Configuration) cfg).isPreference())
return;
Properties props = getProperties(cfg, bo);
- if(props != null){
+ if (props != null) {
props.setProperty(prop, value);
}
}
- protected String getProperty(IConfiguration cfg, IBuildObject bo, String prop){
- if(((Configuration)cfg).isPreference())
+ protected String getProperty(IConfiguration cfg, IBuildObject bo, String prop) {
+ if (((Configuration) cfg).isPreference())
return null;
Properties props = getProperties(cfg, bo);
- if(props != null)
+ if (props != null)
return props.getProperty(prop);
return null;
}
-
- protected Properties getProperties(IConfiguration cfg, IBuildObject bo){
+
+ protected Properties getProperties(IConfiguration cfg, IBuildObject bo) {
return loadProperties(cfg, bo);
}
-
- private LoaddedInfo getLoaddedInfo(){
+
+ private LoaddedInfo getLoaddedInfo() {
return fLoaddedInfo;
}
- private synchronized void setLoaddedInfo(LoaddedInfo info){
+ private synchronized void setLoaddedInfo(LoaddedInfo info) {
fLoaddedInfo = info;
}
- protected Map<String, Object> getLoaddedData(IConfiguration cfg){
+
+ protected Map<String, Object> getLoaddedData(IConfiguration cfg) {
LoaddedInfo info = getLoaddedInfo();
- if(info == null)
+ if (info == null)
return null;
-
- if(!info.cfgMatch(cfg))
+
+ if (!info.cfgMatch(cfg))
return null;
-
- return info.getProperties();
-// Map map = null;
-// IProject proj = null;
-// try {
-// if(!((Configuration)cfg).isPreference()){
-// proj = cfg.getOwner().getProject();
-// map = (Map)proj.getSessionProperty(propsSessionProperty);
-// }
-// if(map == null){
-// map = new HashMap();
-// if(proj != null){
-// proj.setSessionProperty(propsSessionProperty, map);
-// }
-// }
-// map = (Map)map.get(cfg.getId());
-// } catch (CoreException e) {
-// }
-// return map;
- }
-
- protected synchronized void clearLoaddedData(IConfiguration cfg){
- if(((Configuration)cfg).isPreference())
+
+ return info.getProperties();
+ // Map map = null;
+ // IProject proj = null;
+ // try {
+ // if(!((Configuration)cfg).isPreference()){
+ // proj = cfg.getOwner().getProject();
+ // map = (Map)proj.getSessionProperty(propsSessionProperty);
+ // }
+ // if(map == null){
+ // map = new HashMap();
+ // if(proj != null){
+ // proj.setSessionProperty(propsSessionProperty, map);
+ // }
+ // }
+ // map = (Map)map.get(cfg.getId());
+ // } catch (CoreException e) {
+ // }
+ // return map;
+ }
+
+ protected synchronized void clearLoaddedData(IConfiguration cfg) {
+ if (((Configuration) cfg).isPreference())
return;
LoaddedInfo info = getLoaddedInfo();
- if(info == null)
+ if (info == null)
return;
-
- if(info.cfgMatch(cfg))
+
+ if (info.cfgMatch(cfg))
setLoaddedInfo(null);
-// IProject proj = cfg.getOwner().getProject();
-// try {
-// proj.setSessionProperty(propsSessionProperty, null);
-// } catch (CoreException e) {
-// }
- }
-
- private static IProject getProject(IConfiguration cfg){
+ // IProject proj = cfg.getOwner().getProject();
+ // try {
+ // proj.setSessionProperty(propsSessionProperty, null);
+ // } catch (CoreException e) {
+ // }
+ }
+
+ private static IProject getProject(IConfiguration cfg) {
IResource rc = cfg.getOwner();
return rc != null ? rc.getProject() : null;
}
- protected Properties loadProperties(IConfiguration cfg, IBuildObject bo){
+ protected Properties loadProperties(IConfiguration cfg, IBuildObject bo) {
Map<String, Object> map = getData(cfg);
-
+
return getPropsFromData(map, bo);
}
-
- protected Properties getPropsFromData(Map<String, Object> data, IBuildObject bo){
+
+ protected Properties getPropsFromData(Map<String, Object> data, IBuildObject bo) {
synchronized (data) {
Object oVal = data.get(bo.getId());
Properties props = null;
- if(oVal instanceof String){
- props = stringToProps((String)oVal);
+ if (oVal instanceof String) {
+ props = stringToProps((String) oVal);
data.put(bo.getId(), props);
- } else if (oVal instanceof Properties){
- props = (Properties)oVal;
+ } else if (oVal instanceof Properties) {
+ props = (Properties) oVal;
}
-
- if(props == null){
+
+ if (props == null) {
props = new Properties();
data.put(bo.getId(), props);
- }
+ }
return props;
}
}
-
- protected void storeData(IConfiguration cfg){
+ protected void storeData(IConfiguration cfg) {
Map<String, Object> map = getLoaddedData(cfg);
- if(map != null)
+ if (map != null)
storeData(cfg, map);
}
- protected Properties mapToProps(Map<String, Object> map){
+ protected Properties mapToProps(Map<String, Object> map) {
Properties props = null;
- if(map != null){
- synchronized(map){
- if(map.size() > 0){
+ if (map != null) {
+ synchronized (map) {
+ if (map.size() > 0) {
props = new Properties();
Set<Entry<String, Object>> entrySet = map.entrySet();
for (Entry<String, Object> entry : entrySet) {
String key = entry.getKey();
String value = null;
Object oVal = entry.getValue();
- if(oVal instanceof Properties){
- value = propsToString((Properties)oVal);
- } else if (oVal instanceof String){
- value = (String)oVal;
+ if (oVal instanceof Properties) {
+ value = propsToString((Properties) oVal);
+ } else if (oVal instanceof String) {
+ value = (String) oVal;
}
-
- if(key != null && value != null)
+
+ if (key != null && value != null)
props.setProperty(key, value);
}
}
}
}
-
+
return props;
}
-
- protected String propsToString(Properties props){
- if(props == null || props.size() == 0)
+
+ protected String propsToString(Properties props) {
+ if (props == null || props.size() == 0)
return null;
-
+
ByteArrayOutputStream stream = new ByteArrayOutputStream();
try {
- props.store(stream, null);
+ props.store(stream, null);
} catch (IOException e1) {
}
- byte[] bytes= stream.toByteArray();
-
+ byte[] bytes = stream.toByteArray();
+
String value = null;
try {
- value= new String(bytes, "UTF-8"); //$NON-NLS-1$
+ value = new String(bytes, "UTF-8"); //$NON-NLS-1$
} catch (UnsupportedEncodingException e) {
- value= new String(bytes);
+ value = new String(bytes);
}
-
- /* FIX for Bug 405744: Properties.store() always starts the serialzed string with
- * a timestamp comment. That constantly changing comment causes the preference-store
- * to perform many unnecessary file-writes into the workspace metadata, even when
+
+ /* FIX for Bug 405744: Properties.store() always starts the serialzed string with
+ * a timestamp comment. That constantly changing comment causes the preference-store
+ * to perform many unnecessary file-writes into the workspace metadata, even when
* the properties don't change. The comment is ignored by Properties.load(), so
* just remove it here.
*/
String sep = System.getProperty("line.separator"); //$NON-NLS-1$
- while(value.charAt(0) == '#') {
+ while (value.charAt(0) == '#') {
value = value.substring(value.indexOf(sep) + sep.length());
}
-
+
return value;
}
-
- protected Properties stringToProps(String str){
+
+ protected Properties stringToProps(String str) {
Properties props = null;
- if(str != null){
+ if (str != null) {
props = new Properties();
byte[] bytes;
try {
@@ -300,8 +300,8 @@ public class PropertyManager {
}
return props;
}
-
- protected void storeData(IConfiguration cfg, Map<String, Object> map){
+
+ protected void storeData(IConfiguration cfg, Map<String, Object> map) {
String str = null;
Properties props = mapToProps(map);
@@ -309,11 +309,11 @@ public class PropertyManager {
storeString(cfg, str);
}
-
- protected void storeString(IConfiguration cfg, String str){
+
+ protected void storeString(IConfiguration cfg, String str) {
Preferences prefs = getNode(cfg.getManagedProject());
- if(prefs != null){
- if(str != null)
+ if (prefs != null) {
+ if (str != null)
prefs.put(cfg.getId(), str);
else
prefs.remove(cfg.getId());
@@ -324,69 +324,68 @@ public class PropertyManager {
}
}
- protected String loadString(IConfiguration cfg){
+ protected String loadString(IConfiguration cfg) {
String str = null;
Preferences prefs = getNode(cfg.getManagedProject());
- if(prefs != null)
+ if (prefs != null)
str = prefs.get(cfg.getId(), null);
- return str;
+ return str;
}
-
- protected Preferences getNode(IManagedProject mProject){
-// return getProjNode(mProject);
+
+ protected Preferences getNode(IManagedProject mProject) {
+ // return getProjNode(mProject);
return getInstNode(mProject);
}
-
- protected Preferences getProjNode(IManagedProject mProject){
+
+ protected Preferences getProjNode(IManagedProject mProject) {
IProject project = mProject.getOwner().getProject();
- if(project == null || !project.exists() || !project.isOpen())
+ if (project == null || !project.exists() || !project.isOpen())
return null;
Preferences prefs = new ProjectScope(project).getNode(ManagedBuilderCorePlugin.getUniqueIdentifier());
- if(prefs != null)
+ if (prefs != null)
return prefs.node(NODE_NAME);
return null;
}
-
- protected Preferences getInstNode(IManagedProject mProject){
+
+ protected Preferences getInstNode(IManagedProject mProject) {
Preferences prefs = InstanceScope.INSTANCE.getNode(ManagedBuilderCorePlugin.getUniqueIdentifier());
- if(prefs != null){
+ if (prefs != null) {
prefs = prefs.node(NODE_NAME);
- if(prefs != null)
+ if (prefs != null)
prefs = prefs.node(mProject.getId());
}
return prefs;
}
-
- protected Map<String, Object> getData(IConfiguration cfg){
+ protected Map<String, Object> getData(IConfiguration cfg) {
Map<String, Object> map = getLoaddedData(cfg);
-
- if(map == null){
+
+ if (map == null) {
map = loadData(cfg);
-
+
setLoaddedData(cfg, map);
}
-
+
return map;
}
-
- protected Map<String, Object> loadData(IConfiguration cfg){
+
+ protected Map<String, Object> loadData(IConfiguration cfg) {
Map<String, Object> map = null;
String str = loadString(cfg);
Properties props = stringToProps(str);
-
+
map = propsToMap(props);
- if(map == null)
+ if (map == null)
map = new LinkedHashMap<String, Object>();
-
+
return map;
}
-
- protected Map<String, Object> propsToMap(Properties props){
- if(props != null) {
+
+ protected Map<String, Object> propsToMap(Properties props) {
+ if (props != null) {
@SuppressWarnings({ "rawtypes", "unchecked" })
Map<String, Object> map = new LinkedHashMap(props);
return map;
@@ -394,36 +393,36 @@ public class PropertyManager {
return null;
}
- private static IConfiguration getConfigurationFromId(IProject project, String id){
- if(project == null || id == null)
+ private static IConfiguration getConfigurationFromId(IProject project, String id) {
+ if (project == null || id == null)
return null;
IManagedBuildInfo bInfo = ManagedBuildManager.getBuildInfo(project, false);
IConfiguration cfg = null;
- if(bInfo != null){
+ if (bInfo != null) {
IManagedProject mProj = bInfo.getManagedProject();
- if(mProj != null){
+ if (mProj != null) {
cfg = mProj.getConfiguration(id);
}
}
return cfg;
}
-
- protected void setLoaddedData(IConfiguration cfg, Map<String, Object> data){
- if(cfg.getOwner() == null)
+
+ protected void setLoaddedData(IConfiguration cfg, Map<String, Object> data) {
+ if (cfg.getOwner() == null)
return;
LoaddedInfo info = getLoaddedInfo();
-
- if(info != null){
- if(info.cfgMatch(cfg)){
+
+ if (info != null) {
+ if (info.cfgMatch(cfg)) {
info = new LoaddedInfo(info.getProject(), info.getConfigurationId(), data);
setLoaddedInfo(info);
return;
}
-
+
IConfiguration oldCfg = info.getConfiguration();
- if(oldCfg != null){
+ if (oldCfg != null) {
storeData(oldCfg, info.getProperties());
}
}
@@ -433,120 +432,120 @@ public class PropertyManager {
setLoaddedInfo(info);
}
- public void setProperty(IConfiguration cfg, String key, String value){
+ public void setProperty(IConfiguration cfg, String key, String value) {
setProperty(cfg, cfg, key, value);
}
- public void setProperty(IResourceInfo rcInfo, String key, String value){
+ public void setProperty(IResourceInfo rcInfo, String key, String value) {
setProperty(rcInfo.getParent(), rcInfo, key, value);
}
- public void setProperty(IToolChain tc, String key, String value){
+ public void setProperty(IToolChain tc, String key, String value) {
setProperty(tc.getParent(), tc, key, value);
}
- public void setProperty(ITool tool, String key, String value){
- Configuration cfg = (Configuration)getConfiguration(tool);
- if(cfg.isPreference())
+ public void setProperty(ITool tool, String key, String value) {
+ Configuration cfg = (Configuration) getConfiguration(tool);
+ if (cfg.isPreference())
return;
setProperty(cfg, tool, key, value);
}
-
- public void setProperty(IBuilder builder, String key, String value){
+
+ public void setProperty(IBuilder builder, String key, String value) {
setProperty(getConfiguration(builder), builder, key, value);
}
- public String getProperty(IConfiguration cfg, String key){
+ public String getProperty(IConfiguration cfg, String key) {
return getProperty(cfg, cfg, key);
}
- public String getProperty(IResourceInfo rcInfo, String key){
+ public String getProperty(IResourceInfo rcInfo, String key) {
return getProperty(rcInfo.getParent(), rcInfo, key);
}
- public String getProperty(IToolChain tc, String key){
+ public String getProperty(IToolChain tc, String key) {
return getProperty(tc.getParent(), tc, key);
}
- public String getProperty(ITool tool, String key){
+ public String getProperty(ITool tool, String key) {
return getProperty(getConfiguration(tool), tool, key);
}
-
- public String getProperty(IBuilder builder, String key){
+
+ public String getProperty(IBuilder builder, String key) {
return getProperty(getConfiguration(builder), builder, key);
}
- public void clearProperties(IManagedProject mProject){
- if(mProject == null)
+ public void clearProperties(IManagedProject mProject) {
+ if (mProject == null)
return;
-
+
IConfiguration cfgs[] = mProject.getConfigurations();
- for(int i = 0; i < cfgs.length; i++)
+ for (int i = 0; i < cfgs.length; i++)
clearLoaddedData(cfgs[i]);
-
+
Preferences prefs = getNode(mProject);
- if(prefs != null){
+ if (prefs != null) {
try {
Preferences parent = prefs.parent();
prefs.removeNode();
- if(parent != null)
+ if (parent != null)
parent.flush();
} catch (BackingStoreException e) {
}
}
}
- public void clearProperties(IConfiguration cfg){
- if(cfg.getOwner() == null)
+ public void clearProperties(IConfiguration cfg) {
+ if (cfg.getOwner() == null)
return;
-
+
clearLoaddedData(cfg);
storeData(cfg, null);
}
- private IConfiguration getConfiguration(IBuilder builder){
+ private IConfiguration getConfiguration(IBuilder builder) {
IToolChain tc = builder.getParent();
- if(tc != null)
+ if (tc != null)
return tc.getParent();
return null;
}
- private IConfiguration getConfiguration(ITool tool){
+ private IConfiguration getConfiguration(ITool tool) {
IBuildObject p = tool.getParent();
IConfiguration cfg = null;
- if(p instanceof IToolChain){
- cfg = ((IToolChain)p).getParent();
- } else if(p instanceof IResourceConfiguration){
- cfg = ((IResourceConfiguration)p).getParent();
+ if (p instanceof IToolChain) {
+ cfg = ((IToolChain) p).getParent();
+ } else if (p instanceof IResourceConfiguration) {
+ cfg = ((IResourceConfiguration) p).getParent();
}
return cfg;
}
- public void serialize(IConfiguration cfg){
- if(cfg.isTemporary() || cfg.getOwner() == null)
+ public void serialize(IConfiguration cfg) {
+ if (cfg.isTemporary() || cfg.getOwner() == null)
return;
-
+
storeData(cfg);
}
-
- public void serialize(){
+
+ public void serialize() {
LoaddedInfo info = getLoaddedInfo();
IConfiguration cfg = info.getConfiguration();
- if(cfg != null){
+ if (cfg != null) {
serialize(cfg);
-
+
clearLoaddedData(cfg);
}
-// IProject projects[] = ResourcesPlugin.getWorkspace().getRoot().getProjects();
-// for(int i = 0; i < projects.length; i++){
-// IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(projects[i], false);
-// if(info != null && info.isValid() && info.getManagedProject() != null){
-// IConfiguration cfgs[] = info.getManagedProject().getConfigurations();
-// for(int j = 0; j < cfgs.length; j++){
-// serialize(cfgs[j]);
-// }
-// }
-// }
+ // IProject projects[] = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ // for(int i = 0; i < projects.length; i++){
+ // IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(projects[i], false);
+ // if(info != null && info.isValid() && info.getManagedProject() != null){
+ // IConfiguration cfgs[] = info.getManagedProject().getConfigurations();
+ // for(int j = 0; j < cfgs.length; j++){
+ // serialize(cfgs[j]);
+ // }
+ // }
+ // }
}
}
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 ffa2e7fdae7..edb72f718c1 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
@@ -54,17 +54,17 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
private Map<IProject, IManagedBuildInfo> fRmProjectToBuildInfoMap = new HashMap<IProject, IManagedBuildInfo>();
- private class ResourceConfigurationChecker implements IResourceDeltaVisitor{
+ private class ResourceConfigurationChecker implements IResourceDeltaVisitor {
private IResourceDelta fRootDelta;
private HashMap<IProject, IManagedBuilderMakefileGenerator> fBuildFileGeneratorMap = new HashMap<IProject, IManagedBuilderMakefileGenerator>();
private HashSet<IPath> fValidatedFilesSet = new HashSet<IPath>();
private HashSet<IProject> fModifiedProjects = new HashSet<IProject>();
- public ResourceConfigurationChecker(IResourceDelta rootDelta){
+ public ResourceConfigurationChecker(IResourceDelta rootDelta) {
fRootDelta = rootDelta;
}
- public IProject[] getModifiedProjects(){
+ public IProject[] getModifiedProjects() {
return fModifiedProjects.toArray(new IProject[fModifiedProjects.size()]);
}
@@ -73,44 +73,45 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
IResource dResource = delta.getResource();
int rcType = dResource.getType();
- if(rcType == IResource.PROJECT || rcType == IResource.FOLDER){
+ if (rcType == IResource.PROJECT || rcType == IResource.FOLDER) {
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IProject project = null;
IResource rcToCheck = null;
switch (delta.getKind()) {
- case IResourceDelta.REMOVED :
- if (rcType == IResource.PROJECT){
+ case IResourceDelta.REMOVED:
+ if (rcType == IResource.PROJECT) {
IManagedBuildInfo info = fRmProjectToBuildInfoMap.remove(dResource);
- if((delta.getFlags() & IResourceDelta.MOVED_TO) == 0) {
- if(info != null){
+ if ((delta.getFlags() & IResourceDelta.MOVED_TO) == 0) {
+ if (info != null) {
sendClose(info);
PropertyManager.getInstance().clearProperties(info.getManagedProject());
}
break;
}
}
- case IResourceDelta.CHANGED :
+ case IResourceDelta.CHANGED:
if ((delta.getFlags() & IResourceDelta.MOVED_TO) != 0) {
IPath path = delta.getMovedToPath();
- if(path != null){
+ if (path != null) {
project = root.findMember(path.segment(0)).getProject();
- if(project != null && rcType == IResource.FOLDER)
- rcToCheck = root.getFolder(substituteProject(dResource.getFullPath(),project.getName()));
+ if (project != null && rcType == IResource.FOLDER)
+ rcToCheck = root
+ .getFolder(substituteProject(dResource.getFullPath(), project.getName()));
}
break;
}
default:
project = dResource.getProject();
- if(rcType == IResource.FOLDER)
+ if (rcType == IResource.FOLDER)
rcToCheck = dResource;
break;
}
- if(project != null) {
+ if (project != null) {
IManagedBuilderMakefileGenerator makeGen = getInitializedGenerator(project);
- if(makeGen != null){
- if(rcToCheck == null || !makeGen.isGeneratedResource(rcToCheck))
+ if (makeGen != null) {
+ if (rcToCheck == null || !makeGen.isGeneratedResource(rcToCheck))
return true;
}
}
@@ -118,28 +119,24 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
} else if (rcType == IResource.FILE && !dResource.isDerived()) {
int flags = delta.getFlags();
switch (delta.getKind()) {
- case IResourceDelta.REMOVED :
+ case IResourceDelta.REMOVED:
if ((flags & IResourceDelta.MOVED_TO) == 0) {
handleDeleteFile(dResource.getFullPath());
break;
}
- case IResourceDelta.ADDED :
- case IResourceDelta.CHANGED :
- if ((flags & IResourceDelta.MOVED_TO) != 0) {
- IPath path = delta.getMovedToPath();
- if (path != null) {
- handleRenamedFile(
- dResource.getFullPath(),
- path);
- }
- } else if ((flags & IResourceDelta.MOVED_FROM) != 0) {
+ case IResourceDelta.ADDED:
+ case IResourceDelta.CHANGED:
+ if ((flags & IResourceDelta.MOVED_TO) != 0) {
+ IPath path = delta.getMovedToPath();
+ if (path != null) {
+ handleRenamedFile(dResource.getFullPath(), path);
+ }
+ } else if ((flags & IResourceDelta.MOVED_FROM) != 0) {
IPath path = delta.getMovedFromPath();
- if (path != null) {
- handleRenamedFile(
- path,
- dResource.getFullPath());
- }
- }
+ if (path != null) {
+ handleRenamedFile(path, dResource.getFullPath());
+ }
+ }
break;
default:
@@ -147,59 +144,55 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
}
return false;
}
- return true; // visit the children
+ return true; // visit the children
}
- private IPath substituteProject(IPath path, String projectName){
+ private IPath substituteProject(IPath path, String projectName) {
return new Path(projectName).makeAbsolute().append(path.removeFirstSegments(1));
}
- private void handleRenamedFile(IPath fromPath, IPath toPath){
- if(!fValidatedFilesSet.add(fromPath))
+ private void handleRenamedFile(IPath fromPath, IPath toPath) {
+ if (!fValidatedFilesSet.add(fromPath))
return;
IProject fromProject = findModifiedProject(fromPath.segment(0));
- if(fromProject == null)
+ if (fromProject == null)
return;
IManagedBuilderMakefileGenerator fromMakeGen = getInitializedGenerator(fromProject);
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- if(fromMakeGen == null || fromMakeGen.isGeneratedResource(root.getFile(substituteProject(fromPath,fromProject.getName()))))
+ 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 ?
- ManagedBuildManager.getBuildInfo(toProject) :
- null;
- IManagedBuilderMakefileGenerator toMakeGen = toProject != null ?
- getInitializedGenerator(toProject) :
- null;
- if(toMakeGen != null && toMakeGen.isGeneratedResource(root.getFile(toPath)))
+ IManagedBuildInfo toInfo = toProject != null ? ManagedBuildManager.getBuildInfo(toProject) : null;
+ IManagedBuilderMakefileGenerator toMakeGen = toProject != null ? getInitializedGenerator(toProject) : null;
+ if (toMakeGen != null && toMakeGen.isGeneratedResource(root.getFile(toPath)))
toInfo = null;
- if(fromInfo == toInfo){
+ if (fromInfo == toInfo) {
//the resource was moved within the project scope
- if(updateResourceConfigurations(fromInfo,fromPath,toPath) && toProject != null)
+ if (updateResourceConfigurations(fromInfo, fromPath, toPath) && toProject != null)
fModifiedProjects.add(toProject);
} else {
- if(fromInfo != null && toInfo != null){
+ if (fromInfo != null && toInfo != null) {
//TODO: this is the case when the resource
//is moved from one managed project to another
//should we handle this?
//e.g. add resource configurations to the destination project?
}
- if(fromInfo != null && removeResourceConfigurations(fromInfo,fromPath))
+ if (fromInfo != null && removeResourceConfigurations(fromInfo, fromPath))
fModifiedProjects.add(fromProject);
}
}
- private void handleDeleteFile(IPath path){
+ private void handleDeleteFile(IPath path) {
IProject project = findModifiedProject(path.segment(0));
- if(project != null){
+ if (project != null) {
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
- if(info != null
- && removeResourceConfigurations(info,path))
+ if (info != null && removeResourceConfigurations(info, path))
fModifiedProjects.add(project);
}
}
@@ -211,22 +204,22 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
// 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){
+ private IProject findModifiedProject(final String oldProjectName) {
IResourceDelta projectDelta = fRootDelta.findMember(new Path(oldProjectName));
boolean replaced = false;
- if(projectDelta != null) {
- switch(projectDelta.getKind()){
- case IResourceDelta.REMOVED :
- if ((projectDelta.getFlags() & IResourceDelta.MOVED_TO) == 0) {
- return null;
- }
- case IResourceDelta.CHANGED :
- if ((projectDelta.getFlags() & IResourceDelta.MOVED_TO) != 0) {
- IPath path = projectDelta.getMovedToPath();
- if(path != null)
- return ResourcesPlugin.getWorkspace().getRoot().findMember(path).getProject();
- }
- break;
+ if (projectDelta != null) {
+ switch (projectDelta.getKind()) {
+ case IResourceDelta.REMOVED:
+ if ((projectDelta.getFlags() & IResourceDelta.MOVED_TO) == 0) {
+ return null;
+ }
+ case IResourceDelta.CHANGED:
+ if ((projectDelta.getFlags() & IResourceDelta.MOVED_TO) != 0) {
+ IPath path = projectDelta.getMovedToPath();
+ if (path != null)
+ return ResourcesPlugin.getWorkspace().getRoot().findMember(path).getProject();
+ }
+ break;
}
}
@@ -237,19 +230,19 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
public boolean visit(IResourceDelta delta) throws CoreException {
IResource dResource = delta.getResource();
int rcType = dResource.getType();
- if(rcType == IResource.ROOT) {
+ if (rcType == IResource.ROOT) {
return true;
- } else if(rcType == IResource.PROJECT){
- switch(delta.getKind()){
- case IResourceDelta.ADDED :
- case IResourceDelta.CHANGED :
- if ((delta.getFlags() & IResourceDelta.MOVED_FROM) != 0) {
- IPath path = delta.getMovedFromPath();
- if (path != null && path.segment(0).equals(oldProjectName)) {
- project[0] = dResource.getProject();
- }
- }
- break;
+ } else if (rcType == IResource.PROJECT) {
+ switch (delta.getKind()) {
+ case IResourceDelta.ADDED:
+ case IResourceDelta.CHANGED:
+ if ((delta.getFlags() & IResourceDelta.MOVED_FROM) != 0) {
+ IPath path = delta.getMovedFromPath();
+ if (path != null && path.segment(0).equals(oldProjectName)) {
+ project[0] = dResource.getProject();
+ }
+ }
+ break;
default:
break;
}
@@ -260,31 +253,32 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
} catch (CoreException e) {
}
- if(project[0] == null && !replaced)
+ if (project[0] == null && !replaced)
project[0] = ResourcesPlugin.getWorkspace().getRoot().findMember(oldProjectName).getProject();
return project[0];
}
- private IManagedBuilderMakefileGenerator getInitializedGenerator(IProject project){
+ private IManagedBuilderMakefileGenerator getInitializedGenerator(IProject project) {
IManagedBuilderMakefileGenerator makeGen = fBuildFileGeneratorMap.get(project);
if (makeGen == null) {
try {
if (project.hasNature(ManagedCProjectNature.MNG_NATURE_ID)) {
// 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;
+ if (!ManagedBuildManager.canGetBuildInfo(project))
+ return null;
IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(project);
- if (buildInfo != null){
+ if (buildInfo != null) {
IConfiguration defaultCfg = buildInfo.getDefaultConfiguration();
if (defaultCfg != null) {
makeGen = ManagedBuildManager.getBuildfileGenerator(defaultCfg);
- makeGen.initialize(project,buildInfo,new NullProgressMonitor());
- fBuildFileGeneratorMap.put(project,makeGen);
+ makeGen.initialize(project, buildInfo, new NullProgressMonitor());
+ fBuildFileGeneratorMap.put(project, makeGen);
}
}
}
- } catch (CoreException e){
+ } catch (CoreException e) {
return null;
}
}
@@ -292,17 +286,17 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
}
}
- public void sendClose(IProject project){
- sendClose(ManagedBuildManager.getBuildInfo(project,false));
+ public void sendClose(IProject project) {
+ sendClose(ManagedBuildManager.getBuildInfo(project, false));
}
- private void sendClose(IManagedBuildInfo info){
- if(info != null){
+ private void sendClose(IManagedBuildInfo info) {
+ if (info != null) {
IManagedProject managedProj = info.getManagedProject();
if (managedProj != null) {
IConfiguration cfgs[] = managedProj.getConfigurations();
- for(int i = 0; i < cfgs.length; i++)
+ for (int i = 0; i < cfgs.length; i++)
ManagedBuildManager.performValueHandlerEvent(cfgs[i], IManagedOptionValueHandler.EVENT_CLOSE, true);
}
}
@@ -324,73 +318,70 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
if (event.getSource() instanceof IWorkspace) {
switch (event.getType()) {
- case IResourceChangeEvent.PRE_CLOSE:
- IResource proj = event.getResource();
- if(proj instanceof IProject)
- sendClose((IProject)proj);
- break;
- case IResourceChangeEvent.PRE_DELETE :
- IResource rc = event.getResource();
- if(rc instanceof IProject){
- IProject project = (IProject)rc;
- try {
- if (project.hasNature(ManagedCProjectNature.MNG_NATURE_ID)) {
- IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
- if(info != null)
- fRmProjectToBuildInfoMap.put(project, info);
- }
- } catch (CoreException e) {
- }
- }
- case IResourceChangeEvent.POST_CHANGE :
- case IResourceChangeEvent.POST_BUILD :
- IResourceDelta resDelta = event.getDelta();
- if (resDelta == null) {
- break;
- }
+ case IResourceChangeEvent.PRE_CLOSE:
+ IResource proj = event.getResource();
+ if (proj instanceof IProject)
+ sendClose((IProject) proj);
+ break;
+ case IResourceChangeEvent.PRE_DELETE:
+ IResource rc = event.getResource();
+ if (rc instanceof IProject) {
+ IProject project = (IProject) rc;
try {
- ResourceConfigurationChecker rcChecker = new ResourceConfigurationChecker(resDelta);
- resDelta.accept(rcChecker);
-
- //saving info for the modified projects
- initInfoSerialization(rcChecker.getModifiedProjects());
-
+ if (project.hasNature(ManagedCProjectNature.MNG_NATURE_ID)) {
+ IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
+ if (info != null)
+ fRmProjectToBuildInfoMap.put(project, info);
+ }
} catch (CoreException e) {
- ManagedBuilderCorePlugin.log(e);
}
+ }
+ case IResourceChangeEvent.POST_CHANGE:
+ case IResourceChangeEvent.POST_BUILD:
+ IResourceDelta resDelta = event.getDelta();
+ if (resDelta == null) {
break;
- default :
- break;
+ }
+ try {
+ ResourceConfigurationChecker rcChecker = new ResourceConfigurationChecker(resDelta);
+ resDelta.accept(rcChecker);
+
+ //saving info for the modified projects
+ initInfoSerialization(rcChecker.getModifiedProjects());
+
+ } catch (CoreException e) {
+ ManagedBuilderCorePlugin.log(e);
+ }
+ break;
+ default:
+ break;
}
}
}
- private void initInfoSerialization(final IProject projects[]){
- if(projects.length == 0)
+ private void initInfoSerialization(final IProject projects[]) {
+ if (projects.length == 0)
return;
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IResourceRuleFactory ruleFactory = workspace.getRuleFactory();
ISchedulingRule buildInfoSaveRule;
- if(projects.length == 1){
+ if (projects.length == 1) {
buildInfoSaveRule = ruleFactory.modifyRule(projects[0]);
} else {
ISchedulingRule rules[] = new ISchedulingRule[projects.length];
- for(int i = 0; i < rules.length; i++)
+ for (int i = 0; i < rules.length; i++)
rules[i] = ruleFactory.modifyRule(projects[i]);
buildInfoSaveRule = MultiRule.combine(rules);
}
- Job savingJob = new Job(ManagedMakeMessages.getResourceString("ResourceChangeHandler.buildInfoSerializationJob")){ //$NON-NLS-1$
+ Job savingJob = new Job(
+ ManagedMakeMessages.getResourceString("ResourceChangeHandler.buildInfoSerializationJob")) { //$NON-NLS-1$
@Override
protected IStatus run(IProgressMonitor monitor) {
- for(int i = 0; i < projects.length; i++){
- ManagedBuildManager.saveBuildInfo(projects[i],true);
+ for (int i = 0; i < projects.length; i++) {
+ ManagedBuildManager.saveBuildInfo(projects[i], true);
}
- return new Status(
- IStatus.OK,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
- IStatus.OK,
- "", //$NON-NLS-1$
+ return new Status(IStatus.OK, ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.OK, "", //$NON-NLS-1$
null);
}
};
@@ -399,15 +390,15 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
savingJob.schedule();
}
- private boolean updateResourceConfigurations(IManagedBuildInfo info, IPath oldPath, IPath newPath){
+ private boolean updateResourceConfigurations(IManagedBuildInfo info, IPath oldPath, IPath newPath) {
boolean changed = false;
- if(!oldPath.equals(newPath)){
+ if (!oldPath.equals(newPath)) {
IManagedProject mngProj = info.getManagedProject();
- if(mngProj != null){
+ if (mngProj != null) {
IConfiguration configs[] = mngProj.getConfigurations();
- if(configs != null && configs.length > 0){
- for(int i = 0; i < configs.length; i++){
- if(updateResourceConfiguration(configs[i],oldPath,newPath))
+ if (configs != null && configs.length > 0) {
+ for (int i = 0; i < configs.length; i++) {
+ if (updateResourceConfiguration(configs[i], oldPath, newPath))
changed = true;
}
}
@@ -416,14 +407,14 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
return changed;
}
- private boolean removeResourceConfigurations(IManagedBuildInfo info, IPath path){
+ private boolean removeResourceConfigurations(IManagedBuildInfo info, IPath path) {
boolean changed = false;
IManagedProject mngProj = info.getManagedProject();
- if(mngProj != null){
+ if (mngProj != null) {
IConfiguration configs[] = mngProj.getConfigurations();
- if(configs != null && configs.length > 0){
- for(int i = 0; i < configs.length; i++){
- if(removeResourceConfiguration(configs[i],path))
+ if (configs != null && configs.length > 0) {
+ for (int i = 0; i < configs.length; i++) {
+ if (removeResourceConfiguration(configs[i], path))
changed = true;
}
}
@@ -431,24 +422,24 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
return changed;
}
- private boolean updateResourceConfiguration(IConfiguration config, IPath oldPath, IPath newPath){
+ private boolean updateResourceConfiguration(IConfiguration config, IPath oldPath, IPath newPath) {
IResourceConfiguration rcCfg = config.getResourceConfiguration(oldPath.toString());
- if(rcCfg != null && !oldPath.equals(newPath)){
-// config.removeResourceConfiguration(rcCfg);
+ if (rcCfg != null && !oldPath.equals(newPath)) {
+ // config.removeResourceConfiguration(rcCfg);
rcCfg.setResourcePath(newPath.toString());
-// rcCfg.setRebuildState(true);
-// ((Configuration)config).addResourceConfiguration((ResourceConfiguration)rcCfg);
-// config.setRebuildState(true);
+ // rcCfg.setRebuildState(true);
+ // ((Configuration)config).addResourceConfiguration((ResourceConfiguration)rcCfg);
+ // config.setRebuildState(true);
return true;
}
return false;
}
- private boolean removeResourceConfiguration(IConfiguration config, IPath path){
+ private boolean removeResourceConfiguration(IConfiguration config, IPath path) {
IResourceConfiguration rcCfg = config.getResourceConfiguration(path.toString());
- if(rcCfg != null){
+ if (rcCfg != null) {
config.removeResourceConfiguration(rcCfg);
-// config.setRebuildState(true);
+ // config.setRebuildState(true);
return true;
}
return false;
@@ -466,7 +457,7 @@ public class ResourceChangeHandler implements IResourceChangeListener, ISavePart
PropertyManager.getInstance().serialize();
//Request a resource delta to be used on next activation.
- context.needDelta();
+ context.needDelta();
}
/* (non-Javadoc)
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 223a34e110b..61e20e38bd1 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
@@ -47,7 +47,7 @@ import org.osgi.framework.Version;
public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
//property name for holding the rebuild state
- private static final String REBUILD_STATE = "rebuildState"; //$NON-NLS-1$
+ private static final String REBUILD_STATE = "rebuildState"; //$NON-NLS-1$
// Parent and children
private List<ITool> toolList;
@@ -122,45 +122,44 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
}
String rebuild = PropertyManager.getInstance().getProperty(this, REBUILD_STATE);
- if(rebuild == null || Boolean.valueOf(rebuild).booleanValue())
+ if (rebuild == null || Boolean.valueOf(rebuild).booleanValue())
setRebuildState(true);
setDirty(false);
}
- public ResourceConfiguration(FolderInfo folderInfo, ITool baseTool, String id, String resourceName, IPath path){
+ public ResourceConfiguration(FolderInfo folderInfo, ITool baseTool, String id, String resourceName, IPath path) {
super(folderInfo, path, id, resourceName);
-// setParentFolder(folderInfo);
-// setParentFolderId(folderInfo.getId());
+ // setParentFolder(folderInfo);
+ // setParentFolderId(folderInfo.getId());
isExtensionResourceConfig = folderInfo.isExtensionElement();
- if(!isExtensionResourceConfig)
+ if (!isExtensionResourceConfig)
setResourceData(new BuildFileData(this));
- if ( folderInfo.getParent() != null)
+ if (folderInfo.getParent() != null)
setManagedBuildRevision(folderInfo.getParent().getManagedBuildRevision());
setDirty(false);
toolsToInvoke = ""; //$NON-NLS-1$
rcbsApplicability = KIND_DISABLE_RCBS_TOOL;
-
// Get file extension.
String extString = path.getFileExtension();
- if(baseTool != null){
- if(baseTool.getParentResourceInfo() != folderInfo)
+ if (baseTool != null) {
+ if (baseTool.getParentResourceInfo() != folderInfo)
baseTool = null;
}
// Add the resource specific tools to this resource.
ITool tools[] = folderInfo.getFilteredTools();
String subId = ""; //$NON-NLS-1$
for (int i = 0; i < tools.length; i++) {
- if( tools[i].buildsFileType(extString) ) {
+ if (tools[i].buildsFileType(extString)) {
baseTool = tools[i];
break;
}
}
- if(baseTool != null){
+ if (baseTool != null) {
subId = ManagedBuildManager.calculateChildId(baseTool.getId(), null);
createTool(baseTool, subId, baseTool.getName(), false);
setRebuildState(true);
@@ -174,14 +173,15 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
* @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) {
+ 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)
+ if (!cloneConfig.isExtensionResourceConfig)
cloneChildren = true;
- if(!isExtensionResourceConfig)
+ if (!isExtensionResourceConfig)
setResourceData(new BuildFileData(this));
setManagedBuildRevision(cloneConfig.getManagedBuildRevision());
@@ -203,25 +203,23 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
Map<String, String> curIdMap = superClassIdMap.get(cloneConfig.getPath());
ITool extTool = ManagedBuildManager.getExtensionTool(toolChild);
- if(curIdMap != null){
- if(extTool != null){
+ if (curIdMap != null) {
+ if (extTool != null) {
subId = curIdMap.get(extTool.getId());
}
}
subName = toolChild.getName();
- if(subId == null){
+ if (subId == null) {
if (extTool != null) {
- subId = copyIds ? toolChild.getId() : ManagedBuildManager.calculateChildId(
- extTool.getId(),
- null);
- // subName = toolChild.getSuperClass().getName();
+ subId = copyIds ? toolChild.getId()
+ : ManagedBuildManager.calculateChildId(extTool.getId(), null);
+ // subName = toolChild.getSuperClass().getName();
} else {
- subId = copyIds ? toolChild.getId() : ManagedBuildManager.calculateChildId(
- toolChild.getId(),
- null);
- // subName = toolChild.getName();
+ subId = copyIds ? toolChild.getId()
+ : ManagedBuildManager.calculateChildId(toolChild.getId(), null);
+ // subName = toolChild.getName();
}
}
@@ -232,28 +230,29 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
// 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){
- if(otherSuperTool.isExtensionElement()){
+ if (otherSuperTool != null) {
+ if (otherSuperTool.isExtensionElement()) {
toolSuperClass = otherSuperTool;
} else {
IResourceInfo otherRcInfo = otherSuperTool.getParentResourceInfo();
IResourceInfo thisRcInfo = cfg.getResourceInfo(otherRcInfo.getPath(), true);
ITool otherExtTool = ManagedBuildManager.getExtensionTool(otherSuperTool);
- if(otherExtTool != null){
- if(thisRcInfo != null){
+ if (otherExtTool != null) {
+ if (thisRcInfo != null) {
ITool tools[] = thisRcInfo.getTools();
- for(int i = 0; i < tools.length; i++){
+ for (int i = 0; i < tools.length; i++) {
ITool thisExtTool = ManagedBuildManager.getExtensionTool(tools[i]);
- if(otherExtTool.equals(thisExtTool)){
+ if (otherExtTool.equals(thisExtTool)) {
toolSuperClass = tools[i];
superId = toolSuperClass.getId();
break;
}
}
} else {
- superId = copyIds ? otherSuperTool.getId() : ManagedBuildManager.calculateChildId(otherExtTool.getId(), null);
+ superId = copyIds ? otherSuperTool.getId()
+ : ManagedBuildManager.calculateChildId(otherExtTool.getId(), null);
Map<String, String> idMap = superClassIdMap.get(otherRcInfo.getPath());
- if(idMap == null){
+ if (idMap == null) {
idMap = new HashMap<String, String>();
superClassIdMap.put(otherRcInfo.getPath(), idMap);
}
@@ -262,42 +261,42 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
}
}
}
-// IToolChain tCh = cloneConfig.getBaseToolChain();
-// if(tCh != null){
-// if(!tCh.isExtensionElement()){
-// IFolderInfo fo = tCh.getParentFolderInfo();
-// IPath path = fo.getPath();
-// IResourceInfo baseFo = cfg.getResourceInfo(path, false);
-// 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
-// && configTool.getSuperClass() == toolChild.getSuperClass().getSuperClass())
-// {
-// toolSuperClass = configTool;
-// break;
-// }
-// }
-// } else {
-// //TODO:
-// }
+ // IToolChain tCh = cloneConfig.getBaseToolChain();
+ // if(tCh != null){
+ // if(!tCh.isExtensionElement()){
+ // IFolderInfo fo = tCh.getParentFolderInfo();
+ // IPath path = fo.getPath();
+ // IResourceInfo baseFo = cfg.getResourceInfo(path, false);
+ // 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
+ // && configTool.getSuperClass() == toolChild.getSuperClass().getSuperClass())
+ // {
+ // toolSuperClass = configTool;
+ // break;
+ // }
+ // }
+ // } else {
+ // //TODO:
+ // }
Tool newTool = null;
- if(toolSuperClass != null)
- newTool = new Tool(this, toolSuperClass, subId, subName, (Tool)toolChild);
+ if (toolSuperClass != null)
+ newTool = new Tool(this, toolSuperClass, subId, subName, (Tool) toolChild);
else
- newTool = new Tool(this, superId, subId, subName, (Tool)toolChild);
+ newTool = new Tool(this, superId, subId, subName, (Tool) toolChild);
addTool(newTool);
}
}
- if(copyIds){
+ if (copyIds) {
isDirty = cloneConfig.isDirty;
needsRebuild = cloneConfig.needsRebuild;
} else {
@@ -327,7 +326,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
String subId = ManagedBuildManager.calculateChildId(baseId, null);
String subName = toolChild.getName();
- Tool newTool = new Tool(this, superTool, subId, subName, (Tool)toolChild);
+ Tool newTool = new Tool(this, superTool, subId, subName, (Tool) toolChild);
addTool(newTool);
}
}
@@ -405,21 +404,21 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
if (rcbsApplicability != null) {
String str;
switch (getRcbsApplicability()) {
- case KIND_APPLY_RCBS_TOOL_BEFORE:
- str = APPLY_RCBS_TOOL_BEFORE;
- break;
- case KIND_APPLY_RCBS_TOOL_AFTER:
- str = APPLY_RCBS_TOOL_AFTER;
- break;
- case KIND_APPLY_RCBS_TOOL_AS_OVERRIDE:
- str = APPLY_RCBS_TOOL_AS_OVERRIDE;
- break;
- case KIND_DISABLE_RCBS_TOOL:
- str = DISABLE_RCBS_TOOL;
- break;
- default:
- str = DISABLE_RCBS_TOOL;
- break;
+ case KIND_APPLY_RCBS_TOOL_BEFORE:
+ str = APPLY_RCBS_TOOL_BEFORE;
+ break;
+ case KIND_APPLY_RCBS_TOOL_AFTER:
+ str = APPLY_RCBS_TOOL_AFTER;
+ break;
+ case KIND_APPLY_RCBS_TOOL_AS_OVERRIDE:
+ str = APPLY_RCBS_TOOL_AS_OVERRIDE;
+ break;
+ case KIND_DISABLE_RCBS_TOOL:
+ str = DISABLE_RCBS_TOOL;
+ break;
+ default:
+ str = DISABLE_RCBS_TOOL;
+ break;
}
element.setAttribute(IResourceConfiguration.RCBS_APPLICABILITY, str);
}
@@ -428,7 +427,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
List<ITool> toolElements = getToolList();
for (ITool tool : toolElements) {
ICStorageElement toolElement = element.createChild(ITool.TOOL_ELEMENT_NAME);
- ((Tool)tool).serialize(toolElement);
+ ((Tool) tool).serialize(toolElement);
}
// I am clean now
@@ -439,7 +438,6 @@ 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()
*/
@@ -459,7 +457,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
*/
@Override
public ITool getTool(String id) {
- Tool tool = (Tool)getToolMap().get(id);
+ Tool tool = (Tool) getToolMap().get(id);
return tool;
}
@@ -539,7 +537,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
return KIND_DISABLE_RCBS_TOOL;
}
return rcbsApplicability.intValue();
- }
+ }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#getToolsToInvoke()
@@ -561,7 +559,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
String rcbsToolId = ""; //$NON-NLS-1$
int len;
int j;
- int rcbsToolIdx=-1;
+ int rcbsToolIdx = -1;
resConfigTools = getTools();
/*
@@ -582,19 +580,19 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
/*
* See if there is an rcbs tool defined. There should only be one at most.
*/
- for ( int i = 0; i < resConfigTools.length; i++ ){
+ for (int i = 0; i < resConfigTools.length; i++) {
if (resConfigTools[i].getCustomBuildStep() && !resConfigTools[i].isExtensionElement()) {
rcbsToolId = resConfigTools[i].getId();
rcbsToolIdx = i;
break;
}
}
- if (!rcbsToolId.isEmpty()){
+ if (!rcbsToolId.isEmpty()) {
/*
* Here if an rcbs tool is defined.
* Apply the tools according to the current rcbsApplicability setting.
*/
- switch(rcbsApplicability.intValue()){
+ switch (rcbsApplicability.intValue()) {
case KIND_APPLY_RCBS_TOOL_AS_OVERRIDE:
toolsToInvoke = rcbsToolId;
tools = new ITool[1];
@@ -603,9 +601,9 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
case KIND_APPLY_RCBS_TOOL_AFTER:
j = 0;
tools = new ITool[resConfigTools.length];
- for ( int i = 0; i < resConfigTools.length; i++ ){
+ for (int i = 0; i < resConfigTools.length; i++) {
if (resConfigTools[i].getId() != rcbsToolId) {
- t_ToolsToInvoke += resConfigTools[i].getId() + ";"; //$NON-NLS-1$
+ t_ToolsToInvoke += resConfigTools[i].getId() + ";"; //$NON-NLS-1$
tools[j++] = resConfigTools[i];
}
}
@@ -616,16 +614,16 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
case KIND_APPLY_RCBS_TOOL_BEFORE:
j = 0;
tools = new ITool[resConfigTools.length];
- t_ToolsToInvoke = rcbsToolId + ";"; //$NON-NLS-1$
+ t_ToolsToInvoke = rcbsToolId + ";"; //$NON-NLS-1$
tools[j++] = resConfigTools[rcbsToolIdx];
- for ( int i = 0; i < resConfigTools.length; i++ ){
+ for (int i = 0; i < resConfigTools.length; i++) {
if (resConfigTools[i].getId() != rcbsToolId) {
- t_ToolsToInvoke += resConfigTools[i].getId() + ";"; //$NON-NLS-1$
+ t_ToolsToInvoke += resConfigTools[i].getId() + ";"; //$NON-NLS-1$
tools[j++] = resConfigTools[i];
}
}
len = t_ToolsToInvoke.length();
- t_ToolsToInvoke = t_ToolsToInvoke.substring(0,len-1);
+ t_ToolsToInvoke = t_ToolsToInvoke.substring(0, len - 1);
toolsToInvoke = t_ToolsToInvoke;
break;
case KIND_DISABLE_RCBS_TOOL:
@@ -633,21 +631,21 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
* If the rcbs tool is the only tool and the user has disabled it,
* there are no tools to invoke in the resource configuration.
*/
- if(resConfigTools.length == 1){
+ if (resConfigTools.length == 1) {
tools = new ITool[0];
toolsToInvoke = ""; //$NON-NLS-1$
break;
}
j = 0;
- tools = new ITool[resConfigTools.length-1];
- for ( int i = 0; i < resConfigTools.length; i++ ){
+ tools = new ITool[resConfigTools.length - 1];
+ for (int i = 0; i < resConfigTools.length; i++) {
if (resConfigTools[i].getId() != rcbsToolId) {
- t_ToolsToInvoke += resConfigTools[i].getId() + ";"; //$NON-NLS-1$
+ t_ToolsToInvoke += resConfigTools[i].getId() + ";"; //$NON-NLS-1$
tools[j++] = resConfigTools[i];
}
}
len = t_ToolsToInvoke.length();
- t_ToolsToInvoke = t_ToolsToInvoke.substring(0,len-1);
+ t_ToolsToInvoke = t_ToolsToInvoke.substring(0, len - 1);
toolsToInvoke = t_ToolsToInvoke;
break;
default:
@@ -655,34 +653,32 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
* If we get an unexpected value, apply all tools in the order found.
*/
tools = new ITool[resConfigTools.length];
- for ( int i = 0; i < resConfigTools.length; i++ ){
- t_ToolsToInvoke += resConfigTools[i].getId() + ";"; //$NON-NLS-1$
+ for (int i = 0; i < resConfigTools.length; i++) {
+ t_ToolsToInvoke += resConfigTools[i].getId() + ";"; //$NON-NLS-1$
tools[i] = resConfigTools[i];
}
len = t_ToolsToInvoke.length();
- t_ToolsToInvoke = t_ToolsToInvoke.substring(0,len-1);
+ t_ToolsToInvoke = t_ToolsToInvoke.substring(0, len - 1);
toolsToInvoke = t_ToolsToInvoke;
break;
}
- }
- else {
+ } else {
/*
* Here if no rcbs tool is defined, but there are other tools in the resource configuration.
* Specify all tools in the order found.
*/
tools = new ITool[resConfigTools.length];
- for ( int i = 0; i < resConfigTools.length; i++ ){
- t_ToolsToInvoke += resConfigTools[i].getId() + ";"; //$NON-NLS-1$
+ for (int i = 0; i < resConfigTools.length; i++) {
+ t_ToolsToInvoke += resConfigTools[i].getId() + ";"; //$NON-NLS-1$
tools[i] = resConfigTools[i];
}
len = t_ToolsToInvoke.length();
- t_ToolsToInvoke = t_ToolsToInvoke.substring(0,len-1);
+ t_ToolsToInvoke = t_ToolsToInvoke.substring(0, len - 1);
toolsToInvoke = t_ToolsToInvoke;
}
return tools;
}
-
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IResourceConfiguration#getRcbsApplicability()
*/
@@ -706,7 +702,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
*/
@Override
public void setResourcePath(String path) {
- if( path == null)
+ if (path == null)
return;
IPath p = new Path(path).removeFirstSegments(1);
setPath(p);
@@ -729,7 +725,8 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
@Override
public boolean isDirty() {
// This shouldn't be called for an extension tool-chain
- if (isExtensionResourceConfig) return false;
+ if (isExtensionResourceConfig)
+ return false;
// If I need saving, just say yes
if (super.isDirty())
@@ -737,7 +734,8 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
// Otherwise see if any tools need saving
for (ITool toolChild : getToolList()) {
- if (toolChild.isDirty()) return true;
+ if (toolChild.isDirty())
+ return true;
}
return false;
@@ -748,11 +746,12 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
*/
@Override
public void setDirty(boolean isDirty) {
- if (isExtensionResourceConfig) return;
+ if (isExtensionResourceConfig)
+ return;
- super.setDirty(isDirty);
+ super.setDirty(isDirty);
- // Propagate "false" to the children
+ // Propagate "false" to the children
if (!isDirty) {
for (ITool toolChild : getToolList()) {
toolChild.setDirty(false);
@@ -770,7 +769,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
// Call resolveReferences on our children
for (ITool toolChild : getToolList()) {
- ((Tool)toolChild).resolveReferences();
+ ((Tool) toolChild).resolveReferences();
}
}
}
@@ -787,7 +786,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
// 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);
+ // ManagedBuildManager.performValueHandlerEvent(this, IManagedOptionValueHandler.EVENT_CLOSE);
// Remove the configurations
for (int i = 0; i < tools.length; i++) {
ITool tool = tools[i];
@@ -796,7 +795,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
tool.removeOption(opts[j]);
}
}
-// setExclude(false);
+ // setExclude(false);
}
/* (non-Javadoc)
@@ -805,18 +804,18 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
@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);
+ tool.setToolCommand(command);
}
-// private IBuildObject getHoldersParent(IOption option) {
-// IHoldsOptions holder = option.getOptionHolder();
-// if (holder instanceof ITool) {
-// return ((ITool)holder).getParent();
-// } else if (holder instanceof IToolChain) {
-// return ((IToolChain)holder).getParent();
-// }
-// return null;
-// }
+ // private IBuildObject getHoldersParent(IOption option) {
+ // IHoldsOptions holder = option.getOptionHolder();
+ // if (holder instanceof ITool) {
+ // return ((ITool)holder).getParent();
+ // } else if (holder instanceof IToolChain) {
+ // return ((IToolChain)holder).getParent();
+ // }
+ // return null;
+ // }
@Override
public IResource getOwner() {
@@ -828,8 +827,8 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
*/
@Override
public Version getVersion() {
- if ( version == null) {
- if ( getParent() != null) {
+ if (version == null) {
+ if (getParent() != null) {
return getParent().getVersion();
}
}
@@ -845,11 +844,11 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
* @see org.eclipse.cdt.managedbuilder.internal.core.BuildObject#updateManagedBuildRevision(java.lang.String)
*/
@Override
- public void updateManagedBuildRevision(String revision){
+ public void updateManagedBuildRevision(String revision) {
super.updateManagedBuildRevision(revision);
- for (ITool tool : getToolList()) {
- ((Tool)tool).updateManagedBuildRevision(revision);
+ for (ITool tool : getToolList()) {
+ ((Tool) tool).updateManagedBuildRevision(revision);
}
}
@@ -858,12 +857,12 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
*/
@Override
public boolean needsRebuild() {
- if(super.needsRebuild())
+ if (super.needsRebuild())
return true;
ITool tools[] = getToolsToInvoke();
- for(int i = 0; i < tools.length; i++){
- if(tools[i].needsRebuild())
+ for (int i = 0; i < tools.length; i++) {
+ if (tools[i].needsRebuild())
return true;
}
@@ -875,24 +874,24 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
*/
@Override
public void setRebuildState(boolean rebuild) {
- if(isExtensionResourceConfiguration() && rebuild)
+ if (isExtensionResourceConfiguration() && rebuild)
return;
- if(needsRebuild() != rebuild){
+ if (needsRebuild() != rebuild) {
super.setRebuildState(rebuild);
saveRebuildState();
}
- if(!rebuild){
+ if (!rebuild) {
ITool tools[] = getToolsToInvoke();
- for(int i = 0; i < tools.length; i++){
+ for (int i = 0; i < tools.length; i++) {
tools[i].setRebuildState(false);
}
}
}
- private void saveRebuildState(){
+ private void saveRebuildState() {
PropertyManager.getInstance().setProperty(this, REBUILD_STATE, Boolean.toString(needsRebuild()));
}
@@ -902,8 +901,8 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
}
@Override
- public CFileData getFileData(){
- return (CFileData)getResourceData();
+ public CFileData getFileData() {
+ return (CFileData) getResourceData();
}
@Override
@@ -912,7 +911,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
List<CLanguageData> list = new ArrayList<CLanguageData>();
for (ITool tool : tools) {
CLanguageData datas[] = tool.getCLanguageDatas();
- for(int j = 0; j < datas.length; j++){
+ for (int j = 0; j < datas.length; j++) {
list.add(datas[j]);
}
}
@@ -922,24 +921,24 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
public IToolChain getBaseToolChain() {
ITool tools[] = getToolsToInvoke();
ITool baseTool = null;
- for(int i = 0; i < tools.length; i++){
+ for (int i = 0; i < tools.length; i++) {
ITool tool = tools[i];
ITool superTool = tool.getSuperClass();
- if(superTool != null){
+ if (superTool != null) {
baseTool = superTool;
- if(!superTool.isExtensionElement()){
+ if (!superTool.isExtensionElement()) {
break;
}
}
}
IToolChain baseTc = null;
- if(baseTool != null){
+ if (baseTool != null) {
IBuildObject parent = baseTool.getParent();
- if(parent instanceof IToolChain){
- baseTc = (IToolChain)parent;
- } else if(parent instanceof ResourceConfiguration){
- baseTc = ((ResourceConfiguration)parent).getBaseToolChain();
+ if (parent instanceof IToolChain) {
+ baseTc = (IToolChain) parent;
+ } else if (parent instanceof ResourceConfiguration) {
+ baseTc = ((ResourceConfiguration) parent).getBaseToolChain();
}
}
@@ -954,8 +953,8 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
@Override
public boolean supportsBuild(boolean managed) {
ITool tools[] = getToolsToInvoke();
- for(int i = 0; i < tools.length; i++){
- if(!tools[i].supportsBuild(managed))
+ for (int i = 0; i < tools.length; i++) {
+ if (!tools[i].supportsBuild(managed))
return false;
}
@@ -978,39 +977,39 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
}
@Override
- void resolveProjectReferences(boolean onLoad){
+ void resolveProjectReferences(boolean onLoad) {
for (ITool tool : getToolList()) {
- ((Tool)tool).resolveProjectReferences(onLoad);
+ ((Tool) tool).resolveProjectReferences(onLoad);
}
}
@Override
public boolean hasCustomSettings() {
IResourceInfo parentRc = getParentResourceInfo();
- if(parentRc instanceof FolderInfo){
+ if (parentRc instanceof FolderInfo) {
IPath path = getPath();
String ext = path.getFileExtension();
- if(ext == null)
+ if (ext == null)
ext = ""; //$NON-NLS-1$
- ITool otherTool = ((FolderInfo)parentRc).getToolFromInputExtension(ext);
- if(otherTool == null)
+ ITool otherTool = ((FolderInfo) parentRc).getToolFromInputExtension(ext);
+ if (otherTool == null)
return true;
ITool[] tti = getToolsToInvoke();
- if(tti.length != 1)
+ if (tti.length != 1)
return true;
- return ((Tool)tti[0]).hasCustomSettings((Tool)otherTool);
+ return ((Tool) tti[0]).hasCustomSettings((Tool) otherTool);
}
ITool[] tools = getTools();
- ITool[] otherTools = ((IFileInfo)parentRc).getTools();
- if(tools.length != otherTools.length)
+ 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))
+ for (int i = 0; i < tools.length; i++) {
+ Tool tool = (Tool) tools[i];
+ Tool otherTool = (Tool) otherTools[i];
+ if (tool.hasCustomSettings(otherTool))
return true;
}
@@ -1018,7 +1017,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
}
@Override
- public void setTools(ITool[] tools){
+ public void setTools(ITool[] tools) {
ToolListModificationInfo info = getToolListModificationInfo(tools);
info.apply();
}
@@ -1037,7 +1036,7 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
map.clear();
list.addAll(Arrays.asList(resultingTools));
- for(int i = 0; i < resultingTools.length; i++){
+ for (int i = 0; i < resultingTools.length; i++) {
ITool tool = resultingTools[i];
map.put(tool.getId(), tool);
}
@@ -1046,16 +1045,16 @@ public class ResourceConfiguration extends ResourceInfo implements IFileInfo {
}
@Override
- public boolean isSupported(){
+ public boolean isSupported() {
IFolderInfo foInfo = getParentFolderInfo();
- if(foInfo == null){
+ if (foInfo == null) {
IConfiguration cfg = getParent();
- if(cfg != null) {
+ if (cfg != null) {
foInfo = cfg.getRootFolderInfo();
}
}
- if(foInfo != null)
+ 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 3d9e17a62e6..787f35f7979 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
@@ -49,20 +49,20 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo
private ResourceInfoContainer rcInfo;
private CResourceData resourceData;
- ResourceInfo(IConfiguration cfg, IManagedConfigElement element, boolean hasBody){
- config = (Configuration)cfg;
- if(hasBody)
+ ResourceInfo(IConfiguration cfg, IManagedConfigElement element, boolean hasBody) {
+ config = (Configuration) cfg;
+ if (hasBody)
loadFromManifest(element);
}
ResourceInfo(IConfiguration cfg, ResourceInfo base, String id) {
- config = (Configuration)cfg;
+ config = (Configuration) cfg;
path = normalizePath(base.path);
setId(id);
setName(base.getName());
- if(id.equals(base.getId())){
+ if (id.equals(base.getId())) {
isDirty = base.isDirty;
needsRebuild = base.needsRebuild;
} else {
@@ -71,12 +71,12 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo
}
}
- public boolean isRoot(){
+ public boolean isRoot() {
return path.segmentCount() == 0;
}
ResourceInfo(IConfiguration cfg, IPath path, String id, String name) {
- config = (Configuration)cfg;
+ config = (Configuration) cfg;
path = normalizePath(path);
this.path = path;
@@ -85,7 +85,7 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo
}
ResourceInfo(IFileInfo base, IPath path, String id, String name) {
- config = (Configuration)base.getParent();
+ config = (Configuration) base.getParent();
setId(id);
setName(name);
@@ -97,7 +97,7 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo
}
ResourceInfo(FolderInfo base, IPath path, String id, String name) {
- config = (Configuration)base.getParent();
+ config = (Configuration) base.getParent();
setId(id);
setName(name);
@@ -108,9 +108,9 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo
isDirty = true;
}
- ResourceInfo(IConfiguration cfg, ICStorageElement element, boolean hasBody){
- config = (Configuration)cfg;
- if(hasBody)
+ ResourceInfo(IConfiguration cfg, ICStorageElement element, boolean hasBody) {
+ config = (Configuration) cfg;
+ if (hasBody)
loadFromProject(element);
}
@@ -124,22 +124,23 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo
// resourcePath
String tmp = element.getAttribute(RESOURCE_PATH);
- if(tmp != null){
+ if (tmp != null) {
path = new Path(tmp);
- if(IResourceConfiguration.RESOURCE_CONFIGURATION_ELEMENT_NAME.equals(element.getName())){
+ if (IResourceConfiguration.RESOURCE_CONFIGURATION_ELEMENT_NAME.equals(element.getName())) {
path = path.removeFirstSegments(1);
}
path = normalizePath(path);
} else {
- Status status = new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "ResourceInfo.loadFromManifest() : resourcePath=NULL", null); //$NON-NLS-1$
+ Status status = new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID,
+ "ResourceInfo.loadFromManifest() : resourcePath=NULL", null); //$NON-NLS-1$
ManagedBuilderCorePlugin.log(status);
}
// exclude
- String excludeStr = element.getAttribute(EXCLUDE);
- if (excludeStr != null){
- config.setExcluded(getPath(), isFolderInfo(), (Boolean.parseBoolean(excludeStr)));
- }
+ String excludeStr = element.getAttribute(EXCLUDE);
+ if (excludeStr != null) {
+ config.setExcluded(getPath(), isFolderInfo(), (Boolean.parseBoolean(excludeStr)));
+ }
}
private void loadFromProject(ICStorageElement element) {
@@ -155,14 +156,15 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo
// resourcePath
if (element.getAttribute(RESOURCE_PATH) != null) {
String tmp = element.getAttribute(RESOURCE_PATH);
- if(tmp != null){
+ if (tmp != null) {
path = new Path(tmp);
- if(IResourceConfiguration.RESOURCE_CONFIGURATION_ELEMENT_NAME.equals(element.getName())){
+ if (IResourceConfiguration.RESOURCE_CONFIGURATION_ELEMENT_NAME.equals(element.getName())) {
path = path.removeFirstSegments(1);
}
path = normalizePath(path);
} else {
- Status status = new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "ResourceInfo.loadFromProject() : resourcePath=NULL", null); //$NON-NLS-1$
+ Status status = new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID,
+ "ResourceInfo.loadFromProject() : resourcePath=NULL", null); //$NON-NLS-1$
ManagedBuilderCorePlugin.log(status);
}
}
@@ -170,13 +172,12 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo
// exclude
if (element.getAttribute(EXCLUDE) != null) {
String excludeStr = element.getAttribute(EXCLUDE);
- if (excludeStr != null){
- config.setExcluded(getPath(), isFolderInfo(), (Boolean.parseBoolean(excludeStr)));
+ if (excludeStr != null) {
+ config.setExcluded(getPath(), isFolderInfo(), (Boolean.parseBoolean(excludeStr)));
}
}
}
-
@Override
public IConfiguration getParent() {
return config;
@@ -209,7 +210,7 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo
@Override
public void setExclude(boolean excluded) {
- if(isExcluded() == excluded)
+ if (isExcluded() == excluded)
return;
config.setExcluded(getPath(), isFolderInfo(), excluded);
@@ -228,7 +229,7 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo
@Override
public void setPath(IPath p) {
p = normalizePath(p);
- if(path == null)
+ if (path == null)
path = p;
else if (!p.equals(normalizePath(this.path))) {
ResourceInfoContainer info = getRcInfo();
@@ -240,8 +241,8 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo
}
- private ResourceInfoContainer getRcInfo(){
- if(rcInfo == null)
+ private ResourceInfoContainer getRcInfo() {
+ if (rcInfo == null)
rcInfo = (config).getRcInfoContainer(this);
return rcInfo;
}
@@ -251,7 +252,7 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo
needsRebuild = rebuild;
}
- void serialize(ICStorageElement element){
+ void serialize(ICStorageElement element) {
element.setAttribute(IBuildObject.ID, id);
if (name != null) {
@@ -263,30 +264,31 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo
}
}
- void resolveReferences() {}
+ void resolveReferences() {
+ }
@Override
- public CResourceData getResourceData(){
+ public CResourceData getResourceData() {
return resourceData;
}
- protected void setResourceData(CResourceData data){
+ protected void setResourceData(CResourceData data) {
resourceData = data;
}
- void removed(){
+ void removed() {
config = null;
}
@Override
- public boolean isValid(){
+ public boolean isValid() {
return config != null;
}
private void propagate(IHoldsOptions parent, IOption option, Object oldValue, Object value) {
- if (! (parent instanceof ITool))
+ if (!(parent instanceof ITool))
return;
- ITool tool = (ITool)parent;
+ ITool tool = (ITool) parent;
String sup = option.getId();
IOption op = option;
while (op.getSuperClass() != null) {
@@ -302,32 +304,31 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo
continue;
try {
if (value instanceof Boolean) {
- boolean b = ((Boolean)oldValue).booleanValue();
- if (b == op.getBooleanValue() && b != ((Boolean)value).booleanValue())
- ri.setOption(t, op, ((Boolean)value).booleanValue());
+ boolean b = ((Boolean) oldValue).booleanValue();
+ if (b == op.getBooleanValue() && b != ((Boolean) value).booleanValue())
+ ri.setOption(t, op, ((Boolean) value).booleanValue());
} else if (value instanceof String) {
- String s = (String)oldValue;
- if (s.equals(op.getStringValue()) && ! s.equals(value))
- ri.setOption(t, op, (String)value);
+ String s = (String) oldValue;
+ if (s.equals(op.getStringValue()) && !s.equals(value))
+ ri.setOption(t, op, (String) value);
} else if (value instanceof String[]) {
- String[] s = (String[])oldValue;
- if (Arrays.equals(s, op.getStringListValue()) &&
- ! Arrays.equals(s, (String[])value))
- ri.setOption(t, op, (String[])value);
+ String[] s = (String[]) oldValue;
+ if (Arrays.equals(s, op.getStringListValue()) && !Arrays.equals(s, (String[]) value))
+ ri.setOption(t, op, (String[]) value);
} else if (value instanceof OptionStringValue[]) {
- OptionStringValue[] s = (OptionStringValue[])oldValue;
- if (Arrays.equals(s, op.getBasicStringListValueElements()) &&
- ! Arrays.equals(s, (OptionStringValue[])value))
- ri.setOption(t, op, (OptionStringValue[])value);
+ OptionStringValue[] s = (OptionStringValue[]) oldValue;
+ if (Arrays.equals(s, op.getBasicStringListValueElements())
+ && !Arrays.equals(s, (OptionStringValue[]) value))
+ ri.setOption(t, op, (OptionStringValue[]) value);
}
break;
- } catch (BuildException e) {}
+ } catch (BuildException e) {
+ }
}
}
}
-
@Override
public IOption setOption(IHoldsOptions parent, IOption option, boolean value) throws BuildException {
// Is there a change?
@@ -336,9 +337,7 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo
if (oldVal != value) {
retOpt = parent.getOptionToSet(option, false);
retOpt.setValue(value);
- propagate(parent, option,
- (oldVal ? Boolean.TRUE : Boolean.FALSE),
- (value ? Boolean.TRUE : Boolean.FALSE));
+ propagate(parent, option, (oldVal ? Boolean.TRUE : Boolean.FALSE), (value ? Boolean.TRUE : Boolean.FALSE));
NotificationManager.getInstance().optionChanged(this, parent, option, Boolean.valueOf(oldVal));
}
return retOpt;
@@ -364,14 +363,14 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo
// Is there a change?
String[] oldValue;
switch (option.getBasicValueType()) {
- case IOption.STRING_LIST :
- oldValue = option.getBasicStringListValue();
- break;
- default :
- oldValue = new String[0];
- break;
+ case IOption.STRING_LIST:
+ oldValue = option.getBasicStringListValue();
+ break;
+ default:
+ oldValue = new String[0];
+ break;
}
- if(!Arrays.equals(value, oldValue)) {
+ if (!Arrays.equals(value, oldValue)) {
retOpt = parent.getOptionToSet(option, false);
retOpt.setValue(value);
propagate(parent, option, oldValue, value);
@@ -386,30 +385,29 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo
// Is there a change?
OptionStringValue[] oldValue;
switch (option.getBasicValueType()) {
- case IOption.STRING_LIST :
- oldValue = ((Option)option).getBasicStringListValueElements();
- break;
- default :
- oldValue = new OptionStringValue[0];
- break;
+ case IOption.STRING_LIST:
+ oldValue = ((Option) option).getBasicStringListValueElements();
+ break;
+ default:
+ oldValue = new OptionStringValue[0];
+ break;
}
- if(!Arrays.equals(value, oldValue)) {
+ if (!Arrays.equals(value, oldValue)) {
retOpt = parent.getOptionToSet(option, false);
- ((Option)retOpt).setValue(value);
+ ((Option) retOpt).setValue(value);
propagate(parent, option, oldValue, value);
NotificationManager.getInstance().optionChanged(this, parent, option, oldValue);
}
return retOpt;
}
-
- public void propertiesChanged(){
- if(isExtensionElement())
+ public void propertiesChanged() {
+ if (isExtensionElement())
return;
ITool tools[] = getTools();
for (ITool tool : tools) {
- ((Tool)tool).propertiesChanged();
+ ((Tool) tool).propertiesChanged();
}
}
@@ -418,58 +416,58 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo
public abstract Set<String> contributeErrorParsers(Set<String> set);
- protected Set<String> contributeErrorParsers(ITool[] tools, Set<String> set){
+ protected Set<String> contributeErrorParsers(ITool[] tools, Set<String> set) {
for (ITool tool : tools) {
- set = ((Tool)tool).contributeErrorParsers(set);
+ set = ((Tool) tool).contributeErrorParsers(set);
}
return set;
}
public abstract void resetErrorParsers();
- protected void resetErrorParsers(ITool tools[]){
+ protected void resetErrorParsers(ITool tools[]) {
for (ITool tool : tools) {
- ((Tool)tool).resetErrorParsers();
+ ((Tool) tool).resetErrorParsers();
}
}
abstract void removeErrorParsers(Set<String> set);
- protected void removeErrorParsers(ITool tools[], Set<String> set){
+ protected void removeErrorParsers(ITool tools[], Set<String> set) {
for (ITool tool : tools) {
- ((Tool)tool).removeErrorParsers(set);
+ ((Tool) tool).removeErrorParsers(set);
}
}
public ITool getToolById(String id) {
ITool[] tools = getTools();
for (ITool tool : tools) {
- if(id.equals(tool.getId()))
+ if (id.equals(tool.getId()))
return tool;
}
return null;
}
- public static IPath normalizePath(IPath path){
+ public static IPath normalizePath(IPath path) {
return path.makeRelative();
}
- public ResourceInfo getParentResourceInfo(){
- if(isRoot())
+ public ResourceInfo getParentResourceInfo() {
+ if (isRoot())
return null;
IPath path = getPath();
path = path.removeLastSegments(1);
- return (ResourceInfo)getParent().getResourceInfo(path, false);
+ return (ResourceInfo) getParent().getResourceInfo(path, false);
}
- public IFolderInfo getParentFolderInfo(){
+ public IFolderInfo getParentFolderInfo() {
ResourceInfo parentRc = getParentResourceInfo();
- for(; parentRc != null && !parentRc.isFolderInfo(); parentRc = parentRc.getParentResourceInfo()) {
+ for (; parentRc != null && !parentRc.isFolderInfo(); parentRc = parentRc.getParentResourceInfo()) {
// empty body, loop is to find parent only
}
- return (IFolderInfo)parentRc;
+ return (IFolderInfo) parentRc;
}
abstract void resolveProjectReferences(boolean onLoad);
@@ -481,12 +479,12 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo
return ToolChainModificationHelper.getModificationInfo(this, curTools, tools);
}
- static ITool[][] getRealPairs(ITool[] tools){
+ static ITool[][] getRealPairs(ITool[] tools) {
ITool[][] pairs = new ITool[tools.length][];
- for(int i = 0; i < tools.length; i++){
+ for (int i = 0; i < tools.length; i++) {
ITool[] pair = new ITool[2];
pair[0] = ManagedBuildManager.getRealTool(tools[i]);
- if(pair[0] == null)
+ if (pair[0] == null)
pair[0] = tools[i];
pair[1] = tools[i];
pairs[i] = pair;
@@ -496,7 +494,7 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo
abstract void applyToolsInternal(ITool[] resultingTools, ToolListModificationInfo info);
- void doApply(ToolListModificationInfo info){
+ void doApply(ToolListModificationInfo info) {
ITool[] resulting = info.getResultingTools();
ITool[] removed = info.getRemovedTools();
@@ -508,21 +506,21 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo
performPostModificationAdjustments(info);
}
- void performPostModificationAdjustments(ToolListModificationInfo info){
+ void performPostModificationAdjustments(ToolListModificationInfo info) {
propertiesChanged();
}
- public IResourceInfo[] getDirectChildResourceInfos(){
+ public IResourceInfo[] getDirectChildResourceInfos() {
ResourceInfoContainer cr = getRcInfo();
return cr.getDirectChildResourceInfos();
}
- public IResourceInfo[] getChildResourceInfos(){
+ public IResourceInfo[] getChildResourceInfos() {
ResourceInfoContainer cr = getRcInfo();
return cr.getResourceInfos();
}
- public List<IResourceInfo> getChildResourceInfoList(boolean includeCurrent){
+ public List<IResourceInfo> getChildResourceInfoList(boolean includeCurrent) {
return getRcInfo().getRcInfoList(ICSettingBase.SETTING_FILE | ICSettingBase.SETTING_FOLDER, includeCurrent);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceInfoContainer.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceInfoContainer.java
index 1bc5b33aa1a..d0092554009 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceInfoContainer.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ResourceInfoContainer.java
@@ -29,27 +29,27 @@ public class ResourceInfoContainer {
private PathSettingsContainer fRcDataContainer;
private boolean fIncludeCurrent;
- public ResourceInfoContainer(PathSettingsContainer pathSettings, boolean includeCurrent){
+ public ResourceInfoContainer(PathSettingsContainer pathSettings, boolean includeCurrent) {
fRcDataContainer = pathSettings;
fIncludeCurrent = includeCurrent;
}
- public void changeCurrentPath(IPath path, boolean moveChildren){
+ public void changeCurrentPath(IPath path, boolean moveChildren) {
fRcDataContainer.setPath(path, moveChildren);
}
- public IPath getCurrentPath(){
+ public IPath getCurrentPath() {
return fRcDataContainer.getPath();
}
- public IResourceInfo getCurrentResourceInfo(){
- return (IResourceInfo)fRcDataContainer.getValue();
+ public IResourceInfo getCurrentResourceInfo() {
+ return (IResourceInfo) fRcDataContainer.getValue();
}
public IResourceInfo getResourceInfo(IPath path, boolean exactPath) {
PathSettingsContainer cr = fRcDataContainer.getChildContainer(path, false, exactPath);
- if(cr != null)
- return (IResourceInfo)cr.getValue();
+ if (cr != null)
+ return (IResourceInfo) cr.getValue();
return null;
}
@@ -65,39 +65,39 @@ public class ResourceInfoContainer {
return getResourceInfos(kind, IResourceInfo.class);
}
- public IResourceInfo[] getResourceInfos(int kind, Class<? extends IResourceInfo> clazz){
+ public IResourceInfo[] getResourceInfos(int kind, Class<? extends IResourceInfo> clazz) {
List<IResourceInfo> list = getRcInfoList(kind);
- IResourceInfo datas[] = (IResourceInfo[])Array.newInstance(clazz, list.size());
+ IResourceInfo datas[] = (IResourceInfo[]) Array.newInstance(clazz, list.size());
return list.toArray(datas);
}
- public IResourceInfo[] getDirectChildResourceInfos(){
+ public IResourceInfo[] getDirectChildResourceInfos() {
PathSettingsContainer[] children = fRcDataContainer.getDirectChildren();
IResourceInfo datas[] = new IResourceInfo[children.length];
- for(int i = 0; i < datas.length; i++){
- datas[i] = (IResourceInfo)children[i].getValue();
+ for (int i = 0; i < datas.length; i++) {
+ datas[i] = (IResourceInfo) children[i].getValue();
}
return datas;
}
- public List<IResourceInfo> getRcInfoList(final int kind){
+ public List<IResourceInfo> getRcInfoList(final int kind) {
return getRcInfoList(kind, fIncludeCurrent);
}
- public List<IResourceInfo> getRcInfoList(final int kind, final boolean includeCurrent){
+ public List<IResourceInfo> getRcInfoList(final int kind, final boolean includeCurrent) {
final List<IResourceInfo> list = new ArrayList<IResourceInfo>();
- fRcDataContainer.accept(new IPathSettingsContainerVisitor(){
+ fRcDataContainer.accept(new IPathSettingsContainerVisitor() {
@Override
public boolean visit(PathSettingsContainer container) {
- if(includeCurrent || container != fRcDataContainer){
- IResourceInfo data = (IResourceInfo)container.getValue();
- if((data.getKind() & kind) == data.getKind())
+ if (includeCurrent || container != fRcDataContainer) {
+ IResourceInfo data = (IResourceInfo) container.getValue();
+ if ((data.getKind() & kind) == data.getKind())
list.add(data);
}
return true;
@@ -107,9 +107,9 @@ public class ResourceInfoContainer {
return list;
}
- public IResourceInfo getResourceInfo(IPath path, boolean exactPath, int kind){
+ public IResourceInfo getResourceInfo(IPath path, boolean exactPath, int kind) {
IResourceInfo data = getResourceInfo(path, exactPath);
- if(data != null && (data.getKind() & kind) == data.getKind())
+ if (data != null && (data.getKind() & kind) == data.getKind())
return data;
return null;
}
@@ -118,16 +118,16 @@ public class ResourceInfoContainer {
fRcDataContainer.removeChildContainer(path);
}
- public void addResourceInfo(IResourceInfo data){
+ public void addResourceInfo(IResourceInfo data) {
PathSettingsContainer cr = fRcDataContainer.getChildContainer(data.getPath(), true, true);
cr.setValue(data);
}
- public IFileInfo getFileInfo(IPath path){
- return (IFileInfo)getResourceInfo(path, true, ICSettingBase.SETTING_FILE);
+ public IFileInfo getFileInfo(IPath path) {
+ return (IFileInfo) getResourceInfo(path, true, ICSettingBase.SETTING_FILE);
}
- public IFolderInfo getFolderInfo(IPath path){
- return (IFolderInfo)getResourceInfo(path, true, ICSettingBase.SETTING_FOLDER);
+ public IFolderInfo getFolderInfo(IPath path) {
+ return (IFolderInfo) getResourceInfo(path, true, ICSettingBase.SETTING_FOLDER);
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/SettingsChangeEvent.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/SettingsChangeEvent.java
index 85f667d2607..9a3909b4c7b 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/SettingsChangeEvent.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/SettingsChangeEvent.java
@@ -22,16 +22,16 @@ public class SettingsChangeEvent {
private IHoldsOptions fHolder;
private IOption fOption;
private Object fOldValue;
-
+
private int fChangeType;
private int fSettingType;
public static final int CHANGED = 1;
public static final int ADDED = 1 << 1;
public static final int REMOVED = 1 << 2;
-
+
public static final int OPTION = 1;
-
- SettingsChangeEvent(int changeType, IResourceInfo rcInfo, IHoldsOptions holder, IOption option, Object oldValue){
+
+ SettingsChangeEvent(int changeType, IResourceInfo rcInfo, IHoldsOptions holder, IOption option, Object oldValue) {
fSettingType = OPTION;
fChangeType = changeType;
fRcInfo = rcInfo;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/SourcePath.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/SourcePath.java
index f3c9e9d8628..43f98477561 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/SourcePath.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/SourcePath.java
@@ -22,29 +22,29 @@ class SourcePath {
static final String ELEMENT_NAME = "sourcePath"; //$NON-NLS-1$
private static final String ATTRIBUTE_PATH = "path"; //$NON-NLS-1$
private IPath path;
-
+
SourcePath(IPath path) {
this.path = path;
}
-
+
SourcePath(ICStorageElement el) {
String pathStr = el.getAttribute(ATTRIBUTE_PATH);
- if(pathStr != null)
+ if (pathStr != null)
path = new Path(pathStr);
}
SourcePath(IManagedConfigElement el) {
String pathStr = el.getAttribute(ATTRIBUTE_PATH);
- if(pathStr != null)
+ if (pathStr != null)
path = new Path(pathStr);
}
- public IPath getPath(){
+ public IPath getPath() {
return path;
}
-
- void serialize(ICStorageElement el){
- if(path != null){
+
+ void serialize(ICStorageElement el) {
+ if (path != null) {
String strPath = path.toString();
el.setAttribute(ATTRIBUTE_PATH, strPath);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/SupportedProperties.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/SupportedProperties.java
index b21ad13d853..2b841fa7aa0 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/SupportedProperties.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/SupportedProperties.java
@@ -26,11 +26,11 @@ import org.eclipse.cdt.managedbuilder.core.IBuildPropertiesRestriction;
import org.eclipse.cdt.managedbuilder.core.IManagedConfigElement;
public class SupportedProperties implements IBuildPropertiesRestriction {
- public static final String SUPPORTED_PROPERTIES = "supportedProperties"; //$NON-NLS-1$
- public static final String PROPERTY = "property"; //$NON-NLS-1$
- public static final String PROPERTY_VALUE = "value"; //$NON-NLS-1$
- public static final String ID = "id"; //$NON-NLS-1$
- public static final String REQUIRED = "required"; //$NON-NLS-1$
+ public static final String SUPPORTED_PROPERTIES = "supportedProperties"; //$NON-NLS-1$
+ public static final String PROPERTY = "property"; //$NON-NLS-1$
+ public static final String PROPERTY_VALUE = "value"; //$NON-NLS-1$
+ public static final String ID = "id"; //$NON-NLS-1$
+ public static final String REQUIRED = "required"; //$NON-NLS-1$
private HashMap<String, SupportedProperty> fSupportedProperties = new HashMap<String, SupportedProperty>();
@@ -39,106 +39,106 @@ public class SupportedProperties implements IBuildPropertiesRestriction {
private Set<String> fValues = new HashSet<String>();
private String fId;
- SupportedProperty(String id){
+ SupportedProperty(String id) {
fId = id;
}
- void updateRequired(boolean required){
- if(!fIsRequired)
+ void updateRequired(boolean required) {
+ if (!fIsRequired)
fIsRequired = required;
}
- public String getId(){
+ public String getId() {
return fId;
}
-/* SupportedProperty(IManagedConfigElement el) {
- fId = el.getAttribute(ID);
+ /* SupportedProperty(IManagedConfigElement el) {
+ fId = el.getAttribute(ID);
-// IBuildPropertyType type = mngr.getPropertyType(id);
-// if(type == null)
-// continue;
+ // IBuildPropertyType type = mngr.getPropertyType(id);
+ // if(type == null)
+ // continue;
- fIsRequired = Boolean.valueOf(el.getAttribute(REQUIRED)).booleanValue();
+ fIsRequired = Boolean.valueOf(el.getAttribute(REQUIRED)).booleanValue();
- fValues = new HashSet();
+ fValues = new HashSet();
- IManagedConfigElement values[] = el.getChildren();
- for(int k = 0; k < values.length; k++){
- IManagedConfigElement value = values[k];
- if(PROPERTY_VALUE.equals(value.getName())){
- String valueId = value.getAttribute(ID);
- if(valueId == null && valueId.length() == 0)
- continue;
+ IManagedConfigElement values[] = el.getChildren();
+ for(int k = 0; k < values.length; k++){
+ IManagedConfigElement value = values[k];
+ if(PROPERTY_VALUE.equals(value.getName())){
+ String valueId = value.getAttribute(ID);
+ if(valueId == null && valueId.length() == 0)
+ continue;
-// IBuildPropertyValue val = type.getSupportedValue(valueId);
-// if(val != null)
-// set.add(val.getId());
- fValues.add(valueId);
+ // IBuildPropertyValue val = type.getSupportedValue(valueId);
+ // if(val != null)
+ // set.add(val.getId());
+ fValues.add(valueId);
+ }
+ }
}
- }
- }
-*/
-// public boolean isValid(){
-// return fId != null && fValues.size() != 0;
-// }
+ */
+ // public boolean isValid(){
+ // return fId != null && fValues.size() != 0;
+ // }
- public boolean isRequired(){
+ public boolean isRequired() {
return fIsRequired;
}
- public void addValueIds(Set<String> ids){
+ public void addValueIds(Set<String> ids) {
fValues.addAll(ids);
}
- public boolean supportsValue(String id){
+ public boolean supportsValue(String id) {
return fValues.contains(id);
}
- public String[] getSupportedValues(){
+ public String[] getSupportedValues() {
return fValues.toArray(new String[fValues.size()]);
}
}
- public SupportedProperties(IManagedConfigElement el){
-// IBuildPropertyManager mngr = BuildPropertyManager.getInstance();
+ public SupportedProperties(IManagedConfigElement el) {
+ // IBuildPropertyManager mngr = BuildPropertyManager.getInstance();
IManagedConfigElement children[] = el.getChildren();
- for(int i = 0; i < children.length; i++){
+ for (int i = 0; i < children.length; i++) {
IManagedConfigElement child = children[i];
- if(PROPERTY.equals(child.getName())){
+ if (PROPERTY.equals(child.getName())) {
String id = SafeStringInterner.safeIntern(child.getAttribute(ID));
- if(id == null)
+ if (id == null)
continue;
boolean required = Boolean.valueOf(el.getAttribute(REQUIRED)).booleanValue();
-// IBuildPropertyType type = mngr.getPropertyType(id);
-// if(type == null)
-// continue;
+ // IBuildPropertyType type = mngr.getPropertyType(id);
+ // if(type == null)
+ // continue;
Set<String> set = new HashSet<String>();
IManagedConfigElement values[] = child.getChildren();
- for(int k = 0; k < values.length; k++){
+ for (int k = 0; k < values.length; k++) {
IManagedConfigElement value = values[k];
- if(PROPERTY_VALUE.equals(value.getName())){
+ if (PROPERTY_VALUE.equals(value.getName())) {
String valueId = SafeStringInterner.safeIntern(value.getAttribute(ID));
- if(valueId == null || valueId.length() == 0)
+ if (valueId == null || valueId.length() == 0)
continue;
-// IBuildPropertyValue val = type.getSupportedValue(valueId);
-// if(val != null)
-// set.add(val.getId());
+ // IBuildPropertyValue val = type.getSupportedValue(valueId);
+ // if(val != null)
+ // set.add(val.getId());
set.add(valueId);
}
}
- if(set.size() != 0){
+ if (set.size() != 0) {
SupportedProperty stored = fSupportedProperties.get(id);
- if(stored == null){
+ if (stored == null) {
stored = new SupportedProperty(id);
fSupportedProperties.put(id, stored);
}
@@ -150,9 +150,9 @@ public class SupportedProperties implements IBuildPropertiesRestriction {
}
-// public boolean supportsType(IBuildPropertyType type) {
-// return supportsType(type.getId());
-// }
+ // public boolean supportsType(IBuildPropertyType type) {
+ // return supportsType(type.getId());
+ // }
@Override
public boolean supportsType(String type) {
@@ -160,26 +160,26 @@ public class SupportedProperties implements IBuildPropertiesRestriction {
}
@Override
- public boolean supportsValue(String type, String value){
+ public boolean supportsValue(String type, String value) {
boolean suports = false;
SupportedProperty prop = fSupportedProperties.get(type);
- if(prop != null){
+ if (prop != null) {
suports = prop.supportsValue(value);
}
return suports;
}
-// public boolean supportsValue(IBuildPropertyType type,
-// IBuildPropertyValue value) {
-// return supportsValue(type.getId(), value.getId());
-// }
+ // public boolean supportsValue(IBuildPropertyType type,
+ // IBuildPropertyValue value) {
+ // return supportsValue(type.getId(), value.getId());
+ // }
@Override
public String[] getRequiredTypeIds() {
List<String> list = new ArrayList<String>(fSupportedProperties.size());
Collection<SupportedProperty> values = fSupportedProperties.values();
for (SupportedProperty prop : values) {
- if(prop.isRequired())
+ if (prop.isRequired())
list.add(prop.getId());
}
return list.toArray(new String[list.size()]);
@@ -195,7 +195,7 @@ public class SupportedProperties implements IBuildPropertiesRestriction {
@Override
public String[] getSupportedValueIds(String typeId) {
SupportedProperty prop = fSupportedProperties.get(typeId);
- if(prop != null)
+ if (prop != null)
return prop.getSupportedValues();
return new String[0];
}
@@ -203,7 +203,7 @@ public class SupportedProperties implements IBuildPropertiesRestriction {
@Override
public boolean requiresType(String typeId) {
SupportedProperty prop = fSupportedProperties.get(typeId);
- if(prop != null)
+ if (prop != null)
return prop.isRequired();
return false;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
index df9be65c009..d441885a998 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
@@ -50,7 +50,7 @@ public class Target extends BuildObject implements ITarget {
private List<IConfigurationV2> configList;
private Map<String, IConfigurationV2> configMap;
private String defaultExtension;
-// private Map depCalculatorsMap;
+ // private Map depCalculatorsMap;
private String errorParserIds;
private String extension;
private boolean isAbstract = false;
@@ -151,7 +151,7 @@ public class Target extends BuildObject implements ITarget {
// Then load any tools defined for the target
IManagedConfigElement[] tools = element.getChildren(ITool.TOOL_ELEMENT_NAME);
for (int m = 0; m < tools.length; ++m) {
- ITool newTool = new Tool(this, tools[m], managedBuildRevision);
+ ITool newTool = new Tool(this, tools[m], managedBuildRevision);
// Add this tool to the target, as this is not done in the constructor
this.addTool(newTool);
}
@@ -180,7 +180,7 @@ public class Target extends BuildObject implements ITarget {
// Copy the parent's identity
this.parent = parent;
int id = ManagedBuildManager.getRandomNumber();
- setId(owner.getName() + "." + parent.getId() + "." + id); //$NON-NLS-1$ //$NON-NLS-2$
+ setId(owner.getName() + "." + parent.getId() + "." + id); //$NON-NLS-1$ //$NON-NLS-2$
setName(parent.getName());
setManagedBuildRevision(parent.getManagedBuildRevision());
@@ -191,7 +191,7 @@ public class Target extends BuildObject implements ITarget {
this.defaultExtension = parent.getArtifactExtension();
this.isTest = parent.isTestTarget();
this.cleanCommand = parent.getCleanCommand();
- this.scannerInfoCollectorId = ((Target)parent).scannerInfoCollectorId;
+ this.scannerInfoCollectorId = ((Target) parent).scannerInfoCollectorId;
// Hook me up
IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(owner);
@@ -248,14 +248,14 @@ public class Target extends BuildObject implements ITarget {
if (element.hasAttribute(MAKE_COMMAND)) {
makeCommand = element.getAttribute(MAKE_COMMAND);
}
- if(element.hasAttribute(MAKE_ARGS)) {
+ if (element.hasAttribute(MAKE_ARGS)) {
makeArguments = element.getAttribute(MAKE_ARGS);
}
Node child = element.getFirstChild();
while (child != null) {
if (child.getNodeName().equals(IConfigurationV2.CONFIGURATION_ELEMENT_NAME)) {
- new ConfigurationV2(this, (Element)child);
+ new ConfigurationV2(this, (Element) child);
}
child = child.getNextSibling();
}
@@ -282,14 +282,13 @@ public class Target extends BuildObject implements ITarget {
getLocalToolReferences().add(toolRef);
}
-
/**
* Tail-recursion method that creates a lits of tools and tool reference
* walking the receiver's parent hierarchy.
*/
private void addToolsToArray(Vector<ITool> toolArray) {
if (parent != null) {
- ((Target)parent).addToolsToArray(toolArray);
+ ((Target) parent).addToolsToArray(toolArray);
}
// Add the tools from out own list
@@ -442,12 +441,12 @@ public class Target extends BuildObject implements ITarget {
return defaultExtension == null ? EMPTY_STRING : defaultExtension;
}
-// private Map getDepCalcMap() {
-// if (depCalculatorsMap == null) {
-// depCalculatorsMap = new HashMap();
-// }
-// return depCalculatorsMap;
-// }
+ // private Map getDepCalcMap() {
+ // if (depCalculatorsMap == null) {
+ // depCalculatorsMap = new HashMap();
+ // }
+ // return depCalculatorsMap;
+ // }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITarget#getErrorParserIds()
@@ -480,7 +479,7 @@ public class Target extends BuildObject implements ITarget {
while (tok.hasMoreElements()) {
list.add(tok.nextToken());
}
- String[] strArr = {""}; //$NON-NLS-1$
+ String[] strArr = { "" }; //$NON-NLS-1$
errorParsers = list.toArray(strArr);
}
} else {
@@ -568,7 +567,7 @@ public class Target extends BuildObject implements ITarget {
// See if there is anything that my parents add that I don't
if (parent != null) {
- List<OptionReference> refs = ((Target)parent).getOptionReferences(tool);
+ List<OptionReference> refs = ((Target) parent).getOptionReferences(tool);
for (OptionReference ref : refs) {
if (!references.contains(ref)) {
references.add(ref);
@@ -606,7 +605,7 @@ public class Target extends BuildObject implements ITarget {
return parent.getTargetArchList();
} else {
// I have no parent and no defined list
- return new String[] {"all"}; //$NON-NLS-1$
+ return new String[] { "all" }; //$NON-NLS-1$
}
}
return targetArchList.toArray(new String[targetArchList.size()]);
@@ -623,7 +622,7 @@ public class Target extends BuildObject implements ITarget {
return parent.getTargetOSList();
} else {
// I have no parent and no defined filter list
- return new String[] {"all"}; //$NON-NLS-1$
+ return new String[] { "all" }; //$NON-NLS-1$
}
}
return targetOSList.toArray(new String[targetOSList.size()]);
@@ -641,7 +640,7 @@ public class Target extends BuildObject implements ITarget {
// If not, check if parent has it
if (result == null && parent != null) {
- result = ((Target)parent).getTool(id);
+ result = ((Target) parent).getTool(id);
}
// If not defined in parents, check if defined at all
@@ -682,7 +681,8 @@ public class Target extends BuildObject implements ITarget {
private ToolReference getToolReference(ITool tool) {
// See if the receiver has a reference to the tool
ToolReference ref = null;
- if (tool == null) return ref;
+ if (tool == null)
+ return ref;
List<ToolReference> localToolReferences = getLocalToolReferences();
for (ToolReference temp : localToolReferences) {
if (temp.references(tool)) {
@@ -710,7 +710,7 @@ public class Target extends BuildObject implements ITarget {
public boolean hasOverridenMakeCommand() {
// We answer true if the make command or the flags are different
return ((makeCommand != null && !makeCommand.equals(parent.getMakeCommand()))
- || (makeArguments != null && !makeArguments.equals(parent.getMakeArguments())));
+ || (makeArguments != null && !makeArguments.equals(parent.getMakeArguments())));
}
/* (non-Javadoc)
@@ -754,7 +754,7 @@ public class Target extends BuildObject implements ITarget {
* @see org.eclipse.cdt.managedbuilder.core.ITarget#needsRebuild()
*/
@Override
- public boolean needsRebuild(){
+ public boolean needsRebuild() {
// Iterate over the configurations and ask them if they need saving
List<IConfigurationV2> configurationList = getConfigurationList();
for (IConfigurationV2 cfgV2 : configurationList) {
@@ -773,12 +773,12 @@ public class Target extends BuildObject implements ITarget {
// Remove the specified configuration from the list and map
List<IConfigurationV2> configurationList = getConfigurationList();
for (IConfigurationV2 config : configurationList) {
- if (config.getId().equals(id)) {
- configurationList.remove(config);
+ if (config.getId().equals(id)) {
+ configurationList.remove(config);
getConfigurationMap().remove(id);
isDirty = true;
- break;
- }
+ break;
+ }
}
}
@@ -806,7 +806,7 @@ public class Target extends BuildObject implements ITarget {
if (parentId != null) {
parent = ManagedBuildManager.getTarget(null, parentId);
// should resolve before calling methods on it
- ((Target)parent).resolveReferences();
+ ((Target) parent).resolveReferences();
// copy over the parents configs
IConfigurationV2[] parentConfigs = parent.getConfigurations();
for (IConfigurationV2 cfgV2 : parentConfigs) {
@@ -817,7 +817,7 @@ public class Target extends BuildObject implements ITarget {
// call resolve references on any children
List<ITool> toolList = getToolList();
for (ITool current : toolList) {
- ((Tool)current).resolveReferences();
+ ((Tool) current).resolveReferences();
}
List<ToolReference> localToolReferences = getLocalToolReferences();
for (ToolReference current : localToolReferences) {
@@ -825,7 +825,7 @@ public class Target extends BuildObject implements ITarget {
}
List<IConfigurationV2> configurationList = getConfigurationList();
for (IConfigurationV2 current : configurationList) {
- ((ConfigurationV2)current).resolveReferences();
+ ((ConfigurationV2) current).resolveReferences();
}
}
}
@@ -863,7 +863,7 @@ public class Target extends BuildObject implements ITarget {
for (IConfigurationV2 config : configurationList) {
Element configElement = doc.createElement(IConfigurationV2.CONFIGURATION_ELEMENT_NAME);
element.appendChild(configElement);
- ((ConfigurationV2)config).serialize(doc, configElement);
+ ((ConfigurationV2) config).serialize(doc, configElement);
}
// I am clean now
@@ -912,7 +912,8 @@ public class Target extends BuildObject implements ITarget {
*/
@Override
public void setErrorParserIds(String ids) {
- if (ids == null) return;
+ if (ids == null)
+ return;
String currentIds = getErrorParserIds();
if (currentIds == null || !(currentIds.equals(ids))) {
errorParserIds = ids;
@@ -993,7 +994,8 @@ public class Target extends BuildObject implements ITarget {
// Add configurations (Configuration -> ToolChain -> Builder -> TargetPlatform)
List<IConfigurationV2> configurationList = getConfigurationList();
for (IConfigurationV2 configV2 : configurationList) {
- if (configV2.getCreatedConfig() != null) continue;
+ if (configV2.getCreatedConfig() != null)
+ continue;
// The new config's superClass needs to be the
// Configuration created from the ConfigurationV2 parent...
IConfiguration configSuperClass = null;
@@ -1013,39 +1015,42 @@ public class Target extends BuildObject implements ITarget {
// Create the Tool-chain
String subId;
String subName;
- subId = id + ".toolchain"; //$NON-NLS-1$
- subName = name + ".toolchain"; //$NON-NLS-1$
+ subId = id + ".toolchain"; //$NON-NLS-1$
+ subName = name + ".toolchain"; //$NON-NLS-1$
IToolChain toolChain = config.createToolChain(null, subId, subName, true);
// Set the tool chain attributes
toolChain.setIsAbstract(isAbstract);
toolChain.setOSList(getTargetOSList());
toolChain.setArchList(getTargetArchList());
- // In target element had a scannerInfoCollector element here which
- // is now replaced with scanner config discovery profile id.
- // Using the default per project profile for managed make
- if(scannerInfoCollectorId != null && scannerInfoCollectorId.equals("org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultGCCScannerInfoCollector")) //$NON-NLS-1$
- toolChain.setScannerConfigDiscoveryProfileId(ManagedBuildCPathEntryContainer.MM_PP_DISCOVERY_PROFILE_ID);
+ // In target element had a scannerInfoCollector element here which
+ // is now replaced with scanner config discovery profile id.
+ // Using the default per project profile for managed make
+ if (scannerInfoCollectorId != null && scannerInfoCollectorId
+ .equals("org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultGCCScannerInfoCollector")) //$NON-NLS-1$
+ toolChain
+ .setScannerConfigDiscoveryProfileId(ManagedBuildCPathEntryContainer.MM_PP_DISCOVERY_PROFILE_ID);
// Create the Builder
- subId = id + ".builder"; //$NON-NLS-1$
- subName = name + ".builder"; //$NON-NLS-1$
+ subId = id + ".builder"; //$NON-NLS-1$
+ subName = name + ".builder"; //$NON-NLS-1$
IBuilder builder = toolChain.createBuilder(null, subId, subName, true);
// Set the builder attributes
builder.setIsAbstract(isAbstract);
builder.setCommand(getMakeCommand());
builder.setArguments(getMakeArguments());
- IManagedConfigElement element = ManagedBuildManager.getConfigElement(this);
+ IManagedConfigElement element = ManagedBuildManager.getConfigElement(this);
if (element instanceof DefaultManagedConfigElement) {
- ((Builder)builder).setBuildFileGeneratorElement(((DefaultManagedConfigElement)element).getConfigurationElement());
+ ((Builder) builder).setBuildFileGeneratorElement(
+ ((DefaultManagedConfigElement) element).getConfigurationElement());
}
// Create the TargetPlatform
- subId = id + ".targetplatform"; //$NON-NLS-1$
- subName = name + ".targetplatform"; //$NON-NLS-1$
+ subId = id + ".targetplatform"; //$NON-NLS-1$
+ subName = name + ".targetplatform"; //$NON-NLS-1$
ITargetPlatform targetPlatform = toolChain.createTargetPlatform(null, subId, subName, true);
// Set the target platform attributes
targetPlatform.setIsAbstract(isAbstract);
targetPlatform.setOSList(getTargetOSList());
targetPlatform.setArchList(getTargetArchList());
- targetPlatform.setBinaryParserList(new String[]{getBinaryParserId()}); // Older projects will always have only one binary parser set.
+ targetPlatform.setBinaryParserList(new String[] { getBinaryParserId() }); // Older projects will always have only one binary parser set.
// Handle ConfigurationV2 children (ToolReference)
// The tools references fetched here are strictly local to the configuration,
@@ -1086,54 +1091,54 @@ public class Target extends BuildObject implements ITarget {
// Set the option attributes
newOption.setValue(optRef.getValue());
newOption.setValueType(optRef.getValueType());
- ((Option)newOption).setWasOptRef(true);
+ ((Option) newOption).setWasOptRef(true);
}
}
- // Process the tools in the configuration, adding them to the toolchain
+ // Process the tools in the configuration, adding them to the toolchain
// Tools for a configuration are stored in the enclosing target, so getting
// the tools for the configuration ultimately gets them from the enclosing target
ITool[] configTools = configV2.getTools();
for (int i = 0; i < configTools.length; ++i) {
ITool tool = configTools[i];
- // If tool references encountered, they have already been processed, above,
+ // If tool references encountered, they have already been processed, above,
// so ignore them now
if (!(tool instanceof ToolReference)) {
- // See if the toolchain already has a tool with a SuperClass that has an id
- // equal to the tool that we are considering adding to the toolchain; if so,
+ // See if the toolchain already has a tool with a SuperClass that has an id
+ // equal to the tool that we are considering adding to the toolchain; if so,
// don't add it
// This case arises when we have added a tool to the toolchain because
// we processed a ToolReference (above) that references this tool
// The original tool referenced in the ToolReference becomes the SuperClass
// of the tool that is created because of the ToolReference
boolean found = false;
- ITool[] tools = toolChain.getTools();
- ITool currentTool;
- ITool supercurrentTool;
+ ITool[] tools = toolChain.getTools();
+ ITool currentTool;
+ ITool supercurrentTool;
for (int j = 0; j < tools.length; ++j) {
currentTool = tools[j];
supercurrentTool = currentTool.getSuperClass();
if (supercurrentTool != null) {
- if (supercurrentTool.getId() == tool.getId()) {
- found = true;
- // If this tool was already added to the toolchain because of a
- // ToolReference, then we disconnent this redundant
- // tool from the target by setting the parent to null
- ((Tool)tool).setToolParent(null);
- break;
- }
+ if (supercurrentTool.getId() == tool.getId()) {
+ found = true;
+ // If this tool was already added to the toolchain because of a
+ // ToolReference, then we disconnent this redundant
+ // tool from the target by setting the parent to null
+ ((Tool) tool).setToolParent(null);
+ break;
+ }
}
}
if (!found)
// This tool is not in the toolchain yet, so add it to the toolchain
- ((ToolChain)toolChain).addTool((Tool)tool);
+ ((ToolChain) toolChain).addTool((Tool) tool);
}
}
// Normalize the outputextensions list by adding an empty string for each tool
// which did not have an explicit output file extension specified
- ((ToolChain)toolChain).normalizeOutputExtensions();
+ ((ToolChain) toolChain).normalizeOutputExtensions();
}
}
@@ -1144,7 +1149,7 @@ public class Target extends BuildObject implements ITarget {
public void addTargetToolReferences(Vector toolRefs) {
toolRefs.addAll(getLocalToolReferences());
if (parent != null) {
- Target targetParent = (Target)parent;
+ Target targetParent = (Target) parent;
targetParent.addTargetToolReferences(toolRefs);
}
}
@@ -1162,8 +1167,8 @@ public class Target extends BuildObject implements ITarget {
*/
@Override
public Version getVersion() {
- if ( version == null) {
- if ( getParent() != null) {
+ if (version == null) {
+ if (getParent() != null) {
return getParent().getVersion();
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/TargetPlatform.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/TargetPlatform.java
index daff5b667ef..34e0e67ee97 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/TargetPlatform.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/TargetPlatform.java
@@ -91,7 +91,8 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform {
* @param name The name for the new tool chain
* @param isExtensionElement Indicates whether this is an extension element or a managed project element
*/
- public TargetPlatform(ToolChain parent, ITargetPlatform superClass, String Id, String name, boolean isExtensionElement) {
+ public TargetPlatform(ToolChain parent, ITargetPlatform superClass, String Id, String name,
+ boolean isExtensionElement) {
this.parent = parent;
this.superClass = superClass;
setManagedBuildRevision(parent.getManagedBuildRevision());
@@ -140,9 +141,9 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform {
superClass = targetPlatform.isExtensionTargetPlatform ? targetPlatform : targetPlatform.superClass;
if (superClass != null) {
-// if (targetPlatform.superClassId != null) {
- superClassId = superClass.getId();// targetPlatform.superClassId;
-// }
+ // if (targetPlatform.superClassId != null) {
+ superClassId = superClass.getId();// targetPlatform.superClassId;
+ // }
}
setId(Id);
setName(name);
@@ -200,10 +201,10 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform {
unusedChildren = SafeStringInterner.safeIntern(element.getAttribute(IProjectType.UNUSED_CHILDREN));
// isAbstract
- String isAbs = element.getAttribute(IProjectType.IS_ABSTRACT);
- if (isAbs != null){
- isAbstract = Boolean.parseBoolean(isAbs);
- }
+ String isAbs = element.getAttribute(IProjectType.IS_ABSTRACT);
+ if (isAbs != null) {
+ isAbstract = Boolean.parseBoolean(isAbs);
+ }
// Get the comma-separated list of valid OS
String os = element.getAttribute(OS_LIST);
@@ -263,13 +264,13 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform {
// 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);
- if (isAbs != null){
+ if (isAbs != null) {
isAbstract = Boolean.parseBoolean(isAbs);
}
}
@@ -416,7 +417,7 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform {
if (isAbstract != null) {
return isAbstract.booleanValue();
} else {
- return false; // Note: no inheritance from superClass
+ return false; // Note: no inheritance from superClass
}
}
@@ -428,7 +429,7 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform {
if (unusedChildren != null) {
return unusedChildren;
} else
- return EMPTY_STRING; // Note: no inheritance from superClass
+ return EMPTY_STRING; // Note: no inheritance from superClass
}
/* (non-Javadoc)
@@ -438,7 +439,8 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform {
@Override
public String getBinaryParserId() {
String[] ids = getBinaryParserList();
- if (ids.length > 0) return ids[0];
+ if (ids.length > 0)
+ return ids[0];
return EMPTY_STRING;
}
@@ -469,7 +471,7 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform {
return superClass.getArchList();
} else {
// I have no superClass and no defined list
- return new String[] {"all"}; //$NON-NLS-1$
+ return new String[] { "all" }; //$NON-NLS-1$
}
}
return archList.toArray(new String[archList.size()]);
@@ -486,7 +488,7 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform {
return superClass.getOSList();
} else {
// I have no superClass and no defined filter list
- return new String[] {"all"}; //$NON-NLS-1$
+ return new String[] { "all" }; //$NON-NLS-1$
}
}
return osList.toArray(new String[osList.size()]);
@@ -501,7 +503,7 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform {
if (id == null) {
setBinaryParserList(new String[0]);
} else {
- setBinaryParserList(new String[]{id});
+ setBinaryParserList(new String[] { id });
}
}
@@ -510,7 +512,7 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform {
*/
@Override
public void setBinaryParserList(String[] ids) {
- if(ids != null){
+ if (ids != null) {
if (binaryParserList == null) {
binaryParserList = new ArrayList<String>();
} else {
@@ -588,7 +590,8 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform {
@Override
public boolean isDirty() {
// This shouldn't be called for an extension Builder
- if (isExtensionTargetPlatform) return false;
+ if (isExtensionTargetPlatform)
+ return false;
return isDirty;
}
@@ -611,10 +614,8 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform {
superClass = ManagedBuildManager.getExtensionTargetPlatform(superClassId);
if (superClass == null) {
// Report error
- ManagedBuildManager.outputResolveError(
- "superClass", //$NON-NLS-1$
- superClassId,
- "targetPlatform", //$NON-NLS-1$
+ ManagedBuildManager.outputResolveError("superClass", //$NON-NLS-1$
+ superClassId, "targetPlatform", //$NON-NLS-1$
getId());
}
}
@@ -626,8 +627,8 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform {
*/
@Override
public Version getVersion() {
- if ( version == null) {
- if ( getParent() != null) {
+ if (version == null) {
+ if (getParent() != null) {
return getParent().getVersion();
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
index 26a0066e9a3..9af0033c0b0 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
@@ -99,13 +99,14 @@ import org.osgi.framework.Version;
* Note that this class implements IOptionCategory to represent the top
* category.
*/
-public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatchKeyProvider<Tool>, IRealBuildObjectAssociation {
+public class Tool extends HoldsOptions
+ implements ITool, IOptionCategory, IMatchKeyProvider<Tool>, IRealBuildObjectAssociation {
public static final String DEFAULT_PATTERN = "${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}"; //$NON-NLS-1$
public static final String DEFAULT_CBS_PATTERN = "${COMMAND}"; //$NON-NLS-1$
//property name for holding the rebuild state
- private static final String REBUILD_STATE = "rebuildState"; //$NON-NLS-1$
+ private static final String REBUILD_STATE = "rebuildState"; //$NON-NLS-1$
private static final String DEFAULT_SEPARATOR = ","; //$NON-NLS-1$
//private static final IOptionCategory[] EMPTY_CATEGORIES = new IOptionCategory[0];
@@ -113,8 +114,8 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
private static final String EMPTY_QUOTED_STRING = "\"\""; //$NON-NLS-1$
private static final String[] EMPTY_STRING_ARRAY = new String[0];
- private static final String DEFAULT_ANNOUNCEMENT_PREFIX = "Tool.default.announcement"; //$NON-NLS-1$
- private static final String WHITESPACE = " "; //$NON-NLS-1$
+ private static final String DEFAULT_ANNOUNCEMENT_PREFIX = "Tool.default.announcement"; //$NON-NLS-1$
+ private static final String WHITESPACE = " "; //$NON-NLS-1$
private static final boolean resolvedDefault = true;
@@ -154,8 +155,8 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
private IConfigurationElement dependencyGeneratorElement = null;
private IManagedDependencyGeneratorType dependencyGenerator = null;
private URL iconPathURL;
- private IConfigurationElement pathconverterElement = null ;
- private IOptionPathConverter optionPathConverter = null ;
+ private IConfigurationElement pathconverterElement = null;
+ private IOptionPathConverter optionPathConverter = null;
private SupportedProperties supportedProperties;
private Boolean supportsManagedBuild;
private Boolean isHidden;
@@ -205,10 +206,9 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
addOptionCategory(this);
IManagedConfigElement enablements[] = element.getChildren(OptionEnablementExpression.NAME);
- if(enablements.length > 0)
+ if (enablements.length > 0)
booleanExpressionCalculator = new BooleanExpressionApplicabilityCalculator(enablements);
-
// Load children
IManagedConfigElement[] toolElements = element.getChildren();
for (int l = 0; l < toolElements.length; ++l) {
@@ -221,9 +221,9 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
} else if (toolElement.getName().equals(ITool.OUTPUT_TYPE)) {
OutputType outputType = new OutputType(this, toolElement);
addOutputType(outputType);
- } else if (toolElement.getName().equals(IEnvVarBuildPath.BUILD_PATH_ELEMENT_NAME)){
- addEnvVarBuildPath(new EnvVarBuildPath(this,toolElement));
- } else if (toolElement.getName().equals(SupportedProperties.SUPPORTED_PROPERTIES)){
+ } else if (toolElement.getName().equals(IEnvVarBuildPath.BUILD_PATH_ELEMENT_NAME)) {
+ addEnvVarBuildPath(new EnvVarBuildPath(this, toolElement));
+ } else if (toolElement.getName().equals(SupportedProperties.SUPPORTED_PROPERTIES)) {
loadProperties(toolElement);
}
}
@@ -266,9 +266,9 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
setName(name);
setVersion(getVersionFromId());
-// if(!superClass.isExtensionElement()){
-// ((Tool)superClass).updateScannerInfoSettingsToInputTypes();
-// }
+ // if(!superClass.isExtensionElement()){
+ // ((Tool)superClass).updateScannerInfoSettingsToInputTypes();
+ // }
isExtensionTool = isExtensionElement;
if (isExtensionElement) {
@@ -294,7 +294,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
public Tool(ResourceConfiguration parent, ITool superClass, String Id, String name, boolean isExtensionElement) {
super(resolvedDefault);
this.parent = parent;
- setSuperClassInternal( superClass );
+ setSuperClassInternal(superClass);
setManagedBuildRevision(parent.getManagedBuildRevision());
if (getSuperClass() != null) {
superClassId = getSuperClass().getId();
@@ -304,9 +304,9 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
setVersion(getVersionFromId());
isExtensionTool = isExtensionElement;
-// if(superClass != null && !superClass.isExtensionElement()){
-// ((Tool)superClass).updateScannerInfoSettingsToInputTypes();
-// }
+ // if(superClass != null && !superClass.isExtensionElement()){
+ // ((Tool)superClass).updateScannerInfoSettingsToInputTypes();
+ // }
if (isExtensionElement) {
// Hook me up to the Managed Build Manager
ManagedBuildManager.addExtensionTool(this);
@@ -355,7 +355,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
}
String rebuild = PropertyManager.getInstance().getProperty(this, REBUILD_STATE);
- if(rebuild == null || Boolean.valueOf(rebuild).booleanValue())
+ if (rebuild == null || Boolean.valueOf(rebuild).booleanValue())
rebuildState = true;
}
@@ -370,23 +370,23 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
* @param name The new Tool name
* @param tool The existing tool to clone.
*/
- public Tool(IBuildObject parent, ITool toolSuperClass, String Id, String name, Tool tool){
+ public Tool(IBuildObject parent, ITool toolSuperClass, String Id, String name, Tool tool) {
this(parent, toolSuperClass.getId(), Id, name, tool);
setSuperClassInternal(toolSuperClass);
}
- public Tool(IBuildObject parent, String toolSuperClassId, String Id, String name, Tool tool){
+ public Tool(IBuildObject parent, String toolSuperClassId, String Id, String name, Tool tool) {
super(resolvedDefault);
this.parent = parent;
-// if (toolSuperClass != null) {
-// setSuperClassInternal( toolSuperClass );
-// } else {
-// setSuperClassInternal( tool.getSuperClass() );
-// }
-// if (getSuperClass() != null) {
- superClassId = toolSuperClassId;//getSuperClass().getId();
-// }
+ // if (toolSuperClass != null) {
+ // setSuperClassInternal( toolSuperClass );
+ // } else {
+ // setSuperClassInternal( tool.getSuperClass() );
+ // }
+ // if (getSuperClass() != null) {
+ superClassId = toolSuperClassId;//getSuperClass().getId();
+ // }
setId(Id);
setName(name);
@@ -398,10 +398,10 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
boolean copyIds = Id.equals(tool.id);
// Copy the remaining attributes
- if(tool.versionsSupported != null) {
+ if (tool.versionsSupported != null) {
versionsSupported = tool.versionsSupported;
}
- if(tool.convertToId != null) {
+ if (tool.convertToId != null) {
convertToId = tool.convertToId;
}
if (tool.unusedChildren != null) {
@@ -449,35 +449,34 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if (tool.isHidden != null) {
isHidden = tool.isHidden;
}
- supportsManagedBuild = tool.supportsManagedBuild;
-
+ supportsManagedBuild = tool.supportsManagedBuild;
commandLineGenerator = tool.commandLineGenerator;
- if(commandLineGenerator == null) {
+ if (commandLineGenerator == null) {
// only need XML if the generator hasn't been created yet
commandLineGeneratorElement = tool.commandLineGeneratorElement;
}
dependencyGenerator = tool.dependencyGenerator;
- if(dependencyGenerator == null) {
+ if (dependencyGenerator == null) {
// only need XML if the generator hasn't been created yet
dependencyGeneratorElement = tool.dependencyGeneratorElement;
}
- pathconverterElement = tool.pathconverterElement ;
- optionPathConverter = tool.optionPathConverter ;
+ pathconverterElement = tool.pathconverterElement;
+ optionPathConverter = tool.optionPathConverter;
- if(tool.envVarBuildPathList != null)
+ if (tool.envVarBuildPathList != null)
envVarBuildPathList = new ArrayList<IEnvVarBuildPath>(tool.envVarBuildPathList);
-// tool.updateScannerInfoSettingsToInputTypes();
+ // tool.updateScannerInfoSettingsToInputTypes();
// Clone the children in superclass
super.copyChildren(tool);
// Clone the children
if (tool.inputTypeList != null) {
@SuppressWarnings("unchecked")
- HashMap<String, PathInfoCache> clone = (HashMap<String, PathInfoCache>)tool.discoveredInfoMap.clone();
+ HashMap<String, PathInfoCache> clone = (HashMap<String, PathInfoCache>) tool.discoveredInfoMap.clone();
discoveredInfoMap = clone;
for (InputType inputType : tool.getInputTypeList()) {
PathInfoCache cache = discoveredInfoMap.remove(getTypeKey(inputType));
@@ -485,15 +484,15 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
String subId;
String subName;
if (inputType.getSuperClass() != null) {
- subId = copyIds ? inputType.id : inputType.getSuperClass().getId() + "." + nnn; //$NON-NLS-1$
+ subId = copyIds ? inputType.id : inputType.getSuperClass().getId() + "." + nnn; //$NON-NLS-1$
subName = inputType.getSuperClass().getName();
} else {
- subId = copyIds ? inputType.id : inputType.getId() + "." + nnn; //$NON-NLS-1$
+ subId = copyIds ? inputType.id : inputType.getId() + "." + nnn; //$NON-NLS-1$
subName = inputType.getName();
}
InputType newInputType = new InputType(this, subId, subName, inputType);
addInputType(newInputType);
- if(cache != null){
+ if (cache != null) {
discoveredInfoMap.put(getTypeKey(newInputType), cache);
}
}
@@ -504,10 +503,10 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
String subId;
String subName;
if (outputType.getSuperClass() != null) {
- subId = copyIds ? outputType.id : outputType.getSuperClass().getId() + "." + nnn; //$NON-NLS-1$
+ subId = copyIds ? outputType.id : outputType.getSuperClass().getId() + "." + nnn; //$NON-NLS-1$
subName = outputType.getSuperClass().getName();
} else {
- subId = copyIds ? outputType.id : outputType.getId() + "." + nnn; //$NON-NLS-1$
+ subId = copyIds ? outputType.id : outputType.getId() + "." + nnn; //$NON-NLS-1$
subName = outputType.getName();
}
OutputType newOutputType = new OutputType(this, subId, subName, outputType);
@@ -516,32 +515,32 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
}
// icon
- if ( tool.iconPathURL != null ) {
+ if (tool.iconPathURL != null) {
iconPathURL = tool.iconPathURL;
}
- if(copyIds){
+ if (copyIds) {
isDirty = tool.isDirty;
rebuildState = tool.rebuildState;
- } else{
- setDirty(true);
+ } else {
+ setDirty(true);
setRebuildState(true);
}
}
- void copyNonoverriddenSettings(Tool tool){
- if(name == null)
+ void copyNonoverriddenSettings(Tool tool) {
+ if (name == null)
setName(tool.name);
// Set the managedBuildRevision & the version
-// setManagedBuildRevision(tool.getManagedBuildRevision());
-// setVersion(getVersionFromId());
+ // setManagedBuildRevision(tool.getManagedBuildRevision());
+ // setVersion(getVersionFromId());
// Copy the remaining attributes
- if(versionsSupported == null) {
+ if (versionsSupported == null) {
versionsSupported = tool.versionsSupported;
}
- if(convertToId == null) {
+ if (convertToId == null) {
convertToId = tool.convertToId;
}
if (unusedChildren == null) {
@@ -588,38 +587,38 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
}
if (isHidden == null) {
isHidden = tool.isHidden;
- }
+ }
- if(supportsManagedBuild == null)
+ if (supportsManagedBuild == null)
supportsManagedBuild = tool.supportsManagedBuild;
- if(commandLineGenerator == null) {
+ if (commandLineGenerator == null) {
commandLineGenerator = tool.commandLineGenerator;
// only copy the generator element if we don't already have a generator
- if(commandLineGenerator == null && commandLineGeneratorElement == null)
+ if (commandLineGenerator == null && commandLineGeneratorElement == null)
commandLineGeneratorElement = tool.commandLineGeneratorElement;
}
- if(dependencyGenerator == null) {
+ if (dependencyGenerator == null) {
dependencyGenerator = tool.dependencyGenerator;
// only copy the generator element if we don't already have a generator
- if(dependencyGenerator == null) {
- if(dependencyGeneratorElement == null)
+ if (dependencyGenerator == null) {
+ if (dependencyGeneratorElement == null)
dependencyGeneratorElement = tool.dependencyGeneratorElement;
}
}
- if(optionPathConverter == null) {
- optionPathConverter = tool.optionPathConverter ;
+ if (optionPathConverter == null) {
+ optionPathConverter = tool.optionPathConverter;
- if(optionPathConverter == null) {
- if(pathconverterElement == null)
- pathconverterElement = tool.pathconverterElement ;
+ if (optionPathConverter == null) {
+ if (pathconverterElement == null)
+ pathconverterElement = tool.pathconverterElement;
}
}
- if(envVarBuildPathList == null && tool.envVarBuildPathList != null)
+ if (envVarBuildPathList == null && tool.envVarBuildPathList != null)
envVarBuildPathList = new ArrayList<IEnvVarBuildPath>(tool.envVarBuildPathList);
// Clone the children in superclass
@@ -631,10 +630,10 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
String subId;
String subName;
if (inputType.getSuperClass() != null) {
- subId = inputType.getSuperClass().getId() + "." + nnn; //$NON-NLS-1$
+ subId = inputType.getSuperClass().getId() + "." + nnn; //$NON-NLS-1$
subName = inputType.getSuperClass().getName();
} else {
- subId = inputType.getId() + "." + nnn; //$NON-NLS-1$
+ subId = inputType.getId() + "." + nnn; //$NON-NLS-1$
subName = inputType.getName();
}
InputType newInputType = new InputType(this, subId, subName, inputType);
@@ -647,10 +646,10 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
String subId;
String subName;
if (outputType.getSuperClass() != null) {
- subId = outputType.getSuperClass().getId() + "." + nnn; //$NON-NLS-1$
+ subId = outputType.getSuperClass().getId() + "." + nnn; //$NON-NLS-1$
subName = outputType.getSuperClass().getName();
} else {
- subId = outputType.getId() + "." + nnn; //$NON-NLS-1$
+ subId = outputType.getId() + "." + nnn; //$NON-NLS-1$
subName = outputType.getName();
}
OutputType newOutputType = new OutputType(this, subId, subName, outputType);
@@ -659,11 +658,11 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
}
// icon
- if ( iconPathURL == null ) {
+ if (iconPathURL == null) {
iconPathURL = tool.iconPathURL;
}
- setDirty(true);
+ setDirty(true);
setRebuildState(true);
}
@@ -702,22 +701,23 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
convertToId = SafeStringInterner.safeIntern(element.getAttribute(CONVERT_TO_ID));
// isAbstract
- String isAbs = element.getAttribute(IProjectType.IS_ABSTRACT);
- if (isAbs != null){
- isAbstract = Boolean.parseBoolean(isAbs);
- }
+ String isAbs = element.getAttribute(IProjectType.IS_ABSTRACT);
+ if (isAbs != null) {
+ isAbstract = Boolean.parseBoolean(isAbs);
+ }
// Get the semicolon separated list of IDs of the error parsers
- errorParserIds = SafeStringInterner.safeIntern(SafeStringInterner.safeIntern(element.getAttribute(IToolChain.ERROR_PARSERS)));
+ errorParserIds = SafeStringInterner
+ .safeIntern(SafeStringInterner.safeIntern(element.getAttribute(IToolChain.ERROR_PARSERS)));
// Get the nature filter
String nature = element.getAttribute(NATURE);
if (nature != null) {
- if ("both".equals(nature)) { //$NON-NLS-1$
+ if ("both".equals(nature)) { //$NON-NLS-1$
natureFilter = FILTER_BOTH;
- } else if ("cnature".equals(nature)) { //$NON-NLS-1$
+ } else if ("cnature".equals(nature)) { //$NON-NLS-1$
natureFilter = FILTER_C;
- } else if ("ccnature".equals(nature)) { //$NON-NLS-1$
+ } else if ("ccnature".equals(nature)) { //$NON-NLS-1$
natureFilter = FILTER_CC;
} else {
natureFilter = FILTER_BOTH;
@@ -755,19 +755,19 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
outputPrefix = SafeStringInterner.safeIntern(element.getAttribute(ITool.OUTPUT_PREFIX));
// Get command line pattern
- commandLinePattern = SafeStringInterner.safeIntern(element.getAttribute( ITool.COMMAND_LINE_PATTERN ));
+ commandLinePattern = SafeStringInterner.safeIntern(element.getAttribute(ITool.COMMAND_LINE_PATTERN));
// Get advancedInputCategory
- String advInput = element.getAttribute(ITool.ADVANCED_INPUT_CATEGORY);
- if (advInput != null){
+ String advInput = element.getAttribute(ITool.ADVANCED_INPUT_CATEGORY);
+ if (advInput != null) {
advancedInputCategory = Boolean.parseBoolean(advInput);
- }
+ }
// Get customBuildStep
- String cbs = element.getAttribute(ITool.CUSTOM_BUILD_STEP);
- if (cbs != null){
+ String cbs = element.getAttribute(ITool.CUSTOM_BUILD_STEP);
+ if (cbs != null) {
customBuildStep = Boolean.parseBoolean(cbs);
- }
+ }
// Get the announcement text
announcement = SafeStringInterner.safeIntern(element.getAttribute(ITool.ANNOUNCEMENT));
@@ -775,30 +775,30 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
// Store the configuration element IFF there is a command line generator defined
String commandLineGenerator = element.getAttribute(COMMAND_LINE_GENERATOR);
if (commandLineGenerator != null && element instanceof DefaultManagedConfigElement) {
- commandLineGeneratorElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
+ commandLineGeneratorElement = ((DefaultManagedConfigElement) element).getConfigurationElement();
}
// Store the configuration element IFF there is a dependency generator defined
String depGenerator = element.getAttribute(DEP_CALC_ID);
if (depGenerator != null && element instanceof DefaultManagedConfigElement) {
- dependencyGeneratorElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
+ dependencyGeneratorElement = ((DefaultManagedConfigElement) element).getConfigurationElement();
}
// icon
- if ( element.getAttribute(IOptionCategory.ICON) != null && element instanceof DefaultManagedConfigElement)
- {
- String icon = element.getAttribute(IOptionCategory.ICON);
- iconPathURL = ManagedBuildManager.getURLInBuildDefinitions( (DefaultManagedConfigElement)element, new Path(icon) );
+ if (element.getAttribute(IOptionCategory.ICON) != null && element instanceof DefaultManagedConfigElement) {
+ String icon = element.getAttribute(IOptionCategory.ICON);
+ iconPathURL = ManagedBuildManager.getURLInBuildDefinitions((DefaultManagedConfigElement) element,
+ new Path(icon));
}
// optionPathConverter
String pathconverterTypeName = element.getAttribute(ITool.OPTIONPATHCONVERTER);
if (pathconverterTypeName != null && element instanceof DefaultManagedConfigElement) {
- pathconverterElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
+ pathconverterElement = ((DefaultManagedConfigElement) element).getConfigurationElement();
}
String tmp = element.getAttribute(SUPPORTS_MANAGED_BUILD);
- if(tmp != null)
+ if (tmp != null)
supportsManagedBuild = Boolean.valueOf(tmp);
// isHidden
@@ -806,12 +806,13 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if (hidden != null) {
isHidden = Boolean.valueOf(hidden);
}
-
- scannerConfigDiscoveryProfileId = SafeStringInterner.safeIntern(element.getAttribute(IToolChain.SCANNER_CONFIG_PROFILE_ID));
- tmp = element.getAttribute(IS_SYSTEM);
- if(tmp != null)
- isTest = Boolean.valueOf(tmp).booleanValue();
+ scannerConfigDiscoveryProfileId = SafeStringInterner
+ .safeIntern(element.getAttribute(IToolChain.SCANNER_CONFIG_PROFILE_ID));
+
+ tmp = element.getAttribute(IS_SYSTEM);
+ if (tmp != null)
+ isTest = Boolean.valueOf(tmp).booleanValue();
}
/* (non-Javadoc)
@@ -844,7 +845,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
// isAbstract
if (element.getAttribute(IProjectType.IS_ABSTRACT) != null) {
String isAbs = element.getAttribute(IProjectType.IS_ABSTRACT);
- if (isAbs != null){
+ if (isAbs != null) {
isAbstract = Boolean.parseBoolean(isAbs);
}
}
@@ -868,11 +869,11 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if (element.getAttribute(NATURE) != null) {
String nature = element.getAttribute(NATURE);
if (nature != null) {
- if ("both".equals(nature)) { //$NON-NLS-1$
+ if ("both".equals(nature)) { //$NON-NLS-1$
natureFilter = FILTER_BOTH;
- } else if ("cnature".equals(nature)) { //$NON-NLS-1$
+ } else if ("cnature".equals(nature)) { //$NON-NLS-1$
natureFilter = FILTER_C;
- } else if ("ccnature".equals(nature)) { //$NON-NLS-1$
+ } else if ("ccnature".equals(nature)) { //$NON-NLS-1$
natureFilter = FILTER_CC;
} else {
natureFilter = FILTER_BOTH;
@@ -923,14 +924,14 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
}
// Get command line pattern
- if( element.getAttribute( ITool.COMMAND_LINE_PATTERN ) != null) {
- commandLinePattern = SafeStringInterner.safeIntern(element.getAttribute( ITool.COMMAND_LINE_PATTERN ));
+ if (element.getAttribute(ITool.COMMAND_LINE_PATTERN) != null) {
+ commandLinePattern = SafeStringInterner.safeIntern(element.getAttribute(ITool.COMMAND_LINE_PATTERN));
}
// advancedInputCategory
if (element.getAttribute(ITool.ADVANCED_INPUT_CATEGORY) != null) {
String advInput = element.getAttribute(ITool.ADVANCED_INPUT_CATEGORY);
- if (advInput != null){
+ if (advInput != null) {
advancedInputCategory = Boolean.parseBoolean(advInput);
}
}
@@ -938,7 +939,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
// customBuildStep
if (element.getAttribute(ITool.CUSTOM_BUILD_STEP) != null) {
String cbs = element.getAttribute(ITool.CUSTOM_BUILD_STEP);
- if (cbs != null){
+ if (cbs != null) {
customBuildStep = Boolean.parseBoolean(cbs);
}
}
@@ -947,14 +948,14 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if (element.getAttribute(ITool.ANNOUNCEMENT) != null) {
announcement = SafeStringInterner.safeIntern(element.getAttribute(ITool.ANNOUNCEMENT));
}
-
- // Get the tool hidden setting
+
+ // Get the tool hidden setting
if (element.getAttribute(ITool.IS_HIDDEN) != null) {
String hidden = element.getAttribute(ITool.IS_HIDDEN);
- if(hidden != null) {
+ if (hidden != null) {
isHidden = Boolean.valueOf(hidden);
}
- }
+ }
// icon - was saved as URL in string form
if (element.getAttribute(IOptionCategory.ICON) != null) {
@@ -968,27 +969,28 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
}
}
- scannerConfigDiscoveryProfileId = SafeStringInterner.safeIntern(element.getAttribute(IToolChain.SCANNER_CONFIG_PROFILE_ID));
+ scannerConfigDiscoveryProfileId = SafeStringInterner
+ .safeIntern(element.getAttribute(IToolChain.SCANNER_CONFIG_PROFILE_ID));
}
- void resolveProjectReferences(boolean onLoad){
+ void resolveProjectReferences(boolean onLoad) {
if (superClassId != null && superClassId.length() > 0) {
ITool tool = ManagedBuildManager.getExtensionTool(superClassId);
- if(tool == null){
- Configuration cfg = (Configuration)getParentResourceInfo().getParent();
+ if (tool == null) {
+ Configuration cfg = (Configuration) getParentResourceInfo().getParent();
tool = cfg.findToolById(superClassId);
}
- if(tool != null)
+ if (tool != null)
superClass = tool;
- if(onLoad){
+ if (onLoad) {
// Check for migration support
checkForMigrationSupport();
}
}
}
- private void loadProperties(IManagedConfigElement el){
+ private void loadProperties(IManagedConfigElement el) {
supportedProperties = new SupportedProperties(el);
}
@@ -1038,11 +1040,11 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if (natureFilter != null) {
String nature;
if (natureFilter.intValue() == FILTER_C) {
- nature = "cnature"; //$NON-NLS-1$
+ nature = "cnature"; //$NON-NLS-1$
} else if (natureFilter.intValue() == FILTER_CC) {
- nature = "ccnature"; //$NON-NLS-1$
+ nature = "ccnature"; //$NON-NLS-1$
} else {
- nature = "both"; //$NON-NLS-1$
+ nature = "both"; //$NON-NLS-1$
}
element.setAttribute(NATURE, nature);
}
@@ -1108,11 +1110,11 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if (announcement != null) {
element.setAttribute(ITool.ANNOUNCEMENT, announcement);
}
-
+
// hidden tool
if (isHidden != null) {
element.setAttribute(ITool.IS_HIDDEN, isHidden.toString());
- }
+ }
// Serialize elements from my super class
super.serialize(element);
@@ -1147,7 +1149,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
// TODO: issue warning?
}
- if(scannerConfigDiscoveryProfileId != null)
+ if (scannerConfigDiscoveryProfileId != null)
element.setAttribute(IToolChain.SCANNER_CONFIG_PROFILE_ID, scannerConfigDiscoveryProfileId);
saveRebuildState();
@@ -1191,13 +1193,13 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
*/
@Override
public IInputType createInputType(IInputType superClass, String Id, String name, boolean isExtensionElement) {
- InputType type = superClass == null || superClass.isExtensionElement() ?
- new InputType(this, superClass, Id, name, isExtensionElement)
- : new InputType(this, Id, name, (InputType)superClass);
+ InputType type = superClass == null || superClass.isExtensionElement()
+ ? new InputType(this, superClass, Id, name, isExtensionElement)
+ : new InputType(this, Id, name, (InputType) superClass);
- if(superClass != null){
- BuildLanguageData data = (BuildLanguageData)typeToDataMap.remove(superClass);
- if(data != null){
+ if (superClass != null) {
+ BuildLanguageData data = (BuildLanguageData) typeToDataMap.remove(superClass);
+ if (data != null) {
data.updateInputType(type);
typeToDataMap.put(type, data);
}
@@ -1231,7 +1233,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
IInputType[] types = null;
// Merge our input types with our superclass' input types.
if (getSuperClass() != null) {
- types = ((Tool)getSuperClass()).getAllInputTypes();
+ types = ((Tool) getSuperClass()).getAllInputTypes();
}
// Our options take precedence.
Vector<InputType> ourTypes = getInputTypeList();
@@ -1244,12 +1246,12 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
int j;
for (j = 0; j < types.length; j++) {
IInputType otherTypeToCheck = ManagedBuildManager.getExtensionInputType(types[j]);
- if(otherTypeToCheck == null)
+ if (otherTypeToCheck == null)
otherTypeToCheck = types[j];
- if (ourType.getSuperClass() != null &&
- ourType.getSuperClass().getId().equals(otherTypeToCheck.getId()) &&
- !typesWasReplaced[j]) {
+ if (ourType.getSuperClass() != null
+ && ourType.getSuperClass().getId().equals(otherTypeToCheck.getId())
+ && !typesWasReplaced[j]) {
types[j] = ourType;
typesWasReplaced[j] = true;
break;
@@ -1274,7 +1276,6 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
return types;
}
-
private boolean hasInputTypes() {
if (getInputTypeList().size() > 0)
return true;
@@ -1283,9 +1284,9 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
@Override
public IInputType getInputTypeById(String id) {
- InputType type = (InputType)getAllInputTypeById(id);
+ InputType type = (InputType) getAllInputTypeById(id);
- if(isExtensionTool || type == null || type.isEnabled(this))
+ if (isExtensionTool || type == null || type.isEnabled(this))
return type;
return null;
}
@@ -1294,7 +1295,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
IInputType type = getInputTypeMap().get(id);
if (type == null) {
if (getSuperClass() != null) {
- return ((Tool)getSuperClass()).getAllInputTypeById(id);
+ return ((Tool) getSuperClass()).getAllInputTypeById(id);
}
}
@@ -1336,7 +1337,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
IOutputType[] types = null;
// Merge our output types with our superclass' output types.
if (getSuperClass() != null) {
- types = ((Tool)getSuperClass()).getAllOutputTypes();
+ types = ((Tool) getSuperClass()).getAllOutputTypes();
}
// Our options take precedence.
Vector<OutputType> ourTypes = getOutputTypeList();
@@ -1345,8 +1346,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
IOutputType ourType = ourTypes.get(i);
int j;
for (j = 0; j < types.length; j++) {
- if (ourType.getSuperClass() != null &&
- ourType.getSuperClass().getId().equals(types[j].getId())) {
+ if (ourType.getSuperClass() != null && ourType.getSuperClass().getId().equals(types[j].getId())) {
types[j] = ourType;
break;
}
@@ -1367,28 +1367,28 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
return types;
}
- private IOutputType[] filterOutputTypes(IOutputType types[]){
- if(isExtensionTool || types.length == 0)
+ private IOutputType[] filterOutputTypes(IOutputType types[]) {
+ if (isExtensionTool || types.length == 0)
return types;
List<OutputType> list = new ArrayList<OutputType>(types.length);
for (IOutputType itype : types) {
- OutputType type = (OutputType)itype;
- if(type.isEnabled(this))
+ OutputType type = (OutputType) itype;
+ if (type.isEnabled(this))
list.add(type);
}
return list.toArray(new OutputType[list.size()]);
}
- private IInputType[] filterInputTypes(IInputType types[]){
- if(isExtensionTool || types.length == 0)
+ private IInputType[] filterInputTypes(IInputType types[]) {
+ if (isExtensionTool || types.length == 0)
return types;
List<InputType> list = new ArrayList<InputType>(types.length);
for (IInputType itype : types) {
- InputType type = (InputType)itype;
- if(type.isEnabled(this))
+ InputType type = (InputType) itype;
+ if (type.isEnabled(this))
list.add(type);
}
@@ -1397,7 +1397,8 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
private boolean hasOutputTypes() {
Vector<OutputType> ourTypes = getOutputTypeList();
- if (ourTypes.size() > 0) return true;
+ if (ourTypes.size() > 0)
+ return true;
return false;
}
@@ -1406,8 +1407,9 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
IOutputType type = null;
IOutputType[] types = getOutputTypes();
if (types != null && types.length > 0) {
- for (int i=0; i<types.length; i++) {
- if (i == 0) type = types[0];
+ for (int i = 0; i < types.length; i++) {
+ if (i == 0)
+ type = types[0];
if (types[i].getPrimaryOutput() == true) {
type = types[i];
break;
@@ -1419,9 +1421,9 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
@Override
public IOutputType getOutputTypeById(String id) {
- OutputType type = (OutputType)getAllOutputTypeById(id);
+ OutputType type = (OutputType) getAllOutputTypeById(id);
- if(isExtensionTool || type == null || type.isEnabled(this))
+ if (isExtensionTool || type == null || type.isEnabled(this))
return type;
return null;
}
@@ -1430,7 +1432,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
IOutputType type = getOutputTypeMap().get(id);
if (type == null) {
if (getSuperClass() != null) {
- return ((Tool)getSuperClass()).getAllOutputTypeById(id);
+ return ((Tool) getSuperClass()).getAllOutputTypeById(id);
}
}
return type;
@@ -1449,7 +1451,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
*/
@Override
public URL getIconPath() {
- if (iconPathURL == null && getSuperClass() != null) {
+ if (iconPathURL == null && getSuperClass() != null) {
return getSuperClass().getTopOptionCategory().getIconPath();
}
return iconPathURL;
@@ -1460,7 +1462,8 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
*/
@Override
public Object[][] getOptions(IConfiguration configuration, IHoldsOptions optionHolder) {
- if (optionHolder != this) return null;
+ if (optionHolder != this)
+ return null;
return getOptions(configuration);
}
@@ -1484,7 +1487,8 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
*/
@Override
public Object[][] getOptions(IResourceInfo resInfo, IHoldsOptions optionHolder) {
- if (optionHolder != this) return null;
+ if (optionHolder != this)
+ return null;
return getOptions(resInfo);
}
@@ -1513,11 +1517,12 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
break;
}
} while ((superTool = superTool.getSuperClass()) != null);
- if (tool != null) break;
+ if (tool != null)
+ break;
}
// Get all of the tool's options and see which ones are part of
// this category.
- if( tool == null)
+ if (tool == null)
return null;
return getAllOptions(tool);
@@ -1626,7 +1631,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
*/
@Override
public ITool getSuperClass() {
- return (ITool)superClass;
+ return (ITool) superClass;
}
/* (non-Javadoc)
@@ -1638,15 +1643,15 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
}
public void setSuperClass(ITool superClass) {
- if ( this.superClass != superClass ) {
+ if (this.superClass != superClass) {
this.superClass = superClass;
- if ( this.superClass == null) {
+ if (this.superClass == null) {
superClassId = null;
} else {
superClassId = this.superClass.getId();
}
- if(!isExtensionElement())
+ if (!isExtensionElement())
setDirty(true);
}
}
@@ -1667,7 +1672,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if (isAbstract != null) {
return isAbstract.booleanValue();
} else {
- return false; // Note: no inheritance from superClass
+ return false; // Note: no inheritance from superClass
}
}
@@ -1688,7 +1693,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if (unusedChildren != null) {
return unusedChildren;
} else
- return EMPTY_STRING; // Note: no inheritance from superClass
+ return EMPTY_STRING; // Note: no inheritance from superClass
}
/* (non-Javadoc)
@@ -1723,7 +1728,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
while (tok.hasMoreElements()) {
list.add(tok.nextToken());
}
- String[] strArr = {""}; //$NON-NLS-1$
+ String[] strArr = { "" }; //$NON-NLS-1$
errorParsers = list.toArray(strArr);
}
} else {
@@ -1732,12 +1737,12 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
return errorParsers;
}
- public Set<String> contributeErrorParsers(Set<String> set){
- if(getErrorParserIds() != null){
- if(set == null)
+ public Set<String> contributeErrorParsers(Set<String> set) {
+ if (getErrorParserIds() != null) {
+ if (set == null)
set = new HashSet<String>();
String ids[] = getErrorParserList();
- if(ids.length != 0)
+ if (ids.length != 0)
set.addAll(Arrays.asList(ids));
}
return set;
@@ -1758,10 +1763,10 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
}
private List<String> getInputExtensionsAttribute() {
- if( (inputExtensions == null) || ( inputExtensions.size() == 0) ) {
+ if ((inputExtensions == null) || (inputExtensions.size() == 0)) {
// If I have a superClass, ask it
if (getSuperClass() != null) {
- return ((Tool)getSuperClass()).getInputExtensionsAttribute();
+ return ((Tool) getSuperClass()).getInputExtensionsAttribute();
} else {
inputExtensions = new ArrayList<String>();
}
@@ -1771,7 +1776,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
private List<String> getInputExtensionsList() {
if (inputExtensions == null) {
- inputExtensions = new ArrayList<String>();
+ inputExtensions = new ArrayList<String>();
}
return inputExtensions;
}
@@ -1786,12 +1791,14 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if (type != null) {
String[] exts = type.getSourceExtensions(this);
// Use the first entry in the list
- if (exts.length > 0) return exts[0];
+ if (exts.length > 0)
+ return exts[0];
}
// If none, use the input extensions specified for the Tool (backwards compatibility)
List<String> extsList = getInputExtensionsAttribute();
// Use the first entry in the list
- if (extsList != null && extsList.size() > 0) return extsList.get(0);
+ if (extsList != null && extsList.size() > 0)
+ return extsList.get(0);
return EMPTY_STRING;
}
@@ -1804,7 +1811,8 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if (type != null) {
String[] exts = type.getSourceExtensions(this);
// Use the first entry in the list
- if (exts.length > 0) return exts;
+ if (exts.length > 0)
+ return exts;
}
// If none, use the input extensions specified for the Tool (backwards compatibility)
List<String> extsList = getInputExtensionsAttribute();
@@ -1828,7 +1836,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if (types != null && types.length > 0) {
List<String> allExts = new ArrayList<String>();
for (IInputType type : types) {
- String[] exts = ((InputType)type).getSourceExtensions(this, project);
+ String[] exts = ((InputType) type).getSourceExtensions(this, project);
for (String ext : exts) {
allExts.add(ext);
}
@@ -1850,8 +1858,9 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
IInputType type = null;
IInputType[] types = getInputTypes();
if (types != null && types.length > 0) {
- for (int i=0; i<types.length; i++) {
- if (i == 0) type = types[0];
+ for (int i = 0; i < types.length; i++) {
+ if (i == 0)
+ type = types[0];
if (types[i].getPrimaryInput() == true) {
type = types[i];
break;
@@ -1874,7 +1883,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
IInputType[] types = getInputTypes();
if (types != null && types.length > 0) {
for (IInputType t : types) {
- if (((InputType)t).isSourceExtension(this, inputExtension, project)) {
+ if (((InputType) t).isSourceExtension(this, inputExtension, project)) {
type = t;
break;
}
@@ -1906,27 +1915,22 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
int optType = option.getValueType();
if (optType == IOption.STRING) {
inputs.add(Path.fromOSString(option.getStringValue()));
- } else if (
- optType == IOption.STRING_LIST ||
- optType == IOption.LIBRARIES ||
- optType == IOption.OBJECTS ||
- optType == IOption.INCLUDE_FILES ||
- optType == IOption.LIBRARY_PATHS ||
- optType == IOption.LIBRARY_FILES ||
- optType == IOption.MACRO_FILES
- ) {
+ } else if (optType == IOption.STRING_LIST || optType == IOption.LIBRARIES
+ || optType == IOption.OBJECTS || optType == IOption.INCLUDE_FILES
+ || optType == IOption.LIBRARY_PATHS || optType == IOption.LIBRARY_FILES
+ || optType == IOption.MACRO_FILES) {
@SuppressWarnings("unchecked")
- List<String> inputNames = (List<String>)option.getValue();
+ List<String> inputNames = (List<String>) option.getValue();
filterValues(optType, inputNames);
for (String s : inputNames)
inputs.add(Path.fromOSString(s));
}
allDeps.addAll(inputs);
- } catch( BuildException ex ) {
+ } catch (BuildException ex) {
}
}
} else if (type.getBuildVariable() != null && type.getBuildVariable().length() > 0) {
- allDeps.add(Path.fromOSString("$(" + type.getBuildVariable() + ")")); //$NON-NLS-1$ //$NON-NLS-2$
+ allDeps.add(Path.fromOSString("$(" + type.getBuildVariable() + ")")); //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
@@ -1949,7 +1953,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if (type != getPrimaryInputType()) {
String var = type.getBuildVariable();
if (var != null && var.length() > 0) {
- allRes.add(Path.fromOSString("$(" + type.getBuildVariable() + ")")); //$NON-NLS-1$ //$NON-NLS-2$
+ allRes.add(Path.fromOSString("$(" + type.getBuildVariable() + ")")); //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
@@ -1992,11 +1996,11 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if (interfaceExtensions == null || interfaceExtensions.size() == 0) {
// If I have a superClass, ask it
if (getSuperClass() != null) {
- return ((Tool)getSuperClass()).getHeaderExtensionsAttribute();
+ return ((Tool) getSuperClass()).getHeaderExtensionsAttribute();
} else {
- if (interfaceExtensions == null) {
- interfaceExtensions = new ArrayList<String>();
- }
+ if (interfaceExtensions == null) {
+ interfaceExtensions = new ArrayList<String>();
+ }
}
}
return interfaceExtensions;
@@ -2034,8 +2038,9 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
IOutputType type = null;
IOutputType[] types = getOutputTypes();
if (types != null && types.length > 0) {
- for (int i=0; i<types.length; i++) {
- if (i == 0) type = types[0];
+ for (int i = 0; i < types.length; i++) {
+ if (i == 0)
+ type = types[0];
if (types[i].getPrimaryOutput() == true) {
type = types[i];
break;
@@ -2084,9 +2089,9 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
return getSuperClass().getCommandLinePattern();
} else {
if (getCustomBuildStep()) {
- return DEFAULT_CBS_PATTERN; // Default pattern
+ return DEFAULT_CBS_PATTERN; // Default pattern
} else {
- return DEFAULT_PATTERN; // Default pattern
+ return DEFAULT_PATTERN; // Default pattern
}
}
}
@@ -2102,7 +2107,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if (getSuperClass() != null) {
return getSuperClass().getAdvancedInputCategory();
} else {
- return false; // default is false
+ return false; // default is false
}
}
return advancedInputCategory.booleanValue();
@@ -2117,7 +2122,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if (getSuperClass() != null) {
return getSuperClass().getCustomBuildStep();
} else {
- return false; // default is false
+ return false; // default is false
}
}
return customBuildStep.booleanValue();
@@ -2129,9 +2134,8 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
@Override
public String getAnnouncement() {
String an = getAnnouncementAttribute();
- if(an == null){
- an = ManagedMakeMessages.getResourceString(DEFAULT_ANNOUNCEMENT_PREFIX) +
- WHITESPACE + getName(); // + "(" + getId() + ")";
+ if (an == null) {
+ an = ManagedMakeMessages.getResourceString(DEFAULT_ANNOUNCEMENT_PREFIX) + WHITESPACE + getName(); // + "(" + getId() + ")";
}
return an;
}
@@ -2139,7 +2143,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
public String getAnnouncementAttribute() {
if (announcement == null) {
if (getSuperClass() != null) {
- return ((Tool)getSuperClass()).getAnnouncementAttribute();
+ return ((Tool) getSuperClass()).getAnnouncementAttribute();
}
return null;
}
@@ -2152,7 +2156,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
public IConfigurationElement getCommandLineGeneratorElement() {
if (commandLineGeneratorElement == null) {
if (getSuperClass() != null) {
- return ((Tool)getSuperClass()).getCommandLineGeneratorElement();
+ return ((Tool) getSuperClass()).getCommandLineGeneratorElement();
}
}
return commandLineGeneratorElement;
@@ -2178,11 +2182,13 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if (element != null) {
try {
if (element.getAttribute(COMMAND_LINE_GENERATOR) != null) {
- commandLineGenerator = (IManagedCommandLineGenerator) element.createExecutableExtension(COMMAND_LINE_GENERATOR);
+ commandLineGenerator = (IManagedCommandLineGenerator) element
+ .createExecutableExtension(COMMAND_LINE_GENERATOR);
commandLineGeneratorElement = null; // no longer needed now that we've created one
return commandLineGenerator;
}
- } catch (CoreException e) {}
+ } catch (CoreException e) {
+ }
}
return ManagedCommandLineGenerator.getCommandLineGenerator();
}
@@ -2195,15 +2201,15 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
// First try the primary InputType
IInputType type = getPrimaryInputType();
if (type != null) {
- IConfigurationElement primary = ((InputType)type).getDependencyGeneratorElement();
- if (primary != null) return primary;
+ IConfigurationElement primary = ((InputType) type).getDependencyGeneratorElement();
+ if (primary != null)
+ return primary;
}
// If not found, use the deprecated attribute
return getToolDependencyGeneratorElement();
}
-
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITool#getDependencyGeneratorElementForExtension()
*/
@@ -2212,7 +2218,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if (types != null) {
for (IInputType type : types) {
if (type.isSourceExtension(this, sourceExt)) {
- return ((InputType)type).getDependencyGeneratorElement();
+ return ((InputType) type).getDependencyGeneratorElement();
}
}
}
@@ -2224,20 +2230,20 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
private IConfigurationElement getToolDependencyGeneratorElement() {
if (dependencyGeneratorElement == null) {
if (getSuperClass() != null) {
- return ((Tool)getSuperClass()).getToolDependencyGeneratorElement();
+ return ((Tool) getSuperClass()).getToolDependencyGeneratorElement();
}
}
return dependencyGeneratorElement;
}
-// /* (non-Javadoc)
-// * @see org.eclipse.cdt.managedbuilder.core.ITool#setDependencyGeneratorElement(String)
-// * @deprecated
-// */
-// private void setDependencyGeneratorElement(IConfigurationElement element) {
-// dependencyGeneratorElement = element;
-// setDirty(true);
-// }
+ // /* (non-Javadoc)
+ // * @see org.eclipse.cdt.managedbuilder.core.ITool#setDependencyGeneratorElement(String)
+ // * @deprecated
+ // */
+ // private void setDependencyGeneratorElement(IConfigurationElement element) {
+ // dependencyGeneratorElement = element;
+ // setDirty(true);
+ // }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITool#getDependencyGenerator()
@@ -2247,7 +2253,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
public IManagedDependencyGenerator getDependencyGenerator() {
if (dependencyGenerator != null) {
if (dependencyGenerator instanceof IManagedDependencyGenerator)
- return (IManagedDependencyGenerator)dependencyGenerator;
+ return (IManagedDependencyGenerator) dependencyGenerator;
else
return null;
}
@@ -2255,17 +2261,18 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if (element != null) {
try {
if (element.getAttribute(DEP_CALC_ID) != null) {
- dependencyGenerator = (IManagedDependencyGeneratorType) element.createExecutableExtension(DEP_CALC_ID);
+ dependencyGenerator = (IManagedDependencyGeneratorType) element
+ .createExecutableExtension(DEP_CALC_ID);
if (dependencyGenerator != null) {
if (dependencyGenerator instanceof IManagedDependencyGenerator) {
dependencyGeneratorElement = null; // no longer needed now that we've created one
- return (IManagedDependencyGenerator)dependencyGenerator;
- }
- else
+ return (IManagedDependencyGenerator) dependencyGenerator;
+ } else
return null;
}
}
- } catch (CoreException e) {}
+ } catch (CoreException e) {
+ }
}
return null;
}
@@ -2282,10 +2289,12 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if (element != null) {
try {
if (element.getAttribute(DEP_CALC_ID) != null) {
- dependencyGenerator = (IManagedDependencyGeneratorType) element.createExecutableExtension(DEP_CALC_ID);
+ dependencyGenerator = (IManagedDependencyGeneratorType) element
+ .createExecutableExtension(DEP_CALC_ID);
return dependencyGenerator;
}
- } catch (CoreException e) {}
+ } catch (CoreException e) {
+ }
}
return null;
}
@@ -2311,7 +2320,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
if (types != null && types.length > 0) {
List<String> allExts = new ArrayList<String>();
for (IOutputType t : types) {
- String[] exts = ((OutputType)t).getOutputExtensions(this, project);
+ String[] exts = ((OutputType) t).getOutputExtensions(this, project);
if (exts != null)
for (String s : exts)
allExts.add(s);
@@ -2369,7 +2378,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
IOutputType[] types = getOutputTypes();
int i;
if (types != null) {
- for (i=0; i<types.length; i++) {
+ for (i = 0; i < types.length; i++) {
IInputType inputType = types[i].getPrimaryInputType();
if (inputType != null && inputType.isSourceExtension(this, inputExtension)) {
String[] exts = types[i].getOutputExtensions(this);
@@ -2390,7 +2399,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
}
// If no OutputTypes specified, examine the list of input extensions
String[] inputExts = getAllInputExtensions();
- for (i=0; i<inputExts.length; i++) {
+ for (i = 0; i < inputExts.length; i++) {
if (inputExts[i].equals(inputExtension)) {
String[] exts = getOutputsAttribute();
if (exts != null) {
@@ -2429,7 +2438,8 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
@Override
public void setErrorParserIds(String ids) {
String currentIds = getErrorParserIds();
- if (ids == null && currentIds == null) return;
+ if (ids == null && currentIds == null)
+ return;
if (currentIds == null || ids == null || !(currentIds.equals(ids))) {
errorParserIds = ids;
isDirty = true;
@@ -2442,7 +2452,8 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
@Override
public boolean setToolCommand(String cmd) {
String currentCommand = getToolCommand();
- if (cmd == null && command == null) return false;
+ if (cmd == null && command == null)
+ return false;
if (cmd == null || currentCommand == null || !cmd.equals(currentCommand)) {
command = cmd;
isDirty = true;
@@ -2459,7 +2470,8 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
@Override
public void setCommandLinePattern(String pattern) {
String currentPattern = getCommandLinePattern();
- if (pattern == null && commandLinePattern == null) return;
+ if (pattern == null && commandLinePattern == null)
+ return;
if (pattern == null || currentPattern == null || !pattern.equals(currentPattern)) {
commandLinePattern = pattern;
setRebuildState(true);
@@ -2472,7 +2484,8 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
*/
@Override
public void setOutputFlag(String flag) {
- if (flag == null && outputFlag == null) return;
+ if (flag == null && outputFlag == null)
+ return;
if (outputFlag == null || flag == null || !(flag.equals(outputFlag))) {
outputFlag = flag;
setRebuildState(true);
@@ -2485,7 +2498,8 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
*/
@Override
public void setOutputPrefix(String prefix) {
- if (prefix == null && outputPrefix == null) return;
+ if (prefix == null && outputPrefix == null)
+ return;
if (outputPrefix == null || prefix == null || !(prefix.equals(outputPrefix))) {
outputPrefix = prefix;
setRebuildState(true);
@@ -2495,20 +2509,20 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
@Override
public void setOutputPrefixForPrimaryOutput(String prefix) {
- if(prefix != null && prefix.equals(getOutputPrefix()))
+ if (prefix != null && prefix.equals(getOutputPrefix()))
return;
IOutputType type = getPrimaryOutputType();
- if(type == null)
+ if (type == null)
setOutputPrefix(prefix);
else {
setOutputPrefixForType(type, prefix);
}
}
- private void setOutputPrefixForType(IOutputType type, String prefix){
- if(prefix == null){
- if(type.getParent() != this)
+ private void setOutputPrefixForType(IOutputType type, String prefix) {
+ if (prefix == null) {
+ if (type.getParent() != this)
return;
}
type = getEditableOutputType(type);
@@ -2522,7 +2536,8 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
*/
@Override
public void setOutputsAttribute(String ext) {
- if (ext == null && outputExtensions == null) return;
+ if (ext == null && outputExtensions == null)
+ return;
if (outputExtensions == null || ext == null || !(ext.equals(outputExtensions))) {
outputExtensions = ext;
isDirty = true;
@@ -2553,13 +2568,14 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
@Override
public void setAnnouncement(String newText) {
- if (newText == null && announcement == null) return;
+ if (newText == null && announcement == null)
+ return;
if (announcement == null || newText == null || !(newText.equals(announcement))) {
announcement = newText;
setDirty(true);
}
}
-
+
@Override
public void setHidden(boolean hidden) {
if (isHidden == null || !(hidden == isHidden.booleanValue())) {
@@ -2567,14 +2583,13 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
setDirty(true);
}
}
-
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITool#getCommandFlags()
*/
@Override
public String[] getCommandFlags() throws BuildException {
- return getToolCommandFlags(null,null);
+ return getToolCommandFlags(null, null);
}
/* (non-Javadoc)
@@ -2582,7 +2597,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
*/
@Override
public String getToolFlags() throws BuildException {
- return getToolCommandFlagsString(null,null);
+ return getToolCommandFlagsString(null, null);
}
/**
@@ -2593,15 +2608,14 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
* @return the command flags with the build macros resolved
*/
public String[] getToolCommandFlags(IPath inputFileLocation, IPath outputFileLocation,
- SupplierBasedCdtVariableSubstitutor macroSubstitutor,
- IMacroContextInfoProvider provider) {
+ SupplierBasedCdtVariableSubstitutor macroSubstitutor, IMacroContextInfoProvider provider) {
IOption[] opts = getOptions();
ArrayList<String> flags = new ArrayList<String>();
StringBuilder sb = new StringBuilder();
for (IOption option : opts) {
if (option == null)
continue;
- sb.setLength( 0 );
+ sb.setLength(0);
// check to see if the option has an applicability calculator
IOptionApplicability applicabilityCalculator = option.getApplicabilityCalculator();
@@ -2610,20 +2624,22 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
IBuildObject config = null;
IBuildObject parent = getParent();
- if ( parent instanceof IResourceConfiguration ) {
+ if (parent instanceof IResourceConfiguration) {
config = parent;
- } else if ( parent instanceof IToolChain ){
- config = ((IToolChain)parent).getParent();
+ } else if (parent instanceof IToolChain) {
+ config = ((IToolChain) parent).getParent();
}
- if ((catApplicabilityCalculator==null || catApplicabilityCalculator.isOptionCategoryVisible(config, this, cat))
- && (applicabilityCalculator == null || applicabilityCalculator.isOptionUsedInCommandLine(config, this, option))) {
+ if ((catApplicabilityCalculator == null
+ || catApplicabilityCalculator.isOptionCategoryVisible(config, this, cat))
+ && (applicabilityCalculator == null
+ || applicabilityCalculator.isOptionUsedInCommandLine(config, this, option))) {
// update option in case when its value changed.
// This code is added to fix bug #219684 and
// avoid using "getOptionToSet()"
- if (applicabilityCalculator != null &&
- !(applicabilityCalculator instanceof BooleanExpressionApplicabilityCalculator)) {
+ if (applicabilityCalculator != null
+ && !(applicabilityCalculator instanceof BooleanExpressionApplicabilityCalculator)) {
if (option.getSuperClass() != null)
option = getOptionBySuperClassId(option.getSuperClass().getId());
// bug #405904 - if the option is an extension element (first time we build),
@@ -2635,152 +2651,165 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
option = getOptionById(option.getId());
}
- try{
- boolean generateDefaultCommand = true;
- IOptionCommandGenerator commandGenerator = option.getCommandGenerator();
- if(commandGenerator != null) {
- IMacroContextInfo info = provider.getMacroContextInfo(BuildMacroProvider.CONTEXT_FILE, new FileContextData(inputFileLocation, outputFileLocation, option, this));
- if(info != null) {
- macroSubstitutor.setMacroContextInfo(info);
- String command = commandGenerator.generateCommand(option, macroSubstitutor);
- if(command != null) {
- sb.append(command);
- generateDefaultCommand = false;
+ try {
+ boolean generateDefaultCommand = true;
+ IOptionCommandGenerator commandGenerator = option.getCommandGenerator();
+ if (commandGenerator != null) {
+ IMacroContextInfo info = provider.getMacroContextInfo(BuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(inputFileLocation, outputFileLocation, option, this));
+ if (info != null) {
+ macroSubstitutor.setMacroContextInfo(info);
+ String command = commandGenerator.generateCommand(option, macroSubstitutor);
+ if (command != null) {
+ sb.append(command);
+ generateDefaultCommand = false;
+ }
}
}
- }
- if(generateDefaultCommand) {
- switch (option.getValueType()) {
- case IOption.BOOLEAN :
- String boolCmd;
- if (option.getBooleanValue()) {
- boolCmd = option.getCommand();
- } else {
- // Note: getCommandFalse is new with CDT 2.0
- boolCmd = option.getCommandFalse();
- }
- if (boolCmd != null && boolCmd.length() > 0) {
- sb.append(boolCmd);
- }
- break;
+ if (generateDefaultCommand) {
+ switch (option.getValueType()) {
+ case IOption.BOOLEAN:
+ String boolCmd;
+ if (option.getBooleanValue()) {
+ boolCmd = option.getCommand();
+ } else {
+ // Note: getCommandFalse is new with CDT 2.0
+ boolCmd = option.getCommandFalse();
+ }
+ if (boolCmd != null && boolCmd.length() > 0) {
+ sb.append(boolCmd);
+ }
+ break;
- case IOption.ENUMERATED :
- String enumVal = option.getEnumCommand(option.getSelectedEnum());
- if (enumVal.length() > 0) {
- sb.append(enumVal);
- }
- break;
+ case IOption.ENUMERATED:
+ String enumVal = option.getEnumCommand(option.getSelectedEnum());
+ if (enumVal.length() > 0) {
+ sb.append(enumVal);
+ }
+ break;
- case IOption.TREE :
- String treeVal = option.getCommand(option.getStringValue());
- if (treeVal.length() > 0) {
- sb.append(treeVal);
- }
- break;
+ case IOption.TREE:
+ String treeVal = option.getCommand(option.getStringValue());
+ if (treeVal.length() > 0) {
+ sb.append(treeVal);
+ }
+ break;
- case IOption.STRING :{
- String strCmd = option.getCommand();
- String val = option.getStringValue();
- IMacroContextInfo info = provider.getMacroContextInfo(IBuildMacroProvider.CONTEXT_FILE, new FileContextData(inputFileLocation, outputFileLocation, option, this));
- if(info != null){
- macroSubstitutor.setMacroContextInfo(info);
- if (val.length() > 0
- && (val = CdtVariableResolver.resolveToString(val, macroSubstitutor)).length() > 0) {
- sb.append( evaluateCommand( strCmd, val ) );
+ case IOption.STRING: {
+ String strCmd = option.getCommand();
+ String val = option.getStringValue();
+ IMacroContextInfo info = provider.getMacroContextInfo(IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(inputFileLocation, outputFileLocation, option, this));
+ if (info != null) {
+ macroSubstitutor.setMacroContextInfo(info);
+ if (val.length() > 0
+ && (val = CdtVariableResolver.resolveToString(val, macroSubstitutor))
+ .length() > 0) {
+ sb.append(evaluateCommand(strCmd, val));
+ }
}
}
- }
- break;
+ break;
- case IOption.STRING_LIST :
- case IOption.INCLUDE_FILES :
- case IOption.INCLUDE_PATH :
- case IOption.LIBRARY_PATHS :
- case IOption.LIBRARY_FILES :
- case IOption.MACRO_FILES :
- case IOption.UNDEF_INCLUDE_FILES :
- case IOption.UNDEF_INCLUDE_PATH :
- case IOption.UNDEF_LIBRARY_PATHS :
- case IOption.UNDEF_LIBRARY_FILES :
- case IOption.UNDEF_MACRO_FILES : {
- String listCmd = option.getCommand();
- IMacroContextInfo info = provider.getMacroContextInfo(IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(inputFileLocation, outputFileLocation, option, this));
- if(info != null){
- macroSubstitutor.setMacroContextInfo(info);
- String[] list = CdtVariableResolver.resolveStringListValues(option.getBasicStringListValue(), macroSubstitutor, true);
- if(list != null){
- for (String temp : list) {
- if(temp.length() > 0 && !temp.equals(EMPTY_QUOTED_STRING))
- sb.append( evaluateCommand( listCmd, temp ) ).append( WHITE_SPACE );
+ case IOption.STRING_LIST:
+ case IOption.INCLUDE_FILES:
+ case IOption.INCLUDE_PATH:
+ case IOption.LIBRARY_PATHS:
+ case IOption.LIBRARY_FILES:
+ case IOption.MACRO_FILES:
+ case IOption.UNDEF_INCLUDE_FILES:
+ case IOption.UNDEF_INCLUDE_PATH:
+ case IOption.UNDEF_LIBRARY_PATHS:
+ case IOption.UNDEF_LIBRARY_FILES:
+ case IOption.UNDEF_MACRO_FILES: {
+ String listCmd = option.getCommand();
+ IMacroContextInfo info = provider.getMacroContextInfo(IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(inputFileLocation, outputFileLocation, option, this));
+ if (info != null) {
+ macroSubstitutor.setMacroContextInfo(info);
+ String[] list = CdtVariableResolver.resolveStringListValues(
+ option.getBasicStringListValue(), macroSubstitutor, true);
+ if (list != null) {
+ for (String temp : list) {
+ if (temp.length() > 0 && !temp.equals(EMPTY_QUOTED_STRING))
+ sb.append(evaluateCommand(listCmd, temp)).append(WHITE_SPACE);
+ }
}
}
}
- }
- break;
+ break;
- case IOption.PREPROCESSOR_SYMBOLS :
- case IOption.UNDEF_PREPROCESSOR_SYMBOLS :{
- String defCmd = option.getCommand();
- IMacroContextInfo info = provider.getMacroContextInfo(IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(inputFileLocation, outputFileLocation, option, this));
- if(info != null){
- macroSubstitutor.setMacroContextInfo(info);
- String[] symbols = CdtVariableResolver.resolveStringListValues(option.getBasicStringListValue(), macroSubstitutor, true);
- if(symbols != null){
- for (String temp : symbols) {
- if(temp.length() > 0)
- sb.append( evaluateCommand( defCmd, temp ) + WHITE_SPACE);
+ case IOption.PREPROCESSOR_SYMBOLS:
+ case IOption.UNDEF_PREPROCESSOR_SYMBOLS: {
+ String defCmd = option.getCommand();
+ IMacroContextInfo info = provider.getMacroContextInfo(IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(inputFileLocation, outputFileLocation, option, this));
+ if (info != null) {
+ macroSubstitutor.setMacroContextInfo(info);
+ String[] symbols = CdtVariableResolver.resolveStringListValues(
+ option.getBasicStringListValue(), macroSubstitutor, true);
+ if (symbols != null) {
+ for (String temp : symbols) {
+ if (temp.length() > 0)
+ sb.append(evaluateCommand(defCmd, temp) + WHITE_SPACE);
+ }
+ }
}
}
- }
- }
- break;
+ break;
- default :
- break;
- }
- }
+ default:
+ break;
+ }
+ }
- if (sb.toString().trim().length() > 0)
- flags.add(sb.toString().trim());
+ if (sb.toString().trim().length() > 0)
+ flags.add(sb.toString().trim());
} catch (BuildException e) {
// Bug 315187 one broken option shouldn't cascade to all other options breaking the build...
- Status s = new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), MessageFormat.format(ManagedMakeMessages.getString("Tool_Problem_Discovering_Args_For_Option"), option, //$NON-NLS-1$
- option.getId()), e);
+ Status s = new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ MessageFormat.format(
+ ManagedMakeMessages.getString("Tool_Problem_Discovering_Args_For_Option"), option, //$NON-NLS-1$
+ option.getId()),
+ e);
ManagedBuilderCorePlugin.log(new CoreException(s));
} catch (CdtVariableException e) {
- Status s = new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), MessageFormat.format(ManagedMakeMessages.getString("Tool_Problem_Discovering_Args_For_Option"), option, //$NON-NLS-1$
- option.getId()), e);
+ Status s = new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ MessageFormat.format(
+ ManagedMakeMessages.getString("Tool_Problem_Discovering_Args_For_Option"), option, //$NON-NLS-1$
+ option.getId()),
+ e);
ManagedBuilderCorePlugin.log(new CoreException(s));
}
}
}
- String[] f = new String[ flags.size() ];
- return flags.toArray( f );
+ String[] f = new String[flags.size()];
+ return flags.toArray(f);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITool#getToolCommandFlags(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath)
*/
@Override
- public String[] getToolCommandFlags(IPath inputFileLocation, IPath outputFileLocation) throws BuildException{
- SupplierBasedCdtVariableSubstitutor macroSubstitutor = new BuildfileMacroSubstitutor(null,EMPTY_STRING,WHITE_SPACE);
- return getToolCommandFlags(inputFileLocation, outputFileLocation, macroSubstitutor, BuildMacroProvider.getDefault() );
+ public String[] getToolCommandFlags(IPath inputFileLocation, IPath outputFileLocation) throws BuildException {
+ SupplierBasedCdtVariableSubstitutor macroSubstitutor = new BuildfileMacroSubstitutor(null, EMPTY_STRING,
+ WHITE_SPACE);
+ return getToolCommandFlags(inputFileLocation, outputFileLocation, macroSubstitutor,
+ BuildMacroProvider.getDefault());
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITool#getToolCommandFlagsString(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath)
*/
@Override
- public String getToolCommandFlagsString(IPath inputFileLocation, IPath outputFileLocation) throws BuildException{
+ public String getToolCommandFlagsString(IPath inputFileLocation, IPath outputFileLocation) throws BuildException {
// Get all of the optionList
StringBuilder buf = new StringBuilder();
- String[] flags = getToolCommandFlags(inputFileLocation,outputFileLocation);
+ String[] flags = getToolCommandFlags(inputFileLocation, outputFileLocation);
for (String flag : flags) {
- if( flag != null ) {
- buf.append( flag + WHITE_SPACE );
+ if (flag != null) {
+ buf.append(flag + WHITE_SPACE);
}
}
@@ -2797,7 +2826,8 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
}
String[] exts = getAllDependencyExtensions();
for (String dep : exts) {
- if (ext.equals(dep)) return true;
+ if (ext.equals(dep))
+ return true;
}
return false;
}
@@ -2812,7 +2842,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
public boolean buildsFileType(String extension, IProject project) {
- if (extension == null) {
+ if (extension == null) {
return false;
}
IInputType it = getInputType(extension, project);
@@ -2846,7 +2876,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
*/
@Override
public boolean isInputFileType(String extension) {
- if (extension == null) {
+ if (extension == null) {
return false;
}
IInputType it = getInputType(extension);
@@ -2865,7 +2895,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
*/
@Override
public boolean producesFileType(String extension) {
- if (extension == null) {
+ if (extension == null) {
return false;
}
// Check the output-types first
@@ -2885,8 +2915,6 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
return false;
}
-
-
/**
* @return the pathconverterElement
*/
@@ -2895,12 +2923,12 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
}
@Override
- public IOptionPathConverter getOptionPathConverter() {
+ public IOptionPathConverter getOptionPathConverter() {
// Use existing converter
if (optionPathConverter != null) {
- return optionPathConverter ;
+ return optionPathConverter;
}
- if (optionPathConverter==null) {
+ if (optionPathConverter == null) {
// If there is not yet a optionPathConverter try to construct from configuration element
IConfigurationElement element = getPathconverterElement();
if (element != null) {
@@ -2912,7 +2940,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
} catch (CoreException e) {
}
}
- if (optionPathConverter==null) {
+ if (optionPathConverter == null) {
// If there is still no optionPathConverter, ask superclass of this tool whether it has a converter
if (getSuperClass() != null) {
ITool superTool = getSuperClass();
@@ -2921,16 +2949,16 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
}
// If there is still no converter, ask the toolchain for a
// global converter
- if ((optionPathConverter==null)&&(getParent() instanceof IResourceConfiguration)) {
+ if ((optionPathConverter == null) && (getParent() instanceof IResourceConfiguration)) {
// The tool belongs to a resource configuration
IResourceConfiguration resourceConfiguration = (IResourceConfiguration) getParent();
IConfiguration configuration = resourceConfiguration.getParent();
- if (null!=configuration) {
+ if (null != configuration) {
IToolChain toolchain = configuration.getToolChain();
optionPathConverter = toolchain.getOptionPathConverter();
}
}
- if ((optionPathConverter==null)&&(getParent() instanceof IToolChain)) {
+ if ((optionPathConverter == null) && (getParent() instanceof IToolChain)) {
// The tool belongs to a toolchain
IToolChain toolchain = (IToolChain) getParent();
optionPathConverter = toolchain.getOptionPathConverter();
@@ -2938,13 +2966,12 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
}
pathconverterElement = null; // discard now that we've created one
- return optionPathConverter ;
+ return optionPathConverter;
}
-
-/*
- * O B J E C T S T A T E M A I N T E N A N C E
- */
+ /*
+ * 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.ITool#isExtensionElement()
@@ -2960,10 +2987,12 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
@Override
public boolean isDirty() {
// This shouldn't be called for an extension tool
- if (isExtensionTool) return false;
+ if (isExtensionTool)
+ return false;
// If I need saving, just say yes
- if (isDirty) return true;
+ if (isDirty)
+ return true;
// Check my children
for (InputType type : getInputTypeList())
@@ -3007,18 +3036,16 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
resolved = true;
// Resolve superClass
if (superClassId != null && superClassId.length() > 0) {
- setSuperClassInternal( ManagedBuildManager.getExtensionTool(superClassId) );
+ setSuperClassInternal(ManagedBuildManager.getExtensionTool(superClassId));
if (getSuperClass() == null) {
// Report error
- ManagedBuildManager.outputResolveError(
- "superClass", //$NON-NLS-1$
- superClassId,
- "tool", //$NON-NLS-1$
+ ManagedBuildManager.outputResolveError("superClass", //$NON-NLS-1$
+ superClassId, "tool", //$NON-NLS-1$
getId());
} else {
// All of our superclasses must be resolved in order to properly
// resolve options to option categories
- ((Tool)getSuperClass()).resolveReferences();
+ ((Tool) getSuperClass()).resolveReferences();
}
}
// Resolve HoldsOptions
@@ -3035,64 +3062,64 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
/**
* Look for ${VALUE} in the command string
*/
- public String evaluateCommand( String command, String values ) {
+ public String evaluateCommand(String command, String values) {
final int DOLLAR_VALUE_LENGTH = 8;
- if( command == null ) return values.trim();
-
- String ret = command;
- boolean found = false;
- int start = 0;
- int index;
- int len;
- while ((index = ret.indexOf( "${", start )) >= 0 && //$NON-NLS-1$
- (len = ret.length()) >= index + DOLLAR_VALUE_LENGTH) {
- start = index;
- index = index+2;
- int ch = ret.charAt(index);
- if ( ch == 'v' || ch == 'V' ) {
- index++;
- ch = ret.charAt(index);
- if ( ch == 'a' || ch == 'A' ) {
- index++;
- ch = ret.charAt(index);
- if ( ch == 'l' || ch == 'L' ) {
- index++;
- ch = ret.charAt(index);
- if ( ch == 'u' || ch == 'U' ) {
- index++;
- ch = ret.charAt(index);
- if ( ch == 'e' || ch == 'E' ) {
- index++;
- ch = ret.charAt(index);
- if ( ch == '}' ) {
- String temp = ""; //$NON-NLS-1$
- index++;
- found = true;
- if (start > 0) {
- temp = ret.substring(0, start);
- }
- temp = temp.concat(values.trim());
- if (len > index) {
- start = temp.length();
- ret = temp.concat(ret.substring(index));
- index = start;
- }
- else {
- ret = temp;
- break;
- }
- }
- }
- }
- }
- }
- }
- start = index;
- }
- if (found)
- return ret.trim();
- return (command + values).trim();
+ if (command == null)
+ return values.trim();
+
+ String ret = command;
+ boolean found = false;
+ int start = 0;
+ int index;
+ int len;
+ while ((index = ret.indexOf("${", start)) >= 0 && //$NON-NLS-1$
+ (len = ret.length()) >= index + DOLLAR_VALUE_LENGTH) {
+ start = index;
+ index = index + 2;
+ int ch = ret.charAt(index);
+ if (ch == 'v' || ch == 'V') {
+ index++;
+ ch = ret.charAt(index);
+ if (ch == 'a' || ch == 'A') {
+ index++;
+ ch = ret.charAt(index);
+ if (ch == 'l' || ch == 'L') {
+ index++;
+ ch = ret.charAt(index);
+ if (ch == 'u' || ch == 'U') {
+ index++;
+ ch = ret.charAt(index);
+ if (ch == 'e' || ch == 'E') {
+ index++;
+ ch = ret.charAt(index);
+ if (ch == '}') {
+ String temp = ""; //$NON-NLS-1$
+ index++;
+ found = true;
+ if (start > 0) {
+ temp = ret.substring(0, start);
+ }
+ temp = temp.concat(values.trim());
+ if (len > index) {
+ start = temp.length();
+ ret = temp.concat(ret.substring(index));
+ index = start;
+ } else {
+ ret = temp;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ start = index;
+ }
+ if (found)
+ return ret.trim();
+ return (command + values).trim();
}
/* (non-Javadoc)
@@ -3116,7 +3143,8 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
*/
@Override
public void setConvertToId(String convertToId) {
- if (convertToId == null && this.convertToId == null) return;
+ if (convertToId == null && this.convertToId == null)
+ return;
if (convertToId == null || this.convertToId == null || !convertToId.equals(this.convertToId)) {
this.convertToId = convertToId;
setDirty(true);
@@ -3145,8 +3173,10 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
*/
@Override
public void setVersionsSupported(String versionsSupported) {
- if (versionsSupported == null && this.versionsSupported == null) return;
- if (versionsSupported == null || this.versionsSupported == null || !versionsSupported.equals(this.versionsSupported)) {
+ if (versionsSupported == null && this.versionsSupported == null)
+ return;
+ if (versionsSupported == null || this.versionsSupported == null
+ || !versionsSupported.equals(this.versionsSupported)) {
this.versionsSupported = versionsSupported;
setDirty(true);
}
@@ -3157,20 +3187,18 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
* @see org.eclipse.cdt.managedbuilder.core.ITool#getEnvVarBuildPaths()
*/
@Override
- public IEnvVarBuildPath[] getEnvVarBuildPaths(){
- if(envVarBuildPathList != null){
- return envVarBuildPathList.toArray(
- new IEnvVarBuildPath[envVarBuildPathList.size()]);
- }
- else if(getSuperClass() != null)
+ public IEnvVarBuildPath[] getEnvVarBuildPaths() {
+ if (envVarBuildPathList != null) {
+ return envVarBuildPathList.toArray(new IEnvVarBuildPath[envVarBuildPathList.size()]);
+ } else if (getSuperClass() != null)
return getSuperClass().getEnvVarBuildPaths();
return null;
}
- private void addEnvVarBuildPath(IEnvVarBuildPath path){
- if(path == null)
+ private void addEnvVarBuildPath(IEnvVarBuildPath path) {
+ if (path == null)
return;
- if(envVarBuildPathList == null)
+ if (envVarBuildPathList == null)
envVarBuildPathList = new ArrayList<IEnvVarBuildPath>();
envVarBuildPathList.add(path);
@@ -3186,7 +3214,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
boolean isExists = false;
- if ( getSuperClass() == null) {
+ if (getSuperClass() == null) {
// If 'getSuperClass()' is null, then there is no tool available in
// plugin manifest file with the same 'id' & version.
// Look for the 'versionsSupported' attribute
@@ -3194,8 +3222,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
SortedMap<String, ? extends ITool> subMap = null;
if (superClassId.compareTo(high) <= 0) {
- subMap = ManagedBuildManager.getExtensionToolMap().subMap(
- superClassId, high + "\0"); //$NON-NLS-1$
+ subMap = ManagedBuildManager.getExtensionToolMap().subMap(superClassId, high + "\0"); //$NON-NLS-1$
} else {
// It means there are no entries in the map for the given id.
// make the project is invalid
@@ -3205,8 +3232,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
// If the parent is a tool chain
IToolChain parent = (IToolChain) getParent();
IConfiguration parentConfig = parent.getParent();
- IManagedProject managedProject = parentConfig
- .getManagedProject();
+ IManagedProject managedProject = parentConfig.getManagedProject();
if (managedProject != null) {
managedProject.setValid(false);
}
@@ -3217,26 +3243,20 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
// check the 'versionsSupported' attribute whether the given
// tool version is supported
- String baseId = ManagedBuildManager
- .getIdFromIdAndVersion(superClassId);
- String version = ManagedBuildManager
- .getVersionFromIdAndVersion(superClassId);
+ String baseId = ManagedBuildManager.getIdFromIdAndVersion(superClassId);
+ String version = ManagedBuildManager.getVersionFromIdAndVersion(superClassId);
for (ITool toolElement : subMap.values()) {
- if (ManagedBuildManager.getIdFromIdAndVersion(
- toolElement.getId()).compareTo(baseId) > 0)
+ if (ManagedBuildManager.getIdFromIdAndVersion(toolElement.getId()).compareTo(baseId) > 0)
break;
// First check if both base ids are equal
- if (ManagedBuildManager.getIdFromIdAndVersion(
- toolElement.getId()).equals(baseId)) {
+ if (ManagedBuildManager.getIdFromIdAndVersion(toolElement.getId()).equals(baseId)) {
// Check if 'versionsSupported' attribute is available'
- String versionsSupported = toolElement
- .getVersionsSupported();
+ String versionsSupported = toolElement.getVersionsSupported();
- if ((versionsSupported != null)
- && (!versionsSupported.isEmpty())) {
+ if ((versionsSupported != null) && (!versionsSupported.isEmpty())) {
String[] tmpVersions = versionsSupported.split(","); //$NON-NLS-1$
for (String tmpVersion : tmpVersions) {
@@ -3246,11 +3266,8 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
// prompting the user.
// Get the supported version
String supportedVersion = ManagedBuildManager
- .getVersionFromIdAndVersion(toolElement
- .getId());
- setId(ManagedBuildManager
- .getIdFromIdAndVersion(getId())
- + "_" + supportedVersion); //$NON-NLS-1$
+ .getVersionFromIdAndVersion(toolElement.getId());
+ setId(ManagedBuildManager.getIdFromIdAndVersion(getId()) + "_" + supportedVersion); //$NON-NLS-1$
// If control comes here means that superClass
// is null.
@@ -3303,23 +3320,21 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
return;
}
-
private void getConverter(String convertToId) {
String fromId = null;
String toId = null;
// Get the Converter Extension Point
- IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
- .getExtensionPoint("org.eclipse.cdt.managedbuilder.core", //$NON-NLS-1$
- "projectConverter"); //$NON-NLS-1$
+ IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(
+ "org.eclipse.cdt.managedbuilder.core", //$NON-NLS-1$
+ "projectConverter"); //$NON-NLS-1$
if (extensionPoint != null) {
// Get the extensions
IExtension[] extensions = extensionPoint.getExtensions();
for (IExtension extension : extensions) {
// Get the configuration elements of each extension
- IConfigurationElement[] configElements = extension
- .getConfigurationElements();
+ IConfigurationElement[] configElements = extension.getConfigurationElements();
for (IConfigurationElement element : configElements) {
if (element.getName().equals("converter")) { //$NON-NLS-1$
@@ -3329,16 +3344,13 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
// Check whether the current converter can be used for
// the selected tool
- if (fromId.equals(getSuperClass().getId())
- && toId.equals(convertToId)) {
+ if (fromId.equals(getSuperClass().getId()) && toId.equals(convertToId)) {
// If it matches
- String mbsVersion = element
- .getAttribute("mbsVersion"); //$NON-NLS-1$
- Version currentMbsVersion = ManagedBuildManager
- .getBuildInfoVersion();
+ String mbsVersion = element.getAttribute("mbsVersion"); //$NON-NLS-1$
+ Version currentMbsVersion = ManagedBuildManager.getBuildInfoVersion();
// set the converter element based on the MbsVersion
- if (currentMbsVersion.compareTo(new Version(mbsVersion))>0) {
+ if (currentMbsVersion.compareTo(new Version(mbsVersion)) > 0) {
previousMbsVersionConversionElement = element;
} else {
currentMbsVersionConversionElement = element;
@@ -3378,35 +3390,37 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
IBuildObject toolParent = getParent();
if (toolParent != null) {
if (toolParent instanceof IToolChain) {
- IConfiguration config = ((IToolChain)toolParent).getParent();
- if (config == null) return null;
- return (IProject)config.getOwner();
+ IConfiguration config = ((IToolChain) toolParent).getParent();
+ if (config == null)
+ return null;
+ return (IProject) config.getOwner();
} else if (toolParent instanceof IResourceConfiguration) {
- return (IProject)((IResourceConfiguration)toolParent).getOwner();
+ return (IProject) ((IResourceConfiguration) toolParent).getOwner();
}
}
return null;
}
- public String[] getContentTypeFileSpecs (IContentType type) {
+ public String[] getContentTypeFileSpecs(IContentType type) {
return getContentTypeFileSpecs(type, getProject());
}
- public String[] getContentTypeFileSpecs (IContentType type, IProject project) {
+ public String[] getContentTypeFileSpecs(IContentType type, IProject project) {
String[] globalSpecs = type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC);
IContentTypeSettings settings = null;
-// IProject project = getProject();
+ // IProject project = getProject();
if (project != null) {
IScopeContext projectScope = new ProjectScope(project);
try {
settings = type.getSettings(projectScope);
- } catch (Exception e) {}
+ } catch (Exception e) {
+ }
if (settings != null) {
String[] specs = settings.getFileSpecs(IContentType.FILE_EXTENSION_SPEC);
if (specs.length > 0) {
int total = globalSpecs.length + specs.length;
String[] projSpecs = new String[total];
- int i=0;
+ int i = 0;
for (String spec : specs) {
projSpecs[i] = spec;
i++;
@@ -3427,7 +3441,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
*/
@Override
public boolean needsRebuild() {
- if(rebuildState)
+ if (rebuildState)
return true;
// Check my children
@@ -3447,15 +3461,15 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
*/
@Override
public void setRebuildState(boolean rebuild) {
- if(isExtensionElement() && rebuild)
+ if (isExtensionElement() && rebuild)
return;
- if(rebuildState != rebuild){
+ if (rebuildState != rebuild) {
rebuildState = rebuild;
saveRebuildState();
}
- if(!rebuild){
+ if (!rebuild) {
super.setRebuildState(rebuild);
if (!rebuild) {
@@ -3468,7 +3482,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
}
}
- private void saveRebuildState(){
+ private void saveRebuildState() {
PropertyManager.getInstance().setProperty(this, REBUILD_STATE, Boolean.toString(rebuildState));
}
@@ -3478,18 +3492,18 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
return typeToDataMap.get(type);
}
- private void initDataMap(){
- if(fDataMapInited)
+ private void initDataMap() {
+ if (fDataMapInited)
return;
List<IInputType> types = getLanguageInputTypes();
- if(types != null){
- if(types.size() == 0){
+ if (types != null) {
+ if (types.size() == 0) {
CLanguageData data = typeToDataMap.get(null);
- if(data == null){
+ if (data == null) {
data = new BuildLanguageData(this, null);
- if(typeToDataMap.size() != 0){
+ if (typeToDataMap.size() != 0) {
typeToDataMap.clear();
}
typeToDataMap.put(null, data);
@@ -3498,23 +3512,23 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
} else {
//create editable input types for lang datas first
- for(ListIterator<IInputType> iter = types.listIterator(); iter.hasNext();){
+ for (ListIterator<IInputType> iter = types.listIterator(); iter.hasNext();) {
IInputType type = iter.next();
iter.set(getEditableInputType(type));
}
@SuppressWarnings("unchecked")
- Map<IInputType, CLanguageData> map = (Map<IInputType, CLanguageData>)typeToDataMap.clone();
- for(IInputType type : types){
+ Map<IInputType, CLanguageData> map = (Map<IInputType, CLanguageData>) typeToDataMap.clone();
+ for (IInputType type : types) {
CLanguageData data = map.remove(type);
- if(data == null){
+ if (data == null) {
data = new BuildLanguageData(this, type);
typeToDataMap.put(type, data);
}
}
- if(map.size() > 0){
- for(IInputType it : map.keySet()){
+ if (map.size() > 0) {
+ for (IInputType it : map.keySet()) {
typeToDataMap.remove(it);
}
}
@@ -3523,24 +3537,23 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
fDataMapInited = true;
}
- private boolean isLanguageInputType(IInputType type, boolean checkLangSettings){
- boolean supports = type.getLanguageId(this) != null
- || typeContributesToScannerConfig((InputType)type);
+ private boolean isLanguageInputType(IInputType type, boolean checkLangSettings) {
+ boolean supports = type.getLanguageId(this) != null || typeContributesToScannerConfig((InputType) type);
- if(supports && checkLangSettings){
+ if (supports && checkLangSettings) {
supports = supportsLanguageSettings();
}
return supports;
}
- public boolean supportsLanguageSettings(){
+ public boolean supportsLanguageSettings() {
IOption options[] = getOptions();
boolean found = false;
for (IOption option : options) {
try {
int type = option.getValueType();
- if(ManagedBuildManager.optionTypeToEntryKind(type) != 0){
+ if (ManagedBuildManager.optionTypeToEntryKind(type) != 0) {
found = true;
break;
}
@@ -3550,20 +3563,20 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
return found;
}
- private List<IInputType> getLanguageInputTypes(){
+ private List<IInputType> getLanguageInputTypes() {
List<IInputType> list = new ArrayList<IInputType>();
IInputType[] types = getInputTypes();
- for(IInputType t : types){
- InputType type = (InputType)t;
- if(isLanguageInputType(type, false))
+ for (IInputType t : types) {
+ InputType type = (InputType) t;
+ if (isLanguageInputType(type, false))
list.add(type);
}
- if(list.size() == 0){
- if(types.length == 1){
+ if (list.size() == 0) {
+ if (types.length == 1) {
list.add(types[0]);
} else {
- for(IInputType t : types){
- if(t.getPrimaryInput()){
+ for (IInputType t : types) {
+ if (t.getPrimaryInput()) {
list.add(t);
break;
}
@@ -3572,7 +3585,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
}
boolean found = supportsLanguageSettings();
- if(!found)
+ if (!found)
return null;
return list;
}
@@ -3585,37 +3598,36 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
@Override
public IInputType getInputTypeForCLanguageData(CLanguageData data) {
- if(data instanceof BuildLanguageData)
- return ((BuildLanguageData)data).getInputType();
+ if (data instanceof BuildLanguageData)
+ return ((BuildLanguageData) data).getInputType();
return null;
}
@Override
public IResourceInfo getParentResourceInfo() {
- if(parent instanceof IFileInfo)
- return (IResourceInfo)parent;
- else if(parent instanceof IToolChain)
- return ((IToolChain)parent).getParentFolderInfo();
+ if (parent instanceof IFileInfo)
+ return (IResourceInfo) parent;
+ else if (parent instanceof IToolChain)
+ return ((IToolChain) parent).getParentFolderInfo();
return null;
}
-
@Override
public IInputType getEditableInputType(IInputType base) {
- if(base.getParent() == this)
+ if (base.getParent() == this)
return base;
IInputType extType = base;
- for(;extType != null && !extType.isExtensionElement();extType = extType.getSuperClass()) {
+ for (; extType != null && !extType.isExtensionElement(); extType = extType.getSuperClass()) {
// empty body
}
String id;
- if(extType != null){
+ if (extType != null) {
id = ManagedBuildManager.calculateChildId(extType.getId(), null);
} else {
id = ManagedBuildManager.calculateChildId(getId(), null);
}
- InputType newType = (InputType)createInputType(base, id, base.getName(), false);
+ InputType newType = (InputType) createInputType(base, id, base.getName(), false);
IAdditionalInput addlInputs[] = base.getAdditionalInputs();
for (IAdditionalInput addlInput : addlInputs) {
newType.createAdditionalInput(addlInput);
@@ -3625,15 +3637,15 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
@Override
public IOutputType getEditableOutputType(IOutputType base) {
- if(base.getParent() == this)
+ if (base.getParent() == this)
return base;
IOutputType extType = base;
- for(;extType != null && !extType.isExtensionElement();extType = extType.getSuperClass()){
+ for (; extType != null && !extType.isExtensionElement(); extType = extType.getSuperClass()) {
// empty body - loop to find extension
}
String id;
- if(extType != null){
+ if (extType != null) {
id = ManagedBuildManager.calculateChildId(extType.getId(), null);
} else {
id = ManagedBuildManager.calculateChildId(getId(), null);
@@ -3652,60 +3664,59 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
boolean suports = false;
SupportedProperties props = findSupportedProperties();
- if(props != null) {
+ if (props != null) {
suports = props.supportsType(type);
} else {
BooleanExpressionApplicabilityCalculator calc = getBooleanExpressionCalculator();
- if(calc != null){
+ if (calc != null) {
suports = calc.referesProperty(type);
}
- if(!suports)
+ if (!suports)
suports = super.supportsType(type);
}
return suports;
}
@Override
- public boolean supportsValue(String type, String value){
+ public boolean supportsValue(String type, String value) {
boolean suports = false;
SupportedProperties props = findSupportedProperties();
- if(props != null) {
+ if (props != null) {
suports = props.supportsValue(type, value);
} else {
BooleanExpressionApplicabilityCalculator calc = getBooleanExpressionCalculator();
- if(calc != null){
+ if (calc != null) {
suports = calc.referesPropertyValue(type, value);
}
- if(!suports)
+ if (!suports)
suports = super.supportsValue(type, value);
}
return suports;
}
@Override
- public boolean supportsValue(IBuildPropertyType type,
- IBuildPropertyValue value) {
+ public boolean supportsValue(IBuildPropertyType type, IBuildPropertyValue value) {
return supportsValue(type.getId(), value.getId());
}
@Override
public void propertiesChanged() {
- if(isExtensionTool)
+ if (isExtensionTool)
return;
BooleanExpressionApplicabilityCalculator calculator = getBooleanExpressionCalculator();
- if(calculator != null)
+ if (calculator != null)
calculator.adjustTool(getParentResourceInfo(), this, false);
super.propertiesChanged();
}
- public BooleanExpressionApplicabilityCalculator getBooleanExpressionCalculator(){
- if(booleanExpressionCalculator == null){
- if(superClass != null){
- return ((Tool)superClass).getBooleanExpressionCalculator();
+ public BooleanExpressionApplicabilityCalculator getBooleanExpressionCalculator() {
+ if (booleanExpressionCalculator == null) {
+ if (superClass != null) {
+ return ((Tool) superClass).getBooleanExpressionCalculator();
}
}
return booleanExpressionCalculator;
@@ -3719,45 +3730,45 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
public boolean isEnabled(IResourceInfo rcInfo) {
BooleanExpressionApplicabilityCalculator calc = getBooleanExpressionCalculator();
- if(calc == null)
+ if (calc == null)
return true;
return calc.isToolUsedInCommandLine(rcInfo, this);
}
@Override
- public boolean matches(ITool tool){
- if(tool == this)
+ public boolean matches(ITool tool) {
+ if (tool == this)
return true;
ITool rT = ManagedBuildManager.getRealTool(this);
- if(rT == null)
+ if (rT == null)
return false;
return rT == ManagedBuildManager.getRealTool(tool);
}
-/* public SupportedProperties getSupportedProperties(){
- Map map = findSupportedProperties();
- if(map != null)
- return new HashMap(map);
- return null;
- }
-*/
- private SupportedProperties findSupportedProperties(){
- if(supportedProperties == null){
- if(superClass != null){
- return ((Tool)superClass).findSupportedProperties();
+ /* public SupportedProperties getSupportedProperties(){
+ Map map = findSupportedProperties();
+ if(map != null)
+ return new HashMap(map);
+ return null;
+ }
+ */
+ private SupportedProperties findSupportedProperties() {
+ if (supportedProperties == null) {
+ if (superClass != null) {
+ return ((Tool) superClass).findSupportedProperties();
}
}
return supportedProperties;
}
@Override
- public boolean supportsBuild(boolean managed){
- if(supportsManagedBuild == null){
- if(superClass != null){
- return ((Tool)superClass).supportsBuild(managed);
+ public boolean supportsBuild(boolean managed) {
+ if (supportsManagedBuild == null) {
+ if (superClass != null) {
+ return ((Tool) superClass).supportsBuild(managed);
}
return true;
}
@@ -3766,9 +3777,9 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
@Override
public MatchKey<Tool> getMatchKey() {
- if(isAbstract())
+ if (isAbstract())
return null;
- if(!isExtensionTool)
+ if (!isExtensionTool)
return null;
return new MatchKey<Tool>(this);
}
@@ -3778,30 +3789,30 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
identicalList = list;
}
- public String getNameAndVersion(){
+ public String getNameAndVersion() {
String name = getName();
String version = ManagedBuildManager.getVersionFromIdAndVersion(getId());
- if(version != null && version.length() != 0){
+ if (version != null && version.length() != 0) {
return new StringBuilder().append(name).append(" (").append(version).append("").toString(); //$NON-NLS-1$ //$NON-NLS-2$
}
return name;
}
- public IConfigurationElement getConverterModificationElement(ITool toTool){
+ public IConfigurationElement getConverterModificationElement(ITool toTool) {
Map<String, IConfigurationElement> map = ManagedBuildManager.getConversionElements(this);
IConfigurationElement element = null;
- if(!map.isEmpty()){
- for(IConfigurationElement el : map.values()){
+ if (!map.isEmpty()) {
+ for (IConfigurationElement el : map.values()) {
String toId = el.getAttribute("toId"); //$NON-NLS-1$
ITool to = toTool;
- if(toId != null){
- for(;to != null; to = to.getSuperClass()){
- if(toId.equals(to.getId()))
+ if (toId != null) {
+ for (; to != null; to = to.getSuperClass()) {
+ if (toId.equals(to.getId()))
break;
}
}
- if(to != null){
+ if (to != null) {
element = el;
break;
}
@@ -3811,15 +3822,15 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
return element;
}
- void updateParent(IBuildObject parent){
+ void updateParent(IBuildObject parent) {
this.parent = parent;
}
- void updateParentResourceInfo(IResourceInfo rcInfo){
- if(rcInfo instanceof IFileInfo)
+ void updateParentResourceInfo(IResourceInfo rcInfo) {
+ if (rcInfo instanceof IFileInfo)
this.parent = rcInfo;
else
- this.parent = ((IFolderInfo)rcInfo).getToolChain();
+ this.parent = ((IFolderInfo) rcInfo).getToolChain();
}
@Override
@@ -3831,7 +3842,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
public String[] getRequiredTypeIds() {
SupportedProperties props = findSupportedProperties();
String[] required = null;
- if(props != null) {
+ if (props != null) {
required = props.getRequiredTypeIds();
} else {
required = super.getRequiredTypeIds();
@@ -3843,12 +3854,12 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
public String[] getSupportedTypeIds() {
SupportedProperties props = findSupportedProperties();
String[] supported = null;
- if(props != null) {
+ if (props != null) {
supported = props.getSupportedTypeIds();
} else {
BooleanExpressionApplicabilityCalculator calc = getBooleanExpressionCalculator();
List<String> list = new ArrayList<String>();
- if(calc != null){
+ if (calc != null) {
list.addAll(Arrays.asList(calc.getReferencedPropertyIds()));
}
@@ -3862,12 +3873,12 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
public String[] getSupportedValueIds(String typeId) {
SupportedProperties props = findSupportedProperties();
String[] supported = null;
- if(props != null) {
+ if (props != null) {
supported = props.getSupportedValueIds(typeId);
} else {
BooleanExpressionApplicabilityCalculator calc = getBooleanExpressionCalculator();
List<String> list = new ArrayList<String>();
- if(calc != null){
+ if (calc != null) {
list.addAll(Arrays.asList(calc.getReferencedValueIds(typeId)));
}
@@ -3881,7 +3892,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
public boolean requiresType(String typeId) {
SupportedProperties props = findSupportedProperties();
boolean required;
- if(props != null) {
+ if (props != null) {
required = props.requiresType(typeId);
} else {
required = super.requiresType(typeId);
@@ -3889,14 +3900,14 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
return required;
}
- public void resetErrorParsers(){
+ public void resetErrorParsers() {
errorParserIds = null;
}
- void removeErrorParsers(Set<String> set){
- if(set != null && !set.isEmpty()) {
+ void removeErrorParsers(Set<String> set) {
+ if (set != null && !set.isEmpty()) {
Set<String> oldSet = contributeErrorParsers(null);
- if(oldSet == null)
+ if (oldSet == null)
oldSet = new HashSet<String>();
oldSet.removeAll(set);
@@ -3905,14 +3916,14 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
}
public void setErrorParserList(String[] ids) {
- if(ids == null){
+ if (ids == null) {
setErrorParserIds(null);
- } else if(ids.length == 0){
+ } else if (ids.length == 0) {
setErrorParserIds(EMPTY_STRING);
} else {
StringBuilder buf = new StringBuilder();
buf.append(ids[0]);
- for(int i = 1; i < ids.length; i++){
+ for (int i = 1; i < ids.length; i++) {
buf.append(";").append(ids[i]); //$NON-NLS-1$
}
setErrorParserIds(buf.toString());
@@ -3921,18 +3932,18 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
@Override
public boolean isSystemObject() {
- if(isTest)
+ if (isTest)
return true;
- if(getConvertToId().length() != 0)
+ if (getConvertToId().length() != 0)
return true;
IBuildObject bo = getParent();
- if(bo instanceof IToolChain)
- return ((IToolChain)bo).isSystemObject();
+ if (bo instanceof IToolChain)
+ return ((IToolChain) bo).isSystemObject();
return false;
}
-
+
@Override
public boolean isHidden() {
if (isHidden == null) {
@@ -3941,155 +3952,155 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
}
return false; // default is false
}
- return isHidden.booleanValue();
- }
+ return isHidden.booleanValue();
+ }
@Override
public String getUniqueRealName() {
String name = getName();
- if(name == null){
+ if (name == null) {
name = getId();
} else {
String version = ManagedBuildManager.getVersionFromIdAndVersion(getId());
- if(version != null){
- StringBuilder buf = new StringBuilder();
- buf.append(name);
- buf.append(" (v").append(version).append(")"); //$NON-NLS-1$ //$NON-NLS-2$
- name = buf.toString();
+ if (version != null) {
+ StringBuilder buf = new StringBuilder();
+ buf.append(name);
+ buf.append(" (v").append(version).append(")"); //$NON-NLS-1$ //$NON-NLS-2$
+ name = buf.toString();
}
}
return name;
}
- private boolean typeContributesToScannerConfig(InputType inType){
-// InputType inType = (InputType)type;
+ private boolean typeContributesToScannerConfig(InputType inType) {
+ // InputType inType = (InputType)type;
- if(inType.getDiscoveryProfileId(this) != null)
+ if (inType.getDiscoveryProfileId(this) != null)
return true;
return false;
}
- public boolean hasScannerConfigSettings(IInputType type){
- if(type == null){
+ public boolean hasScannerConfigSettings(IInputType type) {
+ if (type == null) {
boolean has = hasScannerConfigSettings();
if (has)
return has;
ITool superClass = getSuperClass();
- if (superClass!=null && superClass instanceof Tool)
- return ((Tool)superClass).hasScannerConfigSettings(type);
+ if (superClass != null && superClass instanceof Tool)
+ return ((Tool) superClass).hasScannerConfigSettings(type);
return false;
}
- return ((InputType)type).hasScannerConfigSettings();
+ return ((InputType) type).hasScannerConfigSettings();
}
- private boolean hasScannerConfigSettings(){
+ private boolean hasScannerConfigSettings() {
- if(getDiscoveryProfileIdAttribute() != null)
+ if (getDiscoveryProfileIdAttribute() != null)
return true;
return false;
}
- public PathInfoCache setDiscoveredPathInfo(IInputType type, PathInfoCache info){
+ public PathInfoCache setDiscoveredPathInfo(IInputType type, PathInfoCache info) {
return discoveredInfoMap.put(getTypeKey(type), info);
}
- public PathInfoCache getDiscoveredPathInfo(IInputType type){
+ public PathInfoCache getDiscoveredPathInfo(IInputType type) {
return discoveredInfoMap.get(getTypeKey(type));
}
- public PathInfoCache clearDiscoveredPathInfo(IInputType type){
+ public PathInfoCache clearDiscoveredPathInfo(IInputType type) {
return discoveredInfoMap.remove(getTypeKey(type));
}
- public void clearAllDiscoveredPathInfo(){
+ public void clearAllDiscoveredPathInfo() {
discoveredInfoMap.clear();
}
- public void clearAllDiscoveredInfo(){
+ public void clearAllDiscoveredInfo() {
discoveredInfoMap.clear();
}
- private String getTypeKey(IInputType type){
- if(type != null)
+ private String getTypeKey(IInputType type) {
+ if (type != null)
return type.getId();
return null;
}
- public String getDiscoveryProfileIdAttribute(){
- if(scannerConfigDiscoveryProfileId == null && superClass != null)
- return ((Tool)superClass).getDiscoveryProfileIdAttribute();
+ public String getDiscoveryProfileIdAttribute() {
+ if (scannerConfigDiscoveryProfileId == null && superClass != null)
+ return ((Tool) superClass).getDiscoveryProfileIdAttribute();
return scannerConfigDiscoveryProfileId;
}
- private IToolChain getToolChain(){
+ private IToolChain getToolChain() {
IBuildObject bo = getParent();
IToolChain tCh = null;
- if(bo instanceof IToolChain){
- tCh = ((IToolChain)bo);
- } else if(bo instanceof IFileInfo){
- tCh = ((ResourceConfiguration)bo).getBaseToolChain();
+ if (bo instanceof IToolChain) {
+ tCh = ((IToolChain) bo);
+ } else if (bo instanceof IFileInfo) {
+ tCh = ((ResourceConfiguration) bo).getBaseToolChain();
}
return tCh;
}
- public String getDiscoveryProfileId(){
+ public String getDiscoveryProfileId() {
String id = getDiscoveryProfileIdAttribute();
- if(id == null){
+ if (id == null) {
IToolChain tc = getToolChain();
- if(tc != null)
+ if (tc != null)
id = tc.getScannerConfigDiscoveryProfileId();
}
return id;
}
- public boolean hasCustomSettings(Tool tool){
- if(superClass == null)
+ public boolean hasCustomSettings(Tool tool) {
+ if (superClass == null)
return true;
ITool realTool = ManagedBuildManager.getRealTool(this);
ITool otherRealTool = ManagedBuildManager.getRealTool(tool);
- if(realTool != otherRealTool)
+ if (realTool != otherRealTool)
return true;
- if(hasCustomSettings())
+ if (hasCustomSettings())
return true;
- if(inputTypeList != null && inputTypeList.size() != 0){
- for(InputType inType : inputTypeList){
- if(inType.hasCustomSettings())
+ if (inputTypeList != null && inputTypeList.size() != 0) {
+ for (InputType inType : inputTypeList) {
+ if (inType.hasCustomSettings())
return true;
}
}
- if(outputTypeList != null && outputTypeList.size() != 0){
- for(OutputType outType : outputTypeList){
- if(outType.hasCustomSettings())
+ if (outputTypeList != null && outputTypeList.size() != 0) {
+ for (OutputType outType : outputTypeList) {
+ if (outType.hasCustomSettings())
return true;
}
}
- Tool superTool = (Tool)superClass;
+ Tool superTool = (Tool) superClass;
+
+ if (command != null && !command.equals(superTool.getToolCommand()))
+ return true;
- if(command != null && !command.equals(superTool.getToolCommand()))
+ if (errorParserIds != null && !errorParserIds.equals(superTool.getErrorParserIds()))
return true;
- if(errorParserIds != null && !errorParserIds.equals(superTool.getErrorParserIds()))
+ if (commandLinePattern != null && !commandLinePattern.equals(superTool.getCommandLinePattern()))
return true;
- if(commandLinePattern != null && !commandLinePattern.equals(superTool.getCommandLinePattern()))
+ if (customBuildStep != null && customBuildStep.booleanValue() != superTool.getCustomBuildStep())
return true;
- if(customBuildStep != null && customBuildStep.booleanValue() != superTool.getCustomBuildStep())
+ if (announcement != null && !announcement.equals(superTool.getAnnouncement()))
return true;
- if(announcement != null && !announcement.equals(superTool.getAnnouncement()))
+ if (isHidden != null && isHidden.booleanValue() != superTool.isHidden())
return true;
-
- if(isHidden != null && isHidden.booleanValue() != superTool.isHidden())
- return true;
- if(discoveredInfoMap != null && discoveredInfoMap.size() != 0)
+ if (discoveredInfoMap != null && discoveredInfoMap.size() != 0)
return true;
if (isAnyOptionModified(this, tool))
@@ -4103,16 +4114,14 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
for (IOption op2 : t2.getOptions()) {
// find matching option
try {
- if (op1.getValueType() == op2.getValueType() &&
- op1.getName() != null &&
- op1.getName().equals(op2.getName())) {
+ if (op1.getValueType() == op2.getValueType() && op1.getName() != null
+ && op1.getName().equals(op2.getName())) {
Object ob1 = op1.getValue();
Object ob2 = op2.getValue();
if (ob1 == null && ob2 == null)
break;
// values are different ?
- if ((ob1 == null || ob2 == null) ||
- !(ob1.equals(ob2) ))
+ if ((ob1 == null || ob2 == null) || !(ob1.equals(ob2)))
return true;
else
break;
@@ -4125,11 +4134,11 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
return false;
}
- public IOption[] getOptionsOfType(int type){
+ public IOption[] getOptionsOfType(int type) {
List<IOption> list = new ArrayList<IOption>();
- for(IOption op : getOptions()){
+ for (IOption op : getOptions()) {
try {
- if(op.getValueType() == type)
+ if (op.getValueType() == type)
list.add(op);
} catch (BuildException e) {
ManagedBuilderCorePlugin.log(e);
@@ -4138,34 +4147,34 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
return list.toArray(new Option[list.size()]);
}
- public void filterValues(int type, List<String> values){
- if(values.size() == 0)
+ public void filterValues(int type, List<String> values) {
+ if (values.size() == 0)
return;
int opType = Option.getOppositeType(type);
- if(opType != 0){
+ if (opType != 0) {
Set<Object> filterSet = new HashSet<Object>();
- for(IOption op : getOptionsOfType(opType)){
- filterSet.addAll((List<Object>)op.getValue());
+ for (IOption op : getOptionsOfType(opType)) {
+ filterSet.addAll((List<Object>) op.getValue());
}
- if(filterSet.size() != 0){
+ if (filterSet.size() != 0) {
for (Iterator<String> iterator = values.iterator(); iterator.hasNext();) {
String oVal = iterator.next();
- if(type == IOption.PREPROCESSOR_SYMBOLS){
+ if (type == IOption.PREPROCESSOR_SYMBOLS) {
String[] nameVal = BuildEntryStorage.macroNameValueFromValue(oVal);
oVal = nameVal[0];
}
- if(filterSet.contains(oVal))
+ if (filterSet.contains(oVal))
iterator.remove();
}
}
}
}
- private int getSuperClassNum(){
+ private int getSuperClassNum() {
int num = 0;
- for(ITool superTool = getSuperClass(); superTool != null; superTool = superTool.getSuperClass()){
+ for (ITool superTool = getSuperClass(); superTool != null; superTool = superTool.getSuperClass()) {
num++;
}
return num;
@@ -4173,7 +4182,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
@Override
public int compareTo(Tool other) {
- if(other.isSystemObject() != isSystemObject())
+ if (other.isSystemObject() != isSystemObject())
return isSystemObject() ? 1 : -1;
return getSuperClassNum() - other.getSuperClassNum();
@@ -4181,22 +4190,22 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
@Override
public IRealBuildObjectAssociation getExtensionObject() {
- return (IRealBuildObjectAssociation)ManagedBuildManager.getExtensionTool(this);
+ return (IRealBuildObjectAssociation) ManagedBuildManager.getExtensionTool(this);
}
@Override
public IRealBuildObjectAssociation[] getIdenticBuildObjects() {
- return (IRealBuildObjectAssociation[])ManagedBuildManager.findIdenticalTools(this);
+ return (IRealBuildObjectAssociation[]) ManagedBuildManager.findIdenticalTools(this);
}
@Override
public IRealBuildObjectAssociation getRealBuildObject() {
- return (IRealBuildObjectAssociation)ManagedBuildManager.getRealTool(this);
+ return (IRealBuildObjectAssociation) ManagedBuildManager.getRealTool(this);
}
@Override
public IRealBuildObjectAssociation getSuperClassObject() {
- return (IRealBuildObjectAssociation)getSuperClass();
+ return (IRealBuildObjectAssociation) getSuperClass();
}
@Override
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java
index e69bd276005..b9830d2bbde 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChain.java
@@ -67,11 +67,12 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.osgi.framework.Version;
-public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProvider<ToolChain>, IRealBuildObjectAssociation {
+public class ToolChain extends HoldsOptions
+ implements IToolChain, IMatchKeyProvider<ToolChain>, IRealBuildObjectAssociation {
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
- private static final String REBUILD_STATE = "rebuildState"; //$NON-NLS-1$
+ private static final String REBUILD_STATE = "rebuildState"; //$NON-NLS-1$
private static final boolean resolvedDefault = true;
@@ -104,8 +105,8 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
private IConfigurationEnvironmentVariableSupplier environmentVariableSupplier = null;
private IConfigurationElement buildMacroSupplierElement = null;
private IConfigurationBuildMacroSupplier buildMacroSupplier = null;
- private IConfigurationElement pathconverterElement = null ;
- private IOptionPathConverter optionPathConverter = null ;
+ private IConfigurationElement pathconverterElement = null;
+ private IOptionPathConverter optionPathConverter = null;
private Boolean supportsManagedBuild;
private boolean isTest;
private SupportedProperties supportedProperties;
@@ -119,7 +120,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
//used for loadding pre-4.0 projects only
private StorableCdtVariables userDefinedMacros;
//holds user-defined macros
-// private StorableEnvironment userDefinedEnvironment;
+ // private StorableEnvironment userDefinedEnvironment;
private IConfigurationElement previousMbsVersionConversionElement = null;
private IConfigurationElement currentMbsVersionConversionElement = null;
@@ -129,13 +130,11 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
private List<ToolChain> identicalList;
private Set<String> unusedChildrenSet;
-
private IFolderInfo parentFolderInfo;
private PathInfoCache discoveredInfo;
private Boolean isRcTypeBasedDiscovery;
-
/**
* This constructor is called to create a tool-chain defined by an extension point in
* a plugin manifest file, or returned by a dynamic element provider
@@ -151,7 +150,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
super(false);
resolved = false;
- if(parentFldInfo != null){
+ if (parentFldInfo != null) {
this.config = parentFldInfo.getParent();
parentFolderInfo = parentFldInfo;
}
@@ -162,7 +161,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
setManagedBuildRevision(managedBuildRevision);
IManagedConfigElement enablements[] = element.getChildren(OptionEnablementExpression.NAME);
- if(enablements.length > 0)
+ if (enablements.length > 0)
booleanExpressionCalculator = new BooleanExpressionApplicabilityCalculator(enablements);
loadFromManifest(element);
@@ -197,7 +196,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
} else if (toolChainElement.getName().equals(ITool.TOOL_ELEMENT_NAME)) {
Tool toolChild = new Tool(this, toolChainElement, managedBuildRevision);
addTool(toolChild);
- } else if (toolChainElement.getName().equals(SupportedProperties.SUPPORTED_PROPERTIES)){
+ } else if (toolChainElement.getName().equals(SupportedProperties.SUPPORTED_PROPERTIES)) {
loadProperties(toolChainElement);
}
}
@@ -213,7 +212,8 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
* @param name The name for the new tool chain
* @param isExtensionElement Indicates whether this is an extension element or a managed project element
*/
- public ToolChain(IFolderInfo parentFldInfo, IToolChain superClass, String Id, String name, boolean isExtensionElement) {
+ public ToolChain(IFolderInfo parentFldInfo, IToolChain superClass, String Id, String name,
+ boolean isExtensionElement) {
super(resolvedDefault);
this.config = parentFldInfo.getParent();
parentFolderInfo = parentFldInfo;
@@ -268,24 +268,24 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
} else if (configElement.getName().equals(ITool.TOOL_ELEMENT_NAME)) {
Tool tool = new Tool(this, configElement, managedBuildRevision);
addTool(tool);
- }else if (configElement.getName().equals(ITargetPlatform.TARGET_PLATFORM_ELEMENT_NAME)) {
+ } else if (configElement.getName().equals(ITargetPlatform.TARGET_PLATFORM_ELEMENT_NAME)) {
if (targetPlatform != null) {
// TODO: report error
}
targetPlatform = new TargetPlatform(this, configElement, managedBuildRevision);
- }else if (configElement.getName().equals(IBuilder.BUILDER_ELEMENT_NAME)) {
+ } else if (configElement.getName().equals(IBuilder.BUILDER_ELEMENT_NAME)) {
if (builder != null) {
// TODO: report error
}
builder = new Builder(this, configElement, managedBuildRevision);
- } else if (configElement.getName().equals("macros")) { //$NON-NLS-1$
+ } else if (configElement.getName().equals("macros")) { //$NON-NLS-1$
//load user-defined macros
userDefinedMacros = new StorableCdtVariables(configElement, false);
}
}
String rebuild = PropertyManager.getInstance().getProperty(this, REBUILD_STATE);
- if(rebuild == null || Boolean.valueOf(rebuild).booleanValue())
+ if (rebuild == null || Boolean.valueOf(rebuild).booleanValue())
rebuildState = true;
}
@@ -298,7 +298,8 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
* @param name name of the new tool-chain
* @param toolChain The existing tool-chain to clone.
*/
- public ToolChain(IFolderInfo parentFldInfo, String Id, String name, Map<IPath, Map<String, String>> superIdMap, ToolChain toolChain) {
+ public ToolChain(IFolderInfo parentFldInfo, String Id, String name, Map<IPath, Map<String, String>> superIdMap,
+ ToolChain toolChain) {
super(resolvedDefault);
this.config = parentFldInfo.getParent();
this.parentFolderInfo = parentFldInfo;
@@ -318,10 +319,10 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
isExtensionToolChain = false;
// Copy the remaining attributes
- if(toolChain.versionsSupported != null) {
+ if (toolChain.versionsSupported != null) {
versionsSupported = toolChain.versionsSupported;
}
- if(toolChain.convertToId != null) {
+ if (toolChain.convertToId != null) {
convertToId = toolChain.convertToId;
}
@@ -363,8 +364,8 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
buildMacroSupplierElement = toolChain.buildMacroSupplierElement;
buildMacroSupplier = toolChain.buildMacroSupplier;
- pathconverterElement = toolChain.pathconverterElement ;
- optionPathConverter = toolChain.optionPathConverter ;
+ pathconverterElement = toolChain.pathconverterElement;
+ optionPathConverter = toolChain.optionPathConverter;
nonInternalBuilderId = toolChain.nonInternalBuilderId;
@@ -381,44 +382,43 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
String subName;
if (toolChain.builder.getSuperClass() != null) {
- subId = copyIds ? toolChain.builder.getId() :
- ManagedBuildManager.calculateChildId(toolChain.builder.getSuperClass().getId(), null);
+ subId = copyIds ? toolChain.builder.getId()
+ : ManagedBuildManager.calculateChildId(toolChain.builder.getSuperClass().getId(), null);
subName = toolChain.builder.getSuperClass().getName();
} else {
- subId = copyIds ? toolChain.builder.getId() : ManagedBuildManager.calculateChildId(
- toolChain.builder.getId(),
- null);
+ subId = copyIds ? toolChain.builder.getId()
+ : ManagedBuildManager.calculateChildId(toolChain.builder.getId(), null);
subName = toolChain.builder.getName();
}
builder = new Builder(this, subId, subName, toolChain.builder);
}
-// if (toolChain.targetPlatform != null)
+ // if (toolChain.targetPlatform != null)
{
ITargetPlatform tpBase = toolChain.getTargetPlatform();
- if(tpBase != null){
+ if (tpBase != null) {
ITargetPlatform extTp = tpBase;
- for(;extTp != null && !extTp.isExtensionElement();extTp = extTp.getSuperClass()) {
+ for (; extTp != null && !extTp.isExtensionElement(); extTp = extTp.getSuperClass()) {
// empty body, the loop is to find extension element
}
String subId;
- if(copyIds){
+ if (copyIds) {
subId = tpBase.getId();
} else {
- subId = extTp != null ? ManagedBuildManager.calculateChildId(extTp.getId(), null):
- ManagedBuildManager.calculateChildId(getId(), null);
+ subId = extTp != null ? ManagedBuildManager.calculateChildId(extTp.getId(), null)
+ : ManagedBuildManager.calculateChildId(getId(), null);
}
String subName = tpBase.getName();
-// if (toolChain.targetPlatform.getSuperClass() != null) {
-// subId = toolChain.targetPlatform.getSuperClass().getId() + "." + nnn; //$NON-NLS-1$
-// subName = toolChain.targetPlatform.getSuperClass().getName();
-// } else {
-// subId = toolChain.targetPlatform.getId() + "." + nnn; //$NON-NLS-1$
-// subName = toolChain.targetPlatform.getName();
-// }
- targetPlatform = new TargetPlatform(this, subId, subName, (TargetPlatform)tpBase);
+ // if (toolChain.targetPlatform.getSuperClass() != null) {
+ // subId = toolChain.targetPlatform.getSuperClass().getId() + "." + nnn; //$NON-NLS-1$
+ // subName = toolChain.targetPlatform.getSuperClass().getName();
+ // } else {
+ // subId = toolChain.targetPlatform.getId() + "." + nnn; //$NON-NLS-1$
+ // subName = toolChain.targetPlatform.getName();
+ // }
+ targetPlatform = new TargetPlatform(this, subId, subName, (TargetPlatform) tpBase);
}
}
@@ -426,33 +426,35 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
if (toolChain.toolList != null) {
for (Tool toolChild : toolChain.getToolList()) {
String subId = null;
-// String tmpId;
+ // String tmpId;
String subName;
-// String version;
+ // String version;
ITool extTool = ManagedBuildManager.getExtensionTool(toolChild);
Map<String, String> curIdMap = superIdMap.get(parentFldInfo.getPath());
- if(curIdMap != null){
- if(extTool != null)
+ if (curIdMap != null) {
+ if (extTool != null)
subId = curIdMap.get(extTool.getId());
}
subName = toolChild.getName();
- if(subId == null){
+ if (subId == null) {
if (extTool != null) {
- subId = copyIds ? toolChild.getId() : ManagedBuildManager.calculateChildId(extTool.getId(), null);
-// subName = toolChild.getSuperClass().getName();
+ subId = copyIds ? toolChild.getId()
+ : ManagedBuildManager.calculateChildId(extTool.getId(), null);
+ // subName = toolChild.getSuperClass().getName();
} else {
- subId = copyIds ? toolChild.getId() : ManagedBuildManager.calculateChildId(toolChild.getId(), null);
-// subName = toolChild.getName();
+ subId = copyIds ? toolChild.getId()
+ : ManagedBuildManager.calculateChildId(toolChild.getId(), null);
+ // subName = toolChild.getName();
}
}
-// version = ManagedBuildManager.getVersionFromIdAndVersion(tmpId);
-// if ( version != null) { // If the 'tmpId' contains version information
-// subId = ManagedBuildManager.getIdFromIdAndVersion(tmpId) + "." + nnn + "_" + version; //$NON-NLS-1$ //$NON-NLS-2$
-// } else {
-// subId = tmpId + "." + nnn; //$NON-NLS-1$
-// }
+ // version = ManagedBuildManager.getVersionFromIdAndVersion(tmpId);
+ // if ( version != null) { // If the 'tmpId' contains version information
+ // subId = ManagedBuildManager.getIdFromIdAndVersion(tmpId) + "." + nnn + "_" + version; //$NON-NLS-1$ //$NON-NLS-2$
+ // } else {
+ // subId = tmpId + "." + nnn; //$NON-NLS-1$
+ // }
// The superclass for the cloned tool is not the same as the one from the tool being cloned.
// The superclasses reside in different configurations.
@@ -461,28 +463,29 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
// 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){
- if(otherSuperTool.isExtensionElement()){
+ if (otherSuperTool != null) {
+ if (otherSuperTool.isExtensionElement()) {
toolSuperClass = otherSuperTool;
} else {
IResourceInfo otherRcInfo = otherSuperTool.getParentResourceInfo();
IResourceInfo thisRcInfo = cfg.getResourceInfo(otherRcInfo.getPath(), true);
ITool otherExtTool = ManagedBuildManager.getExtensionTool(otherSuperTool);
- if(otherExtTool != null){
- if(thisRcInfo != null){
+ if (otherExtTool != null) {
+ if (thisRcInfo != null) {
ITool tools[] = thisRcInfo.getTools();
- for(int i = 0; i < tools.length; i++){
+ for (int i = 0; i < tools.length; i++) {
ITool thisExtTool = ManagedBuildManager.getExtensionTool(tools[i]);
- if(otherExtTool.equals(thisExtTool)){
+ if (otherExtTool.equals(thisExtTool)) {
toolSuperClass = tools[i];
superId = toolSuperClass.getId();
break;
}
}
} else {
- superId = copyIds ? otherSuperTool.getId() : ManagedBuildManager.calculateChildId(otherExtTool.getId(), null);
+ superId = copyIds ? otherSuperTool.getId()
+ : ManagedBuildManager.calculateChildId(otherExtTool.getId(), null);
Map<String, String> idMap = superIdMap.get(otherRcInfo.getPath());
- if(idMap == null){
+ if (idMap == null) {
idMap = new HashMap<String, String>();
superIdMap.put(otherRcInfo.getPath(), idMap);
}
@@ -491,24 +494,24 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
}
}
}
-// Tool newTool = new Tool(this, (Tool)null, subId, subName, toolChild);
-// addTool(newTool);
+ // Tool newTool = new Tool(this, (Tool)null, subId, subName, toolChild);
+ // addTool(newTool);
Tool newTool = null;
- if(toolSuperClass != null)
+ if (toolSuperClass != null)
newTool = new Tool(this, toolSuperClass, subId, subName, toolChild);
- else if(superId != null)
+ else if (superId != null)
newTool = new Tool(this, superId, subId, subName, toolChild);
- else{
+ else {
//TODO: Error
}
- if(newTool != null)
+ if (newTool != null)
addTool(newTool);
}
}
- if(copyIds){
+ if (copyIds) {
rebuildState = toolChain.rebuildState;
isDirty = toolChain.isDirty;
} else {
@@ -547,7 +550,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
// isAbstract
String isAbs = element.getAttribute(IProjectType.IS_ABSTRACT);
- if (isAbs != null){
+ if (isAbs != null) {
isAbstract = Boolean.parseBoolean(isAbs);
}
@@ -564,9 +567,10 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
defaultLanguageSettingsProviderIds = element.getAttribute(LANGUAGE_SETTINGS_PROVIDERS);
// Get the scanner config discovery profile id
- scannerConfigDiscoveryProfileId = SafeStringInterner.safeIntern(element.getAttribute(SCANNER_CONFIG_PROFILE_ID));
+ scannerConfigDiscoveryProfileId = SafeStringInterner
+ .safeIntern(element.getAttribute(SCANNER_CONFIG_PROFILE_ID));
String tmp = element.getAttribute(RESOURCE_TYPE_BASED_DISCOVERY);
- if(tmp != null)
+ if (tmp != null)
isRcTypeBasedDiscovery = Boolean.valueOf(tmp);
// Get the 'versionsSupported' attribute
@@ -576,14 +580,13 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
convertToId = SafeStringInterner.safeIntern(element.getAttribute(CONVERT_TO_ID));
tmp = element.getAttribute(SUPPORTS_MANAGED_BUILD);
- if(tmp != null)
+ if (tmp != null)
supportsManagedBuild = Boolean.valueOf(tmp);
tmp = element.getAttribute(IS_SYSTEM);
- if(tmp != null)
+ if (tmp != null)
isTest = Boolean.valueOf(tmp).booleanValue();
-
// Get the comma-separated list of valid OS
String os = element.getAttribute(OS_LIST);
if (os != null) {
@@ -607,31 +610,30 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
// Get the isToolchainSupported configuration element
String managedIsToolChainSupported = element.getAttribute(IS_TOOL_CHAIN_SUPPORTED);
if (managedIsToolChainSupported != null && element instanceof DefaultManagedConfigElement) {
- managedIsToolChainSupportedElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
+ managedIsToolChainSupportedElement = ((DefaultManagedConfigElement) element).getConfigurationElement();
}
// Get the environmentVariableSupplier configuration element
String environmentVariableSupplier = element.getAttribute(CONFIGURATION_ENVIRONMENT_SUPPLIER);
- if(environmentVariableSupplier != null && element instanceof DefaultManagedConfigElement){
- environmentVariableSupplierElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
+ if (environmentVariableSupplier != null && element instanceof DefaultManagedConfigElement) {
+ environmentVariableSupplierElement = ((DefaultManagedConfigElement) element).getConfigurationElement();
}
// Get the configurationMacroSupplier configuration element
String buildMacroSupplier = element.getAttribute(CONFIGURATION_MACRO_SUPPLIER);
- if(buildMacroSupplier != null && element instanceof DefaultManagedConfigElement){
- buildMacroSupplierElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
+ if (buildMacroSupplier != null && element instanceof DefaultManagedConfigElement) {
+ buildMacroSupplierElement = ((DefaultManagedConfigElement) element).getConfigurationElement();
}
// optionPathConverter
String pathconverterTypeName = element.getAttribute(ITool.OPTIONPATHCONVERTER);
if (pathconverterTypeName != null && element instanceof DefaultManagedConfigElement) {
- pathconverterElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
+ pathconverterElement = ((DefaultManagedConfigElement) element).getConfigurationElement();
}
nonInternalBuilderId = SafeStringInterner.safeIntern(element.getAttribute(NON_INTERNAL_BUILDER_ID));
}
-
/**
* Initialize the tool-chain information from the XML element
* specified in the argument
@@ -654,7 +656,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
// superClass
superClassId = SafeStringInterner.safeIntern(element.getAttribute(IProjectType.SUPERCLASS));
if (superClassId != null && superClassId.length() > 0) {
- setSuperClassInternal( ManagedBuildManager.getExtensionToolChain(superClassId) );
+ setSuperClassInternal(ManagedBuildManager.getExtensionToolChain(superClassId));
// Check for migration support
checkForMigrationSupport();
}
@@ -667,7 +669,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
// isAbstract
if (element.getAttribute(IProjectType.IS_ABSTRACT) != null) {
String isAbs = element.getAttribute(IProjectType.IS_ABSTRACT);
- if (isAbs != null){
+ if (isAbs != null) {
isAbstract = Boolean.parseBoolean(isAbs);
}
}
@@ -689,7 +691,8 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
// Get the scanner config discovery profile id
if (element.getAttribute(SCANNER_CONFIG_PROFILE_ID) != null) {
- scannerConfigDiscoveryProfileId = SafeStringInterner.safeIntern(element.getAttribute(SCANNER_CONFIG_PROFILE_ID));
+ scannerConfigDiscoveryProfileId = SafeStringInterner
+ .safeIntern(element.getAttribute(SCANNER_CONFIG_PROFILE_ID));
}
// Get the 'versionSupported' attribute
@@ -735,12 +738,12 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
// Get the scanner config discovery profile id
scannerConfigDiscoveryProfileId = element.getAttribute(SCANNER_CONFIG_PROFILE_ID);
String tmp = element.getAttribute(RESOURCE_TYPE_BASED_DISCOVERY);
- if(tmp != null)
+ if (tmp != null)
isRcTypeBasedDiscovery = Boolean.valueOf(tmp);
nonInternalBuilderId = SafeStringInterner.safeIntern(element.getAttribute(NON_INTERNAL_BUILDER_ID));
-// String tmp = element.getAttribute(name)
+ // String tmp = element.getAttribute(name)
}
/**
@@ -825,7 +828,8 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
// Serialize my children
if (targetPlatform != null) {
- ICStorageElement targetPlatformElement = element.createChild(ITargetPlatform.TARGET_PLATFORM_ELEMENT_NAME);
+ ICStorageElement targetPlatformElement = element
+ .createChild(ITargetPlatform.TARGET_PLATFORM_ELEMENT_NAME);
targetPlatform.serialize(targetPlatformElement);
}
if (builder != null) {
@@ -845,21 +849,21 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
// Note: environmentVariableSupplier cannot be specified in a project file because
// an IConfigurationElement is needed to load it!
- if(environmentVariableSupplierElement != null) {
+ if (environmentVariableSupplierElement != null) {
// TODO: issue warning?
}
// Note: buildMacroSupplier cannot be specified in a project file because
// an IConfigurationElement is needed to load it!
- if(buildMacroSupplierElement != null) {
+ if (buildMacroSupplierElement != null) {
// TODO: issue warning?
}
//serialize user-defined macros
-// if(userDefinedMacros != null){
-// ICStorageElement macrosElement = element.createChild(StorableMacros.MACROS_ELEMENT_NAME);
-// userDefinedMacros.serialize(macrosElement);
-// }
+ // if(userDefinedMacros != null){
+ // ICStorageElement macrosElement = element.createChild(StorableMacros.MACROS_ELEMENT_NAME);
+ // userDefinedMacros.serialize(macrosElement);
+ // }
// Note: optionPathConverter cannot be specified in a project file because
// an IConfigurationElement is needed to load it!
@@ -867,16 +871,15 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
// TODO: issue warning?
}
-// if(userDefinedEnvironment != null)
-// EnvironmentVariableProvider.fUserSupplier.storeEnvironment(getParent(),true);
+ // if(userDefinedEnvironment != null)
+ // EnvironmentVariableProvider.fUserSupplier.storeEnvironment(getParent(),true);
- if(nonInternalBuilderId != null)
+ if (nonInternalBuilderId != null)
element.setAttribute(NON_INTERNAL_BUILDER_ID, nonInternalBuilderId);
-
- if(scannerConfigDiscoveryProfileId != null)
+ if (scannerConfigDiscoveryProfileId != null)
element.setAttribute(SCANNER_CONFIG_PROFILE_ID, scannerConfigDiscoveryProfileId);
- if(isRcTypeBasedDiscovery != null)
+ if (isRcTypeBasedDiscovery != null)
element.setAttribute(RESOURCE_TYPE_BASED_DISCOVERY, isRcTypeBasedDiscovery.toString());
saveRebuildState();
@@ -897,7 +900,8 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
}
@Override
- public ITargetPlatform createTargetPlatform(ITargetPlatform superClass, String id, String name, boolean isExtensionElement) {
+ public ITargetPlatform createTargetPlatform(ITargetPlatform superClass, String id, String name,
+ boolean isExtensionElement) {
targetPlatform = new TargetPlatform(this, superClass, id, name, isExtensionElement);
setDirty(true);
return targetPlatform;
@@ -915,7 +919,8 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
@Override
public void removeLocalTargetPlatform() {
- if (targetPlatform == null) return;
+ if (targetPlatform == null)
+ return;
targetPlatform = null;
setDirty(true);
}
@@ -927,7 +932,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
return builder;
}
- public void setBuilder(Builder builder){
+ public void setBuilder(Builder builder) {
this.builder = builder;
}
@@ -943,7 +948,8 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
@Override
public void removeLocalBuilder() {
- if (builder == null) return;
+ if (builder == null)
+ return;
builder = null;
setDirty(true);
}
@@ -959,9 +965,9 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
@Override
public ITool[] getTools() {
ITool tools[] = getAllTools(false);
- if(!isExtensionToolChain){
- for(int i = 0; i < tools.length; i++){
- if(tools[i].isExtensionElement()){
+ if (!isExtensionToolChain) {
+ for (int i = 0; i < tools.length; i++) {
+ if (tools[i].isExtensionElement()) {
String subId = ManagedBuildManager.calculateChildId(tools[i].getId(), null);
tools[i] = createTool(tools[i], subId, tools[i].getName(), false);
}
@@ -975,7 +981,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
Tool[] tools = null;
// Merge our tools with our superclass' tools
if (getSuperClass() != null) {
- tools = ((ToolChain)getSuperClass()).getAllTools(false);
+ tools = ((ToolChain) getSuperClass()).getAllTools(false);
}
// Our tools take precedence
if (tools != null) {
@@ -983,9 +989,9 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
int j = 0;
for (; j < tools.length; j++) {
ITool superTool = tool.getSuperClass();
- if(superTool != null){
+ if (superTool != null) {
superTool = ManagedBuildManager.getExtensionTool(superTool);
- if(superTool != null && superTool.getId().equals(tools[j].getId())){
+ if (superTool != null && superTool.getId().equals(tools[j].getId())) {
tools[j] = tool;
break;
}
@@ -1002,20 +1008,20 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
}
}
-// if(!isExtensionToolChain){
-// for(int i = 0; i < tools.length; i++){
-// if(tools[i].getParent() != this){
-// ArrayList list = new ArrayList(Arrays.asList(tools));
-// for(int k = 0; k < list.size(); k++){
-// if(((ITool)list.get(k)).getParent() != this){
-// list.remove(k);
-// }
-// }
-// tools = (ITool[])list.toArray(new ITool[list.size()]);
-// break;
-// }
-// }
-// }
+ // if(!isExtensionToolChain){
+ // for(int i = 0; i < tools.length; i++){
+ // if(tools[i].getParent() != this){
+ // ArrayList list = new ArrayList(Arrays.asList(tools));
+ // for(int k = 0; k < list.size(); k++){
+ // if(((ITool)list.get(k)).getParent() != this){
+ // list.remove(k);
+ // }
+ // }
+ // tools = (ITool[])list.toArray(new ITool[list.size()]);
+ // break;
+ // }
+ // }
+ // }
} else {
tools = new Tool[getToolList().size()];
int i = 0;
@@ -1023,25 +1029,25 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
tools[i++] = tool;
}
}
- if(includeCurrentUnused)
+ if (includeCurrentUnused)
return tools;
return filterUsedTools(tools, true);
}
- private Tool[] filterUsedTools(Tool tools[], boolean used){
+ private Tool[] filterUsedTools(Tool tools[], boolean used) {
Set<String> set = getUnusedChilrenSet();
- if(set.size() == 0)
+ if (set.size() == 0)
return used ? tools : new Tool[0];
List<Tool> list = new ArrayList<Tool>(tools.length);
- for(Tool t : tools){
- if(set.contains(t.getId()) != used)
+ for (Tool t : tools) {
+ if (set.contains(t.getId()) != used)
list.add(t);
}
return list.toArray(new Tool[list.size()]);
}
- public Tool[] getUnusedTools(){
+ public Tool[] getUnusedTools() {
Tool[] all = getAllTools(true);
return filterUsedTools(all, false);
}
@@ -1069,7 +1075,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
} while (tool != null);
}
}
- return retTools.toArray( new ITool[retTools.size()]);
+ return retTools.toArray(new ITool[retTools.size()]);
}
/**
@@ -1104,7 +1110,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
getToolMap().put(tool.getId(), tool);
}
- void setToolsInternal(ITool[] tools){
+ void setToolsInternal(ITool[] tools) {
List<Tool> list = getToolList();
Map<String, Tool> map = getToolMap();
@@ -1112,16 +1118,16 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
map.clear();
for (ITool t : tools) {
- list.add((Tool)t);
- map.put(t.getId(), (Tool)t);
+ list.add((Tool) t);
+ map.put(t.getId(), (Tool) t);
}
}
- public void removeTool(Tool tool){
+ public void removeTool(Tool tool) {
getToolList().remove(tool);
getToolMap().remove(tool.getId());
ITool extTool = ManagedBuildManager.getExtensionTool(tool);
- if(extTool.getParent() == getSuperClass())
+ if (extTool.getParent() == getSuperClass())
addUnusedChild(extTool);
}
@@ -1131,7 +1137,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
@Override
public IToolChain getSuperClass() {
- return (IToolChain)superClass;
+ return (IToolChain) superClass;
}
/**
@@ -1143,15 +1149,15 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
}
public void setSuperClass(IToolChain superClass) {
- if ( this.superClass != superClass ) {
+ if (this.superClass != superClass) {
this.superClass = superClass;
- if ( this.superClass == null) {
+ if (this.superClass == null) {
superClassId = null;
} else {
superClassId = this.superClass.getId();
}
- if(!isExtensionElement())
+ if (!isExtensionElement())
setDirty(true);
}
}
@@ -1166,7 +1172,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
if (isAbstract != null) {
return isAbstract.booleanValue();
} else {
- return false; // Note: no inheritance from superClass
+ return false; // Note: no inheritance from superClass
}
}
@@ -1175,7 +1181,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
if (unusedChildren != null) {
return unusedChildren;
} else
- return EMPTY_STRING; // Note: no inheritance from superClass
+ return EMPTY_STRING; // Note: no inheritance from superClass
}
@Override
@@ -1212,7 +1218,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
if (ids == null) {
// If I have a superClass, ask it
if (getSuperClass() != null) {
- ids = ((ToolChain)getSuperClass()).getErrorParserIdsAttribute();
+ ids = ((ToolChain) getSuperClass()).getErrorParserIdsAttribute();
}
}
return ids;
@@ -1225,8 +1231,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
if (ids == null) {
if (getSuperClass() != null) {
return getSuperClass().getSecondaryOutputs();
- }
- else {
+ } else {
return new IOutputType[0];
}
}
@@ -1236,7 +1241,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
int i = 0;
while (tok.hasMoreElements()) {
String id = tok.nextToken();
- for (int j=0; j<tools.length; j++) {
+ for (int j = 0; j < tools.length; j++) {
IOutputType type;
type = tools[j].getOutputTypeById(id);
if (type != null) {
@@ -1275,7 +1280,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
while (tok.hasMoreElements()) {
list.add(tok.nextToken());
}
- String[] strArr = {""}; //$NON-NLS-1$
+ String[] strArr = { "" }; //$NON-NLS-1$
targetTools = list.toArray(strArr);
}
} else {
@@ -1329,7 +1334,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
while (tok.hasMoreElements()) {
list.add(tok.nextToken());
}
- String[] strArr = {""}; //$NON-NLS-1$
+ String[] strArr = { "" }; //$NON-NLS-1$
errorParsers = list.toArray(strArr);
}
} else {
@@ -1338,12 +1343,12 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
return errorParsers;
}
- public Set<String> contributeErrorParsers(FolderInfo info, Set<String> set, boolean includeChildren){
+ public Set<String> contributeErrorParsers(FolderInfo info, Set<String> set, boolean includeChildren) {
String parserIDs = getErrorParserIdsAttribute();
- if (parserIDs != null){
- if(set == null)
+ if (parserIDs != null) {
+ if (set == null)
set = new HashSet<String>();
- if(parserIDs.length() != 0) {
+ if (parserIDs.length() != 0) {
StringTokenizer tok = new StringTokenizer(parserIDs, ";"); //$NON-NLS-1$
while (tok.hasMoreElements()) {
set.add(tok.nextToken());
@@ -1351,12 +1356,12 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
}
}
- if(includeChildren){
+ if (includeChildren) {
ITool tools[] = info.getFilteredTools();
set = info.contributeErrorParsers(tools, set);
- if(info.isRoot()){
- Builder builder = (Builder)getBuilder();
+ if (info.isRoot()) {
+ Builder builder = (Builder) getBuilder();
set = builder.contributeErrorParsers(set);
}
}
@@ -1371,7 +1376,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
return getSuperClass().getArchList();
} else {
// I have no superClass and no defined list
- return new String[] {"all"}; //$NON-NLS-1$
+ return new String[] { "all" }; //$NON-NLS-1$
}
}
return archList.toArray(new String[archList.size()]);
@@ -1385,7 +1390,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
return getSuperClass().getOSList();
} else {
// I have no superClass and no defined filter list
- return new String[] {"all"}; //$NON-NLS-1$
+ return new String[] { "all" }; //$NON-NLS-1$
}
}
return osList.toArray(new String[osList.size()]);
@@ -1400,7 +1405,8 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
@Override
public void setErrorParserIds(String ids) {
String currentIds = getErrorParserIds();
- if (ids == null && currentIds == null) return;
+ if (ids == null && currentIds == null)
+ return;
if (currentIds == null || ids == null || !(currentIds.equals(ids))) {
errorParserIds = ids;
isDirty = true;
@@ -1409,7 +1415,8 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
@Override
public void setSecondaryOutputs(String newIds) {
- if (secondaryOutputIds == null && newIds == null) return;
+ if (secondaryOutputIds == null && newIds == null)
+ return;
if (secondaryOutputIds == null || newIds == null || !newIds.equals(secondaryOutputIds)) {
secondaryOutputIds = newIds;
isDirty = true;
@@ -1418,7 +1425,8 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
@Override
public void setTargetToolIds(String newIds) {
- if (targetToolIds == null && newIds == null) return;
+ if (targetToolIds == null && newIds == null)
+ return;
if (targetToolIds == null || newIds == null || !newIds.equals(targetToolIds)) {
targetToolIds = newIds;
isDirty = true;
@@ -1519,9 +1527,9 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
@Override
public void setScannerConfigDiscoveryProfileId(String profileId) {
- if (scannerConfigDiscoveryProfileId == null && profileId == null) return;
- if (scannerConfigDiscoveryProfileId == null ||
- !scannerConfigDiscoveryProfileId.equals(profileId)) {
+ if (scannerConfigDiscoveryProfileId == null && profileId == null)
+ return;
+ if (scannerConfigDiscoveryProfileId == null || !scannerConfigDiscoveryProfileId.equals(profileId)) {
scannerConfigDiscoveryProfileId = profileId;
setDirty(true);
}
@@ -1537,27 +1545,27 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
@Override
public IOptionPathConverter getOptionPathConverter() {
if (optionPathConverter != null) {
- return optionPathConverter ;
+ return optionPathConverter;
}
IConfigurationElement element = getPathconverterElement();
if (element != null) {
try {
if (element.getAttribute(ITool.OPTIONPATHCONVERTER) != null) {
- optionPathConverter = (IOptionPathConverter) element.createExecutableExtension(ITool.OPTIONPATHCONVERTER);
+ optionPathConverter = (IOptionPathConverter) element
+ .createExecutableExtension(ITool.OPTIONPATHCONVERTER);
return optionPathConverter;
}
- } catch (CoreException e) {}
- } else {
+ } catch (CoreException e) {
+ }
+ } else {
if (getSuperClass() != null) {
IToolChain superTool = getSuperClass();
- return superTool.getOptionPathConverter() ;
+ return superTool.getOptionPathConverter();
}
}
- return null ;
+ return null;
}
-
-
/*
* O B J E C T S T A T E M A I N T E N A N C E
*/
@@ -1570,19 +1578,21 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
@Override
public boolean isDirty() {
// This shouldn't be called for an extension tool-chain
- if (isExtensionToolChain) return false;
+ if (isExtensionToolChain)
+ return false;
// If I need saving, just say yes
- if (isDirty) return true;
+ if (isDirty)
+ return true;
//check whether the tool-chain - specific macros are dirty
-// if(userDefinedMacros != null && userDefinedMacros.isDirty())
-// return true;
+ // if(userDefinedMacros != null && userDefinedMacros.isDirty())
+ // return true;
-// if(userDefinedEnvironment != null && userDefinedEnvironment.isDirty())
-// return true;
+ // if(userDefinedEnvironment != null && userDefinedEnvironment.isDirty())
+ // return true;
- if(builder != null && builder.isDirty())
+ if (builder != null && builder.isDirty())
return true;
// Otherwise see if any tools need saving
@@ -1623,15 +1633,13 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
setSuperClassInternal(ManagedBuildManager.getExtensionToolChain(superClassId));
if (getSuperClass() == null) {
// Report error
- ManagedBuildManager.outputResolveError(
- "superClass", //$NON-NLS-1$
- superClassId,
- "toolChain", //$NON-NLS-1$
+ ManagedBuildManager.outputResolveError("superClass", //$NON-NLS-1$
+ superClassId, "toolChain", //$NON-NLS-1$
getId());
} else {
// All of our superclasses must be resolved in order to properly
// resolve options to option categories
- ((ToolChain)getSuperClass()).resolveReferences();
+ ((ToolChain) getSuperClass()).resolveReferences();
}
}
// Resolve HoldsOptions
@@ -1654,7 +1662,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
* manifest file. In a post 2.1 manifest, all tools must have a specifed output extension, even
* if it is "")
*/
- public void normalizeOutputExtensions(){
+ public void normalizeOutputExtensions() {
ITool[] tools = getTools();
if (tools != null) {
for (int i = 0; i < tools.length; i++) {
@@ -1664,7 +1672,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
tool.setOutputsAttribute(""); //$NON-NLS-1$
continue;
}
- if (extensions.length == 0){
+ if (extensions.length == 0) {
tool.setOutputsAttribute(""); //$NON-NLS-1$
continue;
}
@@ -1687,7 +1695,8 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
@Override
public void setConvertToId(String convertToId) {
- if (convertToId == null && this.convertToId == null) return;
+ if (convertToId == null && this.convertToId == null)
+ return;
if (convertToId == null || this.convertToId == null || !convertToId.equals(this.convertToId)) {
this.convertToId = convertToId;
setDirty(true);
@@ -1710,39 +1719,43 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
@Override
public void setVersionsSupported(String versionsSupported) {
- if (versionsSupported == null && this.versionsSupported == null) return;
- if (versionsSupported == null || this.versionsSupported == null || !versionsSupported.equals(this.versionsSupported)) {
+ if (versionsSupported == null && this.versionsSupported == null)
+ return;
+ if (versionsSupported == null || this.versionsSupported == null
+ || !versionsSupported.equals(this.versionsSupported)) {
this.versionsSupported = versionsSupported;
setDirty(true);
}
return;
}
- private IConfigurationElement getIsToolChainSupportedElement(){
+ private IConfigurationElement getIsToolChainSupportedElement() {
if (managedIsToolChainSupportedElement == null) {
if (superClass != null && superClass instanceof ToolChain) {
- return ((ToolChain)superClass).getIsToolChainSupportedElement();
+ return ((ToolChain) superClass).getIsToolChainSupportedElement();
}
}
return managedIsToolChainSupportedElement;
}
@Override
- public boolean isSupported(){
+ public boolean isSupported() {
if (managedIsToolChainSupported == null) {
IConfigurationElement element = getIsToolChainSupportedElement();
if (element != null) {
try {
if (element.getAttribute(IS_TOOL_CHAIN_SUPPORTED) != null) {
- managedIsToolChainSupported = (IManagedIsToolChainSupported) element.createExecutableExtension(IS_TOOL_CHAIN_SUPPORTED);
+ managedIsToolChainSupported = (IManagedIsToolChainSupported) element
+ .createExecutableExtension(IS_TOOL_CHAIN_SUPPORTED);
}
- } catch (CoreException e) {}
+ } catch (CoreException e) {
+ }
}
}
if (managedIsToolChainSupported != null) {
try {
- return managedIsToolChainSupported.isSupported(this,null,null);
+ return managedIsToolChainSupported.isSupported(this, null, null);
} catch (Throwable e) {
ManagedBuilderCorePlugin.log(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID,
"Exception in toolchain [" + getName() + "], id=" + getId(), e)); //$NON-NLS-1$ //$NON-NLS-2$
@@ -1757,18 +1770,17 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
*
* @return IConfigurationElement
*/
- public IConfigurationElement getEnvironmentVariableSupplierElement(){
+ public IConfigurationElement getEnvironmentVariableSupplierElement() {
if (environmentVariableSupplierElement == null) {
if (getSuperClass() != null && getSuperClass() instanceof ToolChain) {
- return ((ToolChain)getSuperClass()).getEnvironmentVariableSupplierElement();
+ return ((ToolChain) getSuperClass()).getEnvironmentVariableSupplierElement();
}
}
return environmentVariableSupplierElement;
}
-
@Override
- public IConfigurationEnvironmentVariableSupplier getEnvironmentVariableSupplier(){
+ public IConfigurationEnvironmentVariableSupplier getEnvironmentVariableSupplier() {
if (environmentVariableSupplier != null) {
return environmentVariableSupplier;
}
@@ -1776,57 +1788,57 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
if (element != null) {
try {
if (element.getAttribute(CONFIGURATION_ENVIRONMENT_SUPPLIER) != null) {
- environmentVariableSupplier = (IConfigurationEnvironmentVariableSupplier) element.createExecutableExtension(CONFIGURATION_ENVIRONMENT_SUPPLIER);
+ environmentVariableSupplier = (IConfigurationEnvironmentVariableSupplier) element
+ .createExecutableExtension(CONFIGURATION_ENVIRONMENT_SUPPLIER);
return environmentVariableSupplier;
}
- } catch (CoreException e) {}
+ } catch (CoreException e) {
+ }
}
return null;
}
-// /*
-// * this method is called by the UserDefinedMacroSupplier to obtain user-defined
-// * macros available for this tool-chain
-// */
-// public StorableMacros getUserDefinedMacros(){
-// if(isExtensionToolChain)
-// return null;
-//
-// if(userDefinedMacros == null)
-// userDefinedMacros = new StorableMacros();
-// return userDefinedMacros;
-// }
-
-// public StorableEnvironment getUserDefinedEnvironment(){
-// if(isExtensionToolChain)
-// return null;
-//
-// return userDefinedEnvironment;
-// }
-
-// public void setUserDefinedEnvironment(StorableEnvironment env){
-// if(!isExtensionToolChain)
-// userDefinedEnvironment = env;
-// }
-
+ // /*
+ // * this method is called by the UserDefinedMacroSupplier to obtain user-defined
+ // * macros available for this tool-chain
+ // */
+ // public StorableMacros getUserDefinedMacros(){
+ // if(isExtensionToolChain)
+ // return null;
+ //
+ // if(userDefinedMacros == null)
+ // userDefinedMacros = new StorableMacros();
+ // return userDefinedMacros;
+ // }
+
+ // public StorableEnvironment getUserDefinedEnvironment(){
+ // if(isExtensionToolChain)
+ // return null;
+ //
+ // return userDefinedEnvironment;
+ // }
+
+ // public void setUserDefinedEnvironment(StorableEnvironment env){
+ // if(!isExtensionToolChain)
+ // userDefinedEnvironment = env;
+ // }
/**
* Returns the plugin.xml element of the configurationMacroSupplier extension or <code>null</code> if none.
*
* @return IConfigurationElement
*/
- public IConfigurationElement getBuildMacroSupplierElement(){
+ public IConfigurationElement getBuildMacroSupplierElement() {
if (buildMacroSupplierElement == null) {
if (superClass != null && superClass instanceof ToolChain) {
- return ((ToolChain)superClass).getBuildMacroSupplierElement();
+ return ((ToolChain) superClass).getBuildMacroSupplierElement();
}
}
return buildMacroSupplierElement;
}
-
@Override
- public IConfigurationBuildMacroSupplier getBuildMacroSupplier(){
+ public IConfigurationBuildMacroSupplier getBuildMacroSupplier() {
if (buildMacroSupplier != null) {
return buildMacroSupplier;
}
@@ -1834,10 +1846,12 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
if (element != null) {
try {
if (element.getAttribute(CONFIGURATION_MACRO_SUPPLIER) != null) {
- buildMacroSupplier = (IConfigurationBuildMacroSupplier) element.createExecutableExtension(CONFIGURATION_MACRO_SUPPLIER);
+ buildMacroSupplier = (IConfigurationBuildMacroSupplier) element
+ .createExecutableExtension(CONFIGURATION_MACRO_SUPPLIER);
return buildMacroSupplier;
}
- } catch (CoreException e) {}
+ } catch (CoreException e) {
+ }
}
return null;
}
@@ -1859,8 +1873,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
SortedMap<String, ? extends IToolChain> subMap = null;
if (superClassId.compareTo(high) <= 0) {
- subMap = ManagedBuildManager.getExtensionToolChainMap().subMap(
- superClassId, high + "\0"); //$NON-NLS-1$
+ subMap = ManagedBuildManager.getExtensionToolChainMap().subMap(superClassId, high + "\0"); //$NON-NLS-1$
} else {
// It means there are no entries in the map for the given id.
// make the project is invalid
@@ -1885,19 +1898,16 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
for (int i = 0; i < toolChainElements.length; i++) {
IToolChain toolChainElement = toolChainElements[i];
- if (ManagedBuildManager.getIdFromIdAndVersion(
- toolChainElement.getId()).compareTo(baseId) > 0)
+ if (ManagedBuildManager.getIdFromIdAndVersion(toolChainElement.getId()).compareTo(baseId) > 0)
break;
// First check if both base ids are equal
- if (ManagedBuildManager.getIdFromIdAndVersion(
- toolChainElement.getId()).equals(baseId)) {
+ if (ManagedBuildManager.getIdFromIdAndVersion(toolChainElement.getId()).equals(baseId)) {
// Check if 'versionsSupported' attribute is available'
String versionsSupported = toolChainElement.getVersionsSupported();
- if ((versionsSupported != null)
- && (!versionsSupported.isEmpty())) {
+ if ((versionsSupported != null) && (!versionsSupported.isEmpty())) {
String[] tmpVersions = versionsSupported.split(","); //$NON-NLS-1$
for (int j = 0; j < tmpVersions.length; j++) {
@@ -1906,10 +1916,9 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
// Do the automatic conversion without
// prompting the user.
// Get the supported version
- String supportedVersion = ManagedBuildManager.getVersionFromIdAndVersion(
- toolChainElement.getId());
- setId(ManagedBuildManager.getIdFromIdAndVersion(getId())
- + "_" + supportedVersion); //$NON-NLS-1$
+ String supportedVersion = ManagedBuildManager
+ .getVersionFromIdAndVersion(toolChainElement.getId());
+ setId(ManagedBuildManager.getIdFromIdAndVersion(getId()) + "_" + supportedVersion); //$NON-NLS-1$
// If control comes here means that 'superClass' is null
// So, set the superClass to this toolChain element
@@ -1919,8 +1928,8 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
break;
}
}
- if(isExists)
- break; // break the outer for loop if 'isExists' is true
+ if (isExists)
+ break; // break the outer for loop if 'isExists' is true
}
}
}
@@ -1962,16 +1971,15 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
String toId = null;
// Get the Converter Extension Point
- IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
- .getExtensionPoint("org.eclipse.cdt.managedbuilder.core", //$NON-NLS-1$
- "projectConverter"); //$NON-NLS-1$
+ IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(
+ "org.eclipse.cdt.managedbuilder.core", //$NON-NLS-1$
+ "projectConverter"); //$NON-NLS-1$
if (extensionPoint != null) {
// Get the extensions
IExtension[] extensions = extensionPoint.getExtensions();
for (int i = 0; i < extensions.length; i++) {
// Get the configuration elements of each extension
- IConfigurationElement[] configElements = extensions[i]
- .getConfigurationElements();
+ IConfigurationElement[] configElements = extensions[i].getConfigurationElements();
for (int j = 0; j < configElements.length; j++) {
IConfigurationElement element = configElements[j];
@@ -1983,16 +1991,13 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
// Check whether the current converter can be used for
// the selected toolchain
- if (fromId.equals(getSuperClass().getId())
- && toId.equals(convertToId)) {
+ if (fromId.equals(getSuperClass().getId()) && toId.equals(convertToId)) {
// If it matches
- String mbsVersion = element
- .getAttribute("mbsVersion"); //$NON-NLS-1$
- Version currentMbsVersion = ManagedBuildManager
- .getBuildInfoVersion();
+ String mbsVersion = element.getAttribute("mbsVersion"); //$NON-NLS-1$
+ Version currentMbsVersion = ManagedBuildManager.getBuildInfoVersion();
// set the converter element based on the MbsVersion
- if (currentMbsVersion.compareTo(new Version(mbsVersion))>0) {
+ if (currentMbsVersion.compareTo(new Version(mbsVersion)) > 0) {
previousMbsVersionConversionElement = element;
} else {
currentMbsVersionConversionElement = element;
@@ -2016,7 +2021,6 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
}
}
-
public IConfigurationElement getPreviousMbsVersionConversionElement() {
return previousMbsVersionConversionElement;
}
@@ -2026,24 +2030,24 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
}
@Override
- public void updateManagedBuildRevision(String revision){
+ public void updateManagedBuildRevision(String revision) {
super.updateManagedBuildRevision(revision);
for (Tool t : getToolList())
t.updateManagedBuildRevision(revision);
- if(builder != null)
+ if (builder != null)
builder.updateManagedBuildRevision(revision);
}
@Override
public boolean needsRebuild() {
- if(rebuildState)
+ if (rebuildState)
return true;
ITool tools[] = getTools();
- for(int i = 0; i < tools.length; i++){
- if(tools[i].needsRebuild())
+ for (int i = 0; i < tools.length; i++) {
+ if (tools[i].needsRebuild())
return true;
}
@@ -2052,26 +2056,26 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
@Override
public void setRebuildState(boolean rebuild) {
- if(isExtensionElement() && rebuild)
+ if (isExtensionElement() && rebuild)
return;
- if(rebuildState != rebuild){
+ if (rebuildState != rebuild) {
rebuildState = rebuild;
saveRebuildState();
}
- if(!rebuild){
+ if (!rebuild) {
super.setRebuildState(false);
ITool tools[] = getTools();
- for(int i = 0; i < tools.length; i++){
+ for (int i = 0; i < tools.length; i++) {
tools[i].setRebuildState(false);
}
}
}
- private void saveRebuildState(){
- if(((Configuration)config).isPreference())
+ private void saveRebuildState() {
+ if (((Configuration) config).isPreference())
return;
PropertyManager.getInstance().setProperty(this, REBUILD_STATE, Boolean.toString(needsRebuild()));
}
@@ -2081,28 +2085,29 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
return parentFolderInfo;
}
- void setTargetPlatform(TargetPlatform tp){
+ void setTargetPlatform(TargetPlatform tp) {
targetPlatform = tp;
}
@Override
public CTargetPlatformData getTargetPlatformData() {
- if(isExtensionToolChain)
+ if (isExtensionToolChain)
return null;
- if(targetPlatform == null){
+ if (targetPlatform == null) {
ITargetPlatform platform = getTargetPlatform();
- if(platform != null){
+ if (platform != null) {
ITargetPlatform extPlatform = platform;
- for(;extPlatform != null && !extPlatform.isExtensionElement();extPlatform = extPlatform.getSuperClass()) {
+ for (; extPlatform != null
+ && !extPlatform.isExtensionElement(); extPlatform = extPlatform.getSuperClass()) {
// No body, this loop is to find extension element
}
String subId;
- if(extPlatform != null)
+ if (extPlatform != null)
subId = ManagedBuildManager.calculateChildId(extPlatform.getId(), null);
else
subId = ManagedBuildManager.calculateChildId(getId(), null);
- targetPlatform = new TargetPlatform(this, subId, platform.getName(), (TargetPlatform)extPlatform);
+ targetPlatform = new TargetPlatform(this, subId, platform.getName(), (TargetPlatform) extPlatform);
} else {
String subId = ManagedBuildManager.calculateChildId(getId(), null);
targetPlatform = new TargetPlatform(this, null, subId, "", false); //$NON-NLS-1$
@@ -2115,21 +2120,21 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
public boolean supportsType(String type, boolean checkTools) {
SupportedProperties props = findSupportedProperties();
boolean supports = false;
- if(props != null){
+ if (props != null) {
supports = props.supportsType(type);
} else {
BooleanExpressionApplicabilityCalculator calc = getBooleanExpressionCalculator();
- if(calc != null){
+ if (calc != null) {
supports = calc.referesProperty(type);
}
- if(!supports)
+ if (!supports)
supports = super.supportsType(type);
}
- if(!supports && checkTools){
+ if (!supports && checkTools) {
ITool tools[] = getTools();
- for(int i = 0; i < tools.length; i++){
- if(((Tool)tools[i]).supportsType(type)){
+ for (int i = 0; i < tools.length; i++) {
+ if (((Tool) tools[i]).supportsType(type)) {
supports = true;
break;
}
@@ -2149,29 +2154,29 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
}
@Override
- public boolean supportsValue(String type, String value){
+ public boolean supportsValue(String type, String value) {
return supportsValue(type, value, true);
}
- public boolean supportsValue(String type, String value, boolean checkTools){
+ public boolean supportsValue(String type, String value, boolean checkTools) {
SupportedProperties props = findSupportedProperties();
boolean supports = false;
- if(props != null){
+ if (props != null) {
supports = props.supportsValue(type, value);
} else {
BooleanExpressionApplicabilityCalculator calc = getBooleanExpressionCalculator();
- if(calc != null){
+ if (calc != null) {
supports = calc.referesPropertyValue(type, value);
}
- if(!supports)
+ if (!supports)
supports = super.supportsValue(type, value);
}
- if(!supports && checkTools){
+ if (!supports && checkTools) {
ITool tools[] = getTools();
- for(int i = 0; i < tools.length; i++){
- if(((Tool)tools[i]).supportsValue(type, value)){
+ for (int i = 0; i < tools.length; i++) {
+ if (((Tool) tools[i]).supportsValue(type, value)) {
supports = true;
break;
}
@@ -2181,30 +2186,29 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
}
@Override
- public boolean supportsValue(IBuildPropertyType type,
- IBuildPropertyValue value) {
+ public boolean supportsValue(IBuildPropertyType type, IBuildPropertyValue value) {
return supportsValue(type.getId(), value.getId());
}
@Override
public void propertiesChanged() {
- if(isExtensionToolChain)
+ if (isExtensionToolChain)
return;
BooleanExpressionApplicabilityCalculator calculator = getBooleanExpressionCalculator();
- if(calculator != null)
+ if (calculator != null)
calculator.adjustToolChain(getParentFolderInfo(), this, false);
super.propertiesChanged();
for (ITool t : getTools())
- ((Tool)t).propertiesChanged();
+ ((Tool) t).propertiesChanged();
}
- public BooleanExpressionApplicabilityCalculator getBooleanExpressionCalculator(){
- if(booleanExpressionCalculator == null){
- if(superClass != null){
- return ((ToolChain)superClass).getBooleanExpressionCalculator();
+ public BooleanExpressionApplicabilityCalculator getBooleanExpressionCalculator() {
+ if (booleanExpressionCalculator == null) {
+ if (superClass != null) {
+ return ((ToolChain) superClass).getBooleanExpressionCalculator();
}
}
return booleanExpressionCalculator;
@@ -2216,44 +2220,44 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
}
@Override
- public boolean matches(IToolChain tc){
- if(tc == this)
+ public boolean matches(IToolChain tc) {
+ if (tc == this)
return true;
IToolChain rTc = ManagedBuildManager.getRealToolChain(this);
- if(rTc == null)
+ if (rTc == null)
return false;
return rTc == ManagedBuildManager.getRealToolChain(tc);
}
@Override
- public List<ToolChain> getIdenticalList(){
+ public List<ToolChain> getIdenticalList() {
return identicalList;//;(ArrayList)identicalToolChainsList.clone();
}
@Override
public boolean supportsBuild(boolean managed) {
- if(!getSupportsManagedBuildAttribute())
+ if (!getSupportsManagedBuildAttribute())
return !managed;
IBuilder builder = getBuilder();
- if(builder != null && !builder.supportsBuild(managed))
+ if (builder != null && !builder.supportsBuild(managed))
return false;
ITool tools[] = getTools();
- for(int i = 0; i < tools.length; i++){
- if(!tools[i].supportsBuild(managed))
+ for (int i = 0; i < tools.length; i++) {
+ if (!tools[i].supportsBuild(managed))
return false;
}
return true;
}
- public boolean getSupportsManagedBuildAttribute(){
- if(supportsManagedBuild == null){
- if(superClass != null){
- return ((ToolChain)superClass).getSupportsManagedBuildAttribute();
+ public boolean getSupportsManagedBuildAttribute() {
+ if (supportsManagedBuild == null) {
+ if (superClass != null) {
+ return ((ToolChain) superClass).getSupportsManagedBuildAttribute();
}
return true;
}
@@ -2262,13 +2266,13 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
@Override
public boolean isSystemObject() {
- if(isTest)
+ if (isTest)
return true;
- if(getConvertToId().length() != 0)
+ if (getConvertToId().length() != 0)
return true;
- if(getParent() != null)
+ if (getParent() != null)
return getParent().isSystemObject();
return false;
@@ -2276,9 +2280,9 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
@Override
public MatchKey<ToolChain> getMatchKey() {
- if(isAbstract())
+ if (isAbstract())
return null;
- if(!isExtensionToolChain)
+ if (!isExtensionToolChain)
return null;
return new MatchKey<ToolChain>(this);
}
@@ -2288,29 +2292,29 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
identicalList = list;
}
- public String getNameAndVersion(){
+ public String getNameAndVersion() {
String name = getName();
String version = ManagedBuildManager.getVersionFromIdAndVersion(getId());
- if(version != null && version.length() != 0){
+ if (version != null && version.length() != 0) {
return new StringBuilder().append(name).append(" (").append(version).append("").toString(); //$NON-NLS-1$ //$NON-NLS-2$
}
return name;
}
- public IConfigurationElement getConverterModificationElement(IToolChain tc){
+ public IConfigurationElement getConverterModificationElement(IToolChain tc) {
Map<String, IConfigurationElement> map = ManagedBuildManager.getConversionElements(this);
IConfigurationElement element = null;
- if(!map.isEmpty()){
- for(IConfigurationElement el : map.values()){
+ if (!map.isEmpty()) {
+ for (IConfigurationElement el : map.values()) {
String toId = el.getAttribute("toId"); //$NON-NLS-1$
IToolChain toTc = tc;
- if(toId != null){
- for(;toTc != null; toTc = toTc.getSuperClass()){
- if(toId.equals(toTc.getId()))
+ if (toId != null) {
+ for (; toTc != null; toTc = toTc.getSuperClass()) {
+ if (toId.equals(toTc.getId()))
break;
}
}
- if(toTc != null){
+ if (toTc != null) {
element = el;
break;
}
@@ -2319,11 +2323,11 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
return element;
}
- public IConfigurationElement getConverterModificationElement(ITool fromTool, ITool toTool){
- return ((Tool)fromTool).getConverterModificationElement(toTool);
+ public IConfigurationElement getConverterModificationElement(ITool fromTool, ITool toTool) {
+ return ((Tool) fromTool).getConverterModificationElement(toTool);
}
- void updateParentFolderInfo(FolderInfo info){
+ void updateParentFolderInfo(FolderInfo info) {
parentFolderInfo = info;
config = parentFolderInfo.getParent();
}
@@ -2336,22 +2340,22 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
public String[] getRequiredTypeIds(boolean checkTools) {
SupportedProperties props = findSupportedProperties();
List<String> result = new ArrayList<String>();
- if(props != null) {
+ if (props != null) {
result.addAll(Arrays.asList(props.getRequiredTypeIds()));
} else {
-// BooleanExpressionApplicabilityCalculator calc = getBooleanExpressionCalculator();
-// if(calc != null){
-// result.addAll(Arrays.asList(calc.getReferencedPropertyIds()));
-// }
+ // BooleanExpressionApplicabilityCalculator calc = getBooleanExpressionCalculator();
+ // if(calc != null){
+ // result.addAll(Arrays.asList(calc.getReferencedPropertyIds()));
+ // }
result.addAll(Arrays.asList(super.getRequiredTypeIds()));
}
//call tools anyway
- if(checkTools){
+ if (checkTools) {
ITool tools[] = getTools();
- for(int i = 0; i < tools.length; i++){
- result.addAll(Arrays.asList(((Tool)tools[i]).getRequiredTypeIds()));
+ for (int i = 0; i < tools.length; i++) {
+ result.addAll(Arrays.asList(((Tool) tools[i]).getRequiredTypeIds()));
}
}
return result.toArray(new String[result.size()]);
@@ -2365,11 +2369,11 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
public String[] getSupportedTypeIds(boolean checkTools) {
SupportedProperties props = findSupportedProperties();
List<String> result = new ArrayList<String>();
- if(props != null) {
+ if (props != null) {
result.addAll(Arrays.asList(props.getSupportedTypeIds()));
} else {
BooleanExpressionApplicabilityCalculator calc = getBooleanExpressionCalculator();
- if(calc != null){
+ if (calc != null) {
result.addAll(Arrays.asList(calc.getReferencedPropertyIds()));
}
@@ -2377,10 +2381,10 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
}
//call tools anyway
- if(checkTools){
+ if (checkTools) {
ITool tools[] = getTools();
- for(int i = 0; i < tools.length; i++){
- result.addAll(Arrays.asList(((Tool)tools[i]).getSupportedTypeIds()));
+ for (int i = 0; i < tools.length; i++) {
+ result.addAll(Arrays.asList(((Tool) tools[i]).getSupportedTypeIds()));
}
}
return result.toArray(new String[result.size()]);
@@ -2394,11 +2398,11 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
public String[] getSupportedValueIds(String typeId, boolean checkTools) {
SupportedProperties props = findSupportedProperties();
List<String> result = new ArrayList<String>();
- if(props != null) {
+ if (props != null) {
result.addAll(Arrays.asList(props.getSupportedValueIds(typeId)));
} else {
BooleanExpressionApplicabilityCalculator calc = getBooleanExpressionCalculator();
- if(calc != null){
+ if (calc != null) {
result.addAll(Arrays.asList(calc.getReferencedValueIds(typeId)));
}
@@ -2406,10 +2410,10 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
}
//call tools anyway
- if(checkTools){
+ if (checkTools) {
ITool tools[] = getTools();
- for(int i = 0; i < tools.length; i++){
- result.addAll(Arrays.asList(((Tool)tools[i]).getSupportedValueIds(typeId)));
+ for (int i = 0; i < tools.length; i++) {
+ result.addAll(Arrays.asList(((Tool) tools[i]).getSupportedValueIds(typeId)));
}
}
return result.toArray(new String[result.size()]);
@@ -2423,17 +2427,17 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
public boolean requiresType(String typeId, boolean checkTools) {
SupportedProperties props = findSupportedProperties();
boolean required = false;
- if(props != null) {
+ if (props != null) {
required = props.requiresType(typeId);
} else {
required = super.requiresType(typeId);
}
//call tools if not found
- if(!required && checkTools){
+ if (!required && checkTools) {
ITool tools[] = getTools();
- for(int i = 0; i < tools.length; i++){
- if(((Tool)tools[i]).requiresType(typeId)){
+ for (int i = 0; i < tools.length; i++) {
+ if (((Tool) tools[i]).requiresType(typeId)) {
required = true;
break;
}
@@ -2442,45 +2446,45 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
return required;
}
- private SupportedProperties findSupportedProperties(){
- if(supportedProperties == null){
- if(superClass != null){
- return ((ToolChain)superClass).findSupportedProperties();
+ private SupportedProperties findSupportedProperties() {
+ if (supportedProperties == null) {
+ if (superClass != null) {
+ return ((ToolChain) superClass).findSupportedProperties();
}
}
return supportedProperties;
}
- private void loadProperties(IManagedConfigElement el){
+ private void loadProperties(IManagedConfigElement el) {
supportedProperties = new SupportedProperties(el);
}
- void setNonInternalBuilderId(String id){
+ void setNonInternalBuilderId(String id) {
nonInternalBuilderId = id;
}
- String getNonInternalBuilderId(){
- if(nonInternalBuilderId == null){
- if(superClass != null){
- return ((ToolChain)superClass).getNonInternalBuilderId();
+ String getNonInternalBuilderId() {
+ if (nonInternalBuilderId == null) {
+ if (superClass != null) {
+ return ((ToolChain) superClass).getNonInternalBuilderId();
}
return null;
}
return nonInternalBuilderId;
}
- public void resetErrorParsers(FolderInfo info){
+ public void resetErrorParsers(FolderInfo info) {
errorParserIds = null;
info.resetErrorParsers(info.getFilteredTools());
- if(info.isRoot()){
- if(builder != null){
+ if (info.isRoot()) {
+ if (builder != null) {
builder.resetErrorParsers();
}
}
}
- void removeErrorParsers(FolderInfo info, Set<String> set){
+ void removeErrorParsers(FolderInfo info, Set<String> set) {
if (set != null && !set.isEmpty()) {
Set<String> oldSet = contributeErrorParsers(info, null, false);
if (oldSet == null)
@@ -2499,14 +2503,14 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
}
public void setErrorParserList(String[] ids) {
- if(ids == null){
+ if (ids == null) {
errorParserIds = null;
- } else if(ids.length == 0){
+ } else if (ids.length == 0) {
errorParserIds = EMPTY_STRING;
} else {
StringBuilder buf = new StringBuilder();
buf.append(ids[0]);
- for(int i = 1; i < ids.length; i++){
+ for (int i = 1; i < ids.length; i++) {
buf.append(";").append(ids[i]); //$NON-NLS-1$
}
errorParserIds = buf.toString();
@@ -2516,11 +2520,11 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
@Override
public String getUniqueRealName() {
String name = getName();
- if(name == null){
+ if (name == null) {
name = getId();
} else {
String version = ManagedBuildManager.getVersionFromIdAndVersion(getId());
- if(version != null){
+ if (version != null) {
StringBuilder buf = new StringBuilder();
buf.append(name);
buf.append(" (v").append(version).append(")"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -2530,84 +2534,84 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
return name;
}
- void resolveProjectReferences(boolean onLoad){
- for(Tool tool : getToolList()){
+ void resolveProjectReferences(boolean onLoad) {
+ for (Tool tool : getToolList()) {
tool.resolveProjectReferences(onLoad);
}
}
- public boolean hasScannerConfigSettings(){
+ public boolean hasScannerConfigSettings() {
- if(getScannerConfigDiscoveryProfileId() != null)
+ if (getScannerConfigDiscoveryProfileId() != null)
return true;
return false;
}
- public boolean isPerRcTypeDiscovery(){
- if(isRcTypeBasedDiscovery == null){
- if(superClass != null){
- return ((ToolChain)superClass).isPerRcTypeDiscovery();
+ public boolean isPerRcTypeDiscovery() {
+ if (isRcTypeBasedDiscovery == null) {
+ if (superClass != null) {
+ return ((ToolChain) superClass).isPerRcTypeDiscovery();
}
return true;
}
return isRcTypeBasedDiscovery.booleanValue();
}
- public void setPerRcTypeDiscovery(boolean on){
+ public void setPerRcTypeDiscovery(boolean on) {
isRcTypeBasedDiscovery = Boolean.valueOf(on);
}
- public PathInfoCache setDiscoveredPathInfo(PathInfoCache info){
+ public PathInfoCache setDiscoveredPathInfo(PathInfoCache info) {
PathInfoCache oldInfo = discoveredInfo;
discoveredInfo = info;
return oldInfo;
}
- public PathInfoCache getDiscoveredPathInfo(){
+ public PathInfoCache getDiscoveredPathInfo() {
return discoveredInfo;
}
- public PathInfoCache clearDiscoveredPathInfo(){
+ public PathInfoCache clearDiscoveredPathInfo() {
PathInfoCache oldInfo = discoveredInfo;
discoveredInfo = null;
return oldInfo;
}
- public boolean isPreferenceToolChain(){
+ public boolean isPreferenceToolChain() {
IToolChain tch = ManagedBuildManager.getRealToolChain(this);
return tch != null && tch.getId().equals(ConfigurationDataProvider.PREF_TC_ID);
}
- public boolean hasCustomSettings(ToolChain tCh){
- if(superClass == null)
+ public boolean hasCustomSettings(ToolChain tCh) {
+ if (superClass == null)
return true;
IToolChain realTc = ManagedBuildManager.getRealToolChain(this);
IToolChain otherRealTc = ManagedBuildManager.getRealToolChain(tCh);
- if(realTc != otherRealTc)
+ if (realTc != otherRealTc)
return true;
- if(hasCustomSettings())
+ if (hasCustomSettings())
return true;
ITool[] tools = getTools();
ITool[] otherTools = tCh.getTools();
- if(tools.length != otherTools.length)
+ 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))
+ 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;
}
- private int getSuperClassNum(){
+ private int getSuperClassNum() {
int num = 0;
- for(IToolChain superTool = getSuperClass(); superTool != null; superTool = superTool.getSuperClass()){
+ for (IToolChain superTool = getSuperClass(); superTool != null; superTool = superTool.getSuperClass()) {
num++;
}
return num;
@@ -2615,16 +2619,16 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
@Override
public int compareTo(ToolChain other) {
- if(other.isSystemObject() != isSystemObject())
+ if (other.isSystemObject() != isSystemObject())
return isSystemObject() ? 1 : -1;
return getSuperClassNum() - other.getSuperClassNum();
}
- private Set<String> getUnusedChilrenSet(){
- if(unusedChildrenSet == null){
+ private Set<String> getUnusedChilrenSet() {
+ if (unusedChildrenSet == null) {
String childIds[] = CDataUtil.stringToArray(unusedChildren, ";"); //$NON-NLS-1$
- if(childIds == null)
+ if (childIds == null)
unusedChildrenSet = new HashSet<String>();
else {
unusedChildrenSet = new HashSet<String>();
@@ -2634,29 +2638,29 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
return unusedChildrenSet;
}
- void addUnusedChild(ITool tool){
+ void addUnusedChild(ITool tool) {
Set<String> set = getUnusedChilrenSet();
set.add(tool.getId());
unusedChildrenSet = set;
unusedChildren = translateUnusedIdSetToString(set);
}
- void setUnusedChildren(String children){
- if(CDataUtil.objectsEqual(unusedChildren, children))
+ void setUnusedChildren(String children) {
+ if (CDataUtil.objectsEqual(unusedChildren, children))
return;
unusedChildrenSet = null;
unusedChildren = children;
}
- private String translateUnusedIdSetToString(Set<String> set){
+ private String translateUnusedIdSetToString(Set<String> set) {
return CDataUtil.arrayToString(set.toArray(), ";"); //$NON-NLS-1$
}
- void addProjectVariables(StorableCdtVariables vars){
- if(vars != null && !vars.isEmpty()){
+ void addProjectVariables(StorableCdtVariables vars) {
+ if (vars != null && !vars.isEmpty()) {
StorableCdtVariables cfgVars = new StorableCdtVariables(vars, false);
- if(userDefinedMacros != null){
+ if (userDefinedMacros != null) {
cfgVars.createMacros(userDefinedMacros.getMacros());
}
@@ -2664,7 +2668,7 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
}
}
- public StorableCdtVariables getResetOldStyleProjectVariables(){
+ public StorableCdtVariables getResetOldStyleProjectVariables() {
StorableCdtVariables vars = userDefinedMacros;
userDefinedMacros = null;
return vars;
@@ -2672,22 +2676,22 @@ public class ToolChain extends HoldsOptions implements IToolChain, IMatchKeyProv
@Override
public IRealBuildObjectAssociation getExtensionObject() {
- return (IRealBuildObjectAssociation)ManagedBuildManager.getExtensionToolChain(this);
+ return (IRealBuildObjectAssociation) ManagedBuildManager.getExtensionToolChain(this);
}
@Override
public IRealBuildObjectAssociation[] getIdenticBuildObjects() {
- return (IRealBuildObjectAssociation[])ManagedBuildManager.findIdenticalToolChains(this);
+ return (IRealBuildObjectAssociation[]) ManagedBuildManager.findIdenticalToolChains(this);
}
@Override
public IRealBuildObjectAssociation getRealBuildObject() {
- return (IRealBuildObjectAssociation)ManagedBuildManager.getRealToolChain(this);
+ return (IRealBuildObjectAssociation) ManagedBuildManager.getRealToolChain(this);
}
@Override
public IRealBuildObjectAssociation getSuperClassObject() {
- return (IRealBuildObjectAssociation)getSuperClass();
+ return (IRealBuildObjectAssociation) getSuperClass();
}
@Override
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChainModificationHelper.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChainModificationHelper.java
index 5083aa0c87c..209f3e3e194 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChainModificationHelper.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolChainModificationHelper.java
@@ -28,78 +28,79 @@ import org.eclipse.cdt.managedbuilder.internal.tcmodification.ToolListMap.Collec
import org.eclipse.core.runtime.IConfigurationElement;
public class ToolChainModificationHelper {
-
- private static ToolListMap createRealToToolMap(ITool[] tools, boolean ext){
+
+ private static ToolListMap createRealToToolMap(ITool[] tools, boolean ext) {
ToolListMap lMap = new ToolListMap();
- for(int i = 0; i < tools.length; i++){
+ for (int i = 0; i < tools.length; i++) {
ITool tool = tools[i];
ITool rt = ManagedBuildManager.getRealTool(tool);
- if(rt == null)
+ if (rt == null)
rt = tool;
ITool t = ext ? ManagedBuildManager.getExtensionTool(tool) : tool;
- if(t == null)
+ if (t == null)
t = tool;
lMap.add(rt, t);
}
-
+
return lMap;
}
-
-// private static ListMap calculateDifference(ListMap m1, ListMap m2){
-// m1 = (ListMap)m1.clone();
-// Set ceSet2 = m2.collectionEntrySet();
-//
-// for(Iterator iter = ceSet2.iterator(); iter.hasNext(); ){
-// CollectionEntry entry = (CollectionEntry)iter.next();
-// Collection c1 = m2.get((ITool) entry.getKey(), false);
-// if(c1 != null){
-// Collection c2 = entry.getValue();
-// int i = c2.size();
-// for(Iterator c1Iter = c1.iterator(); i >= 0 && c1Iter.hasNext(); i--){
-// c1Iter.next();
-// c1Iter.remove();
-// }
-// }
-// }
-//
-// return m1;
-// }
-
- static public ToolListModificationInfo getModificationInfo(IResourceInfo rcInfo, ITool[] fromTools, ITool[] addedTools, ITool[] removedTools){
+
+ // private static ListMap calculateDifference(ListMap m1, ListMap m2){
+ // m1 = (ListMap)m1.clone();
+ // Set ceSet2 = m2.collectionEntrySet();
+ //
+ // for(Iterator iter = ceSet2.iterator(); iter.hasNext(); ){
+ // CollectionEntry entry = (CollectionEntry)iter.next();
+ // Collection c1 = m2.get((ITool) entry.getKey(), false);
+ // if(c1 != null){
+ // Collection c2 = entry.getValue();
+ // int i = c2.size();
+ // for(Iterator c1Iter = c1.iterator(); i >= 0 && c1Iter.hasNext(); i--){
+ // c1Iter.next();
+ // c1Iter.remove();
+ // }
+ // }
+ // }
+ //
+ // return m1;
+ // }
+
+ static public ToolListModificationInfo getModificationInfo(IResourceInfo rcInfo, ITool[] fromTools,
+ ITool[] addedTools, ITool[] removedTools) {
ToolListMap addedMap = createRealToToolMap(addedTools, false);
- for(int i = 0; i < removedTools.length; i++){
+ for (int i = 0; i < removedTools.length; i++) {
ITool removedTool = removedTools[i];
ITool realTool = ManagedBuildManager.getRealTool(removedTool);
- if(realTool == null)
+ if (realTool == null)
realTool = removedTool;
-
+
addedMap.remove(realTool, 0);
}
-
+
ToolListMap removedMap = createRealToToolMap(removedTools, false);
- for(int i = 0; i < addedTools.length; i++){
+ for (int i = 0; i < addedTools.length; i++) {
ITool addedTool = addedTools[i];
ITool realTool = ManagedBuildManager.getRealTool(addedTool);
- if(realTool == null)
+ if (realTool == null)
realTool = addedTool;
-
+
removedMap.remove(realTool, 0);
}
-
+
addedMap.clearEmptyLists();
removedMap.clearEmptyLists();
-
+
ToolListMap curMap = createRealToToolMap(fromTools, false);
for (CollectionEntry entry : removedMap.collectionEntrySet()) {
List<ITool> cur = curMap.get(entry.getKey(), false);
List<ITool> removed = entry.getValue();
- if(cur != null){
+ if (cur != null) {
int numToRemove = removed.size();
int curSize = cur.size();
- if(curSize <= numToRemove){
+ if (curSize <= numToRemove) {
curMap.removeAll(entry.getKey());
} else {
- for(int i = 0; i < numToRemove; i++){
+ for (int i = 0; i < numToRemove; i++) {
cur.remove(0);
}
}
@@ -107,116 +108,114 @@ public class ToolChainModificationHelper {
}
curMap.clearEmptyLists();
-
+
for (CollectionEntry entry : addedMap.collectionEntrySet()) {
List<ITool> cur = curMap.get(entry.getKey(), true);
List<ITool> added = entry.getValue();
int numToAdd = added.size();
numToAdd -= cur.size();
- for(int i = 0; i < numToAdd; i++){
+ for (int i = 0; i < numToAdd; i++) {
cur.add(added.get(i));
}
-
- if(cur.size() == 0)
+
+ if (cur.size() == 0)
curMap.removeAll(entry.getKey());
}
-
+
curMap.clearEmptyLists();
-
+
List<ITool> resultingList = new ArrayList<ITool>();
curMap.putValuesToCollection(resultingList);
-
+
return getModificationInfo(rcInfo, fromTools, resultingList.toArray(new ITool[resultingList.size()]));
}
- static public ToolListModificationInfo getModificationInfo(IResourceInfo rcInfo, ITool[] fromTools, ITool[] toTools){
-
+ static public ToolListModificationInfo getModificationInfo(IResourceInfo rcInfo, ITool[] fromTools,
+ ITool[] toTools) {
+
ToolListMap curMap = createRealToToolMap(fromTools, false);
List<ToolInfo> resultingList = new ArrayList<ToolInfo>();
List<ToolInfo> addedList = new ArrayList<ToolInfo>(7);
List<ToolInfo> remainedList = new ArrayList<ToolInfo>(7);
List<ToolInfo> removedList = new ArrayList<ToolInfo>(7);
List<ITool> removedToolsList = new ArrayList<ITool>(7);
-
- for(int i = 0; i < toTools.length; i++){
+
+ for (int i = 0; i < toTools.length; i++) {
ITool tool = toTools[i];
ITool realTool = ManagedBuildManager.getRealTool(tool);
- if(realTool == null)
+ if (realTool == null)
realTool = tool;
-
+
ITool remaining = curMap.remove(realTool, 0);
ToolInfo tInfo;
- if(remaining != null){
+ if (remaining != null) {
tInfo = new ToolInfo(rcInfo, remaining, ToolInfo.REMAINED);
remainedList.add(tInfo);
} else {
tInfo = new ToolInfo(rcInfo, tool, ToolInfo.ADDED);
addedList.add(tInfo);
}
-
+
resultingList.add(tInfo);
}
-
+
curMap.valuesToCollection(removedToolsList);
for (ITool t : removedToolsList) {
removedList.add(new ToolInfo(rcInfo, t, ToolInfo.REMOVED));
}
-
+
ToolInfo[] added = listToArray(addedList);
ToolInfo[] removed = listToArray(removedList);
-
+
adjustAddedList(added, removed);
calculateConverterTools(rcInfo, removed, added, null, null);
- return new ToolListModificationInfo(rcInfo,
- listToArray(resultingList),
- added,
- removed,
+ return new ToolListModificationInfo(rcInfo, listToArray(resultingList), added, removed,
listToArray(remainedList));
}
-
- private static ITool getCommonSuperClass(ITool tool1, ITool tool2){
- for(int i = 0; tool2 != null; tool2 = tool2.getSuperClass(), i++){
- if(getSuperClassLevel(tool1, tool2) != -1)
+
+ private static ITool getCommonSuperClass(ITool tool1, ITool tool2) {
+ for (int i = 0; tool2 != null; tool2 = tool2.getSuperClass(), i++) {
+ if (getSuperClassLevel(tool1, tool2) != -1)
return tool2;
}
-
+
return null;
}
-
- private static int getSuperClassLevel(ITool tool, ITool superClass){
- for(int i = 0; tool != null; tool = tool.getSuperClass(), i++){
- if(superClass == tool)
+
+ private static int getSuperClassLevel(ITool tool, ITool superClass) {
+ for (int i = 0; tool != null; tool = tool.getSuperClass(), i++) {
+ if (superClass == tool)
return i;
}
-
+
return -1;
}
-
- private static int getLevel(ITool tool){
- int i= 0;
- for(; tool != null; tool = tool.getSuperClass(), i++) {
+
+ private static int getLevel(ITool tool) {
+ int i = 0;
+ for (; tool != null; tool = tool.getSuperClass(), i++) {
// empty
}
return i;
}
-
- private static ITool getBestMatchTool(ITool realTool, ToolInfo[] tools){
+
+ private static ITool getBestMatchTool(ITool realTool, ToolInfo[] tools) {
int num = -1;
ITool bestMatch = null;
ITool[] identicTools = ManagedBuildManager.findIdenticalTools(realTool);
-
- for(int i = 0; i < tools.length; i++){
+
+ for (int i = 0; i < tools.length; i++) {
ITool extTool = ManagedBuildManager.getExtensionTool(tools[i].getInitialTool());
-
- for(int k = 0; k < identicTools.length; k++){
+
+ for (int k = 0; k < identicTools.length; k++) {
ITool identic = identicTools[k];
ITool commonSuper = getCommonSuperClass(extTool, identic);
-
- if(commonSuper != null){
+
+ if (commonSuper != null) {
int level = getLevel(commonSuper);
- if(level > num){
+ if (level > num) {
bestMatch = identic;
num = level;
}
@@ -226,62 +225,62 @@ public class ToolChainModificationHelper {
return bestMatch;
}
-
- private static void adjustAddedList(ToolInfo[] adds, ToolInfo[] removes){
- for(int i = 0; i < adds.length; i++){
+
+ private static void adjustAddedList(ToolInfo[] adds, ToolInfo[] removes) {
+ for (int i = 0; i < adds.length; i++) {
ToolInfo add = adds[i];
-
+
ITool bestMatch = getBestMatchTool(add.getRealTool(), removes);
- if(bestMatch != null){
+ if (bestMatch != null) {
add.updateInitialTool(bestMatch);
}
}
}
-
- private static ToolInfo[] listToArray(List<ToolInfo> list){
+
+ private static ToolInfo[] listToArray(List<ToolInfo> list) {
return list.toArray(new ToolInfo[list.size()]);
}
-
- private static Map<ITool, ConverterInfo> calculateConverterTools(IResourceInfo rcInfo, ToolInfo[] removed, ToolInfo[] added, List<ToolInfo> remainingRemoved, List<ToolInfo> remainingAdded){
- if(remainingAdded == null)
+
+ private static Map<ITool, ConverterInfo> calculateConverterTools(IResourceInfo rcInfo, ToolInfo[] removed,
+ ToolInfo[] added, List<ToolInfo> remainingRemoved, List<ToolInfo> remainingAdded) {
+ if (remainingAdded == null)
remainingAdded = new ArrayList<ToolInfo>(added.length);
- if(remainingRemoved == null)
+ if (remainingRemoved == null)
remainingRemoved = new ArrayList<ToolInfo>(removed.length);
-
+
remainingAdded.clear();
remainingRemoved.clear();
-
+
remainingAdded.addAll(Arrays.asList(added));
remainingRemoved.addAll(Arrays.asList(removed));
-
+
Map<ITool, ConverterInfo> resultMap = new HashMap<ITool, ConverterInfo>();
-
- for(Iterator<ToolInfo> rIter = remainingRemoved.iterator(); rIter.hasNext();){
+
+ for (Iterator<ToolInfo> rIter = remainingRemoved.iterator(); rIter.hasNext();) {
ToolInfo rti = rIter.next();
ITool r = rti.getInitialTool();
-
- if(r == null || r.getParentResourceInfo() != rcInfo)
+
+ if (r == null || r.getParentResourceInfo() != rcInfo)
continue;
-
Map<String, IConfigurationElement> map = ManagedBuildManager.getConversionElements(r);
- if(map.size() == 0)
+ if (map.size() == 0)
continue;
- for(Iterator<ToolInfo> aIter = remainingAdded.iterator(); aIter.hasNext();){
+ for (Iterator<ToolInfo> aIter = remainingAdded.iterator(); aIter.hasNext();) {
ToolInfo ati = aIter.next();
ITool a = ati.getBaseTool();
-
- if(a == null || a.getParentResourceInfo() == rcInfo)
+
+ if (a == null || a.getParentResourceInfo() == rcInfo)
continue;
-
+
a = ati.getBaseExtensionTool();
- if(a == null)
+ if (a == null)
continue;
-
+
IConfigurationElement el = getToolConverterElement(r, a);
- if(el != null){
- ConverterInfo ci = new ConverterInfo(rcInfo, r, a, el);
+ if (el != null) {
+ ConverterInfo ci = new ConverterInfo(rcInfo, r, a, el);
resultMap.put(r, ci);
rIter.remove();
aIter.remove();
@@ -291,11 +290,11 @@ public class ToolChainModificationHelper {
}
}
}
-
+
return resultMap;
}
-
- private static IConfigurationElement getToolConverterElement(ITool fromTool, ITool toTool){
- return ((Tool)fromTool).getConverterModificationElement(toTool);
+
+ private static IConfigurationElement getToolConverterElement(ITool fromTool, ITool toTool) {
+ return ((Tool) fromTool).getConverterModificationElement(toTool);
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolInfo.java
index 53d0912ee64..ce27ffbd59d 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolInfo.java
@@ -36,141 +36,149 @@ class ToolInfo {
public static final int REMOVED = 1 << 1;
public static final int REMAINED = 1 << 2;
- ToolInfo(IResourceInfo rcInfo, ITool tool, int flag){
+ ToolInfo(IResourceInfo rcInfo, ITool tool, int flag) {
fRcInfo = rcInfo;
-
+
updateInitialTool(tool);
-
+
fFlag = flag;
}
-
- private static ITool calculateBaseTool(IResourceInfo rcInfo, ITool tool){
+
+ private static ITool calculateBaseTool(IResourceInfo rcInfo, ITool tool) {
ITool baseTool = null;
- if(tool.isExtensionElement()) {
+ if (tool.isExtensionElement()) {
IToolChain baseTc;
- if(rcInfo instanceof IFolderInfo){
- baseTc = ((IFolderInfo)rcInfo).getToolChain();
+ if (rcInfo instanceof IFolderInfo) {
+ baseTc = ((IFolderInfo) rcInfo).getToolChain();
} else {
- IFolderInfo foInfo = ((ResourceConfiguration)rcInfo).getParentFolderInfo();
+ IFolderInfo foInfo = ((ResourceConfiguration) rcInfo).getParentFolderInfo();
baseTc = foInfo.getToolChain();
}
-
+
ITool realTool = ManagedBuildManager.getRealTool(tool);
- if(realTool == null){
+ if (realTool == null) {
baseTool = tool;
} else {
-// ITool[] tcTools = baseTc.getTools();
-// baseTool = getBestMatchTool(realTool, tcTools);
-//
-// if(baseTool == null){
-// IToolChain extTc = ManagedBuildManager.getExtensionToolChain(baseTc);
-// if(extTc != null){
-// baseTool = getBestMatchTool(realTool, extTc.getTools());
-// }
-// }
-
- if(baseTool == null){
+ // ITool[] tcTools = baseTc.getTools();
+ // baseTool = getBestMatchTool(realTool, tcTools);
+ //
+ // if(baseTool == null){
+ // IToolChain extTc = ManagedBuildManager.getExtensionToolChain(baseTc);
+ // if(extTc != null){
+ // baseTool = getBestMatchTool(realTool, extTc.getTools());
+ // }
+ // }
+
+ if (baseTool == null) {
baseTool = tool;
}
}
} else if (rcInfo != tool.getParentResourceInfo()) {
baseTool = tool;
}
-
+
return baseTool;
}
-
- public int getType(){
+
+ public int getType() {
return fFlag;
}
-
- public ITool getRealTool(){
- if(fRealTool == null){
+
+ public ITool getRealTool() {
+ if (fRealTool == null) {
ITool baseTool = getBaseTool();
fRealTool = ManagedBuildManager.getRealTool(baseTool);
- if(fRealTool == null)
+ if (fRealTool == null)
fRealTool = fBaseTool;
}
return fRealTool;
}
-
- void updateInitialTool(ITool tool){
- if(fInitialTool == tool)
+
+ void updateInitialTool(ITool tool) {
+ if (fInitialTool == tool)
return;
fResultingTool = null;
fRealTool = null;
-
+
fInitialTool = tool;
-
+
fModificationStatus = null;
-
+
fBaseTool = calculateBaseTool(fRcInfo, tool);
}
- public ITool getBaseTool(){
- if(fBaseTool == null){
+ public ITool getBaseTool() {
+ if (fBaseTool == null) {
fBaseTool = ManagedBuildManager.getExtensionTool(fInitialTool);
- if(fBaseTool == null)
+ if (fBaseTool == null)
fBaseTool = fInitialTool;
}
return fBaseTool;
}
-
- public ITool getBaseExtensionTool(){
+
+ public ITool getBaseExtensionTool() {
ITool tool = getBaseTool();
return ManagedBuildManager.getExtensionTool(tool);
}
-
- public ITool getInitialTool(){
+
+ public ITool getInitialTool() {
return fInitialTool;
}
-
- public IModificationStatus getModificationStatus(){
- if(fModificationStatus == null){
+
+ public IModificationStatus getModificationStatus() {
+ if (fModificationStatus == null) {
getResultingTool();
}
return fModificationStatus;
}
public ITool getResultingTool() {
- switch(fFlag){
+ switch (fFlag) {
case ADDED:
- if(fResultingTool == null || fResultingTool.getParentResourceInfo() != fRcInfo){
+ if (fResultingTool == null || fResultingTool.getParentResourceInfo() != fRcInfo) {
Tool result = null;
ModificationStatus status = null;
- if(fConverterInfo != null){
+ if (fConverterInfo != null) {
IBuildObject resultBo = fConverterInfo.getConvertedFromObject();
- if(!(resultBo instanceof Tool)) {
+ if (!(resultBo instanceof Tool)) {
status = new ModificationStatus(ManagedMakeMessages.getString("ToolInfo.0")); //$NON-NLS-1$
} else {
- result = (Tool)resultBo;
+ result = (Tool) resultBo;
status = ModificationStatus.OK;
}
- }
-
- if(status != ModificationStatus.OK){
+ }
+
+ if (status != ModificationStatus.OK) {
ITool baseTool = getBaseTool();
- if(fRcInfo instanceof IFolderInfo){
- IFolderInfo foInfo = (IFolderInfo)fRcInfo;
- if(baseTool.isExtensionElement()){
- result = new Tool((ToolChain)foInfo.getToolChain(), baseTool, ManagedBuildManager.calculateChildId(baseTool.getId(), null), baseTool.getName(), false);
+ if (fRcInfo instanceof IFolderInfo) {
+ IFolderInfo foInfo = (IFolderInfo) fRcInfo;
+ if (baseTool.isExtensionElement()) {
+ result = new Tool((ToolChain) foInfo.getToolChain(), baseTool,
+ ManagedBuildManager.calculateChildId(baseTool.getId(), null), baseTool.getName(),
+ false);
} else {
ITool extTool = ManagedBuildManager.getExtensionTool(baseTool);
- result = new Tool(foInfo.getToolChain(), extTool, ManagedBuildManager.calculateChildId(extTool.getId(), null), baseTool.getName(), (Tool)baseTool);
+ result = new Tool(foInfo.getToolChain(), extTool,
+ ManagedBuildManager.calculateChildId(extTool.getId(), null), baseTool.getName(),
+ (Tool) baseTool);
}
} else {
- ResourceConfiguration fiInfo = (ResourceConfiguration)fRcInfo;
- if(baseTool.isExtensionElement()){
- result = new Tool(fiInfo, baseTool, ManagedBuildManager.calculateChildId(baseTool.getId(), null), baseTool.getName(), false);
+ ResourceConfiguration fiInfo = (ResourceConfiguration) fRcInfo;
+ if (baseTool.isExtensionElement()) {
+ result = new Tool(fiInfo, baseTool,
+ ManagedBuildManager.calculateChildId(baseTool.getId(), null), baseTool.getName(),
+ false);
} else {
ITool extTool = ManagedBuildManager.getExtensionTool(baseTool);
- result = new Tool(fiInfo, extTool, ManagedBuildManager.calculateChildId(extTool.getId(), null), baseTool.getName(), (Tool)baseTool);
+ result = new Tool(fiInfo, extTool,
+ ManagedBuildManager.calculateChildId(extTool.getId(), null), baseTool.getName(),
+ (Tool) baseTool);
}
}
-
- if(status == null)
+
+ if (status == null)
status = ModificationStatus.OK;
}
@@ -183,16 +191,16 @@ class ToolInfo {
fModificationStatus = new ModificationStatus(ManagedMakeMessages.getString("ToolInfo.1")); //$NON-NLS-1$
return null;
case REMAINED:
- default:
- if(fResultingTool == null){
+ default:
+ if (fResultingTool == null) {
fModificationStatus = ModificationStatus.OK;
fResultingTool = fInitialTool;
}
- return fResultingTool;
+ return fResultingTool;
}
}
-
- void setConversionInfo(ToolInfo corInfo, ConverterInfo converterInfo){
+
+ void setConversionInfo(ToolInfo corInfo, ConverterInfo converterInfo) {
fCorInfo = corInfo;
fConverterInfo = converterInfo;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolListModificationInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolListModificationInfo.java
index f3f4af39cff..a235eff1a00 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolListModificationInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolListModificationInfo.java
@@ -37,40 +37,40 @@ public class ToolListModificationInfo {
private ToolInfo[] fAddedTools;
private ToolInfo[] fRemovedTools;
private IResourceInfo fRcInfo;
-
- ToolListModificationInfo(IResourceInfo rcInfo, ToolInfo[] resultingTools, ToolInfo[] added, ToolInfo[] removed, ToolInfo[] remaining){
+
+ ToolListModificationInfo(IResourceInfo rcInfo, ToolInfo[] resultingTools, ToolInfo[] added, ToolInfo[] removed,
+ ToolInfo[] remaining) {
fResultingTools = resultingTools;
fRemovedTools = removed;
fAddedTools = added;
fRcInfo = rcInfo;
}
-
- public IResourceInfo getResourceInfo(){
+
+ public IResourceInfo getResourceInfo() {
return fRcInfo;
}
-
+
public List<ITool> getResultingToolList(List<ITool> list) {
- if(list == null)
+ if (list == null)
list = new ArrayList<ITool>(fResultingTools.length);
-
- for(int i = 0; i < fResultingTools.length; i++){
+
+ for (int i = 0; i < fResultingTools.length; i++) {
list.add(fResultingTools[i].getResultingTool());
}
-
+
return list;
}
-
+
public ITool[] getResultingTools() {
ITool[] tools = new ITool[fResultingTools.length];
-
-
- for(int i = 0; i < fResultingTools.length; i++){
+
+ for (int i = 0; i < fResultingTools.length; i++) {
tools[i] = fResultingTools[i].getResultingTool();
}
-
+
return tools;
}
-
+
public ITool[] getRemovedTools() {
return toToolArray(fRemovedTools, true);
}
@@ -82,124 +82,122 @@ public class ToolListModificationInfo {
public ITool[] getRemainedTools() {
return toToolArray(fAddedTools, true);
}
-
- private static ITool[] toToolArray(ToolInfo[] infos, boolean initialTools){
+
+ private static ITool[] toToolArray(ToolInfo[] infos, boolean initialTools) {
ITool[] tools = new ITool[infos.length];
-
- for(int i = 0; i < infos.length; i++){
+
+ for (int i = 0; i < infos.length; i++) {
tools[i] = initialTools ? infos[i].getInitialTool() : infos[i].getResultingTool();
}
-
+
return tools;
}
-
- private static ITool[][] toToolArray(ToolInfo[][] infos, boolean initialTools){
+
+ private static ITool[][] toToolArray(ToolInfo[][] infos, boolean initialTools) {
ITool[][] tools = new ITool[infos.length][];
-
- for(int i = 0; i < infos.length; i++){
+
+ for (int i = 0; i < infos.length; i++) {
tools[i] = toToolArray(infos[i], initialTools);
}
-
+
return tools;
}
-
-
- public MultiStatus getModificationStatus(){
+ public MultiStatus getModificationStatus() {
List<IModificationStatus> statusList = new ArrayList<IModificationStatus>();
ToolInfo[][] conflictInfos = calculateConflictingTools(fResultingTools);
ITool[][] conflicting = toToolArray(conflictInfos, true);
-
+
Map<String, String> unspecifiedRequiredProps = new HashMap<String, String>();
Map<String, String> unspecifiedProps = new HashMap<String, String>();
Set<String> undefinedSet = new HashSet<String>();
IConfiguration cfg = fRcInfo.getParent();
ITool[] nonManagedTools = null;
- if(cfg.isManagedBuildOn() && cfg.supportsBuild(true)){
+ if (cfg.isManagedBuildOn() && cfg.supportsBuild(true)) {
List<ITool> list = new ArrayList<ITool>();
- for(int i = 0; i < fResultingTools.length; i++){
- if(!fResultingTools[i].getInitialTool().supportsBuild(true)){
+ for (int i = 0; i < fResultingTools.length; i++) {
+ if (!fResultingTools[i].getInitialTool().supportsBuild(true)) {
list.add(fResultingTools[i].getInitialTool());
}
}
- if(list.size() != 0){
+ if (list.size() != 0) {
nonManagedTools = list.toArray(new Tool[list.size()]);
}
}
-
- IModificationStatus status = new ModificationStatus(unspecifiedRequiredProps, unspecifiedProps, undefinedSet, conflicting, nonManagedTools);
- if(status.getSeverity() != IStatus.OK)
+ IModificationStatus status = new ModificationStatus(unspecifiedRequiredProps, unspecifiedProps, undefinedSet,
+ conflicting, nonManagedTools);
+
+ if (status.getSeverity() != IStatus.OK)
statusList.add(status);
-
- for(int i = 0; i < fResultingTools.length; i++){
+
+ for (int i = 0; i < fResultingTools.length; i++) {
status = fResultingTools[i].getModificationStatus();
- if(status.getSeverity() != IStatus.OK)
+ if (status.getSeverity() != IStatus.OK)
statusList.add(status);
}
-
- if(statusList.size() != 0)
+
+ if (statusList.size() != 0)
return new MultiStatus(ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.INFO, "", null); //$NON-NLS-1$
return new MultiStatus(ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.ERROR, "", null); //$NON-NLS-1$
}
- private ToolInfo[][] calculateConflictingTools(ToolInfo[] infos){
+ private ToolInfo[][] calculateConflictingTools(ToolInfo[] infos) {
infos = filterInfos(infos);
-
+
return doCalculateConflictingTools(infos);
}
-
- private ToolInfo[] filterInfos(ToolInfo[] infos){
- if(fRcInfo instanceof FolderInfo){
+
+ private ToolInfo[] filterInfos(ToolInfo[] infos) {
+ if (fRcInfo instanceof FolderInfo) {
Map<ITool, ToolInfo> map = createInitialToolToToolInfoMap(infos);
ITool[] tools = new ArrayList<ITool>(map.keySet()).toArray(new ITool[map.size()]);
-
- tools = ((FolderInfo)fRcInfo).filterTools(tools, fRcInfo.getParent().getManagedProject());
-
- if(tools.length < infos.length){
- infos = new ToolInfo[tools.length];
- for(int i = 0; i < infos.length; i++){
+
+ tools = ((FolderInfo) fRcInfo).filterTools(tools, fRcInfo.getParent().getManagedProject());
+
+ if (tools.length < infos.length) {
+ infos = new ToolInfo[tools.length];
+ for (int i = 0; i < infos.length; i++) {
infos[i] = map.get(tools[i]);
}
}
}
-
+
return infos;
}
-
- private static Map<ITool, ToolInfo> createInitialToolToToolInfoMap(ToolInfo[] infos){
+
+ private static Map<ITool, ToolInfo> createInitialToolToToolInfoMap(ToolInfo[] infos) {
Map<ITool, ToolInfo> map = new LinkedHashMap<ITool, ToolInfo>();
- for(int i = 0; i < infos.length; i++){
+ for (int i = 0; i < infos.length; i++) {
map.put(infos[i].getInitialTool(), infos[i]);
}
-
+
return map;
}
-
- private ToolInfo[][] doCalculateConflictingTools(ToolInfo[] infos){
+ private ToolInfo[][] doCalculateConflictingTools(ToolInfo[] infos) {
HashSet<ToolInfo> set = new HashSet<ToolInfo>();
set.addAll(Arrays.asList(infos));
List<ToolInfo[]> result = new ArrayList<ToolInfo[]>();
- for(Iterator<ToolInfo> iter = set.iterator(); iter.hasNext();){
+ for (Iterator<ToolInfo> iter = set.iterator(); iter.hasNext();) {
ToolInfo ti = iter.next();
ITool t = ti.getInitialTool();
iter.remove();
@SuppressWarnings("unchecked")
- HashSet<ToolInfo> tmp = (HashSet<ToolInfo>)set.clone();
+ HashSet<ToolInfo> tmp = (HashSet<ToolInfo>) set.clone();
List<ITool> list = new ArrayList<ITool>();
- for(Iterator<ToolInfo> tmpIt = tmp.iterator(); tmpIt.hasNext();){
- ToolInfo otherTi = tmpIt.next();
+ for (Iterator<ToolInfo> tmpIt = tmp.iterator(); tmpIt.hasNext();) {
+ ToolInfo otherTi = tmpIt.next();
ITool other = otherTi.getInitialTool();
String conflicts[] = getConflictingInputExts(t, other);
- if(conflicts.length != 0){
+ if (conflicts.length != 0) {
list.add(other);
tmpIt.remove();
}
}
-
- if(list.size() != 0){
+
+ if (list.size() != 0) {
list.add(t);
ToolInfo[] arr = list.toArray(new ToolInfo[list.size()]);
result.add(arr);
@@ -207,24 +205,24 @@ public class ToolListModificationInfo {
set = tmp;
iter = set.iterator();
}
-
+
return result.toArray(new ToolInfo[result.size()][]);
}
-
- private String[] getConflictingInputExts(ITool tool1, ITool tool2){
+
+ private String[] getConflictingInputExts(ITool tool1, ITool tool2) {
IProject project = fRcInfo.getParent().getOwner().getProject();
- String ext1[] = ((Tool)tool1).getAllInputExtensions(project);
- String ext2[] = ((Tool)tool2).getAllInputExtensions(project);
+ String ext1[] = ((Tool) tool1).getAllInputExtensions(project);
+ String ext2[] = ((Tool) tool2).getAllInputExtensions(project);
Set<String> set1 = new HashSet<String>(Arrays.asList(ext1));
Set<String> result = new HashSet<String>();
- for(int i = 0; i < ext2.length; i++){
- if(set1.remove(ext2[i]))
+ for (int i = 0; i < ext2.length; i++) {
+ if (set1.remove(ext2[i]))
result.add(ext2[i]);
}
return result.toArray(new String[result.size()]);
}
- public void apply(){
- ((ResourceInfo)fRcInfo).doApply(this);
+ public void apply() {
+ ((ResourceInfo) fRcInfo).doApply(this);
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
index d054d7be84e..5e8880c7c12 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
@@ -75,23 +75,23 @@ public class ToolReference implements IToolReference {
if (owner instanceof ConfigurationV2) {
if (parent == null) {
- Target parentTarget = (Target) ((ConfigurationV2)owner).getTarget();
+ Target parentTarget = (Target) ((ConfigurationV2) owner).getTarget();
try {
- parent = ((Target)parentTarget.getParent()).getTool(element.getAttribute(ID));
+ parent = ((Target) parentTarget.getParent()).getTool(element.getAttribute(ID));
} catch (NullPointerException e) {
parent = null;
}
}
- ((ConfigurationV2)owner).addToolReference(this);
+ ((ConfigurationV2) owner).addToolReference(this);
} else if (owner instanceof Target) {
- if (parent == null) {
- try {
- parent = ((Target)((Target)owner).getParent()).getTool(element.getAttribute(ID));
- } catch (NullPointerException e) {
- parent = null;
- }
- }
- ((Target)owner).addToolReference(this);
+ if (parent == null) {
+ try {
+ parent = ((Target) ((Target) owner).getParent()).getTool(element.getAttribute(ID));
+ } catch (NullPointerException e) {
+ parent = null;
+ }
+ }
+ ((Target) owner).addToolReference(this);
}
// Get the overridden tool command (if any)
@@ -116,7 +116,7 @@ public class ToolReference implements IToolReference {
for (int i = 0; i < configElements.getLength(); ++i) {
Node configElement = configElements.item(i);
if (configElement.getNodeName().equals(ITool.OPTION_REF)) {
- new OptionReference(this, (Element)configElement);
+ new OptionReference(this, (Element) configElement);
}
}
}
@@ -136,9 +136,9 @@ public class ToolReference implements IToolReference {
// hook me up
if (owner instanceof ConfigurationV2) {
- ((ConfigurationV2)owner).addToolReference(this);
+ ((ConfigurationV2) owner).addToolReference(this);
} else if (owner instanceof Target) {
- ((Target)owner).addToolReference(this);
+ ((Target) owner).addToolReference(this);
}
// Get the overridden tool command (if any)
@@ -174,7 +174,7 @@ public class ToolReference implements IToolReference {
public ToolReference(BuildObject owner, ITool tool) {
this.owner = owner;
if (tool instanceof ToolReference) {
- parent = ((ToolReference)tool).getTool();
+ parent = ((ToolReference) tool).getTool();
} else {
parent = tool;
}
@@ -185,7 +185,8 @@ public class ToolReference implements IToolReference {
outputExtensions = ""; //$NON-NLS-1$
if (extensions != null) {
for (int index = 0; index < extensions.length; ++index) {
- if (extensions[index] == null) continue;
+ if (extensions[index] == null)
+ continue;
outputExtensions += extensions[index];
if (index < extensions.length - 1) {
outputExtensions += DEFAULT_SEPARATOR;
@@ -195,24 +196,24 @@ public class ToolReference implements IToolReference {
// Create a copy of the option references of the parent in the receiver
if (tool instanceof ToolReference) {
- List<OptionReference> parentRefs = ((ToolReference)tool).getOptionReferenceList();
+ List<OptionReference> parentRefs = ((ToolReference) tool).getOptionReferenceList();
for (OptionReference parent : parentRefs) {
OptionReference clone = createOptionReference(parent);
try {
switch (parent.getValueType()) {
- case IOption.BOOLEAN:
- clone.setValue(parent.getBooleanValue());
- break;
- case IOption.STRING:
- case IOption.TREE:
- clone.setValue(parent.getStringValue());
- break;
- case IOption.ENUMERATED:
- clone.setValue(parent.getSelectedEnum());
- break;
- default:
- clone.setValue(parent.getStringListValue());
- break;
+ case IOption.BOOLEAN:
+ clone.setValue(parent.getBooleanValue());
+ break;
+ case IOption.STRING:
+ case IOption.TREE:
+ clone.setValue(parent.getStringValue());
+ break;
+ case IOption.ENUMERATED:
+ clone.setValue(parent.getSelectedEnum());
+ break;
+ default:
+ clone.setValue(parent.getStringListValue());
+ break;
}
} catch (BuildException e) {
// Likely a mismatch between the value and option type
@@ -222,9 +223,9 @@ public class ToolReference implements IToolReference {
}
if (owner instanceof ConfigurationV2) {
- ((ConfigurationV2)owner).addToolReference(this);
+ ((ConfigurationV2) owner).addToolReference(this);
} else if (owner instanceof Target) {
- ((Target)owner).addToolReference(this);
+ ((Target) owner).addToolReference(this);
}
}
@@ -241,9 +242,9 @@ public class ToolReference implements IToolReference {
return false;
} else if (parent instanceof IToolReference) {
// check the reference we are overriding
- return ((IToolReference)parent).references(target);
+ return ((IToolReference) parent).references(target);
} else if (target instanceof IToolReference) {
- return parent.equals(((IToolReference)target).getTool());
+ return parent.equals(((IToolReference) target).getTool());
} else {
// the real reference
return parent.equals(target);
@@ -256,16 +257,16 @@ public class ToolReference implements IToolReference {
IManagedConfigElement element = ManagedBuildManager.getConfigElement(this);
// resolve my parent
if (owner instanceof ConfigurationV2) {
- Target target = (Target) ((ConfigurationV2)owner).getTarget();
+ Target target = (Target) ((ConfigurationV2) owner).getTarget();
parent = target.getTool(element.getAttribute(ID));
} else if (owner instanceof Target) {
- parent = ((Target)owner).getTool(element.getAttribute(ID));
+ parent = ((Target) owner).getTool(element.getAttribute(ID));
}
// recursively resolve my parent
if (parent instanceof Tool) {
- ((Tool)parent).resolveReferences();
+ ((Tool) parent).resolveReferences();
} else if (parent instanceof ToolReference) {
- ((ToolReference)parent).resolveReferences();
+ ((ToolReference) parent).resolveReferences();
}
List<OptionReference> optionReferenceList = getOptionReferenceList();
@@ -333,9 +334,9 @@ public class ToolReference implements IToolReference {
protected List<OptionReference> getAllOptionRefs() {
// First get all the option references this tool reference contains
if (owner instanceof ConfigurationV2) {
- return ((ConfigurationV2)owner).getOptionReferences(parent);
+ return ((ConfigurationV2) owner).getOptionReferences(parent);
} else if (owner instanceof Target) {
- return ((Target)owner).getOptionReferences(parent);
+ return ((Target) owner).getOptionReferences(parent);
} else {
// this shouldn't happen
return null;
@@ -366,22 +367,22 @@ public class ToolReference implements IToolReference {
return parent.getBaseId();
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.managedbuilder.core.ITool#getInputExtensions()
- */
- @Override
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.ITool#getInputExtensions()
+ */
+ @Override
public List<String> getInputExtensions() {
String[] exts = getPrimaryInputExtensions();
List<String> extList = new ArrayList<String>();
- for (int i=0; i<exts.length; i++) {
+ for (int i = 0; i < exts.length; i++) {
extList.add(exts[i]);
}
return extList;
- }
+ }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getName()
- */
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getName()
+ */
@Override
public String getName() {
if (parent == null) {
@@ -494,82 +495,83 @@ public class ToolReference implements IToolReference {
if (applicabilityCalculator != null) {
ITool tool = getTool();
IBuildObject config;
- if( tool.getParent() instanceof IResourceConfiguration ) {
+ if (tool.getParent() instanceof IResourceConfiguration) {
config = tool.getParent();
} else {
- config = ((IToolChain)tool.getParent()).getParent();
+ config = ((IToolChain) tool.getParent()).getParent();
}
- optionIsApplicable =
- applicabilityCalculator.isOptionUsedInCommandLine(config, tool, option);
+ optionIsApplicable = applicabilityCalculator.isOptionUsedInCommandLine(config, tool, option);
}
if (optionIsApplicable) {
switch (option.getValueType()) {
- case IOption.BOOLEAN :
- String boolCmd;
- if (option.getBooleanValue()) {
- boolCmd = option.getCommand();
- } else {
- // Note: getCommandFalse is new with CDT 2.0
- boolCmd = option.getCommandFalse();
- }
- if (boolCmd != null && boolCmd.length() > 0) {
- buf.append(boolCmd).append(WHITE_SPACE);
- }
- break;
-
- case IOption.ENUMERATED :
- String enumVal = option.getEnumCommand(option.getSelectedEnum());
- if (enumVal.length() > 0) {
- buf.append(enumVal).append(WHITE_SPACE);
- }
- break;
-
- case IOption.TREE :
- String treeVal = option.getCommand(option.getStringValue());
- if (treeVal.length() > 0) {
- buf.append(treeVal).append(WHITE_SPACE);
- }
- break;
-
- case IOption.STRING :
- String strCmd = option.getCommand();
- String val = option.getStringValue();
- if (val.length() > 0) {
- if (strCmd != null) buf.append(strCmd);
- buf.append(val).append(WHITE_SPACE);
- }
- break;
-
- case IOption.STRING_LIST :
- String cmd = option.getCommand();
- String[] list = option.getStringListValue();
- for (int j = 0; j < list.length; j++) {
- String temp = list[j];
- if (cmd != null) buf.append(cmd);
- buf.append(temp).append(WHITE_SPACE);
- }
- break;
+ case IOption.BOOLEAN:
+ String boolCmd;
+ if (option.getBooleanValue()) {
+ boolCmd = option.getCommand();
+ } else {
+ // Note: getCommandFalse is new with CDT 2.0
+ boolCmd = option.getCommandFalse();
+ }
+ if (boolCmd != null && boolCmd.length() > 0) {
+ buf.append(boolCmd).append(WHITE_SPACE);
+ }
+ break;
- case IOption.INCLUDE_PATH :
- String incCmd = option.getCommand();
- String[] paths = option.getIncludePaths();
- for (int j = 0; j < paths.length; j++) {
- String temp = paths[j];
- buf.append(incCmd).append(temp).append(WHITE_SPACE);
- }
- break;
+ case IOption.ENUMERATED:
+ String enumVal = option.getEnumCommand(option.getSelectedEnum());
+ if (enumVal.length() > 0) {
+ buf.append(enumVal).append(WHITE_SPACE);
+ }
+ break;
- case IOption.PREPROCESSOR_SYMBOLS :
- String defCmd = option.getCommand();
- String[] symbols = option.getDefinedSymbols();
- for (int j = 0; j < symbols.length; j++) {
- String temp = symbols[j];
- buf.append(defCmd).append(temp).append(WHITE_SPACE);
- }
- break;
+ case IOption.TREE:
+ String treeVal = option.getCommand(option.getStringValue());
+ if (treeVal.length() > 0) {
+ buf.append(treeVal).append(WHITE_SPACE);
+ }
+ break;
+
+ case IOption.STRING:
+ String strCmd = option.getCommand();
+ String val = option.getStringValue();
+ if (val.length() > 0) {
+ if (strCmd != null)
+ buf.append(strCmd);
+ buf.append(val).append(WHITE_SPACE);
+ }
+ break;
+
+ case IOption.STRING_LIST:
+ String cmd = option.getCommand();
+ String[] list = option.getStringListValue();
+ for (int j = 0; j < list.length; j++) {
+ String temp = list[j];
+ if (cmd != null)
+ buf.append(cmd);
+ buf.append(temp).append(WHITE_SPACE);
+ }
+ break;
+
+ case IOption.INCLUDE_PATH:
+ String incCmd = option.getCommand();
+ String[] paths = option.getIncludePaths();
+ for (int j = 0; j < paths.length; j++) {
+ String temp = paths[j];
+ buf.append(incCmd).append(temp).append(WHITE_SPACE);
+ }
+ break;
+
+ case IOption.PREPROCESSOR_SYMBOLS:
+ String defCmd = option.getCommand();
+ String[] symbols = option.getDefinedSymbols();
+ for (int j = 0; j < symbols.length; j++) {
+ String temp = symbols[j];
+ buf.append(defCmd).append(temp).append(WHITE_SPACE);
+ }
+ break;
- default :
- break;
+ default:
+ break;
}
}
}
@@ -635,7 +637,6 @@ public class ToolReference implements IToolReference {
return optionReferences;
}
-
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.ITool#getOptions()
*/
@@ -658,17 +659,16 @@ public class ToolReference implements IToolReference {
*/
@Override
public String[] getOutputExtensions() {
- if (outputExtensions == null){
- if (parent != null) {
- return parent.getOutputsAttribute();
- } else {
- return new String[0];
- }
+ if (outputExtensions == null) {
+ if (parent != null) {
+ return parent.getOutputsAttribute();
+ } else {
+ return new String[0];
+ }
}
return outputExtensions.split(DEFAULT_SEPARATOR);
}
-
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITool#getOutputExtension(java.lang.String)
*/
@@ -706,7 +706,7 @@ public class ToolReference implements IToolReference {
if (parent != null) {
return parent.getOutputPrefix();
}
- return ""; // bad reference //$NON-NLS-1$
+ return ""; // bad reference //$NON-NLS-1$
}
return outputPrefix;
}
@@ -737,7 +737,7 @@ public class ToolReference implements IToolReference {
*/
public boolean ownedByConfiguration(IConfigurationV2 config) {
if (owner instanceof ConfigurationV2) {
- return ((IConfigurationV2)owner).equals(config);
+ return ((IConfigurationV2) owner).equals(config);
}
return false;
}
@@ -750,7 +750,8 @@ public class ToolReference implements IToolReference {
* to persist settings.
*/
public void serialize(Document doc, Element element) {
- if (parent == null) return; // This is a bad reference
+ if (parent == null)
+ return; // This is a bad reference
element.setAttribute(ITool.ID, parent.getId());
// Output the command
@@ -813,7 +814,8 @@ public class ToolReference implements IToolReference {
*/
@Override
public void setOutputFlag(String flag) {
- if (flag == null) return;
+ if (flag == null)
+ return;
if (outputFlag == null || !(flag.equals(outputFlag))) {
outputFlag = flag;
isDirty = true;
@@ -825,7 +827,8 @@ public class ToolReference implements IToolReference {
*/
@Override
public void setOutputPrefix(String prefix) {
- if (prefix == null) return;
+ if (prefix == null)
+ return;
if (outputPrefix == null || !(prefix.equals(outputPrefix))) {
outputPrefix = prefix;
isDirty = true;
@@ -836,7 +839,8 @@ public class ToolReference implements IToolReference {
* @see org.eclipse.cdt.managedbuilder.core.ITool#setOutputExtensions(java.lang.String)
*/
public void setOutputExtensions(String ext) {
- if (ext == null) return;
+ if (ext == null)
+ return;
if (outputExtensions == null || !(ext.equals(outputExtensions))) {
outputExtensions = ext;
isDirty = true;
@@ -852,7 +856,7 @@ public class ToolReference implements IToolReference {
return;
}
// Set the parent in the parent of this ToolRefernce, the tool
- ((Tool)parent).setToolParent(newParent);
+ ((Tool) parent).setToolParent(newParent);
}
/* (non-Javadoc)
@@ -868,7 +872,8 @@ public class ToolReference implements IToolReference {
*/
@Override
public String getCommandLinePattern() {
- if( parent == null ) return ""; //$NON-NLS-1$
+ if (parent == null)
+ return ""; //$NON-NLS-1$
return parent.getCommandLinePattern();
}
@@ -877,7 +882,8 @@ public class ToolReference implements IToolReference {
*/
@Override
public IManagedCommandLineGenerator getCommandLineGenerator() {
- if( parent == null ) return null;
+ if (parent == null)
+ return null;
return parent.getCommandLineGenerator();
}
@@ -886,7 +892,8 @@ public class ToolReference implements IToolReference {
*/
@Override
public IManagedDependencyGenerator getDependencyGenerator() {
- if( parent == null ) return null;
+ if (parent == null)
+ return null;
return parent.getDependencyGenerator();
}
@@ -895,7 +902,8 @@ public class ToolReference implements IToolReference {
*/
@Override
public String[] getCommandFlags() throws BuildException {
- if( parent == null ) return null;
+ if (parent == null)
+ return null;
return parent.getToolCommandFlags(null, null);
}
@@ -903,7 +911,7 @@ public class ToolReference implements IToolReference {
* @see org.eclipse.cdt.managedbuilder.core.ITool#getToolCommandFlags(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath)
*/
@Override
- public String[] getToolCommandFlags(IPath inputFileLocation, IPath outputFileLocation) throws BuildException{
+ public String[] getToolCommandFlags(IPath inputFileLocation, IPath outputFileLocation) throws BuildException {
return getCommandFlags();
}
@@ -911,7 +919,7 @@ public class ToolReference implements IToolReference {
* @see org.eclipse.cdt.managedbuilder.core.ITool#getToolCommandFlagsString(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath)
*/
@Override
- public String getToolCommandFlagsString(IPath inputFileLocation, IPath outputFileLocation) throws BuildException{
+ public String getToolCommandFlagsString(IPath inputFileLocation, IPath outputFileLocation) throws BuildException {
return getToolFlags();
}
@@ -923,7 +931,7 @@ public class ToolReference implements IToolReference {
public String toString() {
String answer = ""; //$NON-NLS-1$
if (parent != null) {
- answer += "Reference to " + parent.getName(); //$NON-NLS-1$
+ answer += "Reference to " + parent.getName(); //$NON-NLS-1$
}
if (answer.length() > 0) {
@@ -1226,16 +1234,15 @@ public class ToolReference implements IToolReference {
@Override
public void addOptionCategory(IOptionCategory category) {
}
-
+
@Override
public void setHidden(boolean hidden) {
}
-
+
@Override
public boolean isHidden() {
return false;
- }
-
+ }
/*
* The following methods are added to allow the converter from ToolReference -> Tool
@@ -1296,7 +1303,8 @@ public class ToolReference implements IToolReference {
*/
@Override
public void setConvertToId(String convertToId) {
- if (convertToId == null && this.convertToId == null) return;
+ if (convertToId == null && this.convertToId == null)
+ return;
if (convertToId == null || this.convertToId == null || !convertToId.equals(this.convertToId)) {
this.convertToId = convertToId;
setDirty(true);
@@ -1325,8 +1333,10 @@ public class ToolReference implements IToolReference {
*/
@Override
public void setVersionsSupported(String versionsSupported) {
- if (versionsSupported == null && this.versionsSupported == null) return;
- if (versionsSupported == null || this.versionsSupported == null || !versionsSupported.equals(this.versionsSupported)) {
+ if (versionsSupported == null && this.versionsSupported == null)
+ return;
+ if (versionsSupported == null || this.versionsSupported == null
+ || !versionsSupported.equals(this.versionsSupported)) {
this.versionsSupported = versionsSupported;
setDirty(true);
}
@@ -1337,7 +1347,7 @@ public class ToolReference implements IToolReference {
* @see org.eclipse.cdt.core.build.managed.ITool#getEnvVarBuildPaths()
*/
@Override
- public IEnvVarBuildPath[] getEnvVarBuildPaths(){
+ public IEnvVarBuildPath[] getEnvVarBuildPaths() {
return null;
}
@@ -1357,7 +1367,7 @@ public class ToolReference implements IToolReference {
}
@Override
- public IOption getOptionToSet(IOption option, boolean adjustExtension){
+ public IOption getOptionToSet(IOption option, boolean adjustExtension) {
return null;
}
@@ -1381,7 +1391,7 @@ public class ToolReference implements IToolReference {
*/
@Override
public IOptionPathConverter getOptionPathConverter() {
- if (parent!=null) {
+ if (parent != null) {
return parent.getOptionPathConverter();
}
return null;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildBuildData.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildBuildData.java
index ab1d62be45a..8925acfb3b4 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildBuildData.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildBuildData.java
@@ -30,10 +30,11 @@ import org.eclipse.core.runtime.Path;
public class BuildBuildData extends CBuildData {
private Builder fBuilder;
private Configuration fCfg;
-// private BuildEnvironmentContributor fEnvContibutor;
- public BuildBuildData(IBuilder builder){
- fBuilder = (Builder)builder;
- fCfg = (Configuration)fBuilder.getParent().getParent();
+
+ // private BuildEnvironmentContributor fEnvContibutor;
+ public BuildBuildData(IBuilder builder) {
+ fBuilder = (Builder) builder;
+ fCfg = (Configuration) fBuilder.getParent().getParent();
}
@Override
@@ -41,11 +42,11 @@ public class BuildBuildData extends CBuildData {
return new Path(fBuilder.getBuildPath());//ManagedBuildManager.getBuildLocation(fCfg, fBuilder);
}
-// private IPath createAbsolutePathFromWorkspacePath(IPath path){
-// IStringVariableManager mngr = VariablesPlugin.getDefault().getStringVariableManager();
-// String locationString = mngr.generateVariableExpression("workspace_loc", path.toString()); //$NON-NLS-1$
-// return new Path(locationString);
-// }
+ // private IPath createAbsolutePathFromWorkspacePath(IPath path){
+ // IStringVariableManager mngr = VariablesPlugin.getDefault().getStringVariableManager();
+ // String locationString = mngr.generateVariableExpression("workspace_loc", path.toString()); //$NON-NLS-1$
+ // return new Path(locationString);
+ // }
@Override
public String[] getErrorParserIDs() {
@@ -93,9 +94,9 @@ public class BuildBuildData extends CBuildData {
@Override
public IEnvironmentContributor getBuildEnvironmentContributor() {
-// if(fEnvContibutor == null)
-// fEnvContibutor = new BuildEnvironmentContributor(this);
-// return fEnvContibutor;
+ // if(fEnvContibutor == null)
+ // fEnvContibutor = new BuildEnvironmentContributor(this);
+ // return fEnvContibutor;
return new BuildEnvironmentContributor(this);
}
@@ -103,14 +104,13 @@ public class BuildBuildData extends CBuildData {
public ICommand getBuildSpecCommand() {
try {
return BuilderFactory.createCommandFromBuilder(this.fBuilder);
- }
- catch(CoreException cx) {
+ } catch (CoreException cx) {
ManagedBuilderCorePlugin.log(cx);
return null;
}
}
- public IBuilder getBuilder(){
+ public IBuilder getBuilder() {
return fBuilder;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildConfigurationData.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildConfigurationData.java
index d04b20ed83c..55182da84ad 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildConfigurationData.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildConfigurationData.java
@@ -39,44 +39,42 @@ import org.eclipse.osgi.util.NLS;
public class BuildConfigurationData extends CConfigurationData {
private Configuration fCfg;
-// private BuildVariablesContributor fCdtVars;
- public BuildConfigurationData(IConfiguration cfg){
- fCfg = (Configuration)cfg;
+
+ // private BuildVariablesContributor fCdtVars;
+ public BuildConfigurationData(IConfiguration cfg) {
+ fCfg = (Configuration) cfg;
}
- public IConfiguration getConfiguration(){
+ public IConfiguration getConfiguration() {
return fCfg;
}
@Override
- public CFileData createFileData(IPath path, CFileData base)
- throws CoreException {
- String id = ManagedBuildManager.calculateChildId(fCfg.getId(),null);
- IFileInfo info = fCfg.createFileInfo(path, ((BuildFileData)base).getFileInfo(), id, path.lastSegment());
+ public CFileData createFileData(IPath path, CFileData base) throws CoreException {
+ String id = ManagedBuildManager.calculateChildId(fCfg.getId(), null);
+ IFileInfo info = fCfg.createFileInfo(path, ((BuildFileData) base).getFileInfo(), id, path.lastSegment());
return info.getFileData();
}
@Override
- public CFileData createFileData(IPath path, CFolderData base, CLanguageData baseLangData)
- throws CoreException {
- String id = ManagedBuildManager.calculateChildId(fCfg.getId(),null);
+ public CFileData createFileData(IPath path, CFolderData base, CLanguageData baseLangData) throws CoreException {
+ String id = ManagedBuildManager.calculateChildId(fCfg.getId(), null);
ITool baseTool;
- if(baseLangData instanceof BuildLanguageData){
- baseTool = ((BuildLanguageData)baseLangData).getTool();
+ if (baseLangData instanceof BuildLanguageData) {
+ baseTool = ((BuildLanguageData) baseLangData).getTool();
} else {
baseTool = null;
}
- IFileInfo info = fCfg.createFileInfo(path, ((BuildFolderData)base).getFolderInfo(), baseTool, id, path.lastSegment());
+ IFileInfo info = fCfg.createFileInfo(path, ((BuildFolderData) base).getFolderInfo(), baseTool, id,
+ path.lastSegment());
return info.getFileData();
}
-
-
@Override
- public CFolderData createFolderData(IPath path, CFolderData base)
- throws CoreException {
- String id = ManagedBuildManager.calculateChildId(fCfg.getId(),null);
- IFolderInfo folderInfo = fCfg.createFolderInfo(path, ((BuildFolderData)base).getFolderInfo(), id, base.getName());
+ public CFolderData createFolderData(IPath path, CFolderData base) throws CoreException {
+ String id = ManagedBuildManager.calculateChildId(fCfg.getId(), null);
+ IFolderInfo folderInfo = fCfg.createFolderInfo(path, ((BuildFolderData) base).getFolderInfo(), id,
+ base.getName());
return folderInfo.getFolderData();
}
@@ -89,7 +87,7 @@ public class BuildConfigurationData extends CConfigurationData {
public CResourceData[] getResourceDatas() {
IResourceInfo infos[] = fCfg.getResourceInfos();
CResourceData datas[] = new CResourceData[infos.length];
- for(int i = 0; i < infos.length; i++){
+ for (int i = 0; i < infos.length; i++) {
datas[i] = infos[i].getResourceData();
}
return datas;
@@ -152,26 +150,25 @@ public class BuildConfigurationData extends CConfigurationData {
@Override
public ICdtVariablesContributor getBuildVariablesContributor() {
-// if(fCdtVars == null)
-// fCdtVars = new BuildVariablesContributor(this);
-// return fCdtVars;
+ // if(fCdtVars == null)
+ // fCdtVars = new BuildVariablesContributor(this);
+ // return fCdtVars;
return new BuildVariablesContributor(this);
}
- void clearCachedData(){
+ void clearCachedData() {
fCfg.clearCachedData();
CResourceData[] datas = getResourceDatas();
CResourceData data;
-// BuildLanguageData lData;
-// BuildLanguageData[] lDatas;
-
+ // BuildLanguageData lData;
+ // BuildLanguageData[] lDatas;
- for(int i = 0; i < datas.length; i++){
+ for (int i = 0; i < datas.length; i++) {
data = datas[i];
- if(data.getType() == ICSettingBase.SETTING_FOLDER){
- ((BuildFolderData)data).clearCachedData();
+ if (data.getType() == ICSettingBase.SETTING_FOLDER) {
+ ((BuildFolderData) data).clearCachedData();
} else {
- ((BuildFileData)data).clearCachedData();
+ ((BuildFileData) data).clearCachedData();
}
}
}
@@ -180,17 +177,18 @@ public class BuildConfigurationData extends CConfigurationData {
public CConfigurationStatus getStatus() {
int flags = 0;
String msg = null;
- if(!fCfg.isSupported()){
+ if (!fCfg.isSupported()) {
flags |= CConfigurationStatus.TOOLCHAIN_NOT_SUPPORTED;
IToolChain toolChain = fCfg.getToolChain();
String tname = toolChain != null ? toolChain.getName() : ""; //$NON-NLS-1$
msg = NLS.bind(DataProviderMessages.getString("BuildConfigurationData.NoToolchainSupport"), tname); //$NON-NLS-1$
- } else if (ManagedBuildManager.getExtensionConfiguration(fCfg)==null){
+ } else if (ManagedBuildManager.getExtensionConfiguration(fCfg) == null) {
flags |= CConfigurationStatus.SETTINGS_INVALID;
- msg = NLS.bind(DataProviderMessages.getString("BuildConfigurationData.OrphanedConfiguration"), fCfg.getId()); //$NON-NLS-1$
+ msg = NLS.bind(DataProviderMessages.getString("BuildConfigurationData.OrphanedConfiguration"), //$NON-NLS-1$
+ fCfg.getId());
}
- if(flags != 0)
+ if (flags != 0)
return new CConfigurationStatus(ManagedBuilderCorePlugin.getUniqueIdentifier(), flags, msg, null);
return CConfigurationStatus.CFG_STATUS_OK;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildEntryStorage.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildEntryStorage.java
index e6174ca0c1f..e07a923c231 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildEntryStorage.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildEntryStorage.java
@@ -72,7 +72,8 @@ public class BuildEntryStorage extends AbstractEntryStorage {
private OptionStringValue fBsResolvedValue;
private List<UserEntryInfo> fSequense;
- UserEntryInfo(ICLanguageSettingEntry entry, OptionStringValue originalValue, OptionStringValue bsResolvedValue, List<UserEntryInfo> sequense) {
+ UserEntryInfo(ICLanguageSettingEntry entry, OptionStringValue originalValue, OptionStringValue bsResolvedValue,
+ List<UserEntryInfo> sequense) {
fEntry = entry;
fOriginalValue = originalValue;
fBsResolvedValue = bsResolvedValue;
@@ -92,7 +93,6 @@ public class BuildEntryStorage extends AbstractEntryStorage {
}
}
-
public BuildEntryStorage(int kind, BuildLanguageData lData) {
super(kind);
fLangData = lData;
@@ -144,13 +144,13 @@ public class BuildEntryStorage extends AbstractEntryStorage {
EntryInfo infos[] = level.getInfos();
UserEntryInfo[] userInfos = new UserEntryInfo[infos.length];
for (int i = 0; i < infos.length; i++) {
- UserEntryInfo uei = (UserEntryInfo)infos[i].getCustomInfo();
+ UserEntryInfo uei = (UserEntryInfo) infos[i].getCustomInfo();
if (uei == null)
uei = new UserEntryInfo(infos[i].getEntry(), null, null, null);
userInfos[i] = uei;
}
@SuppressWarnings("unchecked")
- List<EmptyEntryInfo> context = (List<EmptyEntryInfo>)level.getContext();
+ List<EmptyEntryInfo> context = (List<EmptyEntryInfo>) level.getContext();
setUserEntries(userInfos, context);
setUserUndefinedStringSet(level.containsOverrideInfo() ? level.getOverrideSet() : null);
}
@@ -200,7 +200,8 @@ public class BuildEntryStorage extends AbstractEntryStorage {
* @return scanner discovered entries (level 2)
*/
private ICLanguageSettingEntry[] getDiscoveredEntries(int flags) {
- ICLanguageSettingEntry[] entries = ProfileInfoProvider.getInstance().getEntryValues(fLangData, getKind(), flags);
+ ICLanguageSettingEntry[] entries = ProfileInfoProvider.getInstance().getEntryValues(fLangData, getKind(),
+ flags);
if (entries == null || entries.length == 0) {
UserEntryInfo[] infos = getUserEntries(flags, false, null);
if (infos.length != 0) {
@@ -217,9 +218,8 @@ public class BuildEntryStorage extends AbstractEntryStorage {
OptionContextData ocd = new OptionContextData(option, fLangData.getTool());
DefaultMacroContextInfo ci = new DefaultMacroContextInfo(IBuildMacroProvider.CONTEXT_OPTION, ocd);
- return bsVarsOnly ?
- new BuildSystemSpecificVariableSubstitutor(ci) :
- new SupplierBasedCdtVariableSubstitutor(ci, "", " "); //$NON-NLS-1$ //$NON-NLS-2$
+ return bsVarsOnly ? new BuildSystemSpecificVariableSubstitutor(ci)
+ : new SupplierBasedCdtVariableSubstitutor(ci, "", " "); //$NON-NLS-1$ //$NON-NLS-2$
}
/**
@@ -235,10 +235,11 @@ public class BuildEntryStorage extends AbstractEntryStorage {
if (options.length > 0) {
List<UserEntryInfo> entryList = new ArrayList<UserEntryInfo>();
for (IOption opt : options) {
- Option option = (Option)opt;
+ Option option = (Option) opt;
try {
@SuppressWarnings("unchecked")
- List<OptionStringValue> list = usr ? (List<OptionStringValue>)option.getExactValue() : (List<OptionStringValue>)option.getExactBuiltinsList();
+ List<OptionStringValue> list = usr ? (List<OptionStringValue>) option.getExactValue()
+ : (List<OptionStringValue>) option.getExactBuiltinsList();
if (list != null) {
SupplierBasedCdtVariableSubstitutor subst = createSubstitutor(option, false);
SupplierBasedCdtVariableSubstitutor bSVarsSubst = createSubstitutor(option, true);
@@ -253,7 +254,8 @@ public class BuildEntryStorage extends AbstractEntryStorage {
} else {
// If resolved, add each resolved entry as a separate UserEntryInfo
boolean isMultiple = rVes.length > 1;
- List<UserEntryInfo> sequense = isMultiple ? new ArrayList<UserEntryInfo>(rVes.length) : null;
+ List<UserEntryInfo> sequense = isMultiple ? new ArrayList<UserEntryInfo>(rVes.length)
+ : null;
for (OptionStringValue rVe : rVes) {
ICLanguageSettingEntry entry = createUserEntry(option, rVe, flags, subst);
entryList.add(new UserEntryInfo(entry, ve, rVe, sequense));
@@ -271,15 +273,15 @@ public class BuildEntryStorage extends AbstractEntryStorage {
return new UserEntryInfo[0];
}
-// private static OptionStringValue stripQuotes(OptionStringValue ov) {
-// String value = ov.getValue();
-// value = stripQuotes(value, true);
-// if (value != null) {
-// value = value.substring(1, value.length() - 1);
-// ov = substituteValue(ov, value);
-// }
-// return ov;
-// }
+ // private static OptionStringValue stripQuotes(OptionStringValue ov) {
+ // String value = ov.getValue();
+ // value = stripQuotes(value, true);
+ // if (value != null) {
+ // value = value.substring(1, value.length() - 1);
+ // ov = substituteValue(ov, value);
+ // }
+ // return ov;
+ // }
private static String stripQuotes(String value, boolean nullIfNone) {
if (value.indexOf('"') == 0 && value.lastIndexOf('"') == value.length() - 1 && value.length() != 1) {
@@ -290,14 +292,15 @@ public class BuildEntryStorage extends AbstractEntryStorage {
}
private static OptionStringValue substituteValue(OptionStringValue ov, String value) {
- return new OptionStringValue(value, ov.isBuiltIn(), ov.getSourceAttachmentPath(), ov.getSourceAttachmentRootPath(), ov.getSourceAttachmentPrefixMapping());
+ return new OptionStringValue(value, ov.isBuiltIn(), ov.getSourceAttachmentPath(),
+ ov.getSourceAttachmentRootPath(), ov.getSourceAttachmentPrefixMapping());
}
private HashSet<String> getUserUndefinedStringSet() {
HashSet<String> set = null;
for (IOption option : fLangData.getUndefOptionsForKind(getKind())) {
@SuppressWarnings("unchecked")
- List<String> list = (List<String>)option.getValue();
+ List<String> list = (List<String>) option.getValue();
if (list.size() != 0) {
if (set == null)
set = new HashSet<String>();
@@ -342,8 +345,8 @@ public class BuildEntryStorage extends AbstractEntryStorage {
return new PathInfo(projPath, info.isWorkspacePath(), info.getSubstitutor());
}
-// private String[] resolve(String v, IOption option, IPath[] buildLocation) {
-// }
+ // private String[] resolve(String v, IOption option, IPath[] buildLocation) {
+ // }
private String[] resolve(String v, IOption option, SupplierBasedCdtVariableSubstitutor sub) {
try {
@@ -373,21 +376,22 @@ public class BuildEntryStorage extends AbstractEntryStorage {
int kind = getKind();
switch (kind) {
case ICSettingEntry.INCLUDE_PATH: {
- IEnvironmentVariableProvider provider = ManagedBuildManager.getEnvironmentVariableProvider();
- paths = provider.getBuildPaths(fLangData.getConfiguration(), IEnvVarBuildPath.BUILDPATH_INCLUDE);
- }
+ IEnvironmentVariableProvider provider = ManagedBuildManager.getEnvironmentVariableProvider();
+ paths = provider.getBuildPaths(fLangData.getConfiguration(), IEnvVarBuildPath.BUILDPATH_INCLUDE);
+ }
break;
case ICSettingEntry.LIBRARY_PATH: {
- IEnvironmentVariableProvider provider = ManagedBuildManager.getEnvironmentVariableProvider();
- paths = provider.getBuildPaths(fLangData.getConfiguration(), IEnvVarBuildPath.BUILDPATH_LIBRARY);
- }
+ IEnvironmentVariableProvider provider = ManagedBuildManager.getEnvironmentVariableProvider();
+ paths = provider.getBuildPaths(fLangData.getConfiguration(), IEnvVarBuildPath.BUILDPATH_LIBRARY);
+ }
break;
}
if (paths != null && paths.length != 0) {
ICLanguageSettingEntry entries[] = new ICLanguageSettingEntry[paths.length];
for (int i = 0; i < paths.length; i++) {
- entries[i] = (ICLanguageSettingEntry)CDataUtil.createEntry(kind, paths[i].toString(), null, null, flags);
+ entries[i] = (ICLanguageSettingEntry) CDataUtil.createEntry(kind, paths[i].toString(), null, null,
+ flags);
}
return entries;
@@ -398,7 +402,8 @@ public class BuildEntryStorage extends AbstractEntryStorage {
/**
* Create an ICLanguageSettingEntry based on the passed in Option
*/
- private ICLanguageSettingEntry createUserEntry(Option option, OptionStringValue optionValue, int flags, SupplierBasedCdtVariableSubstitutor subst) {
+ private ICLanguageSettingEntry createUserEntry(Option option, OptionStringValue optionValue, int flags,
+ SupplierBasedCdtVariableSubstitutor subst) {
final int kind = getKind();
if (kind == ICSettingEntry.MACRO) {
@@ -415,7 +420,8 @@ public class BuildEntryStorage extends AbstractEntryStorage {
if (pInfo.isWorkspacePath()) {
flags |= ICSettingEntry.VALUE_WORKSPACE_PATH;
} else if (optionPathConverter != null) {
- IPath path = optionPathConverter.convertToPlatformLocation(pInfo.getUnresolvedPath(), option, fLangData.getTool());
+ IPath path = optionPathConverter.convertToPlatformLocation(pInfo.getUnresolvedPath(), option,
+ fLangData.getTool());
if (path != null) {
pInfo = new PathInfo(path.toString(), false, subst);
}
@@ -448,23 +454,24 @@ public class BuildEntryStorage extends AbstractEntryStorage {
srcPrefixMapping = new Path(tmp);
}
- return (ICLanguageSettingEntry)CDataUtil.createEntry(kind, pInfo.getUnresolvedPath(), null, null, flags, srcPath, srcRootPath, srcPrefixMapping);
+ return (ICLanguageSettingEntry) CDataUtil.createEntry(kind, pInfo.getUnresolvedPath(), null, null, flags,
+ srcPath, srcRootPath, srcPrefixMapping);
}
- private OptionStringValue createOptionValue(IOption option, UserEntryInfo info, SupplierBasedCdtVariableSubstitutor subst) {
+ private OptionStringValue createOptionValue(IOption option, UserEntryInfo info,
+ SupplierBasedCdtVariableSubstitutor subst) {
if (info.fOriginalValue != null)
return info.fOriginalValue;
return entryValueToOption(option, info.fEntry, subst);
}
- private OptionStringValue entryValueToOption(IOption option, ICLanguageSettingEntry entry, SupplierBasedCdtVariableSubstitutor subst) {
+ private OptionStringValue entryValueToOption(IOption option, ICLanguageSettingEntry entry,
+ SupplierBasedCdtVariableSubstitutor subst) {
String optionValue = entryValueToOptionStringValue(option, entry, subst);
if (entry.getKind() == ICSettingEntry.LIBRARY_FILE) {
- ICLibraryFileEntry libFile = (ICLibraryFileEntry)entry;
- return new OptionStringValue(optionValue,
- false,
- pathToString(libFile.getSourceAttachmentPath()),
+ ICLibraryFileEntry libFile = (ICLibraryFileEntry) entry;
+ return new OptionStringValue(optionValue, false, pathToString(libFile.getSourceAttachmentPath()),
pathToString(libFile.getSourceAttachmentRootPath()),
pathToString(libFile.getSourceAttachmentPrefixMapping()));
}
@@ -475,7 +482,8 @@ public class BuildEntryStorage extends AbstractEntryStorage {
return path != null ? path.toString() : null;
}
- private String entryValueToOptionStringValue(IOption option, ICLanguageSettingEntry entry, SupplierBasedCdtVariableSubstitutor subst) {
+ private String entryValueToOptionStringValue(IOption option, ICLanguageSettingEntry entry,
+ SupplierBasedCdtVariableSubstitutor subst) {
String result;
boolean checkQuote = true;
if (entry.getKind() == ICSettingEntry.MACRO && entry.getValue().length() > 0) {
@@ -483,10 +491,11 @@ public class BuildEntryStorage extends AbstractEntryStorage {
} else if (entry instanceof ICLanguageSettingPathEntry) {
IOptionPathConverter converter = fLangData.getTool().getOptionPathConverter();
if (converter instanceof IReverseOptionPathConverter) {
- result = ((IReverseOptionPathConverter)converter).convertToOptionValue(entry, option, fLangData.getTool());
+ result = ((IReverseOptionPathConverter) converter).convertToOptionValue(entry, option,
+ fLangData.getTool());
checkQuote = false;
} else {
- ICLanguageSettingPathEntry pathEntry = (ICLanguageSettingPathEntry)entry;
+ ICLanguageSettingPathEntry pathEntry = (ICLanguageSettingPathEntry) entry;
result = doConvertToOptionValue(option, pathEntry, subst);
}
} else {
@@ -499,7 +508,8 @@ public class BuildEntryStorage extends AbstractEntryStorage {
return result;
}
- private String doConvertToOptionValue(IOption option, ICLanguageSettingPathEntry pathEntry, SupplierBasedCdtVariableSubstitutor subst) {
+ private String doConvertToOptionValue(IOption option, ICLanguageSettingPathEntry pathEntry,
+ SupplierBasedCdtVariableSubstitutor subst) {
boolean isWsp = pathEntry.isValueWorkspacePath();
PathInfo pInfo = new PathInfo(pathEntry.getName(), isWsp, subst);
String result;
@@ -543,7 +553,7 @@ public class BuildEntryStorage extends AbstractEntryStorage {
return IOption.STRING;
}
- private static String doubleQuotePath(String pathName, boolean nullIfNone) {
+ private static String doubleQuotePath(String pathName, boolean nullIfNone) {
/* Trim */
pathName = pathName.trim();
@@ -554,8 +564,7 @@ public class BuildEntryStorage extends AbstractEntryStorage {
boolean quoted = false;
/* Check for spaces, backslashes or macros */
- int i = pathName.indexOf(' ') + pathName.indexOf('\\')
- + pathName.indexOf("${"); //$NON-NLS-1$
+ int i = pathName.indexOf(' ') + pathName.indexOf('\\') + pathName.indexOf("${"); //$NON-NLS-1$
/* If indexOf didn't fail all three times, double-quote path */
if (i != -3) {
@@ -587,12 +596,12 @@ public class BuildEntryStorage extends AbstractEntryStorage {
return nv;
}
-// private static Object[] optionPathValueToEntry(String value) {
-// String wspPath = ManagedBuildManager.locationToFullPath(value);
-// if (wspPath != null)
-// return new Object[] { wspPath, Boolean.valueOf(true) };
-// return new Object[] { value, Boolean.valueOf(false) };
-// }
+ // private static Object[] optionPathValueToEntry(String value) {
+ // String wspPath = ManagedBuildManager.locationToFullPath(value);
+ // if (wspPath != null)
+ // return new Object[] { wspPath, Boolean.valueOf(true) };
+ // return new Object[] { value, Boolean.valueOf(false) };
+ // }
/**
* Returns a string representing the workspace relative path with ${workspace_loc: stripped
@@ -600,14 +609,13 @@ public class BuildEntryStorage extends AbstractEntryStorage {
* @param path String path to have workspace_loc removed
* @return workspace path or null
*/
- private static String locationToFullPath(String path){
+ private static String locationToFullPath(String path) {
path = path.trim();
// A path starting from "${workspace_loc}" is always a filesystem path.
// Only ${workspace_loc:/thing} is treated here as workspace path
- if(!path.startsWith("${workspace_loc:")) //$NON-NLS-1$
+ if (!path.startsWith("${workspace_loc:")) //$NON-NLS-1$
return null;
-
-
+
int index = -1;
int depth = 1;
for (int i = "${workspace_loc:".length(); i < path.length(); i++) { //$NON-NLS-1$
@@ -618,21 +626,21 @@ public class BuildEntryStorage extends AbstractEntryStorage {
index = i;
break;
}
- } else if (c == '{' && path.charAt(i-1) == '$') {
+ } else if (c == '{' && path.charAt(i - 1) == '$') {
depth++;
}
}
-
- if(index == -1)
+
+ if (index == -1)
return null;
String varName = "workspace_loc"; //$NON-NLS-1$
String str1 = path.substring(2, index);
String result = null;
- if(str1.startsWith(varName)){
- String str2= str1.substring(varName.length());
- if(str2.length() != 0){
- if(str2.startsWith(":")){ //$NON-NLS-1$
+ if (str1.startsWith(varName)) {
+ String str2 = str1.substring(varName.length());
+ if (str2.length() != 0) {
+ if (str2.startsWith(":")) { //$NON-NLS-1$
result = str2.substring(1);
}
} else {
@@ -667,10 +675,11 @@ public class BuildEntryStorage extends AbstractEntryStorage {
// We don't expect more than one option to manage a particular entry kind, though it
// is theoretically possible... Add a trace for Toolchain developers
if (options.length > 1)
- ManagedBuilderCorePlugin.error("Unexpected error: Warning more than one options found for kind " + getKind()); //$NON-NLS-1$
+ ManagedBuilderCorePlugin
+ .error("Unexpected error: Warning more than one options found for kind " + getKind()); //$NON-NLS-1$
if (options.length != 0) {
IOption option = options[0];
- OptionStringValue[] optValue;
+ OptionStringValue[] optValue;
if (entries.length != 0) {
entries = combineSequenses(entries);
@@ -778,7 +787,7 @@ public class BuildEntryStorage extends AbstractEntryStorage {
if (set != null && set.size() == 0)
set = null;
- String[] optValue = set != null ? (String[])set.toArray(new String[set.size()]) : new String[0];
+ String[] optValue = set != null ? (String[]) set.toArray(new String[set.size()]) : new String[0];
IOption option = options[0];
ITool tool = fLangData.getTool();
IResourceInfo rcInfo = tool.getParentResourceInfo();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildEnvironmentContributor.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildEnvironmentContributor.java
index 07cdc1b9407..d6639e8d843 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildEnvironmentContributor.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildEnvironmentContributor.java
@@ -33,15 +33,14 @@ public class BuildEnvironmentContributor implements IEnvironmentContributor {
private MbsEnvironmentSupplier fMbsSupplier = new MbsEnvironmentSupplier();
- public BuildEnvironmentContributor(BuildBuildData buildData){
+ public BuildEnvironmentContributor(BuildBuildData buildData) {
fBuildData = buildData;
fCfg = fBuildData.getBuilder().getParent().getParent();
fCfgDes = ManagedBuildManager.getDescriptionForConfiguration(fCfg);
}
@Override
- public IEnvironmentVariable getVariable(String name,
- IEnvironmentVariableManager provider) {
+ public IEnvironmentVariable getVariable(String name, IEnvironmentVariableManager provider) {
EnvironmentCollector collector = new EnvironmentCollector();
ExternalExtensionEnvironmentSupplier extSupplier = new ExternalExtensionEnvironmentSupplier(provider);
@@ -61,8 +60,7 @@ public class BuildEnvironmentContributor implements IEnvironmentContributor {
}
@Override
- public IEnvironmentVariable[] getVariables(
- IEnvironmentVariableManager provider) {
+ public IEnvironmentVariable[] getVariables(IEnvironmentVariableManager provider) {
EnvironmentCollector collector = new EnvironmentCollector();
ExternalExtensionEnvironmentSupplier extSupplier = new ExternalExtensionEnvironmentSupplier(provider);
@@ -80,12 +78,13 @@ public class BuildEnvironmentContributor implements IEnvironmentContributor {
return collector.getVariables();
}
- private boolean processVariable(String name, IEnvironmentVariable var, EnvironmentCollector collector, IEnvironmentVariableManager provider, boolean varFound){
- if(var != null){
- if(!varFound){
+ private boolean processVariable(String name, IEnvironmentVariable var, EnvironmentCollector collector,
+ IEnvironmentVariableManager provider, boolean varFound) {
+ if (var != null) {
+ if (!varFound) {
varFound = true;
IEnvironmentVariable base = provider.getVariable(name, fCfgDes, false);
- if(base != null)
+ if (base != null)
collector.addVariable(base);
}
collector.addVariable(var);
@@ -94,21 +93,22 @@ public class BuildEnvironmentContributor implements IEnvironmentContributor {
return varFound;
}
- private Set<String> processVariables(IEnvironmentVariable vars[], EnvironmentCollector collector, IEnvironmentVariableManager provider, Set<String> set){
+ private Set<String> processVariables(IEnvironmentVariable vars[], EnvironmentCollector collector,
+ IEnvironmentVariableManager provider, Set<String> set) {
boolean checkSet = true;
- if(vars != null && vars.length != 0){
- if(set == null){
+ if (vars != null && vars.length != 0) {
+ if (set == null) {
set = new HashSet<String>();
checkSet = false;
}
- for(int i = 0; i < vars.length; i++){
- if(vars[i] == null)
+ for (int i = 0; i < vars.length; i++) {
+ if (vars[i] == null)
continue;
- if(set.add(vars[i].getName()) || !checkSet){
+ if (set.add(vars[i].getName()) || !checkSet) {
IEnvironmentVariable base = provider.getVariable(vars[i].getName(), fCfgDes, false);
- if(base != null){
+ if (base != null) {
collector.addVariable(base);
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildFileData.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildFileData.java
index fae1ab6133a..f66dd48373b 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildFileData.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildFileData.java
@@ -21,11 +21,12 @@ import org.eclipse.core.runtime.IPath;
public class BuildFileData extends CFileData {
private ResourceConfiguration fFileInfo;
- public BuildFileData(IFileInfo fileInfo){
- fFileInfo = (ResourceConfiguration)fileInfo;
+
+ public BuildFileData(IFileInfo fileInfo) {
+ fFileInfo = (ResourceConfiguration) fileInfo;
}
-
- public IFileInfo getFileInfo(){
+
+ public IFileInfo getFileInfo() {
return fFileInfo;
}
@@ -34,13 +35,13 @@ public class BuildFileData extends CFileData {
return fFileInfo.getPath();
}
-// public boolean isExcluded() {
-// return fFileInfo.isExcluded();
-// }
-//
-// public void setExcluded(boolean excluded) {
-// fFileInfo.setExclude(excluded);
-// }
+ // public boolean isExcluded() {
+ // return fFileInfo.isExcluded();
+ // }
+ //
+ // public void setExcluded(boolean excluded) {
+ // fFileInfo.setExclude(excluded);
+ // }
@Override
public void setPath(IPath path) {
@@ -58,7 +59,7 @@ public class BuildFileData extends CFileData {
}
public void setName(String name) {
-// fFileInfo.setN
+ // fFileInfo.setN
}
@Override
@@ -69,7 +70,7 @@ public class BuildFileData extends CFileData {
@Override
public CLanguageData getLanguageData() {
CLanguageData datas[] = fFileInfo.getCLanguageDatas();
- if(datas.length > 0)
+ if (datas.length > 0)
return datas[0];
return null;
}
@@ -78,10 +79,10 @@ public class BuildFileData extends CFileData {
public boolean hasCustomSettings() {
return fFileInfo.hasCustomSettings();
}
-
- void clearCachedData(){
- BuildLanguageData lData = (BuildLanguageData)getLanguageData();
- if(lData != null)
+
+ void clearCachedData() {
+ BuildLanguageData lData = (BuildLanguageData) getLanguageData();
+ if (lData != null)
lData.clearCachedData();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildFolderData.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildFolderData.java
index 22b4f2c4a08..a84cc6e1996 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildFolderData.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildFolderData.java
@@ -21,11 +21,12 @@ import org.eclipse.core.runtime.IPath;
public class BuildFolderData extends CFolderData {
private FolderInfo fFolderInfo;
- public BuildFolderData(IFolderInfo folderInfo){
- fFolderInfo = (FolderInfo)folderInfo;
+
+ public BuildFolderData(IFolderInfo folderInfo) {
+ fFolderInfo = (FolderInfo) folderInfo;
}
-
- public IFolderInfo getFolderInfo(){
+
+ public IFolderInfo getFolderInfo() {
return fFolderInfo;
}
@@ -39,13 +40,13 @@ public class BuildFolderData extends CFolderData {
return fFolderInfo.getPath();
}
-// public boolean isExcluded() {
-// return fFolderInfo.isExcluded();
-// }
-//
-// public void setExcluded(boolean excluded) {
-// fFolderInfo.setExclude(excluded);
-// }
+ // public boolean isExcluded() {
+ // return fFolderInfo.isExcluded();
+ // }
+ //
+ // public void setExcluded(boolean excluded) {
+ // fFolderInfo.setExclude(excluded);
+ // }
@Override
public void setPath(IPath path) {
@@ -72,15 +73,13 @@ public class BuildFolderData extends CFolderData {
}
@Override
- public CLanguageData createLanguageDataForContentTypes(String languageId,
- String[] typesIds) {
+ public CLanguageData createLanguageDataForContentTypes(String languageId, String[] typesIds) {
// TODO Auto-generated method stub
return null;
}
@Override
- public CLanguageData createLanguageDataForExtensions(String languageId,
- String[] extensions) {
+ public CLanguageData createLanguageDataForExtensions(String languageId, String[] extensions) {
// TODO Auto-generated method stub
return null;
}
@@ -89,18 +88,18 @@ public class BuildFolderData extends CFolderData {
public boolean hasCustomSettings() {
return fFolderInfo.hasCustomSettings();
}
-
- void clearCachedData(){
+
+ void clearCachedData() {
CLanguageData[] lDatas = getLanguageDatas();
- for(int i = 0; i < lDatas.length; i++){
- ((BuildLanguageData)lDatas[i]).clearCachedData();
+ for (int i = 0; i < lDatas.length; i++) {
+ ((BuildLanguageData) lDatas[i]).clearCachedData();
}
}
public boolean containsScannerInfo() {
return fFolderInfo.containsDiscoveredScannerInfo();
}
-
+
public void setContainsDiscoveredScannerInfo(boolean contains) {
fFolderInfo.setContainsDiscoveredScannerInfo(contains);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildLanguageData.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildLanguageData.java
index 194f26088c9..24dbef293d4 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildLanguageData.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildLanguageData.java
@@ -39,7 +39,7 @@ import org.eclipse.cdt.managedbuilder.internal.core.ResourceConfiguration;
/**
* This class holds the language data for managed build tool
- *
+ *
* It current holds both the main kind => BuildEntryStorage
* mapping as well as mappings on the currently undef'd kinds
* (e.g. a language setting entry defined by scanner discovery
@@ -52,7 +52,7 @@ public class BuildLanguageData extends CLanguageData {
private ITool fTool;
private IInputType fInputType;
- /** The main kind => BuildEntryStorage store
+ /** The main kind => BuildEntryStorage store
* The BuildEntryStorage calls back to this BuildLanguageData
* to work out which entries are actually (un)defined. */
private KindBasedStore<BuildEntryStorage> fKindToEntryStore = new KindBasedStore<BuildEntryStorage>();
@@ -62,93 +62,92 @@ public class BuildLanguageData extends CLanguageData {
private KindBasedStore<IOption[]> fKindToOptionArrayStore = new KindBasedStore<IOption[]>();
private KindBasedStore<IOption[]> fKindToUndefOptionArrayStore = new KindBasedStore<IOption[]>();
-// private Map fKindToEntryArrayMap = new HashMap();
-// private ProfileInfoProvider fDiscoveredInfo;
-
+ // private Map fKindToEntryArrayMap = new HashMap();
+ // private ProfileInfoProvider fDiscoveredInfo;
- public BuildLanguageData(ITool tool, IInputType inType){
+ public BuildLanguageData(ITool tool, IInputType inType) {
fTool = tool;
- if(inType != null){
-// inType = tool.getEdtableInputType(inType);
+ if (inType != null) {
+ // inType = tool.getEdtableInputType(inType);
fInputType = inType;
- if(inType.getParent() != tool)
+ if (inType.getParent() != tool)
throw new IllegalArgumentException();
-// IInputType extType = inType;
-// for(;extType != null && !extType.isExtensionElement(); extType = extType.getSuperClass());
-// String typeId;
-// if(extType != null)
-// typeId = extType.getId();
-// else
-// typeId = inType.getId();
+ // IInputType extType = inType;
+ // for(;extType != null && !extType.isExtensionElement(); extType = extType.getSuperClass());
+ // String typeId;
+ // if(extType != null)
+ // typeId = extType.getId();
+ // else
+ // typeId = inType.getId();
fId = inType.getId();//new StringBuilder(fTool.getId()).append(".").append(typeId).toString();
} else {
fInputType = null;
fId = new StringBuilder(fTool.getId()).append(".").append("languagedata").toString(); //$NON-NLS-1$ //$NON-NLS-2$
}
-
-// fDiscoveredInfo = new ProfileInfoProvider(this);
+
+ // fDiscoveredInfo = new ProfileInfoProvider(this);
}
-
- private void obtainEditableInputType(){
- if(fInputType != null){
-// IInputType old = fInputType;
+
+ private void obtainEditableInputType() {
+ if (fInputType != null) {
+ // IInputType old = fInputType;
fInputType = fTool.getEditableInputType(fInputType);
-// if(old != fInputType){
-// fDiscoveredInfo.checkUpdateInputType(fInputType);
-// }
+ // if(old != fInputType){
+ // fDiscoveredInfo.checkUpdateInputType(fInputType);
+ // }
}
}
@Override
public void setEntries(int kind, ICLanguageSettingEntry entries[]) {
BuildEntryStorage storage = getEntryStorage(kind);
- if(storage != null)
+ if (storage != null)
storage.setEntries(entries);
}
-
- private BuildEntryStorage getEntryStorage(int kind){
- if(getOptionsForKind(kind).length == 0 && isToolChainDiscoveryProfile())
+
+ private BuildEntryStorage getEntryStorage(int kind) {
+ if (getOptionsForKind(kind).length == 0 && isToolChainDiscoveryProfile())
return null;
-
+
BuildEntryStorage storage = fKindToEntryStore.get(kind);
- if(storage == null){
+ if (storage == null) {
storage = new BuildEntryStorage(kind, this);
fKindToEntryStore.put(kind, storage);
}
return storage;
}
-
- private void notifyOptionsChangeForKind(int kind){
+
+ private void notifyOptionsChangeForKind(int kind) {
fOptionStoreInited = false;
BuildEntryStorage storage = getEntryStorage(kind);
- if(storage != null)
+ if (storage != null)
storage.optionsChanged();
}
-
- public void optionsChanged(int type){
+
+ public void optionsChanged(int type) {
int kind = ManagedBuildManager.optionTypeToEntryKind(type);
- if(kind == 0)
+ if (kind == 0)
kind = ManagedBuildManager.optionUndefTypeToEntryKind(type);
-
- if(kind != 0)
+
+ if (kind != 0)
notifyOptionsChangeForKind(kind);
}
-
-// private ProfileInfoProvider getDiscoveredInfoProvider(){
-// return fDiscoveredInfo;
-// }
-/*
- private String getOptionValueFromEntry(ICLanguageSettingEntry entry){
- String optValue = entry.getName();
- if(entry.getKind() == ICLanguageSettingEntry.MACRO){
- String macroValue = entry.getValue();
- StringBuilder buf = new StringBuilder(optValue).append('=').append(macroValue);
- optValue = buf.toString();
+
+ // private ProfileInfoProvider getDiscoveredInfoProvider(){
+ // return fDiscoveredInfo;
+ // }
+ /*
+ private String getOptionValueFromEntry(ICLanguageSettingEntry entry){
+ String optValue = entry.getName();
+ if(entry.getKind() == ICLanguageSettingEntry.MACRO){
+ String macroValue = entry.getValue();
+ StringBuilder buf = new StringBuilder(optValue).append('=').append(macroValue);
+ optValue = buf.toString();
+ }
+ return optValue;
+
}
- return optValue;
-
- }
-*/
+ */
@Override
public String getLanguageId() {
return fInputType != null ? fInputType.getLanguageId(fTool) : null;
@@ -157,43 +156,43 @@ public class BuildLanguageData extends CLanguageData {
@Override
public ICLanguageSettingEntry[] getEntries(int kinds) {
List<ICLanguageSettingEntry> list = new ArrayList<ICLanguageSettingEntry>();
-
- if((kinds & ICLanguageSettingEntry.INCLUDE_PATH) != 0) {
+
+ if ((kinds & ICLanguageSettingEntry.INCLUDE_PATH) != 0) {
BuildEntryStorage storage = getEntryStorage(ICLanguageSettingEntry.INCLUDE_PATH);
- if(storage != null)
+ if (storage != null)
storage.getEntries(list);
- } else if((kinds & ICLanguageSettingEntry.INCLUDE_FILE) != 0) {
+ } else if ((kinds & ICLanguageSettingEntry.INCLUDE_FILE) != 0) {
BuildEntryStorage storage = getEntryStorage(ICLanguageSettingEntry.INCLUDE_FILE);
- if(storage != null)
+ if (storage != null)
storage.getEntries(list);
- } else if((kinds & ICLanguageSettingEntry.MACRO) != 0) {
+ } else if ((kinds & ICLanguageSettingEntry.MACRO) != 0) {
BuildEntryStorage storage = getEntryStorage(ICLanguageSettingEntry.MACRO);
- if(storage != null)
+ if (storage != null)
storage.getEntries(list);
- } else if((kinds & ICLanguageSettingEntry.MACRO_FILE) != 0) {
+ } else if ((kinds & ICLanguageSettingEntry.MACRO_FILE) != 0) {
BuildEntryStorage storage = getEntryStorage(ICLanguageSettingEntry.MACRO_FILE);
- if(storage != null)
+ if (storage != null)
storage.getEntries(list);
- } else if((kinds & ICLanguageSettingEntry.LIBRARY_PATH) != 0) {
+ } else if ((kinds & ICLanguageSettingEntry.LIBRARY_PATH) != 0) {
BuildEntryStorage storage = getEntryStorage(ICLanguageSettingEntry.LIBRARY_PATH);
- if(storage != null)
+ if (storage != null)
storage.getEntries(list);
- } else if((kinds & ICLanguageSettingEntry.LIBRARY_FILE) != 0) {
+ } else if ((kinds & ICLanguageSettingEntry.LIBRARY_FILE) != 0) {
BuildEntryStorage storage = getEntryStorage(ICLanguageSettingEntry.LIBRARY_FILE);
- if(storage != null)
+ if (storage != null)
storage.getEntries(list);
}
return list.toArray(new ICLanguageSettingEntry[list.size()]);
}
-
- public void updateInputType(IInputType type){
+
+ public void updateInputType(IInputType type) {
fInputType = type;
}
-
+
@Override
public String[] getSourceContentTypeIds() {
- if(fInputType != null){
+ if (fInputType != null) {
return fInputType.getSourceContentTypeIds();
}
return null;
@@ -209,22 +208,22 @@ public class BuildLanguageData extends CLanguageData {
KindBasedStore<IOption[]> store = getKindToOptionArrayStore();
IKindBasedInfo<IOption[]>[] infos = store.getContents();
int kinds = 0;
- for(int i = 0; i < infos.length; i++){
- if(infos[i].getInfo().length > 0)
- kinds |= infos[i].getKind();
+ for (int i = 0; i < infos.length; i++) {
+ if (infos[i].getInfo().length > 0)
+ kinds |= infos[i].getKind();
}
return kinds;
}
-
- private KindBasedStore<IOption[]> getKindToOptionArrayStore(){
+
+ private KindBasedStore<IOption[]> getKindToOptionArrayStore() {
initOptionStores();
return fKindToOptionArrayStore;
}
private void initOptionStores() {
- if(!fOptionStoreInited) {
+ if (!fOptionStoreInited) {
synchronized (this) {
- if(!fOptionStoreInited) {
+ if (!fOptionStoreInited) {
calculateKindToOptionArrayStore();
calculateKindToUndefOptionArrayStore();
fOptionStoreInited = true;
@@ -233,21 +232,25 @@ public class BuildLanguageData extends CLanguageData {
}
}
- private KindBasedStore<IOption[]> getKindToUndefOptionArrayStore(){
+ private KindBasedStore<IOption[]> getKindToUndefOptionArrayStore() {
initOptionStores();
return fKindToUndefOptionArrayStore;
}
- private void calculateKindToOptionArrayStore(){
+ private void calculateKindToOptionArrayStore() {
fKindToOptionArrayStore.clear();
Map<Integer, List<IOption>> kindToOptionList = new HashMap<Integer, List<IOption>>();
IOption options[] = fTool.getOptions();
for (final IOption option : options) {
try {
Integer entryKind = ManagedBuildManager.optionTypeToEntryKind(option.getValueType());
- if(entryKind != 0){
+ if (entryKind != 0) {
if (!kindToOptionList.containsKey(entryKind))
- kindToOptionList.put(entryKind, new ArrayList<IOption>(3){{add(option);}});
+ kindToOptionList.put(entryKind, new ArrayList<IOption>(3) {
+ {
+ add(option);
+ }
+ });
else
kindToOptionList.get(entryKind).add(option);
}
@@ -258,7 +261,7 @@ public class BuildLanguageData extends CLanguageData {
IKindBasedInfo<IOption[]>[] infos = fKindToOptionArrayStore.getContents();
for (IKindBasedInfo<IOption[]> info : infos) {
List<IOption> list = kindToOptionList.get(info.getKind());
- if(list != null){
+ if (list != null) {
IOption[] opts = list.toArray(new IOption[list.size()]);
info.setInfo(opts);
} else {
@@ -266,17 +269,21 @@ public class BuildLanguageData extends CLanguageData {
}
}
}
-
- private void calculateKindToUndefOptionArrayStore(){
+
+ private void calculateKindToUndefOptionArrayStore() {
fKindToUndefOptionArrayStore.clear();
Map<Integer, List<IOption>> kindToOptionList = new HashMap<Integer, List<IOption>>();
IOption options[] = fTool.getOptions();
for (final IOption option : options) {
try {
Integer entryKind = ManagedBuildManager.optionUndefTypeToEntryKind(option.getValueType());
- if(entryKind != 0){
+ if (entryKind != 0) {
if (!kindToOptionList.containsKey(entryKind))
- kindToOptionList.put(entryKind, new ArrayList<IOption>(3){{add(option);}});
+ kindToOptionList.put(entryKind, new ArrayList<IOption>(3) {
+ {
+ add(option);
+ }
+ });
else
kindToOptionList.get(entryKind).add(option);
}
@@ -287,7 +294,7 @@ public class BuildLanguageData extends CLanguageData {
IKindBasedInfo<IOption[]>[] infos = fKindToUndefOptionArrayStore.getContents();
for (IKindBasedInfo<IOption[]> info : infos) {
List<IOption> list = kindToOptionList.get(info.getKind());
- if(list != null){
+ if (list != null) {
IOption[] opts = list.toArray(new IOption[list.size()]);
info.setInfo(opts);
} else {
@@ -296,28 +303,27 @@ public class BuildLanguageData extends CLanguageData {
}
}
-
- IOption[] getUndefOptionsForKind(int entryKind){
+ IOption[] getUndefOptionsForKind(int entryKind) {
KindBasedStore<IOption[]> store = getKindToUndefOptionArrayStore();
return store.get(entryKind);
}
- IOption[] getOptionsForKind(int entryKind){
+ IOption[] getOptionsForKind(int entryKind) {
KindBasedStore<IOption[]> store = getKindToOptionArrayStore();
return store.get(entryKind);
}
-
-/* private IOption[] getOptionsForType(int type){
- Map map = getTypeToOptionArrayMap();
- return (IOption[])map.get(Integer.valueOf(type));
-
- }
-*/
+
+ /* private IOption[] getOptionsForType(int type){
+ Map map = getTypeToOptionArrayMap();
+ return (IOption[])map.get(Integer.valueOf(type));
+
+ }
+ */
@Override
public void setLanguageId(String id) {
- if(CDataUtil.objectsEqual(id, fInputType.getLanguageId(fTool))){
-// fInputType = fTool.getEdtableInputType(fInputType);
+ if (CDataUtil.objectsEqual(id, fInputType.getLanguageId(fTool))) {
+ // fInputType = fTool.getEdtableInputType(fInputType);
obtainEditableInputType();
fInputType.setLanguageIdAttribute(id);
}
@@ -331,18 +337,18 @@ public class BuildLanguageData extends CLanguageData {
@Override
public String getName() {
String name;
- if(fInputType == null){
+ if (fInputType == null) {
name = fTool.getName();
- if(name == null){
+ if (name == null) {
String[] exts = getSourceExtensions();
- if(exts.length != 0){
+ if (exts.length != 0) {
name = CDataUtil.arrayToString(exts, ","); //$NON-NLS-1$
} else {
name = fTool.getId();
}
}
} else {
- name = fInputType.getLanguageName(fTool);
+ name = fInputType.getLanguageName(fTool);
}
return name;
}
@@ -356,70 +362,68 @@ public class BuildLanguageData extends CLanguageData {
public void setName(String name) {
// TODO Auto-generated method stub
}
-
- public ITool getTool(){
+
+ public ITool getTool() {
return fTool;
}
-
+
public IInputType getInputType() {
return fInputType;
}
-
- boolean isToolChainDiscoveryProfile(){
- return fInputType != null ?
- ((InputType)fInputType).getDiscoveryProfileIdAttribute() == null :
- true;
+
+ boolean isToolChainDiscoveryProfile() {
+ return fInputType != null ? ((InputType) fInputType).getDiscoveryProfileIdAttribute() == null : true;
}
-
- String getDiscoveryProfileId(){
- if(fInputType != null)
- return fInputType.getDiscoveryProfileId(fTool);
+
+ String getDiscoveryProfileId() {
+ if (fInputType != null)
+ return fInputType.getDiscoveryProfileId(fTool);
IBuildObject bo = fTool.getParent();
- if(bo instanceof IToolChain)
- return ((IToolChain)bo).getScannerConfigDiscoveryProfileId();
- else if(bo instanceof IResourceInfo){
- IToolChain tCh = ((ResourceConfiguration)bo).getBaseToolChain();
- if(tCh != null)
+ if (bo instanceof IToolChain)
+ return ((IToolChain) bo).getScannerConfigDiscoveryProfileId();
+ else if (bo instanceof IResourceInfo) {
+ IToolChain tCh = ((ResourceConfiguration) bo).getBaseToolChain();
+ if (tCh != null)
return tCh.getScannerConfigDiscoveryProfileId();
}
return null;
}
-
- public IConfiguration getConfiguration(){
+
+ public IConfiguration getConfiguration() {
return fTool.getParentResourceInfo().getParent();
}
@Override
public void setSourceContentTypeIds(String[] ids) {
String[] headerIds = fInputType.getHeaderContentTypeIds();
-
+
List<String> newSrc = new ArrayList<String>(ids.length);
List<String> newHeaders = new ArrayList<String>(ids.length);
- for(int i = 0; i < ids.length; i++){
+ for (int i = 0; i < ids.length; i++) {
String id = ids[i];
int j = 0;
- for(; j < headerIds.length; j++){
- if(id.equals(headerIds[j])){
+ for (; j < headerIds.length; j++) {
+ if (id.equals(headerIds[j])) {
newHeaders.add(id);
break;
}
}
- if(j == headerIds.length){
+ if (j == headerIds.length) {
newSrc.add(id);
}
}
-
+
String newSrcIds[] = newSrc.toArray(new String[newSrc.size()]);
String newHeaderIds[] = newHeaders.toArray(new String[newHeaders.size()]);
-
- if(!Arrays.equals(newSrcIds, fInputType.getSourceContentTypeIds())){
-// fInputType = fTool.getEdtableInputType(fInputType);
+
+ if (!Arrays.equals(newSrcIds, fInputType.getSourceContentTypeIds())) {
+ // fInputType = fTool.getEdtableInputType(fInputType);
obtainEditableInputType();
fInputType.setSourceContentTypeIds(newSrcIds);
}
- if(!Arrays.equals(newHeaderIds, fInputType.getHeaderContentTypeIds())){
-// fInputType = fTool.getEdtableInputType(fInputType);
+ if (!Arrays.equals(newHeaderIds, fInputType.getHeaderContentTypeIds())) {
+ // fInputType = fTool.getEdtableInputType(fInputType);
obtainEditableInputType();
fInputType.setHeaderContentTypeIds(newHeaderIds);
}
@@ -429,18 +433,18 @@ public class BuildLanguageData extends CLanguageData {
@Override
public void setSourceExtensions(String[] exts) {
// TODO Auto-generated method stub
-
+
}
-
- void clearCachedData(){
- fKindToEntryStore.clear();
+
+ void clearCachedData() {
+ fKindToEntryStore.clear();
}
@Override
public boolean containsDiscoveredScannerInfo() {
IResourceInfo rcInfo = fTool.getParentResourceInfo();
- if(rcInfo instanceof FolderInfo){
- return ((FolderInfo)rcInfo).containsDiscoveredScannerInfo();
+ if (rcInfo instanceof FolderInfo) {
+ return ((FolderInfo) rcInfo).containsDiscoveredScannerInfo();
}
return true;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildSystemSpecificVariableSubstitutor.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildSystemSpecificVariableSubstitutor.java
index 1b0e05f002e..0ddfc08d41d 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildSystemSpecificVariableSubstitutor.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildSystemSpecificVariableSubstitutor.java
@@ -25,35 +25,31 @@ import org.eclipse.cdt.utils.cdtvariables.CdtVariableResolver;
import org.eclipse.cdt.utils.cdtvariables.IVariableContextInfo;
import org.eclipse.cdt.utils.cdtvariables.SupplierBasedCdtVariableSubstitutor;
-public class BuildSystemSpecificVariableSubstitutor extends SupplierBasedCdtVariableSubstitutor{
- private static final Set<String> fFileVarsSet = new HashSet<String>(Arrays.asList(MbsMacroSupplier.getInstance().getMacroNames(IBuildMacroProvider.CONTEXT_FILE)));
- private static final Set<String> fOptionVarsSet = new HashSet<String>(Arrays.asList(MbsMacroSupplier.getInstance().getMacroNames(IBuildMacroProvider.CONTEXT_OPTION)));
- private static final Set<String> fToolVarsSet = new HashSet<String>(Arrays.asList(MbsMacroSupplier.getInstance().getMacroNames(IBuildMacroProvider.CONTEXT_TOOL)));
-
- public BuildSystemSpecificVariableSubstitutor(
- IVariableContextInfo contextInfo, String inexistentMacroValue,
- String listDelimiter, Map<String, String> delimiterMap,
- String incorrectlyReferencedMacroValue) {
- super(contextInfo, inexistentMacroValue, listDelimiter, delimiterMap,
- incorrectlyReferencedMacroValue);
+public class BuildSystemSpecificVariableSubstitutor extends SupplierBasedCdtVariableSubstitutor {
+ private static final Set<String> fFileVarsSet = new HashSet<String>(
+ Arrays.asList(MbsMacroSupplier.getInstance().getMacroNames(IBuildMacroProvider.CONTEXT_FILE)));
+ private static final Set<String> fOptionVarsSet = new HashSet<String>(
+ Arrays.asList(MbsMacroSupplier.getInstance().getMacroNames(IBuildMacroProvider.CONTEXT_OPTION)));
+ private static final Set<String> fToolVarsSet = new HashSet<String>(
+ Arrays.asList(MbsMacroSupplier.getInstance().getMacroNames(IBuildMacroProvider.CONTEXT_TOOL)));
+
+ public BuildSystemSpecificVariableSubstitutor(IVariableContextInfo contextInfo, String inexistentMacroValue,
+ String listDelimiter, Map<String, String> delimiterMap, String incorrectlyReferencedMacroValue) {
+ super(contextInfo, inexistentMacroValue, listDelimiter, delimiterMap, incorrectlyReferencedMacroValue);
}
- public BuildSystemSpecificVariableSubstitutor(IVariableContextInfo contextInfo){
+ public BuildSystemSpecificVariableSubstitutor(IVariableContextInfo contextInfo) {
this(contextInfo, "", " "); //$NON-NLS-1$ //$NON-NLS-2$
}
- public BuildSystemSpecificVariableSubstitutor(
- IVariableContextInfo contextInfo, String inexistentMacroValue,
+ public BuildSystemSpecificVariableSubstitutor(IVariableContextInfo contextInfo, String inexistentMacroValue,
String listDelimiter) {
super(contextInfo, inexistentMacroValue, listDelimiter);
}
@Override
- protected ResolvedMacro resolveMacro(String macroName)
- throws CdtVariableException {
- if(fFileVarsSet.contains(macroName)
- || fOptionVarsSet.contains(macroName)
- || fToolVarsSet.contains(macroName))
+ protected ResolvedMacro resolveMacro(String macroName) throws CdtVariableException {
+ if (fFileVarsSet.contains(macroName) || fOptionVarsSet.contains(macroName) || fToolVarsSet.contains(macroName))
return super.resolveMacro(macroName);
return new ResolvedMacro(macroName, CdtVariableResolver.createVariableReference(macroName));
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildTargetPlatformData.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildTargetPlatformData.java
index 258ccb462a0..2519018dfcd 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildTargetPlatformData.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildTargetPlatformData.java
@@ -19,9 +19,10 @@ import org.eclipse.cdt.managedbuilder.internal.core.TargetPlatform;
public class BuildTargetPlatformData extends CTargetPlatformData {
private TargetPlatform fTargetPlatform;
- public BuildTargetPlatformData(TargetPlatform targetPlatform){
+ public BuildTargetPlatformData(TargetPlatform targetPlatform) {
fTargetPlatform = targetPlatform;
}
+
@Override
public String[] getBinaryParserIds() {
return fTargetPlatform.getBinaryParserList();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildVariablesContributor.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildVariablesContributor.java
index 5bce7632d0c..9ac9bea1b21 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildVariablesContributor.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildVariablesContributor.java
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.internal.dataprovider;
-
import org.eclipse.cdt.core.cdtvariables.ICdtVariable;
import org.eclipse.cdt.core.cdtvariables.ICdtVariableManager;
import org.eclipse.cdt.core.cdtvariables.ICdtVariablesContributor;
@@ -40,77 +39,60 @@ public class BuildVariablesContributor implements ICdtVariablesContributor {
ICdtVariableManager fMngr;
private ICConfigurationDescription fCfgDes;
- public ContributorMacroContextInfo(ICdtVariableManager mngr, ICConfigurationDescription cfgDes,
- int type, Object data) {
+ public ContributorMacroContextInfo(ICdtVariableManager mngr, ICConfigurationDescription cfgDes, int type,
+ Object data) {
super(type, data);
fMngr = mngr;
fCfgDes = cfgDes;
}
-
@Override
protected ICdtVariableSupplier[] getSuppliers(int type, Object data) {
- switch(type){
+ switch (type) {
case IBuildMacroProvider.CONTEXT_CONFIGURATION:
- return new ICdtVariableSupplier[]{
- new ExternalExtensionMacroSupplier(fMngr, fCfgDes),
- MbsMacroSupplier.getInstance()
- };
+ return new ICdtVariableSupplier[] { new ExternalExtensionMacroSupplier(fMngr, fCfgDes),
+ MbsMacroSupplier.getInstance() };
case IBuildMacroProvider.CONTEXT_PROJECT:
- return new ICdtVariableSupplier[]{
- new ExternalExtensionMacroSupplier(fMngr, fCfgDes),
- MbsMacroSupplier.getInstance()
- };
+ return new ICdtVariableSupplier[] { new ExternalExtensionMacroSupplier(fMngr, fCfgDes),
+ MbsMacroSupplier.getInstance() };
case IBuildMacroProvider.CONTEXT_WORKSPACE:
- return new ICdtVariableSupplier[]{
- MbsMacroSupplier.getInstance()
- };
+ return new ICdtVariableSupplier[] { MbsMacroSupplier.getInstance() };
}
return null;
}
-
@Override
public IVariableContextInfo getNext() {
- switch(getContextType()){
- case IBuildMacroProvider.CONTEXT_CONFIGURATION:{
- Object data = getContextData();
- IConfiguration configuration = null;
- if(data instanceof IBuilder)
- configuration = ((IBuilder)data).getParent().getParent();
- else if(data instanceof IConfiguration)
- configuration = (IConfiguration)data;
+ switch (getContextType()) {
+ case IBuildMacroProvider.CONTEXT_CONFIGURATION: {
+ Object data = getContextData();
+ IConfiguration configuration = null;
+ if (data instanceof IBuilder)
+ configuration = ((IBuilder) data).getParent().getParent();
+ else if (data instanceof IConfiguration)
+ configuration = (IConfiguration) data;
- if(configuration != null){
- IManagedProject managedProject = configuration.getManagedProject();
- if(managedProject != null)
- return new ContributorMacroContextInfo(
- fMngr,
- fCfgDes,
- IBuildMacroProvider.CONTEXT_PROJECT,
- managedProject);
- }
+ if (configuration != null) {
+ IManagedProject managedProject = configuration.getManagedProject();
+ if (managedProject != null)
+ return new ContributorMacroContextInfo(fMngr, fCfgDes, IBuildMacroProvider.CONTEXT_PROJECT,
+ managedProject);
}
+ }
break;
- case IBuildMacroProvider.CONTEXT_PROJECT:{
- Object data = getContextData();
- if(data instanceof IManagedProject){
- IWorkspace wsp = ResourcesPlugin.getWorkspace();
- if(wsp != null)
- return new ContributorMacroContextInfo(
- fMngr,
- fCfgDes,
- IBuildMacroProvider.CONTEXT_WORKSPACE,
- wsp);
- }
+ case IBuildMacroProvider.CONTEXT_PROJECT: {
+ Object data = getContextData();
+ if (data instanceof IManagedProject) {
+ IWorkspace wsp = ResourcesPlugin.getWorkspace();
+ if (wsp != null)
+ return new ContributorMacroContextInfo(fMngr, fCfgDes, IBuildMacroProvider.CONTEXT_WORKSPACE,
+ wsp);
}
+ }
break;
case IBuildMacroProvider.CONTEXT_WORKSPACE:
- if(getContextData() instanceof IWorkspace){
- return new ContributorMacroContextInfo(
- fMngr,
- fCfgDes,
- IBuildMacroProvider.CONTEXT_INSTALLATIONS,
+ if (getContextData() instanceof IWorkspace) {
+ return new ContributorMacroContextInfo(fMngr, fCfgDes, IBuildMacroProvider.CONTEXT_INSTALLATIONS,
null);
}
break;
@@ -119,28 +101,25 @@ public class BuildVariablesContributor implements ICdtVariablesContributor {
}
}
- BuildVariablesContributor(BuildConfigurationData data){
+ BuildVariablesContributor(BuildConfigurationData data) {
fCfgData = data;
}
@Override
public ICdtVariable getVariable(String name, ICdtVariableManager provider) {
ContributorMacroContextInfo info = createContextInfo(provider);
- if(info != null)
+ if (info != null)
return SupplierBasedCdtVariableManager.getVariable(name, info, true);
return null;
}
- private ContributorMacroContextInfo createContextInfo(ICdtVariableManager mngr){
+ private ContributorMacroContextInfo createContextInfo(ICdtVariableManager mngr) {
IConfiguration cfg = fCfgData.getConfiguration();
- if(((Configuration)cfg).isPreference())
+ if (((Configuration) cfg).isPreference())
return null;
ICConfigurationDescription cfgDes = ManagedBuildManager.getDescriptionForConfiguration(cfg);
- if(cfgDes != null){
- return new ContributorMacroContextInfo(mngr,
- cfgDes,
- BuildMacroProvider.CONTEXT_CONFIGURATION,
- cfg);
+ if (cfgDes != null) {
+ return new ContributorMacroContextInfo(mngr, cfgDes, BuildMacroProvider.CONTEXT_CONFIGURATION, cfg);
}
return null;
}
@@ -148,7 +127,7 @@ public class BuildVariablesContributor implements ICdtVariablesContributor {
@Override
public ICdtVariable[] getVariables(ICdtVariableManager provider) {
ContributorMacroContextInfo info = createContextInfo(provider);
- if(info != null)
+ if (info != null)
return SupplierBasedCdtVariableManager.getVariables(info, true);
return null;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ConfigurationDataProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ConfigurationDataProvider.java
index 351a1a648c1..463e4ff8a32 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ConfigurationDataProvider.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ConfigurationDataProvider.java
@@ -73,19 +73,22 @@ import org.eclipse.core.runtime.content.IContentType;
* Provides & Persists Build configuration data in the project model storage.
*/
public class ConfigurationDataProvider extends CConfigurationDataProvider implements ISettingsChangeListener {
- private static final String BUILD_SYSTEM_DATA_MODULE_NAME = "cdtBuildSystem"; //$NON-NLS-1$
- private static final String VERSION_ATTRIBUTE = "version"; //$NON-NLS-1$
- private static final String PREF_CFG_ID = "org.eclipse.cdt.build.core.prefbase.cfg"; //$NON-NLS-1$
- public static final String PREF_TC_ID = "org.eclipse.cdt.build.core.prefbase.toolchain"; //$NON-NLS-1$
- private static final String PREF_TOOL_ID = "org.eclipse.cdt.build.core.settings.holder"; //$NON-NLS-1$
- private static final QualifiedName CFG_PERSISTED_PROPERTY = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), "configPersisted"); //$NON-NLS-1$
- private static final QualifiedName NATURES_USED_ON_CACHE_PROPERTY = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), "naturesUsedOnCache"); //$NON-NLS-1$
- private static final QualifiedName BUILD_INFO_PROPERTY = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), "buildInfo"); //$NON-NLS-1$
+ private static final String BUILD_SYSTEM_DATA_MODULE_NAME = "cdtBuildSystem"; //$NON-NLS-1$
+ private static final String VERSION_ATTRIBUTE = "version"; //$NON-NLS-1$
+ private static final String PREF_CFG_ID = "org.eclipse.cdt.build.core.prefbase.cfg"; //$NON-NLS-1$
+ public static final String PREF_TC_ID = "org.eclipse.cdt.build.core.prefbase.toolchain"; //$NON-NLS-1$
+ private static final String PREF_TOOL_ID = "org.eclipse.cdt.build.core.settings.holder"; //$NON-NLS-1$
+ private static final QualifiedName CFG_PERSISTED_PROPERTY = new QualifiedName(
+ ManagedBuilderCorePlugin.getUniqueIdentifier(), "configPersisted"); //$NON-NLS-1$
+ private static final QualifiedName NATURES_USED_ON_CACHE_PROPERTY = new QualifiedName(
+ ManagedBuilderCorePlugin.getUniqueIdentifier(), "naturesUsedOnCache"); //$NON-NLS-1$
+ private static final QualifiedName BUILD_INFO_PROPERTY = new QualifiedName(
+ ManagedBuilderCorePlugin.getUniqueIdentifier(), "buildInfo"); //$NON-NLS-1$
private static boolean registered;
- public ConfigurationDataProvider(){
- if(!registered){
+ public ConfigurationDataProvider() {
+ if (!registered) {
registered = true;
NotificationManager.getInstance().subscribe(this);
}
@@ -95,7 +98,7 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
IBuilder fBuilder;
IProject fProject;
- DesApplyRunnable(IProject project, IBuilder builder){
+ DesApplyRunnable(IProject project, IBuilder builder) {
fProject = project;
fBuilder = builder;
}
@@ -104,46 +107,47 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
public void run(IProgressMonitor monitor) throws CoreException {
try {
IProjectDescription eDes = fProject.getDescription();
- if(BuilderFactory.applyBuilder(eDes, fBuilder) == BuilderFactory.CMD_CHANGED) {
+ if (BuilderFactory.applyBuilder(eDes, fBuilder) == BuilderFactory.CMD_CHANGED) {
fProject.setDescription(eDes, monitor);
}
- } catch (Exception e){
+ } catch (Exception e) {
ManagedBuilderCorePlugin.log(e);
}
}
}
- static BuildConfigurationData writeConfiguration(ICConfigurationDescription cfgDescription, BuildConfigurationData baseData)
- throws CoreException {
+ static BuildConfigurationData writeConfiguration(ICConfigurationDescription cfgDescription,
+ BuildConfigurationData baseData) throws CoreException {
BuildConfigurationData appliedCfg = baseData;
ICStorageElement rootElement = cfgDescription.getStorage(BUILD_SYSTEM_DATA_MODULE_NAME, true);
rootElement.clear();
rootElement.setAttribute(VERSION_ATTRIBUTE, ManagedBuildManager.getVersion().toString());
ICStorageElement cfgElemen = rootElement.createChild(IConfiguration.CONFIGURATION_ELEMENT_NAME);
- Configuration cfg = (Configuration)appliedCfg.getConfiguration();
- Builder b = (Builder)cfg.getEditableBuilder();
+ Configuration cfg = (Configuration) appliedCfg.getConfiguration();
+ Builder b = (Builder) cfg.getEditableBuilder();
// Need to ensure that build macro supplier can get the description for this configuration during the write...
cfg.setConfigurationDescription(cfgDescription);
- if(b != null && b.isManagedBuildOn() && b.getBuildPathAttribute(false) == null){
+ if (b != null && b.isManagedBuildOn() && b.getBuildPathAttribute(false) == null) {
String bPath = b.getDefaultBuildPath();
b.setBuildPathAttribute(bPath);
}
-// cfg.setConfigurationDescription(des);
-// ManagedBuildManager.performValueHandlerEvent(cfg, IManagedOptionValueHandler.EVENT_APPLY);
+ // cfg.setConfigurationDescription(des);
+ // ManagedBuildManager.performValueHandlerEvent(cfg, IManagedOptionValueHandler.EVENT_APPLY);
cfg.serialize(cfgElemen);
return appliedCfg;
}
- protected CConfigurationData applyPreferences(ICConfigurationDescription cfgDescription, CConfigurationData baseData) throws CoreException {
- BuildConfigurationData appliedCfg = writeConfiguration(cfgDescription, (BuildConfigurationData)baseData);
+ protected CConfigurationData applyPreferences(ICConfigurationDescription cfgDescription,
+ CConfigurationData baseData) throws CoreException {
+ BuildConfigurationData appliedCfg = writeConfiguration(cfgDescription, (BuildConfigurationData) baseData);
- IConfiguration cfg = ((BuildConfigurationData)baseData).getConfiguration();
+ IConfiguration cfg = ((BuildConfigurationData) baseData).getConfiguration();
try {
CfgScannerConfigInfoFactory2.savePreference(cfg);
- } catch (CoreException e){
+ } catch (CoreException e) {
ManagedBuilderCorePlugin.log(e);
}
@@ -152,28 +156,30 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
@Override
public CConfigurationData applyConfiguration(ICConfigurationDescription cfgDescription,
- ICConfigurationDescription baseCfgDescription, CConfigurationData baseData,
- IModificationContext context, IProgressMonitor monitor) throws CoreException {
+ ICConfigurationDescription baseCfgDescription, CConfigurationData baseData, IModificationContext context,
+ IProgressMonitor monitor) throws CoreException {
if (cfgDescription.isPreferenceConfiguration()) {
return applyPreferences(cfgDescription, baseData);
}
- BuildConfigurationData baseCfgData = (BuildConfigurationData)baseData;
+ BuildConfigurationData baseCfgData = (BuildConfigurationData) baseData;
IConfiguration baseCfg = baseCfgData.getConfiguration();
BuildConfigurationData appliedCfgData;
- if(context.isBaseDataCached() && !baseCfg.isDirty()){
+ if (context.isBaseDataCached() && !baseCfg.isDirty()) {
appliedCfgData = baseCfgData;
- context.setConfigurationSettingsFlags(IModificationContext.CFG_DATA_STORAGE_UNMODIFIED | IModificationContext.CFG_DATA_SETTINGS_UNMODIFIED);
+ context.setConfigurationSettingsFlags(IModificationContext.CFG_DATA_STORAGE_UNMODIFIED
+ | IModificationContext.CFG_DATA_SETTINGS_UNMODIFIED);
} else {
appliedCfgData = writeConfiguration(cfgDescription, baseCfgData);
IManagedBuildInfo info = getBuildInfo(cfgDescription);
- ManagedProject mProj = (ManagedProject)info.getManagedProject();
- mProj.applyConfiguration((Configuration)appliedCfgData.getConfiguration());
+ ManagedProject mProj = (ManagedProject) info.getManagedProject();
+ mProj.applyConfiguration((Configuration) appliedCfgData.getConfiguration());
writeManagedProjectInfo(cfgDescription.getProjectDescription(), mProj);
if (baseCfgDescription instanceof ILanguageSettingsProvidersKeeper) {
- String[] defaultIds = ((ILanguageSettingsProvidersKeeper)baseCfgDescription).getDefaultLanguageSettingsProvidersIds();
+ String[] defaultIds = ((ILanguageSettingsProvidersKeeper) baseCfgDescription)
+ .getDefaultLanguageSettingsProvidersIds();
List<ILanguageSettingsProvider> providers;
if (defaultIds == null) {
ICProjectDescription prjDescription = baseCfgDescription.getProjectDescription();
@@ -190,17 +196,19 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
}
providers = LanguageSettingsManager.createLanguageSettingsProviders(defaultIds);
} else {
- providers = ((ILanguageSettingsProvidersKeeper)baseCfgDescription).getLanguageSettingProviders();
+ providers = ((ILanguageSettingsProvidersKeeper) baseCfgDescription).getLanguageSettingProviders();
}
if (cfgDescription instanceof ILanguageSettingsProvidersKeeper) {
- ((ILanguageSettingsProvidersKeeper)cfgDescription).setDefaultLanguageSettingsProvidersIds(defaultIds);
+ ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .setDefaultLanguageSettingsProvidersIds(defaultIds);
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
}
}
try {
- CfgScannerConfigInfoFactory2.save(appliedCfgData, cfgDescription.getProjectDescription(), baseCfgDescription.getProjectDescription(), !isPersistedCfg(cfgDescription));
- } catch (CoreException e){
+ CfgScannerConfigInfoFactory2.save(appliedCfgData, cfgDescription.getProjectDescription(),
+ baseCfgDescription.getProjectDescription(), !isPersistedCfg(cfgDescription));
+ } catch (CoreException e) {
ManagedBuilderCorePlugin.log(e);
}
info.setValid(true);
@@ -212,12 +220,12 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
cacheNaturesIdsUsedOnCache(cfgDescription);
}
- if(cfgDescription.isActive()){
+ if (cfgDescription.isActive()) {
IConfiguration cfg = appliedCfgData.getConfiguration();
IBuilder builder = cfg.getEditableBuilder();
IProject project = context.getProject();
IProjectDescription eDes = context.getEclipseProjectDescription();
- switch(BuilderFactory.applyBuilder(eDes, builder)){
+ switch (BuilderFactory.applyBuilder(eDes, builder)) {
case BuilderFactory.CMD_UNDEFINED:
IWorkspaceRunnable applyR = new DesApplyRunnable(project, builder);
context.addWorkspaceRunnable(applyR);
@@ -231,11 +239,12 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
return appliedCfgData;
}
- private void setPersistedFlag(ICConfigurationDescription cfgDescription){
+ private void setPersistedFlag(ICConfigurationDescription cfgDescription) {
cfgDescription.setSessionProperty(CFG_PERSISTED_PROPERTY, Boolean.TRUE);
}
- private static void writeManagedProjectInfo(ICProjectDescription prjDescription, ManagedProject mProj) throws CoreException {
+ private static void writeManagedProjectInfo(ICProjectDescription prjDescription, ManagedProject mProj)
+ throws CoreException {
ICStorageElement rootElement = prjDescription.getStorage(BUILD_SYSTEM_DATA_MODULE_NAME, true);
rootElement.clear();
rootElement.setAttribute(VERSION_ATTRIBUTE, ManagedBuildManager.getVersion().toString());
@@ -243,31 +252,32 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
mProj.serializeProjectInfo(mProjElem);
}
- protected CConfigurationData createPreferences(ICConfigurationDescription cfgDescription, CConfigurationData baseData) throws CoreException {
- Configuration cfg = (Configuration)((BuildConfigurationData)baseData).getConfiguration();
- Configuration newCfg = new Configuration((ManagedProject)cfg.getManagedProject(), cfg, cfgDescription.getId(), true, true, true);
+ protected CConfigurationData createPreferences(ICConfigurationDescription cfgDescription,
+ CConfigurationData baseData) throws CoreException {
+ Configuration cfg = (Configuration) ((BuildConfigurationData) baseData).getConfiguration();
+ Configuration newCfg = new Configuration((ManagedProject) cfg.getManagedProject(), cfg, cfgDescription.getId(),
+ true, true, true);
newCfg.setConfigurationDescription(cfgDescription);
newCfg.setName(cfgDescription.getName());
-// if(!newCfg.getId().equals(cfg.getId())){
-// newCfg.exportArtifactInfo();
-// }
+ // if(!newCfg.getId().equals(cfg.getId())){
+ // newCfg.exportArtifactInfo();
+ // }
return newCfg.getConfigurationData();
}
-
@Override
public CConfigurationData createConfiguration(ICConfigurationDescription cfgDescription,
ICConfigurationDescription baseCfgDescription, CConfigurationData base, boolean clone,
IProgressMonitor monitor) throws CoreException {
- if(cfgDescription.isPreferenceConfiguration())
+ if (cfgDescription.isPreferenceConfiguration())
return createPreferences(cfgDescription, base);
- Configuration cfg = (Configuration)((BuildConfigurationData)base).getConfiguration();
+ Configuration cfg = (Configuration) ((BuildConfigurationData) base).getConfiguration();
Configuration newCfg = copyCfg(cfg, cfgDescription);
- if(!newCfg.getId().equals(cfg.getId()) && newCfg.canExportedArtifactInfo()){
+ if (!newCfg.getId().equals(cfg.getId()) && newCfg.canExportedArtifactInfo()) {
// Bug 335001: Remove existing exported settings as they point at this configuration
for (ICExternalSetting extSetting : newCfg.getConfigurationDescription().getExternalSettings())
newCfg.getConfigurationDescription().removeExternalSetting(extSetting);
@@ -282,7 +292,7 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
public static Configuration copyCfg(Configuration cfg, ICConfigurationDescription cfgDescription) {
IManagedBuildInfo info = getBuildInfo(cfgDescription);
- ManagedProject mProj = (ManagedProject)info.getManagedProject();
+ ManagedProject mProj = (ManagedProject) info.getManagedProject();
Configuration newCfg = new Configuration(mProj, cfg, cfgDescription.getId(), true, true, false);
newCfg.setConfigurationDescription(cfgDescription);
@@ -292,9 +302,9 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
ManagedBuildManager.performValueHandlerEvent(newCfg, IManagedOptionValueHandler.EVENT_OPEN);
-// if(!newCfg.getId().equals(cfg.getId())){
-// newCfg.exportArtifactInfo();
-// }
+ // if(!newCfg.getId().equals(cfg.getId())){
+ // newCfg.exportArtifactInfo();
+ // }
return newCfg;
}
@@ -303,7 +313,7 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
ICProjectDescription projDes = cfgDescription.getProjectDescription();
IProject project = projDes.getProject();
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project, false);
- if(info == null)
+ if (info == null)
info = ManagedBuildManager.createBuildInfo(project);
setLoaddedBuildInfo(projDes, info);
@@ -318,12 +328,13 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
}
public static ManagedBuildInfo getLoaddedBuildInfo(ICProjectDescription prjDescription) {
- return (ManagedBuildInfo)prjDescription.getSessionProperty(BUILD_INFO_PROPERTY);
+ return (ManagedBuildInfo) prjDescription.getSessionProperty(BUILD_INFO_PROPERTY);
}
- private static IManagedProject getManagedProject(ICConfigurationDescription cfgDescription, IManagedBuildInfo info) {
+ private static IManagedProject getManagedProject(ICConfigurationDescription cfgDescription,
+ IManagedBuildInfo info) {
IManagedProject mProj = info.getManagedProject();
- if(mProj == null){
+ if (mProj == null) {
mProj = createManagedProject(info, cfgDescription.getProjectDescription());
}
return mProj;
@@ -333,12 +344,12 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
IManagedProject mProj = null;
try {
ICStorageElement rootElem = prjDescription.getStorage(BUILD_SYSTEM_DATA_MODULE_NAME, false);
- if(rootElem != null){
+ if (rootElem != null) {
String version = rootElem.getAttribute(VERSION_ATTRIBUTE);
ICStorageElement children[] = rootElem.getChildren();
- for(int i = 0; i < children.length; i++){
- if(IManagedProject.MANAGED_PROJECT_ELEMENT_NAME.equals(children[i].getName())){
- mProj = new ManagedProject((ManagedBuildInfo)info, children[i], false, version);
+ for (int i = 0; i < children.length; i++) {
+ if (IManagedProject.MANAGED_PROJECT_ELEMENT_NAME.equals(children[i].getName())) {
+ mProj = new ManagedProject((ManagedBuildInfo) info, children[i], false, version);
break;
}
}
@@ -347,7 +358,7 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
mProj = null;
}
- if(mProj == null){
+ if (mProj == null) {
mProj = new ManagedProject(prjDescription);
info.setManagedProject(mProj);
}
@@ -357,14 +368,14 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
public static String[] getNaturesIdsUsedOnCache(IConfiguration cfg) {
ICConfigurationDescription cfgDescription = ManagedBuildManager.getDescriptionForConfiguration(cfg);
- if(cfgDescription != null)
+ if (cfgDescription != null)
return getNaturesIdsUsedOnCache(cfgDescription);
return null;
}
public static String[] getNaturesIdsUsedOnCache(ICConfigurationDescription cfgDescription) {
- String[] strs = (String[])cfgDescription.getSessionProperty(NATURES_USED_ON_CACHE_PROPERTY);
- return strs != null && strs.length != 0 ? (String[])strs.clone() : strs;
+ String[] strs = (String[]) cfgDescription.getSessionProperty(NATURES_USED_ON_CACHE_PROPERTY);
+ return strs != null && strs.length != 0 ? (String[]) strs.clone() : strs;
}
public static void cacheNaturesIdsUsedOnCache(ICConfigurationDescription cfgDescription) {
@@ -379,18 +390,19 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
}
private static void setNaturesIdsUsedOnCache(ICConfigurationDescription cfgDescription, String ids[]) {
- ids = ids != null && ids.length != 0 ? (String[])ids.clone() : ids;
+ ids = ids != null && ids.length != 0 ? (String[]) ids.clone() : ids;
cfgDescription.setSessionProperty(NATURES_USED_ON_CACHE_PROPERTY, ids);
}
- private Configuration load(ICConfigurationDescription cfgDescription, ManagedProject mProj, boolean isPreference) throws CoreException {
+ private Configuration load(ICConfigurationDescription cfgDescription, ManagedProject mProj, boolean isPreference)
+ throws CoreException {
ICStorageElement rootElement = cfgDescription.getStorage(BUILD_SYSTEM_DATA_MODULE_NAME, true);
ICStorageElement children[] = rootElement.getChildren();
String version = rootElement.getAttribute(VERSION_ATTRIBUTE);
Configuration cfg = null;
- for(int i = 0; i < children.length; i++){
- if(IConfiguration.CONFIGURATION_ELEMENT_NAME.equals(children[i].getName())){
+ for (int i = 0; i < children.length; i++) {
+ if (IConfiguration.CONFIGURATION_ELEMENT_NAME.equals(children[i].getName())) {
cfg = new Configuration(mProj, children[i], version, isPreference);
ManagedBuildManager.performValueHandlerEvent(cfg, IManagedOptionValueHandler.EVENT_OPEN);
break;
@@ -413,7 +425,7 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
}
private static Configuration updatePreferenceOnLoad(Configuration cfg, ICConfigurationDescription cfgDescription) {
- if(cfg == null) {
+ if (cfg == null) {
cfg = createEmptyPrefConfiguration(cfgDescription.getId(), cfgDescription.getName());
}
cfg = adjustPreferenceConfig(cfg);
@@ -426,41 +438,42 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
Map<String, ILanguageDescriptor[]> map = mngr.getContentTypeIdToLanguageDescriptionsMap();
IResourceInfo[] rcInfos = cfg.getResourceInfos();
- for(int i = 0; i < rcInfos.length; i++){
- if(rcInfos[i] instanceof IFolderInfo){
- adjustFolderInfo((IFolderInfo)rcInfos[i], dess, new HashMap<Object, ILanguageDescriptor[]>(map));
+ for (int i = 0; i < rcInfos.length; i++) {
+ if (rcInfos[i] instanceof IFolderInfo) {
+ adjustFolderInfo((IFolderInfo) rcInfos[i], dess, new HashMap<Object, ILanguageDescriptor[]>(map));
}
}
return cfg;
}
- private static void adjustFolderInfo(IFolderInfo info, ILanguageDescriptor dess[], HashMap<Object, ILanguageDescriptor[]> map) {
+ private static void adjustFolderInfo(IFolderInfo info, ILanguageDescriptor dess[],
+ HashMap<Object, ILanguageDescriptor[]> map) {
IToolChain tch = info.getToolChain();
Map<String, ILanguageDescriptor> langMap = new HashMap<String, ILanguageDescriptor>();
- for(int i = 0; i < dess.length; i++){
+ for (int i = 0; i < dess.length; i++) {
langMap.put(dess[i].getId(), dess[i]);
}
- if(PREF_TC_ID.equals(tch.getSuperClass().getId())){
+ if (PREF_TC_ID.equals(tch.getSuperClass().getId())) {
ITool[] tools = tch.getTools();
- for(int i = 0; i < tools.length; i++){
- Tool tool = (Tool)tools[i];
+ for (int i = 0; i < tools.length; i++) {
+ Tool tool = (Tool) tools[i];
IInputType types[] = tool.getAllInputTypes();
- for(int k = 0; k < types.length; k++){
- InputType type = (InputType)types[k];
+ for (int k = 0; k < types.length; k++) {
+ InputType type = (InputType) types[k];
String langId = type.getLanguageId(tool);
- if(langId != null){
+ if (langId != null) {
ILanguageDescriptor des = langMap.remove(langId);
- if(des != null)
+ if (des != null)
adjustInputType(tool, type, des);
continue;
} else {
IContentType[] cTypes = type.getSourceContentTypes();
- for(int c = 0; c < cTypes.length; c++){
+ for (int c = 0; c < cTypes.length; c++) {
IContentType cType = cTypes[c];
ILanguageDescriptor[] langs = map.remove(cType.getId());
- if(langs != null && langs.length != 0){
- for(int q = 0; q < langs.length; q++){
+ if (langs != null && langs.length != 0) {
+ for (int q = 0; q < langs.length; q++) {
langMap.remove(langs[q].getId());
}
@@ -471,14 +484,14 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
}
}
- if(!langMap.isEmpty()){
+ if (!langMap.isEmpty()) {
addTools(tch, langMap, map);
}
}
}
private static InputType adjustInputType(Tool tool, InputType type, ILanguageDescriptor des) {
- String [] cTypeIds = des.getContentTypeIds();
+ String[] cTypeIds = des.getContentTypeIds();
String srcIds[] = type.getSourceContentTypeIds();
String hIds[] = type.getHeaderContentTypeIds();
@@ -486,45 +499,46 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
landTypes.removeAll(Arrays.asList(srcIds));
landTypes.removeAll(Arrays.asList(hIds));
- if(landTypes.size() != 0){
+ if (landTypes.size() != 0) {
List<String> srcList = new ArrayList<String>();
srcList.addAll(landTypes);
- type = (InputType)tool.getEditableInputType(type);
+ type = (InputType) tool.getEditableInputType(type);
type.setSourceContentTypeIds(srcList.toArray(new String[srcList.size()]));
}
- if(!des.getId().equals(type.getLanguageId(tool))){
- type = (InputType)tool.getEditableInputType(type);
+ if (!des.getId().equals(type.getLanguageId(tool))) {
+ type = (InputType) tool.getEditableInputType(type);
type.setLanguageIdAttribute(des.getId());
type.setLanguageNameAttribute(des.getName());
}
return type;
}
- private static void addTools(IToolChain tc, Map<String, ILanguageDescriptor> langMap, Map<Object, ILanguageDescriptor[]> cTypeToLangMap ){
+ private static void addTools(IToolChain tc, Map<String, ILanguageDescriptor> langMap,
+ Map<Object, ILanguageDescriptor[]> cTypeToLangMap) {
ITool extTool = ManagedBuildManager.getExtensionTool(PREF_TOOL_ID);
List<ILanguageDescriptor> list = new ArrayList<ILanguageDescriptor>(langMap.values());
ILanguageDescriptor des;
- while(list.size() != 0){
+ while (list.size() != 0) {
des = list.remove(list.size() - 1);
String[] ctypeIds = des.getContentTypeIds();
boolean addLang = false;
- for(int i = 0; i < ctypeIds.length; i++){
+ for (int i = 0; i < ctypeIds.length; i++) {
ILanguageDescriptor[] langs = cTypeToLangMap.remove(ctypeIds[i]);
- if(langs != null && langs.length != 0){
+ if (langs != null && langs.length != 0) {
addLang = true;
- for(int q = 0; q < langs.length; q++){
+ for (int q = 0; q < langs.length; q++) {
list.remove(langs[q]);
}
}
}
- if(addLang){
+ if (addLang) {
String id = ManagedBuildManager.calculateChildId(extTool.getId(), null);
String name = des.getName();
- Tool tool = (Tool)tc.createTool(extTool, id, name, false);
- InputType type = (InputType)tool.getInputTypes()[0];
- type = (InputType)tool.getEditableInputType(type);
+ Tool tool = (Tool) tc.createTool(extTool, id, name, false);
+ InputType type = (InputType) tool.getInputTypes()[0];
+ type = (InputType) tool.getEditableInputType(type);
type.setSourceContentTypes(des.getContentTypes());
type.setLanguageNameAttribute(des.getName());
type.setName(des.getName());
@@ -533,14 +547,13 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
}
}
-
private static Configuration createEmptyPrefConfiguration(String id, String name) {
- Configuration extCfg = (Configuration)ManagedBuildManager.getExtensionConfiguration(PREF_CFG_ID);
+ Configuration extCfg = (Configuration) ManagedBuildManager.getExtensionConfiguration(PREF_CFG_ID);
Configuration emptyPrefCfg = null;
- if(extCfg != null){
- if(id == null)
+ if (extCfg != null) {
+ if (id == null)
id = ManagedBuildManager.calculateChildId(extCfg.getId(), null);
- if(name == null)
+ if (name == null)
name = extCfg.getName();
emptyPrefCfg = new Configuration(null, extCfg, id, false, true, true);
emptyPrefCfg.setName(name);
@@ -551,13 +564,14 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
}
@Override
- public CConfigurationData loadConfiguration(ICConfigurationDescription cfgDescription, IProgressMonitor monitor) throws CoreException {
- if(cfgDescription.isPreferenceConfiguration()) {
+ public CConfigurationData loadConfiguration(ICConfigurationDescription cfgDescription, IProgressMonitor monitor)
+ throws CoreException {
+ if (cfgDescription.isPreferenceConfiguration()) {
return loadPreferences(cfgDescription);
}
IManagedBuildInfo info = getBuildInfo(cfgDescription);
- Configuration cfg = load(cfgDescription, (ManagedProject)info.getManagedProject(), false);
+ Configuration cfg = load(cfgDescription, (ManagedProject) info.getManagedProject(), false);
if (cfg != null) {
IProject project = cfgDescription.getProjectDescription().getProject();
@@ -572,10 +586,11 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
if (cfgDescription instanceof ILanguageSettingsProvidersKeeper) {
String[] defaultIds = cfg.getDefaultLanguageSettingsProviderIds();
if (defaultIds != null) {
- ((ILanguageSettingsProvidersKeeper) cfgDescription).setDefaultLanguageSettingsProvidersIds(defaultIds);
+ ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .setDefaultLanguageSettingsProvidersIds(defaultIds);
}
}
-
+
return cfg.getConfigurationData();
}
return null;
@@ -587,12 +602,12 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
@Override
public void settingsChanged(SettingsChangeEvent event) {
- BuildLanguageData datas[] = (BuildLanguageData[])event.getRcInfo().getCLanguageDatas();
+ BuildLanguageData datas[] = (BuildLanguageData[]) event.getRcInfo().getCLanguageDatas();
IOption option = event.getOption();
try {
int type = option.getValueType();
- for(int i = 0; i < datas.length; i++){
+ for (int i = 0; i < datas.length; i++) {
datas[i].optionsChanged(type);
}
} catch (BuildException e) {
@@ -601,8 +616,9 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
}
@Override
- public void removeConfiguration(ICConfigurationDescription cfgDescription, CConfigurationData data, IProgressMonitor monitor) {
- IConfiguration cfg = ((BuildConfigurationData)data).getConfiguration();
+ public void removeConfiguration(ICConfigurationDescription cfgDescription, CConfigurationData data,
+ IProgressMonitor monitor) {
+ IConfiguration cfg = ((BuildConfigurationData) data).getConfiguration();
ManagedBuildManager.performValueHandlerEvent(cfg, IManagedOptionValueHandler.EVENT_CLOSE);
IManagedBuildInfo info = getBuildInfo(cfgDescription);
IManagedProject mProj = info.getManagedProject();
@@ -610,9 +626,10 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
}
@Override
- public void dataCached(ICConfigurationDescription cfgDescription, CConfigurationData data, IProgressMonitor monitor) {
- BuildConfigurationData cfgData = (BuildConfigurationData)data;
- ((Configuration)cfgData.getConfiguration()).setConfigurationDescription(cfgDescription);
+ public void dataCached(ICConfigurationDescription cfgDescription, CConfigurationData data,
+ IProgressMonitor monitor) {
+ BuildConfigurationData cfgData = (BuildConfigurationData) data;
+ ((Configuration) cfgData.getConfiguration()).setConfigurationDescription(cfgDescription);
cfgData.clearCachedData();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/DataProviderMessages.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/DataProviderMessages.java
index 56d0543c245..8fdd38502d3 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/DataProviderMessages.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/DataProviderMessages.java
@@ -20,8 +20,7 @@ import java.util.ResourceBundle;
public class DataProviderMessages {
private static final String BUNDLE_NAME = "org.eclipse.cdt.managedbuilder.internal.dataprovider.DataProviderMessages"; //$NON-NLS-1$
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
private DataProviderMessages() {
}
@@ -35,7 +34,7 @@ public class DataProviderMessages {
return "#" + key + "#"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
-
+
public static String getResourceString(String key) {
return getString(key);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ExternalExtensionMacroSupplier.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ExternalExtensionMacroSupplier.java
index 2d82fd66188..791ad33209d 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ExternalExtensionMacroSupplier.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ExternalExtensionMacroSupplier.java
@@ -36,25 +36,25 @@ import org.eclipse.cdt.utils.envvar.EnvVarOperationProcessor;
*
* @since 3.0
*/
-public class ExternalExtensionMacroSupplier implements ICdtVariableSupplier{
- private static final String fNonOverloadableMacros[] = new String[]{
- //tool-integrators not allowed currently to override the "CWD" and "PWD" macros
- "CWD", //$NON-NLS-1$
- "PWD" //$NON-NLS-1$
+public class ExternalExtensionMacroSupplier implements ICdtVariableSupplier {
+ private static final String fNonOverloadableMacros[] = new String[] {
+ //tool-integrators not allowed currently to override the "CWD" and "PWD" macros
+ "CWD", //$NON-NLS-1$
+ "PWD" //$NON-NLS-1$
};
private ICdtVariableManager fMngr;
private ICConfigurationDescription fCfgDes;
-// private static ExternalExtensionMacroSupplier fInstance;
+ // private static ExternalExtensionMacroSupplier fInstance;
- private class ExtensionMacroProvider extends BuildMacroProvider{
+ private class ExtensionMacroProvider extends BuildMacroProvider {
private IMacroContextInfo fStartInfo;
private int fContextType;
private Object fContextData;
private boolean fStartInitialized;
- public ExtensionMacroProvider(int contextType, Object contextData){
+ public ExtensionMacroProvider(int contextType, Object contextData) {
fContextType = contextType;
fContextData = contextData;
}
@@ -63,22 +63,19 @@ public class ExternalExtensionMacroSupplier implements ICdtVariableSupplier{
* @see org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider#getVariable(java.lang.String, java.lang.Object, boolean)
*/
@Override
- public ICdtVariable getVariable(String macroName,
- int contextType,
- Object contextData,
- boolean includeParent) {
- if(getValidName(macroName) == null)
+ public ICdtVariable getVariable(String macroName, int contextType, Object contextData, boolean includeParent) {
+ if (getValidName(macroName) == null)
return null;
return fMngr.getVariable(macroName, fCfgDes);
-// return super.getMacro(macroName,contextType,contextData,includeParent);
+ // return super.getMacro(macroName,contextType,contextData,includeParent);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider#getMacros(int, java.lang.Object, boolean)
*/
@Override
- public ICdtVariable[] getVariables(int contextType,Object contextData, boolean includeParent) {
-// return filterVariables(super.getMacros(contextType, contextData, includeParent));
+ public ICdtVariable[] getVariables(int contextType, Object contextData, boolean includeParent) {
+ // return filterVariables(super.getMacros(contextType, contextData, includeParent));
return filterVariables(fMngr.getVariables(fCfgDes));
}
@@ -86,31 +83,30 @@ public class ExternalExtensionMacroSupplier implements ICdtVariableSupplier{
* @see org.eclipse.cdt.managedbuilder.internal.envvar.EnvironmentVariableProvider#getContextInfo(java.lang.Object)
*/
@Override
- public IMacroContextInfo getMacroContextInfo(int contextType,Object contextData){
+ public IMacroContextInfo getMacroContextInfo(int contextType, Object contextData) {
IMacroContextInfo startInfo = getStartInfo();
- if(contextType == fContextType &&
- contextData == fContextData)
+ if (contextType == fContextType && contextData == fContextData)
return startInfo;
IMacroContextInfo info = super.getMacroContextInfo(contextType, contextData);
- if(info == null)
+ if (info == null)
return null;
- if(SupplierBasedCdtVariableManager.checkParentContextRelation(startInfo,info))
+ if (SupplierBasedCdtVariableManager.checkParentContextRelation(startInfo, info))
return info;
return null;
}
- protected IMacroContextInfo getStartInfo(){
- if(fStartInfo == null && !fStartInitialized){
- IMacroContextInfo info = super.getMacroContextInfo(fContextType,fContextData);
- if(info != null){
+ protected IMacroContextInfo getStartInfo() {
+ if (fStartInfo == null && !fStartInitialized) {
+ IMacroContextInfo info = super.getMacroContextInfo(fContextType, fContextData);
+ if (info != null) {
ICdtVariableSupplier suppliers[] = info.getSuppliers();
suppliers = filterValidSuppliers(suppliers);
- if(suppliers != null)
- fStartInfo = new DefaultMacroContextInfo(fContextType,fContextData,suppliers);
+ if (suppliers != null)
+ fStartInfo = new DefaultMacroContextInfo(fContextType, fContextData, suppliers);
else
- fStartInfo = (IMacroContextInfo)info.getNext();
+ fStartInfo = (IMacroContextInfo) info.getNext();
fStartInitialized = true;
}
fStartInitialized = true;
@@ -119,8 +115,7 @@ public class ExternalExtensionMacroSupplier implements ICdtVariableSupplier{
}
}
-
- public ExternalExtensionMacroSupplier(ICdtVariableManager mngr, ICConfigurationDescription cfgDes){
+ public ExternalExtensionMacroSupplier(ICdtVariableManager mngr, ICConfigurationDescription cfgDes) {
fMngr = mngr;
fCfgDes = cfgDes;
}
@@ -130,36 +125,38 @@ public class ExternalExtensionMacroSupplier implements ICdtVariableSupplier{
*/
@Override
public ICdtVariable getVariable(String macroName, IVariableContextInfo context) {
- if((macroName = getValidName(macroName)) == null)
+ if ((macroName = getValidName(macroName)) == null)
return null;
- IMacroContextInfo info = (IMacroContextInfo)context;
+ IMacroContextInfo info = (IMacroContextInfo) context;
int contextType = info.getContextType();
Object contextData = info.getContextData();
- switch(contextType){
+ switch (contextType) {
case IBuildMacroProvider.CONTEXT_CONFIGURATION:
IConfiguration cfg = null;
IBuilder builder = null;
- if(contextData instanceof IBuilder){
- builder = (IBuilder)contextData;
+ if (contextData instanceof IBuilder) {
+ builder = (IBuilder) contextData;
cfg = builder.getParent().getParent();
- } else if(contextData instanceof IConfiguration){
- cfg = (IConfiguration)contextData;
+ } else if (contextData instanceof IConfiguration) {
+ cfg = (IConfiguration) contextData;
builder = cfg.getBuilder();
}
- if(cfg != null){
+ if (cfg != null) {
IConfigurationBuildMacroSupplier supplier = cfg.getBuildMacroSupplier();
- if(supplier == null)
+ if (supplier == null)
return null;
- return supplier.getMacro(macroName,cfg,new ExtensionMacroProvider(contextType, contextData));
+ return supplier.getMacro(macroName, cfg, new ExtensionMacroProvider(contextType, contextData));
}
case IBuildMacroProvider.CONTEXT_PROJECT:
if (contextData instanceof IManagedProject) {
- IManagedProject project = (IManagedProject)contextData;
- IProjectBuildMacroSupplier supplier = project.getProjectType() != null ? project.getProjectType().getBuildMacroSupplier() : null;
- if(supplier == null)
+ IManagedProject project = (IManagedProject) contextData;
+ IProjectBuildMacroSupplier supplier = project.getProjectType() != null
+ ? project.getProjectType().getBuildMacroSupplier()
+ : null;
+ if (supplier == null)
return null;
- return supplier.getMacro(macroName,project,new ExtensionMacroProvider(contextType, contextData));
+ return supplier.getMacro(macroName, project, new ExtensionMacroProvider(contextType, contextData));
}
}
return null;
@@ -171,81 +168,83 @@ public class ExternalExtensionMacroSupplier implements ICdtVariableSupplier{
@Override
public ICdtVariable[] getVariables(IVariableContextInfo context) {
IBuildMacro macros[] = null;
- IMacroContextInfo info = (IMacroContextInfo)context;
+ IMacroContextInfo info = (IMacroContextInfo) context;
int contextType = info.getContextType();
Object contextData = info.getContextData();
- switch(contextType){
+ switch (contextType) {
case IBuildMacroProvider.CONTEXT_CONFIGURATION:
IConfiguration cfg = null;
IBuilder builder = null;
- if(contextData instanceof IBuilder){
- builder = (IBuilder)contextData;
+ if (contextData instanceof IBuilder) {
+ builder = (IBuilder) contextData;
cfg = builder.getParent().getParent();
- }else if(contextData instanceof IConfiguration){
- cfg = (IConfiguration)contextData;
+ } else if (contextData instanceof IConfiguration) {
+ cfg = (IConfiguration) contextData;
builder = cfg.getBuilder();
}
- if(cfg != null){
+ if (cfg != null) {
IConfigurationBuildMacroSupplier supplier = cfg.getBuildMacroSupplier();
- if(supplier != null)
- macros = supplier.getMacros(cfg,new ExtensionMacroProvider(contextType, contextData));
+ if (supplier != null)
+ macros = supplier.getMacros(cfg, new ExtensionMacroProvider(contextType, contextData));
}
break;
case IBuildMacroProvider.CONTEXT_PROJECT:
if (contextData instanceof IManagedProject) {
- IManagedProject project = (IManagedProject)contextData;
- IProjectBuildMacroSupplier supplier = project.getProjectType() != null ? project.getProjectType().getBuildMacroSupplier() : null;
- if(supplier != null)
- macros = supplier.getMacros(project,new ExtensionMacroProvider(contextType, contextData));
+ IManagedProject project = (IManagedProject) contextData;
+ IProjectBuildMacroSupplier supplier = project.getProjectType() != null
+ ? project.getProjectType().getBuildMacroSupplier()
+ : null;
+ if (supplier != null)
+ macros = supplier.getMacros(project, new ExtensionMacroProvider(contextType, contextData));
}
}
return filterVariables(macros);
}
- protected String getValidName(String name){
- if(name == null || (name = name.trim()).length() == 0)
+ protected String getValidName(String name) {
+ if (name == null || (name = name.trim()).length() == 0)
return null;
- if(fNonOverloadableMacros != null){
- for(int i = 0; i < fNonOverloadableMacros.length; i++){
- if(fNonOverloadableMacros[i].equals(EnvVarOperationProcessor.normalizeName(name)))
+ if (fNonOverloadableMacros != null) {
+ for (int i = 0; i < fNonOverloadableMacros.length; i++) {
+ if (fNonOverloadableMacros[i].equals(EnvVarOperationProcessor.normalizeName(name)))
return null;
}
}
return name;
}
- protected ICdtVariable[] filterVariables(ICdtVariable macros[]){
- return filterVariables(macros,fNonOverloadableMacros);
+ protected ICdtVariable[] filterVariables(ICdtVariable macros[]) {
+ return filterVariables(macros, fNonOverloadableMacros);
}
- private ICdtVariable[] filterVariables(ICdtVariable macros[], String remove[]){
- if(macros == null || macros.length == 0)
+ private ICdtVariable[] filterVariables(ICdtVariable macros[], String remove[]) {
+ if (macros == null || macros.length == 0)
return macros;
ICdtVariable filtered[] = new ICdtVariable[macros.length];
int filteredNum = 0;
- for(int i = 0; i < macros.length; i++){
+ for (int i = 0; i < macros.length; i++) {
ICdtVariable var = macros[i];
String name = null;
- if(var != null && (name = var.getName().trim()).length() != 0){
+ if (var != null && (name = var.getName().trim()).length() != 0) {
boolean skip = false;
- if(remove != null && remove.length > 0){
- for(int j = 0; j < remove.length; j++){
- if(remove[j] != null && remove[j].equals(name)){
+ if (remove != null && remove.length > 0) {
+ for (int j = 0; j < remove.length; j++) {
+ if (remove[j] != null && remove[j].equals(name)) {
skip = true;
break;
}
}
}
- if(!skip)
+ if (!skip)
filtered[filteredNum++] = var;
}
}
- if(filteredNum != filtered.length){
+ if (filteredNum != filtered.length) {
ICdtVariable m[] = new ICdtVariable[filteredNum];
- for(int i = 0; i < filteredNum; i++)
+ for (int i = 0; i < filteredNum; i++)
m[i] = filtered[i];
filtered = m;
}
@@ -253,26 +252,24 @@ public class ExternalExtensionMacroSupplier implements ICdtVariableSupplier{
}
- protected ICdtVariableSupplier[] filterValidSuppliers(ICdtVariableSupplier suppliers[]){
- if(suppliers == null)
+ protected ICdtVariableSupplier[] filterValidSuppliers(ICdtVariableSupplier suppliers[]) {
+ if (suppliers == null)
return null;
int i = 0, j = 0;
- for(i = 0; i < suppliers.length; i++){
- if(suppliers[i] == this)
+ for (i = 0; i < suppliers.length; i++) {
+ if (suppliers[i] == this)
break;
}
-
- if(i >= suppliers.length)
+ if (i >= suppliers.length)
return null;
int startNum = i + 1;
- ICdtVariableSupplier validSuppliers[] =
- new ICdtVariableSupplier[suppliers.length - startNum];
+ ICdtVariableSupplier validSuppliers[] = new ICdtVariableSupplier[suppliers.length - startNum];
- for(i = startNum, j = 0; i < suppliers.length; i++, j++)
+ for (i = startNum, j = 0; i < suppliers.length; i++, j++)
validSuppliers[j] = suppliers[i];
return validSuppliers;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/PathInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/PathInfo.java
index 03171b00fab..f141b7d0789 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/PathInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/PathInfo.java
@@ -27,38 +27,37 @@ class PathInfo {
private String fAbsoluteInfoStr;
private Boolean fIsAbsolute;
private SupplierBasedCdtVariableSubstitutor fSubstitutor;
-
- private static final boolean IS_WINDOWS = File.separatorChar == '\\';
+ private static final boolean IS_WINDOWS = File.separatorChar == '\\';
- public PathInfo(String str, boolean isWspPath, SupplierBasedCdtVariableSubstitutor subst){
+ public PathInfo(String str, boolean isWspPath, SupplierBasedCdtVariableSubstitutor subst) {
fUnresolvedStr = str;
fIsWorkspacePath = isWspPath;
fSubstitutor = subst;
}
- public String getUnresolvedPath(){
+ public String getUnresolvedPath() {
return fUnresolvedStr;
}
-
- public boolean isWorkspacePath(){
+
+ public boolean isWorkspacePath() {
return fIsWorkspacePath;
}
-
- public boolean isAbsolute(){
- if(fIsAbsolute == null)
+
+ public boolean isAbsolute() {
+ if (fIsAbsolute == null)
fIsAbsolute = Boolean.valueOf(checkIsAbsolute());
return fIsAbsolute.booleanValue();
}
-
- private boolean checkIsAbsolute(){
-// if(fIsWorkspacePath)
-// return true;
-
- if(fResolvedPath != null)
+
+ private boolean checkIsAbsolute() {
+ // if(fIsWorkspacePath)
+ // return true;
+
+ if (fResolvedPath != null)
return fResolvedPath.isAbsolute();
- if(fAbsoluteInfoStr != null){
+ if (fAbsoluteInfoStr != null) {
return isAbsolute(fAbsoluteInfoStr, fSubstitutor, new String[1]);
}
@@ -67,32 +66,32 @@ class PathInfo {
fAbsoluteInfoStr = str[0];
return isAbs;
}
-
- private static boolean isAbsolute(String str, SupplierBasedCdtVariableSubstitutor subst, String[] out){
+
+ private static boolean isAbsolute(String str, SupplierBasedCdtVariableSubstitutor subst, String[] out) {
int length = str.length();
out[0] = str;
- if(length == 0)
+ if (length == 0)
return false;
-
+
char c0 = str.charAt(0);
- if(c0 == '/' || c0 == '\\')
+ if (c0 == '/' || c0 == '\\')
return true;
-
- if(length == 1)
+
+ if (length == 1)
return false;
-
+
char c1 = str.charAt(1);
- if(IS_WINDOWS && c1 == ':')
+ if (IS_WINDOWS && c1 == ':')
return true;
-
- if(length < 4)
+
+ if (length < 4)
return false;
-
- if(c0 == '$' && c1 == '{'){
+
+ if (c0 == '$' && c1 == '{') {
int indx = str.indexOf('}');
- if(indx != -1){
+ if (indx != -1) {
String macroName = str.substring(2, indx);
- if(macroName.length() != 0){
+ if (macroName.length() != 0) {
String resolvedMacro;
try {
resolvedMacro = subst.resolveToString(macroName);
@@ -102,17 +101,17 @@ class PathInfo {
e.printStackTrace();
}
String substr = str.substring(indx + 1);
- String rStr = resolvedMacro == null || resolvedMacro.length() == 0 ?
- substr : new StringBuilder().append(resolvedMacro).append(subst).toString();
+ String rStr = resolvedMacro == null || resolvedMacro.length() == 0 ? substr
+ : new StringBuilder().append(resolvedMacro).append(subst).toString();
return isAbsolute(rStr, subst, out);
}
}
}
-
+
return false;
}
-
- public SupplierBasedCdtVariableSubstitutor getSubstitutor(){
+
+ public SupplierBasedCdtVariableSubstitutor getSubstitutor() {
return fSubstitutor;
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ProfileInfoProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ProfileInfoProvider.java
index 34db7d993df..ec29793b0cd 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ProfileInfoProvider.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ProfileInfoProvider.java
@@ -31,42 +31,42 @@ import org.eclipse.core.runtime.IPath;
public class ProfileInfoProvider {
private static ProfileInfoProvider fInstance;
-// private BuildLanguageData fLlanguageData;
-// private IProject fProject;
-// private CfgInfoContext fContext;
- private CfgDiscoveredPathManager fMngr;
-
- private ProfileInfoProvider(){
-// fLlanguageData = lData;
-// IResourceInfo rcInfo = lData.getTool().getParentResourceInfo();
-// fContext = new CfgInfoContext(rcInfo, lData.getTool(), lData.getInputType());
+ // private BuildLanguageData fLlanguageData;
+ // private IProject fProject;
+ // private CfgInfoContext fContext;
+ private CfgDiscoveredPathManager fMngr;
+
+ private ProfileInfoProvider() {
+ // fLlanguageData = lData;
+ // IResourceInfo rcInfo = lData.getTool().getParentResourceInfo();
+ // fContext = new CfgInfoContext(rcInfo, lData.getTool(), lData.getInputType());
fMngr = CfgDiscoveredPathManager.getInstance();
-// IResource rc = rcInfo.getParent().getOwner();
-// fProject = rc != null ? rc.getProject() : null;
+ // IResource rc = rcInfo.getParent().getOwner();
+ // fProject = rc != null ? rc.getProject() : null;
}
-
- public static ProfileInfoProvider getInstance(){
- if(fInstance == null)
+
+ public static ProfileInfoProvider getInstance() {
+ if (fInstance == null)
fInstance = new ProfileInfoProvider();
return fInstance;
}
-
-// void checkUpdateInputType(IInputType inType){
-// if(inType != fContext.getInputType()){
-// fContext = new CfgInfoContext(fContext.getResourceInfo(), fContext.getTool(), inType);
-// }
-// }
- public ICLanguageSettingEntry[] getEntryValues(BuildLanguageData lData, int kind, int flags){
+ // void checkUpdateInputType(IInputType inType){
+ // if(inType != fContext.getInputType()){
+ // fContext = new CfgInfoContext(fContext.getResourceInfo(), fContext.getTool(), inType);
+ // }
+ // }
+
+ public ICLanguageSettingEntry[] getEntryValues(BuildLanguageData lData, int kind, int flags) {
IResourceInfo rcInfo = lData.getTool().getParentResourceInfo();
- IResource rc = rcInfo.getParent().getOwner();
+ IResource rc = rcInfo.getParent().getOwner();
IProject project = rc != null ? rc.getProject() : null;
- if(project != null){
+ if (project != null) {
try {
CfgInfoContext context = new CfgInfoContext(rcInfo, lData.getTool(), lData.getInputType());
PathInfo info = fMngr.getDiscoveredInfo(project, context);
- if(info != null){
+ if (info != null) {
return entriesForKind(kind, flags, info);
}
} catch (CoreException e) {
@@ -75,14 +75,14 @@ public class ProfileInfoProvider {
}
return new ICLanguageSettingEntry[0];
}
-
- private ICLanguageSettingEntry[] entriesForKind(int kind, int flags, PathInfo info){
+
+ private ICLanguageSettingEntry[] entriesForKind(int kind, int flags, PathInfo info) {
switch (kind) {
case ICLanguageSettingEntry.INCLUDE_PATH:
ICLanguageSettingEntry[] incPaths = calculateEntries(kind, flags, info.getIncludePaths());
IPath[] quotedPaths = info.getQuoteIncludePaths();
- if(quotedPaths.length != 0){
- if(incPaths.length != 0){
+ if (quotedPaths.length != 0) {
+ if (incPaths.length != 0) {
ICLanguageSettingEntry quotedEntries[] = calculateEntries(kind, flags, quotedPaths);
ICLanguageSettingEntry[] tmp = new ICLanguageSettingEntry[incPaths.length + quotedEntries.length];
System.arraycopy(incPaths, 0, tmp, 0, incPaths.length);
@@ -102,44 +102,44 @@ public class ProfileInfoProvider {
}
return new ICLanguageSettingEntry[0];
}
-
- private ICLanguageSettingEntry[] calculateEntries(int kind, int flags, Map<String, String> map){
+
+ private ICLanguageSettingEntry[] calculateEntries(int kind, int flags, Map<String, String> map) {
ICLanguageSettingEntry entries[] = new ICLanguageSettingEntry[map.size()];
int num = 0;
Set<Entry<String, String>> entrySet = map.entrySet();
for (Entry<String, String> entry : entrySet) {
String name = entry.getKey();
String value = entry.getValue();
- entries[num++] = (ICLanguageSettingEntry)CDataUtil.createEntry(kind, name, value, null, flags);
+ entries[num++] = (ICLanguageSettingEntry) CDataUtil.createEntry(kind, name, value, null, flags);
}
return entries;
}
-// private ICLanguageSettingEntry[] calculateEntries(int kind, int flags, String[] values){
-// ICLanguageSettingEntry entries[] = new ICLanguageSettingEntry[values.length];
-// for(int i = 0; i < values.length; i++){
-// String name = values[i];
-// entries[i] = (ICLanguageSettingEntry)CDataUtil.createEntry(kind, name, null, null, flags);
-// }
-// return entries;
-// }
+ // private ICLanguageSettingEntry[] calculateEntries(int kind, int flags, String[] values){
+ // ICLanguageSettingEntry entries[] = new ICLanguageSettingEntry[values.length];
+ // for(int i = 0; i < values.length; i++){
+ // String name = values[i];
+ // entries[i] = (ICLanguageSettingEntry)CDataUtil.createEntry(kind, name, null, null, flags);
+ // }
+ // return entries;
+ // }
- private ICLanguageSettingEntry[] calculateEntries(int kind, int flags, IPath[] values){
+ private ICLanguageSettingEntry[] calculateEntries(int kind, int flags, IPath[] values) {
ICLanguageSettingEntry entries[] = new ICLanguageSettingEntry[values.length];
- for(int i = 0; i < values.length; i++){
+ for (int i = 0; i < values.length; i++) {
String name = values[i].toString();
- entries[i] = (ICLanguageSettingEntry)CDataUtil.createEntry(kind, name, null, null, flags);
+ entries[i] = (ICLanguageSettingEntry) CDataUtil.createEntry(kind, name, null, null, flags);
}
return entries;
}
-// private ICLanguageSettingEntry[] calculateEntries(int kind, int flags, List list){
-// ICLanguageSettingEntry entries[] = new ICLanguageSettingEntry[list.size()];
-// int num = 0;
-// for(Iterator iter = list.iterator(); iter.hasNext();){
-// String name = (String)iter.next();
-// entries[num++] = (ICLanguageSettingEntry)CDataUtil.createEntry(kind, name, null, null, flags);
-// }
-// return entries;
-// }
+ // private ICLanguageSettingEntry[] calculateEntries(int kind, int flags, List list){
+ // ICLanguageSettingEntry entries[] = new ICLanguageSettingEntry[list.size()];
+ // int num = 0;
+ // for(Iterator iter = list.iterator(); iter.hasNext();){
+ // String name = (String)iter.next();
+ // entries[num++] = (ICLanguageSettingEntry)CDataUtil.createEntry(kind, name, null, null, flags);
+ // }
+ // return entries;
+ // }
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ProjectConverter.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ProjectConverter.java
index a777b6aec9b..f0901661546 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ProjectConverter.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ProjectConverter.java
@@ -76,13 +76,13 @@ import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.IOverwriteQuery;
public class ProjectConverter implements ICProjectConverter {
- private final static String OLD_MAKE_BUILDER_ID = "org.eclipse.cdt.make.core.makeBuilder"; //$NON-NLS-1$
- private final static String OLD_MAKE_NATURE_ID = "org.eclipse.cdt.make.core.makeNature"; //$NON-NLS-1$
- private final static String OLD_MNG_BUILDER_ID = "org.eclipse.cdt.managedbuilder.core.genmakebuilder"; //$NON-NLS-1$
- private final static String OLD_MNG_NATURE_ID = "org.eclipse.cdt.managedbuilder.core.managedBuildNature"; //$NON-NLS-1$
- private final static String OLD_DISCOVERY_MODULE_ID = "scannerConfiguration"; //$NON-NLS-1$
- private final static String OLD_BINARY_PARSER_ID = "org.eclipse.cdt.core.BinaryParser"; //$NON-NLS-1$
- private final static String OLD_ERROR_PARSER_ID = "org.eclipse.cdt.core.ErrorParser"; //$NON-NLS-1$
+ private final static String OLD_MAKE_BUILDER_ID = "org.eclipse.cdt.make.core.makeBuilder"; //$NON-NLS-1$
+ private final static String OLD_MAKE_NATURE_ID = "org.eclipse.cdt.make.core.makeNature"; //$NON-NLS-1$
+ private final static String OLD_MNG_BUILDER_ID = "org.eclipse.cdt.managedbuilder.core.genmakebuilder"; //$NON-NLS-1$
+ private final static String OLD_MNG_NATURE_ID = "org.eclipse.cdt.managedbuilder.core.managedBuildNature"; //$NON-NLS-1$
+ private final static String OLD_DISCOVERY_MODULE_ID = "scannerConfiguration"; //$NON-NLS-1$
+ private final static String OLD_BINARY_PARSER_ID = "org.eclipse.cdt.core.BinaryParser"; //$NON-NLS-1$
+ private final static String OLD_ERROR_PARSER_ID = "org.eclipse.cdt.core.ErrorParser"; //$NON-NLS-1$
private final static String OLD_PATH_ENTRY_ID = "org.eclipse.cdt.core.pathentry"; //$NON-NLS-1$
private final static String OLD_DISCOVERY_NATURE_ID = "org.eclipse.cdt.make.core.ScannerConfigNature"; //$NON-NLS-1$
private final static String OLD_DISCOVERY_BUILDER_ID = "org.eclipse.cdt.make.core.ScannerConfigBuilder"; //$NON-NLS-1$
@@ -96,41 +96,41 @@ public class ProjectConverter implements ICProjectConverter {
@Override
public boolean canConvertProject(IProject project, String oldOwnerId, ICProjectDescription oldDes) {
try {
- if(oldOwnerId == null || oldDes == null)
+ if (oldOwnerId == null || oldDes == null)
return false;
IProjectDescription eDes = project.getDescription();
Set<String> natureSet = new HashSet<String>(Arrays.asList(eDes.getNatureIds()));
- if(natureSet.contains(OLD_MAKE_NATURE_ID))
+ if (natureSet.contains(OLD_MAKE_NATURE_ID))
return true;
- if(natureSet.contains(OLD_MNG_NATURE_ID))
+ if (natureSet.contains(OLD_MNG_NATURE_ID))
return true;
} catch (CoreException e) {
}
return false;
-// return ManagedBuildManager.canGetBuildInfo(project);
+ // return ManagedBuildManager.canGetBuildInfo(project);
}
@Override
- public ICProjectDescription convertProject(IProject project, IProjectDescription eDes, String oldOwnerId, ICProjectDescription oldDes)
- throws CoreException {
+ public ICProjectDescription convertProject(IProject project, IProjectDescription eDes, String oldOwnerId,
+ ICProjectDescription oldDes) throws CoreException {
Set<String> natureSet = new HashSet<String>(Arrays.asList(eDes.getNatureIds()));
CoreModel model = CoreModel.getDefault();
ICProjectDescription newDes = null;
IManagedBuildInfo info = null;
String[] binErrParserIds = null;
-// boolean convertMakeTargetInfo = false;
+ // boolean convertMakeTargetInfo = false;
- if(natureSet.contains(OLD_MAKE_NATURE_ID)){
+ if (natureSet.contains(OLD_MAKE_NATURE_ID)) {
newDes = oldDes;
ICConfigurationDescription des = newDes.getConfigurations()[0];
ICConfigExtensionReference refs[] = des.get(OLD_BINARY_PARSER_ID);
- if(refs.length != 0){
+ if (refs.length != 0) {
binErrParserIds = new String[refs.length];
- for(int i = 0; i < refs.length; i++){
+ for (int i = 0; i < refs.length; i++) {
binErrParserIds[i] = refs[i].getID();
}
}
@@ -143,95 +143,97 @@ public class ProjectConverter implements ICProjectConverter {
cfg.setConfigurationDescription(des);
des.setConfigurationData(ManagedBuildManager.CFG_DATA_PROVIDER_ID, cfg.getConfigurationData());
- } else if(natureSet.contains(OLD_MNG_NATURE_ID)){
+ } else if (natureSet.contains(OLD_MNG_NATURE_ID)) {
try {
- if(PROPS.getProperty(project, CONVERSION_FAILED_MSG_ID) != null)
- throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), DataProviderMessages.getString("ProjectConverter.0"))); //$NON-NLS-1$
+ if (PROPS.getProperty(project, CONVERSION_FAILED_MSG_ID) != null)
+ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ DataProviderMessages.getString("ProjectConverter.0"))); //$NON-NLS-1$
newDes = model.createProjectDescription(project, false);
info = convertManagedBuildInfo(project, newDes);
} catch (CoreException e) {
- displayInfo(project, CONVERSION_FAILED_MSG_ID, DataProviderMessages.getString("ProjectConverter.10"), DataProviderMessages.getFormattedString("ProjectConverter.11", new String[]{project.getName(), e.getLocalizedMessage()})); //$NON-NLS-1$ //$NON-NLS-2$
+ displayInfo(project, CONVERSION_FAILED_MSG_ID, DataProviderMessages.getString("ProjectConverter.10"), //$NON-NLS-1$
+ DataProviderMessages.getFormattedString("ProjectConverter.11", //$NON-NLS-1$
+ new String[] { project.getName(), e.getLocalizedMessage() }));
throw e;
}
}
- if(newDes == null || !newDes.isValid() || newDes.getConfigurations().length == 0){
+ if (newDes == null || !newDes.isValid() || newDes.getConfigurations().length == 0) {
newDes = null;
} else {
boolean changeEDes = false;
- if(natureSet.remove(OLD_MAKE_NATURE_ID))
+ if (natureSet.remove(OLD_MAKE_NATURE_ID))
changeEDes = true;
- if(natureSet.remove(OLD_DISCOVERY_NATURE_ID))
+ if (natureSet.remove(OLD_DISCOVERY_NATURE_ID))
changeEDes = true;
- if(changeEDes)
+ if (changeEDes)
eDes.setNatureIds(natureSet.toArray(new String[natureSet.size()]));
changeEDes = false;
ICommand[] cmds = eDes.getBuildSpec();
List<ICommand> list = new ArrayList<ICommand>(Arrays.asList(cmds));
ICommand makeBuilderCmd = null;
- for(Iterator<ICommand> iter = list.iterator(); iter.hasNext();){
+ for (Iterator<ICommand> iter = list.iterator(); iter.hasNext();) {
ICommand cmd = iter.next();
- if(OLD_MAKE_BUILDER_ID.equals(cmd.getBuilderName())){
+ if (OLD_MAKE_BUILDER_ID.equals(cmd.getBuilderName())) {
makeBuilderCmd = cmd;
iter.remove();
changeEDes = true;
-// convertMakeTargetInfo = true;
- } else if(OLD_DISCOVERY_BUILDER_ID.equals(cmd.getBuilderName())){
+ // convertMakeTargetInfo = true;
+ } else if (OLD_DISCOVERY_BUILDER_ID.equals(cmd.getBuilderName())) {
iter.remove();
changeEDes = true;
}
}
ICConfigurationDescription cfgDess[] = newDes.getConfigurations();
- for(int i = 0; i < cfgDess.length; i++){
+ for (int i = 0; i < cfgDess.length; i++) {
ICConfigurationDescription cfgDes = cfgDess[i];
- BuildConfigurationData data = (BuildConfigurationData)cfgDes.getConfigurationData();
+ BuildConfigurationData data = (BuildConfigurationData) cfgDes.getConfigurationData();
IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(cfgDes);
- if(makeBuilderCmd != null)
+ if (makeBuilderCmd != null)
loadBuilderSettings(cfg, makeBuilderCmd);
-// loadDiscoveryOptions(cfgDes, cfg);
+ // loadDiscoveryOptions(cfgDes, cfg);
loadPathEntryInfo(project, cfgDes, data);
- if(binErrParserIds != null){
+ if (binErrParserIds != null) {
data.getTargetPlatformData().setBinaryParserIds(binErrParserIds);
cfgDes.get(OLD_BINARY_PARSER_ID);
-// ICConfigExtensionReference refs[] = cfgDes.get(OLD_BINARY_PARSER_ID);
-// String ids[] = idsFromRefs(refs);
-// data.getTargetPlatformData().setBinaryParserIds(ids);
-//
-// refs = cfgDes.get(OLD_ERROR_PARSER_ID);
-// ids = idsFromRefs(refs);
-// data.getBuildData().setErrorParserIDs(ids);
+ // ICConfigExtensionReference refs[] = cfgDes.get(OLD_BINARY_PARSER_ID);
+ // String ids[] = idsFromRefs(refs);
+ // data.getTargetPlatformData().setBinaryParserIds(ids);
+ //
+ // refs = cfgDes.get(OLD_ERROR_PARSER_ID);
+ // ids = idsFromRefs(refs);
+ // data.getBuildData().setErrorParserIDs(ids);
}
try {
ConfigurationDataProvider.writeConfiguration(cfgDes, data);
- } catch (CoreException e){
+ } catch (CoreException e) {
}
}
-// if(convertMakeTargetInfo){
-// try {
-// convertMakeTargetInfo(project, newDes, null);
-// } catch (CoreException e){
-// ManagedBuilderCorePlugin.log(e);
-// }
-// }
+ // if(convertMakeTargetInfo){
+ // try {
+ // convertMakeTargetInfo(project, newDes, null);
+ // } catch (CoreException e){
+ // ManagedBuilderCorePlugin.log(e);
+ // }
+ // }
- if(changeEDes){
+ if (changeEDes) {
cmds = list.toArray(new ICommand[list.size()]);
eDes.setBuildSpec(cmds);
}
info.setValid(true);
-
try {
ManagedBuildManager.setLoaddedBuildInfo(project, info);
} catch (Exception e) {
@@ -241,51 +243,52 @@ public class ProjectConverter implements ICProjectConverter {
return newDes;
}
- static void displayInfo(IProject proj, String id, String title, String message){
- if(PROPS.getProperty(proj, id) == null){
+ static void displayInfo(IProject proj, String id, String title, String message) {
+ if (PROPS.getProperty(proj, id) == null) {
openInformation(proj, id, title, message, false);
PROPS.setProperty(proj, id, Boolean.TRUE);
}
}
- public static boolean getBooleanFromQueryAnswer(String answer){
- if(IOverwriteQuery.ALL.equalsIgnoreCase(answer) ||
- IOverwriteQuery.YES.equalsIgnoreCase(answer))
+ public static boolean getBooleanFromQueryAnswer(String answer) {
+ if (IOverwriteQuery.ALL.equalsIgnoreCase(answer) || IOverwriteQuery.YES.equalsIgnoreCase(answer))
return true;
return false;
}
- static public boolean openQuestion(final IResource rc, final String id, final String title, final String message, IOverwriteQuery query, final boolean multiple){
- if(query != null)
+ static public boolean openQuestion(final IResource rc, final String id, final String title, final String message,
+ IOverwriteQuery query, final boolean multiple) {
+ if (query != null)
return getBooleanFromQueryAnswer(query.queryOverwrite(message));
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if(window == null){
+ if (window == null) {
IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows();
window = windows[0];
}
final Shell shell = window.getShell();
- final boolean [] answer = new boolean[1];
+ final boolean[] answer = new boolean[1];
shell.getDisplay().syncExec(new Runnable() {
@Override
public void run() {
Object ob = PROPS.getProperty(rc, id);
- if(multiple || ob == null){
+ if (multiple || ob == null) {
PROPS.setProperty(rc, id, Boolean.TRUE);
- answer[0] = MessageDialog.openQuestion(shell,title,message);
+ answer[0] = MessageDialog.openQuestion(shell, title, message);
PROPS.setProperty(rc, id, answer[0] ? Boolean.TRUE : Boolean.FALSE);
} else {
- answer[0] = ((Boolean)ob).booleanValue();
+ answer[0] = ((Boolean) ob).booleanValue();
}
}
});
return answer[0];
}
- static private void openInformation(final IResource rc, final String id, final String title, final String message, final boolean multiple){
+ static private void openInformation(final IResource rc, final String id, final String title, final String message,
+ final boolean multiple) {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if(window == null){
+ if (window == null) {
IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows();
window = windows[0];
}
@@ -294,120 +297,125 @@ public class ProjectConverter implements ICProjectConverter {
shell.getDisplay().syncExec(new Runnable() {
@Override
public void run() {
- if(multiple || PROPS.getProperty(rc, id) == null){
+ if (multiple || PROPS.getProperty(rc, id) == null) {
PROPS.setProperty(rc, id, Boolean.TRUE);
- MessageDialog.openInformation(shell,title,message);
+ MessageDialog.openInformation(shell, title, message);
}
}
});
}
- private static void convertMakeTargetInfo(final IProject project, ICProjectDescription des, IProgressMonitor monitor) throws CoreException{
- if(monitor == null)
+ private static void convertMakeTargetInfo(final IProject project, ICProjectDescription des,
+ IProgressMonitor monitor) throws CoreException {
+ if (monitor == null)
monitor = new NullProgressMonitor();
- CCorePlugin.getDefault().getCDescriptorManager().runDescriptorOperation(project, des, new ICDescriptorOperation(){
+ CCorePlugin.getDefault().getCDescriptorManager().runDescriptorOperation(project, des,
+ new ICDescriptorOperation() {
- @Override
- public void execute(ICDescriptor descriptor,
- IProgressMonitor monitor) throws CoreException {
- final IMakeTargetManager mngr = MakeCorePlugin.getDefault().getTargetManager();
+ @Override
+ public void execute(ICDescriptor descriptor, IProgressMonitor monitor) throws CoreException {
+ final IMakeTargetManager mngr = MakeCorePlugin.getDefault().getTargetManager();
- project.accept(new IResourceVisitor(){
+ project.accept(new IResourceVisitor() {
- @Override
- public boolean visit(IResource resource)
- throws CoreException {
- if(resource.getType() == IResource.FILE)
- return false;
-
- try {
- IContainer cr = (IContainer)resource;
- IMakeTarget targets[] = mngr.getTargets(cr);
- for(int i = 0; i < targets.length; i++){
- IMakeTarget t = targets[i];
- if(!OLD_MAKE_TARGET_BUIDER_ID.equals(t.getTargetBuilderID()))
- continue;
-
- IMakeTarget newT = mngr.createTarget(project, t.getName(), NEW_MAKE_TARGET_BUIDER_ID);
- copySettings(t, newT);
- mngr.removeTarget(t);
- mngr.addTarget(cr, newT);
+ @Override
+ public boolean visit(IResource resource) throws CoreException {
+ if (resource.getType() == IResource.FILE)
+ return false;
+
+ try {
+ IContainer cr = (IContainer) resource;
+ IMakeTarget targets[] = mngr.getTargets(cr);
+ for (int i = 0; i < targets.length; i++) {
+ IMakeTarget t = targets[i];
+ if (!OLD_MAKE_TARGET_BUIDER_ID.equals(t.getTargetBuilderID()))
+ continue;
+
+ IMakeTarget newT = mngr.createTarget(project, t.getName(),
+ NEW_MAKE_TARGET_BUIDER_ID);
+ copySettings(t, newT);
+ mngr.removeTarget(t);
+ mngr.addTarget(cr, newT);
+ }
+ } catch (CoreException e) {
+ ManagedBuilderCorePlugin.log(e);
+ }
+ return true;
}
- } catch ( CoreException e){
- ManagedBuilderCorePlugin.log(e);
- }
- return true;
- }
- });
- }
+ });
+ }
- }, monitor);
+ }, monitor);
}
- private static void copySettings(IMakeTarget fromTarget, IMakeTarget toTarget) throws CoreException{
- toTarget.setAppendEnvironment(fromTarget.appendEnvironment());
- toTarget.setAppendProjectEnvironment(fromTarget.appendProjectEnvironment());
+ private static void copySettings(IMakeTarget fromTarget, IMakeTarget toTarget) throws CoreException {
+ toTarget.setAppendEnvironment(fromTarget.appendEnvironment());
+ toTarget.setAppendProjectEnvironment(fromTarget.appendProjectEnvironment());
- toTarget.setBuildAttribute(IMakeTarget.BUILD_LOCATION, fromTarget.getBuildAttribute(IMakeTarget.BUILD_LOCATION, null));
- toTarget.setBuildAttribute(IMakeTarget.BUILD_COMMAND, fromTarget.getBuildAttribute(IMakeTarget.BUILD_COMMAND, null));
- toTarget.setBuildAttribute(IMakeTarget.BUILD_ARGUMENTS, fromTarget.getBuildAttribute(IMakeTarget.BUILD_ARGUMENTS, null));
- toTarget.setBuildAttribute(IMakeTarget.BUILD_TARGET, fromTarget.getBuildAttribute(IMakeTarget.BUILD_TARGET, null));
+ toTarget.setBuildAttribute(IMakeTarget.BUILD_LOCATION,
+ fromTarget.getBuildAttribute(IMakeTarget.BUILD_LOCATION, null));
+ toTarget.setBuildAttribute(IMakeTarget.BUILD_COMMAND,
+ fromTarget.getBuildAttribute(IMakeTarget.BUILD_COMMAND, null));
+ toTarget.setBuildAttribute(IMakeTarget.BUILD_ARGUMENTS,
+ fromTarget.getBuildAttribute(IMakeTarget.BUILD_ARGUMENTS, null));
+ toTarget.setBuildAttribute(IMakeTarget.BUILD_TARGET,
+ fromTarget.getBuildAttribute(IMakeTarget.BUILD_TARGET, null));
- Map<String, String> fromMap = fromTarget.getEnvironment();
- if(fromMap != null)
- toTarget.setEnvironment(new HashMap<String, String>(fromMap));
+ Map<String, String> fromMap = fromTarget.getEnvironment();
+ if (fromMap != null)
+ toTarget.setEnvironment(new HashMap<String, String>(fromMap));
-// toTarget.setErrorParsers(fromTarget.getErrorParsers());
+ // toTarget.setErrorParsers(fromTarget.getErrorParsers());
- toTarget.setRunAllBuilders(fromTarget.runAllBuilders());
+ toTarget.setRunAllBuilders(fromTarget.runAllBuilders());
- toTarget.setStopOnError(fromTarget.isStopOnError());
+ toTarget.setStopOnError(fromTarget.isStopOnError());
- toTarget.setUseDefaultBuildCmd(fromTarget.isDefaultBuildCmd());
+ toTarget.setUseDefaultBuildCmd(fromTarget.isDefaultBuildCmd());
- toTarget.setContainer(fromTarget.getContainer());
+ toTarget.setContainer(fromTarget.getContainer());
}
- private void loadPathEntryInfo(IProject project, ICConfigurationDescription des, CConfigurationData data){
+ private void loadPathEntryInfo(IProject project, ICConfigurationDescription des, CConfigurationData data) {
try {
ICStorageElement el = des.getStorage(OLD_PATH_ENTRY_ID, false);
- if(el != null){
+ if (el != null) {
IPathEntry[] entries = PathEntryTranslator.decodePathEntries(project, el);
- if(entries.length != 0){
+ if (entries.length != 0) {
List<IPathEntry> list = new ArrayList<IPathEntry>(Arrays.asList(entries));
- for(Iterator<IPathEntry> iter = list.iterator(); iter.hasNext();){
+ for (Iterator<IPathEntry> iter = list.iterator(); iter.hasNext();) {
IPathEntry entry = iter.next();
- if(entry.getEntryKind() == IPathEntry.CDT_CONTAINER){
+ if (entry.getEntryKind() == IPathEntry.CDT_CONTAINER) {
iter.remove();
continue;
}
}
- if(list.size() != 0){
+ if (list.size() != 0) {
PathEntryTranslator tr = new PathEntryTranslator(project, data);
entries = list.toArray(new IPathEntry[list.size()]);
- ReferenceSettingsInfo refInfo = tr.applyPathEntries(entries, null, PathEntryTranslator.OP_REPLACE);
+ ReferenceSettingsInfo refInfo = tr.applyPathEntries(entries, null,
+ PathEntryTranslator.OP_REPLACE);
ICExternalSetting extSettings[] = refInfo.getExternalSettings();
des.removeExternalSettings();
- if(extSettings.length != 0){
+ if (extSettings.length != 0) {
ICExternalSetting setting;
- for(int i = 0; i < extSettings.length; i++){
+ for (int i = 0; i < extSettings.length; i++) {
setting = extSettings[i];
des.createExternalSetting(setting.getCompatibleLanguageIds(),
- setting.getCompatibleContentTypeIds(),
- setting.getCompatibleExtensions(),
+ setting.getCompatibleContentTypeIds(), setting.getCompatibleExtensions(),
setting.getEntries());
}
}
IPath projPaths[] = refInfo.getReferencedProjectsPaths();
- if(projPaths.length != 0){
+ if (projPaths.length != 0) {
Map<String, String> map = new HashMap<String, String>(projPaths.length);
- for(int i = 0; i < projPaths.length; i++){
- map.put(projPaths[i].segment(0), ""); //$NON-NLS-1$
+ for (int i = 0; i < projPaths.length; i++) {
+ map.put(projPaths[i].segment(0), ""); //$NON-NLS-1$
}
des.setReferenceInfo(map);
}
@@ -420,85 +428,83 @@ public class ProjectConverter implements ICProjectConverter {
}
}
-// private String[] idsFromRefs(ICConfigExtensionReference refs[]){
-// String ids[] = new String[refs.length];
-// for(int i = 0; i < ids.length; i++){
-// ids[i] = refs[i].getID();
-// }
-// return ids;
-// }
-
-// private void loadDiscoveryOptions(ICConfigurationDescription des, IConfiguration cfg){
-// try {
-// ICStorageElement discoveryStorage = des.getStorage(OLD_DISCOVERY_MODULE_ID, false);
-// if(discoveryStorage != null){
-// Configuration config = (Configuration)cfg;
-// IScannerConfigBuilderInfo2 scannerConfigInfo = ScannerConfigInfoFactory2.create(new CfgInfoContext(cfg), discoveryStorage, ScannerConfigProfileManager.NULL_PROFILE_ID);
-// config.setPerRcTypeDiscovery(false);
-// config.setScannerConfigInfo(scannerConfigInfo);
-// des.removeStorage(OLD_DISCOVERY_MODULE_ID);
-// }
-// } catch (CoreException e) {
-// ManagedBuilderCorePlugin.log(e);
-// }
-//
-//
-// }
-
- private void loadBuilderSettings(IConfiguration cfg, ICommand cmd){
- Builder builder = (Builder)BuilderFactory.createBuilderFromCommand(cfg, cmd);
- if(builder.getCommand() != null && builder.getCommand().length() != 0){
+ // private String[] idsFromRefs(ICConfigExtensionReference refs[]){
+ // String ids[] = new String[refs.length];
+ // for(int i = 0; i < ids.length; i++){
+ // ids[i] = refs[i].getID();
+ // }
+ // return ids;
+ // }
+
+ // private void loadDiscoveryOptions(ICConfigurationDescription des, IConfiguration cfg){
+ // try {
+ // ICStorageElement discoveryStorage = des.getStorage(OLD_DISCOVERY_MODULE_ID, false);
+ // if(discoveryStorage != null){
+ // Configuration config = (Configuration)cfg;
+ // IScannerConfigBuilderInfo2 scannerConfigInfo = ScannerConfigInfoFactory2.create(new CfgInfoContext(cfg), discoveryStorage, ScannerConfigProfileManager.NULL_PROFILE_ID);
+ // config.setPerRcTypeDiscovery(false);
+ // config.setScannerConfigInfo(scannerConfigInfo);
+ // des.removeStorage(OLD_DISCOVERY_MODULE_ID);
+ // }
+ // } catch (CoreException e) {
+ // ManagedBuilderCorePlugin.log(e);
+ // }
+ //
+ //
+ // }
+
+ private void loadBuilderSettings(IConfiguration cfg, ICommand cmd) {
+ Builder builder = (Builder) BuilderFactory.createBuilderFromCommand(cfg, cmd);
+ if (builder.getCommand() != null && builder.getCommand().length() != 0) {
String[] errParserIds = builder.getCustomizedErrorParserIds();
builder.setCustomizedErrorParserIds(null);
- ((ToolChain)cfg.getToolChain()).setBuilder(builder);
- if(errParserIds != null && errParserIds.length != 0){
+ ((ToolChain) cfg.getToolChain()).setBuilder(builder);
+ if (errParserIds != null && errParserIds.length != 0) {
cfg.setErrorParserList(errParserIds);
}
}
}
- private static boolean convertOldStdMakeToNewStyle(final IProject project, boolean checkOnly, IProgressMonitor monitor, boolean throwExceptions) throws CoreException {
+ private static boolean convertOldStdMakeToNewStyle(final IProject project, boolean checkOnly,
+ IProgressMonitor monitor, boolean throwExceptions) throws CoreException {
try {
-// ICDescriptor dr = CCorePlugin.getDefault().getCProjectDescription(project, false);
-// if(dr == null){
-// if(throwExceptions)
-// throw new CoreException(new Status(IStatus.ERROR,
-// ManagedBuilderCorePlugin.getUniqueIdentifier(),
-// DataProviderMessages.getString("ProjectConverter.0"))); //$NON-NLS-1$
-// return false;
-// }
-//
-// if(!MakeCorePlugin.MAKE_PROJECT_ID.equals(dr.getProjectOwner().getID())){
-// if(throwExceptions)
-// throw new CoreException(new Status(IStatus.ERROR,
-// ManagedBuilderCorePlugin.getUniqueIdentifier(),
-// DataProviderMessages.getString("ProjectConverter.1") + dr.getProjectOwner().getID())); //$NON-NLS-1$
-// return false;
-// }
+ // ICDescriptor dr = CCorePlugin.getDefault().getCProjectDescription(project, false);
+ // if(dr == null){
+ // if(throwExceptions)
+ // throw new CoreException(new Status(IStatus.ERROR,
+ // ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ // DataProviderMessages.getString("ProjectConverter.0"))); //$NON-NLS-1$
+ // return false;
+ // }
+ //
+ // if(!MakeCorePlugin.MAKE_PROJECT_ID.equals(dr.getProjectOwner().getID())){
+ // if(throwExceptions)
+ // throw new CoreException(new Status(IStatus.ERROR,
+ // ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ // DataProviderMessages.getString("ProjectConverter.1") + dr.getProjectOwner().getID())); //$NON-NLS-1$
+ // return false;
+ // }
ICProjectDescription des = CCorePlugin.getDefault().getProjectDescription(project, false);
- if(des == null){
- if(throwExceptions)
- throw new CoreException(new Status(IStatus.ERROR,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
- DataProviderMessages.getString("ProjectConverter.9"))); //$NON-NLS-1$
+ if (des == null) {
+ if (throwExceptions)
+ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ DataProviderMessages.getString("ProjectConverter.9"))); //$NON-NLS-1$
return false;
}
ICConfigurationDescription cfgs[] = des.getConfigurations();
- if(cfgs.length != 1){
- if(throwExceptions)
- throw new CoreException(new Status(IStatus.ERROR,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ if (cfgs.length != 1) {
+ if (throwExceptions)
+ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
DataProviderMessages.getString("ProjectConverter.2") + cfgs.length)); //$NON-NLS-1$
return false;
}
- if(!CCorePlugin.DEFAULT_PROVIDER_ID.equals(cfgs[0].getBuildSystemId())){
- if(throwExceptions)
- throw new CoreException(new Status(IStatus.ERROR,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ if (!CCorePlugin.DEFAULT_PROVIDER_ID.equals(cfgs[0].getBuildSystemId())) {
+ if (throwExceptions)
+ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
DataProviderMessages.getString("ProjectConverter.3") + cfgs.length)); //$NON-NLS-1$
return false;
}
@@ -506,43 +512,42 @@ public class ProjectConverter implements ICProjectConverter {
final IProjectDescription eDes = project.getDescription();
String natureIds[] = eDes.getNatureIds();
Set<String> set = new HashSet<String>(Arrays.asList(natureIds));
- if(!set.contains(OLD_MAKE_NATURE_ID)){
- if(throwExceptions)
- throw new CoreException(new Status(IStatus.ERROR,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ if (!set.contains(OLD_MAKE_NATURE_ID)) {
+ if (throwExceptions)
+ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
DataProviderMessages.getString("ProjectConverter.4") + natureIds.toString())); //$NON-NLS-1$
return false;
}
- if(!checkOnly){
+ if (!checkOnly) {
ProjectConverter instance = new ProjectConverter();
ICProjectDescription oldDes = CCorePlugin.getDefault().getProjectDescription(project);
- if(!instance.canConvertProject(project, MakeCorePlugin.MAKE_PROJECT_ID, oldDes)){
- if(throwExceptions)
- throw new CoreException(new Status(IStatus.ERROR,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
- DataProviderMessages.getString("ProjectConverter.5"))); //$NON-NLS-1$
+ if (!instance.canConvertProject(project, MakeCorePlugin.MAKE_PROJECT_ID, oldDes)) {
+ if (throwExceptions)
+ throw new CoreException(
+ new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ DataProviderMessages.getString("ProjectConverter.5"))); //$NON-NLS-1$
return false;
}
- final ICProjectDescription newDes = instance.convertProject(project, eDes, MakeCorePlugin.MAKE_PROJECT_ID, oldDes);
- if(newDes == null){
- if(throwExceptions)
- throw new CoreException(new Status(IStatus.ERROR,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
- DataProviderMessages.getString("ProjectConverter.6"))); //$NON-NLS-1$
+ final ICProjectDescription newDes = instance.convertProject(project, eDes,
+ MakeCorePlugin.MAKE_PROJECT_ID, oldDes);
+ if (newDes == null) {
+ if (throwExceptions)
+ throw new CoreException(
+ new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ DataProviderMessages.getString("ProjectConverter.6"))); //$NON-NLS-1$
return false;
}
final IWorkspace wsp = ResourcesPlugin.getWorkspace();
- wsp.run(new IWorkspaceRunnable(){
+ wsp.run(new IWorkspaceRunnable() {
@Override
- public void run(IProgressMonitor monitor)
- throws CoreException {
+ public void run(IProgressMonitor monitor) throws CoreException {
project.setDescription(eDes, monitor);
CCorePlugin.getDefault().setProjectDescription(project, newDes);
- Job job = new Job(DataProviderMessages.getString("ProjectConverter.7")){ //$NON-NLS-1$
+ Job job = new Job(DataProviderMessages.getString("ProjectConverter.7")) { //$NON-NLS-1$
@Override
protected IStatus run(IProgressMonitor monitor) {
@@ -566,18 +571,17 @@ public class ProjectConverter implements ICProjectConverter {
}
return true;
} catch (CoreException e) {
- if(throwExceptions)
+ if (throwExceptions)
throw e;
ManagedBuilderCorePlugin.log(e);
}
- if(throwExceptions)
- throw new CoreException(new Status(IStatus.ERROR,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ if (throwExceptions)
+ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
DataProviderMessages.getString("ProjectConverter.8"))); //$NON-NLS-1$
return false;
}
- public static boolean isOldStyleMakeProject(IProject project){
+ public static boolean isOldStyleMakeProject(IProject project) {
try {
return convertOldStdMakeToNewStyle(project, true, null, false);
} catch (CoreException e) {
@@ -586,52 +590,56 @@ public class ProjectConverter implements ICProjectConverter {
return false;
}
- public static void convertOldStdMakeToNewStyle(IProject project, IProgressMonitor monitor) throws CoreException{
+ public static void convertOldStdMakeToNewStyle(IProject project, IProgressMonitor monitor) throws CoreException {
convertOldStdMakeToNewStyle(project, false, monitor, true);
}
- private IManagedBuildInfo convertManagedBuildInfo(IProject project, ICProjectDescription newDes) throws CoreException {
+ private IManagedBuildInfo convertManagedBuildInfo(IProject project, ICProjectDescription newDes)
+ throws CoreException {
IManagedBuildInfo info = ManagedBuildManager.getOldStyleBuildInfo(project);
- synchronized(PROPS){
- if(info != null && info.isValid()){
+ synchronized (PROPS) {
+ if (info != null && info.isValid()) {
IManagedProject mProj = info.getManagedProject();
IConfiguration cfgs[] = mProj.getConfigurations();
- if(cfgs.length != 0){
+ if (cfgs.length != 0) {
Configuration cfg;
CConfigurationData data;
UserDefinedVariableSupplier usrSupplier = UserDefinedVariableSupplier.getInstance();
- for(int i = 0; i < cfgs.length; i++){
- cfg = (Configuration)cfgs[i];
+ for (int i = 0; i < cfgs.length; i++) {
+ cfg = (Configuration) cfgs[i];
data = cfg.getConfigurationData();
-// try {
- ICConfigurationDescription cfgDes = newDes.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
- if(cfg.getConfigurationDescription() != null) {
- //copy cfg to avoid raise conditions
- cfg = ConfigurationDataProvider.copyCfg(cfg, cfgDes);
- cfgDes.setConfigurationData(ManagedBuildManager.CFG_DATA_PROVIDER_ID, cfg.getConfigurationData());
- }
- cfg.setConfigurationDescription(cfgDes);
+ // try {
+ ICConfigurationDescription cfgDes = newDes
+ .createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
+ if (cfg.getConfigurationDescription() != null) {
+ //copy cfg to avoid raise conditions
+ cfg = ConfigurationDataProvider.copyCfg(cfg, cfgDes);
+ cfgDes.setConfigurationData(ManagedBuildManager.CFG_DATA_PROVIDER_ID,
+ cfg.getConfigurationData());
+ }
+ cfg.setConfigurationDescription(cfgDes);
- StorableCdtVariables vars = ((ToolChain)cfg.getToolChain()).getResetOldStyleProjectVariables();
- if(vars != null){
- ICdtVariable vs[] = vars.getMacros();
- for(int k = 0; k < vs.length; k++){
- usrSupplier.createMacro(vs[k], ICoreVariableContextInfo.CONTEXT_CONFIGURATION, cfgDes);
- }
+ StorableCdtVariables vars = ((ToolChain) cfg.getToolChain()).getResetOldStyleProjectVariables();
+ if (vars != null) {
+ ICdtVariable vs[] = vars.getMacros();
+ for (int k = 0; k < vs.length; k++) {
+ usrSupplier.createMacro(vs[k], ICoreVariableContextInfo.CONTEXT_CONFIGURATION, cfgDes);
}
-// } catch (WriteAccessException e) {
-// ManagedBuilderCorePlugin.log(e);
-// } catch (CoreException e) {
-// ManagedBuilderCorePlugin.log(e);
-// }
+ }
+ // } catch (WriteAccessException e) {
+ // ManagedBuilderCorePlugin.log(e);
+ // } catch (CoreException e) {
+ // ManagedBuilderCorePlugin.log(e);
+ // }
cfg.exportArtifactInfo();
}
}
} else {
- throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), DataProviderMessages.getString("ProjectConverter.13"))); //$NON-NLS-1$
+ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ DataProviderMessages.getString("ProjectConverter.13"))); //$NON-NLS-1$
}
}
return info;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ResourcePropertyHolder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ResourcePropertyHolder.java
index 4161611786e..37aa52f666d 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ResourcePropertyHolder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ResourcePropertyHolder.java
@@ -25,7 +25,7 @@ class ResourcePropertyHolder extends ResourceChangeHandlerBase {
private Map<String, Map<String, Boolean>> fRcMap = new HashMap<String, Map<String, Boolean>>();
private boolean fProjectOnly;
- public ResourcePropertyHolder(boolean projectOnly){
+ public ResourcePropertyHolder(boolean projectOnly) {
fProjectOnly = projectOnly;
}
@@ -42,7 +42,7 @@ class ResourcePropertyHolder extends ResourceChangeHandlerBase {
@Override
public boolean handleResourceMove(IResource fromRc, IResource toRc) {
- if(isValidResource(fromRc)){
+ if (isValidResource(fromRc)) {
moveResourcePropertyMap(fromRc, toRc);
return !fProjectOnly;
}
@@ -51,7 +51,7 @@ class ResourcePropertyHolder extends ResourceChangeHandlerBase {
@Override
public boolean handleResourceRemove(IResource rc) {
- if(isValidResource(rc)){
+ if (isValidResource(rc)) {
removeResourcePropertyMap(rc);
return !fProjectOnly;
}
@@ -60,35 +60,34 @@ class ResourcePropertyHolder extends ResourceChangeHandlerBase {
}
- private boolean isValidResource(IResource rc){
+ private boolean isValidResource(IResource rc) {
return !fProjectOnly || rc.getType() == IResource.PROJECT;
}
@Override
- protected IResourceMoveHandler createResourceMoveHandler(
- IResourceChangeEvent event) {
+ protected IResourceMoveHandler createResourceMoveHandler(IResourceChangeEvent event) {
return new ResourceMoveHandler();
}
- protected String keyForResource(IResource rc){
+ protected String keyForResource(IResource rc) {
return rc.getFullPath().toString();
}
public synchronized Boolean getProperty(IResource rc, String propKey) throws IllegalArgumentException {
- if(!isValidResource(rc))
+ if (!isValidResource(rc))
throw new IllegalArgumentException();
Map<String, Boolean> map = getResourcePropertyMap(rc, false);
- if(map == null)
+ if (map == null)
return null;
return map.get(propKey);
}
- private Map<String, Boolean> getResourcePropertyMap(IResource rc, boolean create){
+ private Map<String, Boolean> getResourcePropertyMap(IResource rc, boolean create) {
String key = keyForResource(rc);
Map<String, Boolean> map = fRcMap.get(key);
- if(map == null && create){
+ if (map == null && create) {
map = new HashMap<String, Boolean>();
fRcMap.put(key, map);
}
@@ -96,43 +95,44 @@ class ResourcePropertyHolder extends ResourceChangeHandlerBase {
return map;
}
- private synchronized void removeResourcePropertyMap(IResource rc){
+ private synchronized void removeResourcePropertyMap(IResource rc) {
String key = keyForResource(rc);
fRcMap.remove(key);
}
- private synchronized void moveResourcePropertyMap(IResource fromRc, IResource toRc){
+ private synchronized void moveResourcePropertyMap(IResource fromRc, IResource toRc) {
String fromKey = keyForResource(fromRc);
String toKey = keyForResource(toRc);
Map<String, Boolean> fromMap = fRcMap.remove(fromKey);
- if(fromMap != null){
+ if (fromMap != null) {
fRcMap.put(toKey, fromMap);
} else {
fRcMap.remove(toKey);
}
}
- public synchronized Boolean setProperty(IResource rc, String propKey, Boolean value) throws IllegalArgumentException {
- if(!isValidResource(rc))
+ public synchronized Boolean setProperty(IResource rc, String propKey, Boolean value)
+ throws IllegalArgumentException {
+ if (!isValidResource(rc))
throw new IllegalArgumentException();
- if(value == null)
+ if (value == null)
return removeProperty(rc, propKey);
Map<String, Boolean> map = getResourcePropertyMap(rc, true);
return map.put(propKey, value);
}
- private synchronized Boolean removeProperty(IResource rc, String propKey){
+ private synchronized Boolean removeProperty(IResource rc, String propKey) {
Map<String, Boolean> map = getResourcePropertyMap(rc, false);
- if(map == null)
+ if (map == null)
return null;
Boolean old = map.remove(propKey);
- if(map.size() == 0)
+ if (map.size() == 0)
removeResourcePropertyMap(rc);
return old;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/AdjustmentContext.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/AdjustmentContext.java
index 065a6159b3a..914938544e7 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/AdjustmentContext.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/AdjustmentContext.java
@@ -18,60 +18,57 @@ import java.util.HashMap;
import java.util.Map.Entry;
import java.util.Set;
-
public class AdjustmentContext {
-// static final int TYPE_CONFIGURATION = 1;
-// static final int TYPE_TOOL_CHAIN = 2;
-// static final int TYPE_TOOL = 3;
-// static final int TYPE_OPTION = 4;
-// static final int TYPE_OUTPUT_TYPE = 5;
-
-// private IBuildObject fObject;
-// private int fType;
-
-// class AfjustedInfo{
-// private boolean fAdjusted;
-//
-// void addAdjustmentState(boolean adjusted){
-// if(!fAdjusted && adjusted){
-// fAdjusted = adjusted;
-// }
-// }
-//
-// boolean isAdjusted(){
-// return fAdjusted;
-// }
-// }
-
-// AdjustmentInfo(IConfiguration cfg){
-// fObject = cfg;
-// fType = TYPE_CONFIGURATION;
-// }
-
-// public int getType(){
-// return fType;
-// }
-
+ // static final int TYPE_CONFIGURATION = 1;
+ // static final int TYPE_TOOL_CHAIN = 2;
+ // static final int TYPE_TOOL = 3;
+ // static final int TYPE_OPTION = 4;
+ // static final int TYPE_OUTPUT_TYPE = 5;
+
+ // private IBuildObject fObject;
+ // private int fType;
+
+ // class AfjustedInfo{
+ // private boolean fAdjusted;
+ //
+ // void addAdjustmentState(boolean adjusted){
+ // if(!fAdjusted && adjusted){
+ // fAdjusted = adjusted;
+ // }
+ // }
+ //
+ // boolean isAdjusted(){
+ // return fAdjusted;
+ // }
+ // }
+
+ // AdjustmentInfo(IConfiguration cfg){
+ // fObject = cfg;
+ // fType = TYPE_CONFIGURATION;
+ // }
+
+ // public int getType(){
+ // return fType;
+ // }
+
private HashMap<String, Boolean> fMap = new HashMap<String, Boolean>();
- public void addAdjustedState(String attr, boolean adjusted){
+ public void addAdjustedState(String attr, boolean adjusted) {
Boolean b = fMap.get(attr);
- if(b == null ||
- (adjusted &&
- !b.booleanValue())){
+ if (b == null || (adjusted && !b.booleanValue())) {
fMap.put(attr, Boolean.valueOf(adjusted));
}
}
-
- public String[] getUnadjusted(){
- if(fMap.size() == 0)
+
+ public String[] getUnadjusted() {
+ if (fMap.size() == 0)
return new String[0];
-
+
ArrayList<String> list = new ArrayList<String>(fMap.size());
Set<Entry<String, Boolean>> entrySet = fMap.entrySet();
for (Entry<String, Boolean> entry : entrySet) {
Boolean b = entry.getValue();
- if(!b.booleanValue()){
+ if (!b.booleanValue()) {
list.add(entry.getKey());
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/AndExpression.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/AndExpression.java
index 3044df01e48..ca9bc8248cf 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/AndExpression.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/AndExpression.java
@@ -21,30 +21,27 @@ import org.eclipse.cdt.managedbuilder.core.IOptionCategory;
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
public class AndExpression extends CompositeExpression {
- public static final String NAME = "and"; //$NON-NLS-1$
+ public static final String NAME = "and"; //$NON-NLS-1$
public AndExpression(IManagedConfigElement element) {
super(element);
}
@Override
- public boolean evaluate(IResourceInfo rcInfo,
- IHoldsOptions holder,
- IOption option) {
+ public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder, IOption option) {
IBooleanExpression children[] = getChildren();
- for(int i = 0; i < children.length; i++){
- if(!children[i].evaluate(rcInfo, holder, option))
+ for (int i = 0; i < children.length; i++) {
+ if (!children[i].evaluate(rcInfo, holder, option))
return false;
}
return true;
}
+
@Override
- public boolean evaluate(IResourceInfo rcInfo,
- IHoldsOptions holder,
- IOptionCategory category) {
+ public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder, IOptionCategory category) {
IBooleanExpression children[] = getChildren();
- for(int i = 0; i < children.length; i++){
- if(!children[i].evaluate(rcInfo, holder, category))
+ for (int i = 0; i < children.length; i++) {
+ if (!children[i].evaluate(rcInfo, holder, category))
return false;
}
return true;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckBuildPropertyExpression.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckBuildPropertyExpression.java
index a5169787b8d..edc6366e936 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckBuildPropertyExpression.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckBuildPropertyExpression.java
@@ -23,102 +23,100 @@ import org.eclipse.cdt.managedbuilder.core.IOptionCategory;
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
public class CheckBuildPropertyExpression implements IBooleanExpression {
- public static final String NAME = "checkBuildProperty"; //$NON-NLS-1$
+ public static final String NAME = "checkBuildProperty"; //$NON-NLS-1$
- public static final String PROPERTY = "property"; //$NON-NLS-1$
- public static final String VALUE = "value"; //$NON-NLS-1$
+ public static final String PROPERTY = "property"; //$NON-NLS-1$
+ public static final String VALUE = "value"; //$NON-NLS-1$
private String fPropertyId;
private String fValueId;
- public CheckBuildPropertyExpression(IManagedConfigElement element){
+ public CheckBuildPropertyExpression(IManagedConfigElement element) {
fPropertyId = element.getAttribute(PROPERTY);
- if(fPropertyId == null)
+ if (fPropertyId == null)
fPropertyId = ""; //$NON-NLS-1$
fValueId = element.getAttribute(VALUE);
-// if(fValueId == null)
-// fValueId = ""; //$NON-NLS-1$
+ // if(fValueId == null)
+ // fValueId = ""; //$NON-NLS-1$
-// fIsRegex = getBooleanValue(element.getAttribute(IS_REGEX));
+ // fIsRegex = getBooleanValue(element.getAttribute(IS_REGEX));
}
-
@Override
- public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder,
- IOption option) {
+ public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder, IOption option) {
return evaluate(rcInfo);
}
@Override
- public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder,
- IOptionCategory category) {
+ public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder, IOptionCategory category) {
return evaluate(rcInfo);
}
private boolean evaluate(IResourceInfo rcInfo) {
IConfiguration cfg = rcInfo.getParent();
IBuildProperty prop = getBuildProperty(cfg, fPropertyId);
- if(prop != null){
+ if (prop != null) {
return fValueId != null ? fValueId.equals(prop.getValue().getId()) : true;
}
return false;
}
-/*
- public static IBuildProperty getBuildProperty(IHoldsOptions ho, String id){
- if(ho instanceof ITool)
- return getBuildProperty((ITool)ho, id);
- if(ho instanceof IToolChain)
- return getBuildProperty((IToolChain)ho, id);
- return null;
- }
- public static IBuildProperty getBuildProperty(ITool tool, String id){
- IBuildProperty prop = tool.getBuildProperties().getProperty(id);
- if(prop == null){
- IBuildObject parent = tool.getParent();
- if(parent instanceof IToolChain){
- prop = getBuildProperty((IToolChain)parent, id);
- } else if (parent instanceof IFileInfo) {
- prop = getBuildProperty((IFileInfo)parent, id);
+ /*
+ public static IBuildProperty getBuildProperty(IHoldsOptions ho, String id){
+ if(ho instanceof ITool)
+ return getBuildProperty((ITool)ho, id);
+ if(ho instanceof IToolChain)
+ return getBuildProperty((IToolChain)ho, id);
+ return null;
+ }
+
+ public static IBuildProperty getBuildProperty(ITool tool, String id){
+ IBuildProperty prop = tool.getBuildProperties().getProperty(id);
+ if(prop == null){
+ IBuildObject parent = tool.getParent();
+ if(parent instanceof IToolChain){
+ prop = getBuildProperty((IToolChain)parent, id);
+ } else if (parent instanceof IFileInfo) {
+ prop = getBuildProperty((IFileInfo)parent, id);
+ }
}
+ return prop;
}
- return prop;
- }
- public static IBuildProperty getBuildProperty(IFileInfo info, String id){
- return getBuildProperty(info.getParent(), id);
- }
+ public static IBuildProperty getBuildProperty(IFileInfo info, String id){
+ return getBuildProperty(info.getParent(), id);
+ }
- public static IBuildProperty getBuildProperty(IFolderInfo info, String id){
- return getBuildProperty(info.getParent(), id);
- }
+ public static IBuildProperty getBuildProperty(IFolderInfo info, String id){
+ return getBuildProperty(info.getParent(), id);
+ }
- public static IBuildProperty getBuildProperty(IToolChain toolChain, String id){
- IBuildProperty prop = null;
- if(toolChain.getParentFolderInfo() == toolChain.getParent().getRootFolderInfo())
- prop = toolChain.getBuildProperties().getProperty(id);
+ public static IBuildProperty getBuildProperty(IToolChain toolChain, String id){
+ IBuildProperty prop = null;
+ if(toolChain.getParentFolderInfo() == toolChain.getParent().getRootFolderInfo())
+ prop = toolChain.getBuildProperties().getProperty(id);
- if(prop == null){
- prop = getBuildProperty(toolChain.getParentFolderInfo(), id);
+ if(prop == null){
+ prop = getBuildProperty(toolChain.getParentFolderInfo(), id);
+ }
+ return prop;
}
- return prop;
- }
-*/
- public static IBuildProperty getBuildProperty(IConfiguration cfg, String id){
+ */
+ public static IBuildProperty getBuildProperty(IConfiguration cfg, String id) {
IBuildProperty prop = cfg.getBuildProperties().getProperty(id);
-// if(prop == null)
-// prop = cfg.getManagedProject().getBuildProperties().getProperty(id);
+ // if(prop == null)
+ // prop = cfg.getManagedProject().getBuildProperties().getProperty(id);
return prop;
}
- public String getPropertyId(){
+ public String getPropertyId() {
return fPropertyId;
}
- public String getValueId(){
+ public String getValueId() {
return fValueId;
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckHolderExpression.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckHolderExpression.java
index b1ec65e383b..69643b17a72 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckHolderExpression.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckHolderExpression.java
@@ -23,32 +23,30 @@ import org.eclipse.cdt.managedbuilder.core.ITool;
import org.eclipse.cdt.managedbuilder.core.IToolChain;
public class CheckHolderExpression implements IBooleanExpression {
- public static final String NAME = "checkHolder"; //$NON-NLS-1$
+ public static final String NAME = "checkHolder"; //$NON-NLS-1$
- public static final String HOLDER_ID = "holderId"; //$NON-NLS-1$
+ public static final String HOLDER_ID = "holderId"; //$NON-NLS-1$
private String fHolderId;
- public CheckHolderExpression(IManagedConfigElement element){
+ public CheckHolderExpression(IManagedConfigElement element) {
fHolderId = element.getAttribute(HOLDER_ID);
}
@Override
- public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder,
- IOption option) {
+ public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder, IOption option) {
return evaluate(holder);
}
@Override
- public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder,
- IOptionCategory category) {
+ public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder, IOptionCategory category) {
return evaluate(holder);
}
private boolean evaluate(IHoldsOptions holder) {
- if(fHolderId != null){
- for(; holder != null; holder = getHolderSuperClass(holder)){
- if(fHolderId.equals(holder.getId()))
+ if (fHolderId != null) {
+ for (; holder != null; holder = getHolderSuperClass(holder)) {
+ if (fHolderId.equals(holder.getId()))
return true;
}
return false;
@@ -56,11 +54,11 @@ public class CheckHolderExpression implements IBooleanExpression {
return true;
}
- private IHoldsOptions getHolderSuperClass(IHoldsOptions holder){
- if(holder instanceof ITool)
- return ((ITool)holder).getSuperClass();
- else if(holder instanceof IToolChain)
- return ((IToolChain)holder).getSuperClass();
+ private IHoldsOptions getHolderSuperClass(IHoldsOptions holder) {
+ if (holder instanceof ITool)
+ return ((ITool) holder).getSuperClass();
+ else if (holder instanceof IToolChain)
+ return ((IToolChain) holder).getSuperClass();
return null;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckOptionExpression.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckOptionExpression.java
index 4db32a9d550..97c65406266 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckOptionExpression.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckOptionExpression.java
@@ -41,14 +41,14 @@ import org.eclipse.cdt.utils.cdtvariables.CdtVariableResolver;
import org.eclipse.cdt.utils.cdtvariables.SupplierBasedCdtVariableSubstitutor;
public class CheckOptionExpression implements IBooleanExpression {
- public static final String NAME = "checkOption"; //$NON-NLS-1$
+ public static final String NAME = "checkOption"; //$NON-NLS-1$
- public static final String OPTION_ID = "optionId"; //$NON-NLS-1$
- public static final String HOLDER_ID = "holderId"; //$NON-NLS-1$
- public static final String VALUE = "value"; //$NON-NLS-1$
- public static final String IS_REGEX = "isRegex"; //$NON-NLS-1$
- public static final String OTHER_OPTION_ID = "otherOptionId"; //$NON-NLS-1$
- public static final String OTHER_HOLDER_ID = "otherHolderId"; //$NON-NLS-1$
+ public static final String OPTION_ID = "optionId"; //$NON-NLS-1$
+ public static final String HOLDER_ID = "holderId"; //$NON-NLS-1$
+ public static final String VALUE = "value"; //$NON-NLS-1$
+ public static final String IS_REGEX = "isRegex"; //$NON-NLS-1$
+ public static final String OTHER_OPTION_ID = "otherOptionId"; //$NON-NLS-1$
+ public static final String OTHER_HOLDER_ID = "otherHolderId"; //$NON-NLS-1$
private String fOptionId;
private String fHolderId;
@@ -57,7 +57,7 @@ public class CheckOptionExpression implements IBooleanExpression {
private String fOtherOptionId;
private String fOtherHolderId;
- public CheckOptionExpression(IManagedConfigElement element){
+ public CheckOptionExpression(IManagedConfigElement element) {
fOptionId = element.getAttribute(OPTION_ID);
fHolderId = element.getAttribute(HOLDER_ID);
fValue = element.getAttribute(VALUE);
@@ -67,101 +67,91 @@ public class CheckOptionExpression implements IBooleanExpression {
}
@Override
- public boolean evaluate(IResourceInfo rcInfo,
- IHoldsOptions holder,
- IOption option) {
+ public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder, IOption option) {
boolean result = false;
- IBuildObject ho[] = getHolderAndOption(fOptionId, fHolderId,
- rcInfo, holder, option);
+ IBuildObject ho[] = getHolderAndOption(fOptionId, fHolderId, rcInfo, holder, option);
- if(ho != null){
- if(fValue != null)
- result = evaluate((IOption)ho[1],((IHoldsOptions)ho[0]),fValue);
+ if (ho != null) {
+ if (fValue != null)
+ result = evaluate((IOption) ho[1], ((IHoldsOptions) ho[0]), fValue);
else {
- IBuildObject otherHo[] = getHolderAndOption(fOtherOptionId, fOtherHolderId,
- rcInfo, holder, option);
- if(otherHo != null)
- result = evaluate((IOption)ho[1],((IHoldsOptions)ho[0]),
- (IOption)otherHo[1],((IHoldsOptions)otherHo[0]));
+ IBuildObject otherHo[] = getHolderAndOption(fOtherOptionId, fOtherHolderId, rcInfo, holder, option);
+ if (otherHo != null)
+ result = evaluate((IOption) ho[1], ((IHoldsOptions) ho[0]), (IOption) otherHo[1],
+ ((IHoldsOptions) otherHo[0]));
}
}
return result;
}
@Override
- public boolean evaluate(IResourceInfo rcInfo,
- IHoldsOptions holder,
- IOptionCategory category) {
+ public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder, IOptionCategory category) {
boolean result = false;
- IBuildObject ho[] = getHolderAndOption(fOptionId, fHolderId,
- rcInfo, holder);
+ IBuildObject ho[] = getHolderAndOption(fOptionId, fHolderId, rcInfo, holder);
- if(ho != null){
- if(fValue != null)
- result = evaluate((IOption)ho[1],((IHoldsOptions)ho[0]),fValue);
+ if (ho != null) {
+ if (fValue != null)
+ result = evaluate((IOption) ho[1], ((IHoldsOptions) ho[0]), fValue);
// otherOptionId shouldn't be set when enabling optionCategory
}
return result;
}
- public boolean evaluate(IOption option, IHoldsOptions holder, String value){
+ public boolean evaluate(IOption option, IHoldsOptions holder, String value) {
IBuildMacroProvider provider = ManagedBuildManager.getBuildMacroProvider();
String delimiter = ManagedBuildManager.getEnvironmentVariableProvider().getDefaultDelimiter();
- String inexVal = " "; //$NON-NLS-1$
+ String inexVal = " "; //$NON-NLS-1$
try {
- String resolvedValue = provider.resolveValue(value, inexVal, delimiter,
- IBuildMacroProvider.CONTEXT_OPTION,
- new OptionContextData(option,holder));
-
- switch(option.getValueType()){
- case IOption.STRING:
- case IOption.TREE:
- case IOption.ENUMERATED:{
- String stringValue = option.getStringValue();
- stringValue = provider.resolveValue(stringValue, inexVal, delimiter,
- IBuildMacroProvider.CONTEXT_OPTION,
- new OptionContextData(option,holder));
- if(fIsRegex){
- Pattern pattern = Pattern.compile(resolvedValue);
- Matcher matcher = pattern.matcher(stringValue);
- return matcher.matches();
- }
- return stringValue.equals(resolvedValue);
+ String resolvedValue = provider.resolveValue(value, inexVal, delimiter, IBuildMacroProvider.CONTEXT_OPTION,
+ new OptionContextData(option, holder));
+
+ switch (option.getValueType()) {
+ case IOption.STRING:
+ case IOption.TREE:
+ case IOption.ENUMERATED: {
+ String stringValue = option.getStringValue();
+ stringValue = provider.resolveValue(stringValue, inexVal, delimiter, IBuildMacroProvider.CONTEXT_OPTION,
+ new OptionContextData(option, holder));
+ if (fIsRegex) {
+ Pattern pattern = Pattern.compile(resolvedValue);
+ Matcher matcher = pattern.matcher(stringValue);
+ return matcher.matches();
}
- case IOption.BOOLEAN:
- return option.getBooleanValue() == OptionEnablementExpression.getBooleanValue(resolvedValue);
- case IOption.INCLUDE_PATH:
- case IOption.STRING_LIST:
- case IOption.PREPROCESSOR_SYMBOLS:
- case IOption.LIBRARIES:
- case IOption.OBJECTS:
- case IOption.INCLUDE_FILES:
- case IOption.LIBRARY_PATHS:
- case IOption.LIBRARY_FILES:
- case IOption.MACRO_FILES:
- case IOption.UNDEF_INCLUDE_PATH:
- case IOption.UNDEF_PREPROCESSOR_SYMBOLS:
- case IOption.UNDEF_INCLUDE_FILES:
- case IOption.UNDEF_LIBRARY_PATHS:
- case IOption.UNDEF_LIBRARY_FILES:
- case IOption.UNDEF_MACRO_FILES:{
- @SuppressWarnings("unchecked")
- List<String> list = (List<String>)option.getValue();
- String listValue = provider.convertStringListToString(list.toArray(new String[list.size()]),delimiter);
-
- listValue = provider.resolveValue(listValue, inexVal, delimiter,
- IBuildMacroProvider.CONTEXT_OPTION,
- new OptionContextData(option,holder));
-
- if(fIsRegex){
- Pattern pattern = Pattern.compile(resolvedValue);
- Matcher matcher = pattern.matcher(listValue);
- return matcher.matches();
- }
- return listValue.equals(resolvedValue);
+ return stringValue.equals(resolvedValue);
+ }
+ case IOption.BOOLEAN:
+ return option.getBooleanValue() == OptionEnablementExpression.getBooleanValue(resolvedValue);
+ case IOption.INCLUDE_PATH:
+ case IOption.STRING_LIST:
+ case IOption.PREPROCESSOR_SYMBOLS:
+ case IOption.LIBRARIES:
+ case IOption.OBJECTS:
+ case IOption.INCLUDE_FILES:
+ case IOption.LIBRARY_PATHS:
+ case IOption.LIBRARY_FILES:
+ case IOption.MACRO_FILES:
+ case IOption.UNDEF_INCLUDE_PATH:
+ case IOption.UNDEF_PREPROCESSOR_SYMBOLS:
+ case IOption.UNDEF_INCLUDE_FILES:
+ case IOption.UNDEF_LIBRARY_PATHS:
+ case IOption.UNDEF_LIBRARY_FILES:
+ case IOption.UNDEF_MACRO_FILES: {
+ @SuppressWarnings("unchecked")
+ List<String> list = (List<String>) option.getValue();
+ String listValue = provider.convertStringListToString(list.toArray(new String[list.size()]), delimiter);
+
+ listValue = provider.resolveValue(listValue, inexVal, delimiter, IBuildMacroProvider.CONTEXT_OPTION,
+ new OptionContextData(option, holder));
+
+ if (fIsRegex) {
+ Pattern pattern = Pattern.compile(resolvedValue);
+ Matcher matcher = pattern.matcher(listValue);
+ return matcher.matches();
}
- default:
- break;
+ return listValue.equals(resolvedValue);
+ }
+ default:
+ break;
}
} catch (BuildException e) {
} catch (BuildMacroException e) {
@@ -169,80 +159,77 @@ public class CheckOptionExpression implements IBooleanExpression {
return false;
}
- public boolean evaluate(IOption option, IHoldsOptions holder,
- IOption otherOption, IHoldsOptions otherHolder){
+ public boolean evaluate(IOption option, IHoldsOptions holder, IOption otherOption, IHoldsOptions otherHolder) {
try {
- if(option.getValueType() != otherOption.getValueType())
+ if (option.getValueType() != otherOption.getValueType())
return false;
- BuildMacroProvider provider = (BuildMacroProvider)ManagedBuildManager.getBuildMacroProvider();
+ BuildMacroProvider provider = (BuildMacroProvider) ManagedBuildManager.getBuildMacroProvider();
String delimiter = ManagedBuildManager.getEnvironmentVariableProvider().getDefaultDelimiter();
- String inexVal = " "; //$NON-NLS-1$
-
- switch(option.getValueType()){
- case IOption.STRING:
- case IOption.TREE:
- case IOption.ENUMERATED:{
- String stringValue = option.getStringValue();
- stringValue = provider.resolveValue(stringValue, inexVal, delimiter,
- IBuildMacroProvider.CONTEXT_OPTION,
- new OptionContextData(option,holder));
-
- String str = otherOption.getStringValue();
- str = provider.resolveValue(str, inexVal, delimiter,
- IBuildMacroProvider.CONTEXT_OPTION,
- new OptionContextData(otherOption,otherHolder));
-
- return stringValue.equals(str);
- }
- case IOption.BOOLEAN:
- return option.getBooleanValue() == otherOption.getBooleanValue();
- case IOption.INCLUDE_PATH:
- case IOption.STRING_LIST:
- case IOption.PREPROCESSOR_SYMBOLS:
- case IOption.LIBRARIES:
- case IOption.OBJECTS:
- case IOption.INCLUDE_FILES:
- case IOption.LIBRARY_PATHS:
- case IOption.LIBRARY_FILES:
- case IOption.MACRO_FILES:
- case IOption.UNDEF_INCLUDE_PATH:
- case IOption.UNDEF_PREPROCESSOR_SYMBOLS:
- case IOption.UNDEF_INCLUDE_FILES:
- case IOption.UNDEF_LIBRARY_PATHS:
- case IOption.UNDEF_LIBRARY_FILES:
- case IOption.UNDEF_MACRO_FILES:{
- @SuppressWarnings("unchecked")
- List<String> list = (List<String>)option.getValue();
- String listValue[] = list.toArray(new String[list.size()]);
-
- @SuppressWarnings("unchecked")
- List<String> otherList = (List<String>)otherOption.getValue();
- String otherValue[] = otherList.toArray(new String[otherList.size()]);
-
- IMacroContextInfo info = provider.getMacroContextInfo(IBuildMacroProvider.CONTEXT_OPTION,
- new OptionContextData(option,holder));
- SupplierBasedCdtVariableSubstitutor subst = provider.getMacroSubstitutor(info,inexVal,delimiter);
-
- listValue = CdtVariableResolver.resolveStringListValues(listValue,subst,false);
-
- info = provider.getMacroContextInfo(IBuildMacroProvider.CONTEXT_OPTION,
- new OptionContextData(otherOption,otherHolder));
- subst = provider.getMacroSubstitutor(info,inexVal,delimiter);
-
- otherValue = CdtVariableResolver.resolveStringListValues(otherValue,subst,false);
-
- if(listValue.length == otherValue.length){
- for(int i = 0; i < listValue.length; i++){
- if(!listValue[i].equals(otherValue[i]))
- return false;
- }
- return true;
+ String inexVal = " "; //$NON-NLS-1$
+
+ switch (option.getValueType()) {
+ case IOption.STRING:
+ case IOption.TREE:
+ case IOption.ENUMERATED: {
+ String stringValue = option.getStringValue();
+ stringValue = provider.resolveValue(stringValue, inexVal, delimiter, IBuildMacroProvider.CONTEXT_OPTION,
+ new OptionContextData(option, holder));
+
+ String str = otherOption.getStringValue();
+ str = provider.resolveValue(str, inexVal, delimiter, IBuildMacroProvider.CONTEXT_OPTION,
+ new OptionContextData(otherOption, otherHolder));
+
+ return stringValue.equals(str);
+ }
+ case IOption.BOOLEAN:
+ return option.getBooleanValue() == otherOption.getBooleanValue();
+ case IOption.INCLUDE_PATH:
+ case IOption.STRING_LIST:
+ case IOption.PREPROCESSOR_SYMBOLS:
+ case IOption.LIBRARIES:
+ case IOption.OBJECTS:
+ case IOption.INCLUDE_FILES:
+ case IOption.LIBRARY_PATHS:
+ case IOption.LIBRARY_FILES:
+ case IOption.MACRO_FILES:
+ case IOption.UNDEF_INCLUDE_PATH:
+ case IOption.UNDEF_PREPROCESSOR_SYMBOLS:
+ case IOption.UNDEF_INCLUDE_FILES:
+ case IOption.UNDEF_LIBRARY_PATHS:
+ case IOption.UNDEF_LIBRARY_FILES:
+ case IOption.UNDEF_MACRO_FILES: {
+ @SuppressWarnings("unchecked")
+ List<String> list = (List<String>) option.getValue();
+ String listValue[] = list.toArray(new String[list.size()]);
+
+ @SuppressWarnings("unchecked")
+ List<String> otherList = (List<String>) otherOption.getValue();
+ String otherValue[] = otherList.toArray(new String[otherList.size()]);
+
+ IMacroContextInfo info = provider.getMacroContextInfo(IBuildMacroProvider.CONTEXT_OPTION,
+ new OptionContextData(option, holder));
+ SupplierBasedCdtVariableSubstitutor subst = provider.getMacroSubstitutor(info, inexVal, delimiter);
+
+ listValue = CdtVariableResolver.resolveStringListValues(listValue, subst, false);
+
+ info = provider.getMacroContextInfo(IBuildMacroProvider.CONTEXT_OPTION,
+ new OptionContextData(otherOption, otherHolder));
+ subst = provider.getMacroSubstitutor(info, inexVal, delimiter);
+
+ otherValue = CdtVariableResolver.resolveStringListValues(otherValue, subst, false);
+
+ if (listValue.length == otherValue.length) {
+ for (int i = 0; i < listValue.length; i++) {
+ if (!listValue[i].equals(otherValue[i]))
+ return false;
}
- return false;
+ return true;
}
- default:
- break;
+ return false;
+ }
+ default:
+ break;
}
} catch (BuildException e) {
} catch (CdtVariableException e) {
@@ -251,78 +238,69 @@ public class CheckOptionExpression implements IBooleanExpression {
return false;
}
- protected IBuildObject[] getHolderAndOption(String optionId,
- String holderId,
- IResourceInfo rcInfo,
- IHoldsOptions holder,
- IOption option
- ){
+ protected IBuildObject[] getHolderAndOption(String optionId, String holderId, IResourceInfo rcInfo,
+ IHoldsOptions holder, IOption option) {
IBuildObject result[] = null;
- if(optionId == null)
- result = new IBuildObject[]{holder,option};
+ if (optionId == null)
+ result = new IBuildObject[] { holder, option };
else {
IHoldsOptions hld = null;
- if(holderId == null)
+ if (holderId == null)
hld = holder;
else
- hld = getHolder(holderId,rcInfo);
+ hld = getHolder(holderId, rcInfo);
- if(hld != null) {
- IOption opt = getOption(optionId,hld);
- if(opt != null)
- result = new IBuildObject[]{hld,opt};
+ if (hld != null) {
+ IOption opt = getOption(optionId, hld);
+ if (opt != null)
+ result = new IBuildObject[] { hld, opt };
}
}
return result;
}
/* This is called for optionCategory */
- protected IBuildObject[] getHolderAndOption(String optionId,
- String holderId,
- IResourceInfo rcInfo,
- IHoldsOptions holder
- ){
+ protected IBuildObject[] getHolderAndOption(String optionId, String holderId, IResourceInfo rcInfo,
+ IHoldsOptions holder) {
IBuildObject result[] = null;
- if(optionId != null) {
+ if (optionId != null) {
IHoldsOptions hld = null;
- if(holderId == null)
+ if (holderId == null)
hld = holder;
else
- hld = getHolder(holderId,rcInfo);
+ hld = getHolder(holderId, rcInfo);
- if(hld != null) {
- IOption opt = getOption(optionId,hld);
- if(opt != null)
- result = new IBuildObject[]{hld,opt};
+ if (hld != null) {
+ IOption opt = getOption(optionId, hld);
+ if (opt != null)
+ result = new IBuildObject[] { hld, opt };
}
}
return result;
}
- protected IOption getOption(String optionId,
- IHoldsOptions holder){
+ protected IOption getOption(String optionId, IHoldsOptions holder) {
return holder.getOptionBySuperClassId(optionId);
}
- protected IHoldsOptions getHolder(String id,
- IResourceInfo rcInfo){
+ protected IHoldsOptions getHolder(String id, IResourceInfo rcInfo) {
IHoldsOptions holder = null;
- if(rcInfo instanceof IFileInfo){
- IHoldsOptions holders[] = ((IResourceConfiguration)rcInfo).getTools();
- for(int i = 0; i < holders.length; i++){
- if(isHolder(id,holders[i])){
+ if (rcInfo instanceof IFileInfo) {
+ IHoldsOptions holders[] = ((IResourceConfiguration) rcInfo).getTools();
+ for (int i = 0; i < holders.length; i++) {
+ if (isHolder(id, holders[i])) {
holder = holders[i];
break;
}
}
- } else if (rcInfo instanceof IFolderInfo){
- IToolChain tc = ((IFolderInfo)rcInfo).getToolChain();
- if(isHolder(id,tc))
+ } else if (rcInfo instanceof IFolderInfo) {
+ IToolChain tc = ((IFolderInfo) rcInfo).getToolChain();
+ if (isHolder(id, tc))
holder = tc;
else {
IHoldsOptions holders[] = tc.getTools();
- for(int i = 0; i < holders.length; i++){
- if(isHolder(id,holders[i])){
+ for (int i = 0; i < holders.length; i++) {
+ if (isHolder(id, holders[i])) {
holder = holders[i];
break;
}
@@ -333,17 +311,17 @@ public class CheckOptionExpression implements IBooleanExpression {
return holder;
}
- protected boolean isHolder(String id, IHoldsOptions holder){
+ protected boolean isHolder(String id, IHoldsOptions holder) {
do {
- if(id.equals(holder.getId()))
+ if (id.equals(holder.getId()))
return true;
- if(holder instanceof IToolChain)
- holder = ((IToolChain)holder).getSuperClass();
- else if(holder instanceof ITool)
- holder = ((ITool)holder).getSuperClass();
+ if (holder instanceof IToolChain)
+ holder = ((IToolChain) holder).getSuperClass();
+ else if (holder instanceof ITool)
+ holder = ((ITool) holder).getSuperClass();
else
holder = null;
- } while(holder != null);
+ } while (holder != null);
return false;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckStringExpression.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckStringExpression.java
index ea5c1cca68e..31e2c573483 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckStringExpression.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CheckStringExpression.java
@@ -29,52 +29,42 @@ import org.eclipse.cdt.managedbuilder.macros.BuildMacroException;
import org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider;
public class CheckStringExpression implements IBooleanExpression {
- public static final String NAME = "checkString"; //$NON-NLS-1$
+ public static final String NAME = "checkString"; //$NON-NLS-1$
- public static final String STRING = "string"; //$NON-NLS-1$
- public static final String VALUE = "value"; //$NON-NLS-1$
- public static final String IS_REGEX = "isRegex"; //$NON-NLS-1$
+ public static final String STRING = "string"; //$NON-NLS-1$
+ public static final String VALUE = "value"; //$NON-NLS-1$
+ public static final String IS_REGEX = "isRegex"; //$NON-NLS-1$
private String fString;
private String fValue;
private boolean fIsRegex;
- public CheckStringExpression(IManagedConfigElement element){
+ public CheckStringExpression(IManagedConfigElement element) {
fString = element.getAttribute(STRING);
- if(fString == null)
+ if (fString == null)
fString = ""; //$NON-NLS-1$
fValue = element.getAttribute(VALUE);
- if(fValue == null)
+ if (fValue == null)
fValue = ""; //$NON-NLS-1$
fIsRegex = OptionEnablementExpression.getBooleanValue(element.getAttribute(IS_REGEX));
}
@Override
- public boolean evaluate(IResourceInfo rcInfo,
- IHoldsOptions holder,
- IOption option) {
+ public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder, IOption option) {
IBuildMacroProvider provider = ManagedBuildManager.getBuildMacroProvider();
IEnvironmentVariableProvider env = ManagedBuildManager.getEnvironmentVariableProvider();
String delimiter = env.getDefaultDelimiter();
try {
- String resolvedString = provider.resolveValue(fString,
- " ", //$NON-NLS-1$
- delimiter,
- IBuildMacroProvider.CONTEXT_OPTION,
- new OptionContextData(option,holder)
- );
-
- String resolvedValue = provider.resolveValue(fValue,
- " ", //$NON-NLS-1$
- delimiter,
- IBuildMacroProvider.CONTEXT_OPTION,
- new OptionContextData(option,holder)
- );
-
- if(fIsRegex){
+ String resolvedString = provider.resolveValue(fString, " ", //$NON-NLS-1$
+ delimiter, IBuildMacroProvider.CONTEXT_OPTION, new OptionContextData(option, holder));
+
+ String resolvedValue = provider.resolveValue(fValue, " ", //$NON-NLS-1$
+ delimiter, IBuildMacroProvider.CONTEXT_OPTION, new OptionContextData(option, holder));
+
+ if (fIsRegex) {
Pattern pattern = Pattern.compile(resolvedValue);
Matcher matcher = pattern.matcher(resolvedString);
return matcher.matches();
@@ -86,29 +76,19 @@ public class CheckStringExpression implements IBooleanExpression {
}
@Override
- public boolean evaluate(IResourceInfo rcInfo,
- IHoldsOptions holder,
- IOptionCategory category) {
+ public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder, IOptionCategory category) {
IBuildMacroProvider provider = ManagedBuildManager.getBuildMacroProvider();
IEnvironmentVariableProvider env = ManagedBuildManager.getEnvironmentVariableProvider();
String delimiter = env.getDefaultDelimiter();
try {
- String resolvedString = provider.resolveValue(fString,
- " ", //$NON-NLS-1$
- delimiter,
- IBuildMacroProvider.CONTEXT_OPTION,
- new OptionContextData(category,holder)
- );
-
- String resolvedValue = provider.resolveValue(fValue,
- " ", //$NON-NLS-1$
- delimiter,
- IBuildMacroProvider.CONTEXT_OPTION,
- new OptionContextData(category,holder)
- );
-
- if(fIsRegex){
+ String resolvedString = provider.resolveValue(fString, " ", //$NON-NLS-1$
+ delimiter, IBuildMacroProvider.CONTEXT_OPTION, new OptionContextData(category, holder));
+
+ String resolvedValue = provider.resolveValue(fValue, " ", //$NON-NLS-1$
+ delimiter, IBuildMacroProvider.CONTEXT_OPTION, new OptionContextData(category, holder));
+
+ if (fIsRegex) {
Pattern pattern = Pattern.compile(resolvedValue);
Matcher matcher = pattern.matcher(resolvedString);
return matcher.matches();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CompositeExpression.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CompositeExpression.java
index 7ad5ee4e22f..5b4700b2d32 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CompositeExpression.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/CompositeExpression.java
@@ -22,25 +22,26 @@ import org.eclipse.cdt.managedbuilder.core.IManagedConfigElement;
public abstract class CompositeExpression implements IBooleanExpression {
private IBooleanExpression fChildren[];
- protected CompositeExpression(IManagedConfigElement element){
+
+ protected CompositeExpression(IManagedConfigElement element) {
IManagedConfigElement childElement[] = element.getChildren();
IBooleanExpression children[] = new IBooleanExpression[childElement.length];
int num = 0;
- for(int i = 0; i < childElement.length; i++){
+ for (int i = 0; i < childElement.length; i++) {
IBooleanExpression child = createExpression(childElement[i]);
- if(child != null)
+ if (child != null)
children[num++] = child;
}
-
- if(num < children.length){
+
+ if (num < children.length) {
IBooleanExpression tmp[] = new IBooleanExpression[num];
- System.arraycopy(children,0,tmp,0,num);
+ System.arraycopy(children, 0, tmp, 0, num);
children = tmp;
}
fChildren = children;
}
-
- protected IBooleanExpression createExpression(IManagedConfigElement element){
+
+ protected IBooleanExpression createExpression(IManagedConfigElement element) {
String name = element.getName();
if (AndExpression.NAME.equals(name))
return new AndExpression(element);
@@ -51,7 +52,7 @@ public abstract class CompositeExpression implements IBooleanExpression {
else if (CheckOptionExpression.NAME.equals(name))
return new CheckOptionExpression(element);
else if (CheckStringExpression.NAME.equals(name))
- return new CheckStringExpression(element);
+ return new CheckStringExpression(element);
else if (FalseExpression.NAME.equals(name))
return new FalseExpression(element);
else if (CheckHolderExpression.NAME.equals(name))
@@ -62,28 +63,27 @@ public abstract class CompositeExpression implements IBooleanExpression {
return new HasNatureExpression(element);
return null;
}
-
- public IBooleanExpression[] getChildren(){
+
+ public IBooleanExpression[] getChildren() {
return fChildren;
}
-
- public Map<String, Set<String>> getReferencedProperties(Map<String, Set<String>> map){
+
+ public Map<String, Set<String>> getReferencedProperties(Map<String, Set<String>> map) {
IBooleanExpression children[] = getChildren();
- if(map == null)
+ if (map == null)
map = new HashMap<String, Set<String>>();
- for(int i = 0; i < children.length; i++){
+ for (int i = 0; i < children.length; i++) {
IBooleanExpression child = children[i];
- if(child instanceof CompositeExpression){
- ((CompositeExpression)child).getReferencedProperties(map);
- } else if(child instanceof CheckBuildPropertyExpression){
- CheckBuildPropertyExpression bp = (CheckBuildPropertyExpression)child;
+ if (child instanceof CompositeExpression) {
+ ((CompositeExpression) child).getReferencedProperties(map);
+ } else if (child instanceof CheckBuildPropertyExpression) {
+ CheckBuildPropertyExpression bp = (CheckBuildPropertyExpression) child;
String prop = bp.getPropertyId();
String val = bp.getValueId();
- if(prop != null && prop.length() != 0
- && val != null && val.length() != 0){
+ if (prop != null && prop.length() != 0 && val != null && val.length() != 0) {
Set<String> set = map.get(prop);
- if(set == null){
+ if (set == null) {
set = new HashSet<String>();
map.put(prop, set);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/FalseExpression.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/FalseExpression.java
index eab96d88d75..9fdde0f3e1f 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/FalseExpression.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/FalseExpression.java
@@ -21,19 +21,18 @@ import org.eclipse.cdt.managedbuilder.core.IOptionCategory;
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
public class FalseExpression implements IBooleanExpression {
- public static final String NAME = "false"; //$NON-NLS-1$
+ public static final String NAME = "false"; //$NON-NLS-1$
public FalseExpression(IManagedConfigElement element) {
}
@Override
- public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder,
- IOption option) {
+ public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder, IOption option) {
return false;
}
+
@Override
- public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder,
- IOptionCategory category) {
+ public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder, IOptionCategory category) {
return false;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/HasNatureExpression.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/HasNatureExpression.java
index 100490e4a23..2a419c06b00 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/HasNatureExpression.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/HasNatureExpression.java
@@ -41,14 +41,12 @@ public class HasNatureExpression implements IBooleanExpression {
}
@Override
- public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder,
- IOption option) {
+ public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder, IOption option) {
return evaluate(rcInfo);
}
@Override
- public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder,
- IOptionCategory category) {
+ public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder, IOptionCategory category) {
return evaluate(rcInfo);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/IBooleanExpression.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/IBooleanExpression.java
index 3df5e09c733..209166cc13e 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/IBooleanExpression.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/IBooleanExpression.java
@@ -20,10 +20,7 @@ import org.eclipse.cdt.managedbuilder.core.IOptionCategory;
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
public interface IBooleanExpression {
- public boolean evaluate(IResourceInfo rcInfo,
- IHoldsOptions holder,
- IOption option);
- public boolean evaluate(IResourceInfo rcInfo,
- IHoldsOptions holder,
- IOptionCategory category);
+ public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder, IOption option);
+
+ public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder, IOptionCategory category);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/NotExpression.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/NotExpression.java
index b917c48e21c..8e8cbae053c 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/NotExpression.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/NotExpression.java
@@ -21,23 +21,19 @@ import org.eclipse.cdt.managedbuilder.core.IOptionCategory;
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
public class NotExpression extends AndExpression {
- public static final String NAME = "not"; //$NON-NLS-1$
-
+ public static final String NAME = "not"; //$NON-NLS-1$
+
public NotExpression(IManagedConfigElement element) {
super(element);
}
@Override
- public boolean evaluate(IResourceInfo rcInfo,
- IHoldsOptions holder,
- IOption option) {
+ public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder, IOption option) {
return !super.evaluate(rcInfo, holder, option);
}
-
+
@Override
- public boolean evaluate(IResourceInfo rcInfo,
- IHoldsOptions holder,
- IOptionCategory category) {
+ public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder, IOptionCategory category) {
return !super.evaluate(rcInfo, holder, category);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/OptionEnablementExpression.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/OptionEnablementExpression.java
index 2d84b5da9fe..ce516d3276b 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/OptionEnablementExpression.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/OptionEnablementExpression.java
@@ -27,42 +27,33 @@ import org.eclipse.cdt.managedbuilder.core.ITool;
import org.eclipse.cdt.managedbuilder.core.IToolChain;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
-public class OptionEnablementExpression extends AndExpression{
- public static final String NAME = "enablement"; //$NON-NLS-1$
- public static final String TYPE = "type"; //$NON-NLS-1$
-
- public static final String TYPE_UI_VISIBILITY = "UI_VISIBILITY"; //$NON-NLS-1$
- public static final String TYPE_UI_ENABLEMENT = "UI_ENABLEMENT"; //$NON-NLS-1$
- public static final String TYPE_CMD_USAGE = "CMD_USAGE"; //$NON-NLS-1$
- public static final String TYPE_CONTAINER_ATTRIBUTE = "CONTAINER_ATTRIBUTE"; //$NON-NLS-1$
- public static final String TYPE_ALL = "ALL"; //$NON-NLS-1$
-
- public static final String FLAG_DELIMITER = "|"; //$NON-NLS-1$
-
- public static final String ATTRIBUTE = "attribute"; //$NON-NLS-1$
- public static final String VALUE = "value"; //$NON-NLS-1$
-
- public static final String EXTENSION_ADJUSTMENT = "extensionAdjustment"; //$NON-NLS-1$
-
- public static final String YES = "yes"; //$NON-NLS-1$
- public static final String TRUE = "true"; //$NON-NLS-1$
-
-
- private static final String fSupportedOptionAttributes[] = {
- IOption.COMMAND,
- IOption.COMMAND_FALSE,
- IOption.VALUE,
- IOption.DEFAULT_VALUE,
- };
-
- private static final String fSupportedToolChainAttributes[] = {
- IToolChain.TARGET_TOOL,
- };
-
- private static final String fSupportedConfigurationAttributes[] = {
- IConfiguration.EXTENSION,
- IConfiguration.ARTIFACT_NAME,
- };
+public class OptionEnablementExpression extends AndExpression {
+ public static final String NAME = "enablement"; //$NON-NLS-1$
+ public static final String TYPE = "type"; //$NON-NLS-1$
+
+ public static final String TYPE_UI_VISIBILITY = "UI_VISIBILITY"; //$NON-NLS-1$
+ public static final String TYPE_UI_ENABLEMENT = "UI_ENABLEMENT"; //$NON-NLS-1$
+ public static final String TYPE_CMD_USAGE = "CMD_USAGE"; //$NON-NLS-1$
+ public static final String TYPE_CONTAINER_ATTRIBUTE = "CONTAINER_ATTRIBUTE"; //$NON-NLS-1$
+ public static final String TYPE_ALL = "ALL"; //$NON-NLS-1$
+
+ public static final String FLAG_DELIMITER = "|"; //$NON-NLS-1$
+
+ public static final String ATTRIBUTE = "attribute"; //$NON-NLS-1$
+ public static final String VALUE = "value"; //$NON-NLS-1$
+
+ public static final String EXTENSION_ADJUSTMENT = "extensionAdjustment"; //$NON-NLS-1$
+
+ public static final String YES = "yes"; //$NON-NLS-1$
+ public static final String TRUE = "true"; //$NON-NLS-1$
+
+ private static final String fSupportedOptionAttributes[] = { IOption.COMMAND, IOption.COMMAND_FALSE, IOption.VALUE,
+ IOption.DEFAULT_VALUE, };
+
+ private static final String fSupportedToolChainAttributes[] = { IToolChain.TARGET_TOOL, };
+
+ private static final String fSupportedConfigurationAttributes[] = { IConfiguration.EXTENSION,
+ IConfiguration.ARTIFACT_NAME, };
public static final int FLAG_UI_VISIBILITY = 0x01;
public static final int FLAG_UI_ENABLEMENT = 0x02;
@@ -77,45 +68,44 @@ public class OptionEnablementExpression extends AndExpression{
public OptionEnablementExpression(IManagedConfigElement element) {
super(element);
-
+
fEnablementFlags = calculateFlags(element.getAttribute(TYPE));
-
+
fAttribute = element.getAttribute(ATTRIBUTE);
fValue = element.getAttribute(VALUE);
String tmp = element.getAttribute(EXTENSION_ADJUSTMENT);
-
+
adjustAttributeSupport();
-
- if(tmp != null) {
+
+ if (tmp != null) {
fIsExtensionAdjustment = getBooleanValue(tmp);
} else {
- fIsExtensionAdjustment = checkFlags(FLAG_CONTAINER_ATTRIBUTE) ?
- false : true;
+ fIsExtensionAdjustment = checkFlags(FLAG_CONTAINER_ATTRIBUTE) ? false : true;
}
}
-
- private void adjustAttributeSupport(){
+
+ private void adjustAttributeSupport() {
boolean cleanAttrFlag = true;
- if(fAttribute != null && fValue != null){
- for(int i = 0; i < fSupportedOptionAttributes.length; i++){
- if(fAttribute.equals(fSupportedOptionAttributes[i])){
+ if (fAttribute != null && fValue != null) {
+ for (int i = 0; i < fSupportedOptionAttributes.length; i++) {
+ if (fAttribute.equals(fSupportedOptionAttributes[i])) {
cleanAttrFlag = false;
break;
}
}
-
- if(cleanAttrFlag){
- for(int i = 0; i < fSupportedToolChainAttributes.length; i++){
- if(fAttribute.equals(fSupportedToolChainAttributes[i])){
+
+ if (cleanAttrFlag) {
+ for (int i = 0; i < fSupportedToolChainAttributes.length; i++) {
+ if (fAttribute.equals(fSupportedToolChainAttributes[i])) {
cleanAttrFlag = false;
break;
}
}
}
- if(cleanAttrFlag){
- for(int i = 0; i < fSupportedConfigurationAttributes.length; i++){
- if(fAttribute.equals(fSupportedConfigurationAttributes[i])){
+ if (cleanAttrFlag) {
+ for (int i = 0; i < fSupportedConfigurationAttributes.length; i++) {
+ if (fAttribute.equals(fSupportedConfigurationAttributes[i])) {
cleanAttrFlag = false;
break;
}
@@ -123,30 +113,29 @@ public class OptionEnablementExpression extends AndExpression{
}
}
-
- if(cleanAttrFlag){
+
+ if (cleanAttrFlag) {
fEnablementFlags &= ~FLAG_CONTAINER_ATTRIBUTE;
fAttribute = null;
fValue = null;
}
}
- public String[] convertToList(String value, String delimiter){
+ public String[] convertToList(String value, String delimiter) {
List<String> list = new ArrayList<String>();
int delLength = delimiter.length();
int valLength = value.length();
- if(delLength == 0){
+ if (delLength == 0) {
list.add(value);
- }
- else{
+ } else {
int start = 0;
int stop;
- while(start < valLength){
- stop = value.indexOf(delimiter,start);
- if(stop == -1)
+ while (start < valLength) {
+ stop = value.indexOf(delimiter, start);
+ if (stop == -1)
stop = valLength;
- String subst = value.substring(start,stop);
+ String subst = value.substring(start, stop);
list.add(subst);
start = stop + delLength;
}
@@ -154,156 +143,141 @@ public class OptionEnablementExpression extends AndExpression{
return list.toArray(new String[list.size()]);
}
-
- protected int calculateFlags(String flagsString){
+
+ protected int calculateFlags(String flagsString) {
int flags = 0;
-
- if(flagsString != null){
- String strings[] = convertToList(flagsString,FLAG_DELIMITER);
-
- for(int i = 0; i < strings.length; i++){
+
+ if (flagsString != null) {
+ String strings[] = convertToList(flagsString, FLAG_DELIMITER);
+
+ for (int i = 0; i < strings.length; i++) {
String str = strings[i].trim();
- if(TYPE_UI_VISIBILITY.equals(str))
+ if (TYPE_UI_VISIBILITY.equals(str))
flags |= FLAG_UI_VISIBILITY;
- else if(TYPE_UI_ENABLEMENT.equals(str))
+ else if (TYPE_UI_ENABLEMENT.equals(str))
flags |= FLAG_UI_ENABLEMENT;
- else if(TYPE_CMD_USAGE.equals(str))
+ else if (TYPE_CMD_USAGE.equals(str))
flags |= FLAG_CMD_USAGE;
- else if(TYPE_CONTAINER_ATTRIBUTE.equals(str))
+ else if (TYPE_CONTAINER_ATTRIBUTE.equals(str))
flags |= FLAG_CONTAINER_ATTRIBUTE;
- else if(TYPE_ALL.equals(str))
+ else if (TYPE_ALL.equals(str))
flags |= FLAG_ALL;
}
}
-
- if(flags == 0)
+
+ if (flags == 0)
flags = FLAG_ALL;
return flags;
}
-
- public boolean evaluate(IResourceInfo rcInfo,
- IHoldsOptions holder,
- IOption option,
- int flags){
+
+ public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder, IOption option, int flags) {
return evaluate(rcInfo, holder, option, flags, (FLAG_CONTAINER_ATTRIBUTE & flags) == 0);
}
- public boolean evaluate(IResourceInfo rcInfo,
- IHoldsOptions holder,
- IOption option,
- int flags,
- boolean bDefault){
- return checkFlags(flags) ? evaluate(rcInfo, holder, option)
- : bDefault;
+ public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder, IOption option, int flags, boolean bDefault) {
+ return checkFlags(flags) ? evaluate(rcInfo, holder, option) : bDefault;
}
-/* public boolean evaluate(IBuildObject configuration,
- IHoldsOptions holder,
- IOption option) {
- if(getChildren().length == 0)
- return false;
- return super.evaluate(configuration,holder,option);
- }
-*/
- public boolean checkFlags(int flags){
+ /* public boolean evaluate(IBuildObject configuration,
+ IHoldsOptions holder,
+ IOption option) {
+ if(getChildren().length == 0)
+ return false;
+ return super.evaluate(configuration,holder,option);
+ }
+ */
+ public boolean checkFlags(int flags) {
return (fEnablementFlags & flags) == flags;
}
-
- public int getFlags(){
+
+ public int getFlags() {
return fEnablementFlags;
}
-
-/* public boolean performAdjustment(IBuildObject configuration,
- IHoldsOptions holder,
- IOption option,
- boolean extensionAdjustment){
- boolean adjusted = false;
- if(canPerformAdjustment(extensionAdjustment)){
- if(evaluate(configuration,holder,option,FLAG_CONTAINER_ATTRIBUTE)){
- if(option != null){
- adjusted = adjustOption(configuration, holder, option, extensionAdjustment);
- } else if (holder != null){
- if(holder instanceof ITool){
- adjusted = adjustTool(configuration, (ITool)holder, extensionAdjustment);
- } else if(holder instanceof IToolChain){
- adjusted = adjustToolChain(configuration, (IToolChain)holder, extensionAdjustment);
- }
- } else if (configuration != null){
- if(configuration instanceof IConfiguration){
- adjusted = adjustConfiguration((IConfiguration)holder, extensionAdjustment);
+
+ /* public boolean performAdjustment(IBuildObject configuration,
+ IHoldsOptions holder,
+ IOption option,
+ boolean extensionAdjustment){
+ boolean adjusted = false;
+ if(canPerformAdjustment(extensionAdjustment)){
+ if(evaluate(configuration,holder,option,FLAG_CONTAINER_ATTRIBUTE)){
+ if(option != null){
+ adjusted = adjustOption(configuration, holder, option, extensionAdjustment);
+ } else if (holder != null){
+ if(holder instanceof ITool){
+ adjusted = adjustTool(configuration, (ITool)holder, extensionAdjustment);
+ } else if(holder instanceof IToolChain){
+ adjusted = adjustToolChain(configuration, (IToolChain)holder, extensionAdjustment);
+ }
+ } else if (configuration != null){
+ if(configuration instanceof IConfiguration){
+ adjusted = adjustConfiguration((IConfiguration)holder, extensionAdjustment);
+ }
}
}
}
+ return adjusted;
}
- return adjusted;
- }
-*/
- private static IOption getOptionToSet(IHoldsOptions holder,
- IOption option,
- String value,
- boolean extensionAdjustment){
+ */
+ private static IOption getOptionToSet(IHoldsOptions holder, IOption option, String value,
+ boolean extensionAdjustment) {
IOption optionToSet = null;
- if(value != null){
+ if (value != null) {
try {
optionToSet = holder.getOptionToSet(option, extensionAdjustment);
} catch (BuildException e) {
}
} else {
- if(!extensionAdjustment && option.getOptionHolder() == holder){
+ if (!extensionAdjustment && option.getOptionHolder() == holder) {
optionToSet = option;
}
}
return optionToSet;
}
- public static boolean adjustOption(IResourceInfo rcInfo,
- IHoldsOptions holder,
- IOption option,
- String attribute,
- String value,
- boolean extensionAdjustment
- ){
-
- if(value == null && rcInfo.isExtensionElement())
+ public static boolean adjustOption(IResourceInfo rcInfo, IHoldsOptions holder, IOption option, String attribute,
+ String value, boolean extensionAdjustment) {
+
+ if (value == null && rcInfo.isExtensionElement())
return false;
-
+
IOption setOption = getOptionToSet(holder, option, value, extensionAdjustment);
- if(setOption == null)
+ if (setOption == null)
return false;
-
+
boolean adjusted = true;
- try{
- if(IOption.COMMAND.equals(attribute)){
-// IOption setOption = holder.getOptionToSet(option, extensionAdjustment);
+ try {
+ if (IOption.COMMAND.equals(attribute)) {
+ // IOption setOption = holder.getOptionToSet(option, extensionAdjustment);
setOption.setCommand(value);
- }else if(IOption.COMMAND_FALSE.equals(attribute)){
-// IOption setOption = holder.getOptionToSet(option, extensionAdjustment);
+ } else if (IOption.COMMAND_FALSE.equals(attribute)) {
+ // IOption setOption = holder.getOptionToSet(option, extensionAdjustment);
setOption.setCommandFalse(value);
- }else if(IOption.VALUE.equals(attribute)){
-// IOption setOption = holder.getOptionToSet(option, extensionAdjustment);
- switch(setOption.getValueType()){
+ } else if (IOption.VALUE.equals(attribute)) {
+ // IOption setOption = holder.getOptionToSet(option, extensionAdjustment);
+ switch (setOption.getValueType()) {
case IOption.BOOLEAN:
Boolean bValue = value != null ? Boolean.valueOf(value) : null;
- if(extensionAdjustment)
+ if (extensionAdjustment)
setOption.setValue(bValue);
- else{
+ else {
if (bValue == null) {
IOption superOption = setOption.getSuperClass();
- if(superOption != null){
+ if (superOption != null) {
bValue = Boolean.valueOf(superOption.getBooleanValue());
}
}
- if(bValue != null)
+ if (bValue != null)
ManagedBuildManager.setOption(rcInfo, holder, setOption, bValue.booleanValue());
else
- setOption.setValue((Object)null);
+ setOption.setValue((Object) null);
}
break;
case IOption.ENUMERATED:
case IOption.TREE:
case IOption.STRING:
- if(extensionAdjustment)
+ if (extensionAdjustment)
setOption.setValue(value);
else
ManagedBuildManager.setOption(rcInfo, holder, setOption, value);
@@ -327,8 +301,8 @@ public class OptionEnablementExpression extends AndExpression{
adjusted = false;
break;
}
- } else if(IOption.DEFAULT_VALUE.equals(attribute)){
- switch(setOption.getValueType()){
+ } else if (IOption.DEFAULT_VALUE.equals(attribute)) {
+ switch (setOption.getValueType()) {
case IOption.BOOLEAN:
Boolean bValue = value != null ? Boolean.valueOf(value) : null;
setOption.setDefaultValue(bValue);
@@ -348,160 +322,139 @@ public class OptionEnablementExpression extends AndExpression{
}
} else
adjusted = false;
- }catch (BuildException e){
+ } catch (BuildException e) {
adjusted = false;
- }
- return adjusted;
+ }
+ return adjusted;
}
-
- public boolean adjustOption(IResourceInfo rcInfo,
- IHoldsOptions holder,
- IOption option,
- AdjustmentContext context,
- boolean extensionAdjustment){
- if(!canPerformAdjustment(extensionAdjustment))
+
+ public boolean adjustOption(IResourceInfo rcInfo, IHoldsOptions holder, IOption option, AdjustmentContext context,
+ boolean extensionAdjustment) {
+ if (!canPerformAdjustment(extensionAdjustment))
return false;
boolean needed = adjustmentNeeded(rcInfo, holder, option);
-
- if(context != null)
+
+ if (context != null)
context.addAdjustedState(fAttribute, needed);
-
- if(needed)
+
+ if (needed)
return adjustOption(rcInfo, holder, option, fAttribute, fValue, extensionAdjustment);
return false;
}
-
- private boolean adjustmentNeeded(IResourceInfo rcInfo,
- IHoldsOptions holder,
- IOption option){
- return evaluate(rcInfo,holder,option,FLAG_CONTAINER_ATTRIBUTE);
+
+ private boolean adjustmentNeeded(IResourceInfo rcInfo, IHoldsOptions holder, IOption option) {
+ return evaluate(rcInfo, holder, option, FLAG_CONTAINER_ATTRIBUTE);
}
- private boolean adjustmentNeeded(IFolderInfo info, IToolChain tChain){
- return adjustmentNeeded(info,tChain,null);
+ private boolean adjustmentNeeded(IFolderInfo info, IToolChain tChain) {
+ return adjustmentNeeded(info, tChain, null);
}
- private boolean adjustmentNeeded(IResourceInfo info, ITool tool){
- return adjustmentNeeded(info,tool,null);
+ private boolean adjustmentNeeded(IResourceInfo info, ITool tool) {
+ return adjustmentNeeded(info, tool, null);
}
- private boolean adjustmentNeeded(IConfiguration cfg){
- return adjustmentNeeded(cfg.getRootFolderInfo(),null,null);
+ private boolean adjustmentNeeded(IConfiguration cfg) {
+ return adjustmentNeeded(cfg.getRootFolderInfo(), null, null);
}
- public static boolean adjustToolChain(IFolderInfo info,
- IToolChain tChain,
- String attrbute,
- String value,
- boolean extensionAdjustment){
-
- if(value == null && tChain.isExtensionElement())
+ public static boolean adjustToolChain(IFolderInfo info, IToolChain tChain, String attrbute, String value,
+ boolean extensionAdjustment) {
+
+ if (value == null && tChain.isExtensionElement())
return false;
-
+
boolean adjusted = true;
-
- if(IToolChain.TARGET_TOOL.equals(attrbute)){
+
+ if (IToolChain.TARGET_TOOL.equals(attrbute)) {
tChain.setTargetToolIds(value);
- }else{
+ } else {
adjusted = false;
}
return adjusted;
}
- public boolean adjustToolChain(IFolderInfo info,
- IToolChain tChain,
- AdjustmentContext context,
- boolean extensionAdjustment){
- if(!canPerformAdjustment(extensionAdjustment))
+ public boolean adjustToolChain(IFolderInfo info, IToolChain tChain, AdjustmentContext context,
+ boolean extensionAdjustment) {
+ if (!canPerformAdjustment(extensionAdjustment))
return false;
-
+
boolean needed = adjustmentNeeded(info, tChain);
-
- if(context != null)
+
+ if (context != null)
context.addAdjustedState(fAttribute, needed);
- if(needed)
+ if (needed)
return adjustToolChain(info, tChain, fAttribute, fValue, extensionAdjustment);
return false;
}
- public static boolean adjustTool(IResourceInfo info,
- ITool tool,
- String attribute,
- String value,
- boolean extensionAdjustment){
-
- if(value == null && tool.isExtensionElement())
+ public static boolean adjustTool(IResourceInfo info, ITool tool, String attribute, String value,
+ boolean extensionAdjustment) {
+
+ if (value == null && tool.isExtensionElement())
return false;
-
+
return false;
}
-
- public boolean adjustTool(IResourceInfo info,
- ITool tool,
- AdjustmentContext context,
- boolean extensionAdjustment){
- if(!canPerformAdjustment(extensionAdjustment))
+
+ public boolean adjustTool(IResourceInfo info, ITool tool, AdjustmentContext context, boolean extensionAdjustment) {
+ if (!canPerformAdjustment(extensionAdjustment))
return false;
-
+
boolean needed = adjustmentNeeded(info, tool);
-
- if(context != null)
+
+ if (context != null)
context.addAdjustedState(fAttribute, needed);
- if(needed)
+ if (needed)
return adjustTool(info, tool, fAttribute, fValue, extensionAdjustment);
return false;
}
- public static boolean adjustConfiguration(IConfiguration cfg,
- String attribute,
- String value,
- boolean extensionAdjustment){
+ public static boolean adjustConfiguration(IConfiguration cfg, String attribute, String value,
+ boolean extensionAdjustment) {
- if(value == null && cfg.isExtensionElement())
+ if (value == null && cfg.isExtensionElement())
return false;
boolean adjusted = true;
-
- if(IConfiguration.EXTENSION.equals(attribute)){
+
+ if (IConfiguration.EXTENSION.equals(attribute)) {
cfg.setArtifactExtension(value);
- } else if(IConfiguration.ARTIFACT_NAME.equals(attribute)){
+ } else if (IConfiguration.ARTIFACT_NAME.equals(attribute)) {
cfg.setArtifactName(value);
- } else{
+ } else {
adjusted = false;
}
return adjusted;
}
- public boolean adjustConfiguration(IConfiguration cfg,
- AdjustmentContext context,
- boolean extensionAdjustment){
- if(!canPerformAdjustment(extensionAdjustment))
+ public boolean adjustConfiguration(IConfiguration cfg, AdjustmentContext context, boolean extensionAdjustment) {
+ if (!canPerformAdjustment(extensionAdjustment))
return false;
-
+
boolean needed = adjustmentNeeded(cfg);
-
- if(context != null)
+
+ if (context != null)
context.addAdjustedState(fAttribute, needed);
- if(needed)
+ if (needed)
return adjustConfiguration(cfg, fAttribute, fValue, extensionAdjustment);
return false;
}
- public boolean canPerformAdjustment(boolean extensionAdjustment){
- return fIsExtensionAdjustment == extensionAdjustment
- && checkFlags(FLAG_CONTAINER_ATTRIBUTE);
+ public boolean canPerformAdjustment(boolean extensionAdjustment) {
+ return fIsExtensionAdjustment == extensionAdjustment && checkFlags(FLAG_CONTAINER_ATTRIBUTE);
}
-
- public static boolean getBooleanValue(String value){
- if(TRUE.equalsIgnoreCase(value))
+
+ public static boolean getBooleanValue(String value) {
+ if (TRUE.equalsIgnoreCase(value))
return true;
- else if(YES.equalsIgnoreCase(value))
+ else if (YES.equalsIgnoreCase(value))
return true;
return false;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/OrExpression.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/OrExpression.java
index 7bbcba4c9e9..8b37e7f9a20 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/OrExpression.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/enablement/OrExpression.java
@@ -21,30 +21,27 @@ import org.eclipse.cdt.managedbuilder.core.IOptionCategory;
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
public class OrExpression extends CompositeExpression {
- public static final String NAME = "or"; //$NON-NLS-1$
+ public static final String NAME = "or"; //$NON-NLS-1$
public OrExpression(IManagedConfigElement element) {
super(element);
}
@Override
- public boolean evaluate(IResourceInfo rcInfo,
- IHoldsOptions holder,
- IOption option) {
+ public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder, IOption option) {
IBooleanExpression children[] = getChildren();
- for(int i = 0; i < children.length; i++){
- if(children[i].evaluate(rcInfo, holder, option))
+ for (int i = 0; i < children.length; i++) {
+ if (children[i].evaluate(rcInfo, holder, option))
return true;
}
return false;
}
+
@Override
- public boolean evaluate(IResourceInfo rcInfo,
- IHoldsOptions holder,
- IOptionCategory category) {
+ public boolean evaluate(IResourceInfo rcInfo, IHoldsOptions holder, IOptionCategory category) {
IBooleanExpression children[] = getChildren();
- for(int i = 0; i < children.length; i++){
- if(children[i].evaluate(rcInfo, holder, category))
+ for (int i = 0; i < children.length; i++) {
+ if (children[i].evaluate(rcInfo, holder, category))
return true;
}
return false;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/BuildEnvVar.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/BuildEnvVar.java
index 0d4d9da645c..4651a42dbbd 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/BuildEnvVar.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/BuildEnvVar.java
@@ -24,31 +24,31 @@ import org.eclipse.cdt.managedbuilder.envvar.IBuildEnvironmentVariable;
* @since 3.0
*/
public class BuildEnvVar extends EnvironmentVariable implements IBuildEnvironmentVariable {
- protected BuildEnvVar(){
+ protected BuildEnvVar() {
}
- public BuildEnvVar(String name){
+ public BuildEnvVar(String name) {
super(name);
}
- public BuildEnvVar(String name, String value){
+ public BuildEnvVar(String name, String value) {
super(name, value);
}
- public BuildEnvVar(String name, String value, String delimiter){
+ public BuildEnvVar(String name, String value, String delimiter) {
super(name, value, delimiter);
}
- public BuildEnvVar(String name, String value, int op){
+ public BuildEnvVar(String name, String value, int op) {
super(name, value, op, EnvironmentVariableManager.getDefault().getDefaultDelimiter());
}
- public BuildEnvVar(String name, String value, int op, String delimiter){
+ public BuildEnvVar(String name, String value, int op, String delimiter) {
super(name, value, op, delimiter);
}
- public BuildEnvVar(IEnvironmentVariable var){
+ public BuildEnvVar(IEnvironmentVariable var) {
super(var);
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/EnvironmentVariableManagerToolChain.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/EnvironmentVariableManagerToolChain.java
index 6fa5180e836..7efc291d067 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/EnvironmentVariableManagerToolChain.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/EnvironmentVariableManagerToolChain.java
@@ -50,36 +50,39 @@ public class EnvironmentVariableManagerToolChain extends EnvironmentVariableMana
*/
private class ToolChainEnvironmentContextInfo implements IEnvironmentContextInfo {
private final ICoreEnvironmentVariableSupplier fToolchainSupplier;
+
private ToolChainEnvironmentContextInfo(IToolChain toolChain) {
fToolchainSupplier = new ToolChainEnvironmentVariableSupplier(toolChain);
}
+
@Override
public IEnvironmentContextInfo getNext() {
return null;
}
+
@Override
public ICoreEnvironmentVariableSupplier[] getSuppliers() {
- return new ICoreEnvironmentVariableSupplier[] {
- fUserSupplier,
- fToolchainSupplier,
- fEclipseSupplier,
- };
+ return new ICoreEnvironmentVariableSupplier[] { fUserSupplier, fToolchainSupplier, fEclipseSupplier, };
}
+
@Override
public Object getContext() {
return null;
}
}
+
/**
* Tool-chain variable supplier
*/
private class ToolChainEnvironmentVariableSupplier implements ICoreEnvironmentVariableSupplier {
- private final IEnvironmentVariableProvider environmentVariableProvider = EnvironmentVariableProvider.getDefault();
+ private final IEnvironmentVariableProvider environmentVariableProvider = EnvironmentVariableProvider
+ .getDefault();
private final IConfigurationEnvironmentVariableSupplier toolchainSupplier;
private ToolChainEnvironmentVariableSupplier(IToolChain toolChain) {
this.toolchainSupplier = toolChain.getEnvironmentVariableSupplier();
}
+
@Override
public IEnvironmentVariable getVariable(String name, Object context) {
if (toolchainSupplier == null) {
@@ -87,6 +90,7 @@ public class EnvironmentVariableManagerToolChain extends EnvironmentVariableMana
}
return toolchainSupplier.getVariable(name, null, environmentVariableProvider);
}
+
@Override
public IEnvironmentVariable[] getVariables(Object context) {
if (toolchainSupplier == null) {
@@ -94,6 +98,7 @@ public class EnvironmentVariableManagerToolChain extends EnvironmentVariableMana
}
return toolchainSupplier.getVariables(null, environmentVariableProvider);
}
+
@Override
public boolean appendEnvironment(Object context) {
return true;
@@ -105,54 +110,61 @@ public class EnvironmentVariableManagerToolChain extends EnvironmentVariableMana
*/
private final class ToolChainCoreVariableContextInfo implements ICoreVariableContextInfo {
private final ToolChainCdtVariableSupplier fToolChainSupplier;
+
private ToolChainCoreVariableContextInfo(IToolChain toolChain) {
fToolChainSupplier = new ToolChainCdtVariableSupplier(toolChain);
}
+
@Override
public ICdtVariableSupplier[] getSuppliers() {
- return new ICdtVariableSupplier[] {
- CdtVariableManager.fUserDefinedMacroSupplier,
- fToolChainSupplier,
- CdtVariableManager.fEnvironmentMacroSupplier,
- CdtVariableManager.fCdtMacroSupplier,
- CdtVariableManager.fEclipseVariablesMacroSupplier,
- };
+ return new ICdtVariableSupplier[] { CdtVariableManager.fUserDefinedMacroSupplier, fToolChainSupplier,
+ CdtVariableManager.fEnvironmentMacroSupplier, CdtVariableManager.fCdtMacroSupplier,
+ CdtVariableManager.fEclipseVariablesMacroSupplier, };
}
+
@Override
public IVariableContextInfo getNext() {
return null;
}
+
@Override
public int getContextType() {
return CONTEXT_WORKSPACE;
}
+
@Override
public Object getContextData() {
return null;
}
}
+
/**
* Tool-chain supplier for variable substitution.
*/
private class ToolChainCdtVariableSupplier implements ICdtVariableSupplier {
private final IConfigurationEnvironmentVariableSupplier toolchainSupplier;
+
private ToolChainCdtVariableSupplier(IToolChain toolChain) {
this.toolchainSupplier = toolChain.getEnvironmentVariableSupplier();
}
+
@Override
public ICdtVariable getVariable(String macroName, IVariableContextInfo context) {
if (toolchainSupplier == null) {
return null;
}
- IEnvironmentVariable var = toolchainSupplier.getVariable(macroName, null, ManagedBuildManager.getEnvironmentVariableProvider());
+ IEnvironmentVariable var = toolchainSupplier.getVariable(macroName, null,
+ ManagedBuildManager.getEnvironmentVariableProvider());
return CdtVariableManager.fEnvironmentMacroSupplier.createBuildMacro(var);
}
+
@Override
public ICdtVariable[] getVariables(IVariableContextInfo context) {
if (toolchainSupplier == null) {
return null;
}
- IEnvironmentVariable[] vars = toolchainSupplier.getVariables(null, ManagedBuildManager.getEnvironmentVariableProvider());
+ IEnvironmentVariable[] vars = toolchainSupplier.getVariables(null,
+ ManagedBuildManager.getEnvironmentVariableProvider());
if (vars != null) {
ICdtVariable[] cdtVars = new ICdtVariable[vars.length];
for (int i = 0; i < vars.length; i++) {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/EnvironmentVariableProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/EnvironmentVariableProvider.java
index a0418a7edeb..88d8956f5ee 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/EnvironmentVariableProvider.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/EnvironmentVariableProvider.java
@@ -40,10 +40,10 @@ import org.eclipse.cdt.utils.envvar.EnvVarOperationProcessor;
* @since 3.0
*/
public class EnvironmentVariableProvider implements IEnvironmentVariableProvider {
-// private static final QualifiedName fBuildPathVarProperty = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), "buildPathVar"); //$NON-NLS-1$
+ // private static final QualifiedName fBuildPathVarProperty = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), "buildPathVar"); //$NON-NLS-1$
-// private static final String DELIMITER_WIN32 = ";"; //$NON-NLS-1$
-// private static final String DELIMITER_UNIX = ":"; //$NON-NLS-1$
+ // private static final String DELIMITER_WIN32 = ";"; //$NON-NLS-1$
+ // private static final String DELIMITER_UNIX = ":"; //$NON-NLS-1$
private static EnvironmentVariableProvider fInstance = null;
private List<IEnvironmentBuildPathsChangeListener> fListeners = null;
@@ -68,11 +68,12 @@ public class EnvironmentVariableProvider implements IEnvironmentVariableProvider
}
@Override
- public String[] resolveBuildPaths(int pathType, String variableName, String variableValue, IConfiguration configuration) {
+ public String[] resolveBuildPaths(int pathType, String variableName, String variableValue,
+ IConfiguration configuration) {
if (fDelimiter == null || fDelimiter.isEmpty())
- return new String[]{variableValue};
+ return new String[] { variableValue };
- List<String> list = EnvVarOperationProcessor.convertToList(variableValue,fDelimiter);
+ List<String> list = EnvVarOperationProcessor.convertToList(variableValue, fDelimiter);
return list.toArray(new String[list.size()]);
}
@@ -91,12 +92,13 @@ public class EnvironmentVariableProvider implements IEnvironmentVariableProvider
}
@Override
- public IBuildEnvironmentVariable getVariable(String variableName, Object level, boolean includeParentLevels, boolean resolveMacros) {
+ public IBuildEnvironmentVariable getVariable(String variableName, Object level, boolean includeParentLevels,
+ boolean resolveMacros) {
if (variableName == null || variableName.isEmpty())
return null;
if (level instanceof IConfiguration) {
- return wrap(getVariable(variableName, (IConfiguration)level, resolveMacros));
+ return wrap(getVariable(variableName, (IConfiguration) level, resolveMacros));
}
return null;
}
@@ -106,7 +108,8 @@ public class EnvironmentVariableProvider implements IEnvironmentVariableProvider
return getVariable(variableName, cfg, resolveMacros, true);
}
- public IEnvironmentVariable getVariable(String variableName, IConfiguration cfg, boolean resolveMacros, boolean checkBuildPaths) {
+ public IEnvironmentVariable getVariable(String variableName, IConfiguration cfg, boolean resolveMacros,
+ boolean checkBuildPaths) {
ICConfigurationDescription des = ManagedBuildManager.getDescriptionForConfiguration(cfg);
if (des != null) {
IEnvironmentVariable variable = fMngr.getVariable(variableName, des, resolveMacros);
@@ -127,7 +130,7 @@ public class EnvironmentVariableProvider implements IEnvironmentVariableProvider
if (des != null) {
IEnvironmentVariable vars[] = fMngr.getVariables(des, resolveMacros);
if (checkBuildPaths && resolveMacros && fBuildPathVarCheckAllowed)
- checkBuildPathVariables(cfg,vars);
+ checkBuildPathVariables(cfg, vars);
return vars;
}
return new IBuildEnvironmentVariable[0];
@@ -137,7 +140,7 @@ public class EnvironmentVariableProvider implements IEnvironmentVariableProvider
if (var == null)
return null;
if (var instanceof IBuildEnvironmentVariable)
- return (IBuildEnvironmentVariable)var;
+ return (IBuildEnvironmentVariable) var;
return new BuildEnvVar(var);
}
@@ -145,28 +148,28 @@ public class EnvironmentVariableProvider implements IEnvironmentVariableProvider
if (vars == null)
return null;
if (vars instanceof IBuildEnvironmentVariable[])
- return (IBuildEnvironmentVariable[])vars;
+ return (IBuildEnvironmentVariable[]) vars;
IBuildEnvironmentVariable[] buildVars = new IBuildEnvironmentVariable[vars.length];
- for(int i = 0; i < vars.length; i++) {
+ for (int i = 0; i < vars.length; i++) {
buildVars[i] = wrap(vars[i]);
}
return buildVars;
}
-/* protected ICConfigurationDescription getDescription(IConfiguration cfg) {
- IProject project = cfg.getOwner().getProject();
- ICProjectDescription des = CoreModel.getDefault().getProjectDescription(project, false);
- if (des != null) {
- return des.getConfigurationById(cfg.getId());
+ /* protected ICConfigurationDescription getDescription(IConfiguration cfg) {
+ IProject project = cfg.getOwner().getProject();
+ ICProjectDescription des = CoreModel.getDefault().getProjectDescription(project, false);
+ if (des != null) {
+ return des.getConfigurationById(cfg.getId());
+ }
+ return null;
}
- return null;
- }
-*/
+ */
@Override
public IBuildEnvironmentVariable[] getVariables(Object level, boolean includeParentLevels, boolean resolveMacros) {
if (level instanceof IConfiguration) {
- return wrap(getVariables((IConfiguration)level, resolveMacros));
+ return wrap(getVariables((IConfiguration) level, resolveMacros));
}
return new IBuildEnvironmentVariable[0];
}
@@ -214,12 +217,12 @@ public class EnvironmentVariableProvider implements IEnvironmentVariableProvider
}
for (String varName : vars) {
- IEnvironmentVariable var = getVariable(varName,configuration,true, false);
+ IEnvironmentVariable var = getVariable(varName, configuration, true, false);
if (var == null)
continue;
String varValue = var.getValue();
- String paths[] = pathResolver.resolveBuildPaths(buildPathType,varName,varValue,configuration);
+ String paths[] = pathResolver.resolveBuildPaths(buildPathType, varName, varValue, configuration);
if (paths != null && paths.length != 0)
list.addAll(Arrays.asList(paths));
}
@@ -244,7 +247,7 @@ public class EnvironmentVariableProvider implements IEnvironmentVariableProvider
private void notifyListeners(IConfiguration configuration, int buildPathType) {
List<IEnvironmentBuildPathsChangeListener> listeners = getListeners();
for (IEnvironmentBuildPathsChangeListener listener : listeners) {
- listener.buildPathsChanged(configuration,buildPathType);
+ listener.buildPathsChanged(configuration, buildPathType);
}
}
@@ -274,7 +277,7 @@ public class EnvironmentVariableProvider implements IEnvironmentVariableProvider
* If the build variables are changed, the notification is sent
*/
public void checkBuildPathVariables(IConfiguration configuration) {
- checkBuildPathVariables(configuration, getVariables(configuration ,true, false));
+ checkBuildPathVariables(configuration, getVariables(configuration, true, false));
}
/**
@@ -282,10 +285,10 @@ public class EnvironmentVariableProvider implements IEnvironmentVariableProvider
* for the given configuration
* If the build variables are changed, the notification is sent
*/
- public void checkBuildPathVariables(IConfiguration configuration,int buildPathType) {
+ public void checkBuildPathVariables(IConfiguration configuration, int buildPathType) {
EnvVarCollector cr = new EnvVarCollector();
cr.add(getVariables(configuration, true, false));
- checkBuildPathVariables(configuration,buildPathType,cr);
+ checkBuildPathVariables(configuration, buildPathType, cr);
}
/**
@@ -297,8 +300,8 @@ public class EnvironmentVariableProvider implements IEnvironmentVariableProvider
protected void checkBuildPathVariables(IConfiguration configuration, IEnvironmentVariable vars[]) {
EnvVarCollector cr = new EnvVarCollector();
cr.add(vars);
- checkBuildPathVariables(configuration,IEnvVarBuildPath.BUILDPATH_INCLUDE,cr);
- checkBuildPathVariables(configuration,IEnvVarBuildPath.BUILDPATH_LIBRARY,cr);
+ checkBuildPathVariables(configuration, IEnvVarBuildPath.BUILDPATH_INCLUDE, cr);
+ checkBuildPathVariables(configuration, IEnvVarBuildPath.BUILDPATH_LIBRARY, cr);
}
/**
@@ -322,14 +325,15 @@ public class EnvironmentVariableProvider implements IEnvironmentVariableProvider
* If it is not changed, other build path variables are not checked
* In the case of the given variable is not the build path one, this method does nothing
*/
- protected void checkBuildPathVariable(IConfiguration configuration, int buildPathType, String varName, IEnvironmentVariable var) {
+ protected void checkBuildPathVariable(IConfiguration configuration, int buildPathType, String varName,
+ IEnvironmentVariable var) {
StoredBuildPathEnvironmentContainer buildPathVars = getStoredBuildPathVariables(buildPathType);
if (buildPathVars == null)
return;
- if (buildPathVars.isVariableChanged(varName,var,configuration)) {
+ if (buildPathVars.isVariableChanged(varName, var, configuration)) {
EnvVarCollector cr = new EnvVarCollector();
cr.add(getVariables(configuration, true, false));
- buildPathVars.synchronize(cr,configuration);
+ buildPathVars.synchronize(cr, configuration);
notifyListeners(configuration, buildPathType);
}
}
@@ -344,7 +348,7 @@ public class EnvironmentVariableProvider implements IEnvironmentVariableProvider
StoredBuildPathEnvironmentContainer buildPathVars = getStoredBuildPathVariables(buildPathType);
if (buildPathVars == null)
return;
- if (buildPathVars.checkBuildPathChange(varSet,configuration)) {
+ if (buildPathVars.checkBuildPathChange(varSet, configuration)) {
notifyListeners(configuration, buildPathType);
}
}
@@ -353,9 +357,8 @@ public class EnvironmentVariableProvider implements IEnvironmentVariableProvider
* returns the container of the build variables of the specified type
*/
protected StoredBuildPathEnvironmentContainer getStoredBuildPathVariables(int buildPathType) {
- return buildPathType == IEnvVarBuildPath.BUILDPATH_LIBRARY ?
- getStoredLibraryBuildPathVariables() :
- getStoredIncludeBuildPathVariables();
+ return buildPathType == IEnvVarBuildPath.BUILDPATH_LIBRARY ? getStoredLibraryBuildPathVariables()
+ : getStoredIncludeBuildPathVariables();
}
/**
@@ -363,7 +366,8 @@ public class EnvironmentVariableProvider implements IEnvironmentVariableProvider
*/
protected StoredBuildPathEnvironmentContainer getStoredIncludeBuildPathVariables() {
if (fIncludeStoredBuildPathVariables == null)
- fIncludeStoredBuildPathVariables = new StoredBuildPathEnvironmentContainer(IEnvVarBuildPath.BUILDPATH_INCLUDE);
+ fIncludeStoredBuildPathVariables = new StoredBuildPathEnvironmentContainer(
+ IEnvVarBuildPath.BUILDPATH_INCLUDE);
return fIncludeStoredBuildPathVariables;
}
@@ -372,7 +376,8 @@ public class EnvironmentVariableProvider implements IEnvironmentVariableProvider
*/
protected StoredBuildPathEnvironmentContainer getStoredLibraryBuildPathVariables() {
if (fLibraryStoredBuildPathVariables == null)
- fLibraryStoredBuildPathVariables = new StoredBuildPathEnvironmentContainer(IEnvVarBuildPath.BUILDPATH_LIBRARY);
+ fLibraryStoredBuildPathVariables = new StoredBuildPathEnvironmentContainer(
+ IEnvVarBuildPath.BUILDPATH_LIBRARY);
return fLibraryStoredBuildPathVariables;
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/ExternalExtensionEnvironmentSupplier.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/ExternalExtensionEnvironmentSupplier.java
index 6dc72298234..ddcdce85e04 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/ExternalExtensionEnvironmentSupplier.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/ExternalExtensionEnvironmentSupplier.java
@@ -30,14 +30,13 @@ import org.eclipse.cdt.utils.envvar.EnvVarOperationProcessor;
*
* @since 3.0
*/
-public class ExternalExtensionEnvironmentSupplier implements
- IEnvironmentVariableSupplier {
+public class ExternalExtensionEnvironmentSupplier implements IEnvironmentVariableSupplier {
private EnvironmentVariableProvider fProvider;
- private static final String fNonOverloadableVariables[] = new String[]{
+ private static final String fNonOverloadableVariables[] = new String[] {
//tool-integrators not allowed currently to override the "CWD" and "PWD" variables
- EnvVarOperationProcessor.normalizeName("CWD"), //$NON-NLS-1$
- EnvVarOperationProcessor.normalizeName("PWD") //$NON-NLS-1$
- };
+ EnvVarOperationProcessor.normalizeName("CWD"), //$NON-NLS-1$
+ EnvVarOperationProcessor.normalizeName("PWD") //$NON-NLS-1$
+ };
/**
* EnvironmentVariableProvider passed to the tool-integrator provided
@@ -47,36 +46,34 @@ public class ExternalExtensionEnvironmentSupplier implements
* @since 3.0
*/
- public ExternalExtensionEnvironmentSupplier(IEnvironmentVariableManager mngr){
+ public ExternalExtensionEnvironmentSupplier(IEnvironmentVariableManager mngr) {
fProvider = new EnvironmentVariableProvider(mngr);
}
-
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableSupplier#getVariable()
*/
@Override
public IEnvironmentVariable getVariable(String name, Object context) {
- if(context == null)
+ if (context == null)
return null;
- if((name = getValidName(name)) == null)
+ if ((name = getValidName(name)) == null)
return null;
- else if(context instanceof IConfiguration){
- IConfiguration cfg = (IConfiguration)context;
+ else if (context instanceof IConfiguration) {
+ IConfiguration cfg = (IConfiguration) context;
IConfigurationEnvironmentVariableSupplier supplier = cfg.getEnvironmentVariableSupplier();
- if(supplier == null)
+ if (supplier == null)
return null;
- return supplier.getVariable(name,cfg,fProvider);
- }
- else if (context instanceof IManagedProject) {
- IManagedProject project = (IManagedProject)context;
+ return supplier.getVariable(name, cfg, fProvider);
+ } else if (context instanceof IManagedProject) {
+ IManagedProject project = (IManagedProject) context;
IProjectType pType = project.getProjectType();
- IProjectEnvironmentVariableSupplier supplier = pType != null ?
- pType.getEnvironmentVariableSupplier() : null;
- if(supplier == null)
+ IProjectEnvironmentVariableSupplier supplier = pType != null ? pType.getEnvironmentVariableSupplier()
+ : null;
+ if (supplier == null)
return null;
- return supplier.getVariable(name,project,fProvider);
+ return supplier.getVariable(name, project, fProvider);
}
return null;
}
@@ -86,67 +83,65 @@ public class ExternalExtensionEnvironmentSupplier implements
*/
@Override
public IEnvironmentVariable[] getVariables(Object context) {
- if(context == null)
+ if (context == null)
return null;
IBuildEnvironmentVariable variables[] = null;
- if(context instanceof IConfiguration){
- IConfiguration cfg = (IConfiguration)context;
+ if (context instanceof IConfiguration) {
+ IConfiguration cfg = (IConfiguration) context;
IConfigurationEnvironmentVariableSupplier supplier = cfg.getEnvironmentVariableSupplier();
- if(supplier == null)
+ if (supplier == null)
return null;
- variables = supplier.getVariables(cfg,fProvider);
- }
- else if (context instanceof IManagedProject) {
- IManagedProject project = (IManagedProject)context;
- IProjectEnvironmentVariableSupplier supplier = project.getProjectType() != null ? project.getProjectType().getEnvironmentVariableSupplier() : null;
- if(supplier == null)
+ variables = supplier.getVariables(cfg, fProvider);
+ } else if (context instanceof IManagedProject) {
+ IManagedProject project = (IManagedProject) context;
+ IProjectEnvironmentVariableSupplier supplier = project.getProjectType() != null
+ ? project.getProjectType().getEnvironmentVariableSupplier()
+ : null;
+ if (supplier == null)
return null;
- variables = supplier.getVariables(project,fProvider);
+ variables = supplier.getVariables(project, fProvider);
}
return filterVariables(variables);
}
- protected IEnvironmentVariableSupplier[] filterValidSuppliers(IEnvironmentVariableSupplier suppliers[]){
- if(suppliers == null)
+ protected IEnvironmentVariableSupplier[] filterValidSuppliers(IEnvironmentVariableSupplier suppliers[]) {
+ if (suppliers == null)
return null;
int i = 0, j = 0;
- for(i = 0; i < suppliers.length; i++){
- if(suppliers[i] == this)
+ for (i = 0; i < suppliers.length; i++) {
+ if (suppliers[i] == this)
break;
}
-
- if(i >= suppliers.length)
+ if (i >= suppliers.length)
return null;
int startNum = i + 1;
+ IEnvironmentVariableSupplier validSuppliers[] = new IEnvironmentVariableSupplier[suppliers.length - startNum];
- IEnvironmentVariableSupplier validSuppliers[] =
- new IEnvironmentVariableSupplier[suppliers.length - startNum];
-
- for(i = startNum, j = 0; i < suppliers.length; i++, j++)
+ for (i = startNum, j = 0; i < suppliers.length; i++, j++)
validSuppliers[j] = suppliers[i];
return validSuppliers;
}
- protected String getValidName(String name){
+ protected String getValidName(String name) {
name = EnvVarOperationProcessor.normalizeName(name);
- if(name == null)
+ if (name == null)
return null;
- if(fNonOverloadableVariables != null){
- for(int i = 0; i < fNonOverloadableVariables.length; i++){
- if(name.equals(fNonOverloadableVariables[i]))
+ if (fNonOverloadableVariables != null) {
+ for (int i = 0; i < fNonOverloadableVariables.length; i++) {
+ if (name.equals(fNonOverloadableVariables[i]))
return null;
}
}
return name;
}
- protected IEnvironmentVariable[] filterVariables(IBuildEnvironmentVariable variables[]){
- return EnvVarOperationProcessor.filterVariables(variables,fNonOverloadableVariables);
+ protected IEnvironmentVariable[] filterVariables(IBuildEnvironmentVariable variables[]) {
+ return EnvVarOperationProcessor.filterVariables(variables, fNonOverloadableVariables);
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/MbsEnvironmentSupplier.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/MbsEnvironmentSupplier.java
index 02461fb1709..bab8be8c29c 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/MbsEnvironmentSupplier.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/MbsEnvironmentSupplier.java
@@ -32,46 +32,46 @@ import org.eclipse.core.runtime.IPath;
* @since 3.0
*/
public class MbsEnvironmentSupplier implements IEnvironmentVariableSupplier {
-// private static final String fVariableNames[] = new String[]{
-// "CWD", //$NON-NLS-1$
-// "PWD" //$NON-NLS-1$
-// };
+ // private static final String fVariableNames[] = new String[]{
+ // "CWD", //$NON-NLS-1$
+ // "PWD" //$NON-NLS-1$
+ // };
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableSupplier#getVariable()
*/
@Override
public IEnvironmentVariable getVariable(String name, Object context) {
- if(context instanceof IConfiguration)
- return getConfigurationVariable(name,(IConfiguration)context);
+ if (context instanceof IConfiguration)
+ return getConfigurationVariable(name, (IConfiguration) context);
return null;
}
public IBuildEnvironmentVariable getConfigurationVariable(String name, IConfiguration configuration) {
IBuildEnvironmentVariable variable = null;
- if("CWD".equals(name) || "PWD".equals(name)){ //$NON-NLS-1$ //$NON-NLS-2$
+ if ("CWD".equals(name) || "PWD".equals(name)) { //$NON-NLS-1$ //$NON-NLS-2$
IResource owner = configuration.getOwner();
- if(owner != null){
-// IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(owner);
-// if(info != null && configuration.equals(info.getDefaultConfiguration())){
-// IManagedBuilderMakefileGenerator generator = ManagedBuildManager.getBuildfileGenerator(configuration);
-// generator.initialize((IProject)owner,info,null);
+ if (owner != null) {
+ // IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(owner);
+ // if(info != null && configuration.equals(info.getDefaultConfiguration())){
+ // IManagedBuilderMakefileGenerator generator = ManagedBuildManager.getBuildfileGenerator(configuration);
+ // generator.initialize((IProject)owner,info,null);
IBuilder builder = configuration.getEditableBuilder();
IPath topBuildDir = ManagedBuildManager.getBuildLocation(configuration, builder);
-
-//// IPath topBuildDir = generator.getBuildWorkingDir();
-// if(topBuildDir == null)
-// topBuildDir = new Path(configuration.getName());
-//
-// IPath projectLocation = owner.getLocation();
-// IPath workingDirectory = projectLocation.append(topBuildDir);
-// String value = workingDirectory.toOSString();
- if(topBuildDir != null) {
- variable = new BuildEnvVar(name, topBuildDir.toOSString(), IBuildEnvironmentVariable.ENVVAR_REPLACE,null);
+ //// IPath topBuildDir = generator.getBuildWorkingDir();
+ // if(topBuildDir == null)
+ // topBuildDir = new Path(configuration.getName());
+ //
+ // IPath projectLocation = owner.getLocation();
+ // IPath workingDirectory = projectLocation.append(topBuildDir);
+ // String value = workingDirectory.toOSString();
+ if (topBuildDir != null) {
+ variable = new BuildEnvVar(name, topBuildDir.toOSString(), IBuildEnvironmentVariable.ENVVAR_REPLACE,
+ null);
}
-// }
+ // }
}
}
return variable;
@@ -82,10 +82,10 @@ public class MbsEnvironmentSupplier implements IEnvironmentVariableSupplier {
*/
@Override
public IEnvironmentVariable[] getVariables(Object context) {
- if(context instanceof IConfiguration){
+ if (context instanceof IConfiguration) {
List<IBuildEnvironmentVariable> variables = new ArrayList<IBuildEnvironmentVariable>(2);
- IBuildEnvironmentVariable var = getConfigurationVariable("CWD",(IConfiguration)context); //$NON-NLS-1$
- if(var != null){
+ IBuildEnvironmentVariable var = getConfigurationVariable("CWD", (IConfiguration) context); //$NON-NLS-1$
+ if (var != null) {
variables.add(var);
variables.add(new BuildEnvVar("PWD", var.getValue(), IBuildEnvironmentVariable.ENVVAR_REPLACE, null)); //$NON-NLS-1$
} else {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/StoredBuildPathEnvironmentContainer.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/StoredBuildPathEnvironmentContainer.java
index a1b966c84d8..4fc9d959fb4 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/StoredBuildPathEnvironmentContainer.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/envvar/StoredBuildPathEnvironmentContainer.java
@@ -40,41 +40,41 @@ import org.osgi.service.prefs.Preferences;
* @since 3.0
*
*/
-public class StoredBuildPathEnvironmentContainer extends
- StorableEnvironmentLoader {
- public static final String NODENAME = "environment"; //$NON-NLS-1$
- public static final String NODENAME_PREFIX_CFG = "buildEnvironment"; //$NON-NLS-1$
- public static final String NODENAME_CFG_INCLUDE = NODENAME_PREFIX_CFG + "Include"; //$NON-NLS-1$
- public static final String NODENAME_CFG_LIBRARY = NODENAME_PREFIX_CFG + "Library"; //$NON-NLS-1$
+public class StoredBuildPathEnvironmentContainer extends StorableEnvironmentLoader {
+ public static final String NODENAME = "environment"; //$NON-NLS-1$
+ public static final String NODENAME_PREFIX_CFG = "buildEnvironment"; //$NON-NLS-1$
+ public static final String NODENAME_CFG_INCLUDE = NODENAME_PREFIX_CFG + "Include"; //$NON-NLS-1$
+ public static final String NODENAME_CFG_LIBRARY = NODENAME_PREFIX_CFG + "Library"; //$NON-NLS-1$
private IConfiguration fConfiguration;
private StorableEnvironment fEnvironment;
private int fPathType;
- private boolean fIsVariableCaseSensitive = ManagedBuildManager.getEnvironmentVariableProvider().isVariableCaseSensitive();
+ private boolean fIsVariableCaseSensitive = ManagedBuildManager.getEnvironmentVariableProvider()
+ .isVariableCaseSensitive();
- public StoredBuildPathEnvironmentContainer(int pathType){
- fPathType = pathType == IEnvVarBuildPath.BUILDPATH_LIBRARY ?
- IEnvVarBuildPath.BUILDPATH_LIBRARY : IEnvVarBuildPath.BUILDPATH_INCLUDE;
+ public StoredBuildPathEnvironmentContainer(int pathType) {
+ fPathType = pathType == IEnvVarBuildPath.BUILDPATH_LIBRARY ? IEnvVarBuildPath.BUILDPATH_LIBRARY
+ : IEnvVarBuildPath.BUILDPATH_INCLUDE;
}
protected StorableEnvironment getEnvironment(Object context) {
StorableEnvironment env = null;
- if(context instanceof IConfiguration){
- if(fConfiguration != null && context == fConfiguration && fEnvironment != null)
+ if (context instanceof IConfiguration) {
+ if (fConfiguration != null && context == fConfiguration && fEnvironment != null)
env = fEnvironment;
else {
env = loadEnvironment(context, false);
- if(env != null){
- if(fConfiguration != null && fEnvironment != null){
- try{
- storeEnvironment(fEnvironment,fConfiguration,false, false);
- }catch(CoreException e){
+ if (env != null) {
+ if (fConfiguration != null && fEnvironment != null) {
+ try {
+ storeEnvironment(fEnvironment, fConfiguration, false, false);
+ } catch (CoreException e) {
}
}
- checkLoadedVarNames(env,context);
+ checkLoadedVarNames(env, context);
- fConfiguration = (IConfiguration)context;
+ fConfiguration = (IConfiguration) context;
fEnvironment = env;
}
}
@@ -82,54 +82,50 @@ public class StoredBuildPathEnvironmentContainer extends
return env;
}
- private boolean haveIdenticalValues(IEnvironmentVariable var1,
- IEnvironmentVariable var2){
- if(var1 == null)
+ private boolean haveIdenticalValues(IEnvironmentVariable var1, IEnvironmentVariable var2) {
+ if (var1 == null)
return var2 == null || var2.getOperation() == IBuildEnvironmentVariable.ENVVAR_REMOVE;
- if(var2 == null)
+ if (var2 == null)
return var1 == null || var1.getOperation() == IBuildEnvironmentVariable.ENVVAR_REMOVE;
int op1 = var1.getOperation();
int op2 = var2.getOperation();
- if(op1 == IBuildEnvironmentVariable.ENVVAR_REMOVE ||
- op2 == IBuildEnvironmentVariable.ENVVAR_REMOVE)
+ if (op1 == IBuildEnvironmentVariable.ENVVAR_REMOVE || op2 == IBuildEnvironmentVariable.ENVVAR_REMOVE)
return op1 == op2;
return maskNull(var1.getValue()).equals(maskNull(var2.getValue()));
}
- private String maskNull(String val){
- return val == null ? "" : val; //$NON-NLS-1$
+ private String maskNull(String val) {
+ return val == null ? "" : val; //$NON-NLS-1$
}
- public boolean checkBuildPathChange(EnvVarCollector existingVariables,
- IConfiguration configuration){
+ public boolean checkBuildPathChange(EnvVarCollector existingVariables, IConfiguration configuration) {
StorableEnvironment env = getEnvironment(configuration);
- if(env == null)
+ if (env == null)
return false;
IEnvironmentVariable vars[] = env.getVariables();
- for(int i = 0; i < vars.length; i++){
+ for (int i = 0; i < vars.length; i++) {
IEnvironmentVariable var = vars[i];
String name = var.getName();
- EnvVarDescriptor des = existingVariables != null ?
- existingVariables.getVariable(name) : null;
-// EnvironmentVariableProvider provider = ((EnvironmentVariableProvider)ManagedBuildManager.getEnvironmentVariableProvider());
+ EnvVarDescriptor des = existingVariables != null ? existingVariables.getVariable(name) : null;
+ // EnvironmentVariableProvider provider = ((EnvironmentVariableProvider)ManagedBuildManager.getEnvironmentVariableProvider());
IEnvironmentVariable curVar = des/* != null ?
- provider.getVariable(des.getName(), configuration, true, false) : null*/;
- if(!haveIdenticalValues(var,curVar)){
- if(curVar == null){
- env.createVariable(name,null,IBuildEnvironmentVariable.ENVVAR_REMOVE,null);
- }
- else{
- env.createVariable(curVar.getName(),curVar.getValue(),curVar.getOperation(),curVar.getDelimiter());
+ provider.getVariable(des.getName(), configuration, true, false) : null*/;
+ if (!haveIdenticalValues(var, curVar)) {
+ if (curVar == null) {
+ env.createVariable(name, null, IBuildEnvironmentVariable.ENVVAR_REMOVE, null);
+ } else {
+ env.createVariable(curVar.getName(), curVar.getValue(), curVar.getOperation(),
+ curVar.getDelimiter());
}
}
}
boolean changed = env.isChanged();
env.setChanged(false);
- if(changed && !configuration.isTemporary())
- try{
- storeEnvironment(env,configuration, false, false);
- }catch(CoreException e){
+ if (changed && !configuration.isTemporary())
+ try {
+ storeEnvironment(env, configuration, false, false);
+ } catch (CoreException e) {
}
return changed;
}
@@ -141,20 +137,18 @@ public class StoredBuildPathEnvironmentContainer extends
* If it is not the build path variable, no check is performed and this method always
* returns false in this case
*/
- public boolean isVariableChanged(String name,
- IEnvironmentVariable variable,
- IConfiguration configuration){
+ public boolean isVariableChanged(String name, IEnvironmentVariable variable, IConfiguration configuration) {
StorableEnvironment env = getEnvironment(configuration);
- if(env == null)
+ if (env == null)
return false;
IEnvironmentVariable var = env.getVariable(name);
- if(var == null)
+ if (var == null)
return false;
-// EnvironmentVariableProvider provider = (EnvironmentVariableProvider)ManagedBuildManager.getEnvironmentVariableProvider();
-// variable = provider.getVariable(name, configuration, true, false);
+ // EnvironmentVariableProvider provider = (EnvironmentVariableProvider)ManagedBuildManager.getEnvironmentVariableProvider();
+ // variable = provider.getVariable(name, configuration, true, false);
- if(haveIdenticalValues(var,variable))
+ if (haveIdenticalValues(var, variable))
return false;
return true;
@@ -163,31 +157,30 @@ public class StoredBuildPathEnvironmentContainer extends
/*
* synchronizes the stored variables with the ones passed to this method
*/
- public void synchronize(EnvVarCollector existingVariables,
- IConfiguration configuration){
- checkBuildPathChange(existingVariables,configuration);
+ public void synchronize(EnvVarCollector existingVariables, IConfiguration configuration) {
+ checkBuildPathChange(existingVariables, configuration);
}
- private void checkLoadedVarNames(StorableEnvironment env, Object context){
- String varNames[] = getBuildPathVarNames((IConfiguration)context, fPathType);
- for(int i = 0; i < varNames.length; i++){
+ private void checkLoadedVarNames(StorableEnvironment env, Object context) {
+ String varNames[] = getBuildPathVarNames((IConfiguration) context, fPathType);
+ for (int i = 0; i < varNames.length; i++) {
String name = varNames[i];
- if(env.getVariable(name) == null)
- env.createVariable(name,null,IBuildEnvironmentVariable.ENVVAR_REMOVE,null);
+ if (env.getVariable(name) == null)
+ env.createVariable(name, null, IBuildEnvironmentVariable.ENVVAR_REMOVE, null);
}
IEnvironmentVariable vars[] = env.getVariables();
- for(int i = 0; i < vars.length; i++){
+ for (int i = 0; i < vars.length; i++) {
IEnvironmentVariable var = vars[i];
boolean validVar = false;
- for(int j = 0; j < varNames.length; j++){
+ for (int j = 0; j < varNames.length; j++) {
String varName = varNames[j];
- if(varNamesEqual(var.getName(),varName)){
+ if (varNamesEqual(var.getName(), varName)) {
validVar = true;
break;
}
}
- if(!validVar){
+ if (!validVar) {
env.deleteVariable(var.getName());
}
}
@@ -196,9 +189,8 @@ public class StoredBuildPathEnvironmentContainer extends
/*
* returns true if the variable names are equal and false otherwise
*/
- private boolean varNamesEqual(String name1, String name2){
- return fIsVariableCaseSensitive ?
- name1.equals(name2) : name1.equalsIgnoreCase(name2);
+ private boolean varNamesEqual(String name1, String name2) {
+ return fIsVariableCaseSensitive ? name1.equals(name2) : name1.equalsIgnoreCase(name2);
}
/* (non-Javadoc)
@@ -207,70 +199,70 @@ public class StoredBuildPathEnvironmentContainer extends
@Override
protected ISerializeInfo getSerializeInfo(Object context) {
ISerializeInfo serializeInfo = null;
- if(context instanceof IConfiguration){
- IConfiguration cfg = (IConfiguration)context;
+ if (context instanceof IConfiguration) {
+ IConfiguration cfg = (IConfiguration) context;
final Preferences prefs = getConfigurationNode(cfg);
final String name = cfg.getId();
- if(prefs != null && name != null)
- serializeInfo = new ISerializeInfo(){
- @Override
- public Preferences getNode(){
- return prefs;
- }
+ if (prefs != null && name != null)
+ serializeInfo = new ISerializeInfo() {
+ @Override
+ public Preferences getNode() {
+ return prefs;
+ }
- @Override
- public String getPrefName(){
- return name;
- }
- };
+ @Override
+ public String getPrefName() {
+ return name;
+ }
+ };
}
return serializeInfo;
}
public void serialize(boolean force) {
- if(fEnvironment != null){
- try{
- storeEnvironment(fEnvironment,fConfiguration,force, true);
- }catch(CoreException e){
+ if (fEnvironment != null) {
+ try {
+ storeEnvironment(fEnvironment, fConfiguration, force, true);
+ } catch (CoreException e) {
}
}
}
- private Preferences getConfigurationNode(IConfiguration cfg){
- IProject project = (IProject)cfg.getOwner();
- if(project == null || !project.exists())
+ private Preferences getConfigurationNode(IConfiguration cfg) {
+ IProject project = (IProject) cfg.getOwner();
+ if (project == null || !project.exists())
return null;
Preferences prefNode = new ProjectScope(project).getNode(ManagedBuilderCorePlugin.getUniqueIdentifier());
- if(prefNode == null)
+ if (prefNode == null)
return null;
prefNode = prefNode.node(NODENAME);
- if(prefNode == null)
+ if (prefNode == null)
return null;
- if(fPathType == IEnvVarBuildPath.BUILDPATH_LIBRARY)
+ if (fPathType == IEnvVarBuildPath.BUILDPATH_LIBRARY)
return prefNode.node(NODENAME_CFG_LIBRARY);
return prefNode.node(NODENAME_CFG_INCLUDE);
}
- private String[] getBuildPathVarNames(IConfiguration configuration,int buildPathType){
+ private String[] getBuildPathVarNames(IConfiguration configuration, int buildPathType) {
ITool tools[] = configuration.getFilteredTools();
List<String> list = new ArrayList<String>();
- for(int i = 0; i < tools.length; i++){
+ for (int i = 0; i < tools.length; i++) {
IEnvVarBuildPath pathDescriptors[] = tools[i].getEnvVarBuildPaths();
- if(pathDescriptors == null || pathDescriptors.length == 0)
+ if (pathDescriptors == null || pathDescriptors.length == 0)
continue;
- for(int j = 0; j < pathDescriptors.length; j++){
+ for (int j = 0; j < pathDescriptors.length; j++) {
IEnvVarBuildPath curPathDes = pathDescriptors[j];
- if(curPathDes.getType() != buildPathType)
+ if (curPathDes.getType() != buildPathType)
continue;
String vars[] = curPathDes.getVariableNames();
- if(vars == null || vars.length == 0)
+ if (vars == null || vars.length == 0)
continue;
list.addAll(Arrays.asList(vars));
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/GCCBuiltinSpecsDetectorCygwin.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/GCCBuiltinSpecsDetectorCygwin.java
index 475211739da..b5e1b587499 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/GCCBuiltinSpecsDetectorCygwin.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/GCCBuiltinSpecsDetectorCygwin.java
@@ -30,7 +30,7 @@ import org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpec
*/
public class GCCBuiltinSpecsDetectorCygwin extends GCCBuiltinSpecsDetector {
// ID must match the tool-chain definition in org.eclipse.cdt.managedbuilder.core.buildDefinitions extension point
- private static final String GCC_TOOLCHAIN_ID_CYGWIN = "cdt.managedbuild.toolchain.gnu.cygwin.base"; //$NON-NLS-1$
+ private static final String GCC_TOOLCHAIN_ID_CYGWIN = "cdt.managedbuild.toolchain.gnu.cygwin.base"; //$NON-NLS-1$
private static final String ENV_PATH = "PATH"; //$NON-NLS-1$
public static final String CONTAINER_ENABLEMENT_PROPERTY = "org.eclipse.cdt.docker.launcher.containerbuild.property.enablement"; //$NON-NLS-1$
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/GCCBuiltinSpecsDetectorMinGW.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/GCCBuiltinSpecsDetectorMinGW.java
index 418855a1156..3b1200310b3 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/GCCBuiltinSpecsDetectorMinGW.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/GCCBuiltinSpecsDetectorMinGW.java
@@ -21,7 +21,7 @@ import org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpec
*/
public class GCCBuiltinSpecsDetectorMinGW extends GCCBuiltinSpecsDetector {
// ID must match the tool-chain definition in org.eclipse.cdt.managedbuilder.core.buildDefinitions extension point
- private static final String GCC_TOOLCHAIN_ID_MINGW = "cdt.managedbuild.toolchain.gnu.mingw.base"; //$NON-NLS-1$
+ private static final String GCC_TOOLCHAIN_ID_MINGW = "cdt.managedbuild.toolchain.gnu.mingw.base"; //$NON-NLS-1$
@Override
public String getToolchainId() {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/MBSLanguageSettingsProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/MBSLanguageSettingsProvider.java
index 4f4a66d77ab..3f12c97ff6f 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/MBSLanguageSettingsProvider.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/MBSLanguageSettingsProvider.java
@@ -44,9 +44,11 @@ import org.eclipse.core.variables.VariablesPlugin;
/**
* Implementation of language settings provider for CDT Managed Build System.
*/
-public class MBSLanguageSettingsProvider extends AbstractExecutableExtensionBase implements ILanguageSettingsBroadcastingProvider {
+public class MBSLanguageSettingsProvider extends AbstractExecutableExtensionBase
+ implements ILanguageSettingsBroadcastingProvider {
@Override
- public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc, String languageId) {
+ public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc,
+ String languageId) {
if (cfgDescription == null || rc == null) {
return null;
}
@@ -75,7 +77,7 @@ public class MBSLanguageSettingsProvider extends AbstractExecutableExtensionBase
String id = langSetting.getLanguageId();
if (id == languageId || (id != null && id.equals(languageId))) {
int kindsBits = langSetting.getSupportedEntryKinds();
- for (int kind=1; kind <= kindsBits; kind <<= 1) {
+ for (int kind = 1; kind <= kindsBits; kind <<= 1) {
if ((kindsBits & kind) != 0) {
List<ICLanguageSettingEntry> additions = langSetting.getSettingEntriesList(kind);
for (ICLanguageSettingEntry entry : additions) {
@@ -86,17 +88,25 @@ public class MBSLanguageSettingsProvider extends AbstractExecutableExtensionBase
// We need to add project-rooted entry for relative path as MBS counts it this way in some UI
// The relative entry below also should be added for indexer to resolve from source file locations
- ICdtVariableManager varManager = CCorePlugin.getDefault().getCdtVariableManager();
+ ICdtVariableManager varManager = CCorePlugin.getDefault()
+ .getCdtVariableManager();
try {
// Substitute build/environment variables
- String location = varManager.resolveValue(pathStr, "", null, cfgDescription); //$NON-NLS-1$
+ String location = varManager.resolveValue(pathStr, "", null, //$NON-NLS-1$
+ cfgDescription);
if (!new Path(location).isAbsolute()) {
- IStringVariableManager mngr = VariablesPlugin.getDefault().getStringVariableManager();
- String projectRootedPath = mngr.generateVariableExpression("workspace_loc", rc.getProject().getName()) + Path.SEPARATOR + pathStr; //$NON-NLS-1$
+ IStringVariableManager mngr = VariablesPlugin.getDefault()
+ .getStringVariableManager();
+ String projectRootedPath = mngr.generateVariableExpression(
+ "workspace_loc", rc.getProject().getName()) + Path.SEPARATOR //$NON-NLS-1$
+ + pathStr;
// clear "RESOLVED" flag
- int flags = entry.getFlags() & ~(ICSettingEntry.RESOLVED | ICSettingEntry.VALUE_WORKSPACE_PATH);
- ICLanguageSettingEntry projectRootedEntry = (ICLanguageSettingEntry) CDataUtil.createEntry(kind, projectRootedPath, projectRootedPath, null, flags);
- if (! list.contains(projectRootedEntry)) {
+ int flags = entry.getFlags() & ~(ICSettingEntry.RESOLVED
+ | ICSettingEntry.VALUE_WORKSPACE_PATH);
+ ICLanguageSettingEntry projectRootedEntry = (ICLanguageSettingEntry) CDataUtil
+ .createEntry(kind, projectRootedPath, projectRootedPath,
+ null, flags);
+ if (!list.contains(projectRootedEntry)) {
list.add(projectRootedEntry);
}
}
@@ -104,10 +114,10 @@ public class MBSLanguageSettingsProvider extends AbstractExecutableExtensionBase
// Swallow exceptions but also log them
ManagedBuilderCorePlugin.log(e);
}
-
+
}
}
- if (! list.contains(entry)) {
+ if (!list.contains(entry)) {
list.add(entry);
}
}
@@ -129,11 +139,11 @@ public class MBSLanguageSettingsProvider extends AbstractExecutableExtensionBase
case ICSettingBase.SETTING_PROJECT:
case ICSettingBase.SETTING_CONFIGURATION:
case ICSettingBase.SETTING_FOLDER:
- ICFolderDescription foDes = (ICFolderDescription)rcDescription;
+ ICFolderDescription foDes = (ICFolderDescription) rcDescription;
array = foDes.getLanguageSettings();
break;
case ICSettingBase.SETTING_FILE:
- ICFileDescription fiDes = (ICFileDescription)rcDescription;
+ ICFileDescription fiDes = (ICFileDescription) rcDescription;
ICLanguageSetting ls = fiDes.getLanguageSetting();
if (ls != null) {
array = new ICLanguageSetting[] { ls };
@@ -152,10 +162,12 @@ public class MBSLanguageSettingsProvider extends AbstractExecutableExtensionBase
public boolean isEmpty() {
return false;
}
+
@Override
public LanguageSettingsStorage clone() throws CloneNotSupportedException {
return this;
}
+
@Override
public boolean equals(Object obj) {
// Note that this always triggers change event even if nothing changed in MBS
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildCdtVariablesSupplierBase.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildCdtVariablesSupplierBase.java
index 89dc08f3f12..4f3db449a5e 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildCdtVariablesSupplierBase.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildCdtVariablesSupplierBase.java
@@ -21,15 +21,13 @@ import org.eclipse.cdt.utils.cdtvariables.IVariableContextInfo;
public abstract class BuildCdtVariablesSupplierBase implements IBuildMacroSupplier {
@Override
- public abstract IBuildMacro getMacro(String macroName, int contextType,
- Object contextData);
+ public abstract IBuildMacro getMacro(String macroName, int contextType, Object contextData);
@Override
public abstract IBuildMacro[] getMacros(int contextType, Object contextData);
@Override
- public ICdtVariable getVariable(String macroName,
- IMacroContextInfo context) {
+ public ICdtVariable getVariable(String macroName, IMacroContextInfo context) {
return getMacro(macroName, context.getContextType(), context.getContextData());
}
@@ -39,10 +37,9 @@ public abstract class BuildCdtVariablesSupplierBase implements IBuildMacroSuppli
}
@Override
- public ICdtVariable getVariable(String macroName,
- IVariableContextInfo context) {
- if(context instanceof IMacroContextInfo){
- IMacroContextInfo info = (IMacroContextInfo)context;
+ public ICdtVariable getVariable(String macroName, IVariableContextInfo context) {
+ if (context instanceof IMacroContextInfo) {
+ IMacroContextInfo info = (IMacroContextInfo) context;
return getMacro(macroName, info.getContextType(), info.getContextData());
}
return null;
@@ -50,8 +47,8 @@ public abstract class BuildCdtVariablesSupplierBase implements IBuildMacroSuppli
@Override
public ICdtVariable[] getVariables(IVariableContextInfo context) {
- if(context instanceof IMacroContextInfo){
- IMacroContextInfo info = (IMacroContextInfo)context;
+ if (context instanceof IMacroContextInfo) {
+ IMacroContextInfo info = (IMacroContextInfo) context;
return getMacros(info.getContextType(), info.getContextData());
}
return null;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildMacroProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildMacroProvider.java
index 3787b9d7059..200176190e6 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildMacroProvider.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildMacroProvider.java
@@ -53,23 +53,23 @@ public class BuildMacroProvider implements IBuildMacroProvider, IMacroContextInf
public static MbsMacroSupplier fMbsMacroSupplier = MbsMacroSupplier.getInstance();
- protected BuildMacroProvider(){
+ protected BuildMacroProvider() {
}
- public static BuildMacroProvider getDefault(){
- if(fDefault == null)
+ public static BuildMacroProvider getDefault() {
+ if (fDefault == null)
fDefault = new BuildMacroProvider();
return fDefault;
}
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider#getMacro(java.lang.String, int, java.lang.Object, boolean)
*/
@Override
- public IBuildMacro getMacro(String macroName, int contextType,
- Object contextData, boolean includeParentContexts) {
+ public IBuildMacro getMacro(String macroName, int contextType, Object contextData, boolean includeParentContexts) {
ICdtVariable var = getVariable(macroName, contextType, contextData, includeParentContexts);
- if(var != null)
+ if (var != null)
return wrap(var);
return null;
}
@@ -78,67 +78,61 @@ public class BuildMacroProvider implements IBuildMacroProvider, IMacroContextInf
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider#getMacros(int, java.lang.Object, boolean)
*/
@Override
- public IBuildMacro[] getMacros(int contextType, Object contextData,
- boolean includeParentContexts) {
+ public IBuildMacro[] getMacros(int contextType, Object contextData, boolean includeParentContexts) {
ICdtVariable[] vars = getVariables(contextType, contextData, includeParentContexts);
- if(vars != null)
+ if (vars != null)
return wrap(vars);
return null;
}
- public static CoreMacrosSupplier createCoreSupplier(IConfiguration cfg){
+ public static CoreMacrosSupplier createCoreSupplier(IConfiguration cfg) {
ICConfigurationDescription cfgDes = ManagedBuildManager.getDescriptionForConfiguration(cfg);
- if(cfgDes != null){
+ if (cfgDes != null) {
return new CoreMacrosSupplier(cfgDes);
}
return null;
}
-
-
@Override
- public ICdtVariable getVariable(String macroName, int contextType,
- Object contextData, boolean includeParentContexts) {
- return SupplierBasedCdtVariableManager.getVariable(macroName,
- getMacroContextInfo(contextType,contextData),includeParentContexts);
+ public ICdtVariable getVariable(String macroName, int contextType, Object contextData,
+ boolean includeParentContexts) {
+ return SupplierBasedCdtVariableManager.getVariable(macroName, getMacroContextInfo(contextType, contextData),
+ includeParentContexts);
}
@Override
- public ICdtVariable[] getVariables(int contextType, Object contextData,
- boolean includeParentContexts) {
- return SupplierBasedCdtVariableManager.getVariables(getMacroContextInfo(contextType,contextData),includeParentContexts);
+ public ICdtVariable[] getVariables(int contextType, Object contextData, boolean includeParentContexts) {
+ return SupplierBasedCdtVariableManager.getVariables(getMacroContextInfo(contextType, contextData),
+ includeParentContexts);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider#getSuppliers(int, java.lang.Object)
*/
@Override
- public IBuildMacroSupplier[] getSuppliers(int contextType,
- Object contextData) {
- IMacroContextInfo info = getMacroContextInfo(contextType,contextData);
- if(info != null){
+ public IBuildMacroSupplier[] getSuppliers(int contextType, Object contextData) {
+ IMacroContextInfo info = getMacroContextInfo(contextType, contextData);
+ if (info != null) {
ICdtVariableSupplier suppliers[] = info.getSuppliers();
- if(suppliers != null)
+ if (suppliers != null)
return filterMacroSuppliers(suppliers);
}
return null;
}
- private static IBuildMacroSupplier[] filterMacroSuppliers(ICdtVariableSupplier suppliers[]){
+ private static IBuildMacroSupplier[] filterMacroSuppliers(ICdtVariableSupplier suppliers[]) {
List<ICdtVariableSupplier> list = new ArrayList<ICdtVariableSupplier>(suppliers.length);
- for(int i = 0; i < suppliers.length; i++){
- if(suppliers[i] instanceof IBuildMacroSupplier)
+ for (int i = 0; i < suppliers.length; i++) {
+ if (suppliers[i] instanceof IBuildMacroSupplier)
list.add(suppliers[i]);
}
return list.toArray(new IBuildMacroSupplier[list.size()]);
}
@Override
- public IMacroContextInfo getMacroContextInfo(
- int contextType,
- Object contextData){
- DefaultMacroContextInfo info = new DefaultMacroContextInfo(contextType,contextData);
- if(info.getSuppliers() != null)
+ public IMacroContextInfo getMacroContextInfo(int contextType, Object contextData) {
+ DefaultMacroContextInfo info = new DefaultMacroContextInfo(contextType, contextData);
+ if (info.getSuppliers() != null)
return info;
return null;
}
@@ -148,22 +142,22 @@ public class BuildMacroProvider implements IBuildMacroProvider, IMacroContextInf
*/
@Override
public String convertStringListToString(String[] value, String listDelimiter) {
- return CdtVariableResolver.convertStringListToString(value,listDelimiter);
+ return CdtVariableResolver.convertStringListToString(value, listDelimiter);
}
private static class VariableWrapper implements IBuildMacro {
private ICdtVariable fVariable;
- public VariableWrapper(ICdtVariable var){
- if(var == null)
+ public VariableWrapper(ICdtVariable var) {
+ if (var == null)
throw new NullPointerException();
fVariable = var;
}
-// public ICdtVariable getVariable(){
-// return fVariable;
-// }
+ // public ICdtVariable getVariable(){
+ // return fVariable;
+ // }
@Override
public int getMacroValueType() {
@@ -199,20 +193,20 @@ public class BuildMacroProvider implements IBuildMacroProvider, IMacroContextInf
}
}
- public static IBuildMacro wrap(ICdtVariable var){
- if(var == null)
+ public static IBuildMacro wrap(ICdtVariable var) {
+ if (var == null)
return null;
- if(var instanceof IBuildMacro)
- return (IBuildMacro)var;
+ if (var instanceof IBuildMacro)
+ return (IBuildMacro) var;
return new VariableWrapper(var);
}
- public static IBuildMacro[] wrap(ICdtVariable vars[]){
- if(vars instanceof IBuildMacro[])
- return (IBuildMacro[])vars;
+ public static IBuildMacro[] wrap(ICdtVariable vars[]) {
+ if (vars instanceof IBuildMacro[])
+ return (IBuildMacro[]) vars;
IBuildMacro macros[] = new IBuildMacro[vars.length];
- for(int i = 0; i < macros.length; i++){
+ for (int i = 0; i < macros.length; i++) {
macros[i] = wrap(vars[i]);
}
return macros;
@@ -222,15 +216,14 @@ public class BuildMacroProvider implements IBuildMacroProvider, IMacroContextInf
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider#resolveValue(java.lang.String, java.lang.String, java.lang.String, int, java.lang.Object)
*/
@Override
- public String resolveValue(String value, String nonexistentMacrosValue,
- String listDelimiter, int contextType, Object contextData)
- throws BuildMacroException {
- IMacroContextInfo info = getMacroContextInfo(contextType,contextData);
+ public String resolveValue(String value, String nonexistentMacrosValue, String listDelimiter, int contextType,
+ Object contextData) throws BuildMacroException {
+ IMacroContextInfo info = getMacroContextInfo(contextType, contextData);
- if(info != null){
+ if (info != null) {
try {
return CdtVariableResolver.resolveToString(value,
- getMacroSubstitutor(info,nonexistentMacrosValue, listDelimiter));
+ getMacroSubstitutor(info, nonexistentMacrosValue, listDelimiter));
} catch (CdtVariableException e) {
throw new BuildMacroException(e);
}
@@ -242,14 +235,14 @@ public class BuildMacroProvider implements IBuildMacroProvider, IMacroContextInf
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider#resolveStringListValue(java.lang.String, java.lang.String, int, java.lang.Object)
*/
@Override
- public String[] resolveStringListValue(String value,
- String nonexistentMacrosValue, String listDelimiter,
+ public String[] resolveStringListValue(String value, String nonexistentMacrosValue, String listDelimiter,
int contextType, Object contextData) throws BuildMacroException {
- IMacroContextInfo info = getMacroContextInfo(contextType,contextData);
- if(info != null){
+ IMacroContextInfo info = getMacroContextInfo(contextType, contextData);
+ if (info != null) {
try {
- return CdtVariableResolver.resolveToStringList(value,getMacroSubstitutor(info,nonexistentMacrosValue, listDelimiter));
+ return CdtVariableResolver.resolveToStringList(value,
+ getMacroSubstitutor(info, nonexistentMacrosValue, listDelimiter));
} catch (CdtVariableException e) {
throw new BuildMacroException(e);
}
@@ -261,15 +254,14 @@ public class BuildMacroProvider implements IBuildMacroProvider, IMacroContextInf
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider#resolveValueToMakefileFormat(java.lang.String, java.lang.String, java.lang.String, int, java.lang.Object)
*/
@Override
- public String resolveValueToMakefileFormat(String value,
- String nonexistentMacrosValue, String listDelimiter,
+ public String resolveValueToMakefileFormat(String value, String nonexistentMacrosValue, String listDelimiter,
int contextType, Object contextData) throws BuildMacroException {
- IMacroContextInfo info = getMacroContextInfo(contextType,contextData);
- if(info != null){
+ IMacroContextInfo info = getMacroContextInfo(contextType, contextData);
+ if (info != null) {
try {
return CdtVariableResolver.resolveToString(value,
- getBuildfileMacroSubstitutor(info,nonexistentMacrosValue, listDelimiter));
+ getBuildfileMacroSubstitutor(info, nonexistentMacrosValue, listDelimiter));
} catch (CdtVariableException e) {
throw new BuildMacroException(e);
}
@@ -281,14 +273,14 @@ public class BuildMacroProvider implements IBuildMacroProvider, IMacroContextInf
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider#resolveStringListValueToMakefileFormat(java.lang.String, java.lang.String, int, java.lang.Object)
*/
@Override
- public String[] resolveStringListValueToMakefileFormat(String value,
- String nonexistentMacrosValue, String listDelimiter, int contextType, Object contextData)
- throws BuildMacroException {
+ public String[] resolveStringListValueToMakefileFormat(String value, String nonexistentMacrosValue,
+ String listDelimiter, int contextType, Object contextData) throws BuildMacroException {
- IMacroContextInfo info = getMacroContextInfo(contextType,contextData);
- if(info != null){
+ IMacroContextInfo info = getMacroContextInfo(contextType, contextData);
+ if (info != null) {
try {
- return CdtVariableResolver.resolveToStringList(value,getBuildfileMacroSubstitutor(info,nonexistentMacrosValue, listDelimiter));
+ return CdtVariableResolver.resolveToStringList(value,
+ getBuildfileMacroSubstitutor(info, nonexistentMacrosValue, listDelimiter));
} catch (CdtVariableException e) {
throw new BuildMacroException(e);
}
@@ -302,8 +294,9 @@ public class BuildMacroProvider implements IBuildMacroProvider, IMacroContextInf
@Override
public boolean isStringListValue(String value, int contextType, Object contextData) throws BuildMacroException {
try {
- CdtVariableResolver.resolveToStringList(value,getMacroSubstitutor(getMacroContextInfo(contextType,contextData)," ",null)); //$NON-NLS-1$
- }catch(CdtVariableException e){
+ CdtVariableResolver.resolveToStringList(value,
+ getMacroSubstitutor(getMacroContextInfo(contextType, contextData), " ", null)); //$NON-NLS-1$
+ } catch (CdtVariableException e) {
return false;
}
return true;
@@ -314,44 +307,45 @@ public class BuildMacroProvider implements IBuildMacroProvider, IMacroContextInf
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider#checkIntegrity(int, java.lang.Object)
*/
@Override
- public void checkIntegrity(int contextType, Object contextData)
- throws BuildMacroException {
+ public void checkIntegrity(int contextType, Object contextData) throws BuildMacroException {
final ICdtVariableManager mngr = CCorePlugin.getDefault().getCdtVariableManager();
- IMacroContextInfo info = getMacroContextInfo(contextType,contextData);
- IVariableSubstitutor subst = new SupplierBasedCdtVariableSubstitutor(info,null,""){ //$NON-NLS-1$
+ IMacroContextInfo info = getMacroContextInfo(contextType, contextData);
+ IVariableSubstitutor subst = new SupplierBasedCdtVariableSubstitutor(info, null, "") { //$NON-NLS-1$
@Override
protected ResolvedMacro resolveMacro(ICdtVariable macro) throws CdtVariableException {
IStringVariable var = mngr.toEclipseVariable(macro, null);
- if(var instanceof IDynamicVariable)
- return new ResolvedMacro(macro.getName(),""); //$NON-NLS-1$
+ if (var instanceof IDynamicVariable)
+ return new ResolvedMacro(macro.getName(), ""); //$NON-NLS-1$
return super.resolveMacro(macro);
}
};
- if(info != null){
+ if (info != null) {
try {
- CdtVariableResolver.checkIntegrity(info,subst);
+ CdtVariableResolver.checkIntegrity(info, subst);
} catch (CdtVariableException e) {
throw new BuildMacroException(e);
}
}
}
- public SupplierBasedCdtVariableSubstitutor getMacroSubstitutor(IMacroContextInfo info, String inexistentMacroValue, String listDelimiter){
+ public SupplierBasedCdtVariableSubstitutor getMacroSubstitutor(IMacroContextInfo info, String inexistentMacroValue,
+ String listDelimiter) {
return new SupplierBasedCdtVariableSubstitutor(info, inexistentMacroValue, listDelimiter);
}
- public IVariableSubstitutor getBuildfileMacroSubstitutor(IMacroContextInfo info, String inexistentMacroValue, String listDelimiter){
+ public IVariableSubstitutor getBuildfileMacroSubstitutor(IMacroContextInfo info, String inexistentMacroValue,
+ String listDelimiter) {
return new BuildfileMacroSubstitutor(info, inexistentMacroValue, listDelimiter);
}
/**
* @return whether the environment macros are to be expanded in the buildfile
*/
- public boolean areMacrosExpandedInBuildfile(IConfiguration cfg){
+ public boolean areMacrosExpandedInBuildfile(IConfiguration cfg) {
IBuilder builder = cfg.getBuilder();
boolean expanded = !builder.keepEnvironmentVariablesInBuildfile();
- if(expanded || canKeepMacrosInBuildfile(cfg))
+ if (expanded || canKeepMacrosInBuildfile(cfg))
return expanded;
return true;
}
@@ -364,8 +358,8 @@ public class BuildMacroProvider implements IBuildMacroProvider, IMacroContextInf
*
* @return whether the environment macros are to be expanded in the buildfile
*/
- public boolean expandMacrosInBuildfile(IConfiguration cfg, boolean expand){
- if(expand || canKeepMacrosInBuildfile(cfg)){
+ public boolean expandMacrosInBuildfile(IConfiguration cfg, boolean expand) {
+ if (expand || canKeepMacrosInBuildfile(cfg)) {
IBuilder builder = cfg.getEditableBuilder();
builder.setKeepEnvironmentVariablesInBuildfile(!expand);
return expand;
@@ -373,17 +367,17 @@ public class BuildMacroProvider implements IBuildMacroProvider, IMacroContextInf
return true;
}
-
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider#resolveStringListValues(java.lang.String[], java.lang.String, java.lang.String, int, java.lang.Object)
*/
@Override
- public String[] resolveStringListValues(String[] value, String nonexistentMacrosValue, String listDelimiter, int contextType, Object contextData) throws BuildMacroException {
- IMacroContextInfo info = getMacroContextInfo(contextType,contextData);
- if(info != null){
+ public String[] resolveStringListValues(String[] value, String nonexistentMacrosValue, String listDelimiter,
+ int contextType, Object contextData) throws BuildMacroException {
+ IMacroContextInfo info = getMacroContextInfo(contextType, contextData);
+ if (info != null) {
try {
return CdtVariableResolver.resolveStringListValues(value,
- getMacroSubstitutor(info,nonexistentMacrosValue, listDelimiter), true);
+ getMacroSubstitutor(info, nonexistentMacrosValue, listDelimiter), true);
} catch (CdtVariableException e) {
throw new BuildMacroException(e);
}
@@ -395,12 +389,13 @@ public class BuildMacroProvider implements IBuildMacroProvider, IMacroContextInf
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider#resolveStringListValuesToMakefileFormat(java.lang.String[], java.lang.String, java.lang.String, int, java.lang.Object)
*/
@Override
- public String[] resolveStringListValuesToMakefileFormat(String[] value, String nonexistentMacrosValue, String listDelimiter, int contextType, Object contextData) throws BuildMacroException {
- IMacroContextInfo info = getMacroContextInfo(contextType,contextData);
- if(info != null){
+ public String[] resolveStringListValuesToMakefileFormat(String[] value, String nonexistentMacrosValue,
+ String listDelimiter, int contextType, Object contextData) throws BuildMacroException {
+ IMacroContextInfo info = getMacroContextInfo(contextType, contextData);
+ if (info != null) {
try {
return CdtVariableResolver.resolveStringListValues(value,
- getBuildfileMacroSubstitutor(info,nonexistentMacrosValue, listDelimiter), true);
+ getBuildfileMacroSubstitutor(info, nonexistentMacrosValue, listDelimiter), true);
} catch (CdtVariableException e) {
throw new BuildMacroException(e);
}
@@ -412,10 +407,10 @@ public class BuildMacroProvider implements IBuildMacroProvider, IMacroContextInf
* @return whether the builder used for the given configuration is capable
* of handling macros in the buildfile
*/
- public static boolean canKeepMacrosInBuildfile(IConfiguration cfg){
- if(cfg != null){
+ public static boolean canKeepMacrosInBuildfile(IConfiguration cfg) {
+ if (cfg != null) {
IToolChain toolChain = cfg.getToolChain();
- if(toolChain != null)
+ if (toolChain != null)
return canKeepMacrosInBuildfile(toolChain.getBuilder());
}
return false;
@@ -425,10 +420,10 @@ public class BuildMacroProvider implements IBuildMacroProvider, IMacroContextInf
* @return whether the given builder is capable
* of handling macros in the buildfile
*/
- public static boolean canKeepMacrosInBuildfile(IBuilder builder){
- if(builder != null){
+ public static boolean canKeepMacrosInBuildfile(IBuilder builder) {
+ if (builder != null) {
String pattern = builder.getBuilderVariablePattern();
- if(pattern != null && pattern.indexOf(PATTERN_MACRO_NAME) != -1)
+ if (pattern != null && pattern.indexOf(PATTERN_MACRO_NAME) != -1)
return true;
}
return false;
@@ -438,12 +433,12 @@ public class BuildMacroProvider implements IBuildMacroProvider, IMacroContextInf
* creates a macro reference in the buildfile format for the given builder.
* If the builder can not treat macros, returns null
*/
- public static String createBuildfileMacroReference(String name, IBuilder builder){
+ public static String createBuildfileMacroReference(String name, IBuilder builder) {
String ref = null;
- if(builder != null){
+ if (builder != null) {
String pattern = builder.getBuilderVariablePattern();
- if(pattern != null && pattern.indexOf(PATTERN_MACRO_NAME) != -1)
- ref = pattern.replaceAll(PATTERN_MACRO_NAME,name);
+ if (pattern != null && pattern.indexOf(PATTERN_MACRO_NAME) != -1)
+ ref = pattern.replaceAll(PATTERN_MACRO_NAME, name);
}
return ref;
}
@@ -453,12 +448,12 @@ public class BuildMacroProvider implements IBuildMacroProvider, IMacroContextInf
* the given configuration.
* If the builder can not treat macros, returns null
*/
- public static String createBuildfileMacroReference(String name, IConfiguration cfg){
+ public static String createBuildfileMacroReference(String name, IConfiguration cfg) {
String ref = null;
- if(cfg != null){
+ if (cfg != null) {
IToolChain toolChain = cfg.getToolChain();
- if(toolChain != null)
- ref = createBuildfileMacroReference(name,toolChain.getBuilder());
+ if (toolChain != null)
+ ref = createBuildfileMacroReference(name, toolChain.getBuilder());
}
return ref;
}
@@ -469,38 +464,37 @@ public class BuildMacroProvider implements IBuildMacroProvider, IMacroContextInf
* by the tool-integrator. As a result these macros contain explicit values, but not the values
* specified in the format of the builder automatic variables and text functions)
*/
- public static IBuildMacro[] getReferencedExplitFileMacros(ITool tool){
- if(tool instanceof Tool){
- Tool t = (Tool)tool;
+ public static IBuildMacro[] getReferencedExplitFileMacros(ITool tool) {
+ if (tool instanceof Tool) {
+ Tool t = (Tool) tool;
ExplicitFileMacroCollector collector = new ExplicitFileMacroCollector(null);
- t.getToolCommandFlags(null,null,collector, getDefault());
+ t.getToolCommandFlags(null, null, collector, getDefault());
return collector.getExplicisFileMacros();
}
return new IBuildMacro[0];
}
- static IConfiguration getConfiguration(ITool tool){
+ static IConfiguration getConfiguration(ITool tool) {
IBuildObject bo = tool.getParent();
- if(bo instanceof IResourceConfiguration)
- return ((IResourceConfiguration)bo).getParent();
+ if (bo instanceof IResourceConfiguration)
+ return ((IResourceConfiguration) bo).getParent();
else if (bo instanceof IToolChain)
- return ((IToolChain)bo).getParent();
+ return ((IToolChain) bo).getParent();
return null;
}
-
-
/**
* @return the array of the explicit file macros, referenced in the given string
* (Explicit file macros are the file-specific macros, whose values are not provided
* by the tool-integrator. As a result these macros contain explicit values, but not the values
* specified in the format of the builder automatic variables and text functions)
*/
- public static IBuildMacro[] getReferencedExplitFileMacros(String expression, int contextType, Object contextData){
- ExplicitFileMacroCollector collector = new ExplicitFileMacroCollector(getDefault().getMacroContextInfo(contextType, contextData));
+ public static IBuildMacro[] getReferencedExplitFileMacros(String expression, int contextType, Object contextData) {
+ ExplicitFileMacroCollector collector = new ExplicitFileMacroCollector(
+ getDefault().getMacroContextInfo(contextType, contextData));
try {
- CdtVariableResolver.resolveToString(expression,collector);
- } catch (CdtVariableException e){
+ CdtVariableResolver.resolveToString(expression, collector);
+ } catch (CdtVariableException e) {
}
return collector.getExplicisFileMacros();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildMacroStatus.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildMacroStatus.java
index b7d571441c8..149af4a07ee 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildMacroStatus.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildMacroStatus.java
@@ -24,21 +24,18 @@ import org.eclipse.cdt.utils.cdtvariables.SupplierBasedCdtVariableStatus;
*/
public class BuildMacroStatus extends SupplierBasedCdtVariableStatus implements IBuildMacroStatus {
- public BuildMacroStatus(int severity, int code, String message,
- Throwable exception, String macroName, String expression,
- String referencedName, IVariableContextInfo info) {
- super(severity, code, message, exception, macroName, expression,
- referencedName, info);
+ public BuildMacroStatus(int severity, int code, String message, Throwable exception, String macroName,
+ String expression, String referencedName, IVariableContextInfo info) {
+ super(severity, code, message, exception, macroName, expression, referencedName, info);
}
- public BuildMacroStatus(int code, String macroName, String expression,
- String referencedName, IVariableContextInfo info) {
+ public BuildMacroStatus(int code, String macroName, String expression, String referencedName,
+ IVariableContextInfo info) {
super(code, macroName, expression, referencedName, info);
}
- public BuildMacroStatus(int code, String message, Throwable exception,
- String macroName, String expression, String referencedName,
- IVariableContextInfo info) {
+ public BuildMacroStatus(int code, String message, Throwable exception, String macroName, String expression,
+ String referencedName, IVariableContextInfo info) {
super(code, message, exception, macroName, expression, referencedName, info);
}
@@ -48,16 +45,16 @@ public class BuildMacroStatus extends SupplierBasedCdtVariableStatus implements
@Override
public int getContextType() {
IMacroContextInfo info = getMacroContextInfo();
- if(info != null){
+ if (info != null) {
return info.getContextType();
}
return 0;
}
- private IMacroContextInfo getMacroContextInfo(){
+ private IMacroContextInfo getMacroContextInfo() {
IVariableContextInfo info = getVariableContextInfo();
- if(info instanceof IMacroContextInfo)
- return (IMacroContextInfo)info;
+ if (info instanceof IMacroContextInfo)
+ return (IMacroContextInfo) info;
return null;
}
@@ -67,7 +64,7 @@ public class BuildMacroStatus extends SupplierBasedCdtVariableStatus implements
@Override
public Object getContextData() {
IMacroContextInfo info = getMacroContextInfo();
- if(info != null){
+ if (info != null) {
return info.getContextData();
}
return null;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildfileMacroSubstitutor.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildfileMacroSubstitutor.java
index a0126d42ab2..63a637c1b0e 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildfileMacroSubstitutor.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/BuildfileMacroSubstitutor.java
@@ -57,22 +57,22 @@ public class BuildfileMacroSubstitutor extends SupplierBasedCdtVariableSubstitut
private ICdtVariableManager fVarMngr;
private ICConfigurationDescription fCfgDes;
- private class DefaultReservedMacroNameSupplier implements IReservedMacroNameSupplier{
+ private class DefaultReservedMacroNameSupplier implements IReservedMacroNameSupplier {
String fReservedNames[];
- public DefaultReservedMacroNameSupplier(IConfiguration configuration){
+ public DefaultReservedMacroNameSupplier(IConfiguration configuration) {
IBuilder builder = configuration.getToolChain().getBuilder();
String reservedNames[] = builder.getReservedMacroNames();
String buildVars[] = getConfigurationReservedNames(configuration);
- if(reservedNames == null || reservedNames.length == 0)
+ if (reservedNames == null || reservedNames.length == 0)
fReservedNames = buildVars;
- else if(buildVars == null || buildVars.length == 0)
+ else if (buildVars == null || buildVars.length == 0)
fReservedNames = reservedNames;
else {
fReservedNames = new String[reservedNames.length + buildVars.length];
- System.arraycopy(reservedNames,0,fReservedNames,0,reservedNames.length);
- System.arraycopy(buildVars,0,fReservedNames,reservedNames.length,buildVars.length);
+ System.arraycopy(reservedNames, 0, fReservedNames, 0, reservedNames.length);
+ System.arraycopy(buildVars, 0, fReservedNames, reservedNames.length, buildVars.length);
}
}
@@ -81,37 +81,37 @@ public class BuildfileMacroSubstitutor extends SupplierBasedCdtVariableSubstitut
*/
@Override
public boolean isReservedName(String macroName, IConfiguration configuration) {
- if(fReservedNames != null && fReservedNames.length > 0){
- for(int i = 0; i < fReservedNames.length; i++){
+ if (fReservedNames != null && fReservedNames.length > 0) {
+ for (int i = 0; i < fReservedNames.length; i++) {
Pattern p = Pattern.compile(fReservedNames[i]);
Matcher m = p.matcher(macroName);
- if(m.matches())
+ if (m.matches())
return true;
}
}
return false;
}
- protected String[] getConfigurationReservedNames(IConfiguration configuration){
+ protected String[] getConfigurationReservedNames(IConfiguration configuration) {
ITool tools[] = configuration.getFilteredTools();
- if(tools != null){
+ if (tools != null) {
Set<String> set = new HashSet<String>();
- for(int i = 0; i < tools.length; i++){
+ for (int i = 0; i < tools.length; i++) {
IOutputType ots[] = tools[i].getOutputTypes();
- if(ots != null){
- for(int j = 0; j < ots.length; j++){
+ if (ots != null) {
+ for (int j = 0; j < ots.length; j++) {
String varName = ots[j].getBuildVariable();
- if(varName != null){
+ if (varName != null) {
set.add(varName);
}
}
}
IInputType its[] = tools[i].getInputTypes();
- if(its != null){
- for(int j = 0; j < its.length; j++){
+ if (its != null) {
+ for (int j = 0; j < its.length; j++) {
String varName = its[j].getBuildVariable();
- if(varName != null){
+ if (varName != null) {
set.add(varName);
}
}
@@ -125,93 +125,92 @@ public class BuildfileMacroSubstitutor extends SupplierBasedCdtVariableSubstitut
}
}
-// public BuildfileMacroSubstitutor(int contextType, Object contextData, String inexistentMacroValue, String listDelimiter){
-// super(contextType, contextData, inexistentMacroValue, listDelimiter);
-// init();
-// }
+ // public BuildfileMacroSubstitutor(int contextType, Object contextData, String inexistentMacroValue, String listDelimiter){
+ // super(contextType, contextData, inexistentMacroValue, listDelimiter);
+ // init();
+ // }
- public BuildfileMacroSubstitutor(IBuilder builder, IMacroContextInfo contextInfo, String inexistentMacroValue, String listDelimiter){
+ public BuildfileMacroSubstitutor(IBuilder builder, IMacroContextInfo contextInfo, String inexistentMacroValue,
+ String listDelimiter) {
super(contextInfo, inexistentMacroValue, listDelimiter);
init(builder, contextInfo);
}
- public BuildfileMacroSubstitutor(IMacroContextInfo contextInfo, String inexistentMacroValue, String listDelimiter){
+ public BuildfileMacroSubstitutor(IMacroContextInfo contextInfo, String inexistentMacroValue, String listDelimiter) {
this(null, contextInfo, inexistentMacroValue, listDelimiter);
}
-
-
- private void init(IBuilder builder, IMacroContextInfo contextInfo){
- if(contextInfo == null)
+ private void init(IBuilder builder, IMacroContextInfo contextInfo) {
+ if (contextInfo == null)
return;
fVarMngr = CCorePlugin.getDefault().getCdtVariableManager();
- if(builder != null){
+ if (builder != null) {
fBuilder = builder;
fConfiguration = builder.getParent().getParent();
} else {
IBuildObject[] bos = findConfigurationAndBuilderFromContext(contextInfo);
- if(bos != null){
- fConfiguration = (IConfiguration)bos[0];
- fBuilder = (IBuilder)bos[1];
+ if (bos != null) {
+ fConfiguration = (IConfiguration) bos[0];
+ fBuilder = (IBuilder) bos[1];
}
}
- if(fConfiguration != null){
+ if (fConfiguration != null) {
fCfgDes = ManagedBuildManager.getDescriptionForConfiguration(fConfiguration);
}
}
- static IBuildObject[] findConfigurationAndBuilderFromContext(IMacroContextInfo contextInfo){
+ static IBuildObject[] findConfigurationAndBuilderFromContext(IMacroContextInfo contextInfo) {
int type = contextInfo.getContextType();
IConfiguration cfg = null;
IBuilder builder = null;
- switch(type){
+ switch (type) {
case IBuildMacroProvider.CONTEXT_FILE:
- contextInfo = (IMacroContextInfo)contextInfo.getNext();
- if(contextInfo == null)
+ contextInfo = (IMacroContextInfo) contextInfo.getNext();
+ if (contextInfo == null)
break;
case IBuildMacroProvider.CONTEXT_OPTION:
- contextInfo = (IMacroContextInfo)contextInfo.getNext();
- if(contextInfo == null)
+ contextInfo = (IMacroContextInfo) contextInfo.getNext();
+ if (contextInfo == null)
break;
- case IBuildMacroProvider.CONTEXT_CONFIGURATION:{
- Object contextData = contextInfo.getContextData();
- if(contextData instanceof IConfiguration){
- cfg = (IConfiguration)contextData;
- builder = cfg.getBuilder();
- } else if (contextData instanceof IBuilder){
- builder = (IBuilder)contextData;
- cfg = builder.getParent().getParent();
- } else if (contextData instanceof ITool) {
- ITool tool = (ITool)contextData;
- IResourceInfo rcInfo = tool.getParentResourceInfo();
- if(rcInfo != null){
- cfg = rcInfo.getParent();
- if(cfg != null){
- builder = cfg.getBuilder();
- }
+ case IBuildMacroProvider.CONTEXT_CONFIGURATION: {
+ Object contextData = contextInfo.getContextData();
+ if (contextData instanceof IConfiguration) {
+ cfg = (IConfiguration) contextData;
+ builder = cfg.getBuilder();
+ } else if (contextData instanceof IBuilder) {
+ builder = (IBuilder) contextData;
+ cfg = builder.getParent().getParent();
+ } else if (contextData instanceof ITool) {
+ ITool tool = (ITool) contextData;
+ IResourceInfo rcInfo = tool.getParentResourceInfo();
+ if (rcInfo != null) {
+ cfg = rcInfo.getParent();
+ if (cfg != null) {
+ builder = cfg.getBuilder();
}
}
}
+ }
break;
- case IBuildMacroProvider.CONTEXT_PROJECT:{
- Object contextData = contextInfo.getContextData();
- if(contextData instanceof IManagedProject){
- IResource rc = ((IManagedProject)contextData).getOwner();
- if(rc != null){
- IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(rc);
- cfg = info.getDefaultConfiguration();
- builder = cfg.getBuilder();
- }
+ case IBuildMacroProvider.CONTEXT_PROJECT: {
+ Object contextData = contextInfo.getContextData();
+ if (contextData instanceof IManagedProject) {
+ IResource rc = ((IManagedProject) contextData).getOwner();
+ if (rc != null) {
+ IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(rc);
+ cfg = info.getDefaultConfiguration();
+ builder = cfg.getBuilder();
}
}
+ }
break;
}
- if(cfg != null && builder != null)
- return new IBuildObject[]{cfg, builder};
+ if (cfg != null && builder != null)
+ return new IBuildObject[] { cfg, builder };
return null;
}
@@ -219,61 +218,61 @@ public class BuildfileMacroSubstitutor extends SupplierBasedCdtVariableSubstitut
* @see org.eclipse.cdt.managedbuilder.internal.macros.DefaultMacroSubstitutor#resolveMacro(org.eclipse.cdt.managedbuilder.macros.IBuildMacro)
*/
@Override
- protected ResolvedMacro resolveMacro(ICdtVariable macro) throws CdtVariableException{
+ protected ResolvedMacro resolveMacro(ICdtVariable macro) throws CdtVariableException {
ResolvedMacro resolved = null;
- if(fConfiguration != null && fBuilder != null &&
- fBuilder.keepEnvironmentVariablesInBuildfile() &&
- fVarMngr.isEnvironmentVariable(macro, fCfgDes) &&
- (!CdtVariableResolver.isStringListVariable(macro.getValueType())
- || size(macro.getStringListValue()) < 2)){
+ if (fConfiguration != null && fBuilder != null && fBuilder.keepEnvironmentVariablesInBuildfile()
+ && fVarMngr.isEnvironmentVariable(macro, fCfgDes)
+ && (!CdtVariableResolver.isStringListVariable(macro.getValueType())
+ || size(macro.getStringListValue()) < 2)) {
String ref = getMacroReference(macro);
- if(ref != null)
- resolved = new ResolvedMacro(macro.getName(),ref);
+ if (ref != null)
+ resolved = new ResolvedMacro(macro.getName(), ref);
}
- if(resolved != null)
+ if (resolved != null)
return resolved;
return super.resolveMacro(macro);
}
- private static int size(String[] value){
+ private static int size(String[] value) {
return value != null ? value.length : 0;
}
- public IConfiguration getConfiguration(){
+ public IConfiguration getConfiguration() {
return fConfiguration;
}
- protected IReservedMacroNameSupplier getReservedMacroNameSupplier(){
- if(fBuilder == null)
+ protected IReservedMacroNameSupplier getReservedMacroNameSupplier() {
+ if (fBuilder == null)
return null;
IReservedMacroNameSupplier supplier = fBuilder.getReservedMacroNameSupplier();
- if(supplier == null)
+ if (supplier == null)
supplier = new DefaultReservedMacroNameSupplier(fConfiguration);
return supplier;
}
- protected String getMacroReference(ICdtVariable macro){
+ protected String getMacroReference(ICdtVariable macro) {
String macroName = macro.getName();
String ref = null;
IReservedMacroNameSupplier supplier = getReservedMacroNameSupplier();
//on win32 all environment variable names are converted to upper case
macroName = EnvVarOperationProcessor.normalizeName(macroName);
- if(supplier == null || !supplier.isReservedName(macroName,fConfiguration)){
+ if (supplier == null || !supplier.isReservedName(macroName, fConfiguration)) {
String pattern = fBuilder.getBuilderVariablePattern();
- if(pattern != null && pattern.indexOf(PATTERN_MACRO_NAME) != -1){
- if(fBuilder.isVariableCaseSensitive() || getCaseInsensitiveReferencedNames().add(macroName.toUpperCase())){
- ref = pattern.replaceAll(PATTERN_MACRO_NAME,macroName);
+ if (pattern != null && pattern.indexOf(PATTERN_MACRO_NAME) != -1) {
+ if (fBuilder.isVariableCaseSensitive()
+ || getCaseInsensitiveReferencedNames().add(macroName.toUpperCase())) {
+ ref = pattern.replaceAll(PATTERN_MACRO_NAME, macroName);
}
}
}
return ref;
}
- protected Set<String> getCaseInsensitiveReferencedNames(){
- if(fCaseInsensitiveReferencedNames == null)
+ protected Set<String> getCaseInsensitiveReferencedNames() {
+ if (fCaseInsensitiveReferencedNames == null)
fCaseInsensitiveReferencedNames = new HashSet<String>();
return fCaseInsensitiveReferencedNames;
}
@@ -282,19 +281,18 @@ public class BuildfileMacroSubstitutor extends SupplierBasedCdtVariableSubstitut
* @see org.eclipse.cdt.managedbuilder.internal.macros.DefaultMacroSubstitutor#setMacroContextInfo(org.eclipse.cdt.managedbuilder.internal.macros.IMacroContextInfo)
*/
@Override
- public void setMacroContextInfo(IVariableContextInfo info)
- throws CdtVariableException{
+ public void setMacroContextInfo(IVariableContextInfo info) throws CdtVariableException {
super.setMacroContextInfo(info);
- if(info instanceof IMacroContextInfo)
- init(null, (IMacroContextInfo)info);
+ if (info instanceof IMacroContextInfo)
+ init(null, (IMacroContextInfo) info);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.internal.macros.IMacroSubstitutor#setMacroContextInfo(int, java.lang.Object)
*/
-// public void setMacroContextInfo(int contextType, Object contextData) throws BuildMacroException{
-// super.setMacroContextInfo(contextType, contextData);
-// init();
-// }
+ // public void setMacroContextInfo(int contextType, Object contextData) throws BuildMacroException{
+ // super.setMacroContextInfo(contextType, contextData);
+ // init();
+ // }
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/CoreMacrosSupplier.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/CoreMacrosSupplier.java
index 597ef4f6e27..d5051e7e788 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/CoreMacrosSupplier.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/CoreMacrosSupplier.java
@@ -21,15 +21,15 @@ import org.eclipse.cdt.managedbuilder.macros.IBuildMacro;
public class CoreMacrosSupplier extends BuildCdtVariablesSupplierBase {
private ICConfigurationDescription fCfgDes;
- private ICdtVariableManager fMngr;
- CoreMacrosSupplier(ICConfigurationDescription cfgDes){
+ private ICdtVariableManager fMngr;
+
+ CoreMacrosSupplier(ICConfigurationDescription cfgDes) {
fCfgDes = cfgDes;
fMngr = CCorePlugin.getDefault().getCdtVariableManager();
}
@Override
- public IBuildMacro getMacro(String macroName, int contextType,
- Object contextData) {
+ public IBuildMacro getMacro(String macroName, int contextType, Object contextData) {
return BuildMacroProvider.wrap(getVariable(macroName, null));
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/DefaultMacroContextInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/DefaultMacroContextInfo.java
index 68a4e13c4ff..f3aa6d9902c 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/DefaultMacroContextInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/DefaultMacroContextInfo.java
@@ -39,94 +39,86 @@ public class DefaultMacroContextInfo implements IMacroContextInfo {
private int fType;
private Object fData;
- public DefaultMacroContextInfo(int type, Object data){
+ public DefaultMacroContextInfo(int type, Object data) {
fType = type;
fData = data;
}
- public DefaultMacroContextInfo(int type, Object data, ICdtVariableSupplier suppliers[]){
+ public DefaultMacroContextInfo(int type, Object data, ICdtVariableSupplier suppliers[]) {
fType = type;
fData = data;
fSuppliers = suppliers;
}
- protected ICdtVariableSupplier[] getSuppliers(int type, Object data){
- switch(type){
+ protected ICdtVariableSupplier[] getSuppliers(int type, Object data) {
+ switch (type) {
case IBuildMacroProvider.CONTEXT_FILE:
- if(data instanceof IFileContextData){
- return new ICdtVariableSupplier[]{
- BuildMacroProvider.fMbsMacroSupplier
- };
+ if (data instanceof IFileContextData) {
+ return new ICdtVariableSupplier[] { BuildMacroProvider.fMbsMacroSupplier };
}
break;
case IBuildMacroProvider.CONTEXT_OPTION:
- if(data instanceof IOptionContextData){
- return new ICdtVariableSupplier[]{
- BuildMacroProvider.fMbsMacroSupplier
- };
+ if (data instanceof IOptionContextData) {
+ return new ICdtVariableSupplier[] { BuildMacroProvider.fMbsMacroSupplier };
}
break;
case IBuildMacroProvider.CONTEXT_TOOL:
- if(data instanceof ITool){
- return new ICdtVariableSupplier[]{
- BuildMacroProvider.fMbsMacroSupplier
- };
+ if (data instanceof ITool) {
+ return new ICdtVariableSupplier[] { BuildMacroProvider.fMbsMacroSupplier };
}
break;
case IBuildMacroProvider.CONTEXT_CONFIGURATION:
IConfiguration cfg = null;
- if(data instanceof IConfiguration){
- cfg = (IConfiguration)data;
- } else if(data instanceof IBuilder){
- cfg = ((IBuilder)data).getParent().getParent();
+ if (data instanceof IConfiguration) {
+ cfg = (IConfiguration) data;
+ } else if (data instanceof IBuilder) {
+ cfg = ((IBuilder) data).getParent().getParent();
}
- if(cfg != null){
+ if (cfg != null) {
CoreMacrosSupplier supplier = BuildMacroProvider.createCoreSupplier(cfg);
- if(supplier != null){
- return new ICdtVariableSupplier[]{
- supplier
- };
+ if (supplier != null) {
+ return new ICdtVariableSupplier[] { supplier };
}
}
break;
-/* case IBuildMacroProvider.CONTEXT_PROJECT:
- if(data instanceof IManagedProject){
- return new ICdtVariableSupplier[]{
- BuildMacroProvider.fUserDefinedMacroSupplier,
- BuildMacroProvider.fExternalExtensionMacroSupplier,
- BuildMacroProvider.fEnvironmentMacroSupplier,
- BuildMacroProvider.fMbsMacroSupplier
- };
- }
- break;
- case IBuildMacroProvider.CONTEXT_WORKSPACE:
- if(data instanceof IWorkspace){
- return new ICdtVariableSupplier[]{
- BuildMacroProvider.fUserDefinedMacroSupplier,
- BuildMacroProvider.fEnvironmentMacroSupplier,
- BuildMacroProvider.fMbsMacroSupplier,
- BuildMacroProvider.fCdtPathEntryMacroSupplier,
- BuildMacroProvider.fEclipseVariablesMacroSupplier
- };
- }
- break;
- case IBuildMacroProvider.CONTEXT_INSTALLATIONS:
- if(data == null){
- return new ICdtVariableSupplier[]{
- BuildMacroProvider.fMbsMacroSupplier
- };
- }
- break;
- case IBuildMacroProvider.CONTEXT_ECLIPSEENV:
- if(data == null){
- return new ICdtVariableSupplier[]{
- BuildMacroProvider.fEnvironmentMacroSupplier
- };
- }
- break;
- */
+ /* case IBuildMacroProvider.CONTEXT_PROJECT:
+ if(data instanceof IManagedProject){
+ return new ICdtVariableSupplier[]{
+ BuildMacroProvider.fUserDefinedMacroSupplier,
+ BuildMacroProvider.fExternalExtensionMacroSupplier,
+ BuildMacroProvider.fEnvironmentMacroSupplier,
+ BuildMacroProvider.fMbsMacroSupplier
+ };
+ }
+ break;
+ case IBuildMacroProvider.CONTEXT_WORKSPACE:
+ if(data instanceof IWorkspace){
+ return new ICdtVariableSupplier[]{
+ BuildMacroProvider.fUserDefinedMacroSupplier,
+ BuildMacroProvider.fEnvironmentMacroSupplier,
+ BuildMacroProvider.fMbsMacroSupplier,
+ BuildMacroProvider.fCdtPathEntryMacroSupplier,
+ BuildMacroProvider.fEclipseVariablesMacroSupplier
+ };
+ }
+ break;
+ case IBuildMacroProvider.CONTEXT_INSTALLATIONS:
+ if(data == null){
+ return new ICdtVariableSupplier[]{
+ BuildMacroProvider.fMbsMacroSupplier
+ };
+ }
+ break;
+ case IBuildMacroProvider.CONTEXT_ECLIPSEENV:
+ if(data == null){
+ return new ICdtVariableSupplier[]{
+ BuildMacroProvider.fEnvironmentMacroSupplier
+ };
+ }
+ break;
+ */
}
return null;
}
@@ -152,7 +144,7 @@ public class DefaultMacroContextInfo implements IMacroContextInfo {
*/
@Override
public ICdtVariableSupplier[] getSuppliers() {
- if(fSuppliers == null)
+ if (fSuppliers == null)
fSuppliers = getSuppliers(fType, fData);
return fSuppliers;
}
@@ -162,105 +154,88 @@ public class DefaultMacroContextInfo implements IMacroContextInfo {
*/
@Override
public IVariableContextInfo getNext() {
- switch(fType){
+ switch (fType) {
case IBuildMacroProvider.CONTEXT_FILE:
- if(fData instanceof IFileContextData){
- IFileContextData fileContext = (IFileContextData)fData;
+ if (fData instanceof IFileContextData) {
+ IFileContextData fileContext = (IFileContextData) fData;
IOptionContextData optionContext = fileContext.getOptionContextData();
- if(optionContext != null)
- return new DefaultMacroContextInfo(
- IBuildMacroProvider.CONTEXT_OPTION,
- optionContext);
+ if (optionContext != null)
+ return new DefaultMacroContextInfo(IBuildMacroProvider.CONTEXT_OPTION, optionContext);
}
break;
case IBuildMacroProvider.CONTEXT_OPTION:
- if(fData instanceof IOptionContextData){
- IOptionContextData optionContext = (IOptionContextData)fData;
+ if (fData instanceof IOptionContextData) {
+ IOptionContextData optionContext = (IOptionContextData) fData;
IHoldsOptions ho = OptionContextData.getHolder(optionContext);
- if(ho instanceof ITool)
- return new DefaultMacroContextInfo(
- IBuildMacroProvider.CONTEXT_TOOL,
- ho);
- else if(ho instanceof IToolChain)
- return new DefaultMacroContextInfo(
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- ((IToolChain)ho).getParent());
+ if (ho instanceof ITool)
+ return new DefaultMacroContextInfo(IBuildMacroProvider.CONTEXT_TOOL, ho);
+ else if (ho instanceof IToolChain)
+ return new DefaultMacroContextInfo(IBuildMacroProvider.CONTEXT_CONFIGURATION,
+ ((IToolChain) ho).getParent());
else {
IBuildObject buildObj = optionContext.getParent();
- IConfiguration cfg = null;
- if(buildObj instanceof ITool)
- buildObj = ((ITool)buildObj).getParent();
- if(buildObj instanceof IToolChain)
- cfg = ((IToolChain)buildObj).getParent();
- else if(buildObj instanceof IResourceConfiguration)
- cfg = ((IResourceConfiguration)buildObj).getParent();
- else if(buildObj instanceof IConfiguration)
- cfg = (IConfiguration)buildObj;
+ IConfiguration cfg = null;
+ if (buildObj instanceof ITool)
+ buildObj = ((ITool) buildObj).getParent();
+ if (buildObj instanceof IToolChain)
+ cfg = ((IToolChain) buildObj).getParent();
+ else if (buildObj instanceof IResourceConfiguration)
+ cfg = ((IResourceConfiguration) buildObj).getParent();
+ else if (buildObj instanceof IConfiguration)
+ cfg = (IConfiguration) buildObj;
- if(cfg != null){
- return new DefaultMacroContextInfo(
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- cfg);
- }
+ if (cfg != null) {
+ return new DefaultMacroContextInfo(IBuildMacroProvider.CONTEXT_CONFIGURATION, cfg);
+ }
}
}
break;
case IBuildMacroProvider.CONTEXT_TOOL:
- if(fData instanceof ITool){
- IBuildObject parent = ((ITool)fData).getParent();
+ if (fData instanceof ITool) {
+ IBuildObject parent = ((ITool) fData).getParent();
IConfiguration cfg = null;
- if(parent instanceof IToolChain)
- cfg = ((IToolChain)parent).getParent();
- else if(parent instanceof IResourceConfiguration)
- cfg = ((IResourceConfiguration)parent).getParent();
+ if (parent instanceof IToolChain)
+ cfg = ((IToolChain) parent).getParent();
+ else if (parent instanceof IResourceConfiguration)
+ cfg = ((IResourceConfiguration) parent).getParent();
- if(cfg != null)
- return new DefaultMacroContextInfo(
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- cfg);
+ if (cfg != null)
+ return new DefaultMacroContextInfo(IBuildMacroProvider.CONTEXT_CONFIGURATION, cfg);
}
break;
case IBuildMacroProvider.CONTEXT_CONFIGURATION:
IConfiguration configuration = null;
- if(fData instanceof IConfiguration){
- configuration = (IConfiguration)fData;
- } else if(fData instanceof IBuilder){
- configuration = ((IBuilder)fData).getParent().getParent();
+ if (fData instanceof IConfiguration) {
+ configuration = (IConfiguration) fData;
+ } else if (fData instanceof IBuilder) {
+ configuration = ((IBuilder) fData).getParent().getParent();
}
- if(configuration != null){
+ if (configuration != null) {
IManagedProject managedProject = configuration.getManagedProject();
- if(managedProject != null)
- return new DefaultMacroContextInfo(
- IBuildMacroProvider.CONTEXT_PROJECT,
- managedProject);
+ if (managedProject != null)
+ return new DefaultMacroContextInfo(IBuildMacroProvider.CONTEXT_PROJECT, managedProject);
}
break;
case IBuildMacroProvider.CONTEXT_PROJECT:
- if(fData instanceof IManagedProject){
+ if (fData instanceof IManagedProject) {
IWorkspace wsp = ResourcesPlugin.getWorkspace();
- if(wsp != null)
- return new DefaultMacroContextInfo(
- IBuildMacroProvider.CONTEXT_WORKSPACE,
- wsp);
+ if (wsp != null)
+ return new DefaultMacroContextInfo(IBuildMacroProvider.CONTEXT_WORKSPACE, wsp);
}
break;
case IBuildMacroProvider.CONTEXT_WORKSPACE:
- if(fData instanceof IWorkspace){
- return new DefaultMacroContextInfo(
- IBuildMacroProvider.CONTEXT_INSTALLATIONS,
- null);
+ if (fData instanceof IWorkspace) {
+ return new DefaultMacroContextInfo(IBuildMacroProvider.CONTEXT_INSTALLATIONS, null);
}
break;
case IBuildMacroProvider.CONTEXT_INSTALLATIONS:
- if(fData == null){
- return new DefaultMacroContextInfo(
- IBuildMacroProvider.CONTEXT_ECLIPSEENV,
- null);
+ if (fData == null) {
+ return new DefaultMacroContextInfo(IBuildMacroProvider.CONTEXT_ECLIPSEENV, null);
}
break;
case IBuildMacroProvider.CONTEXT_ECLIPSEENV:
- if(fData == null){
+ if (fData == null) {
return null;
}
break;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/ExplicitFileMacroCollector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/ExplicitFileMacroCollector.java
index 692369bdf5c..f7c523f87a7 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/ExplicitFileMacroCollector.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/ExplicitFileMacroCollector.java
@@ -24,50 +24,51 @@ import org.eclipse.cdt.utils.cdtvariables.SupplierBasedCdtVariableSubstitutor;
/**
* This class is used by the MacroResolver to collect and present
* the explicit file macros referenced in the given expression
- *
+ *
* @since 3.0
*/
public class ExplicitFileMacroCollector extends SupplierBasedCdtVariableSubstitutor {
- private static final String EMPTY_STRING = ""; //$NON-NLS-1$
-
+ private static final String EMPTY_STRING = ""; //$NON-NLS-1$
+
private List<ICdtVariable> fMacrosList = new ArrayList<ICdtVariable>();
-/* public ExplicitFileMacroCollector(int contextType, Object contextData){
- super(contextType, contextData, EMPTY_STRING, EMPTY_STRING);
- }
-*/
- public ExplicitFileMacroCollector(IMacroContextInfo contextInfo){
+ /* public ExplicitFileMacroCollector(int contextType, Object contextData){
+ super(contextType, contextData, EMPTY_STRING, EMPTY_STRING);
+ }
+ */
+ public ExplicitFileMacroCollector(IMacroContextInfo contextInfo) {
super(contextInfo, EMPTY_STRING, EMPTY_STRING);
}
-/*
- public ExplicitFileMacroCollector(ITool tool){
- super(null, EMPTY_STRING, EMPTY_STRING);
- IBuildObject bo = tool.getParent();
- IConfiguration cfg = null;
- if(bo instanceof IResourceConfiguration)
- cfg = ((IResourceConfiguration)bo).getParent();
- else if (bo instanceof IToolChain)
- cfg = ((IToolChain)bo).getParent();
- try{
- setMacroContextInfo(IBuildMacroProvider.CONTEXT_CONFIGURATION,cfg);
- }catch (BuildMacroException e){
+
+ /*
+ public ExplicitFileMacroCollector(ITool tool){
+ super(null, EMPTY_STRING, EMPTY_STRING);
+ IBuildObject bo = tool.getParent();
+ IConfiguration cfg = null;
+ if(bo instanceof IResourceConfiguration)
+ cfg = ((IResourceConfiguration)bo).getParent();
+ else if (bo instanceof IToolChain)
+ cfg = ((IToolChain)bo).getParent();
+ try{
+ setMacroContextInfo(IBuildMacroProvider.CONTEXT_CONFIGURATION,cfg);
+ }catch (BuildMacroException e){
+ }
}
- }
-*/
+ */
/* (non-Javadoc)
*/
@Override
- protected ResolvedMacro resolveMacro(ICdtVariable macro) throws CdtVariableException{
- if(macro instanceof MbsMacroSupplier.FileContextMacro){
- MbsMacroSupplier.FileContextMacro fileMacro = (MbsMacroSupplier.FileContextMacro)macro;
- if(fileMacro.isExplicit())
+ protected ResolvedMacro resolveMacro(ICdtVariable macro) throws CdtVariableException {
+ if (macro instanceof MbsMacroSupplier.FileContextMacro) {
+ MbsMacroSupplier.FileContextMacro fileMacro = (MbsMacroSupplier.FileContextMacro) macro;
+ if (fileMacro.isExplicit())
fMacrosList.add(macro);
return null;
}
return super.resolveMacro(macro);
}
-
- public IBuildMacro[] getExplicisFileMacros(){
+
+ public IBuildMacro[] getExplicisFileMacros() {
return fMacrosList.toArray(new IBuildMacro[fMacrosList.size()]);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/FileContextBuildMacroValues.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/FileContextBuildMacroValues.java
index c1e60f72655..d8a332d0887 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/FileContextBuildMacroValues.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/FileContextBuildMacroValues.java
@@ -26,8 +26,7 @@ import org.eclipse.cdt.managedbuilder.macros.IFileContextBuildMacroValues;
* The implementation of the IFileContextBuildMacroValues interface
* @since 3.0
*/
-public class FileContextBuildMacroValues implements
- IFileContextBuildMacroValues, Cloneable {
+public class FileContextBuildMacroValues implements IFileContextBuildMacroValues, Cloneable {
private IBuilder fBuilder;
private IFileContextBuildMacroValues fSupperClassValues;
@@ -36,40 +35,40 @@ public class FileContextBuildMacroValues implements
private HashMap<String, String> fAllValues = new HashMap<String, String>();
private boolean fInitialized;
- public FileContextBuildMacroValues(IBuilder builder, IManagedConfigElement element){
+ public FileContextBuildMacroValues(IBuilder builder, IManagedConfigElement element) {
fBuilder = builder;
load(element);
}
- private void load(IManagedConfigElement element){
+ private void load(IManagedConfigElement element) {
String names[] = MbsMacroSupplier.getInstance().getMacroNames(IBuildMacroProvider.CONTEXT_FILE);
fValues.clear();
- for(int i = 0; i < names.length; i++){
+ for (int i = 0; i < names.length; i++) {
String value = element.getAttribute(PREFIX + names[i] + SUFFIX);
- if(value != null)
- fValues.put(names[i],value);
+ if (value != null)
+ fValues.put(names[i], value);
}
}
- private void load(){
- if(!fInitialized){
+ private void load() {
+ if (!fInitialized) {
fAllValues.clear();
IFileContextBuildMacroValues supperValues = getSupperClassValues();
- if(supperValues != null) {
+ if (supperValues != null) {
String names[] = MbsMacroSupplier.getInstance().getMacroNames(IBuildMacroProvider.CONTEXT_FILE);
- for(int i = 0; i < names.length; i++){
+ for (int i = 0; i < names.length; i++) {
String value = fValues.get(names[i]);
- if(value == null)
+ if (value == null)
value = supperValues.getMacroValue(names[i]);
- if(value != null && value.length() > 0)
- fAllValues.put(names[i],value);
+ if (value != null && value.length() > 0)
+ fAllValues.put(names[i], value);
}
} else {
Set<Entry<String, String>> entrySet = fValues.entrySet();
for (Entry<String, String> entry : entrySet) {
String value = entry.getValue();
- if(value != null && value.length() > 0)
- fAllValues.put(entry.getKey(),value);
+ if (value != null && value.length() > 0)
+ fAllValues.put(entry.getKey(), value);
}
}
fInitialized = true;
@@ -96,16 +95,16 @@ public class FileContextBuildMacroValues implements
return fAllValues.get(macroName);
}
- public IFileContextBuildMacroValues getSupperClassValues(){
- if(fBuilder != null){
+ public IFileContextBuildMacroValues getSupperClassValues() {
+ if (fBuilder != null) {
IBuilder supperClass = fBuilder.getSuperClass();
- if(supperClass != null)
+ if (supperClass != null)
fSupperClassValues = supperClass.getFileContextBuildMacroValues();
}
return fSupperClassValues;
}
- public void setBuilder(IBuilder builder){
+ public void setBuilder(IBuilder builder) {
fBuilder = builder;
fInitialized = false;
}
@@ -115,13 +114,13 @@ public class FileContextBuildMacroValues implements
*/
@SuppressWarnings("unchecked")
@Override
- public Object clone(){
+ public Object clone() {
FileContextBuildMacroValues cloned = null;
- try{
- cloned = (FileContextBuildMacroValues)super.clone();
- cloned.fValues = (HashMap<String, String>)fValues.clone();
- cloned.fAllValues = (HashMap<String, String>)fAllValues.clone();
- } catch (CloneNotSupportedException e){
+ try {
+ cloned = (FileContextBuildMacroValues) super.clone();
+ cloned.fValues = (HashMap<String, String>) fValues.clone();
+ cloned.fAllValues = (HashMap<String, String>) fAllValues.clone();
+ } catch (CloneNotSupportedException e) {
}
return cloned;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/FileContextData.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/FileContextData.java
index a32d2ea337e..f72197f3f7e 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/FileContextData.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/FileContextData.java
@@ -29,11 +29,12 @@ public class FileContextData implements IFileContextData {
private IPath fOutputFileLocation;
private IOptionContextData fOptionContextData;
- public FileContextData(IPath inputFileLocation, IPath outputFileLocation, IOption option, IBuildObject optionParent){
- this(inputFileLocation, outputFileLocation, new OptionContextData(option,optionParent));
+ public FileContextData(IPath inputFileLocation, IPath outputFileLocation, IOption option,
+ IBuildObject optionParent) {
+ this(inputFileLocation, outputFileLocation, new OptionContextData(option, optionParent));
}
- public FileContextData(IPath inputFileLocation, IPath outputFileLocation, IOptionContextData optionContextData){
+ public FileContextData(IPath inputFileLocation, IPath outputFileLocation, IOptionContextData optionContextData) {
fInputFileLocation = inputFileLocation;
fOutputFileLocation = outputFileLocation;
fOptionContextData = optionContextData;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/IMacroContextInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/IMacroContextInfo.java
index 5c0b7b48fad..2c90b22c079 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/IMacroContextInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/IMacroContextInfo.java
@@ -17,20 +17,20 @@ import org.eclipse.cdt.utils.cdtvariables.IVariableContextInfo;
/**
* This interface represents the context information.
- *
+ *
* @since 3.0
*/
-public interface IMacroContextInfo extends IVariableContextInfo{
+public interface IMacroContextInfo extends IVariableContextInfo {
/**
* returns the context type
- *
+ *
* @return int
*/
public int getContextType();
/**
* returns the context data
- *
+ *
* @return Object
*/
public Object getContextData();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/IMacroContextInfoProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/IMacroContextInfoProvider.java
index 973ec0def59..bd1cdcd8028 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/IMacroContextInfoProvider.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/IMacroContextInfoProvider.java
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.internal.macros;
-
public interface IMacroContextInfoProvider {
IMacroContextInfo getMacroContextInfo(int type, Object context);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/MbsMacroSupplier.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/MbsMacroSupplier.java
index aca1a6beef3..2872e375c94 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/MbsMacroSupplier.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/MbsMacroSupplier.java
@@ -54,83 +54,80 @@ import org.osgi.framework.Version;
*/
public class MbsMacroSupplier extends BuildCdtVariablesSupplierBase {
private static MbsMacroSupplier fInstance;
- public final static String DOT = "."; //$NON-NLS-1$
+ public final static String DOT = "."; //$NON-NLS-1$
public final static String EMPTY_STRING = ""; //$NON-NLS-1$
-
- private static final String fFileMacros[] = new String[]{
- "InputFileName", //$NON-NLS-1$
- "InputFileExt", //$NON-NLS-1$
- "InputFileBaseName", //$NON-NLS-1$
- "InputFileRelPath", //$NON-NLS-1$
- "InputDirRelPath", //$NON-NLS-1$
- "OutputFileName", //$NON-NLS-1$
- "OutputFileExt", //$NON-NLS-1$
- "OutputFileBaseName", //$NON-NLS-1$
- "OutputFileRelPath", //$NON-NLS-1$
- "OutputDirRelPath", //$NON-NLS-1$
+ private static final String fFileMacros[] = new String[] { "InputFileName", //$NON-NLS-1$
+ "InputFileExt", //$NON-NLS-1$
+ "InputFileBaseName", //$NON-NLS-1$
+ "InputFileRelPath", //$NON-NLS-1$
+ "InputDirRelPath", //$NON-NLS-1$
+ "OutputFileName", //$NON-NLS-1$
+ "OutputFileExt", //$NON-NLS-1$
+ "OutputFileBaseName", //$NON-NLS-1$
+ "OutputFileRelPath", //$NON-NLS-1$
+ "OutputDirRelPath", //$NON-NLS-1$
};
- private static final String fOptionMacros[] = new String[]{
- "IncludeDefaults", //$NON-NLS-1$
- "ParentVersion", //$NON-NLS-1$
+ private static final String fOptionMacros[] = new String[] { "IncludeDefaults", //$NON-NLS-1$
+ "ParentVersion", //$NON-NLS-1$
};
- private static final String fToolMacros[] = new String[]{
- "ToolVersion", //$NON-NLS-1$
+ private static final String fToolMacros[] = new String[] { "ToolVersion", //$NON-NLS-1$
};
- private static final String fConfigurationMacros[] = new String[]{
-// CdtVariableResolver.VAR_CONFIG_NAME,
-// CdtVariableResolver.VAR_CONFIG_DESCRIPTION,
- "BuildArtifactFileName", //$NON-NLS-1$
- "BuildArtifactFileExt", //$NON-NLS-1$
- "BuildArtifactFileBaseName", //$NON-NLS-1$
- "BuildArtifactFilePrefix", //$NON-NLS-1$
- "TargetOsList", //$NON-NLS-1$
- "TargetArchList", //$NON-NLS-1$
- "ToolChainVersion", //$NON-NLS-1$
- "BuilderVersion", //$NON-NLS-1$
+ private static final String fConfigurationMacros[] = new String[] {
+ // CdtVariableResolver.VAR_CONFIG_NAME,
+ // CdtVariableResolver.VAR_CONFIG_DESCRIPTION,
+ "BuildArtifactFileName", //$NON-NLS-1$
+ "BuildArtifactFileExt", //$NON-NLS-1$
+ "BuildArtifactFileBaseName", //$NON-NLS-1$
+ "BuildArtifactFilePrefix", //$NON-NLS-1$
+ "TargetOsList", //$NON-NLS-1$
+ "TargetArchList", //$NON-NLS-1$
+ "ToolChainVersion", //$NON-NLS-1$
+ "BuilderVersion", //$NON-NLS-1$
};
- private static final String fProjectMacros[] = new String[]{
-// CdtVariableResolver.VAR_PROJ_NAME,
-// CdtVariableResolver.VAR_PROJ_DIR_PATH,
+ private static final String fProjectMacros[] = new String[] {
+ // CdtVariableResolver.VAR_PROJ_NAME,
+ // CdtVariableResolver.VAR_PROJ_DIR_PATH,
};
- private static final String fWorkspaceMacros[] = new String[]{
-// CdtVariableResolver.VAR_WORKSPACE_DIR_PATH,
-// CdtVariableResolver.VAR_DIRECTORY_DELIMITER,
-// CdtVariableResolver.VAR_PATH_DELIMITER,
+ private static final String fWorkspaceMacros[] = new String[] {
+ // CdtVariableResolver.VAR_WORKSPACE_DIR_PATH,
+ // CdtVariableResolver.VAR_DIRECTORY_DELIMITER,
+ // CdtVariableResolver.VAR_PATH_DELIMITER,
};
- private static final String fCDTEclipseMacros[] = new String[]{
-// CdtVariableResolver.VAR_ECLIPSE_VERSION,
-// CdtVariableResolver.VAR_CDT_VERSION,
- "MBSVersion", //$NON-NLS-1$
-// CdtVariableResolver.VAR_HOST_OS_NAME,
-// CdtVariableResolver.VAR_HOST_ARCH_NAME,
-// CdtVariableResolver.VAR_HOST_OS_TYPE,
-// CdtVariableResolver.VAR_HOST_ARCH_TYPE,
+ private static final String fCDTEclipseMacros[] = new String[] {
+ // CdtVariableResolver.VAR_ECLIPSE_VERSION,
+ // CdtVariableResolver.VAR_CDT_VERSION,
+ "MBSVersion", //$NON-NLS-1$
+ // CdtVariableResolver.VAR_HOST_OS_NAME,
+ // CdtVariableResolver.VAR_HOST_ARCH_NAME,
+ // CdtVariableResolver.VAR_HOST_OS_TYPE,
+ // CdtVariableResolver.VAR_HOST_ARCH_TYPE,
};
private class OptionData extends OptionContextData {
private IBuildObject fOptionContainer;
- public OptionData(IOption option, IBuildObject parent, IBuildObject optionContainer) {
+
+ public OptionData(IOption option, IBuildObject parent, IBuildObject optionContainer) {
super(option, parent);
fOptionContainer = optionContainer;
}
- public IBuildObject getOptionContainer(){
+ public IBuildObject getOptionContainer() {
return fOptionContainer;
}
}
- public class FileContextMacro extends BuildMacro{
-// private IFileContextData fContextData;
-// private IConfiguration fConfiguration;
+ public class FileContextMacro extends BuildMacro {
+ // private IFileContextData fContextData;
+ // private IConfiguration fConfiguration;
//TODO: initialize builder
-// private IBuilder fBuilder;
+ // private IBuilder fBuilder;
private boolean fIsExplicit = true;
private boolean fIsInitialized;
private String fExplicitValue;
@@ -138,54 +135,55 @@ public class MbsMacroSupplier extends BuildCdtVariablesSupplierBase {
private IPath fInputFileLocation;
private IPath fOutputFileLocation;
- private FileContextMacro(String name, IFileContextData contextData){
+ private FileContextMacro(String name, IFileContextData contextData) {
fName = name;
fType = VALUE_TEXT;
loadValue(contextData);
-// fContextData = contextData;
+ // fContextData = contextData;
}
- private void loadValue(IFileContextData contextData){
- if(fIsInitialized)
+ private void loadValue(IFileContextData contextData) {
+ if (fIsInitialized)
return;
IBuilder builder = null;
IConfiguration configuration = null;
IOptionContextData optionContext = contextData.getOptionContextData();
- if(optionContext != null){
+ if (optionContext != null) {
IBuildObject buildObject = optionContext.getParent();
- if(buildObject instanceof ITool){
- buildObject = ((ITool)buildObject).getParent();
- } else if(buildObject instanceof IConfiguration){
- buildObject = ((IConfiguration)buildObject).getToolChain();
+ if (buildObject instanceof ITool) {
+ buildObject = ((ITool) buildObject).getParent();
+ } else if (buildObject instanceof IConfiguration) {
+ buildObject = ((IConfiguration) buildObject).getToolChain();
}
- if(buildObject instanceof IToolChain){
- IToolChain toolChain = (IToolChain)buildObject;
+ if (buildObject instanceof IToolChain) {
+ IToolChain toolChain = (IToolChain) buildObject;
builder = toolChain.getBuilder();
configuration = toolChain.getParent();
- } else if (buildObject instanceof IResourceInfo){
- configuration = ((IResourceInfo)buildObject).getParent();
- if(configuration != null){
+ } else if (buildObject instanceof IResourceInfo) {
+ configuration = ((IResourceInfo) buildObject).getParent();
+ if (configuration != null) {
IToolChain toolChain = configuration.getToolChain();
- if(toolChain != null)
+ if (toolChain != null)
builder = toolChain.getBuilder();
}
}
}
- if(builder != null){
+ if (builder != null) {
IFileContextBuildMacroValues values = builder.getFileContextBuildMacroValues();
String value = values.getMacroValue(fName);
- if(value != null){
+ if (value != null) {
fStringValue = value;
fIsExplicit = false;
}
}
- if(fStringValue == null){
+ if (fStringValue == null) {
fIsExplicit = true;
- fStringValue = getExplicitFileMacroValue(fName, contextData.getInputFileLocation(), contextData.getOutputFileLocation(), builder, configuration);
+ fStringValue = getExplicitFileMacroValue(fName, contextData.getInputFileLocation(),
+ contextData.getOutputFileLocation(), builder, configuration);
fExplicitValue = fStringValue;
fIsExplicitResolved = true;
}
@@ -195,17 +193,18 @@ public class MbsMacroSupplier extends BuildCdtVariablesSupplierBase {
fIsInitialized = true;
}
- public String getExplicitMacroValue(IConfiguration configuration, IBuilder builder){
-// loadValue();
- if(!fIsExplicitResolved){
- fExplicitValue = getExplicitFileMacroValue(fName, fInputFileLocation, fOutputFileLocation, builder, configuration);
+ public String getExplicitMacroValue(IConfiguration configuration, IBuilder builder) {
+ // loadValue();
+ if (!fIsExplicitResolved) {
+ fExplicitValue = getExplicitFileMacroValue(fName, fInputFileLocation, fOutputFileLocation, builder,
+ configuration);
fIsExplicitResolved = true;
}
return fExplicitValue;
}
- public boolean isExplicit(){
-// loadValue();
+ public boolean isExplicit() {
+ // loadValue();
return fIsExplicit;
}
@@ -213,67 +212,68 @@ public class MbsMacroSupplier extends BuildCdtVariablesSupplierBase {
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacro#getStringValue()
*/
@Override
- public String getStringValue(){
-// loadValue();
+ public String getStringValue() {
+ // loadValue();
return fStringValue;
}
}
- private String getExplicitFileMacroValue(String name, IPath inputFileLocation, IPath outputFileLocation, IBuilder builder, IConfiguration cfg){
+ private String getExplicitFileMacroValue(String name, IPath inputFileLocation, IPath outputFileLocation,
+ IBuilder builder, IConfiguration cfg) {
String value = null;
- if("InputFileName".equals(name)){ //$NON-NLS-1$
- if(inputFileLocation != null && inputFileLocation.segmentCount() > 0)
+ if ("InputFileName".equals(name)) { //$NON-NLS-1$
+ if (inputFileLocation != null && inputFileLocation.segmentCount() > 0)
value = inputFileLocation.lastSegment();
- }else if("InputFileExt".equals(name)){ //$NON-NLS-1$
- if(inputFileLocation != null && inputFileLocation.segmentCount() > 0)
+ } else if ("InputFileExt".equals(name)) { //$NON-NLS-1$
+ if (inputFileLocation != null && inputFileLocation.segmentCount() > 0)
value = getExtension(inputFileLocation.lastSegment());
- }else if("InputFileBaseName".equals(name)){ //$NON-NLS-1$
- if(inputFileLocation != null && inputFileLocation.segmentCount() > 0)
+ } else if ("InputFileBaseName".equals(name)) { //$NON-NLS-1$
+ if (inputFileLocation != null && inputFileLocation.segmentCount() > 0)
value = getBaseName(inputFileLocation.lastSegment());
- }else if("InputFileRelPath".equals(name)){ //$NON-NLS-1$
- if(inputFileLocation != null && inputFileLocation.segmentCount() > 0){
+ } else if ("InputFileRelPath".equals(name)) { //$NON-NLS-1$
+ if (inputFileLocation != null && inputFileLocation.segmentCount() > 0) {
IPath workingDirectory = getBuilderCWD(builder, cfg);
- if(workingDirectory != null){
+ if (workingDirectory != null) {
IPath filePath = ManagedBuildManager.calculateRelativePath(workingDirectory, inputFileLocation);
- if(filePath != null)
+ if (filePath != null)
value = filePath.toOSString();
}
}
- }
- else if("InputDirRelPath".equals(name)){ //$NON-NLS-1$
- if(inputFileLocation != null && inputFileLocation.segmentCount() > 0){
+ } else if ("InputDirRelPath".equals(name)) { //$NON-NLS-1$
+ if (inputFileLocation != null && inputFileLocation.segmentCount() > 0) {
IPath workingDirectory = getBuilderCWD(builder, cfg);
- if(workingDirectory != null){
- IPath filePath = ManagedBuildManager.calculateRelativePath(workingDirectory, inputFileLocation.removeLastSegments(1).addTrailingSeparator());
- if(filePath != null)
+ if (workingDirectory != null) {
+ IPath filePath = ManagedBuildManager.calculateRelativePath(workingDirectory,
+ inputFileLocation.removeLastSegments(1).addTrailingSeparator());
+ if (filePath != null)
value = filePath.toOSString();
}
}
- }
- else if("OutputFileName".equals(name)){ //$NON-NLS-1$
- if(outputFileLocation != null && outputFileLocation.segmentCount() > 0)
+ } else if ("OutputFileName".equals(name)) { //$NON-NLS-1$
+ if (outputFileLocation != null && outputFileLocation.segmentCount() > 0)
value = outputFileLocation.lastSegment();
- }else if("OutputFileExt".equals(name)){ //$NON-NLS-1$
- if(outputFileLocation != null && outputFileLocation.segmentCount() > 0)
+ } else if ("OutputFileExt".equals(name)) { //$NON-NLS-1$
+ if (outputFileLocation != null && outputFileLocation.segmentCount() > 0)
value = getExtension(outputFileLocation.lastSegment());
- }else if("OutputFileBaseName".equals(name)){ //$NON-NLS-1$
- if(outputFileLocation != null && outputFileLocation.segmentCount() > 0)
+ } else if ("OutputFileBaseName".equals(name)) { //$NON-NLS-1$
+ if (outputFileLocation != null && outputFileLocation.segmentCount() > 0)
value = getBaseName(outputFileLocation.lastSegment());
- }else if("OutputFileRelPath".equals(name)){ //$NON-NLS-1$
- if(outputFileLocation != null && outputFileLocation.segmentCount() > 0){
+ } else if ("OutputFileRelPath".equals(name)) { //$NON-NLS-1$
+ if (outputFileLocation != null && outputFileLocation.segmentCount() > 0) {
IPath workingDirectory = getBuilderCWD(builder, cfg);
- if(workingDirectory != null){
+ if (workingDirectory != null) {
IPath filePath = ManagedBuildManager.calculateRelativePath(workingDirectory, outputFileLocation);
- if(filePath != null)
+ if (filePath != null)
value = filePath.toOSString();
}
}
- }else if("OutputDirRelPath".equals(name)){ //$NON-NLS-1$
- if(outputFileLocation != null && outputFileLocation.segmentCount() > 0){
+ } else if ("OutputDirRelPath".equals(name)) { //$NON-NLS-1$
+ if (outputFileLocation != null && outputFileLocation.segmentCount() > 0) {
IPath workingDirectory = getBuilderCWD(builder, cfg);
- if(workingDirectory != null){
- IPath filePath = ManagedBuildManager.calculateRelativePath(workingDirectory, outputFileLocation.removeLastSegments(1).addTrailingSeparator());
- if(filePath != null)
+ if (workingDirectory != null) {
+ IPath filePath = ManagedBuildManager.calculateRelativePath(workingDirectory,
+ outputFileLocation.removeLastSegments(1).addTrailingSeparator());
+ if (filePath != null)
value = filePath.toOSString();
}
}
@@ -282,13 +282,13 @@ public class MbsMacroSupplier extends BuildCdtVariablesSupplierBase {
return value;
}
- public String[] getMacroNames(int contextType){
- return getMacroNames(contextType,true);
+ public String[] getMacroNames(int contextType) {
+ return getMacroNames(contextType, true);
}
- private String[] getMacroNames(int contextType, boolean clone){
+ private String[] getMacroNames(int contextType, boolean clone) {
String names[] = null;
- switch(contextType){
+ switch (contextType) {
case IBuildMacroProvider.CONTEXT_FILE:
names = fFileMacros;
break;
@@ -313,17 +313,17 @@ public class MbsMacroSupplier extends BuildCdtVariablesSupplierBase {
case IBuildMacroProvider.CONTEXT_ECLIPSEENV:
break;
}
- if(names != null)
- return clone ? (String[])names.clone() : names;
+ if (names != null)
+ return clone ? (String[]) names.clone() : names;
return null;
}
- private MbsMacroSupplier(){
+ private MbsMacroSupplier() {
}
- public static MbsMacroSupplier getInstance(){
- if(fInstance == null)
+ public static MbsMacroSupplier getInstance() {
+ if (fInstance == null)
fInstance = new MbsMacroSupplier();
return fInstance;
}
@@ -332,56 +332,55 @@ public class MbsMacroSupplier extends BuildCdtVariablesSupplierBase {
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroSupplier#getMacro(java.lang.String, int, java.lang.Object)
*/
@Override
- public IBuildMacro getMacro(String macroName, int contextType,
- Object contextData) {
+ public IBuildMacro getMacro(String macroName, int contextType, Object contextData) {
IBuildMacro macro = null;
- switch(contextType){
+ switch (contextType) {
case IBuildMacroProvider.CONTEXT_FILE:
- if(contextData instanceof IFileContextData){
- for(int i = 0; i < fFileMacros.length; i++){
- if(macroName.equals(fFileMacros[i])){
- macro = new FileContextMacro(macroName,(IFileContextData)contextData);
+ if (contextData instanceof IFileContextData) {
+ for (int i = 0; i < fFileMacros.length; i++) {
+ if (macroName.equals(fFileMacros[i])) {
+ macro = new FileContextMacro(macroName, (IFileContextData) contextData);
break;
}
}
}
break;
case IBuildMacroProvider.CONTEXT_OPTION:
- if(contextData instanceof IOptionContextData){
- macro = getMacro(macroName, (IOptionContextData)contextData);
+ if (contextData instanceof IOptionContextData) {
+ macro = getMacro(macroName, (IOptionContextData) contextData);
}
break;
case IBuildMacroProvider.CONTEXT_TOOL:
- if(contextData instanceof ITool){
- macro = getMacro(macroName, (ITool)contextData);
+ if (contextData instanceof ITool) {
+ macro = getMacro(macroName, (ITool) contextData);
}
break;
case IBuildMacroProvider.CONTEXT_CONFIGURATION:
IConfiguration cfg = null;
IBuilder builder = null;
- if(contextData instanceof IConfiguration){
- cfg = (IConfiguration)contextData;
+ if (contextData instanceof IConfiguration) {
+ cfg = (IConfiguration) contextData;
builder = cfg.getBuilder();
- } else if (contextData instanceof IBuilder){
- builder = (IBuilder)contextData;
+ } else if (contextData instanceof IBuilder) {
+ builder = (IBuilder) contextData;
cfg = builder.getParent().getParent();
}
- if(cfg != null)
+ if (cfg != null)
macro = getMacro(macroName, builder, cfg);
break;
case IBuildMacroProvider.CONTEXT_PROJECT:
- if(contextData instanceof IManagedProject){
- macro = getMacro(macroName, (IManagedProject)contextData);
+ if (contextData instanceof IManagedProject) {
+ macro = getMacro(macroName, (IManagedProject) contextData);
}
break;
case IBuildMacroProvider.CONTEXT_WORKSPACE:
- if(contextData instanceof IWorkspace){
- macro = getMacro(macroName, (IWorkspace)contextData);
+ if (contextData instanceof IWorkspace) {
+ macro = getMacro(macroName, (IWorkspace) contextData);
}
break;
case IBuildMacroProvider.CONTEXT_INSTALLATIONS:
- if(contextData == null){
+ if (contextData == null) {
macro = getMacro(macroName);
}
break;
@@ -392,54 +391,49 @@ public class MbsMacroSupplier extends BuildCdtVariablesSupplierBase {
return macro;
}
- public IBuildMacro getMacro(String macroName, IOptionContextData optionContext){
+ public IBuildMacro getMacro(String macroName, IOptionContextData optionContext) {
IBuildMacro macro = null;
- if("IncludeDefaults".equals(macroName)){ //$NON-NLS-1$
- if(!canHandle(optionContext))
+ if ("IncludeDefaults".equals(macroName)) { //$NON-NLS-1$
+ if (!canHandle(optionContext))
optionContext = null;
- macro = new OptionMacro(macroName,optionContext);
- } else if("ParentVersion".equals(macroName)){ //$NON-NLS-1$
+ macro = new OptionMacro(macroName, optionContext);
+ } else if ("ParentVersion".equals(macroName)) { //$NON-NLS-1$
IHoldsOptions holder = OptionContextData.getHolder(optionContext);
- if(holder != null && holder.getVersion() != null)
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,holder.getVersion().toString());
+ if (holder != null && holder.getVersion() != null)
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_TEXT, holder.getVersion().toString());
}
return macro;
}
- public IBuildMacro getMacro(String macroName, ITool tool){
+ public IBuildMacro getMacro(String macroName, ITool tool) {
IBuildMacro macro = null;
- if("ToolVersion".equals(macroName) && tool.getVersion() != null){ //$NON-NLS-1$
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,tool.getVersion().toString());
+ if ("ToolVersion".equals(macroName) && tool.getVersion() != null) { //$NON-NLS-1$
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_TEXT, tool.getVersion().toString());
}
return macro;
}
- public IBuildMacro getMacro(String macroName, IBuilder builder, IConfiguration cfg){
+ public IBuildMacro getMacro(String macroName, IBuilder builder, IConfiguration cfg) {
IBuildMacro macro = null;
if (CdtVariableResolver.VAR_CONFIG_NAME.equals(macroName)) {
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,cfg.getName());
- }
- else if (CdtVariableResolver.VAR_CONFIG_DESCRIPTION.equals(macroName)){
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,cfg.getDescription());
- }
- else if("BuildArtifactFileName".equals(macroName)){ //$NON-NLS-1$
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_TEXT, cfg.getName());
+ } else if (CdtVariableResolver.VAR_CONFIG_DESCRIPTION.equals(macroName)) {
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_TEXT, cfg.getDescription());
+ } else if ("BuildArtifactFileName".equals(macroName)) { //$NON-NLS-1$
String name = cfg.getArtifactName();
String ext = cfg.getArtifactExtension();
- if(ext != null && !EMPTY_STRING.equals(ext))
+ if (ext != null && !EMPTY_STRING.equals(ext))
name = name + DOT + ext;
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,name);
- }
- else if("BuildArtifactFileExt".equals(macroName)){ //$NON-NLS-1$
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_TEXT, name);
+ } else if ("BuildArtifactFileExt".equals(macroName)) { //$NON-NLS-1$
String ext = cfg.getArtifactExtension();
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,ext);
- }
- else if("BuildArtifactFileBaseName".equals(macroName)){ //$NON-NLS-1$
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_TEXT, ext);
+ } else if ("BuildArtifactFileBaseName".equals(macroName)) { //$NON-NLS-1$
String name = cfg.getArtifactName();
ITool targetTool = cfg.calculateTargetTool();
- if(targetTool != null){
+ if (targetTool != null) {
IOutputType pot = targetTool.getPrimaryOutputType();
- String prefix = pot != null ? pot.getOutputPrefix() : ""; //$NON-NLS-1$
-
+ String prefix = pot != null ? pot.getOutputPrefix() : ""; //$NON-NLS-1$
// Resolve any macros in the outputPrefix
// Note that we cannot use file macros because if we do a clean
@@ -456,32 +450,24 @@ public class MbsMacroSupplier extends BuildCdtVariablesSupplierBase {
config = (IConfiguration) toolParent;
else if (toolParent instanceof IToolChain) {
// must be a toolchain
- config = ((IToolChain) toolParent)
- .getParent();
+ config = ((IToolChain) toolParent).getParent();
}
else if (toolParent instanceof IResourceConfiguration) {
- config = ((IResourceConfiguration) toolParent)
- .getParent();
+ config = ((IResourceConfiguration) toolParent).getParent();
}
else {
// bad
- throw new AssertionError(
- ManagedMakeMessages.getResourceString("MbsMacroSupplier.1")); //$NON-NLS-1$
+ throw new AssertionError(ManagedMakeMessages.getResourceString("MbsMacroSupplier.1")); //$NON-NLS-1$
}
if (config != null) {
try {
- prefix = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveValueToMakefileFormat(
- prefix,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- config);
+ prefix = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(prefix, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, config);
}
catch (BuildMacroException e) {
@@ -489,17 +475,15 @@ public class MbsMacroSupplier extends BuildCdtVariablesSupplierBase {
}
-
- if(prefix != null && !EMPTY_STRING.equals(prefix))
+ if (prefix != null && !EMPTY_STRING.equals(prefix))
name = prefix + name;
}
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,name);
- }
- else if("BuildArtifactFilePrefix".equals(macroName)){ //$NON-NLS-1$
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_TEXT, name);
+ } else if ("BuildArtifactFilePrefix".equals(macroName)) { //$NON-NLS-1$
ITool targetTool = cfg.calculateTargetTool();
- if(targetTool != null){
+ if (targetTool != null) {
IOutputType pot = targetTool.getPrimaryOutputType();
- String prefix = pot != null ? pot.getOutputPrefix() : ""; //$NON-NLS-1$
+ String prefix = pot != null ? pot.getOutputPrefix() : ""; //$NON-NLS-1$
// Resolve any macros in the outputPrefix
// Note that we cannot use file macros because if we do a clean
@@ -516,32 +500,24 @@ public class MbsMacroSupplier extends BuildCdtVariablesSupplierBase {
config = (IConfiguration) toolParent;
else if (toolParent instanceof IToolChain) {
// must be a toolchain
- config = ((IToolChain) toolParent)
- .getParent();
+ config = ((IToolChain) toolParent).getParent();
}
else if (toolParent instanceof IResourceConfiguration) {
- config = ((IResourceConfiguration) toolParent)
- .getParent();
+ config = ((IResourceConfiguration) toolParent).getParent();
}
else {
// bad
- throw new AssertionError(
- ManagedMakeMessages.getResourceString("MbsMacroSupplier.2")); //$NON-NLS-1$
+ throw new AssertionError(ManagedMakeMessages.getResourceString("MbsMacroSupplier.2")); //$NON-NLS-1$
}
if (config != null) {
try {
- prefix = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveValueToMakefileFormat(
- prefix,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- config);
+ prefix = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(prefix, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, config);
}
catch (BuildMacroException e) {
@@ -549,151 +525,141 @@ public class MbsMacroSupplier extends BuildCdtVariablesSupplierBase {
}
- if(prefix == null)
+ if (prefix == null)
prefix = EMPTY_STRING;
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,prefix);
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_TEXT, prefix);
}
- }
- else if("TargetOsList".equals(macroName)){ //$NON-NLS-1$
+ } else if ("TargetOsList".equals(macroName)) { //$NON-NLS-1$
IToolChain toolChain = cfg.getToolChain();
String osList[] = toolChain.getOSList();
- if(osList == null)
+ if (osList == null)
osList = new String[0];
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT_LIST,osList);
- }
- else if("TargetArchList".equals(macroName)){ //$NON-NLS-1$
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_TEXT_LIST, osList);
+ } else if ("TargetArchList".equals(macroName)) { //$NON-NLS-1$
IToolChain toolChain = cfg.getToolChain();
String archList[] = toolChain.getArchList();
- if(archList == null)
+ if (archList == null)
archList = new String[0];
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT_LIST,archList);
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_TEXT_LIST, archList);
- }
- else if("ToolChainVersion".equals(macroName)){ //$NON-NLS-1$
- if(cfg.getToolChain().getVersion() != null)
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,cfg.getToolChain().getVersion().toString());
- }
- else if("BuilderVersion".equals(macroName)){ //$NON-NLS-1$
+ } else if ("ToolChainVersion".equals(macroName)) { //$NON-NLS-1$
+ if (cfg.getToolChain().getVersion() != null)
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_TEXT, cfg.getToolChain().getVersion().toString());
+ } else if ("BuilderVersion".equals(macroName)) { //$NON-NLS-1$
Version version = cfg.getToolChain().getBuilder().getVersion();
- if(version != null)
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,version.toString());
+ if (version != null)
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_TEXT, version.toString());
}
return macro;
}
- private String getBaseName(String name){
+ private String getBaseName(String name) {
String value = null;
int index = name.lastIndexOf('.');
- if(index == -1)
+ if (index == -1)
value = name;
else
- value = name.substring(0,index);
+ value = name.substring(0, index);
return value;
}
- private String getExtension(String name){
+ private String getExtension(String name) {
String value = null;
int index = name.lastIndexOf('.');
- if(index != -1)
- value = name.substring(index+1);
+ if (index != -1)
+ value = name.substring(index + 1);
return value;
}
- public IBuildMacro getMacro(String macroName, IManagedProject mngProj){
+ public IBuildMacro getMacro(String macroName, IManagedProject mngProj) {
IBuildMacro macro = null;
- if(CdtVariableResolver.VAR_PROJ_NAME.equals(macroName)){
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,mngProj.getOwner().getName());
- }
- else if(CdtVariableResolver.VAR_PROJ_DIR_PATH.equals(macroName)){
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_PATH_DIR,mngProj.getOwner().getLocation().toOSString());
+ if (CdtVariableResolver.VAR_PROJ_NAME.equals(macroName)) {
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_TEXT, mngProj.getOwner().getName());
+ } else if (CdtVariableResolver.VAR_PROJ_DIR_PATH.equals(macroName)) {
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_PATH_DIR,
+ mngProj.getOwner().getLocation().toOSString());
}
return macro;
}
- public IBuildMacro getMacro(String macroName, IWorkspace wsp){
+ public IBuildMacro getMacro(String macroName, IWorkspace wsp) {
IBuildMacro macro = null;
if (CdtVariableResolver.VAR_WORKSPACE_DIR_PATH.equals(macroName)) {
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_PATH_DIR,wsp.getRoot().getLocation().toOSString());
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_PATH_DIR, wsp.getRoot().getLocation().toOSString());
} else if (CdtVariableResolver.VAR_DIRECTORY_DELIMITER.equals(macroName)) {
- if(isWin32()){
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,"\\"); //$NON-NLS-1$
+ if (isWin32()) {
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_TEXT, "\\"); //$NON-NLS-1$
} else {
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,"/"); //$NON-NLS-1$
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_TEXT, "/"); //$NON-NLS-1$
}
} else if (CdtVariableResolver.VAR_PATH_DELIMITER.equals(macroName)) {
- if(isWin32()){
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,";"); //$NON-NLS-1$
+ if (isWin32()) {
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_TEXT, ";"); //$NON-NLS-1$
} else {
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,":"); //$NON-NLS-1$
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_TEXT, ":"); //$NON-NLS-1$
}
}
return macro;
}
- private boolean isWin32(){
+ private boolean isWin32() {
String os = System.getProperty("os.name").toLowerCase(); //$NON-NLS-1$
if (os.startsWith("windows ")) //$NON-NLS-1$
return true;
return false;
}
- public IBuildMacro getMacro(String macroName){
+ public IBuildMacro getMacro(String macroName) {
IBuildMacro macro = null;
if (CdtVariableResolver.VAR_ECLIPSE_VERSION.equals(macroName)) {
- Bundle bundle = Platform.getBundle("org.eclipse.platform"); //$NON-NLS-1$
- String version = bundle != null ?
- (String)bundle.getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION) :
- null;
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,version);
- }
- else if (CdtVariableResolver.VAR_CDT_VERSION.equals(macroName)) {
- String version = CCorePlugin.getDefault().getBundle().getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION);
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,version);
- }
- else if ("MBSVersion".equals(macroName)) { //$NON-NLS-1$
+ Bundle bundle = Platform.getBundle("org.eclipse.platform"); //$NON-NLS-1$
+ String version = bundle != null
+ ? (String) bundle.getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION)
+ : null;
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_TEXT, version);
+ } else if (CdtVariableResolver.VAR_CDT_VERSION.equals(macroName)) {
+ String version = CCorePlugin.getDefault().getBundle().getHeaders()
+ .get(org.osgi.framework.Constants.BUNDLE_VERSION);
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_TEXT, version);
+ } else if ("MBSVersion".equals(macroName)) { //$NON-NLS-1$
String version = ManagedBuildManager.getBuildInfoVersion().toString();
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,version);
- }
- else if (CdtVariableResolver.VAR_HOST_OS_NAME.equals(macroName)) {
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_TEXT, version);
+ } else if (CdtVariableResolver.VAR_HOST_OS_NAME.equals(macroName)) {
String os = System.getProperty("os.name"); //$NON-NLS-1$
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,os);
- }
- else if (CdtVariableResolver.VAR_HOST_ARCH_NAME.equals(macroName)) {
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_TEXT, os);
+ } else if (CdtVariableResolver.VAR_HOST_ARCH_NAME.equals(macroName)) {
String arch = System.getProperty("os.arch"); //$NON-NLS-1$
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,arch);
- }
- else if (CdtVariableResolver.VAR_OS_TYPE.equals(macroName)) {
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_TEXT, arch);
+ } else if (CdtVariableResolver.VAR_OS_TYPE.equals(macroName)) {
String os = Platform.getOS();
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,os);
- }
- else if (CdtVariableResolver.VAR_ARCH_TYPE.equals(macroName)) {
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_TEXT, os);
+ } else if (CdtVariableResolver.VAR_ARCH_TYPE.equals(macroName)) {
String arch = Platform.getOSArch();
- macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,arch);
+ macro = new BuildMacro(macroName, IBuildMacro.VALUE_TEXT, arch);
}
return macro;
}
-
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroSupplier#getMacros(int, java.lang.Object)
*/
@Override
public IBuildMacro[] getMacros(int contextType, Object contextData) {
- String names[] = getMacroNames(contextType,false);
+ String names[] = getMacroNames(contextType, false);
- if(names != null){
+ if (names != null) {
IBuildMacro macros[] = new IBuildMacro[names.length];
int num = 0;
- for(int i = 0; i < names.length; i++){
- IBuildMacro macro = getMacro(names[i],contextType,contextData);
- if(macro != null)
+ for (int i = 0; i < names.length; i++) {
+ IBuildMacro macro = getMacro(names[i], contextType, contextData);
+ if (macro != null)
macros[num++] = macro;
}
- if(macros.length != num){
+ if (macros.length != num) {
IBuildMacro tmp[] = new IBuildMacro[num];
- if(num > 0)
- System.arraycopy(macros,0,tmp,0,num);
+ if (num > 0)
+ System.arraycopy(macros, 0, tmp, 0, num);
macros = tmp;
}
return macros;
@@ -701,7 +667,7 @@ public class MbsMacroSupplier extends BuildCdtVariablesSupplierBase {
return null;
}
- private IPath getBuilderCWD(IBuilder builder, IConfiguration cfg){
+ private IPath getBuilderCWD(IBuilder builder, IConfiguration cfg) {
return ManagedBuildManager.getBuildLocation(cfg, builder);
}
@@ -709,7 +675,8 @@ public class MbsMacroSupplier extends BuildCdtVariablesSupplierBase {
* Returns the option that matches the option ID in this tool
*/
public IOption getOption(ITool tool, String optionId) {
- if (optionId == null) return null;
+ if (optionId == null)
+ return null;
// Look for an option with this ID, or an option with a superclass with this id
IOption[] options = tool.getOptions();
@@ -730,57 +697,57 @@ public class MbsMacroSupplier extends BuildCdtVariablesSupplierBase {
private class IncludeDefaultsSubstitutor implements IVariableSubstitutor {
private IOptionContextData fOptionContextData;
- public IncludeDefaultsSubstitutor(IOptionContextData data){
+ public IncludeDefaultsSubstitutor(IOptionContextData data) {
fOptionContextData = data;
}
@Override
public String resolveToString(String macroName) throws CdtVariableException {
- if(!"IncludeDefaults".equals(macroName)) //$NON-NLS-1$
+ if (!"IncludeDefaults".equals(macroName)) //$NON-NLS-1$
return CdtVariableResolver.createVariableReference(macroName);
IOptionContextData parent = getParent(fOptionContextData);
- if(parent == null)
+ if (parent == null)
return EMPTY_STRING;
IncludeDefaultsSubstitutor sub = new IncludeDefaultsSubstitutor(parent);
IOption option = parent.getOption();
- if (option==null)
+ if (option == null)
return null;
String str = null;
String strL[] = null;
- try{
- switch(option.getBasicValueType()){
- case IOption.STRING :
+ try {
+ switch (option.getBasicValueType()) {
+ case IOption.STRING:
str = option.getStringValue();
break;
- case IOption.STRING_LIST :
+ case IOption.STRING_LIST:
strL = option.getBasicStringListValue();
break;
-// case IOption.INCLUDE_PATH :
-// strL = option.getIncludePaths();
-// break;
-// case IOption.PREPROCESSOR_SYMBOLS :
-// strL = option.getDefinedSymbols();
-// break;
-// case IOption.LIBRARIES :
-// strL = option.getLibraries();
-// break;
-// case IOption.OBJECTS :
-// strL = option.getUserObjects();
-// break;
- default :
+ // case IOption.INCLUDE_PATH :
+ // strL = option.getIncludePaths();
+ // break;
+ // case IOption.PREPROCESSOR_SYMBOLS :
+ // strL = option.getDefinedSymbols();
+ // break;
+ // case IOption.LIBRARIES :
+ // strL = option.getLibraries();
+ // break;
+ // case IOption.OBJECTS :
+ // strL = option.getUserObjects();
+ // break;
+ default:
break;
}
- if(str != null)
- return CdtVariableResolver.resolveToString(str,sub);
- else if(strL != null){
- strL = CdtVariableResolver.resolveStringListValues(strL,sub,true);
- return CdtVariableResolver.convertStringListToString(strL," "); //$NON-NLS-1$
+ if (str != null)
+ return CdtVariableResolver.resolveToString(str, sub);
+ else if (strL != null) {
+ strL = CdtVariableResolver.resolveStringListValues(strL, sub, true);
+ return CdtVariableResolver.convertStringListToString(strL, " "); //$NON-NLS-1$
}
- } catch (BuildException e){
+ } catch (BuildException e) {
- } catch (CdtVariableException e){
+ } catch (CdtVariableException e) {
}
return null;
@@ -788,75 +755,75 @@ public class MbsMacroSupplier extends BuildCdtVariablesSupplierBase {
@Override
public String[] resolveToStringList(String macroName) throws CdtVariableException {
- if(!"IncludeDefaults".equals(macroName)) //$NON-NLS-1$
- return new String[]{CdtVariableResolver.createVariableReference(macroName)};
+ if (!"IncludeDefaults".equals(macroName)) //$NON-NLS-1$
+ return new String[] { CdtVariableResolver.createVariableReference(macroName) };
IOptionContextData parent = getParent(fOptionContextData);
- if(parent == null)
- return new String[]{EMPTY_STRING};
+ if (parent == null)
+ return new String[] { EMPTY_STRING };
IncludeDefaultsSubstitutor sub = new IncludeDefaultsSubstitutor(parent);
IOption option = parent.getOption();
- if (option==null)
+ if (option == null)
return null;
String str = null;
String strL[] = null;
- try{
- switch(option.getBasicValueType()){
- case IOption.STRING :
+ try {
+ switch (option.getBasicValueType()) {
+ case IOption.STRING:
str = option.getStringValue();
break;
- case IOption.STRING_LIST :
+ case IOption.STRING_LIST:
strL = option.getBasicStringListValue();
break;
-// case IOption.INCLUDE_PATH :
-// strL = option.getIncludePaths();
-// break;
-// case IOption.PREPROCESSOR_SYMBOLS :
-// strL = option.getDefinedSymbols();
-// break;
-// case IOption.LIBRARIES :
-// strL = option.getLibraries();
-// break;
-// case IOption.OBJECTS :
-// strL = option.getUserObjects();
-// break;
- default :
+ // case IOption.INCLUDE_PATH :
+ // strL = option.getIncludePaths();
+ // break;
+ // case IOption.PREPROCESSOR_SYMBOLS :
+ // strL = option.getDefinedSymbols();
+ // break;
+ // case IOption.LIBRARIES :
+ // strL = option.getLibraries();
+ // break;
+ // case IOption.OBJECTS :
+ // strL = option.getUserObjects();
+ // break;
+ default:
break;
}
- if(str != null)
- return CdtVariableResolver.resolveToStringList(str,sub);
- else if(strL != null)
- return CdtVariableResolver.resolveStringListValues(strL,sub,true);
- } catch (BuildException e){
+ if (str != null)
+ return CdtVariableResolver.resolveToStringList(str, sub);
+ else if (strL != null)
+ return CdtVariableResolver.resolveStringListValues(strL, sub, true);
+ } catch (BuildException e) {
- } catch (CdtVariableException e){
+ } catch (CdtVariableException e) {
}
return null;
}
}
- public class OptionMacro extends BuildMacro{
-// private IOptionContextData fOptionContextData;
-// private IOptionContextData fParentOptionContextData;
-// private IOption fParentOption;
- private OptionMacro(String name, IOptionContextData optionContextData){
+ public class OptionMacro extends BuildMacro {
+ // private IOptionContextData fOptionContextData;
+ // private IOptionContextData fParentOptionContextData;
+ // private IOption fParentOption;
+ private OptionMacro(String name, IOptionContextData optionContextData) {
fName = name;
-// fOptionContextData = optionContextData;
+ // fOptionContextData = optionContextData;
IOptionContextData parentOptionContextData = getParent(optionContextData);
load(optionContextData, parentOptionContextData);
}
- private boolean load(IOptionContextData optionContextData, IOptionContextData parentOptionContextData){
+ private boolean load(IOptionContextData optionContextData, IOptionContextData parentOptionContextData) {
fStringValue = null;
fStringListValue = null;
fType = 0;
- if(parentOptionContextData != null){
+ if (parentOptionContextData != null) {
IOption option = parentOptionContextData.getOption();
- if (option!=null) {
- try{
+ if (option != null) {
+ try {
switch (option.getValueType()) {
case IOption.BOOLEAN:
break;
@@ -929,18 +896,20 @@ public class MbsMacroSupplier extends BuildCdtVariablesSupplierBase {
fStringListValue = option.getBasicStringListValue();
break;
}
- if(fStringValue != null)
- fStringValue = CdtVariableResolver.resolveToString(fStringValue,new IncludeDefaultsSubstitutor(parentOptionContextData));
- else if(fStringListValue != null)
- fStringListValue = CdtVariableResolver.resolveStringListValues(fStringListValue,new IncludeDefaultsSubstitutor(parentOptionContextData), true);
- }catch(Exception e){
+ if (fStringValue != null)
+ fStringValue = CdtVariableResolver.resolveToString(fStringValue,
+ new IncludeDefaultsSubstitutor(parentOptionContextData));
+ else if (fStringListValue != null)
+ fStringListValue = CdtVariableResolver.resolveStringListValues(fStringListValue,
+ new IncludeDefaultsSubstitutor(parentOptionContextData), true);
+ } catch (Exception e) {
fType = 0;
}
}
}
boolean result = fType != 0;
- if(!result){
+ if (!result) {
fType = VALUE_TEXT;
fStringListValue = null;
fStringValue = null;
@@ -950,11 +919,11 @@ public class MbsMacroSupplier extends BuildCdtVariablesSupplierBase {
}
}
- private OptionData getParent(IOptionContextData optionContext){
- if(optionContext == null)
+ private OptionData getParent(IOptionContextData optionContext) {
+ if (optionContext == null)
return null;
IOption option = optionContext.getOption();
- if(option == null)
+ if (option == null)
return null;
IBuildObject parent = option.getParent();
@@ -962,88 +931,88 @@ public class MbsMacroSupplier extends BuildCdtVariablesSupplierBase {
IToolChain tCh = null;
IResourceInfo optionRcInfo = null;
if (parent instanceof ITool) {
- tool = (ITool)parent;
+ tool = (ITool) parent;
optionRcInfo = tool.getParentResourceInfo();
} else if (parent instanceof IToolChain) {
- tCh = (IToolChain)parent;
+ tCh = (IToolChain) parent;
optionRcInfo = tCh.getParentFolderInfo();
}
- if(optionRcInfo != null && optionRcInfo.isExtensionElement())
+ if (optionRcInfo != null && optionRcInfo.isExtensionElement())
optionRcInfo = null;
IBuildObject parentObj = null;
IOption parentOption = null;
- if(optionRcInfo != null){
+ if (optionRcInfo != null) {
//only if optionRcInfo is not null
- IBuildObject bObj = (optionContext instanceof OptionData) ?
- ((OptionData)optionContext).getOptionContainer() : optionContext.getParent();
-
+ IBuildObject bObj = (optionContext instanceof OptionData)
+ ? ((OptionData) optionContext).getOptionContainer()
+ : optionContext.getParent();
IResourceInfo rcInfo = null;
IFileInfo fileInfo = null;
IFolderInfo folderInfo = null;
ITool holderTool = null;
IToolChain holderTc = null;
- if(bObj instanceof ITool){
- holderTool = (ITool)bObj;
+ if (bObj instanceof ITool) {
+ holderTool = (ITool) bObj;
rcInfo = holderTool.getParentResourceInfo();
- } else if(bObj instanceof IFileInfo) {
- fileInfo = (IFileInfo)bObj;
+ } else if (bObj instanceof IFileInfo) {
+ fileInfo = (IFileInfo) bObj;
rcInfo = fileInfo;
} else if (bObj instanceof IFolderInfo) {
- folderInfo = (IFolderInfo)bObj;
+ folderInfo = (IFolderInfo) bObj;
rcInfo = folderInfo;
holderTc = folderInfo.getToolChain();
} else if (bObj instanceof IToolChain) {
- holderTc = (IToolChain)bObj;
+ holderTc = (IToolChain) bObj;
folderInfo = holderTc.getParentFolderInfo();
}
- if(rcInfo != null && rcInfo.isExtensionElement())
+ if (rcInfo != null && rcInfo.isExtensionElement())
rcInfo = null;
IResourceInfo parentRcInfo = null;
- if(rcInfo != null){
+ if (rcInfo != null) {
IPath optionRcPath = optionRcInfo.getPath();
IPath rcPath = rcInfo.getPath();
- if(optionRcPath.isPrefixOf(rcPath)){
- parentRcInfo = ((ResourceInfo)optionRcInfo).getParentResourceInfo();
+ if (optionRcPath.isPrefixOf(rcPath)) {
+ parentRcInfo = ((ResourceInfo) optionRcInfo).getParentResourceInfo();
} else {
- parentRcInfo = ((ResourceInfo)rcInfo).getParentResourceInfo();
+ parentRcInfo = ((ResourceInfo) rcInfo).getParentResourceInfo();
}
}
- if(parentRcInfo != null){
- if(tool != null){
+ if (parentRcInfo != null) {
+ if (tool != null) {
ITool tools[] = parentRcInfo.getTools();
ITool cur = tool;
ITool found = null;
- do{
+ do {
String id = cur.getId();
- ITool []tmp = BuildSettingsUtil.getToolsBySuperClassId(tools, id);
- if(tmp.length != 0){
+ ITool[] tmp = BuildSettingsUtil.getToolsBySuperClassId(tools, id);
+ if (tmp.length != 0) {
found = tmp[0];
break;
}
- if(cur.isExtensionElement())
+ if (cur.isExtensionElement())
break;
cur = cur.getSuperClass();
- } while(cur != null);
+ } while (cur != null);
- if(found != null){
+ if (found != null) {
parentOption = getParentOption(found, option);
- if(parentOption != null){
+ if (parentOption != null) {
parentObj = found;
}
}
} else if (tCh != null) {
- if(parentRcInfo instanceof IFolderInfo){
- IToolChain parentTc = ((IFolderInfo)parentRcInfo).getToolChain();
+ if (parentRcInfo instanceof IFolderInfo) {
+ IToolChain parentTc = ((IFolderInfo) parentRcInfo).getToolChain();
parentOption = getParentOption(parentTc, option);
- if(parentOption != null){
+ if (parentOption != null) {
parentObj = parentTc;
}
}
@@ -1051,40 +1020,40 @@ public class MbsMacroSupplier extends BuildCdtVariablesSupplierBase {
}
}
- if(parentObj == null)
+ if (parentObj == null)
parentOption = null;
- if(parentOption == null)
+ if (parentOption == null)
parentOption = option.getSuperClass();
- if(parentOption != null)
- return new OptionData(parentOption,optionContext.getParent(),parentObj);
+ if (parentOption != null)
+ return new OptionData(parentOption, optionContext.getParent(), parentObj);
return null;
}
- private IOption getParentOption(IHoldsOptions holder, IOption option){
+ private IOption getParentOption(IHoldsOptions holder, IOption option) {
IOption cur = option;
IOption found = null;
do {
String id = cur.getId();
found = holder.getOptionBySuperClassId(id);
- if(found != null)
+ if (found != null)
break;
- if(cur.isExtensionElement())
+ if (cur.isExtensionElement())
break;
cur = cur.getSuperClass();
} while (cur != null);
return found;
}
- private boolean canHandle(IOptionContextData optionData){
+ private boolean canHandle(IOptionContextData optionData) {
IOption option = optionData.getOption();
- if(option == null)
+ if (option == null)
return false;
boolean can = false;
- try{
+ try {
switch (option.getBasicValueType()) {
case IOption.BOOLEAN:
break;
@@ -1111,7 +1080,7 @@ public class MbsMacroSupplier extends BuildCdtVariablesSupplierBase {
can = true;
break;
}
- }catch(BuildException e){
+ } catch (BuildException e) {
can = false;
}
return can;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/OptionContextData.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/OptionContextData.java
index aa1bd989a7a..a2ecb15b71a 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/OptionContextData.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/OptionContextData.java
@@ -36,7 +36,7 @@ public class OptionContextData implements IOptionContextData {
private IOptionCategory fCategory;
private IBuildObject fParent;
- public OptionContextData(IOption option, IBuildObject parent){
+ public OptionContextData(IOption option, IBuildObject parent) {
fOption = option;
fParent = parent;
}
@@ -44,10 +44,11 @@ public class OptionContextData implements IOptionContextData {
/*
* @since 8.0
*/
- public OptionContextData(IOptionCategory category, IBuildObject parent){
+ public OptionContextData(IOptionCategory category, IBuildObject parent) {
fCategory = category;
fParent = parent;
}
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.macros.IOptionContextData#getOption()
*/
@@ -72,53 +73,52 @@ public class OptionContextData implements IOptionContextData {
return fParent;
}
- public static IHoldsOptions getHolder(IOptionContextData data){
+ public static IHoldsOptions getHolder(IOptionContextData data) {
IBuildObject buildObj = data.getParent();
IToolChain tCh = null;
IHoldsOptions ho = null;
IResourceInfo rcInfo = null;
IFileInfo fileInfo = null;
IFolderInfo folderInfo = null;
- if(buildObj instanceof ITool)
- ho = (ITool)buildObj;
- else if(buildObj instanceof IToolChain)
- tCh = (IToolChain)buildObj;
- else if(buildObj instanceof IFileInfo){
- fileInfo = (IFileInfo)buildObj;
+ if (buildObj instanceof ITool)
+ ho = (ITool) buildObj;
+ else if (buildObj instanceof IToolChain)
+ tCh = (IToolChain) buildObj;
+ else if (buildObj instanceof IFileInfo) {
+ fileInfo = (IFileInfo) buildObj;
rcInfo = fileInfo;
- }else if(buildObj instanceof IConfiguration)
- tCh = ((IConfiguration)buildObj).getToolChain();
- else if(buildObj instanceof IFolderInfo){
- folderInfo = (IFolderInfo)buildObj;
+ } else if (buildObj instanceof IConfiguration)
+ tCh = ((IConfiguration) buildObj).getToolChain();
+ else if (buildObj instanceof IFolderInfo) {
+ folderInfo = (IFolderInfo) buildObj;
rcInfo = folderInfo;
tCh = folderInfo.getToolChain();
}
- if(ho == null){
+ if (ho == null) {
IOption option = data.getOption();
- if(option == null)
+ if (option == null)
return null;
IHoldsOptions tmp = option.getOptionHolder();
ITool tools[] = null;
- if(tCh != null){
- for(IToolChain cur = tCh; cur != null; cur = cur.getSuperClass()){
- if(cur == tmp)
+ if (tCh != null) {
+ for (IToolChain cur = tCh; cur != null; cur = cur.getSuperClass()) {
+ if (cur == tmp)
return tCh;
}
tools = tCh.getTools();
- } else if(rcInfo != null){
+ } else if (rcInfo != null) {
tools = rcInfo.getTools();
}
- if(tools != null){
- for(int i = 0; i < tools.length; i++){
- for(ITool cur = tools[i]; cur != null; cur = cur.getSuperClass()){
- if(cur == tmp){
+ if (tools != null) {
+ for (int i = 0; i < tools.length; i++) {
+ for (ITool cur = tools[i]; cur != null; cur = cur.getSuperClass()) {
+ if (cur == tmp) {
ITool tool = tools[i];
- if(!tool.isExtensionElement()
- && tool.getParent() != null){
+ if (!tool.isExtensionElement() && tool.getParent() != null) {
ho = tools[i];
break;
}
@@ -127,17 +127,15 @@ public class OptionContextData implements IOptionContextData {
}
}
- if(ho == null && tmp != null){
- if(tmp instanceof ITool){
- ITool tool = (ITool)tmp;
- if(!tool.isExtensionElement()
- && tool.getParent() != null){
+ if (ho == null && tmp != null) {
+ if (tmp instanceof ITool) {
+ ITool tool = (ITool) tmp;
+ if (!tool.isExtensionElement() && tool.getParent() != null) {
ho = tmp;
}
- } else if (tmp instanceof IToolChain){
- IToolChain tChain = (IToolChain)tmp;
- if(!tChain.isExtensionElement()
- && tChain.getParent() != null){
+ } else if (tmp instanceof IToolChain) {
+ IToolChain tChain = (IToolChain) tmp;
+ if (!tChain.isExtensionElement() && tChain.getParent() != null) {
ho = tmp;
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultGCCScannerInfoCollector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultGCCScannerInfoCollector.java
index df0bbdb1e34..0a3b127e382 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultGCCScannerInfoCollector.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultGCCScannerInfoCollector.java
@@ -17,11 +17,11 @@ import org.eclipse.cdt.make.internal.core.scannerconfig2.PerProjectSICollector;
import org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector;
/**
- * Implementation class for gathering the built-in compiler settings for
- * GCC-based targets. The assumption is that the tools will answer path
- * information in POSIX format and that the Scanner will be able to search for
+ * Implementation class for gathering the built-in compiler settings for
+ * GCC-based targets. The assumption is that the tools will answer path
+ * information in POSIX format and that the Scanner will be able to search for
* files using this format.
- *
+ *
* @since 2.0
*/
public class DefaultGCCScannerInfoCollector extends PerProjectSICollector implements IManagedScannerInfoCollector {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultGnuWinScannerInfoCollector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultGnuWinScannerInfoCollector.java
index 08af2bf459d..8726d578481 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultGnuWinScannerInfoCollector.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/DefaultGnuWinScannerInfoCollector.java
@@ -23,52 +23,54 @@ import org.eclipse.cdt.make.internal.core.scannerconfig.util.CygpathTranslator;
import org.eclipse.core.resources.IProject;
/**
- * Implementation class for gathering the built-in compiler settings for
+ * Implementation class for gathering the built-in compiler settings for
* Cygwin-based targets.
- *
+ *
* @since 2.0
*/
public class DefaultGnuWinScannerInfoCollector extends DefaultGCCScannerInfoCollector {
- private IProject fProject;
- /* (non-Javadoc)
- * @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector#contributeToScannerConfig(java.lang.Object, java.util.Map)
- */
+ private IProject fProject;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector#contributeToScannerConfig(java.lang.Object, java.util.Map)
+ */
@SuppressWarnings("unchecked")
@Override
- public void contributeToScannerConfig(Object resource, @SuppressWarnings("rawtypes") Map scannerInfo) {
- // check the resource
-// if (resource != null && resource instanceof IResource &&
-// ((IResource) resource).getProject().equals(getProject())) {
- List<String> includes = (List<String>) scannerInfo.get(ScannerInfoTypes.INCLUDE_PATHS);
-// List symbols = (List) scannerInfo.get(ScannerInfoTypes.SYMBOL_DEFINITIONS);
-
- // This method will be called by the parser each time there is a new value
- List<String> translatedIncludes = CygpathTranslator.translateIncludePaths(fProject, includes);
- Iterator<String> pathIter = translatedIncludes.listIterator();
- while (pathIter.hasNext()) {
- String convertedPath = pathIter.next();
- // On MinGW, there is no facility for converting paths
- if (convertedPath.startsWith("/")) //$NON-NLS-1$
- pathIter.remove();
-// // Add it if it is not a duplicate
-// if (!getIncludePaths().contains(convertedPath)){
-// getIncludePaths().add(convertedPath);
-// }
- }
- scannerInfo.put(ScannerInfoTypes.INCLUDE_PATHS, translatedIncludes);
-
-// // Now add the macros
-// Iterator symbolIter = symbols.listIterator();
-// while (symbolIter.hasNext()) {
-// // See if it has an equals
-// String[] macroTokens = ((String)symbolIter.next()).split(EQUALS);
-// String macro = macroTokens[0].trim();
-// String value = (macroTokens.length > 1) ? macroTokens[1].trim() : ""; //$NON-NLS-1$
-// getDefinedSymbols().put(macro, value);
-// }
- super.contributeToScannerConfig(resource, scannerInfo);
- }
-// }
+ public void contributeToScannerConfig(Object resource, @SuppressWarnings("rawtypes") Map scannerInfo) {
+ // check the resource
+ // if (resource != null && resource instanceof IResource &&
+ // ((IResource) resource).getProject().equals(getProject())) {
+ List<String> includes = (List<String>) scannerInfo.get(ScannerInfoTypes.INCLUDE_PATHS);
+ // List symbols = (List) scannerInfo.get(ScannerInfoTypes.SYMBOL_DEFINITIONS);
+
+ // This method will be called by the parser each time there is a new value
+ List<String> translatedIncludes = CygpathTranslator.translateIncludePaths(fProject, includes);
+ Iterator<String> pathIter = translatedIncludes.listIterator();
+ while (pathIter.hasNext()) {
+ String convertedPath = pathIter.next();
+ // On MinGW, there is no facility for converting paths
+ if (convertedPath.startsWith("/")) //$NON-NLS-1$
+ pathIter.remove();
+ // // Add it if it is not a duplicate
+ // if (!getIncludePaths().contains(convertedPath)){
+ // getIncludePaths().add(convertedPath);
+ // }
+ }
+ scannerInfo.put(ScannerInfoTypes.INCLUDE_PATHS, translatedIncludes);
+
+ // // Now add the macros
+ // Iterator symbolIter = symbols.listIterator();
+ // while (symbolIter.hasNext()) {
+ // // See if it has an equals
+ // String[] macroTokens = ((String)symbolIter.next()).split(EQUALS);
+ // String macro = macroTokens[0].trim();
+ // String value = (macroTokens.length > 1) ? macroTokens[1].trim() : ""; //$NON-NLS-1$
+ // getDefinedSymbols().put(macro, value);
+ // }
+ super.contributeToScannerConfig(resource, scannerInfo);
+ }
+
+ // }
@Override
public void setProject(IProject project) {
fProject = project;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/ManagedBuildCPathEntryContainer.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/ManagedBuildCPathEntryContainer.java
index ee06bfce112..5aea167cf93 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/ManagedBuildCPathEntryContainer.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/ManagedBuildCPathEntryContainer.java
@@ -57,13 +57,14 @@ import org.eclipse.core.runtime.Platform;
* @since 2.0
*/
public class ManagedBuildCPathEntryContainer implements IPathEntryContainer {
- // Managed make per project scanner configuration discovery profile
- public static final String MM_PP_DISCOVERY_PROFILE_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".GCCManagedMakePerProjectProfile"; //$NON-NLS-1$
+ // Managed make per project scanner configuration discovery profile
+ public static final String MM_PP_DISCOVERY_PROFILE_ID = ManagedBuilderCorePlugin.getUniqueIdentifier()
+ + ".GCCManagedMakePerProjectProfile"; //$NON-NLS-1$
- private static final String NEWLINE = System.getProperty("line.separator"); //$NON-NLS-1$
- private static final String ERROR_HEADER = "PathEntryContainer error ["; //$NON-NLS-1$
- private static final String TRACE_FOOTER = "]: "; //$NON-NLS-1$
- private static final String TRACE_HEADER = "PathEntryContainer trace ["; //$NON-NLS-1$
+ private static final String NEWLINE = System.getProperty("line.separator"); //$NON-NLS-1$
+ private static final String ERROR_HEADER = "PathEntryContainer error ["; //$NON-NLS-1$
+ private static final String TRACE_FOOTER = "]: "; //$NON-NLS-1$
+ private static final String TRACE_HEADER = "PathEntryContainer trace ["; //$NON-NLS-1$
private ITarget defaultTarget;
private Vector<IPathEntry> entries;
@@ -101,8 +102,8 @@ public class ManagedBuildCPathEntryContainer implements IPathEntryContainer {
// Make sure the current entries do not contain a duplicate
for (IPathEntry entry : entries) {
if (entry.getEntryKind() == IPathEntry.CDT_MACRO) {
- if (((IMacroEntry)entry).getMacroName().equals(macro) &&
- ((IMacroEntry)entry).getMacroValue().equals(value)) {
+ if (((IMacroEntry) entry).getMacroName().equals(macro)
+ && ((IMacroEntry) entry).getMacroValue().equals(value)) {
add = false;
break;
}
@@ -126,17 +127,17 @@ public class ManagedBuildCPathEntryContainer implements IPathEntryContainer {
}
}
- protected void calculateEntriesDynamically(final IProject project,
- SCProfileInstance profileInstance,
- final IScannerInfoCollector collector) {
+ protected void calculateEntriesDynamically(final IProject project, SCProfileInstance profileInstance,
+ final IScannerInfoCollector collector) {
// TODO Get the provider from the toolchain specification
- final IScannerConfigBuilderInfo2 buildInfo = ScannerConfigProfileManager.
- createScannerConfigBuildInfo2(ManagedBuilderCorePlugin.getDefault().getPluginPreferences(),
- profileInstance.getProfile().getId(), false);
- List<String> providerIds = buildInfo.getProviderIdList();
- for (final String providerId : providerIds) {
- final IExternalScannerInfoProvider esiProvider = profileInstance.createExternalScannerInfoProvider(providerId);
+ final IScannerConfigBuilderInfo2 buildInfo = ScannerConfigProfileManager.createScannerConfigBuildInfo2(
+ ManagedBuilderCorePlugin.getDefault().getPluginPreferences(), profileInstance.getProfile().getId(),
+ false);
+ List<String> providerIds = buildInfo.getProviderIdList();
+ for (final String providerId : providerIds) {
+ final IExternalScannerInfoProvider esiProvider = profileInstance
+ .createExternalScannerInfoProvider(providerId);
// Set the arguments for the provider
@@ -146,7 +147,8 @@ public class ManagedBuildCPathEntryContainer implements IPathEntryContainer {
IProgressMonitor monitor = new NullProgressMonitor();
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
IConfiguration config = info.getDefaultConfiguration();
- IBuildEnvironmentVariable[] vars = ManagedBuildManager.getEnvironmentVariableProvider().getVariables(config, true, true);
+ IBuildEnvironmentVariable[] vars = ManagedBuildManager.getEnvironmentVariableProvider()
+ .getVariables(config, true, true);
Properties env = new Properties();
if (vars != null)
for (int i = 0; i < vars.length; ++i)
@@ -162,7 +164,7 @@ public class ManagedBuildCPathEntryContainer implements IPathEntryContainer {
}
};
Platform.run(runnable);
- }
+ }
}
/* (non-Javadoc)
@@ -172,50 +174,51 @@ public class ManagedBuildCPathEntryContainer implements IPathEntryContainer {
public IPathEntry[] getPathEntries() {
info = (ManagedBuildInfo) ManagedBuildManager.getBuildInfo(project);
if (info == null) {
- ManagedBuildCPathEntryContainer.outputError(project.getName(), "Build information is null"); //$NON-NLS-1$
+ ManagedBuildCPathEntryContainer.outputError(project.getName(), "Build information is null"); //$NON-NLS-1$
return entries.toArray(new IPathEntry[entries.size()]);
}
IConfiguration defaultConfig = info.getDefaultConfiguration();
if (defaultConfig == null) {
// The build information has not been loaded yet
- ManagedBuildCPathEntryContainer.outputError(project.getName(), "Build information has not been loaded yet"); //$NON-NLS-1$
+ ManagedBuildCPathEntryContainer.outputError(project.getName(), "Build information has not been loaded yet"); //$NON-NLS-1$
return entries.toArray(new IPathEntry[entries.size()]);
}
// get the associated scanner config discovery profile id
- String scdProfileId = ManagedBuildManager.getScannerInfoProfileId(defaultConfig);
- IScannerInfoCollector collector = null;
- SCProfileInstance profileInstance = null;
- if (scdProfileId != null) {
+ String scdProfileId = ManagedBuildManager.getScannerInfoProfileId(defaultConfig);
+ IScannerInfoCollector collector = null;
+ SCProfileInstance profileInstance = null;
+ if (scdProfileId != null) {
// See if we can load a dynamic resolver
- //FIXME:
- InfoContext context = CfgScannerConfigProfileManager.createDefaultContext(project);
- profileInstance = ScannerConfigProfileManager.getInstance().
- getSCProfileInstance(project, context, scdProfileId);
- collector = profileInstance.createScannerInfoCollector();
- }
-
- synchronized(this) {
- if (collector instanceof IManagedScannerInfoCollector) {
- IManagedScannerInfoCollector mCollector = (IManagedScannerInfoCollector) collector;
- mCollector.setProject(project);
- ManagedBuildCPathEntryContainer.outputTrace(project.getName(), "Path entries collected dynamically"); //$NON-NLS-1$
- calculateEntriesDynamically((IProject)info.getOwner(), profileInstance, collector);
- addEntries(info.getManagedBuildValues());
- addIncludePaths(mCollector.getIncludePaths());
- addDefinedSymbols(mCollector.getDefinedSymbols());
- } else {
- // If none supplied, use the built-ins
- if (defaultConfig != null) {
+ //FIXME:
+ InfoContext context = CfgScannerConfigProfileManager.createDefaultContext(project);
+ profileInstance = ScannerConfigProfileManager.getInstance().getSCProfileInstance(project, context,
+ scdProfileId);
+ collector = profileInstance.createScannerInfoCollector();
+ }
+
+ synchronized (this) {
+ if (collector instanceof IManagedScannerInfoCollector) {
+ IManagedScannerInfoCollector mCollector = (IManagedScannerInfoCollector) collector;
+ mCollector.setProject(project);
+ ManagedBuildCPathEntryContainer.outputTrace(project.getName(), "Path entries collected dynamically"); //$NON-NLS-1$
+ calculateEntriesDynamically((IProject) info.getOwner(), profileInstance, collector);
addEntries(info.getManagedBuildValues());
- addEntries(info.getManagedBuildBuiltIns());
- ManagedBuildCPathEntryContainer.outputTrace(project.getName(), "Path entries set using built-in definitions from " + defaultConfig.getName()); //$NON-NLS-1$
+ addIncludePaths(mCollector.getIncludePaths());
+ addDefinedSymbols(mCollector.getDefinedSymbols());
} else {
- ManagedBuildCPathEntryContainer.outputError(project.getName(), "Configuration is null"); //$NON-NLS-1$
- return entries.toArray(new IPathEntry[entries.size()]);
+ // If none supplied, use the built-ins
+ if (defaultConfig != null) {
+ addEntries(info.getManagedBuildValues());
+ addEntries(info.getManagedBuildBuiltIns());
+ ManagedBuildCPathEntryContainer.outputTrace(project.getName(),
+ "Path entries set using built-in definitions from " + defaultConfig.getName()); //$NON-NLS-1$
+ } else {
+ ManagedBuildCPathEntryContainer.outputError(project.getName(), "Configuration is null"); //$NON-NLS-1$
+ return entries.toArray(new IPathEntry[entries.size()]);
+ }
}
- }
- return entries.toArray(new IPathEntry[entries.size()]);
- } // end synchronized
+ return entries.toArray(new IPathEntry[entries.size()]);
+ } // end synchronized
}
/* (non-Javadoc)
@@ -223,7 +226,7 @@ public class ManagedBuildCPathEntryContainer implements IPathEntryContainer {
*/
@Override
public String getDescription() {
- return "CDT Managed Build Project"; //$NON-NLS-1$
+ return "CDT Managed Build Project"; //$NON-NLS-1$
}
/* (non-Javadoc)
@@ -231,15 +234,19 @@ public class ManagedBuildCPathEntryContainer implements IPathEntryContainer {
*/
@Override
public IPath getPath() {
- return new Path("org.eclipse.cdt.managedbuilder.MANAGED_CONTAINER"); //$NON-NLS-1$
+ return new Path("org.eclipse.cdt.managedbuilder.MANAGED_CONTAINER"); //$NON-NLS-1$
}
- private void addEntries(IPathEntry[] values) {
- if (values == null) return;
- for (int i=0; i<values.length; i++) {
- if (values[i] == null) continue;
- if (!entries.contains(values[i])) { entries.add(values[i]); }
- }
- }
+ private void addEntries(IPathEntry[] values) {
+ if (values == null)
+ return;
+ for (int i = 0; i < values.length; i++) {
+ if (values[i] == null)
+ continue;
+ if (!entries.contains(values[i])) {
+ entries.add(values[i]);
+ }
+ }
+ }
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/ManagedBuildPathEntryContainerInitializer.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/ManagedBuildPathEntryContainerInitializer.java
index 51fa6529507..519a008e4b2 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/ManagedBuildPathEntryContainerInitializer.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/ManagedBuildPathEntryContainerInitializer.java
@@ -24,13 +24,13 @@ import org.eclipse.core.runtime.IPath;
* @since 2.0
*/
public class ManagedBuildPathEntryContainerInitializer extends PathEntryContainerInitializer {
- private static final String TRACE_FOOTER = "]: "; //$NON-NLS-1$
- private static final String TRACE_HEADER = "PathEntryContainerInitializer trace ["; //$NON-NLS-1$
+ private static final String TRACE_FOOTER = "]: "; //$NON-NLS-1$
+ private static final String TRACE_HEADER = "PathEntryContainerInitializer trace ["; //$NON-NLS-1$
public static boolean VERBOSE = false;
/**
- * Need a zero-argument constructor to allow the system to create
- * the intitializer
+ * Need a zero-argument constructor to allow the system to create
+ * the intitializer
*/
public ManagedBuildPathEntryContainerInitializer() {
super();
@@ -42,12 +42,11 @@ public class ManagedBuildPathEntryContainerInitializer extends PathEntryContaine
@Override
public void initialize(IPath containerPath, ICProject project) throws CoreException {
if (VERBOSE) {
- System.out.println(TRACE_HEADER +
- project.getProject().getName() +
- TRACE_FOOTER +
- "Initializing path entry container"); //$NON-NLS-1$
+ System.out.println(
+ TRACE_HEADER + project.getProject().getName() + TRACE_FOOTER + "Initializing path entry container"); //$NON-NLS-1$
}
- CoreModel.setPathEntryContainer(new ICProject[]{project}, new ManagedBuildCPathEntryContainer(project.getProject()), null);
+ CoreModel.setPathEntryContainer(new ICProject[] { project },
+ new ManagedBuildCPathEntryContainer(project.getProject()), null);
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/ManagedGCCScannerInfoConsoleParser.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/ManagedGCCScannerInfoConsoleParser.java
index ae524deec31..8a31960144e 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/ManagedGCCScannerInfoConsoleParser.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/scannerconfig/ManagedGCCScannerInfoConsoleParser.java
@@ -23,20 +23,19 @@ import org.eclipse.cdt.make.internal.core.scannerconfig2.PerProjectSICollector;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.core.resources.IProject;
-public class ManagedGCCScannerInfoConsoleParser extends
- GCCScannerInfoConsoleParser {
+public class ManagedGCCScannerInfoConsoleParser extends GCCScannerInfoConsoleParser {
Boolean fManagedBuildOnState;
-
+
@Override
public boolean processLine(String line) {
- if(isManagedBuildOn())
+ if (isManagedBuildOn())
return false;
return super.processLine(line);
}
@Override
public void shutdown() {
- if(!isManagedBuildOn()){
+ if (!isManagedBuildOn()) {
super.shutdown();
}
fManagedBuildOnState = null;
@@ -44,30 +43,30 @@ public class ManagedGCCScannerInfoConsoleParser extends
@Override
public void startup(IProject project, IScannerInfoCollector collector) {
- if(isManagedBuildOn())
+ if (isManagedBuildOn())
return;
super.startup(project, collector);
}
- protected boolean isManagedBuildOn(){
- if(fManagedBuildOnState == null)
+ protected boolean isManagedBuildOn() {
+ if (fManagedBuildOnState == null)
fManagedBuildOnState = Boolean.valueOf(doCalcManagedBuildOnState());
return fManagedBuildOnState.booleanValue();
}
- protected boolean doCalcManagedBuildOnState(){
+ protected boolean doCalcManagedBuildOnState() {
IScannerInfoCollector cr = getCollector();
InfoContext c;
- if(cr instanceof PerProjectSICollector){
- c = ((PerProjectSICollector)cr).getContext();
+ if (cr instanceof PerProjectSICollector) {
+ c = ((PerProjectSICollector) cr).getContext();
} else {
return false;
}
-
+
IProject project = c.getProject();
ICProjectDescription des = CoreModel.getDefault().getProjectDescription(project, false);
CfgInfoContext cc = CfgInfoContext.fromInfoContext(des, c);
- if(cc != null){
+ if (cc != null) {
IConfiguration cfg = cc.getConfiguration();
return cfg.isManagedBuildOn();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConfigurationModification.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConfigurationModification.java
index a18dbbf8ef0..c9b2567bfad 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConfigurationModification.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConfigurationModification.java
@@ -34,8 +34,7 @@ import org.eclipse.cdt.managedbuilder.tcmodification.IConfigurationModification;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
-public class ConfigurationModification extends FolderInfoModification implements
- IConfigurationModification {
+public class ConfigurationModification extends FolderInfoModification implements IConfigurationModification {
private IBuilder fSelectedBuilder;
private IBuilder fRealBuilder;
private boolean fCompatibilityInfoInited;
@@ -45,35 +44,35 @@ public class ConfigurationModification extends FolderInfoModification implements
private IBuilder[] fAllSysBuilders;
private BuilderCompatibilityInfoElement fCurrentBuilderCompatibilityInfo;
-
public static class BuilderCompatibilityInfoElement {
private Builder fBuilder;
private List<ConflictMatch> fErrComflictMatchList;
private CompatibilityStatus fStatus;
- BuilderCompatibilityInfoElement(Builder builder, List<ConflictMatch> errConflictList){
+ BuilderCompatibilityInfoElement(Builder builder, List<ConflictMatch> errConflictList) {
fBuilder = builder;
- if(errConflictList != null && errConflictList.size() != 0)
+ if (errConflictList != null && errConflictList.size() != 0)
fErrComflictMatchList = errConflictList;
}
- public CompatibilityStatus getCompatibilityStatus(){
- if(fStatus == null){
+ public CompatibilityStatus getCompatibilityStatus() {
+ if (fStatus == null) {
int severity;
String message;
- if(fErrComflictMatchList != null){
+ if (fErrComflictMatchList != null) {
severity = IStatus.ERROR;
message = Messages.getString("ConfigurationModification.0"); //$NON-NLS-1$
} else {
severity = IStatus.OK;
message = ""; //$NON-NLS-1$
}
- fStatus = new CompatibilityStatus(severity, message, new ConflictSet(fBuilder, fErrComflictMatchList, null));
+ fStatus = new CompatibilityStatus(severity, message,
+ new ConflictSet(fBuilder, fErrComflictMatchList, null));
}
return fStatus;
}
- public boolean isCompatible(){
+ public boolean isCompatible() {
return fErrComflictMatchList == null;
}
}
@@ -88,7 +87,7 @@ public class ConfigurationModification extends FolderInfoModification implements
super(foInfo, base);
fSelectedBuilder = base.fSelectedBuilder;
- if(!fSelectedBuilder.isExtensionElement())
+ if (!fSelectedBuilder.isExtensionElement())
fSelectedBuilder = ManagedBuildManager.getExtensionBuilder(fSelectedBuilder);
fRealBuilder = base.fRealBuilder;
@@ -114,28 +113,29 @@ public class ConfigurationModification extends FolderInfoModification implements
return currentBuilderCompatibilityInfo.getCompatibilityStatus();
}
- private ConflictMatchSet getParentConflictMatchSet(){
- if(fConflicts == null){
+ private ConflictMatchSet getParentConflictMatchSet() {
+ if (fConflicts == null) {
PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage = getCompleteObjectStore();
Set<IPath> restore = TcModificationUtil.removeBuilderInfo(storage, fRealBuilder);
try {
- fConflicts = ToolChainModificationManager.getInstance().getConflictInfo(IRealBuildObjectAssociation.OBJECT_BUILDER, storage);
+ fConflicts = ToolChainModificationManager.getInstance()
+ .getConflictInfo(IRealBuildObjectAssociation.OBJECT_BUILDER, storage);
} finally {
- if(restore != null)
+ if (restore != null)
TcModificationUtil.restoreBuilderInfo(storage, fRealBuilder, restore);
}
}
return fConflicts;
}
- private IBuilder[] getAllSysBuilders(){
- if(fAllSysBuilders == null)
+ private IBuilder[] getAllSysBuilders() {
+ if (fAllSysBuilders == null)
fAllSysBuilders = ManagedBuildManager.getRealBuilders();
return fAllSysBuilders;
}
- private void initCompatibilityInfo(){
- if(fCompatibilityInfoInited)
+ private void initCompatibilityInfo() {
+ if (fCompatibilityInfoInited)
return;
fCompatibleBuilders = new HashMap<IBuilder, BuilderCompatibilityInfoElement>();
@@ -144,11 +144,11 @@ public class ConfigurationModification extends FolderInfoModification implements
IBuilder sysBs[] = getAllSysBuilders();
@SuppressWarnings("unchecked")
Map<Builder, List<ConflictMatch>> conflictMap = (Map<Builder, List<ConflictMatch>>) conflicts.fObjToConflictListMap;
- for(int i = 0; i < sysBs.length; i++){
+ for (int i = 0; i < sysBs.length; i++) {
Builder b = (Builder) sysBs[i];
List<ConflictMatch> l = conflictMap.get(b);
BuilderCompatibilityInfoElement info = new BuilderCompatibilityInfoElement(b, l);
- if(info.isCompatible()){
+ if (info.isCompatible()) {
fCompatibleBuilders.put(b, info);
} else {
fInCompatibleBuilders.put(b, info);
@@ -158,11 +158,11 @@ public class ConfigurationModification extends FolderInfoModification implements
fCompatibilityInfoInited = true;
}
- private BuilderCompatibilityInfoElement getCurrentBuilderCompatibilityInfo(){
- if(fCurrentBuilderCompatibilityInfo == null){
+ private BuilderCompatibilityInfoElement getCurrentBuilderCompatibilityInfo() {
+ if (fCurrentBuilderCompatibilityInfo == null) {
initCompatibilityInfo();
BuilderCompatibilityInfoElement info = fCompatibleBuilders.get(fRealBuilder);
- if(info == null)
+ if (info == null)
info = fInCompatibleBuilders.get(fRealBuilder);
fCurrentBuilderCompatibilityInfo = info;
}
@@ -177,7 +177,7 @@ public class ConfigurationModification extends FolderInfoModification implements
Set<IBuilder> keySet = fCompatibleBuilders.keySet();
for (IBuilder b : keySet) {
- if(b != fRealBuilder && cfg.isBuilderCompatible(b))
+ if (b != fRealBuilder && cfg.isBuilderCompatible(b))
l.add(b);
}
return l.toArray(new IBuilder[l.size()]);
@@ -191,12 +191,12 @@ public class ConfigurationModification extends FolderInfoModification implements
@Override
public void setBuilder(IBuilder builder) {
- if(builder == fSelectedBuilder)
+ if (builder == fSelectedBuilder)
return;
fSelectedBuilder = builder;
IBuilder realBuilder = ManagedBuildManager.getRealBuilder(builder);
- if(realBuilder == fRealBuilder)
+ if (realBuilder == fRealBuilder)
return;
fRealBuilder = realBuilder;
@@ -222,7 +222,7 @@ public class ConfigurationModification extends FolderInfoModification implements
super.changeProjectTools(removeTool, addTool);
}
- protected void clearBuilderCompatibilityInfo(){
+ protected void clearBuilderCompatibilityInfo() {
fInCompatibleBuilders = null;
fCompatibleBuilders = null;
fCompatibilityInfoInited = false;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConflictSet.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConflictSet.java
index 5468b70bbe9..569a14db447 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConflictSet.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConflictSet.java
@@ -33,22 +33,23 @@ public class ConflictSet {
private PerTypeMapStorage<IRealBuildObjectAssociation, Conflict> fConflictStorage;
private List<ConflictMatch> fConflictMatchList;
-// private Set<IRealBuildObjectAssociation> fExtConflictSet;
-// private IRealBuildObjectAssociation fRealObj;
+ // private Set<IRealBuildObjectAssociation> fExtConflictSet;
+ // private IRealBuildObjectAssociation fRealObj;
- public ConflictSet(IRealBuildObjectAssociation realObj, List<ConflictMatch> conflictMatchList, Set<? extends IRealBuildObjectAssociation> extConflictSet){
+ public ConflictSet(IRealBuildObjectAssociation realObj, List<ConflictMatch> conflictMatchList,
+ Set<? extends IRealBuildObjectAssociation> extConflictSet) {
fConflictMatchList = conflictMatchList;
-// fExtConflictSet = (Set<IRealBuildObjectAssociation>) extConflictSet;
-// fRealObj = realObj;
+ // fExtConflictSet = (Set<IRealBuildObjectAssociation>) extConflictSet;
+ // fRealObj = realObj;
}
- private void init(){
- if(fConflictStorage == null){
+ private void init() {
+ if (fConflictStorage == null) {
fConflictStorage = new PerTypeMapStorage<IRealBuildObjectAssociation, Conflict>();
- if(fConflictMatchList != null && fConflictMatchList.size() != 0){
+ if (fConflictMatchList != null && fConflictMatchList.size() != 0) {
int size = fConflictMatchList.size();
PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> result = new PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>>();
- for(int i = 0; i < size; i++){
+ for (int i = 0; i < size; i++) {
ConflictMatch match = fConflictMatchList.get(i);
int objType = match.fMatchType;
Map<IRealBuildObjectAssociation, Set<IPath>> cm = match.fRObjToPathMap;
@@ -57,13 +58,13 @@ public class ConflictSet {
Set<Entry<IRealBuildObjectAssociation, Set<IPath>>> entrySet = cm.entrySet();
for (Entry<IRealBuildObjectAssociation, Set<IPath>> entry : entrySet) {
IRealBuildObjectAssociation bo = entry.getKey();
- if(DbgTcmUtil.DEBUG){
- if((bo).getType() != objType)
+ if (DbgTcmUtil.DEBUG) {
+ if ((bo).getType() != objType)
DbgTcmUtil.fail();
}
Set<IPath> set = cur.get(bo);
- if(set == null){
+ if (set == null) {
set = new TreeSet<IPath>(PathComparator.INSTANCE);
cur.put(bo, set);
}
@@ -73,10 +74,10 @@ public class ConflictSet {
}
int types[] = ObjectTypeBasedStorage.getSupportedObjectTypes();
- for(int i = 0; i < types.length; i++){
+ for (int i = 0; i < types.length; i++) {
int type = types[i];
Map<IRealBuildObjectAssociation, Set<IPath>> map = result.getMap(type, false);
- if(map == null)
+ if (map == null)
continue;
Set<Entry<IRealBuildObjectAssociation, Set<IPath>>> entrySet = map.entrySet();
@@ -98,7 +99,7 @@ public class ConflictSet {
private Set<IPath> fPathSet;
private int fType;
- Conflict(int type, IRealBuildObjectAssociation obj, Set<IPath> paths){
+ Conflict(int type, IRealBuildObjectAssociation obj, Set<IPath> paths) {
fType = type;
fObj = obj;
fPathSet = paths;
@@ -125,13 +126,13 @@ public class ConflictSet {
}
}
- public IConflict[] getConflicts(){
+ public IConflict[] getConflicts() {
init();
int types[] = ObjectTypeBasedStorage.getSupportedObjectTypes();
List<Conflict> list = new ArrayList<Conflict>();
- for(int i = 0; i < types.length; i++){
+ for (int i = 0; i < types.length; i++) {
Map<IRealBuildObjectAssociation, Conflict> map = fConflictStorage.getMap(types[i], false);
- if(map == null)
+ if (map == null)
continue;
getConflicts(map, list);
@@ -140,8 +141,8 @@ public class ConflictSet {
return conflictArray(list);
}
- private static List<Conflict> getConflicts(Map<IRealBuildObjectAssociation, Conflict> map, List<Conflict> list){
- if(list == null)
+ private static List<Conflict> getConflicts(Map<IRealBuildObjectAssociation, Conflict> map, List<Conflict> list) {
+ if (list == null)
list = new ArrayList<Conflict>();
Collection<Conflict> conflicts = map.values();
@@ -152,41 +153,40 @@ public class ConflictSet {
return list;
}
- private static Conflict[] conflictArray(Collection<Conflict> list){
+ private static Conflict[] conflictArray(Collection<Conflict> list) {
return list.toArray(new Conflict[list.size()]);
}
- private static IRealBuildObjectAssociation[] objArray(Collection<IRealBuildObjectAssociation> list){
+ private static IRealBuildObjectAssociation[] objArray(Collection<IRealBuildObjectAssociation> list) {
return list.toArray(new IRealBuildObjectAssociation[list.size()]);
}
- public IConflict[] getConflictsWith(int objectType){
+ public IConflict[] getConflictsWith(int objectType) {
init();
Map<IRealBuildObjectAssociation, Conflict> map = fConflictStorage.getMap(objectType, false);
- if(map == null)
+ if (map == null)
return EMPTY_CONFLICT_ARRAY;
-
return conflictArray(map.values());
}
- public IBuildObject[] getConflictingObjects(int objectType){
+ public IBuildObject[] getConflictingObjects(int objectType) {
init();
Map<IRealBuildObjectAssociation, Conflict> map = fConflictStorage.getMap(objectType, false);
- if(map == null)
+ if (map == null)
return EMPTY_BO_ARRAY;
return objArray(map.keySet());
}
- public IConflict getConflictWith(IBuildObject bo){
+ public IConflict getConflictWith(IBuildObject bo) {
init();
- if(!(bo instanceof IRealBuildObjectAssociation))
+ if (!(bo instanceof IRealBuildObjectAssociation))
return null;
- IRealBuildObjectAssociation obj = (IRealBuildObjectAssociation)bo;
+ IRealBuildObjectAssociation obj = (IRealBuildObjectAssociation) bo;
Map<IRealBuildObjectAssociation, Conflict> map = fConflictStorage.getMap(obj.getType(), false);
- if(map == null)
+ if (map == null)
return null;
return map.get(obj);
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/DbgTcmUtil.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/DbgTcmUtil.java
index 57af669aa98..2ce7f505d1f 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/DbgTcmUtil.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/DbgTcmUtil.java
@@ -25,13 +25,14 @@ import org.eclipse.core.runtime.IPath;
public class DbgTcmUtil {
private static final PrintStream OUT = System.out;
public static boolean DEBUG = false;
-
- private DbgTcmUtil(){
+
+ private DbgTcmUtil() {
}
+
public static final class DbgException extends RuntimeException {
/**
- *
+ *
*/
private static final long serialVersionUID = 1L;
@@ -51,46 +52,48 @@ public class DbgTcmUtil {
super(cause);
}
}
-
- public static void print(String str){
+
+ public static void print(String str) {
OUT.print(str);
}
- public static void println(String str){
+ public static void println(String str) {
OUT.println(str);
}
-
- public static void fail(String msg){
+
+ public static void fail(String msg) {
println(msg);
throw new DbgException(msg);
}
- public static void fail(){
+ public static void fail() {
DbgException e = new DbgException();
e.printStackTrace(OUT);
throw e;
}
-
- public static void dumpStorage(PerTypeMapStorage<? extends IRealBuildObjectAssociation, Set<IPath>> storage){
+
+ public static void dumpStorage(PerTypeMapStorage<? extends IRealBuildObjectAssociation, Set<IPath>> storage) {
println("starting storage dump.."); //$NON-NLS-1$
int[] types = ObjectTypeBasedStorage.getSupportedObjectTypes();
- for(int i = 0; i < types.length; i++){
+ for (int i = 0; i < types.length; i++) {
int type = types[i];
- MatchObjectElement.TypeToStringAssociation assoc = MatchObjectElement.TypeToStringAssociation.getAssociation(type);
- if(assoc == null)
+ MatchObjectElement.TypeToStringAssociation assoc = MatchObjectElement.TypeToStringAssociation
+ .getAssociation(type);
+ if (assoc == null)
continue;
-
+
println(" dumping for type " + assoc.getString()); //$NON-NLS-1$
-
+
@SuppressWarnings("unchecked")
- Map<IRealBuildObjectAssociation, Set<IPath>> map = (Map<IRealBuildObjectAssociation, Set<IPath>>) storage.getMap(type, false);
- if(map != null){
+ Map<IRealBuildObjectAssociation, Set<IPath>> map = (Map<IRealBuildObjectAssociation, Set<IPath>>) storage
+ .getMap(type, false);
+ if (map != null) {
Set<Entry<IRealBuildObjectAssociation, Set<IPath>>> entrySet = map.entrySet();
for (Entry<IRealBuildObjectAssociation, Set<IPath>> entry : entrySet) {
IRealBuildObjectAssociation obj = entry.getKey();
println(" dumping " + assoc.getString() + " " + obj.getUniqueRealName()); //$NON-NLS-1$ //$NON-NLS-2$
Set<IPath> set = entry.getValue();
- if(set != null){
+ if (set != null) {
for (IPath path : set) {
println(" path \"" + path + "\""); //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -98,7 +101,7 @@ public class DbgTcmUtil {
println(" end dumping " + obj.getUniqueRealName()); //$NON-NLS-1$
}
}
-
+
println(" end type " + assoc.getString()); //$NON-NLS-1$
}
println("end storage dump"); //$NON-NLS-1$
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/FileInfoModification.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/FileInfoModification.java
index 438072afc74..52011296ccf 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/FileInfoModification.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/FileInfoModification.java
@@ -26,8 +26,7 @@ import org.eclipse.cdt.managedbuilder.tcmodification.IFileInfoModification;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IPath;
-public class FileInfoModification extends
- ToolListModification implements IFileInfoModification {
+public class FileInfoModification extends ToolListModification implements IFileInfoModification {
private String fFileExt;
private Set<IPath> fApplPathSet;
private IProject fProject;
@@ -59,7 +58,7 @@ public class FileInfoModification extends
@Override
protected Set<IPath> getToolApplicabilityPathSet(Tool realTool, boolean isProject) {
- if(fApplPathSet == null){
+ if (fApplPathSet == null) {
Set<IPath> s = new HashSet<IPath>(1);
s.add(getResourceInfo().getPath());
fApplPathSet = Collections.unmodifiableSet(s);
@@ -77,17 +76,17 @@ public class FileInfoModification extends
return tools;
}
- private String getFileExtension(){
- if(fFileExt == null){
+ private String getFileExtension() {
+ if (fFileExt == null) {
fFileExt = getResourceInfo().getPath().getFileExtension();
- if(fFileExt == null)
+ if (fFileExt == null)
fFileExt = ""; //$NON-NLS-1$
}
return fFileExt;
}
- private IProject getProject(){
- if(fProject == null){
+ private IProject getProject() {
+ if (fProject == null) {
fProject = getResourceInfo().getParent().getOwner().getProject();
}
return fProject;
@@ -95,12 +94,12 @@ public class FileInfoModification extends
@Override
public void restoreDefaults() {
-// 3.per-file : change to the tool from the parent folder's tool-chain suitable
-// for the given file. NOTE: the custom build step tool should be preserved!
- ResourceConfiguration rcInfo = (ResourceConfiguration)getResourceInfo();
+ // 3.per-file : change to the tool from the parent folder's tool-chain suitable
+ // for the given file. NOTE: the custom build step tool should be preserved!
+ ResourceConfiguration rcInfo = (ResourceConfiguration) getResourceInfo();
IFolderInfo parentFo = rcInfo.getParentFolderInfo();
String ext = rcInfo.getPath().getFileExtension();
- if(ext == null)
+ if (ext == null)
ext = ""; //$NON-NLS-1$
ITool tool = parentFo.getToolFromInputExtension(ext);
@@ -108,16 +107,16 @@ public class FileInfoModification extends
boolean add = true;
ITool[] curTools = getProjectTools();
- for(int i = 0; i < curTools.length; i++){
+ for (int i = 0; i < curTools.length; i++) {
ITool cur = curTools[i];
- if(ManagedBuildManager.getRealTool(cur) == realTool){
+ if (ManagedBuildManager.getRealTool(cur) == realTool) {
add = false;
- } else if (!cur.getCustomBuildStep()){
+ } else if (!cur.getCustomBuildStep()) {
changeProjectTools(cur, null);
}
}
- if(add && tool != null)
+ if (add && tool != null)
changeProjectTools(null, tool);
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/FolderInfoModification.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/FolderInfoModification.java
index cb4837455bf..a12353bea65 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/FolderInfoModification.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/FolderInfoModification.java
@@ -56,43 +56,45 @@ public class FolderInfoModification extends ToolListModification implements IFol
private Map<ToolChain, ToolChainCompatibilityInfoElement> fInCompatibleToolChains;
private PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> fParentObjectStorage;
private ConflictMatchSet fParentConflicts;
-// private PerTypeMapStorage fChildObjectStorage;
-// private ConflictMatchSet fChildConflicts;
+ // private PerTypeMapStorage fChildObjectStorage;
+ // private ConflictMatchSet fChildConflicts;
private boolean fCompatibilityInfoInited;
private ToolChainApplicabilityPaths fTcApplicabilityPaths;
public FolderInfoModification(FolderInfo foInfo) {
super(foInfo, foInfo.getTools());
- fSelectedToolChain = (ToolChain)foInfo.getToolChain();
- fRealToolChain = (ToolChain)ManagedBuildManager.getRealToolChain(fSelectedToolChain);
+ fSelectedToolChain = (ToolChain) foInfo.getToolChain();
+ fRealToolChain = (ToolChain) ManagedBuildManager.getRealToolChain(fSelectedToolChain);
}
public FolderInfoModification(FolderInfo foInfo, FolderInfoModification base) {
super(foInfo, base);
fSelectedToolChain = base.fSelectedToolChain;
- if(!fSelectedToolChain.isExtensionElement())
- fSelectedToolChain = (ToolChain)fSelectedToolChain.getExtensionObject();
+ if (!fSelectedToolChain.isExtensionElement())
+ fSelectedToolChain = (ToolChain) fSelectedToolChain.getExtensionObject();
fRealToolChain = base.fRealToolChain;
}
- private ConflictMatchSet getParentConflictMatchSet(){
- if(fParentConflicts == null){
+ private ConflictMatchSet getParentConflictMatchSet() {
+ if (fParentConflicts == null) {
PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage = getParentObjectStorage();
- fParentConflicts = ToolChainModificationManager.getInstance().getConflictInfo(IRealBuildObjectAssociation.OBJECT_TOOLCHAIN, storage);
+ fParentConflicts = ToolChainModificationManager.getInstance()
+ .getConflictInfo(IRealBuildObjectAssociation.OBJECT_TOOLCHAIN, storage);
}
return fParentConflicts;
}
- private PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> getParentObjectStorage(){
- if(fParentObjectStorage == null){
- fParentObjectStorage = TcModificationUtil.createParentObjectsRealToolToPathSet((FolderInfo)getResourceInfo());
+ private PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> getParentObjectStorage() {
+ if (fParentObjectStorage == null) {
+ fParentObjectStorage = TcModificationUtil
+ .createParentObjectsRealToolToPathSet((FolderInfo) getResourceInfo());
}
return fParentObjectStorage;
}
- private IToolChain[] getAllSysToolChains(){
- if(fAllSysToolChains == null)
+ private IToolChain[] getAllSysToolChains() {
+ if (fAllSysToolChains == null)
fAllSysToolChains = ManagedBuildManager.getRealToolChains();
return fAllSysToolChains;
}
@@ -106,20 +108,20 @@ public class FolderInfoModification extends ToolListModification implements IFol
public static class ToolChainCompatibilityInfoElement {
private ToolChain fTc;
private List<ConflictMatch> fErrComflictMatchList;
-// private List fWarningConflictMatchList;
+ // private List fWarningConflictMatchList;
private CompatibilityStatus fStatus;
- ToolChainCompatibilityInfoElement(ToolChain tc, List<ConflictMatch> errConflictList){
+ ToolChainCompatibilityInfoElement(ToolChain tc, List<ConflictMatch> errConflictList) {
fTc = tc;
- if(errConflictList != null && errConflictList.size() != 0)
+ if (errConflictList != null && errConflictList.size() != 0)
fErrComflictMatchList = errConflictList;
}
- public CompatibilityStatus getCompatibilityStatus(){
- if(fStatus == null){
+ public CompatibilityStatus getCompatibilityStatus() {
+ if (fStatus == null) {
int severity;
String message;
- if(fErrComflictMatchList != null){
+ if (fErrComflictMatchList != null) {
severity = IStatus.ERROR;
message = Messages.getString("FolderInfoModification.0"); //$NON-NLS-1$
} else {
@@ -131,35 +133,35 @@ public class FolderInfoModification extends ToolListModification implements IFol
return fStatus;
}
- public boolean isCompatible(){
+ public boolean isCompatible() {
return fErrComflictMatchList == null;
}
}
@Override
- public IToolChain[] getCompatibleToolChains(){
+ public IToolChain[] getCompatibleToolChains() {
initCompatibilityInfo();
- FolderInfo foInfo = (FolderInfo)getResourceInfo();
+ FolderInfo foInfo = (FolderInfo) getResourceInfo();
List<ToolChain> l = new ArrayList<ToolChain>(fCompatibleToolChains.size());
Set<ToolChain> keySet = fCompatibleToolChains.keySet();
for (ToolChain tc : keySet) {
- if(tc != fRealToolChain && foInfo.isToolChainCompatible(fRealToolChain, tc))
+ if (tc != fRealToolChain && foInfo.isToolChainCompatible(fRealToolChain, tc))
l.add(tc);
}
return l.toArray(new ToolChain[l.size()]);
}
@Override
- public CompatibilityStatus getToolChainCompatibilityStatus(){
+ public CompatibilityStatus getToolChainCompatibilityStatus() {
return getCurrentCompatibilityInfo().getCompatibilityStatus();
}
- private ToolChainCompatibilityInfoElement getCurrentCompatibilityInfo(){
- if(fCurrentCompatibilityInfo == null){
+ private ToolChainCompatibilityInfoElement getCurrentCompatibilityInfo() {
+ if (fCurrentCompatibilityInfo == null) {
initCompatibilityInfo();
ToolChainCompatibilityInfoElement info = fCompatibleToolChains.get(fRealToolChain);
- if(info == null)
+ if (info == null)
info = fInCompatibleToolChains.get(fRealToolChain);
fCurrentCompatibilityInfo = info;
}
@@ -167,25 +169,25 @@ public class FolderInfoModification extends ToolListModification implements IFol
}
@Override
- public boolean isToolChainCompatible(){
+ public boolean isToolChainCompatible() {
return getCurrentCompatibilityInfo().isCompatible();
}
- private void initCompatibilityInfo(){
- if(fCompatibilityInfoInited)
+ private void initCompatibilityInfo() {
+ if (fCompatibilityInfoInited)
return;
fCompatibleToolChains = new HashMap<ToolChain, ToolChainCompatibilityInfoElement>();
fInCompatibleToolChains = new HashMap<ToolChain, ToolChainCompatibilityInfoElement>();
ConflictMatchSet parentConflicts = getParentConflictMatchSet();
- ToolChain sysTCs[] = (ToolChain[])getAllSysToolChains();
+ ToolChain sysTCs[] = (ToolChain[]) getAllSysToolChains();
@SuppressWarnings("unchecked")
- Map<ToolChain, List<ConflictMatch>> conflictMap = (Map<ToolChain, List<ConflictMatch>>) parentConflicts.fObjToConflictListMap;
+ Map<ToolChain, List<ConflictMatch>> conflictMap = (Map<ToolChain, List<ConflictMatch>>) parentConflicts.fObjToConflictListMap;
for (ToolChain tc : sysTCs) {
List<ConflictMatch> l = conflictMap.get(tc);
ToolChainCompatibilityInfoElement info = new ToolChainCompatibilityInfoElement(tc, l);
- if(info.isCompatible()){
+ if (info.isCompatible()) {
fCompatibleToolChains.put(tc, info);
} else {
fInCompatibleToolChains.put(tc, info);
@@ -196,36 +198,36 @@ public class FolderInfoModification extends ToolListModification implements IFol
}
@Override
- public IToolChain getToolChain(){
+ public IToolChain getToolChain() {
return fSelectedToolChain;
}
@Override
- public final void setToolChain(IToolChain tc){
+ public final void setToolChain(IToolChain tc) {
setToolChain(tc, false);
}
- public void setToolChain(IToolChain tc, boolean force){
- if(tc == fSelectedToolChain && !force)
+ public void setToolChain(IToolChain tc, boolean force) {
+ if (tc == fSelectedToolChain && !force)
return;
- applyToolChain((ToolChain)tc);
+ applyToolChain((ToolChain) tc);
- fSelectedToolChain = (ToolChain)tc;
+ fSelectedToolChain = (ToolChain) tc;
IToolChain newReal = ManagedBuildManager.getRealToolChain(tc);
- if(newReal == fRealToolChain && !force)
+ if (newReal == fRealToolChain && !force)
return;
- fRealToolChain = (ToolChain)newReal;
+ fRealToolChain = (ToolChain) newReal;
-// setProjectTools(tc.getTools());
-// applyToolChain(fSelectedToolChain);
+ // setProjectTools(tc.getTools());
+ // applyToolChain(fSelectedToolChain);
clearToolInfo(tc.getTools());
fCurrentCompatibilityInfo = null;
}
- protected void clearToolChainCompatibilityInfo(){
+ protected void clearToolChainCompatibilityInfo() {
fCompatibilityInfoInited = false;
fCompatibleToolChains = null;
fInCompatibleToolChains = null;
@@ -236,8 +238,8 @@ public class FolderInfoModification extends ToolListModification implements IFol
protected boolean canRemove(ITool realTool) {
IToolChain extTc = ManagedBuildManager.getExtensionToolChain(fSelectedToolChain);
ITool[] tools = extTc.getTools();
- for(int i = 0; i < tools.length; i++){
- if(realTool == ManagedBuildManager.getRealTool(tools[i]))
+ for (int i = 0; i < tools.length; i++) {
+ if (realTool == ManagedBuildManager.getRealTool(tools[i]))
return false;
}
@@ -255,11 +257,11 @@ public class FolderInfoModification extends ToolListModification implements IFol
Set<String> curInputExts = null;
Set<String> inputExts = getInputExtsSet();
for (String ext : exts) {
- if(inputExts.contains(ext)){
- if(curInputExts == null)
+ if (inputExts.contains(ext)) {
+ if (curInputExts == null)
curInputExts = new HashSet<String>(Arrays.asList(fromTool.getPrimaryInputExtensions()));
- if(curInputExts.contains(ext)){
+ if (curInputExts.contains(ext)) {
return true;
}
}
@@ -272,12 +274,12 @@ public class FolderInfoModification extends ToolListModification implements IFol
String exts[] = tool.getPrimaryInputExtensions();
Set<String> extsSet = new HashSet<String>(Arrays.asList(exts));
Set<Tool> conflictsSet = null;
- for(int i = 0; i < tools.length; i++){
+ for (int i = 0; i < tools.length; i++) {
Tool t = tools[i];
- if(t == tool)
+ if (t == tool)
continue;
- if(TcModificationUtil.containCommonEntries(extsSet, t.getPrimaryInputExtensions())){
- if(conflictsSet == null)
+ if (TcModificationUtil.containCommonEntries(extsSet, t.getPrimaryInputExtensions())) {
+ if (conflictsSet == null)
conflictsSet = new HashSet<Tool>();
conflictsSet.add(t);
@@ -285,14 +287,14 @@ public class FolderInfoModification extends ToolListModification implements IFol
}
- if(conflictsSet == null)
+ if (conflictsSet == null)
conflictsSet = Collections.emptySet();
return conflictsSet;
}
@Override
protected Set<IPath> getToolApplicabilityPathSet(Tool realTool, boolean isProject) {
- if(isProject)
+ if (isProject)
return getToolChainApplicabilityPaths().fToolPathMap.get(realTool);
return getToolChainApplicabilityPaths().fFolderInfoPaths;
}
@@ -300,16 +302,16 @@ public class FolderInfoModification extends ToolListModification implements IFol
@Override
protected Tool[] filterTools(Tool[] tools) {
IResourceInfo rcInfo = getResourceInfo();
- return (Tool[])((FolderInfo)rcInfo).filterTools(tools, rcInfo.getParent().getManagedProject());
+ return (Tool[]) ((FolderInfo) rcInfo).filterTools(tools, rcInfo.getParent().getManagedProject());
}
- private ToolChainApplicabilityPaths getToolChainApplicabilityPaths(){
+ private ToolChainApplicabilityPaths getToolChainApplicabilityPaths() {
initToolChainApplicabilityPaths();
return fTcApplicabilityPaths;
}
- private void initToolChainApplicabilityPaths(){
- if(fTcApplicabilityPaths != null)
+ private void initToolChainApplicabilityPaths() {
+ if (fTcApplicabilityPaths != null)
return;
ToolChainApplicabilityPaths tcApplicabilityPaths = new ToolChainApplicabilityPaths();
@@ -331,7 +333,7 @@ public class FolderInfoModification extends ToolListModification implements IFol
foInfoPaths.add(path);
Map<Tool, Set<IPath>> toolPathsMap = tcApplicabilityPaths.fToolPathMap;
- if(toolSet != null){
+ if (toolSet != null) {
for (IRealBuildObjectAssociation oa : toolSet) {
Tool tool = (Tool) oa;
Set<IPath> set = new HashSet<IPath>();
@@ -346,17 +348,18 @@ public class FolderInfoModification extends ToolListModification implements IFol
}
@Override
- protected void clearToolInfo(ITool[] tools){
+ protected void clearToolInfo(ITool[] tools) {
super.clearToolInfo(tools);
fTcApplicabilityPaths = null;
}
- private static void putToolInfo(Set<Tool> ct, Map<Tool, Set<IPath>> toolPathsMap, Set<IPath> fileInfoPaths, IPath p){
- if(ct != null && ct.size() != 0){
+ private static void putToolInfo(Set<Tool> ct, Map<Tool, Set<IPath>> toolPathsMap, Set<IPath> fileInfoPaths,
+ IPath p) {
+ if (ct != null && ct.size() != 0) {
for (Tool t : ct) {
Set<IPath> set = toolPathsMap.get(t);
- if(set != null){
- if(fileInfoPaths != null)
+ if (set != null) {
+ if (fileInfoPaths != null)
fileInfoPaths.add(p);
set.add(p);
}
@@ -364,8 +367,11 @@ public class FolderInfoModification extends ToolListModification implements IFol
}
}
- private static void calculateChildPaths(TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> pathMap, IPath path, ToolChain tc, Set<IPath> tcPaths, Map<Tool,Set<IPath>> toolPathsMap, Set<IPath> fileInfoPaths){
- SortedMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> directCMap = PathComparator.getDirectChildPathMap(pathMap, path);
+ private static void calculateChildPaths(TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> pathMap,
+ IPath path, ToolChain tc, Set<IPath> tcPaths, Map<Tool, Set<IPath>> toolPathsMap,
+ Set<IPath> fileInfoPaths) {
+ SortedMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> directCMap = PathComparator
+ .getDirectChildPathMap(pathMap, path);
Set<Entry<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>>> entrySet = directCMap.entrySet();
for (Entry<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> entry : entrySet) {
PerTypeSetStorage<? extends IRealBuildObjectAssociation> cst = entry.getValue();
@@ -375,12 +381,11 @@ public class FolderInfoModification extends ToolListModification implements IFol
@SuppressWarnings("unchecked")
Set<Tool> ct = (Set<Tool>) cst.getSet(IRealBuildObjectAssociation.OBJECT_TOOL, false);
-
- if(ctc == null || ctc.size() == 0){
+ if (ctc == null || ctc.size() == 0) {
//fileInfo, check for tools
putToolInfo(ct, toolPathsMap, fileInfoPaths, entry.getKey());
} else {
- if(ctc.contains(tc)){
+ if (ctc.contains(tc)) {
IPath cp = entry.getKey();
tcPaths.add(cp);
putToolInfo(ct, toolPathsMap, null, entry.getKey());
@@ -391,28 +396,29 @@ public class FolderInfoModification extends ToolListModification implements IFol
}
}
- private void applyToolChain(ToolChain newNonRealTc){
- ToolChain newRealTc = (ToolChain)ManagedBuildManager.getRealToolChain(newNonRealTc);
+ private void applyToolChain(ToolChain newNonRealTc) {
+ ToolChain newRealTc = (ToolChain) ManagedBuildManager.getRealToolChain(newNonRealTc);
ToolChainApplicabilityPaths tcApplicability = getToolChainApplicabilityPaths();
PerTypeMapStorage<? extends IRealBuildObjectAssociation, Set<IPath>> storage = getCompleteObjectStore();
@SuppressWarnings("unchecked")
- Map<ToolChain, Set<IPath>> tcMap = (Map<ToolChain, Set<IPath>>) storage.getMap(IRealBuildObjectAssociation.OBJECT_TOOLCHAIN, false);
+ Map<ToolChain, Set<IPath>> tcMap = (Map<ToolChain, Set<IPath>>) storage
+ .getMap(IRealBuildObjectAssociation.OBJECT_TOOLCHAIN, false);
@SuppressWarnings("unchecked")
- Map<Tool, Set<IPath>> toolMap = (Map<Tool, Set<IPath>>) storage.getMap(IRealBuildObjectAssociation.OBJECT_TOOL, false);
-
+ Map<Tool, Set<IPath>> toolMap = (Map<Tool, Set<IPath>>) storage.getMap(IRealBuildObjectAssociation.OBJECT_TOOL,
+ false);
TcModificationUtil.removePaths(tcMap, fRealToolChain, tcApplicability.fFolderInfoPaths);
TcModificationUtil.addPaths(tcMap, newRealTc, tcApplicability.fFolderInfoPaths);
- Tool[] newTools = (Tool[])newNonRealTc.getTools();
+ Tool[] newTools = (Tool[]) newNonRealTc.getTools();
- for(int i = 0; i < newTools.length; i++){
- newTools[i] = (Tool)ManagedBuildManager.getRealTool(newTools[i]);
+ for (int i = 0; i < newTools.length; i++) {
+ newTools[i] = (Tool) ManagedBuildManager.getRealTool(newTools[i]);
}
Set<Entry<Tool, Set<IPath>>> entrySet = tcApplicability.fToolPathMap.entrySet();
- for(Iterator<Entry<Tool, Set<IPath>>> iter = entrySet.iterator(); iter.hasNext(); ){
+ for (Iterator<Entry<Tool, Set<IPath>>> iter = entrySet.iterator(); iter.hasNext();) {
Map.Entry<Tool, Set<IPath>> entry = iter.next();
Tool tool = entry.getKey();
Set<IPath> pathSet = entry.getValue();
@@ -420,49 +426,49 @@ public class FolderInfoModification extends ToolListModification implements IFol
TcModificationUtil.removePaths(toolMap, tool, pathSet);
}
- for(int i = 0; i < newTools.length; i++){
+ for (int i = 0; i < newTools.length; i++) {
TcModificationUtil.addPaths(toolMap, newTools[i], tcApplicability.fFolderInfoPaths);
}
- if(tcApplicability.fFileInfoPaths.size() != 0){
- FolderInfo foInfo = (FolderInfo)getResourceInfo();
+ if (tcApplicability.fFileInfoPaths.size() != 0) {
+ FolderInfo foInfo = (FolderInfo) getResourceInfo();
IManagedProject mProj = foInfo.getParent().getManagedProject();
IProject project = mProj.getOwner().getProject();
- Tool[] filtered = (Tool[])foInfo.filterTools(newTools, mProj);
- if(filtered.length != 0){
+ Tool[] filtered = (Tool[]) foInfo.filterTools(newTools, mProj);
+ if (filtered.length != 0) {
for (IPath p : tcApplicability.fFileInfoPaths) {
boolean found = false;
String ext = p.getFileExtension();
- if(ext == null)
+ if (ext == null)
ext = ""; //$NON-NLS-1$
- for(int i = 0; i < filtered.length; i++){
- if(filtered[i].buildsFileType(ext, project)){
+ for (int i = 0; i < filtered.length; i++) {
+ if (filtered[i].buildsFileType(ext, project)) {
TcModificationUtil.addPath(toolMap, filtered[i], p);
found = true;
break;
}
}
- if(!found){
- if (DbgTcmUtil.DEBUG){
+ if (!found) {
+ if (DbgTcmUtil.DEBUG) {
DbgTcmUtil.println("no tools found for path " + p); //$NON-NLS-1$
}
}
}
- } else if (DbgTcmUtil.DEBUG){
+ } else if (DbgTcmUtil.DEBUG) {
DbgTcmUtil.println("no filtered tools"); //$NON-NLS-1$
}
}
}
- private IToolChain getDefaultToolChain(){
+ private IToolChain getDefaultToolChain() {
IResourceInfo rcInfo = getResourceInfo();
IToolChain defaultTc = null;
if (rcInfo.getPath().segmentCount() == 0) {
-// 1.Per-project : change to the "default" tool-chain defined in the extension
-// super-class of the project configuration. NOTE: the makefile project case might
-// need a special handling in this case.
+ // 1.Per-project : change to the "default" tool-chain defined in the extension
+ // super-class of the project configuration. NOTE: the makefile project case might
+ // need a special handling in this case.
IConfiguration cfg = rcInfo.getParent();
IConfiguration extCfg = cfg.getParent();
@@ -473,14 +479,14 @@ public class FolderInfoModification extends ToolListModification implements IFol
}
}
} else {
-// 2.per-folder : change to the same tool-chain as the one used by the parent
-// folder.
- IFolderInfo parentFo = ((ResourceInfo)rcInfo).getParentFolderInfo();
+ // 2.per-folder : change to the same tool-chain as the one used by the parent
+ // folder.
+ IFolderInfo parentFo = ((ResourceInfo) rcInfo).getParentFolderInfo();
IToolChain tc = parentFo.getToolChain();
defaultTc = ManagedBuildManager.getExtensionToolChain(tc);
}
- if(defaultTc != null && defaultTc.getId().equals(ConfigurationDataProvider.PREF_TC_ID))
+ if (defaultTc != null && defaultTc.getId().equals(ConfigurationDataProvider.PREF_TC_ID))
defaultTc = null;
return defaultTc;
@@ -489,7 +495,7 @@ public class FolderInfoModification extends ToolListModification implements IFol
@Override
public final void restoreDefaults() {
IToolChain tc = getDefaultToolChain();
- if(tc != null){
+ if (tc != null) {
setToolChain(tc, true);
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/IObjectSet.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/IObjectSet.java
index d91661104ca..9726af9749b 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/IObjectSet.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/IObjectSet.java
@@ -17,7 +17,6 @@ import java.util.Collection;
import org.eclipse.cdt.managedbuilder.internal.core.IRealBuildObjectAssociation;
-
public interface IObjectSet {
int getObjectType();
@@ -25,10 +24,10 @@ public interface IObjectSet {
IRealBuildObjectAssociation[] getRealBuildObjects();
Collection<IRealBuildObjectAssociation> getRealBuildObjects(Collection<IRealBuildObjectAssociation> list);
-
+
boolean matchesObject(IRealBuildObjectAssociation obj);
-
+
boolean retainMatches(Collection<IRealBuildObjectAssociation> collection);
-
+
public int getNumObjects();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/Messages.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/Messages.java
index 7ba346547f1..6d27c201655 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/Messages.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/Messages.java
@@ -19,8 +19,7 @@ import java.util.ResourceBundle;
public class Messages {
private static final String BUNDLE_NAME = "org.eclipse.cdt.managedbuilder.internal.tcmodification.ToolChainModificationMessages"; //$NON-NLS-1$
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
private Messages() {
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ObjectSet.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ObjectSet.java
index c10520e2c1f..8efd5a250cb 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ObjectSet.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ObjectSet.java
@@ -24,7 +24,7 @@ public class ObjectSet implements IObjectSet {
private int fObjectType;
private Set<IRealBuildObjectAssociation> fObjectSet;
- public ObjectSet(int objectType, Set<IRealBuildObjectAssociation> objectSet){
+ public ObjectSet(int objectType, Set<IRealBuildObjectAssociation> objectSet) {
fObjectType = objectType;
fObjectSet = objectSet;
}
@@ -41,7 +41,7 @@ public class ObjectSet implements IObjectSet {
@Override
public Collection<IRealBuildObjectAssociation> getRealBuildObjects(Collection<IRealBuildObjectAssociation> set) {
- if(set == null)
+ if (set == null)
set = new HashSet<IRealBuildObjectAssociation>();
set.addAll(fObjectSet);
@@ -66,13 +66,13 @@ public class ObjectSet implements IObjectSet {
@SuppressWarnings("nls")
@Override
- public String toString(){
+ public String toString() {
StringBuilder buf = new StringBuilder();
buf.append(MatchObjectElement.TypeToStringAssociation.getAssociation(fObjectType).getString());
buf.append("[");
boolean isFirst = true;
for (IRealBuildObjectAssociation obj : fObjectSet) {
- if(isFirst){
+ if (isFirst) {
buf.append(", ");
isFirst = false;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ObjectSetList.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ObjectSetList.java
index 72c00d0d62f..8270198343c 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ObjectSetList.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ObjectSetList.java
@@ -13,21 +13,20 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.internal.tcmodification;
-
public class ObjectSetList {
private IObjectSet[] fObjectSets;
-
- public ObjectSetList(IObjectSet[] objects){
+
+ public ObjectSetList(IObjectSet[] objects) {
this(objects, true);
}
- ObjectSetList(IObjectSet[] objects, boolean copy){
- if(copy)
+ ObjectSetList(IObjectSet[] objects, boolean copy) {
+ if (copy)
objects = objects.clone();
fObjectSets = objects;
}
- public IObjectSet[] getObjectSets(){
+ public IObjectSet[] getObjectSets() {
return fObjectSets.clone();
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ObjectTypeBasedStorage.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ObjectTypeBasedStorage.java
index ab1b6e8d968..fb72906c6d7 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ObjectTypeBasedStorage.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ObjectTypeBasedStorage.java
@@ -17,7 +17,7 @@ import org.eclipse.cdt.managedbuilder.internal.core.IRealBuildObjectAssociation;
/**
* The class implements the storage organized by types extending
- * {@link IRealBuildObjectAssociation}.
+ * {@link IRealBuildObjectAssociation}.
*
* @param <T> - the type of object being stored.
*/
@@ -28,21 +28,18 @@ public final class ObjectTypeBasedStorage<T> implements Cloneable {
private static final int CFG_INDEX = 3;
private static final int SIZE = 4;
- private static final int[] OBJECT_TYPES = new int[]{
- IRealBuildObjectAssociation.OBJECT_TOOL,
- IRealBuildObjectAssociation.OBJECT_TOOLCHAIN,
- IRealBuildObjectAssociation.OBJECT_BUILDER,
- IRealBuildObjectAssociation.OBJECT_CONFIGURATION,
- };
-
+ private static final int[] OBJECT_TYPES = new int[] { IRealBuildObjectAssociation.OBJECT_TOOL,
+ IRealBuildObjectAssociation.OBJECT_TOOLCHAIN, IRealBuildObjectAssociation.OBJECT_BUILDER,
+ IRealBuildObjectAssociation.OBJECT_CONFIGURATION, };
+
@SuppressWarnings("unchecked")
private T fStorage[] = (T[]) new Object[SIZE];
-
- public static int[] getSupportedObjectTypes(){
+
+ public static int[] getSupportedObjectTypes() {
return OBJECT_TYPES.clone();
}
-
- private int getIndex(int type){
+
+ private int getIndex(int type) {
switch (type) {
case IRealBuildObjectAssociation.OBJECT_TOOL:
return TOOL_INDEX;
@@ -56,27 +53,27 @@ public final class ObjectTypeBasedStorage<T> implements Cloneable {
throw new IllegalArgumentException();
}
}
-
-// private int getType(int index){
-// switch (index) {
-// case TOOL_INDEX:
-// return IRealBuildObjectAssociation.OBJECT_TOOL;
-// case TOOLCHAIN_INDEX:
-// return IRealBuildObjectAssociation.OBJECT_TOOLCHAIN;
-// case BUILDER_INDEX:
-// return IRealBuildObjectAssociation.OBJECT_BUILDER;
-// case CFG_INDEX:
-// return IRealBuildObjectAssociation.OBJECT_CONFIGURATION;
-// default:
-// throw new IllegalArgumentException();
-// }
-// }
-
- public T get(int type){
+
+ // private int getType(int index){
+ // switch (index) {
+ // case TOOL_INDEX:
+ // return IRealBuildObjectAssociation.OBJECT_TOOL;
+ // case TOOLCHAIN_INDEX:
+ // return IRealBuildObjectAssociation.OBJECT_TOOLCHAIN;
+ // case BUILDER_INDEX:
+ // return IRealBuildObjectAssociation.OBJECT_BUILDER;
+ // case CFG_INDEX:
+ // return IRealBuildObjectAssociation.OBJECT_CONFIGURATION;
+ // default:
+ // throw new IllegalArgumentException();
+ // }
+ // }
+
+ public T get(int type) {
return fStorage[getIndex(type)];
}
-
- public T set(int type, T value){
+
+ public T set(int type, T value) {
int index = getIndex(type);
T oldValue = fStorage[index];
fStorage[index] = value;
@@ -84,10 +81,10 @@ public final class ObjectTypeBasedStorage<T> implements Cloneable {
}
@Override
- public Object clone(){
+ public Object clone() {
try {
@SuppressWarnings("unchecked")
- ObjectTypeBasedStorage<T> clone = (ObjectTypeBasedStorage<T>)super.clone();
+ ObjectTypeBasedStorage<T> clone = (ObjectTypeBasedStorage<T>) super.clone();
clone.fStorage = fStorage.clone();
return clone;
} catch (CloneNotSupportedException e) {
@@ -95,10 +92,10 @@ public final class ObjectTypeBasedStorage<T> implements Cloneable {
return null;
}
}
-
- public boolean isEmpty(){
- for(int i = 0; i < fStorage.length; i++){
- if(fStorage[i] != null)
+
+ public boolean isEmpty() {
+ for (int i = 0; i < fStorage.length; i++) {
+ if (fStorage[i] != null)
return false;
}
return true;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PathComparator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PathComparator.java
index 755ce694142..52f60f0a29b 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PathComparator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PathComparator.java
@@ -26,15 +26,15 @@ import org.eclipse.core.runtime.IPath;
public class PathComparator implements Comparator<IPath> {
public static PathComparator INSTANCE = new PathComparator();
-// public static final SortedSet EMPTY_SET = Collections.unmodifiableSortedSet(new TreeSet(INSTANCE));
-// public static final SortedMap EMPTY_MAP = Collections.unmodifiableSortedMap(new TreeMap(INSTANCE));
+ // public static final SortedSet EMPTY_SET = Collections.unmodifiableSortedSet(new TreeSet(INSTANCE));
+ // public static final SortedMap EMPTY_MAP = Collections.unmodifiableSortedMap(new TreeMap(INSTANCE));
- private PathComparator(){
+ private PathComparator() {
}
@Override
public int compare(IPath arg0, IPath arg1) {
- if(arg0 == arg1)
+ if (arg0 == arg1)
return 0;
IPath path1 = arg0;
@@ -43,19 +43,19 @@ public class PathComparator implements Comparator<IPath> {
int length1 = path1.segmentCount();
int length2 = path2.segmentCount();
int i = 0;
- for(; i < length1; i++){
- if(i >= length2){
+ for (; i < length1; i++) {
+ if (i >= length2) {
//path2 is a prefix of path1
return 1;
}
int comparison = path1.segment(i).compareTo(path2.segment(i));
- if(comparison == 0)
+ if (comparison == 0)
continue;
//
return comparison;
}
- if(length1 == length2){
+ if (length1 == length2) {
//equal
return 0;
}
@@ -63,36 +63,40 @@ public class PathComparator implements Comparator<IPath> {
return -1;
}
- public static IPath getNext(IPath path){
- if(path.segmentCount() == 0)
+ public static IPath getNext(IPath path) {
+ if (path.segmentCount() == 0)
return null;
String newLast = path.lastSegment() + '\0';
return path.removeLastSegments(1).append(newLast);
}
- public static IPath getFirstChild(IPath path){
+ public static IPath getFirstChild(IPath path) {
return path.append("\0"); //$NON-NLS-1$
}
- public static SortedMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> getChildPathMap(SortedMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> map, IPath path, boolean includeThis, boolean copy){
+ public static SortedMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> getChildPathMap(
+ SortedMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> map, IPath path, boolean includeThis,
+ boolean copy) {
IPath start = includeThis ? path : getFirstChild(path);
IPath next = getNext(path);
- SortedMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> result = next != null ? map.subMap(start, next) : map.tailMap(start);
- if(copy)
+ SortedMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> result = next != null ? map.subMap(start, next)
+ : map.tailMap(start);
+ if (copy)
result = new TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>>(result);
return result;
}
- public static SortedSet<IPath> getChildPathSet(SortedSet<IPath> set, IPath path, boolean includeThis, boolean copy){
+ public static SortedSet<IPath> getChildPathSet(SortedSet<IPath> set, IPath path, boolean includeThis,
+ boolean copy) {
IPath start = includeThis ? path : getFirstChild(path);
IPath next = getNext(path);
SortedSet<IPath> result = next != null ? set.subSet(start, next) : set.tailSet(start);
- if(copy)
+ if (copy)
result = new TreeSet<IPath>(result);
return result;
}
- public static SortedSet<IPath> getDirectChildPathSet(SortedSet<IPath> set, IPath path){
+ public static SortedSet<IPath> getDirectChildPathSet(SortedSet<IPath> set, IPath path) {
//all children
SortedSet<IPath> children = getChildPathSet(set, path, false, false);
SortedSet<IPath> result = new TreeSet<IPath>(INSTANCE);
@@ -104,12 +108,16 @@ public class PathComparator implements Comparator<IPath> {
return result;
}
- public static SortedMap<IPath,PerTypeSetStorage<IRealBuildObjectAssociation>> getDirectChildPathMap(SortedMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> map, IPath path){
+ public static SortedMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> getDirectChildPathMap(
+ SortedMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> map, IPath path) {
//all children
- SortedMap<IPath,PerTypeSetStorage<IRealBuildObjectAssociation>> children = getChildPathMap(map, path, false, false);
- SortedMap<IPath,PerTypeSetStorage<IRealBuildObjectAssociation>> result = new TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>>(INSTANCE);
- for(Iterator<Map.Entry<IPath,PerTypeSetStorage<IRealBuildObjectAssociation>>> iter = children.entrySet().iterator(); iter.hasNext(); iter = children.entrySet().iterator()){
- Map.Entry<IPath,PerTypeSetStorage<IRealBuildObjectAssociation>> entry = iter.next();
+ SortedMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> children = getChildPathMap(map, path, false,
+ false);
+ SortedMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> result = new TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>>(
+ INSTANCE);
+ for (Iterator<Map.Entry<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>>> iter = children.entrySet()
+ .iterator(); iter.hasNext(); iter = children.entrySet().iterator()) {
+ Map.Entry<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> entry = iter.next();
IPath childPath = entry.getKey();
result.put(childPath, entry.getValue());
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PerTypeMapStorage.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PerTypeMapStorage.java
index 8be8cbb82ad..11a3ccabd1d 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PerTypeMapStorage.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PerTypeMapStorage.java
@@ -20,7 +20,7 @@ import org.eclipse.cdt.managedbuilder.internal.core.IRealBuildObjectAssociation;
/**
* The class implements the storage of maps (Map<K, V>) organized by types extending
- * {@link IRealBuildObjectAssociation}.
+ * {@link IRealBuildObjectAssociation}.
*
* @param <K> - the type of keys of the map
* @param <V> - the type of values in the map
@@ -28,33 +28,33 @@ import org.eclipse.cdt.managedbuilder.internal.core.IRealBuildObjectAssociation;
public class PerTypeMapStorage<K extends IRealBuildObjectAssociation, V> implements Cloneable {
private ObjectTypeBasedStorage<Map<K, V>> fStorage = new ObjectTypeBasedStorage<Map<K, V>>();
- public Map<K, V> getMap(int type, boolean create){
+ public Map<K, V> getMap(int type, boolean create) {
Map<K, V> map = fStorage.get(type);
- if(map == null && create){
+ if (map == null && create) {
map = createMap(null);
fStorage.set(type, map);
}
return map;
}
-
- protected Map<K, V> createMap(Map<K, V> map){
- if(map == null) {
+
+ protected Map<K, V> createMap(Map<K, V> map) {
+ if (map == null) {
return new HashMap<K, V>();
}
@SuppressWarnings("unchecked")
- Map<K, V> clone = (Map<K, V>)((HashMap<K, V>)map).clone();
+ Map<K, V> clone = (Map<K, V>) ((HashMap<K, V>) map).clone();
return clone;
}
@Override
- public Object clone(){
+ public Object clone() {
try {
@SuppressWarnings("unchecked")
- PerTypeMapStorage<K, V> clone = (PerTypeMapStorage<K, V>)super.clone();
+ PerTypeMapStorage<K, V> clone = (PerTypeMapStorage<K, V>) super.clone();
int types[] = ObjectTypeBasedStorage.getSupportedObjectTypes();
- for(int i = 0; i < types.length; i++){
+ for (int i = 0; i < types.length; i++) {
Map<K, V> o = clone.fStorage.get(types[i]);
- if(o != null){
+ if (o != null) {
clone.fStorage.set(types[i], clone.createMap(o));
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PerTypeSetStorage.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PerTypeSetStorage.java
index 18e35256fba..1438e261b62 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PerTypeSetStorage.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/PerTypeSetStorage.java
@@ -18,36 +18,36 @@ import java.util.Set;
public class PerTypeSetStorage<T> implements Cloneable {
private ObjectTypeBasedStorage<Set<T>> fStorage = new ObjectTypeBasedStorage<Set<T>>();
-
- public Set<T> getSet(int type, boolean create){
+
+ public Set<T> getSet(int type, boolean create) {
Set<T> set = fStorage.get(type);
- if(set == null && create){
+ if (set == null && create) {
set = createSet(null);
fStorage.set(type, set);
}
return set;
}
-
- protected Set<T> createSet(Set<T> set){
- if(set == null)
+
+ protected Set<T> createSet(Set<T> set) {
+ if (set == null)
return new LinkedHashSet<T>();
@SuppressWarnings("unchecked")
- Set<T> clone = (Set<T>)((LinkedHashSet<T>)set).clone();
+ Set<T> clone = (Set<T>) ((LinkedHashSet<T>) set).clone();
return clone;
}
@Override
- public Object clone(){
+ public Object clone() {
try {
@SuppressWarnings("unchecked")
- PerTypeSetStorage<T> clone = (PerTypeSetStorage<T>)super.clone();
+ PerTypeSetStorage<T> clone = (PerTypeSetStorage<T>) super.clone();
@SuppressWarnings("unchecked")
- ObjectTypeBasedStorage<Set<T>> storageClone = (ObjectTypeBasedStorage<Set<T>>)fStorage.clone();
+ ObjectTypeBasedStorage<Set<T>> storageClone = (ObjectTypeBasedStorage<Set<T>>) fStorage.clone();
clone.fStorage = storageClone;
int types[] = ObjectTypeBasedStorage.getSupportedObjectTypes();
- for(int i = 0; i < types.length; i++){
- Set<T> o = clone.fStorage.get(types[i]);
- if(o != null){
+ for (int i = 0; i < types.length; i++) {
+ Set<T> o = clone.fStorage.get(types[i]);
+ if (o != null) {
clone.fStorage.set(types[i], createSet(o));
}
}
@@ -58,14 +58,14 @@ public class PerTypeSetStorage<T> implements Cloneable {
return null;
}
- public boolean isEmpty(boolean emptySetAsNull){
- if(fStorage.isEmpty())
+ public boolean isEmpty(boolean emptySetAsNull) {
+ if (fStorage.isEmpty())
return true;
- if(emptySetAsNull){
+ if (emptySetAsNull) {
int types[] = ObjectTypeBasedStorage.getSupportedObjectTypes();
- for(int i = 0; i < types.length; i++){
- Set<T> o = fStorage.get(types[i]);
- if(o != null && !o.isEmpty())
+ for (int i = 0; i < types.length; i++) {
+ Set<T> o = fStorage.get(types[i]);
+ if (o != null && !o.isEmpty())
return false;
}
return true;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/TcModificationUtil.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/TcModificationUtil.java
index ab8920786f1..12be582a12d 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/TcModificationUtil.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/TcModificationUtil.java
@@ -45,97 +45,106 @@ import org.eclipse.core.runtime.IPath;
public class TcModificationUtil {
- private static void processFolderInfoChildren(FolderInfo foInfo, PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage, IToolChain rtc, Map<IRealBuildObjectAssociation, Set<IPath>> tcMap, Map<IRealBuildObjectAssociation, Set<IPath>> toolMap, boolean addSkipInfo){
+ private static void processFolderInfoChildren(FolderInfo foInfo,
+ PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage, IToolChain rtc,
+ Map<IRealBuildObjectAssociation, Set<IPath>> tcMap, Map<IRealBuildObjectAssociation, Set<IPath>> toolMap,
+ boolean addSkipInfo) {
IResourceInfo rcInfos[] = foInfo.getDirectChildResourceInfos();
- for(int i = 0; i < rcInfos.length; i++){
+ for (int i = 0; i < rcInfos.length; i++) {
IResourceInfo rc = rcInfos[i];
- if(rc instanceof ResourceConfiguration){
- ResourceConfiguration fi = (ResourceConfiguration)rc;
+ if (rc instanceof ResourceConfiguration) {
+ ResourceConfiguration fi = (ResourceConfiguration) rc;
IPath p = fi.getPath();
ITool[] tools = fi.getTools();
- processTools(storage.getMap(IRealBuildObjectAssociation.OBJECT_FILE_INFO, true), p, tools, toolMap, addSkipInfo);
+ processTools(storage.getMap(IRealBuildObjectAssociation.OBJECT_FILE_INFO, true), p, tools, toolMap,
+ addSkipInfo);
} else {
- FolderInfo childFoInfo = (FolderInfo)rc;
+ FolderInfo childFoInfo = (FolderInfo) rc;
IToolChain tc = foInfo.getToolChain();
tc = ManagedBuildManager.getRealToolChain(tc);
- if(tc == rtc){
- if(addSkipInfo && tcMap != null){
- Set<IPath> set = getPathTreeSet(tcMap, (ToolChain)tc);
+ if (tc == rtc) {
+ if (addSkipInfo && tcMap != null) {
+ Set<IPath> set = getPathTreeSet(tcMap, (ToolChain) tc);
set.add(childFoInfo.getPath());
}
- processFolderInfoChildren(childFoInfo, storage, tc, tcMap, toolMap, addSkipInfo);
+ processFolderInfoChildren(childFoInfo, storage, tc, tcMap, toolMap, addSkipInfo);
} else {
processFolderInfo(storage, childFoInfo, null, false);
}
}
}
}
-
- public static PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> createChildObjectsRealToolToPathSet(FolderInfo foInfo, Map<IRealBuildObjectAssociation, Set<IPath>> toolChainMap, Map<IRealBuildObjectAssociation, Set<IPath>> toolsMap, boolean addSkipPaths){
+
+ public static PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> createChildObjectsRealToolToPathSet(
+ FolderInfo foInfo, Map<IRealBuildObjectAssociation, Set<IPath>> toolChainMap,
+ Map<IRealBuildObjectAssociation, Set<IPath>> toolsMap, boolean addSkipPaths) {
PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage = new PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>>();
-
+
IToolChain tc = foInfo.getToolChain();
IToolChain rTc = ManagedBuildManager.getRealToolChain(tc);
ITool[] tools = rTc.getTools();
toolsMap.clear();
- if(toolChainMap != null)
+ if (toolChainMap != null)
toolChainMap.clear();
- for(int i = 0; i < tools.length; i++){
- toolsMap.put((Tool)ManagedBuildManager.getRealTool(tools[i]), null);
+ for (int i = 0; i < tools.length; i++) {
+ toolsMap.put((Tool) ManagedBuildManager.getRealTool(tools[i]), null);
}
-
-
+
processFolderInfoChildren(foInfo, storage, rTc, toolChainMap, toolsMap, addSkipPaths);
-
+
return storage;
}
-
- public static PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> createParentObjectsRealToolToPathSet(final FolderInfo foInfo){
+
+ public static PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> createParentObjectsRealToolToPathSet(
+ final FolderInfo foInfo) {
PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage = new PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>>();
IConfiguration cfg = foInfo.getParent();
- FolderInfo rf = (FolderInfo)cfg.getRootFolderInfo();
+ FolderInfo rf = (FolderInfo) cfg.getRootFolderInfo();
IPath p = rf.getPath();
IBuilder realBuilder = ManagedBuildManager.getRealBuilder(cfg.getBuilder());
- Map<IRealBuildObjectAssociation, Set<IPath>> map = storage.getMap(IRealBuildObjectAssociation.OBJECT_BUILDER, true);
+ Map<IRealBuildObjectAssociation, Set<IPath>> map = storage.getMap(IRealBuildObjectAssociation.OBJECT_BUILDER,
+ true);
Set<IPath> pathSet = new TreeSet<IPath>(PathComparator.INSTANCE);
pathSet.add(p);
- map.put((Builder)realBuilder, pathSet);
-
- IRealBuildObjectAssociation realCfg = ((Configuration)cfg).getRealBuildObject();
+ map.put((Builder) realBuilder, pathSet);
+
+ IRealBuildObjectAssociation realCfg = ((Configuration) cfg).getRealBuildObject();
map = storage.getMap(IRealBuildObjectAssociation.OBJECT_CONFIGURATION, true);
pathSet = new TreeSet<IPath>(PathComparator.INSTANCE);
pathSet.add(p);
map.put(realCfg, pathSet);
-
- if(!foInfo.isRoot()){
+
+ if (!foInfo.isRoot()) {
Set<IResourceInfo> allRcInfos = new HashSet<IResourceInfo>(Arrays.asList(cfg.getResourceInfos()));
allRcInfos.removeAll(foInfo.getChildResourceInfoList(true));
for (IResourceInfo rc : allRcInfos) {
- if(rc instanceof ResourceConfiguration){
- processFileInfo(storage, (ResourceConfiguration)rc, null, false);
+ if (rc instanceof ResourceConfiguration) {
+ processFileInfo(storage, (ResourceConfiguration) rc, null, false);
} else {
- processFolderInfo(storage, (FolderInfo)rc, null, false);
+ processFolderInfo(storage, (FolderInfo) rc, null, false);
}
}
}
-
+
return storage;
}
- public static PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> cloneRealToolToPathSet(PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage){
+ public static PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> cloneRealToolToPathSet(
+ PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage) {
@SuppressWarnings("unchecked")
- PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> cloneStorage = (PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>>)storage.clone();
+ PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> cloneStorage = (PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>>) storage
+ .clone();
storage = cloneStorage;
int types[] = ObjectTypeBasedStorage.getSupportedObjectTypes();
- for(int i = 0; i < types.length; i++){
+ for (int i = 0; i < types.length; i++) {
Map<IRealBuildObjectAssociation, Set<IPath>> map = storage.getMap(types[i], false);
- if(map != null){
+ if (map != null) {
Set<Entry<IRealBuildObjectAssociation, Set<IPath>>> entrySet = map.entrySet();
for (Entry<IRealBuildObjectAssociation, Set<IPath>> entry : entrySet) {
@SuppressWarnings("unchecked")
- Set<IPath> clone = (Set<IPath>) ((TreeSet<IPath>)entry.getValue()).clone();
+ Set<IPath> clone = (Set<IPath>) ((TreeSet<IPath>) entry.getValue()).clone();
entry.setValue(clone);
}
}
@@ -143,86 +152,95 @@ public class TcModificationUtil {
return storage;
}
-
- public static PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> createRealToolToPathSet(IConfiguration cfg, PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> skipMapStorage, boolean addSkipPaths){
+
+ public static PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> createRealToolToPathSet(IConfiguration cfg,
+ PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> skipMapStorage, boolean addSkipPaths) {
PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage = new PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>>();
- FolderInfo rf = (FolderInfo)cfg.getRootFolderInfo();
+ FolderInfo rf = (FolderInfo) cfg.getRootFolderInfo();
IPath p = rf.getPath();
- Map<IRealBuildObjectAssociation, Set<IPath>> skipMap = skipMapStorage != null ? skipMapStorage.getMap(IRealBuildObjectAssociation.OBJECT_BUILDER, false) : null;
+ Map<IRealBuildObjectAssociation, Set<IPath>> skipMap = skipMapStorage != null
+ ? skipMapStorage.getMap(IRealBuildObjectAssociation.OBJECT_BUILDER, false)
+ : null;
IBuilder realBuilder = ManagedBuildManager.getRealBuilder(cfg.getBuilder());
- if(skipMap != null && skipMap.containsKey(realBuilder)){
- if(addSkipPaths){
- Set<IPath> set = getPathTreeSet(skipMap, (Builder)realBuilder);
+ if (skipMap != null && skipMap.containsKey(realBuilder)) {
+ if (addSkipPaths) {
+ Set<IPath> set = getPathTreeSet(skipMap, (Builder) realBuilder);
set.add(p);
}
} else {
- Map<IRealBuildObjectAssociation, Set<IPath>> map = storage.getMap(IRealBuildObjectAssociation.OBJECT_BUILDER, true);
+ Map<IRealBuildObjectAssociation, Set<IPath>> map = storage
+ .getMap(IRealBuildObjectAssociation.OBJECT_BUILDER, true);
Set<IPath> pathSet = new TreeSet<IPath>(PathComparator.INSTANCE);
pathSet.add(p);
- map.put((Builder)realBuilder, pathSet);
+ map.put((Builder) realBuilder, pathSet);
}
-
- skipMap = skipMapStorage != null ? skipMapStorage.getMap(IRealBuildObjectAssociation.OBJECT_CONFIGURATION, false) : null;
- IRealBuildObjectAssociation realCfg = ((Configuration)cfg).getRealBuildObject();
- if(skipMap != null && skipMap.containsKey(realCfg)){
- if(addSkipPaths){
+
+ skipMap = skipMapStorage != null
+ ? skipMapStorage.getMap(IRealBuildObjectAssociation.OBJECT_CONFIGURATION, false)
+ : null;
+ IRealBuildObjectAssociation realCfg = ((Configuration) cfg).getRealBuildObject();
+ if (skipMap != null && skipMap.containsKey(realCfg)) {
+ if (addSkipPaths) {
Set<IPath> set = getPathTreeSet(skipMap, realCfg);
set.add(p);
}
} else {
- Map<IRealBuildObjectAssociation, Set<IPath>> map = storage.getMap(IRealBuildObjectAssociation.OBJECT_CONFIGURATION, true);
+ Map<IRealBuildObjectAssociation, Set<IPath>> map = storage
+ .getMap(IRealBuildObjectAssociation.OBJECT_CONFIGURATION, true);
Set<IPath> pathSet = new TreeSet<IPath>(PathComparator.INSTANCE);
pathSet.add(p);
map.put(realCfg, pathSet);
}
-
+
processFolderInfo(storage, rf, skipMapStorage, addSkipPaths);
IResourceInfo[] rcInfos = rf.getChildResourceInfos();
- for(int i = 0; i < rcInfos.length; i++){
+ for (int i = 0; i < rcInfos.length; i++) {
IResourceInfo rc = rcInfos[i];
- if(rc instanceof ResourceConfiguration){
- processFileInfo(storage, (ResourceConfiguration)rc, skipMapStorage, addSkipPaths);
+ if (rc instanceof ResourceConfiguration) {
+ processFileInfo(storage, (ResourceConfiguration) rc, skipMapStorage, addSkipPaths);
} else {
- processFolderInfo(storage, (FolderInfo)rc, skipMapStorage, addSkipPaths);
+ processFolderInfo(storage, (FolderInfo) rc, skipMapStorage, addSkipPaths);
}
}
-
+
return storage;
}
-
- public static TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> createResultingChangesMap(TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> resultingMap, TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> initialMap){
- int[] types = new int []{
- IRealBuildObjectAssociation.OBJECT_TOOLCHAIN,
- IRealBuildObjectAssociation.OBJECT_BUILDER,
- IRealBuildObjectAssociation.OBJECT_TOOL,
- };
-
- TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> result = new TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>>(PathComparator.INSTANCE);
+
+ public static TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> createResultingChangesMap(
+ TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> resultingMap,
+ TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> initialMap) {
+ int[] types = new int[] { IRealBuildObjectAssociation.OBJECT_TOOLCHAIN,
+ IRealBuildObjectAssociation.OBJECT_BUILDER, IRealBuildObjectAssociation.OBJECT_TOOL, };
+
+ TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> result = new TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>>(
+ PathComparator.INSTANCE);
@SuppressWarnings("unchecked")
- TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> clone = (TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>>)initialMap.clone();
+ TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> clone = (TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>>) initialMap
+ .clone();
initialMap = clone;
-
+
for (Entry<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> entry : resultingMap.entrySet()) {
IPath oPath = entry.getKey();
-
+
PerTypeSetStorage<IRealBuildObjectAssociation> resStorage = entry.getValue();
PerTypeSetStorage<IRealBuildObjectAssociation> initStorage = initialMap.remove(oPath);
PerTypeSetStorage<IRealBuildObjectAssociation> storage;
-
- if(initStorage == null || initStorage.isEmpty(true)){
- if(resStorage != null && !resStorage.isEmpty(true)){
+
+ if (initStorage == null || initStorage.isEmpty(true)) {
+ if (resStorage != null && !resStorage.isEmpty(true)) {
@SuppressWarnings("unchecked")
- PerTypeSetStorage<IRealBuildObjectAssociation> clone2 = (PerTypeSetStorage<IRealBuildObjectAssociation>)resStorage.clone();
+ PerTypeSetStorage<IRealBuildObjectAssociation> clone2 = (PerTypeSetStorage<IRealBuildObjectAssociation>) resStorage
+ .clone();
storage = clone2;
} else {
storage = new PerTypeSetStorage<IRealBuildObjectAssociation>();
}
- } else if(resStorage == null || resStorage.isEmpty(true)){
+ } else if (resStorage == null || resStorage.isEmpty(true)) {
storage = new PerTypeSetStorage<IRealBuildObjectAssociation>();
- for(int i = 0; i < types.length; i++){
+ for (int i = 0; i < types.length; i++) {
Set<IRealBuildObjectAssociation> set = initStorage.getSet(types[i], false);
- if(set != null && set.size() != 0){
+ if (set != null && set.size() != 0) {
storage.getSet(types[i], true);
}
}
@@ -230,450 +248,474 @@ public class TcModificationUtil {
Set<IRealBuildObjectAssociation> tcInitSet, resSet, setToStore;
Set<IRealBuildObjectAssociation> bInitSet = null, tInitSet = null;
storage = new PerTypeSetStorage<IRealBuildObjectAssociation>();
-
+
tcInitSet = initStorage.getSet(IRealBuildObjectAssociation.OBJECT_TOOLCHAIN, false);
resSet = resStorage.getSet(IRealBuildObjectAssociation.OBJECT_TOOLCHAIN, false);
setToStore = compareSets(resSet, tcInitSet);
- if(setToStore != null) {
+ if (setToStore != null) {
storage.getSet(IRealBuildObjectAssociation.OBJECT_TOOLCHAIN, true).addAll(setToStore);
-
- //need to change the initial storage to contain
+
+ //need to change the initial storage to contain
//tools and a builder from the newly assigned tool-chain
//for the correct change calculation
-
- ToolChain tc = setToStore.size() != 0 ?
- (ToolChain)setToStore.iterator().next() : null;
-
+
+ ToolChain tc = setToStore.size() != 0 ? (ToolChain) setToStore.iterator().next() : null;
+
IPath path = oPath;
- if(tc != null){
+ if (tc != null) {
tInitSet = new LinkedHashSet<IRealBuildObjectAssociation>();
- TcModificationUtil.getRealObjectsSet((Tool[])tc.getTools(), tInitSet);
- if(path.segmentCount() == 0){
+ TcModificationUtil.getRealObjectsSet((Tool[]) tc.getTools(), tInitSet);
+ if (path.segmentCount() == 0) {
bInitSet = new LinkedHashSet<IRealBuildObjectAssociation>();
IBuilder builder = tc.getBuilder();
- if(builder != null){
- bInitSet.add((Builder)ManagedBuildManager.getRealBuilder(builder));
+ if (builder != null) {
+ bInitSet.add((Builder) ManagedBuildManager.getRealBuilder(builder));
}
}
} else {
tcInitSet = Collections.emptySet();
- if(path.segmentCount() == 0){
+ if (path.segmentCount() == 0) {
bInitSet = Collections.emptySet();
}
}
- }
+ }
- if(bInitSet == null)
+ if (bInitSet == null)
bInitSet = initStorage.getSet(IRealBuildObjectAssociation.OBJECT_BUILDER, false);
-
+
resSet = resStorage.getSet(IRealBuildObjectAssociation.OBJECT_BUILDER, false);
setToStore = compareSets(resSet, bInitSet);
- if(setToStore != null) {
+ if (setToStore != null) {
storage.getSet(IRealBuildObjectAssociation.OBJECT_BUILDER, true).addAll(setToStore);
- }
+ }
- if(tInitSet == null)
+ if (tInitSet == null)
tInitSet = initStorage.getSet(IRealBuildObjectAssociation.OBJECT_TOOL, false);
-
+
resSet = resStorage.getSet(IRealBuildObjectAssociation.OBJECT_TOOL, false);
setToStore = compareSets(resSet, tInitSet);
- if(setToStore != null) {
+ if (setToStore != null) {
storage.getSet(IRealBuildObjectAssociation.OBJECT_TOOL, true).addAll(setToStore);
}
}
-
- if(!storage.isEmpty(false)){
+
+ if (!storage.isEmpty(false)) {
result.put(oPath, storage);
}
}
-
- if(initialMap.size() != 0){
+
+ if (initialMap.size() != 0) {
Set<Entry<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>>> entrySet = initialMap.entrySet();
for (Entry<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> entry : entrySet) {
IPath oPath = entry.getKey();
-
+
PerTypeSetStorage<IRealBuildObjectAssociation> initStorage = entry.getValue();
- if(!initStorage.isEmpty(true)){
+ if (!initStorage.isEmpty(true)) {
PerTypeSetStorage<IRealBuildObjectAssociation> storage = new PerTypeSetStorage<IRealBuildObjectAssociation>();
- for(int i = 0; i < types.length; i++){
+ for (int i = 0; i < types.length; i++) {
Set<IRealBuildObjectAssociation> set = initStorage.getSet(types[i], false);
- if(set != null && set.size() != 0){
+ if (set != null && set.size() != 0) {
storage.getSet(types[i], true).addAll(set);
}
}
-
- if(!storage.isEmpty(false)){
+
+ if (!storage.isEmpty(false)) {
result.put(oPath, storage);
}
}
-
+
}
}
-
return result;
}
-
- private static Set<IRealBuildObjectAssociation> compareSets(Set<IRealBuildObjectAssociation> resSet, Set<IRealBuildObjectAssociation> initSet){
+
+ private static Set<IRealBuildObjectAssociation> compareSets(Set<IRealBuildObjectAssociation> resSet,
+ Set<IRealBuildObjectAssociation> initSet) {
Set<IRealBuildObjectAssociation> result = null;
- if(initSet == null || initSet.isEmpty()){
- if(resSet != null && !resSet.isEmpty()){
+ if (initSet == null || initSet.isEmpty()) {
+ if (resSet != null && !resSet.isEmpty()) {
result = resSet;
}
- } else if (resSet == null || resSet.isEmpty()){
+ } else if (resSet == null || resSet.isEmpty()) {
result = Collections.emptySet();
} else {
- if(!initSet.equals(resSet)){
+ if (!initSet.equals(resSet)) {
result = resSet;
}
}
-
+
return result;
}
- private static void processFolderInfo(PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage, FolderInfo info, PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> skipMapStorage, boolean addSkipPaths){
+ private static void processFolderInfo(PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage,
+ FolderInfo info, PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> skipMapStorage,
+ boolean addSkipPaths) {
IPath p = info.getPath();
IToolChain rtc = ManagedBuildManager.getRealToolChain(info.getToolChain());
- Map<IRealBuildObjectAssociation, Set<IPath>> skipMap = skipMapStorage != null ? skipMapStorage.getMap(IRealBuildObjectAssociation.OBJECT_TOOLCHAIN, false) : null;
- if(skipMap != null && skipMap.containsKey(rtc)){
- if(addSkipPaths){
- Set<IPath> set = getPathTreeSet(skipMap, (ToolChain)rtc);
+ Map<IRealBuildObjectAssociation, Set<IPath>> skipMap = skipMapStorage != null
+ ? skipMapStorage.getMap(IRealBuildObjectAssociation.OBJECT_TOOLCHAIN, false)
+ : null;
+ if (skipMap != null && skipMap.containsKey(rtc)) {
+ if (addSkipPaths) {
+ Set<IPath> set = getPathTreeSet(skipMap, (ToolChain) rtc);
set.add(p);
}
} else {
- Map<IRealBuildObjectAssociation, Set<IPath>> map = storage.getMap(IRealBuildObjectAssociation.OBJECT_TOOLCHAIN, true);
- Set<IPath> set = getPathTreeSet(map, (ToolChain)rtc);
+ Map<IRealBuildObjectAssociation, Set<IPath>> map = storage
+ .getMap(IRealBuildObjectAssociation.OBJECT_TOOLCHAIN, true);
+ Set<IPath> set = getPathTreeSet(map, (ToolChain) rtc);
set.add(p);
}
-
+
ITool[] tools = info.getTools();
processTools(storage, p, tools, skipMapStorage, addSkipPaths);
}
-
-// public static IRealBuildObjectAssociation[] getRealObjects(IRealBuildObjectAssociation[] objs, Class clazz){
-// LinkedHashSet set = new LinkedHashSet();
-// for(int i = 0; i < objs.length; i++){
-// set.add(objs[i].getRealBuildObject());
-// }
-// Object[] array = (Object[])Array.newInstance(clazz, set.size());
-// return (IRealBuildObjectAssociation[])set.toArray(array);
-// }
-
- public static Set<IRealBuildObjectAssociation> getRealObjectsSet(IRealBuildObjectAssociation[] objs, Set<IRealBuildObjectAssociation> set){
- if(set == null)
+
+ // public static IRealBuildObjectAssociation[] getRealObjects(IRealBuildObjectAssociation[] objs, Class clazz){
+ // LinkedHashSet set = new LinkedHashSet();
+ // for(int i = 0; i < objs.length; i++){
+ // set.add(objs[i].getRealBuildObject());
+ // }
+ // Object[] array = (Object[])Array.newInstance(clazz, set.size());
+ // return (IRealBuildObjectAssociation[])set.toArray(array);
+ // }
+
+ public static Set<IRealBuildObjectAssociation> getRealObjectsSet(IRealBuildObjectAssociation[] objs,
+ Set<IRealBuildObjectAssociation> set) {
+ if (set == null)
set = new LinkedHashSet<IRealBuildObjectAssociation>();
- for(int i = 0; i < objs.length; i++){
+ for (int i = 0; i < objs.length; i++) {
set.add(objs[i].getRealBuildObject());
}
return set;
}
- public static Map<? extends IRealBuildObjectAssociation, ? extends IRealBuildObjectAssociation> getRealToObjectsMap(IRealBuildObjectAssociation[] objs, Map<IRealBuildObjectAssociation, IRealBuildObjectAssociation> map){
- if(map == null)
+ public static Map<? extends IRealBuildObjectAssociation, ? extends IRealBuildObjectAssociation> getRealToObjectsMap(
+ IRealBuildObjectAssociation[] objs, Map<IRealBuildObjectAssociation, IRealBuildObjectAssociation> map) {
+ if (map == null)
map = new LinkedHashMap<IRealBuildObjectAssociation, IRealBuildObjectAssociation>();
- for(int i = 0; i < objs.length; i++){
+ for (int i = 0; i < objs.length; i++) {
map.put(objs[i].getRealBuildObject(), objs[i]);
}
return map;
}
- private static void processFileInfo(PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage, ResourceConfiguration info, PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> skipMapStorage, boolean addSkipPaths){
+ private static void processFileInfo(PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage,
+ ResourceConfiguration info, PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> skipMapStorage,
+ boolean addSkipPaths) {
IPath p = info.getPath();
ITool[] tools = info.getTools();
processTools(storage, p, tools, skipMapStorage, addSkipPaths);
}
- private static void processTools(PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage, IPath path, ITool[] tools, PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> skipMapStorage, boolean addSkipPaths){
- Map<IRealBuildObjectAssociation, Set<IPath>> map = storage.getMap(IRealBuildObjectAssociation.OBJECT_TOOL, true);
- Map<IRealBuildObjectAssociation, Set<IPath>> skipMap = skipMapStorage != null ? skipMapStorage.getMap(IRealBuildObjectAssociation.OBJECT_TOOL, false) : null;
-
+ private static void processTools(PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage, IPath path,
+ ITool[] tools, PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> skipMapStorage,
+ boolean addSkipPaths) {
+ Map<IRealBuildObjectAssociation, Set<IPath>> map = storage.getMap(IRealBuildObjectAssociation.OBJECT_TOOL,
+ true);
+ Map<IRealBuildObjectAssociation, Set<IPath>> skipMap = skipMapStorage != null
+ ? skipMapStorage.getMap(IRealBuildObjectAssociation.OBJECT_TOOL, false)
+ : null;
+
processTools(map, path, tools, skipMap, addSkipPaths);
}
- private static void processTools(Map<IRealBuildObjectAssociation, Set<IPath>> storageMap, IPath path, ITool[] tools, Map<IRealBuildObjectAssociation, Set<IPath>> skipMap, boolean addSkipPaths){
- for(int i = 0; i < tools.length; i++){
+ private static void processTools(Map<IRealBuildObjectAssociation, Set<IPath>> storageMap, IPath path, ITool[] tools,
+ Map<IRealBuildObjectAssociation, Set<IPath>> skipMap, boolean addSkipPaths) {
+ for (int i = 0; i < tools.length; i++) {
ITool rt = ManagedBuildManager.getRealTool(tools[i]);
- if(skipMap != null && skipMap.containsKey(rt)){
- if(addSkipPaths){
- Set<IPath> set = getPathTreeSet(skipMap, (Tool)rt);
+ if (skipMap != null && skipMap.containsKey(rt)) {
+ if (addSkipPaths) {
+ Set<IPath> set = getPathTreeSet(skipMap, (Tool) rt);
set.add(path);
}
} else {
- Set<IPath> set = getPathTreeSet(storageMap, (Tool)rt);
+ Set<IPath> set = getPathTreeSet(storageMap, (Tool) rt);
set.add(path);
}
}
}
-
-
- public static Set<IPath> getPathTreeSet(Map<IRealBuildObjectAssociation, Set<IPath>> map, IRealBuildObjectAssociation bo){
+
+ public static Set<IPath> getPathTreeSet(Map<IRealBuildObjectAssociation, Set<IPath>> map,
+ IRealBuildObjectAssociation bo) {
Set<IPath> set = map.get(bo);
- if(set == null){
+ if (set == null) {
set = new TreeSet<IPath>(PathComparator.INSTANCE);
map.put(bo, set);
}
return set;
}
- public static <K, V> List<V> getArrayList(Map<K, List<V>> map, K obj){
+ public static <K, V> List<V> getArrayList(Map<K, List<V>> map, K obj) {
List<V> list = map.get(obj);
- if(list == null){
+ if (list == null) {
list = new ArrayList<V>();
map.put(obj, list);
}
return list;
}
- public static Set<IPath> removeBuilderInfo(PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage, IBuilder builder){
+ public static Set<IPath> removeBuilderInfo(PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage,
+ IBuilder builder) {
return storage.getMap(IRealBuildObjectAssociation.OBJECT_BUILDER, true).remove(builder);
}
- public static void restoreBuilderInfo(PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage, IBuilder builder, Set<IPath> obj){
- storage.getMap(IRealBuildObjectAssociation.OBJECT_BUILDER, true).put((Builder)builder, obj);
+ public static void restoreBuilderInfo(PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage,
+ IBuilder builder, Set<IPath> obj) {
+ storage.getMap(IRealBuildObjectAssociation.OBJECT_BUILDER, true).put((Builder) builder, obj);
}
-// public static boolean removeToolInfo(PerTypeMapStorage storage, IPath path, ITool tool){
-// Map map = storage.getMap(IRealBuildObjectAssociation.OBJECT_TOOL, false);
-// if(map == null)
-// return false;
-// Set set = (Set)map.get(tool);
-// if(set == null)
-// return false;
-// boolean result = set.remove(path);
-// if(set.isEmpty())
-// map.remove(tool);
-// return result;
-// }
-//
-// public static void restoreToolInfo(PerTypeMapStorage storage, IPath path, ITool tool){
-// Map map = storage.getMap(IRealBuildObjectAssociation.OBJECT_TOOL, true);
-// Set set = TcModificationUtil.getPathTreeSet(map, tool);
-// set.add(path);
-// }
-//
-// public static Set removeToolInfoWithChildren(PerTypeMapStorage storage, IPath path, ITool tool){
-// Map map = storage.getMap(IRealBuildObjectAssociation.OBJECT_TOOL, false);
-// if(map == null)
-// return null;
-// SortedSet set = (SortedSet)map.get(tool);
-// if(set == null)
-// return null;
-//
-// Set rmSet = PathComparator.getChildPathSet(set, path, true, true);
-// if(rmSet.size() == 0)
-// return null;
-//
-// set.removeAll(rmSet);
-// return rmSet;
-// }
-//
-// public static void restoreToolInfoWithChildren(PerTypeMapStorage storage, Set restoreSet, ITool tool){
-// Map map = storage.getMap(IRealBuildObjectAssociation.OBJECT_TOOL, true);
-// Set set = TcModificationUtil.getPathTreeSet(map, tool);
-// set.addAll(restoreSet);
-// }
-
- public static <T extends IRealBuildObjectAssociation> void removePaths(Map<T, Set<IPath>> map, T bo, Set<IPath> paths){
+ // public static boolean removeToolInfo(PerTypeMapStorage storage, IPath path, ITool tool){
+ // Map map = storage.getMap(IRealBuildObjectAssociation.OBJECT_TOOL, false);
+ // if(map == null)
+ // return false;
+ // Set set = (Set)map.get(tool);
+ // if(set == null)
+ // return false;
+ // boolean result = set.remove(path);
+ // if(set.isEmpty())
+ // map.remove(tool);
+ // return result;
+ // }
+ //
+ // public static void restoreToolInfo(PerTypeMapStorage storage, IPath path, ITool tool){
+ // Map map = storage.getMap(IRealBuildObjectAssociation.OBJECT_TOOL, true);
+ // Set set = TcModificationUtil.getPathTreeSet(map, tool);
+ // set.add(path);
+ // }
+ //
+ // public static Set removeToolInfoWithChildren(PerTypeMapStorage storage, IPath path, ITool tool){
+ // Map map = storage.getMap(IRealBuildObjectAssociation.OBJECT_TOOL, false);
+ // if(map == null)
+ // return null;
+ // SortedSet set = (SortedSet)map.get(tool);
+ // if(set == null)
+ // return null;
+ //
+ // Set rmSet = PathComparator.getChildPathSet(set, path, true, true);
+ // if(rmSet.size() == 0)
+ // return null;
+ //
+ // set.removeAll(rmSet);
+ // return rmSet;
+ // }
+ //
+ // public static void restoreToolInfoWithChildren(PerTypeMapStorage storage, Set restoreSet, ITool tool){
+ // Map map = storage.getMap(IRealBuildObjectAssociation.OBJECT_TOOL, true);
+ // Set set = TcModificationUtil.getPathTreeSet(map, tool);
+ // set.addAll(restoreSet);
+ // }
+
+ public static <T extends IRealBuildObjectAssociation> void removePaths(Map<T, Set<IPath>> map, T bo,
+ Set<IPath> paths) {
Set<IPath> objPaths = map.get(bo);
- if(objPaths == null)
+ if (objPaths == null)
return;
-
+
objPaths.removeAll(paths);
- if(objPaths.size() == 0)
+ if (objPaths.size() == 0)
map.remove(bo);
}
-
- public static <T extends IRealBuildObjectAssociation> void addPaths(Map<T, Set<IPath>> map, T bo, Set<IPath> paths){
- if(paths.size() == 0)
+
+ public static <T extends IRealBuildObjectAssociation> void addPaths(Map<T, Set<IPath>> map, T bo,
+ Set<IPath> paths) {
+ if (paths.size() == 0)
return;
-
+
Set<IPath> objPaths = map.get(bo);
- if(objPaths == null){
+ if (objPaths == null) {
objPaths = new TreeSet<IPath>(PathComparator.INSTANCE);
map.put(bo, objPaths);
}
-
+
objPaths.addAll(paths);
}
-
- public static <T extends IRealBuildObjectAssociation> void addPath(Map<T, Set<IPath>> map, T bo, IPath path){
+
+ public static <T extends IRealBuildObjectAssociation> void addPath(Map<T, Set<IPath>> map, T bo, IPath path) {
Set<IPath> objPaths = map.get(bo);
- if(objPaths == null){
+ if (objPaths == null) {
objPaths = new TreeSet<IPath>(PathComparator.INSTANCE);
map.put(bo, objPaths);
}
-
+
objPaths.add(path);
}
- public static void applyBuilder(PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage, IPath path, IBuilder builder){
- Map<IRealBuildObjectAssociation, Set<IPath>> bMap = storage.getMap(IRealBuildObjectAssociation.OBJECT_BUILDER, true);
+ public static void applyBuilder(PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage, IPath path,
+ IBuilder builder) {
+ Map<IRealBuildObjectAssociation, Set<IPath>> bMap = storage.getMap(IRealBuildObjectAssociation.OBJECT_BUILDER,
+ true);
bMap.clear();
IBuilder realBuilder = ManagedBuildManager.getRealBuilder(builder);
- Set<IPath> set = getPathTreeSet(bMap, (Builder)realBuilder);
+ Set<IPath> set = getPathTreeSet(bMap, (Builder) realBuilder);
set.add(path);
}
-// public static void applyBuilder(TreeMap pathMap, IPath path, IBuilder builder){
-// IBuilder realBuilder = ManagedBuildManager.getRealBuilder(builder);
-// PerTypeSetStorage storage = (PerTypeSetStorage)pathMap.get(path);
-// Set set = storage.getSet(IRealBuildObjectAssociation.OBJECT_BUILDER, true);
-// set.clear();
-// set.add(realBuilder);
-// }
-
- public static TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> createPathMap(IConfiguration cfg){
+ // public static void applyBuilder(TreeMap pathMap, IPath path, IBuilder builder){
+ // IBuilder realBuilder = ManagedBuildManager.getRealBuilder(builder);
+ // PerTypeSetStorage storage = (PerTypeSetStorage)pathMap.get(path);
+ // Set set = storage.getSet(IRealBuildObjectAssociation.OBJECT_BUILDER, true);
+ // set.clear();
+ // set.add(realBuilder);
+ // }
+
+ public static TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> createPathMap(IConfiguration cfg) {
//TODO: optimize to calculate the map directly
PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage = createRealToolToPathSet(cfg, null, false);
return createPathMap(storage);
}
- public static TreeMap<IPath,PerTypeSetStorage<IRealBuildObjectAssociation>> createPathMap(PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage){
+ public static TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> createPathMap(
+ PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage) {
int[] types = ObjectTypeBasedStorage.getSupportedObjectTypes();
- TreeMap<IPath,PerTypeSetStorage<IRealBuildObjectAssociation>> result = new TreeMap<IPath,PerTypeSetStorage<IRealBuildObjectAssociation>>(PathComparator.INSTANCE);
- for(int i = 0; i < types.length; i++){
+ TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> result = new TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>>(
+ PathComparator.INSTANCE);
+ for (int i = 0; i < types.length; i++) {
int type = types[i];
Map<IRealBuildObjectAssociation, Set<IPath>> map = storage.getMap(type, false);
- if(map == null)
+ if (map == null)
continue;
-
+
Set<Entry<IRealBuildObjectAssociation, Set<IPath>>> entrySet = map.entrySet();
for (Entry<IRealBuildObjectAssociation, Set<IPath>> entry : entrySet) {
IRealBuildObjectAssociation pathKey = entry.getKey();
Set<IPath> pathSet = entry.getValue();
for (IPath path : pathSet) {
PerTypeSetStorage<IRealBuildObjectAssociation> oset = result.get(path);
- if(oset == null){
+ if (oset == null) {
oset = new PerTypeSetStorage<IRealBuildObjectAssociation>();
result.put(path, oset);
}
-
+
Set<IRealBuildObjectAssociation> set = oset.getSet(type, true);
set.add(pathKey);
}
}
}
-
+
return result;
}
-// public static TreeMap clonePathMap(TreeMap map){
-// map = (TreeMap)map.clone();
-//
-// for(Iterator iter = map.entrySet().iterator(); iter.hasNext(); ){
-// Map.Entry entry = (Map.Entry)iter.next();
-// entry.setValue(((PerTypeSetStorage)entry.getValue()).clone());
-// }
-//
-// return map;
-// }
-
-// private static boolean pathContainsObjects(PerTypeMapStorage storage, IPath path, int type){
-// Map map = storage.getMap(type, false);
-// if(map == null)
-// return false;
-//
-// for(Iterator iter = map.values().iterator(); iter.hasNext(); ){
-// SortedSet set = (SortedSet)iter.next();
-// if(set.contains(path))
-// return true;
-// }
-//
-// return false;
-// }
-
- public static SortedSet<IPath> getDirectChildUsagePaths(PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage, IPath path, IRealBuildObjectAssociation obj, SortedSet<IPath> inclusionPaths){
+ // public static TreeMap clonePathMap(TreeMap map){
+ // map = (TreeMap)map.clone();
+ //
+ // for(Iterator iter = map.entrySet().iterator(); iter.hasNext(); ){
+ // Map.Entry entry = (Map.Entry)iter.next();
+ // entry.setValue(((PerTypeSetStorage)entry.getValue()).clone());
+ // }
+ //
+ // return map;
+ // }
+
+ // private static boolean pathContainsObjects(PerTypeMapStorage storage, IPath path, int type){
+ // Map map = storage.getMap(type, false);
+ // if(map == null)
+ // return false;
+ //
+ // for(Iterator iter = map.values().iterator(); iter.hasNext(); ){
+ // SortedSet set = (SortedSet)iter.next();
+ // if(set.contains(path))
+ // return true;
+ // }
+ //
+ // return false;
+ // }
+
+ public static SortedSet<IPath> getDirectChildUsagePaths(
+ PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage, IPath path,
+ IRealBuildObjectAssociation obj, SortedSet<IPath> inclusionPaths) {
Map<IRealBuildObjectAssociation, Set<IPath>> objMap = storage.getMap(obj.getType(), false);
- SortedSet<IPath> objPaths = (SortedSet<IPath>)objMap.get(obj);
- if(DbgTcmUtil.DEBUG){
- if(!objPaths.contains(path)){
+ SortedSet<IPath> objPaths = (SortedSet<IPath>) objMap.get(obj);
+ if (DbgTcmUtil.DEBUG) {
+ if (!objPaths.contains(path)) {
DbgTcmUtil.fail();
}
}
SortedSet<IPath> objChildPaths = PathComparator.getChildPathSet(objPaths, path, false, true);
- if(inclusionPaths != null) {
+ if (inclusionPaths != null) {
objChildPaths.retainAll(inclusionPaths);
}
-
- for(Iterator<Entry<IRealBuildObjectAssociation, Set<IPath>>> iter = objMap.entrySet().iterator(); iter.hasNext(); ){
+
+ for (Iterator<Entry<IRealBuildObjectAssociation, Set<IPath>>> iter = objMap.entrySet().iterator(); iter
+ .hasNext();) {
Map.Entry<IRealBuildObjectAssociation, Set<IPath>> entry = iter.next();
IRealBuildObjectAssociation cur = entry.getKey();
- if(obj == cur)
+ if (obj == cur)
continue;
-
- SortedSet<IPath> curPaths = (SortedSet<IPath>)entry.getValue();
-
+
+ SortedSet<IPath> curPaths = (SortedSet<IPath>) entry.getValue();
+
curPaths = PathComparator.getChildPathSet(curPaths, path, false, false);
-
+
for (IPath childPath : objChildPaths) {
SortedSet<IPath> sub = curPaths.tailSet(childPath);
- if(sub.size() != 0)
+ if (sub.size() != 0)
iter.remove();
}
}
-
+
objChildPaths.add(path);
-
+
return objChildPaths;
}
-
- public static boolean containCommonEntries(Set<String> set, String[] objs){
- for(int i = 0; i < objs.length; i++){
- if(set.contains(objs[i]))
+ public static boolean containCommonEntries(Set<String> set, String[] objs) {
+ for (int i = 0; i < objs.length; i++) {
+ if (set.contains(objs[i]))
return true;
}
return false;
}
-
- public static IRealBuildObjectAssociation[] getRealObjects(int type){
+
+ public static IRealBuildObjectAssociation[] getRealObjects(int type) {
switch (type) {
case IRealBuildObjectAssociation.OBJECT_TOOL:
- return (IRealBuildObjectAssociation[])ManagedBuildManager.getRealTools();
+ return (IRealBuildObjectAssociation[]) ManagedBuildManager.getRealTools();
case IRealBuildObjectAssociation.OBJECT_TOOLCHAIN:
- return (IRealBuildObjectAssociation[])ManagedBuildManager.getRealToolChains();
+ return (IRealBuildObjectAssociation[]) ManagedBuildManager.getRealToolChains();
case IRealBuildObjectAssociation.OBJECT_BUILDER:
- return (IRealBuildObjectAssociation[])ManagedBuildManager.getRealBuilders();
+ return (IRealBuildObjectAssociation[]) ManagedBuildManager.getRealBuilders();
case IRealBuildObjectAssociation.OBJECT_CONFIGURATION:
- return (IRealBuildObjectAssociation[])ManagedBuildManager.getExtensionConfigurations();
+ return (IRealBuildObjectAssociation[]) ManagedBuildManager.getExtensionConfigurations();
default:
throw new IllegalArgumentException();
}
}
-
- public static IRealBuildObjectAssociation[] getExtensionObjects(int type){
+
+ public static IRealBuildObjectAssociation[] getExtensionObjects(int type) {
switch (type) {
case IRealBuildObjectAssociation.OBJECT_TOOL:
- return (IRealBuildObjectAssociation[])ManagedBuildManager.getExtensionTools();
+ return (IRealBuildObjectAssociation[]) ManagedBuildManager.getExtensionTools();
case IRealBuildObjectAssociation.OBJECT_TOOLCHAIN:
- return (IRealBuildObjectAssociation[])ManagedBuildManager.getExtensionToolChains();
+ return (IRealBuildObjectAssociation[]) ManagedBuildManager.getExtensionToolChains();
case IRealBuildObjectAssociation.OBJECT_BUILDER:
- return (IRealBuildObjectAssociation[])ManagedBuildManager.getExtensionBuilders();
+ return (IRealBuildObjectAssociation[]) ManagedBuildManager.getExtensionBuilders();
case IRealBuildObjectAssociation.OBJECT_CONFIGURATION:
- return (IRealBuildObjectAssociation[])ManagedBuildManager.getExtensionConfigurations();
+ return (IRealBuildObjectAssociation[]) ManagedBuildManager.getExtensionConfigurations();
default:
throw new IllegalArgumentException();
}
}
-
- public static IRealBuildObjectAssociation getObjectById(int type, String id){
+
+ public static IRealBuildObjectAssociation getObjectById(int type, String id) {
switch (type) {
case IRealBuildObjectAssociation.OBJECT_TOOL:
- return (IRealBuildObjectAssociation)ManagedBuildManager.getExtensionTool(id);
+ return (IRealBuildObjectAssociation) ManagedBuildManager.getExtensionTool(id);
case IRealBuildObjectAssociation.OBJECT_TOOLCHAIN:
- return (IRealBuildObjectAssociation)ManagedBuildManager.getExtensionToolChain(id);
+ return (IRealBuildObjectAssociation) ManagedBuildManager.getExtensionToolChain(id);
case IRealBuildObjectAssociation.OBJECT_BUILDER:
- return (IRealBuildObjectAssociation)ManagedBuildManager.getExtensionBuilder(id);
+ return (IRealBuildObjectAssociation) ManagedBuildManager.getExtensionBuilder(id);
case IRealBuildObjectAssociation.OBJECT_CONFIGURATION:
- return (IRealBuildObjectAssociation)ManagedBuildManager.getExtensionConfiguration(id);
+ return (IRealBuildObjectAssociation) ManagedBuildManager.getExtensionConfiguration(id);
default:
throw new IllegalArgumentException();
}
}
-
+
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolChainModificationManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolChainModificationManager.java
index cf178364dc1..df34f6aba5d 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolChainModificationManager.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolChainModificationManager.java
@@ -36,125 +36,125 @@ import org.eclipse.cdt.managedbuilder.tcmodification.IFolderInfoModification;
import org.eclipse.cdt.managedbuilder.tcmodification.IToolChainModificationManager;
import org.eclipse.core.runtime.IPath;
-public class ToolChainModificationManager implements
- IToolChainModificationManager {
+public class ToolChainModificationManager implements IToolChainModificationManager {
private static ToolChainModificationManager fInstance;
- private ToolChainModificationManager(){
+ private ToolChainModificationManager() {
}
- public static ToolChainModificationManager getInstance(){
- if(fInstance == null)
+ public static ToolChainModificationManager getInstance() {
+ if (fInstance == null)
fInstance = getInstanceSynch();
return fInstance;
}
private static synchronized ToolChainModificationManager getInstanceSynch() {
- if(fInstance == null)
+ if (fInstance == null)
fInstance = new ToolChainModificationManager();
return fInstance;
}
- public void start(){
+ public void start() {
RulesManager.getInstance().start();
}
@Override
public IFileInfoModification createModification(IFileInfo rcInfo) {
- return new FileInfoModification((ResourceConfiguration)rcInfo);
+ return new FileInfoModification((ResourceConfiguration) rcInfo);
}
@Override
public IFolderInfoModification createModification(IFolderInfo rcInfo) {
- FolderInfo foInfo = (FolderInfo)rcInfo;
- if(foInfo.isRoot())
+ FolderInfo foInfo = (FolderInfo) rcInfo;
+ if (foInfo.isRoot())
return new ConfigurationModification(foInfo);
return new FolderInfoModification(foInfo);
}
@Override
- public IFolderInfoModification createModification(IConfiguration cfg,
- IFolderInfoModification base) throws IllegalArgumentException {
+ public IFolderInfoModification createModification(IConfiguration cfg, IFolderInfoModification base)
+ throws IllegalArgumentException {
IResourceInfo baseRcInfo = base.getResourceInfo();
IPath path = baseRcInfo.getPath();
IResourceInfo rcInfo = cfg.getResourceInfo(path, true);
FolderInfo folderInfo;
- if(rcInfo != null){
- if(rcInfo instanceof FolderInfo){
- folderInfo = (FolderInfo)rcInfo;
+ if (rcInfo != null) {
+ if (rcInfo instanceof FolderInfo) {
+ folderInfo = (FolderInfo) rcInfo;
} else {
throw new IllegalArgumentException();
}
} else {
- folderInfo = (FolderInfo)cfg.createFolderInfo(path);
+ folderInfo = (FolderInfo) cfg.createFolderInfo(path);
}
- return folderInfo.isRoot() ?
- new ConfigurationModification(folderInfo, (ConfigurationModification)base)
- : new FolderInfoModification(folderInfo, (FolderInfoModification)base);
+ return folderInfo.isRoot() ? new ConfigurationModification(folderInfo, (ConfigurationModification) base)
+ : new FolderInfoModification(folderInfo, (FolderInfoModification) base);
}
@Override
- public IFileInfoModification createModification(IConfiguration cfg,
- IFileInfoModification base) throws IllegalArgumentException {
+ public IFileInfoModification createModification(IConfiguration cfg, IFileInfoModification base)
+ throws IllegalArgumentException {
IResourceInfo baseRcInfo = base.getResourceInfo();
IPath path = baseRcInfo.getPath();
IResourceInfo rcInfo = cfg.getResourceInfo(path, true);
ResourceConfiguration fileInfo;
- if(rcInfo != null){
- if(rcInfo instanceof ResourceConfiguration){
- fileInfo = (ResourceConfiguration)rcInfo;
+ if (rcInfo != null) {
+ if (rcInfo instanceof ResourceConfiguration) {
+ fileInfo = (ResourceConfiguration) rcInfo;
} else {
throw new IllegalArgumentException();
}
} else {
- fileInfo = (ResourceConfiguration)cfg.createFileInfo(path);
+ fileInfo = (ResourceConfiguration) cfg.createFileInfo(path);
}
- return new FileInfoModification(fileInfo, (FileInfoModification)base);
+ return new FileInfoModification(fileInfo, (FileInfoModification) base);
}
- public static boolean checkFlags(int flags, int value){
+ public static boolean checkFlags(int flags, int value) {
return (flags & value) == value;
}
- public static int addFlags(int flags, int value){
+ public static int addFlags(int flags, int value) {
return flags |= value;
}
- public static int clearFlags(int flags, int value){
+ public static int clearFlags(int flags, int value) {
return flags &= (~value);
}
- private boolean getMatchingObjects(int type, IObjectSet[] oSets, Set<IRealBuildObjectAssociation> skipSet, IRealBuildObjectAssociation additionalSkip, Set<IRealBuildObjectAssociation> result){
+ private boolean getMatchingObjects(int type, IObjectSet[] oSets, Set<IRealBuildObjectAssociation> skipSet,
+ IRealBuildObjectAssociation additionalSkip, Set<IRealBuildObjectAssociation> result) {
Set<IRealBuildObjectAssociation> tmp = null;
boolean added = false;
for (IObjectSet os : oSets) {
int setType = os.getObjectType();
- if(setType != type)
+ if (setType != type)
continue;
- if(tmp == null)
+ if (tmp == null)
tmp = new HashSet<IRealBuildObjectAssociation>();
else
tmp.clear();
os.getRealBuildObjects(tmp);
- if(skipSet != null)
+ if (skipSet != null)
tmp.removeAll(skipSet);
- if(additionalSkip != null)
+ if (additionalSkip != null)
tmp.remove(additionalSkip);
- if(result.addAll(tmp)){
+ if (result.addAll(tmp)) {
added = true;
}
}
return added;
}
- public ConflictMatchSet getConflictInfo(int objType, PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> parent){
+ public ConflictMatchSet getConflictInfo(int objType,
+ PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> parent) {
//parent should be passed - it is constant no need to recalculate every time
//PerTypeMapStorage parent = TcModificationUtil.createParentObjectsRealToolToPathSet(foInfo);
@@ -169,7 +169,8 @@ public class ToolChainModificationManager implements
final int fConflictType;
final Set<IRealBuildObjectAssociation> fConflicts;
- ConflictMatch(int matchType, Map<IRealBuildObjectAssociation, Set<IPath>> rtToPathMap, int conflictType, Set<IRealBuildObjectAssociation> conflicts){
+ ConflictMatch(int matchType, Map<IRealBuildObjectAssociation, Set<IPath>> rtToPathMap, int conflictType,
+ Set<IRealBuildObjectAssociation> conflicts) {
fMatchType = matchType;
fRObjToPathMap = Collections.unmodifiableMap(rtToPathMap);
fConflictType = conflictType;
@@ -181,15 +182,17 @@ public class ToolChainModificationManager implements
ConflictMatch[] fConflicts;
Map<? extends IRealBuildObjectAssociation, List<ConflictMatch>> fObjToConflictListMap;
- ConflictMatchSet(ConflictMatch[] coflicts, Map<? extends IRealBuildObjectAssociation, List<ConflictMatch>> objToConflictMap){
+ ConflictMatchSet(ConflictMatch[] coflicts,
+ Map<? extends IRealBuildObjectAssociation, List<ConflictMatch>> objToConflictMap) {
fConflicts = coflicts;
fObjToConflictListMap = objToConflictMap;
}
-
}
- private ConflictMatchSet getConflictMatches(int type, PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> rtToPath, PerTypeSetStorage<IRealBuildObjectAssociation> skip){
+ private ConflictMatchSet getConflictMatches(int type,
+ PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> rtToPath,
+ PerTypeSetStorage<IRealBuildObjectAssociation> skip) {
//conversion:
//1.first filter applicable to not-this
@@ -199,39 +202,45 @@ public class ToolChainModificationManager implements
List<ConflictMatch> conflictList = new ArrayList<ConflictMatch>();
Map<IRealBuildObjectAssociation, List<ConflictMatch>> objToConflictMatchMap = new HashMap<IRealBuildObjectAssociation, List<ConflictMatch>>();
- ObjectSetListBasedDefinition[] defs = RulesManager.getInstance().getRules(ObjectSetListBasedDefinition.CONFLICT);
- for(int i = 0; i < defs.length; i++){
- ObjectSetListBasedDefinition def= defs[i];
+ ObjectSetListBasedDefinition[] defs = RulesManager.getInstance()
+ .getRules(ObjectSetListBasedDefinition.CONFLICT);
+ for (int i = 0; i < defs.length; i++) {
+ ObjectSetListBasedDefinition def = defs[i];
ObjectSetList sl = def.getObjectSetList();
IObjectSet oss[] = sl.getObjectSets();
- for(int k = 0; k < oss.length; k++){
+ for (int k = 0; k < oss.length; k++) {
IObjectSet os = oss[k];
int objType = os.getObjectType();
Map<IRealBuildObjectAssociation, Set<IPath>> rtToPathMap = rtToPath.getMap(objType, false);
- if(rtToPathMap == null)
+ if (rtToPathMap == null)
continue;
@SuppressWarnings("unchecked")
- Map<IRealBuildObjectAssociation, Set<IPath>> clone = (Map<IRealBuildObjectAssociation, Set<IPath>>)((HashMap<IRealBuildObjectAssociation, Set<IPath>>)rtToPathMap).clone();
+ Map<IRealBuildObjectAssociation, Set<IPath>> clone = (Map<IRealBuildObjectAssociation, Set<IPath>>) ((HashMap<IRealBuildObjectAssociation, Set<IPath>>) rtToPathMap)
+ .clone();
rtToPathMap = clone;
- Set<IRealBuildObjectAssociation> skipSet = skip != null ? (Set<IRealBuildObjectAssociation>)skip.getSet(objType, false) : null;
+ Set<IRealBuildObjectAssociation> skipSet = skip != null
+ ? (Set<IRealBuildObjectAssociation>) skip.getSet(objType, false)
+ : null;
Set<IRealBuildObjectAssociation> objSet = rtToPathMap.keySet();
- if(skipSet != null)
+ if (skipSet != null)
objSet.removeAll(skipSet);
os.retainMatches(objSet);
- if(objSet.size() != 0){
+ if (objSet.size() != 0) {
List<IObjectSet> remainingList = new ArrayList<IObjectSet>(Arrays.asList(oss));
remainingList.remove(os);
IObjectSet[] remaining = remainingList.toArray(new IObjectSet[remainingList.size()]);
//get objects matching remaining
- Set<IRealBuildObjectAssociation> skipSet2 = skip != null ? (Set<IRealBuildObjectAssociation>)skip.getSet(type, false) : null;
+ Set<IRealBuildObjectAssociation> skipSet2 = skip != null
+ ? (Set<IRealBuildObjectAssociation>) skip.getSet(type, false)
+ : null;
Set<IRealBuildObjectAssociation> matchingObjects = new HashSet<IRealBuildObjectAssociation>();
getMatchingObjects(type, remaining, skipSet2, null, matchingObjects);
- if(matchingObjects.size() != 0){
+ if (matchingObjects.size() != 0) {
ConflictMatch conflict = new ConflictMatch(objType, rtToPathMap, type, matchingObjects);
for (IRealBuildObjectAssociation bo : matchingObjects) {
@@ -241,11 +250,12 @@ public class ToolChainModificationManager implements
conflictList.add(conflict);
}
-// break;
+ // break;
}
}
}
- return new ConflictMatchSet(conflictList.toArray(new ConflictMatch[conflictList.size()]), objToConflictMatchMap);
+ return new ConflictMatchSet(conflictList.toArray(new ConflictMatch[conflictList.size()]),
+ objToConflictMatchMap);
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolListMap.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolListMap.java
index 1f3456df501..2e78842ed6a 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolListMap.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolListMap.java
@@ -29,59 +29,59 @@ public class ToolListMap implements Cloneable {
private HashMap<ITool, List<ITool>> fMap;
private CollectionEntrySet fCollectionEntrySet;
- public ToolListMap(){
+ public ToolListMap() {
fMap = new HashMap<ITool, List<ITool>>();
}
-// public class ValueIter {
-// private Map fIterMap;
-//
-// public ValueIter() {
-// fIterMap = new HashMap(fMap);
-// for(Iterator iter = fIterMap.entrySet().iterator(); iter.hasNext();){
-// Map.Entry entry = (Map.Entry)iter.next();
-// Collection c = (Collection)entry.getValue();
-// entry.setValue(c.iterator());
-// }
-// }
-//
-// public Iterator get(Object key){
-// Iterator iter = (Iterator)fIterMap.get(key);
-// if(iter != null && !iter.hasNext()){
-// fIterMap.remove(key);
-// return null;
-// }
-// return iter;
-// }
-// }
+ // public class ValueIter {
+ // private Map fIterMap;
+ //
+ // public ValueIter() {
+ // fIterMap = new HashMap(fMap);
+ // for(Iterator iter = fIterMap.entrySet().iterator(); iter.hasNext();){
+ // Map.Entry entry = (Map.Entry)iter.next();
+ // Collection c = (Collection)entry.getValue();
+ // entry.setValue(c.iterator());
+ // }
+ // }
+ //
+ // public Iterator get(Object key){
+ // Iterator iter = (Iterator)fIterMap.get(key);
+ // if(iter != null && !iter.hasNext()){
+ // fIterMap.remove(key);
+ // return null;
+ // }
+ // return iter;
+ // }
+ // }
public class CollectionEntry {
private Map.Entry<ITool, List<ITool>> fEntry;
- CollectionEntry(Map.Entry<ITool, List<ITool>> entry){
+ CollectionEntry(Map.Entry<ITool, List<ITool>> entry) {
fEntry = entry;
}
- public ITool getKey(){
+ public ITool getKey() {
return fEntry.getKey();
}
- public List<ITool> getValue(){
+ public List<ITool> getValue() {
return fEntry.getValue();
}
@Override
public boolean equals(Object obj) {
- if(obj == this)
+ if (obj == this)
return true;
- if(obj == null)
+ if (obj == null)
return false;
- if(!(obj instanceof CollectionEntry))
+ if (!(obj instanceof CollectionEntry))
return false;
- return fEntry.equals(((CollectionEntry)obj).fEntry);
+ return fEntry.equals(((CollectionEntry) obj).fEntry);
}
@Override
@@ -96,9 +96,10 @@ public class ToolListMap implements Cloneable {
private class Iter implements Iterator<CollectionEntry> {
private Iterator<Entry<ITool, List<ITool>>> fIter;
- private Iter(){
+ private Iter() {
fIter = fMapEntrySet.iterator();
}
+
@Override
public boolean hasNext() {
return fIter.hasNext();
@@ -116,7 +117,7 @@ public class ToolListMap implements Cloneable {
}
- private CollectionEntrySet(){
+ private CollectionEntrySet() {
fMapEntrySet = fMap.entrySet();
}
@@ -131,19 +132,18 @@ public class ToolListMap implements Cloneable {
}
}
-
- public void add(ITool key, ITool value){
+ public void add(ITool key, ITool value) {
List<ITool> l = get(key, true);
l.add(value);
}
- public List<ITool> removeAll(ITool key){
+ public List<ITool> removeAll(ITool key) {
return fMap.remove(key);
}
- public List<ITool> get(ITool key, boolean create){
+ public List<ITool> get(ITool key, boolean create) {
List<ITool> l = fMap.get(key);
- if(l == null && create){
+ if (l == null && create) {
l = newList(1);
fMap.put(key, l);
}
@@ -151,8 +151,8 @@ public class ToolListMap implements Cloneable {
return l;
}
- public List<ITool> valuesToCollection(List<ITool> c){
- if(c == null)
+ public List<ITool> valuesToCollection(List<ITool> c) {
+ if (c == null)
c = newList(20);
for (List<ITool> l : fMap.values()) {
@@ -162,26 +162,26 @@ public class ToolListMap implements Cloneable {
return c;
}
-// public List<ITool> getValues(){
-// return valuesToCollection(null);
-// }
+ // public List<ITool> getValues(){
+ // return valuesToCollection(null);
+ // }
-// public ITool[] getValuesArray(Class clazz){
-// List<ITool> list = getValues();
-// ITool[] result = (ITool[])Array.newInstance(clazz, list.size());
-// return list.toArray(result);
-// }
+ // public ITool[] getValuesArray(Class clazz){
+ // List<ITool> list = getValues();
+ // ITool[] result = (ITool[])Array.newInstance(clazz, list.size());
+ // return list.toArray(result);
+ // }
- protected List<ITool> newList(int size){
+ protected List<ITool> newList(int size) {
return new ArrayList<ITool>(size);
}
@SuppressWarnings("unchecked")
- protected List<ITool> cloneList(List<ITool> l){
- return (List<ITool>)((ArrayList<ITool>)l).clone();
+ protected List<ITool> cloneList(List<ITool> l) {
+ return (List<ITool>) ((ArrayList<ITool>) l).clone();
}
- public List<ITool> putValuesToCollection(List<ITool> c){
+ public List<ITool> putValuesToCollection(List<ITool> c) {
for (CollectionEntry entry : collectionEntrySet()) {
List<ITool> l = entry.getValue();
c.addAll(l);
@@ -189,28 +189,28 @@ public class ToolListMap implements Cloneable {
return c;
}
- public void remove(ITool key, ITool value){
+ public void remove(ITool key, ITool value) {
List<ITool> c = get(key, false);
- if(c != null){
- if(c.remove(value) && c.size() == 0){
+ if (c != null) {
+ if (c.remove(value) && c.size() == 0) {
fMap.remove(key);
}
}
}
- public ITool get(ITool key, int num){
+ public ITool get(ITool key, int num) {
List<ITool> l = get(key, false);
- if(l != null){
+ if (l != null) {
return l.get(num);
}
return null;
}
- public ITool remove(ITool key, int num){
+ public ITool remove(ITool key, int num) {
List<ITool> l = get(key, false);
- if(l != null){
+ if (l != null) {
ITool result = null;
- if(l.size() > num){
+ if (l.size() > num) {
result = l.remove(num);
}
@@ -219,11 +219,11 @@ public class ToolListMap implements Cloneable {
return null;
}
- public ITool removeLast(ITool key){
+ public ITool removeLast(ITool key) {
List<ITool> l = get(key, false);
- if(l != null){
+ if (l != null) {
ITool result = null;
- if(l.size() > 0){
+ if (l.size() > 0) {
result = l.remove(l.size() - 1);
}
return result;
@@ -231,55 +231,55 @@ public class ToolListMap implements Cloneable {
return null;
}
- public void removeAll(ITool key, List<ITool> values){
+ public void removeAll(ITool key, List<ITool> values) {
List<ITool> c = get(key, false);
- if(c != null){
- if(c.removeAll(values) && c.size() == 0){
+ if (c != null) {
+ if (c.removeAll(values) && c.size() == 0) {
fMap.remove(key);
}
}
}
- public void clearEmptyLists(){
- for(Iterator<Entry<ITool, List<ITool>>> iter = fMap.entrySet().iterator(); iter.hasNext(); ){
+ public void clearEmptyLists() {
+ for (Iterator<Entry<ITool, List<ITool>>> iter = fMap.entrySet().iterator(); iter.hasNext();) {
Map.Entry<ITool, List<ITool>> entry = iter.next();
- if((entry.getValue()).size() == 0)
+ if ((entry.getValue()).size() == 0)
iter.remove();
}
}
- public Set<CollectionEntry> collectionEntrySet(){
- if(fCollectionEntrySet == null)
+ public Set<CollectionEntry> collectionEntrySet() {
+ if (fCollectionEntrySet == null)
fCollectionEntrySet = new CollectionEntrySet();
return fCollectionEntrySet;
}
-// public void difference(ListMap map){
-// for(Iterator<Entry<ITool, List<ITool>>> iter = map.fMap.entrySet().iterator(); iter.hasNext(); ){
-// Map.Entry<ITool, List<ITool>> entry = iter.next();
-// List<ITool> thisC = fMap.get(entry.getKey());
-// if(thisC != null){
-// if(thisC.removeAll(entry.getValue()) && thisC == null){
-// fMap.remove(entry.getKey());
-// }
-// }
-// }
-// }
-
-// public ValueIter valueIter(){
-// return new ValueIter();
-// }
-
-// protected Collection createCollection(Object key){
-// return new ArrayList(1);
-// }
+ // public void difference(ListMap map){
+ // for(Iterator<Entry<ITool, List<ITool>>> iter = map.fMap.entrySet().iterator(); iter.hasNext(); ){
+ // Map.Entry<ITool, List<ITool>> entry = iter.next();
+ // List<ITool> thisC = fMap.get(entry.getKey());
+ // if(thisC != null){
+ // if(thisC.removeAll(entry.getValue()) && thisC == null){
+ // fMap.remove(entry.getKey());
+ // }
+ // }
+ // }
+ // }
+
+ // public ValueIter valueIter(){
+ // return new ValueIter();
+ // }
+
+ // protected Collection createCollection(Object key){
+ // return new ArrayList(1);
+ // }
@Override
public Object clone() {
try {
- ToolListMap clone = (ToolListMap)super.clone();
+ ToolListMap clone = (ToolListMap) super.clone();
@SuppressWarnings("unchecked")
- HashMap<ITool, List<ITool>> clone2 = (HashMap<ITool, List<ITool>>)fMap.clone();
+ HashMap<ITool, List<ITool>> clone2 = (HashMap<ITool, List<ITool>>) fMap.clone();
clone.fMap = clone2;
for (Entry<ITool, List<ITool>> entry : clone.fMap.entrySet()) {
entry.setValue(cloneList(entry.getValue()));
@@ -290,13 +290,13 @@ public class ToolListMap implements Cloneable {
return null;
}
-// protected Map getMap(boolean create){
-// if(fMap == null && create)
-// fMap = createMap();
-// return fMap;
-// }
-//
-// protected Map createMap(){
-// return new HashMap();
-// }
+ // protected Map getMap(boolean create){
+ // if(fMap == null && create)
+ // fMap = createMap();
+ // return fMap;
+ // }
+ //
+ // protected Map createMap(){
+ // return new HashMap();
+ // }
} \ No newline at end of file
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolListModification.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolListModification.java
index 9b3ec8e2e1f..4268332bb96 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolListModification.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolListModification.java
@@ -53,15 +53,15 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
public abstract class ToolListModification implements IToolListModification {
-// private Tool []fTools;
+ // private Tool []fTools;
private HashSet<String> fInputExtsSet = new HashSet<String>();
private ResourceInfo fRcInfo;
private LinkedHashMap<Tool, IToolModification> fProjCompInfoMap = new LinkedHashMap<Tool, IToolModification>();
private HashMap<Tool, IToolModification> fSysCompInfoMap = new HashMap<Tool, IToolModification>();
private Tool[] fAllSysTools;
private HashSet<ITool> fFilteredOutSysTools;
-// private LinkedHashMap fRealToToolMap = new LinkedHashMap();
-// private boolean fSysInfoMapInited;
+ // private LinkedHashMap fRealToToolMap = new LinkedHashMap();
+ // private boolean fSysInfoMapInited;
private PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> fCompleteObjectStorage;
protected TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> fCompletePathMapStorage;
private HashSet<Tool> fAddCapableTools;
@@ -73,7 +73,7 @@ public abstract class ToolListModification implements IToolListModification {
private ITool fReplacement;
private IToolModification fModification;
- ModificationOperation(IToolModification modification, ITool tool){
+ ModificationOperation(IToolModification modification, ITool tool) {
fModification = modification;
fReplacement = tool;
}
@@ -93,7 +93,7 @@ public abstract class ToolListModification implements IToolListModification {
private ITool fTool;
private boolean fIsProject;
- public FilteredTool(ITool tool, boolean isProject){
+ public FilteredTool(ITool tool, boolean isProject) {
fTool = tool;
fIsProject = isProject;
}
@@ -101,7 +101,8 @@ public abstract class ToolListModification implements IToolListModification {
@Override
public CompatibilityStatus getCompatibilityStatus() {
return fIsProject ? CompatibilityStatus.OK_COMPATIBILITY_STATUS
- : new CompatibilityStatus(IStatus.ERROR, Messages.getString("ToolListModification.ToolIsIncompatible"), null); //$NON-NLS-1$
+ : new CompatibilityStatus(IStatus.ERROR,
+ Messages.getString("ToolListModification.ToolIsIncompatible"), null); //$NON-NLS-1$
}
@Override
@@ -141,12 +142,12 @@ public abstract class ToolListModification implements IToolListModification {
private boolean fInited;
private Set<Tool> fExtConflictTools;
- ProjToolCompatibilityStatusInfo(Tool tool){
+ ProjToolCompatibilityStatusInfo(Tool tool) {
fSelectedTool = tool;
- fRealTool = (Tool)ManagedBuildManager.getRealTool(tool);
+ fRealTool = (Tool) ManagedBuildManager.getRealTool(tool);
}
- private ToolCompatibilityInfoElement getCurrentElement(){
+ private ToolCompatibilityInfoElement getCurrentElement() {
checkInitCompatibleTools();
return fCurrentElement;
}
@@ -157,7 +158,7 @@ public abstract class ToolListModification implements IToolListModification {
}
@Override
- public boolean isCompatible(){
+ public boolean isCompatible() {
return getCurrentElement().isCompatible();
}
@@ -166,43 +167,46 @@ public abstract class ToolListModification implements IToolListModification {
return true;
}
- public Map<Tool, ToolCompatibilityInfoElement> getCompatibleTools(){
+ public Map<Tool, ToolCompatibilityInfoElement> getCompatibleTools() {
checkInitCompatibleTools();
return fCompatibleTools;
}
- private void checkInitCompatibleTools(){
- if(fInited)
+ private void checkInitCompatibleTools() {
+ if (fInited)
return;
- if(DbgTcmUtil.DEBUG)
+ if (DbgTcmUtil.DEBUG)
DbgTcmUtil.println("calculating compatibility for tool " + fRealTool.getUniqueRealName()); //$NON-NLS-1$
PerTypeMapStorage<? extends IRealBuildObjectAssociation, Set<IPath>> storage = getCompleteObjectStore();
Tool tool = fRealTool;
Set<IPath> rmSet = getToolApplicabilityPathSet(tool, true);
@SuppressWarnings("unchecked")
- Map<Tool, Set<IPath>> toolMap = (Map<Tool, Set<IPath>>) storage.getMap(IRealBuildObjectAssociation.OBJECT_TOOL, false);
+ Map<Tool, Set<IPath>> toolMap = (Map<Tool, Set<IPath>>) storage
+ .getMap(IRealBuildObjectAssociation.OBJECT_TOOL, false);
try {
- if(rmSet != null && rmSet.size() != 0)
+ if (rmSet != null && rmSet.size() != 0)
TcModificationUtil.removePaths(toolMap, tool, rmSet);
- if(DbgTcmUtil.DEBUG)
+ if (DbgTcmUtil.DEBUG)
DbgTcmUtil.dumpStorage(storage);
@SuppressWarnings("unchecked")
- ConflictMatchSet conflicts = ToolChainModificationManager.getInstance().getConflictInfo(IRealBuildObjectAssociation.OBJECT_TOOL, (PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>>) storage);
+ ConflictMatchSet conflicts = ToolChainModificationManager.getInstance().getConflictInfo(
+ IRealBuildObjectAssociation.OBJECT_TOOL,
+ (PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>>) storage);
fCompatibleTools = new HashMap<Tool, ToolCompatibilityInfoElement>();
fInCompatibleTools = new HashMap<Tool, ToolCompatibilityInfoElement>();
Tool sysTools[] = getTools(false, true);
@SuppressWarnings("unchecked")
Map<Tool, List<ConflictMatch>> conflictMap = (Map<Tool, List<ConflictMatch>>) conflicts.fObjToConflictListMap;
- for(int i = 0; i < sysTools.length; i++){
+ for (int i = 0; i < sysTools.length; i++) {
Tool t = sysTools[i];
List<ConflictMatch> l = conflictMap.get(t);
ToolCompatibilityInfoElement el = new ToolCompatibilityInfoElement(this, t, l);
- if(el.isCompatible()){
+ if (el.isCompatible()) {
fCompatibleTools.put(t, el);
} else {
fInCompatibleTools.put(t, el);
@@ -213,18 +217,18 @@ public abstract class ToolListModification implements IToolListModification {
List<ConflictMatch> l = conflictMap.get(t);
fCurrentElement = new ToolCompatibilityInfoElement(this, t, l);
} finally {
- if(rmSet != null && rmSet.size() != 0)
+ if (rmSet != null && rmSet.size() != 0)
TcModificationUtil.addPaths(toolMap, tool, rmSet);
}
fInited = true;
}
- private Set<Tool> getConflictingTools(){
- if(fExtConflictTools == null){
+ private Set<Tool> getConflictingTools() {
+ if (fExtConflictTools == null) {
Tool[] tmp = new Tool[1];
tmp[0] = fSelectedTool;
tmp = filterTools(tmp);
- if(tmp.length == 0)
+ if (tmp.length == 0)
fExtConflictTools = Collections.emptySet();
else
fExtConflictTools = getExtensionConflictToolSet(fSelectedTool, filterTools(getTools(true, false)));
@@ -234,28 +238,27 @@ public abstract class ToolListModification implements IToolListModification {
@Override
public IModificationOperation[] getSupportedOperations() {
- if(fOperations == null){
+ if (fOperations == null) {
checkInitCompatibleTools();
- if(fFilteredOutTools.containsKey(fRealTool)){
- if(canRemove(fRealTool)){
- fOperations = new ModificationOperation[]{
- new ModificationOperation(this, null)
- };
+ if (fFilteredOutTools.containsKey(fRealTool)) {
+ if (canRemove(fRealTool)) {
+ fOperations = new ModificationOperation[] { new ModificationOperation(this, null) };
} else {
fOperations = new ModificationOperation[0];
}
} else {
- List<ModificationOperation> opList = new ArrayList<ModificationOperation>(fCompatibleTools.size() + 1);
+ List<ModificationOperation> opList = new ArrayList<ModificationOperation>(
+ fCompatibleTools.size() + 1);
Set<Tool> keySet = fCompatibleTools.keySet();
for (Tool tool : keySet) {
- if(tool == fRealTool)
+ if (tool == fRealTool)
continue;
- if(canReplace(fRealTool, tool))
+ if (canReplace(fRealTool, tool))
opList.add(new ModificationOperation(this, tool));
}
- if(fCompatibleTools.size() == 0 || canRemove(fRealTool)){
+ if (fCompatibleTools.size() == 0 || canRemove(fRealTool)) {
opList.add(new ModificationOperation(this, null));
}
@@ -279,7 +282,7 @@ public abstract class ToolListModification implements IToolListModification {
return fRcInfo;
}
- public void clearCompatibilityInfo(){
+ public void clearCompatibilityInfo() {
fInited = false;
fCompatibleTools = null;
fInCompatibleTools = null;
@@ -290,7 +293,7 @@ public abstract class ToolListModification implements IToolListModification {
}
- protected Set<String> getInputExtsSet(){
+ protected Set<String> getInputExtsSet() {
return fInputExtsSet;
}
@@ -300,28 +303,28 @@ public abstract class ToolListModification implements IToolListModification {
private Tool fRealTool;
private CompatibilityStatus fStatus;
- SysToolCompatibilityStatusInfo(Tool tool){
+ SysToolCompatibilityStatusInfo(Tool tool) {
fSelectedTool = tool;
- fRealTool = (Tool)ManagedBuildManager.getRealTool(tool);
+ fRealTool = (Tool) ManagedBuildManager.getRealTool(tool);
}
-// private ToolCompatibilityInfoElement getCurrentElement(){
-// if(fCurrentElement == null){
-// checkInitCompatibleTools();
-// ToolCompatibilityInfoElement info = (ToolCompatibilityInfoElement)fCompatibleTools.get(fRealTool);
-// if(info == null)
-// info = (ToolCompatibilityInfoElement)fInCompatibleTools.get(fRealTool);
-// fCurrentElement = info;
-// }
-// return fCurrentElement;
-// }
+ // private ToolCompatibilityInfoElement getCurrentElement(){
+ // if(fCurrentElement == null){
+ // checkInitCompatibleTools();
+ // ToolCompatibilityInfoElement info = (ToolCompatibilityInfoElement)fCompatibleTools.get(fRealTool);
+ // if(info == null)
+ // info = (ToolCompatibilityInfoElement)fInCompatibleTools.get(fRealTool);
+ // fCurrentElement = info;
+ // }
+ // return fCurrentElement;
+ // }
@Override
public CompatibilityStatus getCompatibilityStatus() {
- if(fStatus == null){
+ if (fStatus == null) {
int severity;
String message;
- if(!isCompatible()){
+ if (!isCompatible()) {
severity = IStatus.ERROR;
message = Messages.getString("ToolListModification.ToolIsIncompatible"); //$NON-NLS-1$
} else {
@@ -334,7 +337,7 @@ public abstract class ToolListModification implements IToolListModification {
}
@Override
- public boolean isCompatible(){
+ public boolean isCompatible() {
return getSupportedOperationsArray().length > 0;
}
@@ -344,18 +347,18 @@ public abstract class ToolListModification implements IToolListModification {
}
public IModificationOperation[] getSupportedOperationsArray() {
- if(fOperations == null){
+ if (fOperations == null) {
Set<Tool> addCompatibleSysToolsSet = getAddCompatibleSysTools();
- if(addCompatibleSysToolsSet.contains(fRealTool) && canAdd(fRealTool)){
- fOperations = new ModificationOperation[]{new ModificationOperation(this, null)};
+ if (addCompatibleSysToolsSet.contains(fRealTool) && canAdd(fRealTool)) {
+ fOperations = new ModificationOperation[] { new ModificationOperation(this, null) };
} else {
Map<Tool, IToolModification> projMap = getMap(true);
List<ModificationOperation> opList = new ArrayList<ModificationOperation>(projMap.size());
for (IToolModification tm : projMap.values()) {
- ProjToolCompatibilityStatusInfo info = (ProjToolCompatibilityStatusInfo)tm;
- if(info.getCompatibleTools().containsKey(fRealTool)
+ ProjToolCompatibilityStatusInfo info = (ProjToolCompatibilityStatusInfo) tm;
+ if (info.getCompatibleTools().containsKey(fRealTool)
&& !fFilteredOutTools.containsKey(info.fRealTool)
- && canReplace(info.fSelectedTool, this.fSelectedTool)){
+ && canReplace(info.fSelectedTool, this.fSelectedTool)) {
opList.add(new ModificationOperation(this, info.fSelectedTool));
}
}
@@ -385,44 +388,47 @@ public abstract class ToolListModification implements IToolListModification {
return fRcInfo;
}
- public void clearCompatibilityInfo(){
+ public void clearCompatibilityInfo() {
fOperations = null;
fStatus = null;
}
}
- private Set<Tool> getAddCompatibleSysTools(){
- if(fAddCapableTools == null){
+ private Set<Tool> getAddCompatibleSysTools() {
+ if (fAddCapableTools == null) {
fAddCapableTools = new HashSet<Tool>(Arrays.asList(getAllSysTools()));
PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> storage = getCompleteObjectStore();
- ConflictMatchSet conflicts = ToolChainModificationManager.getInstance().getConflictInfo(IRealBuildObjectAssociation.OBJECT_TOOL, storage);
+ ConflictMatchSet conflicts = ToolChainModificationManager.getInstance()
+ .getConflictInfo(IRealBuildObjectAssociation.OBJECT_TOOL, storage);
fAddCapableTools.removeAll(conflicts.fObjToConflictListMap.keySet());
}
return fAddCapableTools;
}
- public ToolListModification(ResourceInfo rcInfo, ITool[] tools){
+ public ToolListModification(ResourceInfo rcInfo, ITool[] tools) {
fRcInfo = rcInfo;
clearToolInfo(tools);
}
- public ToolListModification(ResourceInfo rcInfo, ToolListModification base){
+ public ToolListModification(ResourceInfo rcInfo, ToolListModification base) {
fRcInfo = rcInfo;
- Tool[] initialTools = (Tool[])rcInfo.getTools();
+ Tool[] initialTools = (Tool[]) rcInfo.getTools();
@SuppressWarnings("unchecked")
- Map<Tool, Tool> initRealToToolMap = (Map<Tool, Tool>) TcModificationUtil.getRealToObjectsMap(initialTools, null);
+ Map<Tool, Tool> initRealToToolMap = (Map<Tool, Tool>) TcModificationUtil.getRealToObjectsMap(initialTools,
+ null);
Tool[] updatedTools = base.getTools(true, false);
@SuppressWarnings("unchecked")
- Map<Tool, Tool> updatedRealToToolMap = (Map<Tool, Tool>) TcModificationUtil.getRealToObjectsMap(updatedTools, null);
+ Map<Tool, Tool> updatedRealToToolMap = (Map<Tool, Tool>) TcModificationUtil.getRealToObjectsMap(updatedTools,
+ null);
Set<Entry<Tool, Tool>> entrySet = updatedRealToToolMap.entrySet();
for (Entry<Tool, Tool> entry : entrySet) {
Tool real = entry.getKey();
Tool initial = initRealToToolMap.get(real);
- if(initial != null){
+ if (initial != null) {
entry.setValue(initial);
} else {
Tool updated = entry.getValue();
- if(!updated.isExtensionBuildObject()){
+ if (!updated.isExtensionBuildObject()) {
updated = (Tool) updated.getExtensionObject();
entry.setValue(updated);
}
@@ -432,36 +438,35 @@ public abstract class ToolListModification implements IToolListModification {
updatedRealToToolMap.values().toArray(updatedTools);
clearToolInfo(updatedTools);
-// if(base.fInputExtsSet != null)
-// fInputExtsSet = (HashSet)base.fInputExtsSet.clone();
-// private LinkedHashMap fProjCompInfoMap = new LinkedHashMap();
-// private HashMap fSysCompInfoMap = new HashMap();
- if(base.fAllSysTools != null)
+ // if(base.fInputExtsSet != null)
+ // fInputExtsSet = (HashSet)base.fInputExtsSet.clone();
+ // private LinkedHashMap fProjCompInfoMap = new LinkedHashMap();
+ // private HashMap fSysCompInfoMap = new HashMap();
+ if (base.fAllSysTools != null)
fAllSysTools = base.fAllSysTools.clone();
- if(base.fFilteredOutSysTools != null) {
+ if (base.fFilteredOutSysTools != null) {
@SuppressWarnings("unchecked")
- HashSet<ITool> clone = (HashSet<ITool>)base.fFilteredOutSysTools.clone();
+ HashSet<ITool> clone = (HashSet<ITool>) base.fFilteredOutSysTools.clone();
fFilteredOutSysTools = clone;
}
- if(base.fCompleteObjectStorage != null){
+ if (base.fCompleteObjectStorage != null) {
fCompleteObjectStorage = TcModificationUtil.cloneRealToolToPathSet(base.fCompleteObjectStorage);
}
- if(base.fCompletePathMapStorage != null){
+ if (base.fCompletePathMapStorage != null) {
fCompletePathMapStorage = base.fCompletePathMapStorage;
}
-// if(base.fAddCapableTools)
-// fAddCapableTools = (HashSet)base.fAddCapableTools.clone();
+ // if(base.fAddCapableTools)
+ // fAddCapableTools = (HashSet)base.fAddCapableTools.clone();
//private Map fFilteredOutTools;
-// private ToolListModificationInfo fModificationInfo;
+ // private ToolListModificationInfo fModificationInfo;
}
-
@Override
- public IResourceInfo getResourceInfo(){
+ public IResourceInfo getResourceInfo() {
return fRcInfo;
}
@@ -483,19 +488,20 @@ public abstract class ToolListModification implements IToolListModification {
private CompatibilityStatus fStatus;
private ProjToolCompatibilityStatusInfo fStatusInfo;
- ToolCompatibilityInfoElement(ProjToolCompatibilityStatusInfo statusInfo, Tool realTool, List<ConflictMatch> errConflictList){
+ ToolCompatibilityInfoElement(ProjToolCompatibilityStatusInfo statusInfo, Tool realTool,
+ List<ConflictMatch> errConflictList) {
fStatusInfo = statusInfo;
fRealTool = realTool;
- if(errConflictList != null && errConflictList.size() != 0)
+ if (errConflictList != null && errConflictList.size() != 0)
fErrComflictMatchList = errConflictList;
}
- public CompatibilityStatus getCompatibilityStatus(){
- if(fStatus == null){
+ public CompatibilityStatus getCompatibilityStatus() {
+ if (fStatus == null) {
int severity;
String message;
ConflictSet conflicts;
- if(!isCompatible()){
+ if (!isCompatible()) {
severity = IStatus.ERROR;
message = Messages.getString("ToolListModification.ToolIsIncompatible"); //$NON-NLS-1$
conflicts = new ConflictSet(fRealTool, fErrComflictMatchList, fStatusInfo.getConflictingTools());
@@ -509,20 +515,20 @@ public abstract class ToolListModification implements IToolListModification {
return fStatus;
}
- public boolean isCompatible(){
- return noCompatibilityConflicts() &&
- (fRealTool != fStatusInfo.getRealTool() || fStatusInfo.getConflictingTools().size() == 0);
+ public boolean isCompatible() {
+ return noCompatibilityConflicts()
+ && (fRealTool != fStatusInfo.getRealTool() || fStatusInfo.getConflictingTools().size() == 0);
}
- public boolean noCompatibilityConflicts(){
+ public boolean noCompatibilityConflicts() {
return fErrComflictMatchList == null;
}
}
- private Tool[] getAllSysTools(){
- if(fAllSysTools == null){
+ private Tool[] getAllSysTools() {
+ if (fAllSysTools == null) {
ITool[] allSys = ManagedBuildManager.getRealTools();
- fAllSysTools = filterTools((Tool[])allSys);
+ fAllSysTools = filterTools((Tool[]) allSys);
HashSet<ITool> set = new HashSet<ITool>(Arrays.asList(allSys));
set.removeAll(Arrays.asList(fAllSysTools));
fFilteredOutSysTools = set;
@@ -532,63 +538,66 @@ public abstract class ToolListModification implements IToolListModification {
@Override
public final void apply() throws CoreException {
- TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> initialMap = TcModificationUtil.createPathMap(fRcInfo.getParent());
+ TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> initialMap = TcModificationUtil
+ .createPathMap(fRcInfo.getParent());
TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> cur = getCompletePathMapStorage();
- TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> result = TcModificationUtil.createResultingChangesMap(cur, initialMap);
+ TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> result = TcModificationUtil
+ .createResultingChangesMap(cur, initialMap);
apply(result);
}
- private void apply(TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> resultingChangeMap) throws CoreException {
+ private void apply(TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> resultingChangeMap)
+ throws CoreException {
//the order matters here: we first should process tool-chain than a builder and then tools
- int types[] = new int[]{
- IRealBuildObjectAssociation.OBJECT_TOOLCHAIN,
- IRealBuildObjectAssociation.OBJECT_BUILDER,
- IRealBuildObjectAssociation.OBJECT_TOOL,
- };
+ int types[] = new int[] { IRealBuildObjectAssociation.OBJECT_TOOLCHAIN,
+ IRealBuildObjectAssociation.OBJECT_BUILDER, IRealBuildObjectAssociation.OBJECT_TOOL, };
int type;
IConfiguration cfg = fRcInfo.getParent();
Set<Entry<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>>> entrySet = resultingChangeMap.entrySet();
for (Entry<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> entry : entrySet) {
IPath path = entry.getKey();
- ResourceInfo rcInfo = (ResourceInfo)cfg.getResourceInfo(path, true);
- if(rcInfo == null){
- rcInfo = (FolderInfo)cfg.createFolderInfo(path);
+ ResourceInfo rcInfo = (ResourceInfo) cfg.getResourceInfo(path, true);
+ if (rcInfo == null) {
+ rcInfo = (FolderInfo) cfg.createFolderInfo(path);
}
PerTypeSetStorage<IRealBuildObjectAssociation> storage = entry.getValue();
- for(int i = 0; i < types.length; i++){
+ for (int i = 0; i < types.length; i++) {
type = types[i];
Set<IRealBuildObjectAssociation> set = storage.getSet(type, false);
- if(set != null){
+ if (set != null) {
apply(rcInfo, type, set);
}
}
}
}
- private void apply(ResourceInfo rcInfo, int type, Set<? extends IRealBuildObjectAssociation> set) throws CoreException {
- switch(type){
+ private void apply(ResourceInfo rcInfo, int type, Set<? extends IRealBuildObjectAssociation> set)
+ throws CoreException {
+ switch (type) {
case IRealBuildObjectAssociation.OBJECT_TOOL:
- ToolListModificationInfo info = rcInfo == fRcInfo ? getModificationInfo() :
- ToolChainModificationHelper.getModificationInfo(rcInfo, rcInfo.getTools(), set.toArray(new Tool[set.size()]));
- info.apply();
+ ToolListModificationInfo info = rcInfo == fRcInfo ? getModificationInfo()
+ : ToolChainModificationHelper.getModificationInfo(rcInfo, rcInfo.getTools(),
+ set.toArray(new Tool[set.size()]));
+ info.apply();
break;
case IRealBuildObjectAssociation.OBJECT_TOOLCHAIN:
- if(rcInfo.isFolderInfo()){
- if(set.size() != 0){
- ToolChain tc = (ToolChain)set.iterator().next();
+ if (rcInfo.isFolderInfo()) {
+ if (set.size() != 0) {
+ ToolChain tc = (ToolChain) set.iterator().next();
try {
- ((FolderInfo)rcInfo).changeToolChain(tc, CDataUtil.genId(tc.getId()), null);
+ ((FolderInfo) rcInfo).changeToolChain(tc, CDataUtil.genId(tc.getId()), null);
} catch (BuildException e) {
- throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), e.getLocalizedMessage(), e));
+ throw new CoreException(new Status(IStatus.ERROR,
+ ManagedBuilderCorePlugin.getUniqueIdentifier(), e.getLocalizedMessage(), e));
}
}
}
break;
case IRealBuildObjectAssociation.OBJECT_BUILDER:
- if(rcInfo.isRoot()){
- if(set.size() != 0){
- Builder b = (Builder)set.iterator().next();
+ if (rcInfo.isRoot()) {
+ if (set.size() != 0) {
+ Builder b = (Builder) set.iterator().next();
rcInfo.getParent().changeBuilder(b, CDataUtil.genId(b.getId()), null);
}
}
@@ -596,9 +605,10 @@ public abstract class ToolListModification implements IToolListModification {
}
}
- private ToolListModificationInfo getModificationInfo(){
- if(fModificationInfo == null){
- fModificationInfo = ToolChainModificationHelper.getModificationInfo(fRcInfo, fRcInfo.getTools(), getTools(true, false));
+ private ToolListModificationInfo getModificationInfo() {
+ if (fModificationInfo == null) {
+ fModificationInfo = ToolChainModificationHelper.getModificationInfo(fRcInfo, fRcInfo.getTools(),
+ getTools(true, false));
}
return fModificationInfo;
}
@@ -622,11 +632,11 @@ public abstract class ToolListModification implements IToolListModification {
@Override
public IToolModification getToolModification(ITool tool) {
- Tool rt = (Tool)ManagedBuildManager.getRealTool(tool);
+ Tool rt = (Tool) ManagedBuildManager.getRealTool(tool);
boolean isProj = isProjectTool(rt);
Map<Tool, IToolModification> map = getMap(isProj);
IToolModification m = map.get(rt);
- if(m == null){
+ if (m == null) {
ITool realTool = ManagedBuildManager.getRealTool(tool);
boolean projFiltered = fFilteredOutTools.keySet().contains(realTool);
m = new FilteredTool(tool, projFiltered);
@@ -634,24 +644,24 @@ public abstract class ToolListModification implements IToolListModification {
return m;
}
-// private Map<Tool, IToolModification> getMap(Tool tool){
-// return getMap(isProjectTool(tool));
-// }
+ // private Map<Tool, IToolModification> getMap(Tool tool){
+ // return getMap(isProjectTool(tool));
+ // }
- private Map<Tool, IToolModification> getMap(boolean proj){
+ private Map<Tool, IToolModification> getMap(boolean proj) {
return proj ? fProjCompInfoMap : fSysCompInfoMap;
}
- private Tool[] getTools(boolean proj, boolean real){
- if(proj){
- if(real)
+ private Tool[] getTools(boolean proj, boolean real) {
+ if (proj) {
+ if (real)
return fProjCompInfoMap.keySet().toArray(new Tool[fProjCompInfoMap.size()]);
Tool[] tools = new Tool[fProjCompInfoMap.size()];
int i = 0;
Collection<IToolModification> infos = fProjCompInfoMap.values();
for (IToolModification info : infos) {
- tools[i++] = ((ProjToolCompatibilityStatusInfo)info).fSelectedTool;
+ tools[i++] = ((ProjToolCompatibilityStatusInfo) info).fSelectedTool;
}
return tools;
}
@@ -659,27 +669,27 @@ public abstract class ToolListModification implements IToolListModification {
return fSysCompInfoMap.keySet().toArray(new Tool[fSysCompInfoMap.size()]);
}
- private boolean isProjectTool(Tool tool){
+ private boolean isProjectTool(Tool tool) {
return fProjCompInfoMap.containsKey(tool.getRealBuildObject());
}
@Override
public void changeProjectTools(ITool removeTool, ITool addTool) {
Map<ITool, ITool> map = createRealToToolMap();
- Tool realAdded = (Tool)ManagedBuildManager.getRealTool(addTool);
- Tool realRemoved = (Tool)ManagedBuildManager.getRealTool(removeTool);
+ Tool realAdded = (Tool) ManagedBuildManager.getRealTool(addTool);
+ Tool realRemoved = (Tool) ManagedBuildManager.getRealTool(removeTool);
boolean removed = realRemoved != null ? map.remove(realRemoved) != null : false;
boolean added = realAdded != null ? map.put(realAdded, addTool) == null : false;
- if(!added && !removed)
+ if (!added && !removed)
return;
Set<IPath> rmSet = null;
Set<IPath> addSet = null;
- if(removed){
+ if (removed) {
rmSet = getToolApplicabilityPathSet(realRemoved, true);
}
- if(added){
- if(rmSet == null)
+ if (added) {
+ if (rmSet == null)
addSet = getToolApplicabilityPathSet(realAdded, false);
else
addSet = rmSet;
@@ -691,45 +701,45 @@ public abstract class ToolListModification implements IToolListModification {
PerTypeMapStorage<? extends IRealBuildObjectAssociation, Set<IPath>> storage = getCompleteObjectStore();
@SuppressWarnings("unchecked")
- Map<Tool, Set<IPath>> toolMap = (Map<Tool, Set<IPath>>) storage.getMap(IRealBuildObjectAssociation.OBJECT_TOOL, true);
- if(rmSet != null)
+ Map<Tool, Set<IPath>> toolMap = (Map<Tool, Set<IPath>>) storage.getMap(IRealBuildObjectAssociation.OBJECT_TOOL,
+ true);
+ if (rmSet != null)
TcModificationUtil.removePaths(toolMap, realRemoved, rmSet);
- if(addSet != null)
+ if (addSet != null)
TcModificationUtil.addPaths(toolMap, realAdded, addSet);
}
- private HashMap<ITool, ITool> createRealToToolMap(/*boolean includeFilteredOut*/){
+ private HashMap<ITool, ITool> createRealToToolMap(/*boolean includeFilteredOut*/) {
HashMap<ITool, ITool> map = new HashMap<ITool, ITool>();
Set<Entry<Tool, IToolModification>> entries = fProjCompInfoMap.entrySet();
for (Entry<Tool, IToolModification> entry : entries) {
map.put(entry.getKey(), entry.getValue().getTool());
}
-// if(includeFilteredOut){
-// for(Iterator iter = fFilteredOutTools.entrySet().iterator(); iter.hasNext(); ){
-// Map.Entry entry = (Map.Entry)iter.next();
-// map.put(entry.getKey(), entry.getValue());
-// }
-// }
+ // if(includeFilteredOut){
+ // for(Iterator iter = fFilteredOutTools.entrySet().iterator(); iter.hasNext(); ){
+ // Map.Entry entry = (Map.Entry)iter.next();
+ // map.put(entry.getKey(), entry.getValue());
+ // }
+ // }
return map;
}
- protected void clearToolCompatibilityInfo(){
+ protected void clearToolCompatibilityInfo() {
for (IToolModification info : fProjCompInfoMap.values()) {
- ((ProjToolCompatibilityStatusInfo)info).clearCompatibilityInfo();
+ ((ProjToolCompatibilityStatusInfo) info).clearCompatibilityInfo();
}
for (IToolModification info : fSysCompInfoMap.values()) {
- ((SysToolCompatibilityStatusInfo)info).clearCompatibilityInfo();
+ ((SysToolCompatibilityStatusInfo) info).clearCompatibilityInfo();
}
}
-
- protected void clearToolInfo(ITool[] tools){
+ protected void clearToolInfo(ITool[] tools) {
Tool[] filteredTools;
Tool[] allTools;
- if(tools instanceof Tool[]){
- allTools = (Tool[])tools;
+ if (tools instanceof Tool[]) {
+ allTools = (Tool[]) tools;
} else {
allTools = new Tool[tools.length];
System.arraycopy(tools, 0, allTools, 0, tools.length);
@@ -742,23 +752,23 @@ public abstract class ToolListModification implements IToolListModification {
Map<Tool, Tool> allMap = (Map<Tool, Tool>) TcModificationUtil.getRealToObjectsMap(allTools, null);
allMap.keySet().removeAll(filteredMap.keySet());
fFilteredOutTools = allMap;
-// tools = filteredTools;
+ // tools = filteredTools;
fModificationInfo = null;
fInputExtsSet.clear();
fProjCompInfoMap.clear();
- for(int i = 0; i < tools.length; i++){
+ for (int i = 0; i < tools.length; i++) {
ITool tool = tools[i];
- Tool realTool = (Tool)ManagedBuildManager.getRealTool(tool);
- fProjCompInfoMap.put(realTool, new ProjToolCompatibilityStatusInfo((Tool)tool));
- if(!fFilteredOutTools.containsKey(realTool))
+ Tool realTool = (Tool) ManagedBuildManager.getRealTool(tool);
+ fProjCompInfoMap.put(realTool, new ProjToolCompatibilityStatusInfo((Tool) tool));
+ if (!fFilteredOutTools.containsKey(realTool))
fInputExtsSet.addAll(Arrays.asList(tool.getPrimaryInputExtensions()));
}
fSysCompInfoMap.clear();
Tool[] sysTools = getAllSysTools();
- for(int i = 0; i < sysTools.length; i++){
+ for (int i = 0; i < sysTools.length; i++) {
Tool sysTool = sysTools[i];
- if(!fProjCompInfoMap.containsKey(sysTool)){
+ if (!fProjCompInfoMap.containsKey(sysTool)) {
fSysCompInfoMap.put(sysTool, new SysToolCompatibilityStatusInfo(sysTool));
}
}
@@ -766,10 +776,10 @@ public abstract class ToolListModification implements IToolListModification {
fCompletePathMapStorage = null;
}
- protected PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> getCompleteObjectStore(){
- if(fCompleteObjectStorage == null){
+ protected PerTypeMapStorage<IRealBuildObjectAssociation, Set<IPath>> getCompleteObjectStore() {
+ if (fCompleteObjectStorage == null) {
fCompleteObjectStorage = TcModificationUtil.createRealToolToPathSet(fRcInfo.getParent(), null, false);
- if(DbgTcmUtil.DEBUG){
+ if (DbgTcmUtil.DEBUG) {
DbgTcmUtil.println("dumping complete storage"); //$NON-NLS-1$
DbgTcmUtil.dumpStorage(fCompleteObjectStorage);
}
@@ -777,8 +787,8 @@ public abstract class ToolListModification implements IToolListModification {
return fCompleteObjectStorage;
}
- protected TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> getCompletePathMapStorage(){
- if(fCompletePathMapStorage == null){
+ protected TreeMap<IPath, PerTypeSetStorage<IRealBuildObjectAssociation>> getCompletePathMapStorage() {
+ if (fCompletePathMapStorage == null) {
fCompletePathMapStorage = TcModificationUtil.createPathMap(getCompleteObjectStore());
}
return fCompletePathMapStorage;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/ConflictDefinitionElement.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/ConflictDefinitionElement.java
index 86b5387f9d7..e9f30b59832 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/ConflictDefinitionElement.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/ConflictDefinitionElement.java
@@ -18,8 +18,7 @@ import org.eclipse.core.runtime.IConfigurationElement;
public class ConflictDefinitionElement extends MatchObjectList {
public static final String ELEMENT_NAME = "conflictDefinition"; //$NON-NLS-1$
- public ConflictDefinitionElement(IConfigurationElement element)
- throws IllegalArgumentException {
+ public ConflictDefinitionElement(IConfigurationElement element) throws IllegalArgumentException {
super(element);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/MatchObjectElement.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/MatchObjectElement.java
index 7dc6c069199..c6cf1ea528e 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/MatchObjectElement.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/MatchObjectElement.java
@@ -32,62 +32,66 @@ public class MatchObjectElement {
private static String ATTR_PATTERN_TYPE_ID_TYPE = "objectIdsType"; //$NON-NLS-1$
private static String DELIMITER = ";"; //$NON-NLS-1$
-
+
private int fObjectType;
private PatternElement[] fPatterns;
private int fHash;
-
+
public static class TypeToStringAssociation {
private int fType;
private String fString;
private static ObjectTypeBasedStorage<TypeToStringAssociation> fTypeAssociationStorage = new ObjectTypeBasedStorage<TypeToStringAssociation>();
private static Map<String, TypeToStringAssociation> fStringAssociationStorage = new HashMap<String, TypeToStringAssociation>();
-
- public static TypeToStringAssociation TOOL = new TypeToStringAssociation(IRealBuildObjectAssociation.OBJECT_TOOL, "tool"); //$NON-NLS-1$
- public static TypeToStringAssociation TOOLCHAIN = new TypeToStringAssociation(IRealBuildObjectAssociation.OBJECT_TOOLCHAIN, "toolChain"); //$NON-NLS-1$
- public static TypeToStringAssociation CONFIGURATION = new TypeToStringAssociation(IRealBuildObjectAssociation.OBJECT_CONFIGURATION, "configuration"); //$NON-NLS-1$
- public static TypeToStringAssociation BUILDER = new TypeToStringAssociation(IRealBuildObjectAssociation.OBJECT_BUILDER, "builder"); //$NON-NLS-1$
-
- private TypeToStringAssociation(int type, String string){
+
+ public static TypeToStringAssociation TOOL = new TypeToStringAssociation(
+ IRealBuildObjectAssociation.OBJECT_TOOL, "tool"); //$NON-NLS-1$
+ public static TypeToStringAssociation TOOLCHAIN = new TypeToStringAssociation(
+ IRealBuildObjectAssociation.OBJECT_TOOLCHAIN, "toolChain"); //$NON-NLS-1$
+ public static TypeToStringAssociation CONFIGURATION = new TypeToStringAssociation(
+ IRealBuildObjectAssociation.OBJECT_CONFIGURATION, "configuration"); //$NON-NLS-1$
+ public static TypeToStringAssociation BUILDER = new TypeToStringAssociation(
+ IRealBuildObjectAssociation.OBJECT_BUILDER, "builder"); //$NON-NLS-1$
+
+ private TypeToStringAssociation(int type, String string) {
fType = type;
fString = string;
fTypeAssociationStorage.set(type, this);
fStringAssociationStorage.put(fString, this);
}
-
- public int getType(){
+
+ public int getType() {
return fType;
}
-
- public String getString(){
+
+ public String getString() {
return fString;
}
-
- public static TypeToStringAssociation getAssociation(String str){
+
+ public static TypeToStringAssociation getAssociation(String str) {
return fStringAssociationStorage.get(str);
}
-
- public static TypeToStringAssociation getAssociation(int type){
+
+ public static TypeToStringAssociation getAssociation(int type) {
return fTypeAssociationStorage.get(type);
}
}
private static class PatternTypeKey {
private int fType;
-
- PatternTypeKey(PatternElement el){
+
+ PatternTypeKey(PatternElement el) {
fType = el.getCompleteOredTypeValue();
}
@Override
public boolean equals(Object obj) {
- if(obj == this)
+ if (obj == this)
return true;
-
- if(!(obj instanceof PatternTypeKey))
+
+ if (!(obj instanceof PatternTypeKey))
return false;
-
- return fType == ((PatternTypeKey)obj).fType;
+
+ return fType == ((PatternTypeKey) obj).fType;
}
@Override
@@ -95,12 +99,12 @@ public class MatchObjectElement {
return fType;
}
}
-
+
public class PatternElement {
private HashSet<String> fIds;
private int fHashPE;
private int fType;
-
+
private static final int SEARCH_TYPE_MASK = 0xff;
private static final int SEARCH_TYPE_OFFSET = 0;
public static final int TYPE_SEARCH_EXTENSION_OBJECT = 1 << SEARCH_TYPE_OFFSET;
@@ -118,19 +122,19 @@ public class MatchObjectElement {
private static final String EXACT_MATCH = "EXACT_MATCH"; //$NON-NLS-1$
private static final String REGEGP = "REGEXP"; //$NON-NLS-1$
-
- PatternElement(IConfigurationElement el, int defaultSearchType, int defaultIdType){
+
+ PatternElement(IConfigurationElement el, int defaultSearchType, int defaultIdType) {
String tmp = el.getAttribute(ATTR_OBJECT_IDS);
fIds = new HashSet<String>(Arrays.asList(CDataUtil.stringToArray(tmp, DELIMITER)));
-
+
int type = 0;
tmp = el.getAttribute(ATTR_PATTERN_TYPE_SEARCH_SCOPE);
- if(tmp == null) {
+ if (tmp == null) {
type = defaultSearchType;
} else {
- if(EXTENSION_OBJECT.equals(tmp)){
+ if (EXTENSION_OBJECT.equals(tmp)) {
type = TYPE_SEARCH_EXTENSION_OBJECT;
- } else if (ALL_EXTENSION_SUPERCLASSES.equals(tmp)){
+ } else if (ALL_EXTENSION_SUPERCLASSES.equals(tmp)) {
type = TYPE_SEARCH_ALL_EXTENSION_SUPERCLASSES;
} else {
throw new IllegalArgumentException();
@@ -138,12 +142,12 @@ public class MatchObjectElement {
}
tmp = el.getAttribute(ATTR_PATTERN_TYPE_ID_TYPE);
- if(tmp == null) {
+ if (tmp == null) {
type |= defaultIdType;
} else {
- if(EXACT_MATCH.equals(tmp)){
+ if (EXACT_MATCH.equals(tmp)) {
type |= TYPE_ID_EXACT_MATCH;
- } else if (REGEGP.equals(tmp)){
+ } else if (REGEGP.equals(tmp)) {
type |= TYPE_ID_REGEXP;
} else {
throw new IllegalArgumentException();
@@ -153,132 +157,132 @@ public class MatchObjectElement {
fType = type;
}
- private PatternElement(HashSet<String> ids, int type){
+ private PatternElement(HashSet<String> ids, int type) {
fIds = ids;
fType = type;
}
- public String[] getIds(){
+ public String[] getIds() {
return fIds.toArray(new String[fIds.size()]);
}
@Override
public boolean equals(Object obj) {
- if(obj == this)
+ if (obj == this)
return true;
-
- if(!(obj instanceof PatternElement))
+
+ if (!(obj instanceof PatternElement))
return false;
-
- PatternElement other = (PatternElement)obj;
- if(other.fIds.size() != fIds.size())
+
+ PatternElement other = (PatternElement) obj;
+ if (other.fIds.size() != fIds.size())
return false;
-
+
return other.fIds.containsAll(fIds);
}
@Override
public int hashCode() {
- if(fHashPE == 0){
+ if (fHashPE == 0) {
fHashPE = fIds.hashCode();
}
return fHashPE;
}
-
+
public PatternElement merge(PatternElement el) throws IllegalArgumentException {
- if(el.fType != fType)
+ if (el.fType != fType)
throw new IllegalArgumentException();
-
+
HashSet<String> set = new HashSet<String>();
set.addAll(fIds);
set.addAll(el.fIds);
return new PatternElement(set, fType);
}
-
- public int getSearchType(){
+
+ public int getSearchType() {
return fType & SEARCH_TYPE_MASK;
}
-
- public int getIdType(){
+
+ public int getIdType() {
return fType & ID_TYPE_MASK;
}
- public int getCompleteOredTypeValue(){
+ public int getCompleteOredTypeValue() {
return fType;
}
}
public MatchObjectElement(IConfigurationElement element) throws IllegalArgumentException {
TypeToStringAssociation assoc = TypeToStringAssociation.getAssociation(element.getAttribute(ATTR_OBJECT_TYPE));
- if(assoc == null)
+ if (assoc == null)
throw new IllegalArgumentException();
-
+
fObjectType = assoc.getType();
-
+
Map<PatternTypeKey, PatternElement> patternMap = new HashMap<PatternTypeKey, PatternElement>();
int defaultSearchType = PatternElement.DEFAULT_PATTERN_SEARCH_TYPE;
int defaultIdType = PatternElement.DEFAULT_PATTERN_ID_TYPE;
-
- if(element.getAttribute(ATTR_OBJECT_IDS) != null){
+
+ if (element.getAttribute(ATTR_OBJECT_IDS) != null) {
PatternElement el = new PatternElement(element, defaultSearchType, defaultIdType);
patternMap.put(new PatternTypeKey(el), el);
defaultSearchType = el.getSearchType();
defaultIdType = el.getIdType();
}
-
+
IConfigurationElement patternsChildren[] = element.getChildren(ELEMENT_PATTERN);
- if(patternsChildren.length != 0){
- for(int i = 0; i < patternsChildren.length; i++){
+ if (patternsChildren.length != 0) {
+ for (int i = 0; i < patternsChildren.length; i++) {
PatternElement el = new PatternElement(patternsChildren[i], defaultSearchType, defaultIdType);
PatternTypeKey key = new PatternTypeKey(el);
PatternElement cur = patternMap.get(key);
- if(cur != null){
+ if (cur != null) {
patternMap.put(key, cur.merge(el));
} else {
patternMap.put(key, el);
}
}
- }
-
- if(patternMap.size() == 0) {
+ }
+
+ if (patternMap.size() == 0) {
throw new IllegalArgumentException();
}
-
+
fPatterns = patternMap.values().toArray(new PatternElement[patternMap.size()]);
}
-
- public int getObjectType(){
+
+ public int getObjectType() {
return fObjectType;
}
@Override
public boolean equals(Object obj) {
- if(obj == this)
+ if (obj == this)
return true;
-
- if(!(obj instanceof MatchObjectElement))
+
+ if (!(obj instanceof MatchObjectElement))
return false;
-
- MatchObjectElement other = (MatchObjectElement)obj;
- if(fObjectType != other.fObjectType)
+
+ MatchObjectElement other = (MatchObjectElement) obj;
+ if (fObjectType != other.fObjectType)
return false;
-
+
return Arrays.equals(other.fPatterns, fPatterns);
}
@Override
public int hashCode() {
- if(fHash == 0){
+ if (fHash == 0) {
int hash = fObjectType;
- for(int i = 0; i < fPatterns.length; i++){
+ for (int i = 0; i < fPatterns.length; i++) {
hash += fPatterns[i].hashCode();
}
fHash = hash;
}
return fHash;
}
-
- public PatternElement[] getPatterns(){
+
+ public PatternElement[] getPatterns() {
return fPatterns.clone();
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/MatchObjectList.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/MatchObjectList.java
index 83cfee912c6..fb6aa9c5c9b 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/MatchObjectList.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/MatchObjectList.java
@@ -17,17 +17,17 @@ import org.eclipse.core.runtime.IConfigurationElement;
public class MatchObjectList {
private MatchObjectElement[] fObjects;
-
+
public MatchObjectList(IConfigurationElement element) throws IllegalArgumentException {
IConfigurationElement[] objectEls = element.getChildren(MatchObjectElement.ELEMENT_NAME);
MatchObjectElement[] objects = new MatchObjectElement[objectEls.length];
- for(int i = 0; i < objectEls.length; i++){
+ for (int i = 0; i < objectEls.length; i++) {
objects[i] = new MatchObjectElement(objectEls[i]);
}
fObjects = objects;
}
- public MatchObjectElement[] getMatchObjects(){
+ public MatchObjectElement[] getMatchObjects() {
return fObjects.clone();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/ObjectSetListBasedDefinition.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/ObjectSetListBasedDefinition.java
index 1f1db18181b..4f18d631c4e 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/ObjectSetListBasedDefinition.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/ObjectSetListBasedDefinition.java
@@ -18,15 +18,15 @@ import org.eclipse.cdt.managedbuilder.internal.tcmodification.ObjectSetList;
public abstract class ObjectSetListBasedDefinition {
public static final int CONFLICT = 1;
private ObjectSetList fList;
-
- protected ObjectSetListBasedDefinition(ObjectSetList list){
+
+ protected ObjectSetListBasedDefinition(ObjectSetList list) {
fList = list;
}
- public ObjectSetList getObjectSetList(){
+ public ObjectSetList getObjectSetList() {
return fList;
}
-
+
public abstract int getType();
-
+
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/RulesManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/RulesManager.java
index eaabb64aa4e..2bf1b5c92d8 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/RulesManager.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/extension/RulesManager.java
@@ -39,17 +39,17 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
-
public class RulesManager {
private static RulesManager fInstance;
- private static final String EXTENSION_POINT_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".tcModificationInfo"; //$NON-NLS-1$
-
+ private static final String EXTENSION_POINT_ID = ManagedBuilderCorePlugin.getUniqueIdentifier()
+ + ".tcModificationInfo"; //$NON-NLS-1$
+
private ConflictDefinition[] fConflictDefinitions;
-
+
private Map<MatchObjectElement, IObjectSet> fMatchObjectMap = new HashMap<MatchObjectElement, IObjectSet>();
private PerTypeMapStorage<IRealBuildObjectAssociation, Set<IRealBuildObjectAssociation>> fObjToChildSuperClassMap;
private StarterJob fStarter;
- private boolean fIsStartInited;
+ private boolean fIsStartInited;
private class StarterJob extends Job {
@@ -67,42 +67,42 @@ public class RulesManager {
}
return Status.OK_STATUS;
}
-
+
}
- private RulesManager(){
+ private RulesManager() {
}
-
- public static RulesManager getInstance(){
- if(fInstance == null)
+
+ public static RulesManager getInstance() {
+ if (fInstance == null)
fInstance = getInstanceSynch();
return fInstance;
}
- public synchronized static RulesManager getInstanceSynch(){
- if(fInstance == null)
+ public synchronized static RulesManager getInstanceSynch() {
+ if (fInstance == null)
fInstance = new RulesManager();
return fInstance;
}
-
- public void start(){
- if(fIsStartInited)
+
+ public void start() {
+ if (fIsStartInited)
return;
synchronized (this) {
- if(fIsStartInited)
+ if (fIsStartInited)
return;
-
+
fIsStartInited = true;
}
-
+
fStarter = new StarterJob();
fStarter.schedule();
}
-
- private void loadExtensions(){
+
+ private void loadExtensions() {
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT_ID);
- if(extensionPoint == null){
+ if (extensionPoint == null) {
fConflictDefinitions = new ConflictDefinition[0];
} else {
IExtension[] extensions = extensionPoint.getExtensions();
@@ -110,51 +110,51 @@ public class RulesManager {
for (int i = 0; i < extensions.length; ++i) {
IExtension extension = extensions[i];
IConfigurationElement[] elements = extension.getConfigurationElements();
- for(int k = 0; k < elements.length; k++){
+ for (int k = 0; k < elements.length; k++) {
IConfigurationElement el = elements[k];
String elName = el.getName();
- if(ConflictDefinitionElement.ELEMENT_NAME.equals(elName)){
+ if (ConflictDefinitionElement.ELEMENT_NAME.equals(elName)) {
try {
ConflictDefinitionElement cde = new ConflictDefinitionElement(el);
ConflictDefinition cd = resolve(cde);
- if(cd != null)
+ if (cd != null)
conflictDefs.add(cd);
- } catch (IllegalArgumentException e){
+ } catch (IllegalArgumentException e) {
ManagedBuilderCorePlugin.log(e);
}
}
}
}
-
+
fConflictDefinitions = conflictDefs.toArray(new ConflictDefinition[conflictDefs.size()]);
}
}
-
+
private ConflictDefinition resolve(ConflictDefinitionElement el) throws IllegalArgumentException {
MatchObjectElement mos[] = el.getMatchObjects();
- if(mos.length != 2)
+ if (mos.length != 2)
throw new IllegalArgumentException();
-
+
IObjectSet oss[] = new IObjectSet[mos.length];
-
- for(int i = 0; i < mos.length; i++){
+
+ for (int i = 0; i < mos.length; i++) {
oss[i] = resolve(mos[i]);
- if(oss[i].getNumObjects() == 0){
+ if (oss[i].getNumObjects() == 0) {
//no conflicts
return null;
}
}
-
+
return new ConflictDefinition(new ObjectSetList(oss));
}
-
- private IObjectSet resolve(MatchObjectElement el){
+
+ private IObjectSet resolve(MatchObjectElement el) {
IObjectSet oSet = fMatchObjectMap.get(el);
- if(oSet == null){
+ if (oSet == null) {
int type = el.getObjectType();
PatternElement[] patterns = el.getPatterns();
- HashSet<IRealBuildObjectAssociation> objectsSet = new HashSet<IRealBuildObjectAssociation>();
- for(int i = 0; i < patterns.length; i++){
+ HashSet<IRealBuildObjectAssociation> objectsSet = new HashSet<IRealBuildObjectAssociation>();
+ for (int i = 0; i < patterns.length; i++) {
PatternElement pattern = patterns[i];
processPattern(type, pattern, objectsSet);
}
@@ -163,108 +163,113 @@ public class RulesManager {
}
return oSet;
}
-
- private IRealBuildObjectAssociation[] getObjectsForId(int objType, String id, int idType){
- if(idType == PatternElement.TYPE_ID_EXACT_MATCH){
+
+ private IRealBuildObjectAssociation[] getObjectsForId(int objType, String id, int idType) {
+ if (idType == PatternElement.TYPE_ID_EXACT_MATCH) {
IRealBuildObjectAssociation obj = TcModificationUtil.getObjectById(objType, id);
- if(obj != null)
- return new IRealBuildObjectAssociation[]{obj};
+ if (obj != null)
+ return new IRealBuildObjectAssociation[] { obj };
return new IRealBuildObjectAssociation[0];
}
-
+
IRealBuildObjectAssociation[] allObjs = TcModificationUtil.getExtensionObjects(objType);
Pattern pattern = Pattern.compile(id);
List<IRealBuildObjectAssociation> list = new ArrayList<IRealBuildObjectAssociation>();
-
- for(int i = 0; i < allObjs.length; i++){
- if(pattern.matcher(allObjs[i].getId()).matches())
+
+ for (int i = 0; i < allObjs.length; i++) {
+ if (pattern.matcher(allObjs[i].getId()).matches())
list.add(allObjs[i]);
}
-
+
return list.toArray(new IRealBuildObjectAssociation[list.size()]);
}
-
- private Set<IRealBuildObjectAssociation> processPattern(int objType, PatternElement el, Set<IRealBuildObjectAssociation> set){
- if(set == null)
+
+ private Set<IRealBuildObjectAssociation> processPattern(int objType, PatternElement el,
+ Set<IRealBuildObjectAssociation> set) {
+ if (set == null)
set = new HashSet<IRealBuildObjectAssociation>();
-
+
String ids[] = el.getIds();
- if(el.getSearchType() == PatternElement.TYPE_SEARCH_EXTENSION_OBJECT){
- for(int i = 0; i < ids.length; i++){
+ if (el.getSearchType() == PatternElement.TYPE_SEARCH_EXTENSION_OBJECT) {
+ for (int i = 0; i < ids.length; i++) {
IRealBuildObjectAssociation objs[] = getObjectsForId(objType, ids[i], el.getIdType());
- for(int k = 0; k < objs.length; k++){
+ for (int k = 0; k < objs.length; k++) {
set.add(objs[k].getRealBuildObject());
}
}
- } else if (el.getSearchType() == PatternElement.TYPE_SEARCH_ALL_EXTENSION_SUPERCLASSES){
+ } else if (el.getSearchType() == PatternElement.TYPE_SEARCH_ALL_EXTENSION_SUPERCLASSES) {
IRealBuildObjectAssociation[] allReal = TcModificationUtil.getRealObjects(objType);
- for(int i = 0; i < ids.length; i++){
- IRealBuildObjectAssociation []objs = getObjectsForId(objType, ids[i], el.getIdType());
- for(int k = 0; k < objs.length; k++){
+ for (int i = 0; i < ids.length; i++) {
+ IRealBuildObjectAssociation[] objs = getObjectsForId(objType, ids[i], el.getIdType());
+ for (int k = 0; k < objs.length; k++) {
IRealBuildObjectAssociation obj = objs[k];
-
+
set.add(obj.getRealBuildObject());
Set<IRealBuildObjectAssociation> childRealSet = getChildSuperClassRealSet(obj, allReal);
-
+
set.addAll(childRealSet);
-// for(int k = 0; k < allReal.length; k++){
-// IRealBuildObjectAssociation otherReal = allReal[k];
-// if(otherReal == obj || set.contains(otherReal))
-// continue;
-//
-// if("tcm.derive.tc1".equals(otherReal.getId())){
-// int f = 0; f++;
-// }
-// IRealBuildObjectAssociation[] identics = otherReal.getIdenticBuildObjects();
-// for(int j = 0; j < identics.length; j++){
-// IRealBuildObjectAssociation identic = identics[j];
-// for(identic = identic.getSuperClassObject(); identic != null; identic = identic.getSuperClassObject()){
-// if(identic == obj){
-// set.add(identic.getRealBuildObject());
-// }
-// }
-// }
-// }
+ // for(int k = 0; k < allReal.length; k++){
+ // IRealBuildObjectAssociation otherReal = allReal[k];
+ // if(otherReal == obj || set.contains(otherReal))
+ // continue;
+ //
+ // if("tcm.derive.tc1".equals(otherReal.getId())){
+ // int f = 0; f++;
+ // }
+ // IRealBuildObjectAssociation[] identics = otherReal.getIdenticBuildObjects();
+ // for(int j = 0; j < identics.length; j++){
+ // IRealBuildObjectAssociation identic = identics[j];
+ // for(identic = identic.getSuperClassObject(); identic != null; identic = identic.getSuperClassObject()){
+ // if(identic == obj){
+ // set.add(identic.getRealBuildObject());
+ // }
+ // }
+ // }
+ // }
}
}
}
-
+
return set;
}
-
- private Set<IRealBuildObjectAssociation> getChildSuperClassRealSet(IRealBuildObjectAssociation obj, IRealBuildObjectAssociation[] all){
- if(fObjToChildSuperClassMap == null)
+
+ private Set<IRealBuildObjectAssociation> getChildSuperClassRealSet(IRealBuildObjectAssociation obj,
+ IRealBuildObjectAssociation[] all) {
+ if (fObjToChildSuperClassMap == null)
fObjToChildSuperClassMap = new PerTypeMapStorage<IRealBuildObjectAssociation, Set<IRealBuildObjectAssociation>>();
- if(all == null)
+ if (all == null)
all = TcModificationUtil.getExtensionObjects(obj.getType());
- Map<IRealBuildObjectAssociation, Set<IRealBuildObjectAssociation>> map = fObjToChildSuperClassMap.getMap(obj.getType(), true);
+ Map<IRealBuildObjectAssociation, Set<IRealBuildObjectAssociation>> map = fObjToChildSuperClassMap
+ .getMap(obj.getType(), true);
Set<IRealBuildObjectAssociation> set = map.get(obj);
- if(set == null){
+ if (set == null) {
set = createChildSuperClassRealSet(obj, all, null);
map.put(obj, set);
}
-
+
return set;
}
-
- private static Set<IRealBuildObjectAssociation> createChildSuperClassRealSet(IRealBuildObjectAssociation obj, IRealBuildObjectAssociation[] all, Set<IRealBuildObjectAssociation> set){
- if(set == null)
+
+ private static Set<IRealBuildObjectAssociation> createChildSuperClassRealSet(IRealBuildObjectAssociation obj,
+ IRealBuildObjectAssociation[] all, Set<IRealBuildObjectAssociation> set) {
+ if (set == null)
set = new HashSet<IRealBuildObjectAssociation>();
-
- if(all == null)
+
+ if (all == null)
all = TcModificationUtil.getExtensionObjects(obj.getType());
-
- for(int i = 0; i < all.length; i++){
+
+ for (int i = 0; i < all.length; i++) {
IRealBuildObjectAssociation cur = all[i];
- for(IRealBuildObjectAssociation el = cur.getSuperClassObject(); el != null; el = el.getSuperClassObject()){
- if(el == obj){
+ for (IRealBuildObjectAssociation el = cur.getSuperClassObject(); el != null; el = el
+ .getSuperClassObject()) {
+ if (el == obj) {
IRealBuildObjectAssociation realQuickTest = null;
- for(IRealBuildObjectAssociation found = cur; found != obj; found = found.getSuperClassObject()){
+ for (IRealBuildObjectAssociation found = cur; found != obj; found = found.getSuperClassObject()) {
IRealBuildObjectAssociation real = found.getRealBuildObject();
- if(real != realQuickTest){
+ if (real != realQuickTest) {
set.add(real);
realQuickTest = real;
}
@@ -272,22 +277,22 @@ public class RulesManager {
}
}
}
-
+
return set;
}
-
- public ObjectSetListBasedDefinition[] getRules(int ruleType){
+
+ public ObjectSetListBasedDefinition[] getRules(int ruleType) {
checkInitialization();
return fConflictDefinitions.clone();
}
-
- private void checkInitialization(){
- if(!fIsStartInited)
+
+ private void checkInitialization() {
+ if (!fIsStartInited)
throw new IllegalStateException();
-
- StarterJob starter = fStarter;
-
- if(starter != null){
+
+ StarterJob starter = fStarter;
+
+ if (starter != null) {
try {
starter.join();
} catch (InterruptedException e) {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuildCommandParser.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuildCommandParser.java
index a07f6cc1737..3cc3334ad42 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuildCommandParser.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuildCommandParser.java
@@ -50,7 +50,6 @@ public abstract class AbstractBuildCommandParser extends AbstractLanguageSetting
private static final String VALUE_FOLDER_SCOPE = "per-folder"; //$NON-NLS-1$
private static final String VALUE_PROJECT_SCOPE = "per-project"; //$NON-NLS-1$
-
private static final String LEADING_PATH_PATTERN = "\\S+[/\\\\]"; //$NON-NLS-1$
/**
@@ -65,13 +64,12 @@ public abstract class AbstractBuildCommandParser extends AbstractLanguageSetting
/** "\"foo\"" */
private static final String QUOTE_BSLASH_QUOTE = "(\"\\\\\".*?\\\\\"\")"; //$NON-NLS-1$
- private static final Pattern OPTIONS_PATTERN = Pattern.compile("-[^\\s\"'\\\\]*(\\s*(" + QUOTE +"|" + QUOTE_BSLASH_QUOTE + "|" + BSLASH_QUOTE + "|" + SINGLE_QUOTE + "|([^-\\s][^\\s]+)))?"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$<
+ private static final Pattern OPTIONS_PATTERN = Pattern.compile("-[^\\s\"'\\\\]*(\\s*(" + QUOTE + "|" //$NON-NLS-1$//$NON-NLS-2$
+ + QUOTE_BSLASH_QUOTE + "|" + BSLASH_QUOTE + "|" + SINGLE_QUOTE + "|([^-\\s][^\\s]+)))?"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$<
private static final int OPTION_GROUP = 0;
public enum ResourceScope {
- FILE,
- FOLDER,
- PROJECT,
+ FILE, FOLDER, PROJECT,
}
/**
@@ -79,14 +77,14 @@ public abstract class AbstractBuildCommandParser extends AbstractLanguageSetting
*/
@SuppressWarnings("nls")
private static final String[] COMPILER_COMMAND_PATTERN_TEMPLATES = {
- "${COMPILER_PATTERN}.*\\s" + "()([^'\"\\s]*\\.${EXTENSIONS_PATTERN})(\\s.*)?[\r\n]*", // compiling unquoted file
- "${COMPILER_PATTERN}.*\\s" + "(['\"])(.*\\.${EXTENSIONS_PATTERN})\\${COMPILER_GROUPS+1}(\\s.*)?[\r\n]*" // compiling quoted file
+ "${COMPILER_PATTERN}.*\\s" + "()([^'\"\\s]*\\.${EXTENSIONS_PATTERN})(\\s.*)?[\r\n]*", // compiling unquoted file
+ "${COMPILER_PATTERN}.*\\s" + "(['\"])(.*\\.${EXTENSIONS_PATTERN})\\${COMPILER_GROUPS+1}(\\s.*)?[\r\n]*" // compiling quoted file
};
private static final int FILE_GROUP = 2;
// cached value from properties, do not need to use in equals() and hashCode()
private ResourceScope resourceScope = null;
-
+
// Used to handle line continuations in the build output.
private String partialLine;
@@ -117,7 +115,7 @@ public abstract class AbstractBuildCommandParser extends AbstractLanguageSetting
@SuppressWarnings("nls")
private String getCompilerPatternExtended() {
String compilerPattern = getCompilerPattern();
- return "\\s*\"?("+LEADING_PATH_PATTERN+")?(" + compilerPattern + ")\"?";
+ return "\\s*\"?(" + LEADING_PATH_PATTERN + ")?(" + compilerPattern + ")\"?";
}
/**
@@ -205,8 +203,7 @@ public abstract class AbstractBuildCommandParser extends AbstractLanguageSetting
*/
private String makePattern(String template) {
@SuppressWarnings("nls")
- String pattern = template
- .replace("${COMPILER_PATTERN}", getCompilerPatternExtended())
+ String pattern = template.replace("${COMPILER_PATTERN}", getCompilerPatternExtended())
.replace("${EXTENSIONS_PATTERN}", getPatternFileExtensions())
.replace("${COMPILER_GROUPS+1}", Integer.toString(countGroups(getCompilerPatternExtended()) + 1));
return pattern;
@@ -240,7 +237,7 @@ public abstract class AbstractBuildCommandParser extends AbstractLanguageSetting
Matcher optionMatcher = OPTIONS_PATTERN.matcher(line);
while (optionMatcher.find()) {
String option = optionMatcher.group(OPTION_GROUP);
- if (option!=null) {
+ if (option != null) {
options.add(option);
}
}
@@ -266,29 +263,29 @@ public abstract class AbstractBuildCommandParser extends AbstractLanguageSetting
processLine(partialLine);
partialLine = null;
}
-
+
serializeLanguageSettingsInBackground();
super.shutdown();
}
-
+
@Override
public boolean processLine(String line) {
line = handleLineContinuation(line);
return super.processLine(line);
}
-
+
/**
* Handle line continuations ('\' at the end of a line, indicating that the next line is a
* continuation of this one).
*/
private String handleLineContinuation(String line) {
- if (line == null)
+ if (line == null)
return null;
- // If the character preceding the '\' is also '\', it's not a line continuation -
+ // If the character preceding the '\' is also '\', it's not a line continuation -
// the first '\' escapes the second.
- if (line.length() > 0 && line.charAt(line.length() - 1) == '\\' &&
- (line.length() == 1 || line.charAt(line.length() - 2) != '\\')) {
+ if (line.length() > 0 && line.charAt(line.length() - 1) == '\\'
+ && (line.length() == 1 || line.charAt(line.length() - 2) != '\\')) {
// Line ends in line continuation - save it for later.
String fragment = line.substring(0, line.length() - 1);
if (partialLine == null) {
@@ -296,7 +293,7 @@ public abstract class AbstractBuildCommandParser extends AbstractLanguageSetting
} else {
partialLine += fragment;
}
- return null; // line will not be processed now
+ return null; // line will not be processed now
} else if (partialLine != null) {
// Line doesn't end in continuation but previous lines did - use their contents.
line = partialLine + line;
@@ -310,7 +307,8 @@ public abstract class AbstractBuildCommandParser extends AbstractLanguageSetting
* of this parser. Intended for better troubleshooting experience.
* Implementers are supposed to add the error parser via extension point {@code org.eclipse.cdt.core.ErrorParser}.
*/
- protected static abstract class AbstractBuildCommandPatternHighlighter extends RegexErrorParser implements IErrorParser2 {
+ protected static abstract class AbstractBuildCommandPatternHighlighter extends RegexErrorParser
+ implements IErrorParser2 {
/**
* Constructor.
* @param parserId - build command parser ID specified in the extension {@code org.eclipse.cdt.core.LanguageSettingsProvider}.
@@ -324,13 +322,15 @@ public abstract class AbstractBuildCommandParser extends AbstractLanguageSetting
* @param parserId - language settings provider (the build command parser) ID.
*/
protected void init(String parserId) {
- AbstractBuildCommandParser buildCommandParser = (AbstractBuildCommandParser) LanguageSettingsManager.getExtensionProviderCopy(parserId, false);
+ AbstractBuildCommandParser buildCommandParser = (AbstractBuildCommandParser) LanguageSettingsManager
+ .getExtensionProviderCopy(parserId, false);
if (buildCommandParser != null) {
for (String template : COMPILER_COMMAND_PATTERN_TEMPLATES) {
String pattern = buildCommandParser.makePattern(template);
- String fileExpr = "$"+buildCommandParser.adjustFileGroup(); //$NON-NLS-1$
+ String fileExpr = "$" + buildCommandParser.adjustFileGroup(); //$NON-NLS-1$
String descExpr = "$0"; //$NON-NLS-1$
- addPattern(new RegexErrorPattern(pattern, fileExpr, null, descExpr, null, IMarkerGenerator.SEVERITY_WARNING, true));
+ addPattern(new RegexErrorPattern(pattern, fileExpr, null, descExpr, null,
+ IMarkerGenerator.SEVERITY_WARNING, true));
}
}
}
@@ -341,5 +341,4 @@ public abstract class AbstractBuildCommandParser extends AbstractLanguageSetting
}
}
-
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java
index fe52216a7cb..c935edca7f3 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java
@@ -162,12 +162,14 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
final String providerName = getName();
final String providerId = getId();
// Add markers in a job to avoid deadlocks
- Job markerJob = new Job(ManagedMakeMessages.getResourceString("AbstractBuiltinSpecsDetector.AddScannerDiscoveryMarkers")) { //$NON-NLS-1$
+ Job markerJob = new Job(
+ ManagedMakeMessages.getResourceString("AbstractBuiltinSpecsDetector.AddScannerDiscoveryMarkers")) { //$NON-NLS-1$
@Override
protected IStatus run(IProgressMonitor monitor) {
// Avoid duplicates as different languages can generate identical errors
try {
- IMarker[] markers = problemMarkerInfo.file.findMarkers(SDMarkerGenerator.SCANNER_DISCOVERY_PROBLEM_MARKER, false, IResource.DEPTH_ZERO);
+ IMarker[] markers = problemMarkerInfo.file.findMarkers(
+ SDMarkerGenerator.SCANNER_DISCOVERY_PROBLEM_MARKER, false, IResource.DEPTH_ZERO);
for (IMarker marker : markers) {
int sev = ((Integer) marker.getAttribute(IMarker.SEVERITY)).intValue();
if (sev == problemMarkerInfo.severity) {
@@ -178,24 +180,31 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
}
}
} catch (CoreException e) {
- return new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "Error checking markers.", e); //$NON-NLS-1$
+ return new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "Error checking markers.", //$NON-NLS-1$
+ e);
}
try {
- IMarker marker = problemMarkerInfo.file.createMarker(SDMarkerGenerator.SCANNER_DISCOVERY_PROBLEM_MARKER);
+ IMarker marker = problemMarkerInfo.file
+ .createMarker(SDMarkerGenerator.SCANNER_DISCOVERY_PROBLEM_MARKER);
marker.setAttribute(IMarker.MESSAGE, problemMarkerInfo.description);
marker.setAttribute(IMarker.SEVERITY, problemMarkerInfo.severity);
marker.setAttribute(SDMarkerGenerator.ATTR_PROVIDER, providerId);
if (problemMarkerInfo.file instanceof IWorkspaceRoot) {
- String msgPreferences = ManagedMakeMessages.getFormattedString("AbstractBuiltinSpecsDetector.ScannerDiscoveryMarkerLocationPreferences", providerName); //$NON-NLS-1$
+ String msgPreferences = ManagedMakeMessages.getFormattedString(
+ "AbstractBuiltinSpecsDetector.ScannerDiscoveryMarkerLocationPreferences", //$NON-NLS-1$
+ providerName);
marker.setAttribute(IMarker.LOCATION, msgPreferences);
} else {
- String msgProperties = ManagedMakeMessages.getFormattedString("AbstractBuiltinSpecsDetector.ScannerDiscoveryMarkerLocationProperties", providerName); //$NON-NLS-1$
+ String msgProperties = ManagedMakeMessages.getFormattedString(
+ "AbstractBuiltinSpecsDetector.ScannerDiscoveryMarkerLocationProperties", //$NON-NLS-1$
+ providerName);
marker.setAttribute(IMarker.LOCATION, msgProperties);
}
} catch (CoreException e) {
- return new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "Error adding markers.", e); //$NON-NLS-1$
+ return new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "Error adding markers.", //$NON-NLS-1$
+ e);
}
return Status.OK_STATUS;
@@ -224,7 +233,8 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
}
}
} catch (CoreException e) {
- ManagedBuilderCorePlugin.log(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "Error deleting markers.", e)); //$NON-NLS-1$
+ ManagedBuilderCorePlugin.log(
+ new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "Error deleting markers.", e)); //$NON-NLS-1$
}
}
@@ -235,13 +245,16 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
*/
private class ConsoleParserAdapter implements ICBuildOutputParser {
@Override
- public void startup(ICConfigurationDescription cfgDescription, IWorkingDirectoryTracker cwdTracker) throws CoreException {
+ public void startup(ICConfigurationDescription cfgDescription, IWorkingDirectoryTracker cwdTracker)
+ throws CoreException {
AbstractBuiltinSpecsDetector.this.cwdTracker = cwdTracker;
}
+
@Override
public boolean processLine(String line) {
return AbstractBuiltinSpecsDetector.this.processLine(line);
}
+
@Override
public void shutdown() {
AbstractBuiltinSpecsDetector.this.cwdTracker = null;
@@ -394,7 +407,8 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
}
@Override
- public void startup(ICConfigurationDescription cfgDescription, IWorkingDirectoryTracker cwdTracker) throws CoreException {
+ public void startup(ICConfigurationDescription cfgDescription, IWorkingDirectoryTracker cwdTracker)
+ throws CoreException {
super.startup(cfgDescription, cwdTracker);
mappedRootURI = null;
@@ -420,14 +434,14 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
List<String> languageIds = getLanguageScope();
if (languageIds == null) {
languageIds = new ArrayList<String>(1);
- // "null" language indicates that the provider provides for any language
+ // "null" language indicates that the provider provides for any language
languageIds.add(null);
}
for (String languageId : languageIds) {
try {
String command = resolveCommand(languageId);
if (command != null) {
- envHashNew = 31*envHashNew + command.hashCode();
+ envHashNew = 31 * envHashNew + command.hashCode();
}
String[] cmdArray = CommandLineUtil.argumentsToArray(command);
@@ -445,8 +459,8 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
ManagedBuilderCorePlugin.log(e);
}
long lastModified = file.lastModified();
- envHashNew = 31*envHashNew + location.hashCode();
- envHashNew = 31*envHashNew + lastModified;
+ envHashNew = 31 * envHashNew + location.hashCode();
+ envHashNew = 31 * envHashNew + lastModified;
}
}
} catch (CoreException e) {
@@ -488,7 +502,8 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
return;
}
- WorkspaceJob job = new WorkspaceJob(ManagedMakeMessages.getResourceString("AbstractBuiltinSpecsDetector.DiscoverBuiltInSettingsJobName")) { //$NON-NLS-1$
+ WorkspaceJob job = new WorkspaceJob(
+ ManagedMakeMessages.getResourceString("AbstractBuiltinSpecsDetector.DiscoverBuiltInSettingsJobName")) { //$NON-NLS-1$
@Override
public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
isExecuted = false;
@@ -502,7 +517,8 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
status = runForEachLanguage(monitor);
} catch (CoreException e) {
ManagedBuilderCorePlugin.log(e);
- status = new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, IStatus.ERROR, "Error running Builtin Specs Detector", e); //$NON-NLS-1$
+ status = new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, IStatus.ERROR,
+ "Error running Builtin Specs Detector", e); //$NON-NLS-1$
} finally {
isExecuted = true;
shutdown();
@@ -510,6 +526,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
return status;
}
+
@Override
public boolean belongsTo(Object family) {
return family == JOB_FAMILY_BUILTIN_SPECS_DETECTOR;
@@ -538,7 +555,8 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
* @return status of operation.
*/
protected IStatus runForEachLanguage(IProgressMonitor monitor) {
- MultiStatus status = new MultiStatus(ManagedBuilderCorePlugin.PLUGIN_ID, IStatus.OK, "Problem running CDT Scanner Discovery provider " + getId(), null); //$NON-NLS-1$
+ MultiStatus status = new MultiStatus(ManagedBuilderCorePlugin.PLUGIN_ID, IStatus.OK,
+ "Problem running CDT Scanner Discovery provider " + getId(), null); //$NON-NLS-1$
if (monitor == null) {
monitor = new NullProgressMonitor();
@@ -548,14 +566,17 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
boolean isChanged = false;
List<String> languageIds = getLanguageScope();
-
+
if (languageIds != null) {
- monitor.beginTask(ManagedMakeMessages.getResourceString("AbstractBuiltinSpecsDetector.ScannerDiscoveryTaskTitle"), //$NON-NLS-1$
- TICKS_REMOVE_MARKERS + languageIds.size()*TICKS_RUN_FOR_ONE_LANGUAGE + TICKS_SERIALIZATION);
+ monitor.beginTask(
+ ManagedMakeMessages.getResourceString("AbstractBuiltinSpecsDetector.ScannerDiscoveryTaskTitle"), //$NON-NLS-1$
+ TICKS_REMOVE_MARKERS + languageIds.size() * TICKS_RUN_FOR_ONE_LANGUAGE + TICKS_SERIALIZATION);
- IResource markersResource = currentProject != null ? currentProject : ResourcesPlugin.getWorkspace().getRoot();
+ IResource markersResource = currentProject != null ? currentProject
+ : ResourcesPlugin.getWorkspace().getRoot();
- monitor.subTask(ManagedMakeMessages.getFormattedString("AbstractBuiltinSpecsDetector.ClearingMarkers", markersResource.getFullPath().toString())); //$NON-NLS-1$
+ monitor.subTask(ManagedMakeMessages.getFormattedString("AbstractBuiltinSpecsDetector.ClearingMarkers", //$NON-NLS-1$
+ markersResource.getFullPath().toString()));
markerGenerator.deleteMarkers(markersResource);
if (monitor.isCanceled())
throw new OperationCanceledException();
@@ -563,19 +584,22 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
monitor.worked(TICKS_REMOVE_MARKERS);
for (String languageId : languageIds) {
- List<ICLanguageSettingEntry> oldEntries = getSettingEntries(currentCfgDescription, null, languageId);
+ List<ICLanguageSettingEntry> oldEntries = getSettingEntries(currentCfgDescription, null,
+ languageId);
try {
startupForLanguage(languageId);
runForLanguage(new SubProgressMonitor(monitor, TICKS_RUN_FOR_ONE_LANGUAGE));
} catch (Exception e) {
- IStatus s = new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, IStatus.ERROR, "Error running Builtin Specs Detector", e); //$NON-NLS-1$
+ IStatus s = new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, IStatus.ERROR,
+ "Error running Builtin Specs Detector", e); //$NON-NLS-1$
ManagedBuilderCorePlugin.log(s);
status.merge(s);
} finally {
shutdownForLanguage();
}
if (!isChanged) {
- List<ICLanguageSettingEntry> newEntries = getSettingEntries(currentCfgDescription, null, languageId);
+ List<ICLanguageSettingEntry> newEntries = getSettingEntries(currentCfgDescription, null,
+ languageId);
isChanged = newEntries != oldEntries;
}
@@ -594,7 +618,8 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
} catch (OperationCanceledException e) {
// user chose to cancel operation, do not threaten them with red error signs
} catch (Exception e) {
- status.merge(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, IStatus.ERROR, "Error running Builtin Specs Detector", e)); //$NON-NLS-1$
+ status.merge(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, IStatus.ERROR,
+ "Error running Builtin Specs Detector", e)); //$NON-NLS-1$
ManagedBuilderCorePlugin.log(status);
} finally {
monitor.done();
@@ -630,7 +655,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
detectedSettingEntries = null;
currentCommandResolved = null;
- if (specFile!=null && !preserveSpecFile) {
+ if (specFile != null && !preserveSpecFile) {
specFile.delete();
specFile = null;
}
@@ -651,7 +676,9 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
monitor = new NullProgressMonitor();
}
try {
- monitor.beginTask(ManagedMakeMessages.getFormattedString("AbstractBuiltinSpecsDetector.RunningScannerDiscovery", getName()), //$NON-NLS-1$
+ monitor.beginTask(
+ ManagedMakeMessages.getFormattedString("AbstractBuiltinSpecsDetector.RunningScannerDiscovery", //$NON-NLS-1$
+ getName()),
TICKS_EXECUTE_COMMAND + TICKS_OUTPUT_PARSING);
IConsole console;
@@ -672,7 +699,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
if (cmdArray != null && cmdArray.length > 0) {
program = new Path(cmdArray[0]);
if (cmdArray.length > 1) {
- args = new String[cmdArray.length-1];
+ args = new String[cmdArray.length - 1];
System.arraycopy(cmdArray, 1, args, 0, args.length);
}
}
@@ -680,27 +707,32 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
String[] envp = toEnvp(environmentMap);
// Using GMAKE_ERROR_PARSER_ID as it can handle generated error messages
- ErrorParserManager epm = new ErrorParserManager(currentProject, buildDirURI, markerGenerator, new String[] {GMAKE_ERROR_PARSER_ID});
+ ErrorParserManager epm = new ErrorParserManager(currentProject, buildDirURI, markerGenerator,
+ new String[] { GMAKE_ERROR_PARSER_ID });
ConsoleParserAdapter consoleParser = new ConsoleParserAdapter();
consoleParser.startup(currentCfgDescription, epm);
List<IConsoleParser> parsers = new ArrayList<IConsoleParser>();
parsers.add(consoleParser);
buildRunnerHelper.setLaunchParameters(launcher, program, args, buildDirURI, envp);
- buildRunnerHelper.prepareStreams(epm, parsers, console, new SubProgressMonitor(monitor, TICKS_OUTPUT_PARSING));
+ buildRunnerHelper.prepareStreams(epm, parsers, console,
+ new SubProgressMonitor(monitor, TICKS_OUTPUT_PARSING));
- buildRunnerHelper.greeting(ManagedMakeMessages.getFormattedString("AbstractBuiltinSpecsDetector.RunningScannerDiscovery", getName())); //$NON-NLS-1$
+ buildRunnerHelper.greeting(ManagedMakeMessages
+ .getFormattedString("AbstractBuiltinSpecsDetector.RunningScannerDiscovery", getName())); //$NON-NLS-1$
OutputStream outStream = buildRunnerHelper.getOutputStream();
OutputStream errStream = buildRunnerHelper.getErrorStream();
runProgramForLanguage(currentLanguageId, currentCommandResolved, envp, buildDirURI, outStream, errStream,
- new SubProgressMonitor(monitor, TICKS_EXECUTE_COMMAND, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
+ new SubProgressMonitor(monitor, TICKS_EXECUTE_COMMAND,
+ SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
buildRunnerHelper.close();
buildRunnerHelper.goodbye();
} catch (Exception e) {
- ManagedBuilderCorePlugin.log(new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "Error running Builtin Specs Detector" , e))); //$NON-NLS-1$
+ ManagedBuilderCorePlugin.log(new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID,
+ "Error running Builtin Specs Detector", e))); //$NON-NLS-1$
} finally {
try {
buildRunnerHelper.close();
@@ -722,7 +754,8 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
if (envMngr == null) {
envMngr = CCorePlugin.getDefault().getBuildEnvironmentManager();
}
- List<IEnvironmentVariable> vars = new ArrayList<IEnvironmentVariable>(Arrays.asList(envMngr.getVariables(currentCfgDescription, true)));
+ List<IEnvironmentVariable> vars = new ArrayList<IEnvironmentVariable>(
+ Arrays.asList(envMngr.getVariables(currentCfgDescription, true)));
// On POSIX (Linux, UNIX) systems reset language variables to default (English)
// with UTF-8 encoding since GNU compilers can handle only UTF-8 characters.
@@ -756,13 +789,15 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
*/
private String[] toEnvp(Map<String, String> environmentMap) {
Set<String> envp = new HashSet<String>();
- for (Entry<String, String> var: environmentMap.entrySet()) {
+ for (Entry<String, String> var : environmentMap.entrySet()) {
envp.add(var.getKey() + '=' + var.getValue());
}
return envp.toArray(new String[envp.size()]);
}
- protected int runProgramForLanguage(String languageId, String command, String[] envp, URI workingDirectoryURI, OutputStream consoleOut, OutputStream consoleErr, IProgressMonitor monitor) throws CoreException, IOException {
+ protected int runProgramForLanguage(String languageId, String command, String[] envp, URI workingDirectoryURI,
+ OutputStream consoleOut, OutputStream consoleErr, IProgressMonitor monitor)
+ throws CoreException, IOException {
return buildRunnerHelper.build(monitor);
}
@@ -800,7 +835,8 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
URL defaultIcon = Platform.getBundle(CDT_MANAGEDBUILDER_UI_PLUGIN_ID).getEntry(DEFAULT_CONSOLE_ICON);
if (defaultIcon == null) {
@SuppressWarnings("nls")
- String msg = "Unable to find icon " + DEFAULT_CONSOLE_ICON + " in plugin " + CDT_MANAGEDBUILDER_UI_PLUGIN_ID;
+ String msg = "Unable to find icon " + DEFAULT_CONSOLE_ICON + " in plugin "
+ + CDT_MANAGEDBUILDER_UI_PLUGIN_ID;
ManagedBuilderCorePlugin.log(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, msg));
}
@@ -871,7 +907,8 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
}
if (ext == null) {
- ManagedBuilderCorePlugin.log(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "Unable to find file extension for language " + languageId)); //$NON-NLS-1$
+ ManagedBuilderCorePlugin.log(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID,
+ "Unable to find file extension for language " + languageId)); //$NON-NLS-1$
}
return ext;
}
@@ -914,7 +951,8 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
try {
envPathHash = Long.parseLong(envPathHashStr);
} catch (Exception e) {
- ManagedBuilderCorePlugin.log(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, "Wrong integer format [" + envPathHashStr + "]", e)); //$NON-NLS-1$ //$NON-NLS-2$
+ ManagedBuilderCorePlugin.log(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID,
+ "Wrong integer format [" + envPathHashStr + "]", e)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractLanguageSettingsOutputScanner.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractLanguageSettingsOutputScanner.java
index 0223119b141..b7de3fc60ae 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractLanguageSettingsOutputScanner.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractLanguageSettingsOutputScanner.java
@@ -73,10 +73,12 @@ import org.w3c.dom.Element;
*
* @since 8.1
*/
-public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSettingsSerializableProvider implements ICBuildOutputParser {
+public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSettingsSerializableProvider
+ implements ICBuildOutputParser {
protected static final String ATTR_KEEP_RELATIVE_PATHS = "keep-relative-paths"; //$NON-NLS-1$
// evaluates to "/${ProjName)/"
- private static final String PROJ_NAME_PREFIX = '/' + CdtVariableResolver.createVariableReference(CdtVariableResolver.VAR_PROJ_NAME) + '/';
+ private static final String PROJ_NAME_PREFIX = '/'
+ + CdtVariableResolver.createVariableReference(CdtVariableResolver.VAR_PROJ_NAME) + '/';
protected ICConfigurationDescription currentCfgDescription = null;
protected IWorkingDirectoryTracker cwdTracker = null;
@@ -92,26 +94,32 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
private static final EFSExtensionProvider efsProviderDefault = new EFSExtensionProvider() {
final EFSExtensionManager efsManager = EFSExtensionManager.getDefault();
+
@Override
public String getPathFromURI(URI locationURI) {
return efsManager.getPathFromURI(locationURI);
}
+
@Override
public URI getLinkedURI(URI locationURI) {
return efsManager.getLinkedURI(locationURI);
}
+
@Override
public URI createNewURIFromPath(URI locationOnSameFilesystem, String path) {
return efsManager.createNewURIFromPath(locationOnSameFilesystem, path);
}
+
@Override
public String getMappedPath(URI locationURI) {
return efsManager.getMappedPath(locationURI);
}
+
@Override
public boolean isVirtual(URI locationURI) {
return efsManager.isVirtual(locationURI);
}
+
@Override
public URI append(URI baseURI, String extension) {
return efsManager.append(baseURI, extension);
@@ -145,7 +153,8 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
* @param valueExpression - capturing group expression defining value of an entry.
* @param extraFlag - extra-flag to add while creating language settings entry.
*/
- public AbstractOptionParser(int kind, String pattern, String nameExpression, String valueExpression, int extraFlag) {
+ public AbstractOptionParser(int kind, String pattern, String nameExpression, String valueExpression,
+ int extraFlag) {
this.kind = kind;
this.patternStr = pattern;
this.nameExpression = nameExpression;
@@ -224,6 +233,7 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
public IncludePathOptionParser(String pattern, String nameExpression) {
super(ICLanguageSettingEntry.INCLUDE_PATH, pattern, nameExpression, nameExpression, 0);
}
+
public IncludePathOptionParser(String pattern, String nameExpression, int extraFlag) {
super(ICLanguageSettingEntry.INCLUDE_PATH, pattern, nameExpression, nameExpression, extraFlag);
}
@@ -241,6 +251,7 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
public IncludeFileOptionParser(String pattern, String nameExpression) {
super(ICLanguageSettingEntry.INCLUDE_FILE, pattern, nameExpression, nameExpression, 0);
}
+
/**
* Constructor.
* @param pattern - regular expression pattern being parsed by the parser.
@@ -265,6 +276,7 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
public MacroOptionParser(String pattern, String nameExpression, String valueExpression) {
super(ICLanguageSettingEntry.MACRO, pattern, nameExpression, valueExpression, 0);
}
+
/**
* Constructor.
* @param pattern - regular expression pattern being parsed by the parser.
@@ -275,6 +287,7 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
public MacroOptionParser(String pattern, String nameExpression, String valueExpression, int extraFlag) {
super(ICLanguageSettingEntry.MACRO, pattern, nameExpression, valueExpression, extraFlag);
}
+
/**
* Constructor.
* @param pattern - regular expression pattern being parsed by the parser.
@@ -298,6 +311,7 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
public MacroFileOptionParser(String pattern, String nameExpression) {
super(ICLanguageSettingEntry.MACRO_FILE, pattern, nameExpression, nameExpression, 0);
}
+
/**
* Constructor.
* @param pattern - regular expression pattern being parsed by the parser.
@@ -321,6 +335,7 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
public LibraryPathOptionParser(String pattern, String nameExpression) {
super(ICLanguageSettingEntry.LIBRARY_PATH, pattern, nameExpression, nameExpression, 0);
}
+
/**
* Constructor.
* @param pattern - regular expression pattern being parsed by the parser.
@@ -344,6 +359,7 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
public LibraryFileOptionParser(String pattern, String nameExpression) {
super(ICLanguageSettingEntry.LIBRARY_FILE, pattern, nameExpression, nameExpression, 0);
}
+
/**
* Constructor.
* @param pattern - regular expression pattern being parsed by the parser.
@@ -405,9 +421,9 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
this.isResolvingPaths = resolvePaths;
}
-
@Override
- public void startup(ICConfigurationDescription cfgDescription, IWorkingDirectoryTracker cwdTracker) throws CoreException {
+ public void startup(ICConfigurationDescription cfgDescription, IWorkingDirectoryTracker cwdTracker)
+ throws CoreException {
this.currentCfgDescription = cfgDescription;
this.currentProject = cfgDescription != null ? cfgDescription.getProjectDescription().getProject() : null;
this.cwdTracker = cwdTracker;
@@ -486,8 +502,10 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
}
} catch (Throwable e) {
@SuppressWarnings("nls")
- String msg = "Exception trying to parse option [" + option + "], class " + getClass().getSimpleName();
- ManagedBuilderCorePlugin.log(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, msg, e));
+ String msg = "Exception trying to parse option [" + option + "], class "
+ + getClass().getSimpleName();
+ ManagedBuilderCorePlugin
+ .log(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, msg, e));
}
}
}
@@ -788,8 +806,8 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
}
try {
- cwdURI = new URI(fileURI.getScheme(), fileURI.getUserInfo(), fileURI.getHost(),
- fileURI.getPort(), path + '/', fileURI.getQuery(), fileURI.getFragment());
+ cwdURI = new URI(fileURI.getScheme(), fileURI.getUserInfo(), fileURI.getHost(), fileURI.getPort(),
+ path + '/', fileURI.getQuery(), fileURI.getFragment());
} catch (URISyntaxException e) {
// It should be valid URI here or something is really wrong
ManagedBuilderCorePlugin.log(e);
@@ -923,7 +941,7 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
private IResource findBestFitInWorkspace(String parsedName) {
Set<String> referencedProjectsNames = new LinkedHashSet<String>();
if (currentCfgDescription != null) {
- Map<String,String> refs = currentCfgDescription.getReferenceInfo();
+ Map<String, String> refs = currentCfgDescription.getReferenceInfo();
referencedProjectsNames.addAll(refs.keySet());
}
@@ -1021,11 +1039,13 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
/**
* Resolve and create language settings path entry.
*/
- private ICLanguageSettingEntry createResolvedPathEntry(AbstractOptionParser optionParser, String parsedPath, int flag, URI baseURI) {
+ private ICLanguageSettingEntry createResolvedPathEntry(AbstractOptionParser optionParser, String parsedPath,
+ int flag, URI baseURI) {
URI uri = determineMappedURI(parsedPath, baseURI);
boolean isRelative = !new Path(parsedPath).isAbsolute();
// is mapped something that is not a project root
- boolean isRemapped = baseURI != null && currentProject != null && !baseURI.equals(currentProject.getLocationURI());
+ boolean isRemapped = baseURI != null && currentProject != null
+ && !baseURI.equals(currentProject.getLocationURI());
boolean presentAsRelative = isRelative || isRemapped;
ICLanguageSettingEntry entry = resolvePathEntryInWorkspace(optionParser, uri, flag, presentAsRelative);
@@ -1055,7 +1075,8 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
* Create a language settings entry for a given resource.
* This will represent relative path using CDT variable ${ProjName}.
*/
- private ICLanguageSettingEntry createPathEntry(AbstractOptionParser optionParser, IResource rc, boolean isRelative, int flag) {
+ private ICLanguageSettingEntry createPathEntry(AbstractOptionParser optionParser, IResource rc, boolean isRelative,
+ int flag) {
String path;
if (isRelative && rc.getProject().equals(currentProject)) {
path = PROJ_NAME_PREFIX + rc.getFullPath().removeFirstSegments(1);
@@ -1070,7 +1091,8 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
/**
* Find an existing resource in the workspace and create a language settings entry for it.
*/
- private ICLanguageSettingEntry resolvePathEntryInWorkspace(AbstractOptionParser optionParser, URI uri, int flag, boolean isRelative) {
+ private ICLanguageSettingEntry resolvePathEntryInWorkspace(AbstractOptionParser optionParser, URI uri, int flag,
+ boolean isRelative) {
if (uri != null && uri.isAbsolute()) {
IResource rc = null;
if (optionParser.isForFolder()) {
@@ -1102,7 +1124,8 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
/**
* Find a best fit for the resource in the workspace and create a language settings entry for it.
*/
- private ICLanguageSettingEntry resolvePathEntryInWorkspaceAsBestFit(AbstractOptionParser optionParser, String parsedPath, int flag, boolean isRelative) {
+ private ICLanguageSettingEntry resolvePathEntryInWorkspaceAsBestFit(AbstractOptionParser optionParser,
+ String parsedPath, int flag, boolean isRelative) {
IResource rc = findBestFitInWorkspace(parsedPath);
if (rc != null) {
return createPathEntry(optionParser, rc, isRelative, flag);
@@ -1113,7 +1136,8 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
/**
* Try to map a resource in the workspace even if it does not exist and create a language settings entry for it.
*/
- private ICLanguageSettingEntry resolvePathEntryInWorkspaceToNonexistingResource(AbstractOptionParser optionParser, URI uri, int flag, boolean isRelative) {
+ private ICLanguageSettingEntry resolvePathEntryInWorkspaceToNonexistingResource(AbstractOptionParser optionParser,
+ URI uri, int flag, boolean isRelative) {
if (uri != null && uri.isAbsolute()) {
IResource rc = null;
if (optionParser.isForFolder()) {
@@ -1131,7 +1155,8 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
/**
* Try to map a resource on the file-system even if it does not exist and create a language settings entry for it.
*/
- private ICLanguageSettingEntry resolvePathEntryInFilesystemToNonExistingResource(AbstractOptionParser optionParser, URI uri, int flag) {
+ private ICLanguageSettingEntry resolvePathEntryInFilesystemToNonExistingResource(AbstractOptionParser optionParser,
+ URI uri, int flag) {
IPath location = getFilesystemLocation(uri);
if (location != null) {
return optionParser.createEntry(location.toString(), location.toString(), flag);
@@ -1192,11 +1217,11 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
return pattern;
}
-
+
/**
* This {@link EFSExtensionProvider} is capable to translate EFS paths to and from local
* file-system. Added mostly for Cygwin translations.
- *
+ *
* This usage of {@link EFSExtensionProvider} is somewhat a misnomer. This provider is not
* an "extension" provider but rather a wrapper on {@link EFSExtensionManager} which in fact
* will use genuine {@link EFSExtensionProvider}s defined as extensions.
@@ -1210,7 +1235,7 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
@Override
public Element serializeAttributes(Element parentElement) {
Element elementProvider = super.serializeAttributes(parentElement);
- elementProvider.setAttribute(ATTR_KEEP_RELATIVE_PATHS, Boolean.toString( ! isResolvingPaths ));
+ elementProvider.setAttribute(ATTR_KEEP_RELATIVE_PATHS, Boolean.toString(!isResolvingPaths));
return elementProvider;
}
@@ -1219,8 +1244,8 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
super.loadAttributes(providerNode);
String expandRelativePathsValue = XmlUtil.determineAttributeValue(providerNode, ATTR_KEEP_RELATIVE_PATHS);
- if (expandRelativePathsValue!=null)
- isResolvingPaths = ! Boolean.parseBoolean(expandRelativePathsValue);
+ if (expandRelativePathsValue != null)
+ isResolvingPaths = !Boolean.parseBoolean(expandRelativePathsValue);
}
@Override
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuildCommandParser.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuildCommandParser.java
index 1c536fe6897..2548a73d152 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuildCommandParser.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuildCommandParser.java
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.language.settings.providers;
-
import org.eclipse.cdt.core.errorparsers.RegexErrorPattern;
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsEditableProvider;
import org.eclipse.cdt.core.settings.model.ICSettingEntry;
@@ -33,8 +32,7 @@ import org.eclipse.cdt.core.settings.model.ICSettingEntry;
*/
public class GCCBuildCommandParser extends AbstractBuildCommandParser implements ILanguageSettingsEditableProvider {
@SuppressWarnings("nls")
- static final AbstractOptionParser[] optionParsers = {
- new IncludePathOptionParser("-I\\s*([\"'])(.*)\\1", "$2"),
+ static final AbstractOptionParser[] optionParsers = { new IncludePathOptionParser("-I\\s*([\"'])(.*)\\1", "$2"),
new IncludePathOptionParser("-I\\s*([^\\s\"']*)", "$1"),
new IncludePathOptionParser("-isystem\\s*([\"'])(.*)\\1", "$2"),
new IncludePathOptionParser("-isystem\\s*([^\\s\"']*)", "$1"),
@@ -74,7 +72,8 @@ public class GCCBuildCommandParser extends AbstractBuildCommandParser implements
* Error Parser which allows highlighting of output lines matching the patterns of this parser.
* Intended for better troubleshooting experience.
*/
- public static class GCCBuildCommandPatternHighlighter extends AbstractBuildCommandParser.AbstractBuildCommandPatternHighlighter {
+ public static class GCCBuildCommandPatternHighlighter
+ extends AbstractBuildCommandParser.AbstractBuildCommandPatternHighlighter {
// ID of the parser taken from the existing extension point
private static final String GCC_BUILD_COMMAND_PARSER_EXT = "org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"; //$NON-NLS-1$
@@ -91,7 +90,7 @@ public class GCCBuildCommandParser extends AbstractBuildCommandParser implements
that.setId(getId());
that.setName(getName());
for (RegexErrorPattern pattern : getPatterns()) {
- that.addPattern((RegexErrorPattern)pattern.clone());
+ that.addPattern((RegexErrorPattern) pattern.clone());
}
return that;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuiltinSpecsDetector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuiltinSpecsDetector.java
index 9f904e8c863..a00429c4a01 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuiltinSpecsDetector.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuiltinSpecsDetector.java
@@ -35,21 +35,28 @@ import org.eclipse.core.runtime.CoreException;
*
* @since 8.1
*/
-public class GCCBuiltinSpecsDetector extends ToolchainBuiltinSpecsDetector implements ILanguageSettingsEditableProvider {
+public class GCCBuiltinSpecsDetector extends ToolchainBuiltinSpecsDetector
+ implements ILanguageSettingsEditableProvider {
// ID must match the tool-chain definition in org.eclipse.cdt.managedbuilder.core.buildDefinitions extension point
- private static final String GCC_TOOLCHAIN_ID = "cdt.managedbuild.toolchain.gnu.base"; //$NON-NLS-1$
+ private static final String GCC_TOOLCHAIN_ID = "cdt.managedbuild.toolchain.gnu.base"; //$NON-NLS-1$
+
+ private enum State {
+ NONE, EXPECTING_LOCAL_INCLUDE, EXPECTING_SYSTEM_INCLUDE, EXPECTING_FRAMEWORKS
+ }
- private enum State {NONE, EXPECTING_LOCAL_INCLUDE, EXPECTING_SYSTEM_INCLUDE, EXPECTING_FRAMEWORKS}
private State state = State.NONE;
@SuppressWarnings("nls")
private static final AbstractOptionParser[] optionParsers = {
- new IncludePathOptionParser("#include \"(\\S.*)\"", "$1", ICSettingEntry.BUILTIN | ICSettingEntry.READONLY | ICSettingEntry.LOCAL),
+ new IncludePathOptionParser("#include \"(\\S.*)\"", "$1",
+ ICSettingEntry.BUILTIN | ICSettingEntry.READONLY | ICSettingEntry.LOCAL),
new IncludePathOptionParser("#include <(\\S.*)>", "$1", ICSettingEntry.BUILTIN | ICSettingEntry.READONLY),
- new IncludePathOptionParser("#framework <(\\S.*)>", "$1", ICSettingEntry.BUILTIN | ICSettingEntry.READONLY | ICSettingEntry.FRAMEWORKS_MAC),
- new MacroOptionParser("#define\\s+(\\S*\\(.*?\\))\\s*(.*)", "$1", "$2", ICSettingEntry.BUILTIN | ICSettingEntry.READONLY),
- new MacroOptionParser("#define\\s+(\\S*)\\s*(.*)", "$1", "$2", ICSettingEntry.BUILTIN | ICSettingEntry.READONLY),
- };
+ new IncludePathOptionParser("#framework <(\\S.*)>", "$1",
+ ICSettingEntry.BUILTIN | ICSettingEntry.READONLY | ICSettingEntry.FRAMEWORKS_MAC),
+ new MacroOptionParser("#define\\s+(\\S*\\(.*?\\))\\s*(.*)", "$1", "$2",
+ ICSettingEntry.BUILTIN | ICSettingEntry.READONLY),
+ new MacroOptionParser("#define\\s+(\\S*)\\s*(.*)", "$1", "$2",
+ ICSettingEntry.BUILTIN | ICSettingEntry.READONLY), };
/**
* @since 8.2
@@ -77,7 +84,7 @@ public class GCCBuiltinSpecsDetector extends ToolchainBuiltinSpecsDetector imple
@Override
protected List<String> parseOptions(String line) {
line = line.trim();
-
+
// contribution of -dD option
if (line.startsWith("#define")) {
return makeList(line);
@@ -87,7 +94,7 @@ public class GCCBuiltinSpecsDetector extends ToolchainBuiltinSpecsDetector imple
if (line.startsWith("#undef")) {
return null;
}
-
+
// contribution of includes
if (line.equals("#include \"...\" search starts here:")) {
state = State.EXPECTING_LOCAL_INCLUDE;
@@ -99,23 +106,23 @@ public class GCCBuiltinSpecsDetector extends ToolchainBuiltinSpecsDetector imple
state = State.EXPECTING_FRAMEWORKS;
} else if (line.startsWith("End of framework search list.")) {
state = State.NONE;
- } else if (state==State.EXPECTING_LOCAL_INCLUDE) {
+ } else if (state == State.EXPECTING_LOCAL_INCLUDE) {
// making that up for the parser to figure out
- line = "#include \""+line+"\"";
+ line = "#include \"" + line + "\"";
return makeList(line);
} else {
String frameworkIndicator = "(framework directory)";
- if (state==State.EXPECTING_SYSTEM_INCLUDE) {
+ if (state == State.EXPECTING_SYSTEM_INCLUDE) {
// making that up for the parser to figure out
if (line.contains(frameworkIndicator)) {
- line = "#framework <"+line.replace(frameworkIndicator, "").trim()+">";
+ line = "#framework <" + line.replace(frameworkIndicator, "").trim() + ">";
} else {
- line = "#include <"+line+">";
+ line = "#include <" + line + ">";
}
return makeList(line);
- } else if (state==State.EXPECTING_FRAMEWORKS) {
+ } else if (state == State.EXPECTING_FRAMEWORKS) {
// making that up for the parser to figure out
- line = "#framework <"+line.replace(frameworkIndicator, "").trim()+">";
+ line = "#framework <" + line.replace(frameworkIndicator, "").trim() + ">";
return makeList(line);
}
}
@@ -124,7 +131,8 @@ public class GCCBuiltinSpecsDetector extends ToolchainBuiltinSpecsDetector imple
}
@Override
- public void startup(ICConfigurationDescription cfgDescription, IWorkingDirectoryTracker cwdTracker) throws CoreException {
+ public void startup(ICConfigurationDescription cfgDescription, IWorkingDirectoryTracker cwdTracker)
+ throws CoreException {
super.startup(cfgDescription, cwdTracker);
state = State.NONE;
@@ -147,5 +155,4 @@ public class GCCBuiltinSpecsDetector extends ToolchainBuiltinSpecsDetector imple
return (GCCBuiltinSpecsDetector) super.clone();
}
-
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/ToolchainBuiltinSpecsDetector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/ToolchainBuiltinSpecsDetector.java
index c4781303603..9ca89c36882 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/ToolchainBuiltinSpecsDetector.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/ToolchainBuiltinSpecsDetector.java
@@ -84,7 +84,7 @@ public abstract class ToolchainBuiltinSpecsDetector extends AbstractBuiltinSpecs
toolchainId = getToolchainId();
toolchain = ManagedBuildManager.getExtensionToolChain(toolchainId);
}
- for (;toolchain != null;toolchain = toolchain.getSuperClass()) {
+ for (; toolchain != null; toolchain = toolchain.getSuperClass()) {
tool = getTool(languageId, toolchain);
if (tool != null) {
break;
@@ -96,7 +96,8 @@ public abstract class ToolchainBuiltinSpecsDetector extends AbstractBuiltinSpecs
}
if (tool == null) {
- ManagedBuilderCorePlugin.error("Unable to find tool in toolchain=" + toolchainId + " for language=" + languageId); //$NON-NLS-1$ //$NON-NLS-2$
+ ManagedBuilderCorePlugin
+ .error("Unable to find tool in toolchain=" + toolchainId + " for language=" + languageId); //$NON-NLS-1$ //$NON-NLS-2$
}
return tool;
}
@@ -169,11 +170,11 @@ public abstract class ToolchainBuiltinSpecsDetector extends AbstractBuiltinSpecs
break;
case IOption.STRING_LIST:
String[] values = option.getBasicStringListValue();
- if(values != null) {
+ if (values != null) {
optionValue = ""; //$NON-NLS-1$
String cmd = option.getCommand();
for (String value : values) {
- if(!value.isEmpty() && !value.equals(EMPTY_QUOTED_STRING)) {
+ if (!value.isEmpty() && !value.equals(EMPTY_QUOTED_STRING)) {
optionValue = optionValue + cmd + value + ' ';
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/BuildMacroException.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/BuildMacroException.java
index 9ff06c257ab..a072e5b2e8d 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/BuildMacroException.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/BuildMacroException.java
@@ -18,8 +18,8 @@ import org.eclipse.core.runtime.IStatus;
/**
* This exception is thrown in the case of some build macros-related operation failure
- * The exception typically contains one or more IBuildMacroStatus statuses
- *
+ * The exception typically contains one or more IBuildMacroStatus statuses
+ *
* @since 3.0
* @noextend This class is not intended to be subclassed by clients.
*/
@@ -30,9 +30,9 @@ public class BuildMacroException extends CdtVariableException {
private static final long serialVersionUID = 3976741380246681395L;
/**
- * Creates a new exception with the given status object.
+ * Creates a new exception with the given status object.
*
- * @param status the status object to be associated with this exception.
+ * @param status the status object to be associated with this exception.
* Typically this is either the IBuildMacroStatus or the MultiStatus that holds
* the list of the IBuildMacroStatus statuses
*/
@@ -40,76 +40,76 @@ public class BuildMacroException extends CdtVariableException {
super(status);
}
-// /**
-// * Creates an exception containing a single IBuildMacroStatus status with the IStatus.ERROR severity
-// *
-// * @param code one of the IBuildMacroStatus.TYPE_xxx statusses
-// * @param message message, can be null. In this case the default message will
-// * be generated base upon the other status info
-// * @param exception a low-level exception, or <code>null</code> if not
-// * applicable
-// * @param macroName the name of the build macro whose resolution caused this status creation or null if none
-// * @param expression the string whose resolutinon caused caused this status creation or null if none
-// * @param referencedName the macro name referenced in the resolution string that caused this this status creation or null if none
-// * @param contextType the context type used in the operation
-// * @param contextData the context data used in the operation
-// */
-// public BuildMacroException(int code,
-// String message,
-// Throwable exception,
-// String macroName,
-// String expression,
-// String referencedName,
-// int contextType,
-// Object contextData) {
-// super(new BuildMacroStatus(code, message, exception, macroName, expression, referencedName, contextType, contextData));
-// }
+ // /**
+ // * Creates an exception containing a single IBuildMacroStatus status with the IStatus.ERROR severity
+ // *
+ // * @param code one of the IBuildMacroStatus.TYPE_xxx statusses
+ // * @param message message, can be null. In this case the default message will
+ // * be generated base upon the other status info
+ // * @param exception a low-level exception, or <code>null</code> if not
+ // * applicable
+ // * @param macroName the name of the build macro whose resolution caused this status creation or null if none
+ // * @param expression the string whose resolutinon caused caused this status creation or null if none
+ // * @param referencedName the macro name referenced in the resolution string that caused this this status creation or null if none
+ // * @param contextType the context type used in the operation
+ // * @param contextData the context data used in the operation
+ // */
+ // public BuildMacroException(int code,
+ // String message,
+ // Throwable exception,
+ // String macroName,
+ // String expression,
+ // String referencedName,
+ // int contextType,
+ // Object contextData) {
+ // super(new BuildMacroStatus(code, message, exception, macroName, expression, referencedName, contextType, contextData));
+ // }
+
+ // /**
+ // * Creates an exception containing a single IBuildMacroStatus status with the IStatus.ERROR severity and with the default message
+ // *
+ // * @param code one of the IBuildMacroStatus.TYPE_xxx statusses
+ // * @param exception a low-level exception, or <code>null</code> if not
+ // * applicable
+ // * @param macroName the name of the build macro whose resolution caused this status creation or null if none
+ // * @param expression the string whose resolutinon caused caused this status creation or null if none
+ // * @param referencedName the macro name referenced in the resolution string that caused this this status creation or null if none
+ // * @param contextType the context type used in the operation
+ // * @param contextData the context data used in the operation
+ // */
+ // public BuildMacroException(int code,
+ // String macroName,
+ // String expression,
+ // String referencedName,
+ // int contextType,
+ // Object contextData) {
+ // super(new BuildMacroStatus(code, macroName, expression, referencedName, contextType, contextData));
+ // }
-// /**
-// * Creates an exception containing a single IBuildMacroStatus status with the IStatus.ERROR severity and with the default message
-// *
-// * @param code one of the IBuildMacroStatus.TYPE_xxx statusses
-// * @param exception a low-level exception, or <code>null</code> if not
-// * applicable
-// * @param macroName the name of the build macro whose resolution caused this status creation or null if none
-// * @param expression the string whose resolutinon caused caused this status creation or null if none
-// * @param referencedName the macro name referenced in the resolution string that caused this this status creation or null if none
-// * @param contextType the context type used in the operation
-// * @param contextData the context data used in the operation
-// */
-// public BuildMacroException(int code,
-// String macroName,
-// String expression,
-// String referencedName,
-// int contextType,
-// Object contextData) {
-// super(new BuildMacroStatus(code, macroName, expression, referencedName, contextType, contextData));
-// }
-
- public BuildMacroException(CdtVariableException e){
+ public BuildMacroException(CdtVariableException e) {
super(e.getStatus());
}
-
+
/**
* Returns an array of the IBuildMacroStatus statuses this exception holds
- *
+ *
* @return IBuildMacroStatus[]
*/
- public IBuildMacroStatus[] getMacroStatuses(){
+ public IBuildMacroStatus[] getMacroStatuses() {
IStatus status = getStatus();
- if(status instanceof IBuildMacroStatus)
- return new IBuildMacroStatus[]{(IBuildMacroStatus)status};
- else if(status.isMultiStatus()){
+ if (status instanceof IBuildMacroStatus)
+ return new IBuildMacroStatus[] { (IBuildMacroStatus) status };
+ else if (status.isMultiStatus()) {
IStatus children[] = status.getChildren();
IBuildMacroStatus result[] = new IBuildMacroStatus[children.length];
int num = 0;
- for(int i = 0; i < children.length; i++){
- if(children[i] instanceof IBuildMacroStatus)
- result[num++]=(IBuildMacroStatus)children[i];
+ for (int i = 0; i < children.length; i++) {
+ if (children[i] instanceof IBuildMacroStatus)
+ result[num++] = (IBuildMacroStatus) children[i];
}
- if(num != children.length){
+ if (num != children.length) {
IBuildMacroStatus tmp[] = new IBuildMacroStatus[num];
- for(int i = 0; i < num; i++)
+ for (int i = 0; i < num; i++)
tmp[i] = result[i];
result = tmp;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IBuildMacro.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IBuildMacro.java
index 5041a1175a4..b030e6fd290 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IBuildMacro.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IBuildMacro.java
@@ -15,27 +15,25 @@ package org.eclipse.cdt.managedbuilder.macros;
import org.eclipse.cdt.core.cdtvariables.ICdtVariable;
-
/**
* This interface represents the given build macro
* Clients may implement or extend this interface.
*
* @since 3.0
*/
-public interface IBuildMacro extends ICdtVariable{
+public interface IBuildMacro extends ICdtVariable {
int getMacroValueType();
- /**
- * @throws BuildMacroException if macro holds StringList-type value
- */
- @Override
+ /**
+ * @throws BuildMacroException if macro holds StringList-type value
+ */
+ @Override
String getStringValue() throws BuildMacroException;
- /**
- * @throws BuildMacroException if macro holds single String-type value
- */
- @Override
+ /**
+ * @throws BuildMacroException if macro holds single String-type value
+ */
+ @Override
String[] getStringListValue() throws BuildMacroException;
}
-
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IBuildMacroProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IBuildMacroProvider.java
index a08fa500f41..0580f8f9e75 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IBuildMacroProvider.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IBuildMacroProvider.java
@@ -16,12 +16,12 @@ package org.eclipse.cdt.managedbuilder.macros;
import org.eclipse.cdt.core.cdtvariables.ICdtVariable;
/**
- *
+ *
* @since 3.0
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
-public interface IBuildMacroProvider{
+public interface IBuildMacroProvider {
public final static int CONTEXT_FILE = 1;
public final static int CONTEXT_OPTION = 2;
public final static int CONTEXT_CONFIGURATION = 3;
@@ -32,23 +32,23 @@ public interface IBuildMacroProvider{
public final static int CONTEXT_TOOL = 8;
/**
- *
+ *
* Returns reference to the IBuildMacro interface representing Macro of the
* specified name or null if there is there is no such macro
* @param macroName macro name
* @param contextType represents the context type. Should be set to one of the the
- * IBuildMacroProvider. CONTEXT_xxx constants
+ * IBuildMacroProvider. CONTEXT_xxx constants
* @param contextData represents the additional data needed by the Build Macro Provider
* and Macro Suppliers in order to obtain the macro value. The type of the context data
- * differs depending on the context type and can be one of the following:
+ * differs depending on the context type and can be one of the following:
* 1. IFileContextData interface - used to represent currently selected file context
* the IFileContextData interface is defined as follows:
* public interface IFileContextData{
* IFile getFile();
* IOption getOption();
* }
- * NOTE: the IFileContextData is passed that represents the current file and the option
- * for that file because Macro Value Provider needs to know what option should be used
+ * NOTE: the IFileContextData is passed that represents the current file and the option
+ * for that file because Macro Value Provider needs to know what option should be used
* as a context in case macro is not found for "current file" context
* 2. IOptionContextData interface used to represent the currently selected option context
* 3. IConfiguration - used to represent the currently selected configuration context
@@ -56,170 +56,136 @@ public interface IBuildMacroProvider{
* 5. IWorkspace - used to represent current workspace context
* 6. null - to represent the CDT and Eclipse installation context
* 7. null - to represent process environment context
- * @param includeParentContexts specifies whether lower-precedence context macros should
+ * @param includeParentContexts specifies whether lower-precedence context macros should
* be included
*/
- public IBuildMacro getMacro(String macroName,
- int contextType,
- Object contextData,
- boolean includeParentContexts);
+ public IBuildMacro getMacro(String macroName, int contextType, Object contextData, boolean includeParentContexts);
/**
- *
- * @return the array of the IBuildMacro representing all available macros
+ *
+ * @return the array of the IBuildMacro representing all available macros
*/
- public IBuildMacro[] getMacros(int contextType,
- Object contextData,
- boolean includeParentContexts);
+ public IBuildMacro[] getMacros(int contextType, Object contextData, boolean includeParentContexts);
+ public ICdtVariable getVariable(String macroName, int contextType, Object contextData,
+ boolean includeParentContexts);
- public ICdtVariable getVariable(String macroName,
- int contextType,
- Object contextData,
- boolean includeParentContexts);
-
/**
- *
- * @return the array of the IBuildMacro representing all available macros
+ *
+ * @return the array of the IBuildMacro representing all available macros
*/
- public ICdtVariable[] getVariables(int contextType,
- Object contextData,
- boolean includeParentContexts);
+ public ICdtVariable[] getVariables(int contextType, Object contextData, boolean includeParentContexts);
/**
* This method is defined to be used primarily by the UI classes and should not be used by the
* tool-integrator
* @return the array of the provider-internal suppliers for the given context
*/
- public IBuildMacroSupplier[] getSuppliers(int contextType,
- Object contextData);
-
+ public IBuildMacroSupplier[] getSuppliers(int contextType, Object contextData);
/**
- *
+ *
* converts StringList value into String of the following format:
* "<value_1>< listDelimiter ><value_2>< listDelimiter > ... <value_n>"
*/
- public String convertStringListToString (String value[], String listDelimiter);
+ public String convertStringListToString(String value[], String listDelimiter);
/**
- *
- * resolves all macros in the string.
+ *
+ * resolves all macros in the string.
* @param value the value to be resolved
- * @param nonexistentMacrosValue specifies the value that inexistent macro references will be
- * expanded to. If null the BuildMacroException is thrown in case the string to be resolved
+ * @param nonexistentMacrosValue specifies the value that inexistent macro references will be
+ * expanded to. If null the BuildMacroException is thrown in case the string to be resolved
* references inexistent macros
* @param listDelimiter if not null, StringList macros are expanded as
* "<value_1>< listDelimiter ><value_2>< listDelimiter > ... <value_n>"
- * otherwise the BuildMacroException is thrown in case the string to be resolved references
- * string-list macros
+ * otherwise the BuildMacroException is thrown in case the string to be resolved references
+ * string-list macros
* @param contextType context from which the macro search should be started
* @param contextData context data
*/
- public String resolveValue(String value,
- String nonexistentMacrosValue,
- String listDelimiter,
- int contextType,
- Object contextData) throws BuildMacroException;
+ public String resolveValue(String value, String nonexistentMacrosValue, String listDelimiter, int contextType,
+ Object contextData) throws BuildMacroException;
/**
- *
+ *
* if the string contains a value that can be treated as a StringList resolves it to arrays of strings
* otherwise throws the BuildMacroException exception
* @see #isStringListValue
*/
- public String[] resolveStringListValue(String value,
- String nonexistentMacrosValue,
- String listDelimiter,
- int contextType,
- Object contextData) throws BuildMacroException;
+ public String[] resolveStringListValue(String value, String nonexistentMacrosValue, String listDelimiter,
+ int contextType, Object contextData) throws BuildMacroException;
/**
- *
+ *
* resolves macros in the array of string-list values
- *
+ *
* @see #isStringListValue
*/
- public String[] resolveStringListValues(String value[],
- String nonexistentMacrosValue,
- String listDelimiter,
- int contextType,
- Object contextData) throws BuildMacroException;
+ public String[] resolveStringListValues(String value[], String nonexistentMacrosValue, String listDelimiter,
+ int contextType, Object contextData) throws BuildMacroException;
/**
- *
+ *
* resolves all macros in the string to the makefile format. That is:
- * 1. In case when a user has specified to resolve the environment build macros all macros
+ * 1. In case when a user has specified to resolve the environment build macros all macros
* get resolved in the string
* 2. In case when the a user has specified not to resolve the environment build macros all macros
* get resolved except the build environment macros (macros whose name conflicts with one
- * of reserved macro names, or string-list macros always get resolved in the buildfile).
+ * of reserved macro names, or string-list macros always get resolved in the buildfile).
* Macro references that are kept unresolved are converted to the makefile format
* @param value the value to be resolved
- * @param nonexistentMacrosValue specifies the value that inexistent macro references will be
- * expanded to. If null the BuildMacroException is thrown in case the string to be resolved
+ * @param nonexistentMacrosValue specifies the value that inexistent macro references will be
+ * expanded to. If null the BuildMacroException is thrown in case the string to be resolved
* references inexistent macros
* @param listDelimiter if not null, StringList macros are expanded as
* "<value_1>< listDelimiter ><value_2>< listDelimiter > ... <value_n>"
- * otherwise the BuildMacroException is thrown in case the string to be resolved references
- * string-list macros
+ * otherwise the BuildMacroException is thrown in case the string to be resolved references
+ * string-list macros
* @param contextType context from which the macro search should be started
* @param contextData context data
*/
- public String resolveValueToMakefileFormat(String value,
- String nonexistentMacrosValue,
- String listDelimiter,
- int contextType,
- Object contextData) throws BuildMacroException;
+ public String resolveValueToMakefileFormat(String value, String nonexistentMacrosValue, String listDelimiter,
+ int contextType, Object contextData) throws BuildMacroException;
/**
- *
+ *
* if the string contains a value that can be treated as a StringList resolves it to arrays of strings
* otherwise throws the BuildMacroException exception
* each string of the returned array will contain all macro references resolved in case of
- * a user has specified to resolve the build macros, and will contain the string with the
+ * a user has specified to resolve the build macros, and will contain the string with the
* environment macro references unresolved and converted to the buildfile format otherwise
* @see #isStringListValue
*/
- public String[] resolveStringListValueToMakefileFormat(String value,
- String nonexistentMacrosValue,
- String listDelimiter,
- int contextType,
- Object contextData) throws BuildMacroException;
+ public String[] resolveStringListValueToMakefileFormat(String value, String nonexistentMacrosValue,
+ String listDelimiter, int contextType, Object contextData) throws BuildMacroException;
/**
* resolves macros in the array of string-list values
* macros are resolved to the makefile format
- *
+ *
* @see #isStringListValue
*/
- public String[] resolveStringListValuesToMakefileFormat(String value[],
- String nonexistentMacrosValue,
- String listDelimiter,
- int contextType,
- Object contextData) throws BuildMacroException;
-
+ public String[] resolveStringListValuesToMakefileFormat(String value[], String nonexistentMacrosValue,
+ String listDelimiter, int contextType, Object contextData) throws BuildMacroException;
/**
- *
+ *
* @return true if the specified expression can be treated as StringList
* 1. The string value is "${<some_StringList_Macro_name>}"
*/
- public boolean isStringListValue(String value, int contextType, Object contextData)
- throws BuildMacroException;
+ public boolean isStringListValue(String value, int contextType, Object contextData) throws BuildMacroException;
/**
- *
- * checks the integrity of the Macros
+ *
+ * checks the integrity of the Macros
* If there are inconsistencies, such as when a macro value refers to a nonexistent macro
* or when two macros refer to each other, this method will throw the BuildMacroException exception
- * The BuildMacroException will contain the human-readable string describing
+ * The BuildMacroException will contain the human-readable string describing
* the inconsistency and the array of the IBuildMacro interfaces that will represent the macros that
- * caused the inconsistency. This information will be used in the UI to notify the user about
+ * caused the inconsistency. This information will be used in the UI to notify the user about
* the macro inconsistencies (see also the "User interface for viewing and editing Build Macros"
* section of this design)
*/
- public void checkIntegrity(int contextType,
- Object contextData) throws BuildMacroException;
+ public void checkIntegrity(int contextType, Object contextData) throws BuildMacroException;
}
-
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IBuildMacroStatus.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IBuildMacroStatus.java
index b4cba83fc21..1e0cfa21beb 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IBuildMacroStatus.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IBuildMacroStatus.java
@@ -16,26 +16,26 @@ package org.eclipse.cdt.managedbuilder.macros;
import org.eclipse.cdt.core.cdtvariables.ICdtVariableStatus;
/**
- * This interface represents the status of a build macro operation
- *
+ * This interface represents the status of a build macro operation
+ *
* @since 3.0
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IBuildMacroStatus extends ICdtVariableStatus {
-
+
/**
* returns the context type used in the operation
* @return int
*/
public int getContextType();
-
+
/**
* returns the context data used in the operation
* @return Object
*/
public Object getContextData();
-
+
public String getMacroName();
-
+
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IBuildMacroSupplier.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IBuildMacroSupplier.java
index 30304381e0b..9f83a4f04fb 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IBuildMacroSupplier.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IBuildMacroSupplier.java
@@ -18,36 +18,31 @@ import org.eclipse.cdt.managedbuilder.internal.macros.IMacroContextInfo;
import org.eclipse.cdt.utils.cdtvariables.ICdtVariableSupplier;
/**
- *
+ *
* @since 3.0
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
-public interface IBuildMacroSupplier extends ICdtVariableSupplier{
-
+public interface IBuildMacroSupplier extends ICdtVariableSupplier {
+
/**
- *
+ *
* @param macroName macro name
* @param contextType context type
* @param contextData context data
* @return IBuildMacro
*/
- public IBuildMacro getMacro(String macroName,
- int contextType,
- Object contextData);
-
+ public IBuildMacro getMacro(String macroName, int contextType, Object contextData);
+
/**
- *
+ *
* @param contextType context type
* @param contextData context data
* @return IBuildMacro[]
*/
- public IBuildMacro[] getMacros(int contextType,
- Object contextData);
-
-
- public ICdtVariable getVariable(String macroName,
- IMacroContextInfo context);
+ public IBuildMacro[] getMacros(int contextType, Object contextData);
+
+ public ICdtVariable getVariable(String macroName, IMacroContextInfo context);
public ICdtVariable[] getVariables(IMacroContextInfo context);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IConfigurationBuildMacroSupplier.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IConfigurationBuildMacroSupplier.java
index 1bb19ebdb00..bf040a56fbb 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IConfigurationBuildMacroSupplier.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IConfigurationBuildMacroSupplier.java
@@ -16,10 +16,10 @@ package org.eclipse.cdt.managedbuilder.macros;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
/**
- *
+ *
* this interface is to be implemented by the tool-integrator
* for supplying the configuration-specific macros
- *
+ *
* @since 3.0
*/
public interface IConfigurationBuildMacroSupplier {
@@ -31,19 +31,17 @@ public interface IConfigurationBuildMacroSupplier {
* build macros from within the supplier. The supplier should use this provider to obtain
* the already defined build macros instead of using the "default" provider returned by the
* ManagedBuildManager.getBuildMacroProvider().
- * The provider passed to a supplier will ignore searching macros for the levels
- * higher than the current supplier level, will query only the lower-precedence suppliers
- * for the current level and will query all suppliers for the lower levels.
- * This is done to avoid infinite loops that could be caused if the supplier calls the provider
+ * The provider passed to a supplier will ignore searching macros for the levels
+ * higher than the current supplier level, will query only the lower-precedence suppliers
+ * for the current level and will query all suppliers for the lower levels.
+ * This is done to avoid infinite loops that could be caused if the supplier calls the provider
* and the provider in turn calls that supplier again. Also the supplier should not know anything
* about the build macros defined for the higher levels.
- * @return the reference to the IBuildMacro interface representing
+ * @return the reference to the IBuildMacro interface representing
* the build macro of a given name or null if the macro of that name is not defined
*/
- public IBuildMacro getMacro(String macroName,
- IConfiguration configuration,
- IBuildMacroProvider provider);
-
+ public IBuildMacro getMacro(String macroName, IConfiguration configuration, IBuildMacroProvider provider);
+
/**
*
* @param configuration configuration
@@ -51,15 +49,13 @@ public interface IConfigurationBuildMacroSupplier {
* build macros from within the supplier. The supplier should use this provider to obtain
* the already defined build macros instead of using the "default" provider returned by the
* ManagedBuildManager.getBuildMacroProvider().
- * The provider passed to a supplier will ignore searching macros for the levels
- * higher than the current supplier level, will query only the lower-precedence suppliers
- * for the current level and will query all suppliers for the lower levels.
- * This is done to avoid infinite loops that could be caused if the supplier calls the provider
+ * The provider passed to a supplier will ignore searching macros for the levels
+ * higher than the current supplier level, will query only the lower-precedence suppliers
+ * for the current level and will query all suppliers for the lower levels.
+ * This is done to avoid infinite loops that could be caused if the supplier calls the provider
* and the provider in turn calls that supplier again. Also the supplier should not know anything
* about the build macros defined for the higher levels.
- * @return the IBuildMacro[] array representing defined macros
+ * @return the IBuildMacro[] array representing defined macros
*/
- public IBuildMacro[] getMacros(IConfiguration configuration,
- IBuildMacroProvider provider);
+ public IBuildMacro[] getMacros(IConfiguration configuration, IBuildMacroProvider provider);
}
-
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IFileContextBuildMacroValues.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IFileContextBuildMacroValues.java
index c426b9f60d2..180dc30e1a3 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IFileContextBuildMacroValues.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IFileContextBuildMacroValues.java
@@ -14,25 +14,25 @@
package org.eclipse.cdt.managedbuilder.macros;
/**
- *
+ *
* @since 3.0
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IFileContextBuildMacroValues {
- public static final String PREFIX = "macro"; //$NON-NLS-1$
- public static final String SUFFIX = "Value"; //$NON-NLS-1$
+ public static final String PREFIX = "macro"; //$NON-NLS-1$
+ public static final String SUFFIX = "Value"; //$NON-NLS-1$
/**
*
- * @return the array if strings representing the names of file context macros supported
+ * @return the array if strings representing the names of file context macros supported
* by the builder
*/
String[] getSupportedMacros();
/**
*
- * @return the file context macro value for the given macro name
+ * @return the file context macro value for the given macro name
*/
String getMacroValue(String macroName);
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IFileContextData.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IFileContextData.java
index a37c469fce6..822a7944c9d 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IFileContextData.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IFileContextData.java
@@ -17,28 +17,28 @@ import org.eclipse.core.runtime.IPath;
/**
* This interface is used to represent file context data
- *
+ *
* @since 3.0
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IFileContextData {
-
+
/**
* Returns the input file location
* @return IPath
*/
public IPath getInputFileLocation();
-
+
/**
* Returns the output file location
* @return IPath
*/
public IPath getOutputFileLocation();
-
+
/**
* Returns the option context data
- *
+ *
* @return IOptionContextData
*/
public IOptionContextData getOptionContextData();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IOptionContextData.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IOptionContextData.java
index 3dc9e3cd610..ff80d62ac02 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IOptionContextData.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IOptionContextData.java
@@ -10,7 +10,7 @@
*
* Contributors:
* Intel Corporation - Initial API and implementation
- * Miwako Tokugawa (Intel Corporation) - bug 222817 (OptionCategoryApplicability)
+ * Miwako Tokugawa (Intel Corporation) - bug 222817 (OptionCategoryApplicability)
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.macros;
@@ -20,7 +20,7 @@ import org.eclipse.cdt.managedbuilder.core.IOptionCategory;
/**
* This interface is used to represent an option context data
- *
+ *
* @since 3.0
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
@@ -28,28 +28,28 @@ import org.eclipse.cdt.managedbuilder.core.IOptionCategory;
public interface IOptionContextData {
/**
* Returns an option
- *
+ *
* @return IOption, could be {@code null}
*/
public IOption getOption();
-
+
/**
* Returns an option category
- *
+ *
* @return IOptionCategory, could be {@code null}
- *
+ *
* @since 8.0
*/
public IOptionCategory getOptionCategory();
-
+
/**
- * Returns IBuildObject that represents the option holder.
- * For the backward compatibility MBS will also support the cases
- * when this method returns either an IToolChain or IResourceConfiguration.
- * In this case MBS will try to obtain the option holder automatically,
- * but it might fail in case the tool-chain/resource configuration contains
+ * Returns IBuildObject that represents the option holder.
+ * For the backward compatibility MBS will also support the cases
+ * when this method returns either an IToolChain or IResourceConfiguration.
+ * In this case MBS will try to obtain the option holder automatically,
+ * but it might fail in case the tool-chain/resource configuration contains
* more than one tools with the same super-class
- *
+ *
* @return IBuildObject
*/
public IBuildObject getParent();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IProjectBuildMacroSupplier.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IProjectBuildMacroSupplier.java
index d6e900f9a60..05c1349f833 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IProjectBuildMacroSupplier.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IProjectBuildMacroSupplier.java
@@ -16,10 +16,10 @@ package org.eclipse.cdt.managedbuilder.macros;
import org.eclipse.cdt.managedbuilder.core.IManagedProject;
/**
- *
+ *
* this interface is to be implemented by the tool-integrator
* for supplying the project-specific macros
- *
+ *
* @since 3.0
*/
public interface IProjectBuildMacroSupplier {
@@ -31,19 +31,17 @@ public interface IProjectBuildMacroSupplier {
* build macros from within the supplier. The supplier should use this provider to obtain
* the already defined build macros instead of using the "default" provider returned by the
* ManagedBuildManager.getBuildMacroProvider().
- * The provider passed to a supplier will ignore searching macros for the levels
- * higher than the current supplier level, will query only the lower-precedence suppliers
- * for the current level and will query all suppliers for the lower levels.
- * This is done to avoid infinite loops that could be caused if the supplier calls the provider
+ * The provider passed to a supplier will ignore searching macros for the levels
+ * higher than the current supplier level, will query only the lower-precedence suppliers
+ * for the current level and will query all suppliers for the lower levels.
+ * This is done to avoid infinite loops that could be caused if the supplier calls the provider
* and the provider in turn calls that supplier again. Also the supplier should not know anything
* about the build macros defined for the higher levels.
- * @return the reference to the IBuildMacro interface representing
+ * @return the reference to the IBuildMacro interface representing
* the build macro of a given name or null if the macro of that name is not defined
*/
- IBuildMacro getMacro(String macroName,
- IManagedProject project,
- IBuildMacroProvider provider);
-
+ IBuildMacro getMacro(String macroName, IManagedProject project, IBuildMacroProvider provider);
+
/**
*
* @param project the instance of the managed project
@@ -51,14 +49,13 @@ public interface IProjectBuildMacroSupplier {
* build macros from within the supplier. The supplier should use this provider to obtain
* the already defined build macros instead of using the "default" provider returned by the
* ManagedBuildManager.getBuildMacroProvider().
- * The provider passed to a supplier will ignore searching macros for the levels
- * higher than the current supplier level, will query only the lower-precedence suppliers
- * for the current level and will query all suppliers for the lower levels.
- * This is done to avoid infinite loops that could be caused if the supplier calls the provider
+ * The provider passed to a supplier will ignore searching macros for the levels
+ * higher than the current supplier level, will query only the lower-precedence suppliers
+ * for the current level and will query all suppliers for the lower levels.
+ * This is done to avoid infinite loops that could be caused if the supplier calls the provider
* and the provider in turn calls that supplier again. Also the supplier should not know anything
* about the build macros defined for the higher levels.
- * @return the IBuildMacro[] array representing defined macros
+ * @return the IBuildMacro[] array representing defined macros
*/
- IBuildMacro[] getMacros(IManagedProject project,
- IBuildMacroProvider provider);
+ IBuildMacro[] getMacros(IManagedProject project, IBuildMacroProvider provider);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IReservedMacroNameSupplier.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IReservedMacroNameSupplier.java
index 76f1d1dcb0a..1d62ba0a93f 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IReservedMacroNameSupplier.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/macros/IReservedMacroNameSupplier.java
@@ -18,14 +18,13 @@ import org.eclipse.cdt.managedbuilder.core.IConfiguration;
/**
* This interface is to be implemented by the tool-integrator to specify to the MBS
* the reserved builder variable names
- *
+ *
* @since 3.0
*/
-public interface IReservedMacroNameSupplier{
+public interface IReservedMacroNameSupplier {
/**
* @return true if the given macro name is reserved by the builder or the makefile generator
*/
boolean isReservedName(String macroName, IConfiguration configuration);
}
-
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedBuilderMakefileGenerator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedBuilderMakefileGenerator.java
index 221e688f7ce..103aecfedd1 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedBuilderMakefileGenerator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedBuilderMakefileGenerator.java
@@ -24,86 +24,85 @@ import org.eclipse.core.runtime.MultiStatus;
/**
* @since 2.0
- *
- * TODO: isGeneratedResource should take an IPath rather than an IResource,
+ *
+ * TODO: isGeneratedResource should take an IPath rather than an IResource,
* because an output file can be generated outside of the project directory.
- * This will require a new interface.
+ * This will require a new interface.
*/
public interface IManagedBuilderMakefileGenerator {
- public final String AT = "@"; //$NON-NLS-1$
- public final String COLON = ":"; //$NON-NLS-1$
+ public final String AT = "@"; //$NON-NLS-1$
+ public final String COLON = ":"; //$NON-NLS-1$
public final int COLS_PER_LINE = 80;
- public final String COMMENT_SYMBOL = "#"; //$NON-NLS-1$
- public final String DOLLAR_SYMBOL = "$"; //$NON-NLS-1$
- public final String DEP_EXT = "d"; //$NON-NLS-1$
- public final String DEPFILE_NAME = "subdir.dep"; //$NON-NLS-1$
- public final String DOT = "."; //$NON-NLS-1$
- public final String DASH = "-"; //$NON-NLS-1$
- public final String ECHO = "echo"; //$NON-NLS-1$
- public final String IN_MACRO = "$<"; //$NON-NLS-1$
- public final String LINEBREAK = "\\\n"; //$NON-NLS-1$
- public final String LOGICAL_AND = "&&"; //$NON-NLS-1$
+ public final String COMMENT_SYMBOL = "#"; //$NON-NLS-1$
+ public final String DOLLAR_SYMBOL = "$"; //$NON-NLS-1$
+ public final String DEP_EXT = "d"; //$NON-NLS-1$
+ public final String DEPFILE_NAME = "subdir.dep"; //$NON-NLS-1$
+ public final String DOT = "."; //$NON-NLS-1$
+ public final String DASH = "-"; //$NON-NLS-1$
+ public final String ECHO = "echo"; //$NON-NLS-1$
+ public final String IN_MACRO = "$<"; //$NON-NLS-1$
+ public final String LINEBREAK = "\\\n"; //$NON-NLS-1$
+ public final String LOGICAL_AND = "&&"; //$NON-NLS-1$
public final String MAKEFILE_DEFS = "makefile.defs"; //$NON-NLS-1$
public final String MAKEFILE_INIT = "makefile.init"; //$NON-NLS-1$
- public final String MAKEFILE_NAME = "makefile"; //$NON-NLS-1$
+ public final String MAKEFILE_NAME = "makefile"; //$NON-NLS-1$
public final String MAKEFILE_TARGETS = "makefile.targets"; //$NON-NLS-1$
- public final String MAKE = "$(MAKE)"; //$NON-NLS-1$
- public final String NO_PRINT_DIR = "--no-print-directory"; //$NON-NLS-1$
+ public final String MAKE = "$(MAKE)"; //$NON-NLS-1$
+ public final String NO_PRINT_DIR = "--no-print-directory"; //$NON-NLS-1$
- public final String MODFILE_NAME = "subdir.mk"; //$NON-NLS-1$
- public final String NEWLINE = System.getProperty("line.separator"); //$NON-NLS-1$
+ public final String MODFILE_NAME = "subdir.mk"; //$NON-NLS-1$
+ public final String NEWLINE = System.getProperty("line.separator"); //$NON-NLS-1$
public final String OBJECTS_MAKFILE = "objects.mk"; //$NON-NLS-1$
- public final String OUT_MACRO = "$@"; //$NON-NLS-1$
- public final String ROOT = ".."; //$NON-NLS-1$
- public final String SEPARATOR = "/"; //$NON-NLS-1$
- public final String SINGLE_QUOTE = "'"; //$NON-NLS-1$
- public final String SRCSFILE_NAME = "sources.mk"; //$NON-NLS-1$
- public final String TAB = "\t"; //$NON-NLS-1$
- public final String WHITESPACE = " "; //$NON-NLS-1$
- public final String WILDCARD = "%"; //$NON-NLS-1$
-
+ public final String OUT_MACRO = "$@"; //$NON-NLS-1$
+ public final String ROOT = ".."; //$NON-NLS-1$
+ public final String SEPARATOR = "/"; //$NON-NLS-1$
+ public final String SINGLE_QUOTE = "'"; //$NON-NLS-1$
+ public final String SRCSFILE_NAME = "sources.mk"; //$NON-NLS-1$
+ public final String TAB = "\t"; //$NON-NLS-1$
+ public final String WHITESPACE = " "; //$NON-NLS-1$
+ public final String WILDCARD = "%"; //$NON-NLS-1$
+
// Generation error codes
public static final int SPACES_IN_PATH = 0;
public static final int NO_SOURCE_FOLDERS = 1;
-
public void generateDependencies() throws CoreException;
/**
* Clients call this method when an incremental rebuild is required. The argument
- * contains a set of resource deltas that will be used to determine which
- * subdirectories need a new makefile and dependency list (if any).
+ * contains a set of resource deltas that will be used to determine which
+ * subdirectories need a new makefile and dependency list (if any).
*/
- public MultiStatus generateMakefiles(IResourceDelta delta) throws CoreException ;
-
+ public MultiStatus generateMakefiles(IResourceDelta delta) throws CoreException;
+
/**
* Answers the path of the top directory generated for the build
* output, or <code>null</code> if none has been generated.
- *
+ *
* @return <code>IPath</code> to the working directory of the build
*/
public IPath getBuildWorkingDir();
/**
* Answers the name of the top-level makefile generated by the receiver.
- *
+ *
* @return name of the makefile.
*/
public String getMakefileName();
-
+
/**
* This method initializes the makefile generator
*/
- public void initialize(IProject project, IManagedBuildInfo info, IProgressMonitor monitor);
+ public void initialize(IProject project, IManagedBuildInfo info, IProgressMonitor monitor);
/**
* Answers <code>true</code> if the argument is a resource created by the generator
*/
public boolean isGeneratedResource(IResource resource);
-
+
public void regenerateDependencies(boolean force) throws CoreException;
-
+
public MultiStatus regenerateMakefiles() throws CoreException;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedBuilderMakefileGenerator2.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedBuilderMakefileGenerator2.java
index bddfc16bc0f..c4b16033a13 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedBuilderMakefileGenerator2.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedBuilderMakefileGenerator2.java
@@ -17,9 +17,8 @@ import org.eclipse.cdt.managedbuilder.core.IBuilder;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.core.runtime.IProgressMonitor;
-public interface IManagedBuilderMakefileGenerator2 extends
- IManagedBuilderMakefileGenerator {
+public interface IManagedBuilderMakefileGenerator2 extends IManagedBuilderMakefileGenerator {
- public void initialize(int buildKind, IConfiguration cfg, IBuilder builder, IProgressMonitor monitor);
+ public void initialize(int buildKind, IConfiguration cfg, IBuilder builder, IProgressMonitor monitor);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyCalculator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyCalculator.java
index a0c7a61578f..e010eb83a4a 100755
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyCalculator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyCalculator.java
@@ -22,61 +22,61 @@ import org.eclipse.core.runtime.IPath;
* IManagedDependencyCommands or IManagedDependencyPreBuild.
* An object implementing the interface is returned from a call to
* IManagedDependencyGenerator2.getDependencySourceInfo.
- *
+ *
* Discussion of Dependency Calculation:
- *
- * There are two major, and multiple minor, modes of dependency calculation
+ *
+ * There are two major, and multiple minor, modes of dependency calculation
* supported by the MBS. The major modes are:
- *
- * 1. The build file generator invokes tool integrator provided methods
+ *
+ * 1. The build file generator invokes tool integrator provided methods
* that calculate all dependencies using whatever method the tool
* integrator wants. The build file generator then adds the dependencies
- * to the build file using the appropriate build file syntax.
+ * to the build file using the appropriate build file syntax.
* This type of dependency calculator implements the
* IManagedDependencyCalculator interface defined in this module.
- *
+ *
* One minor mode of this mode is to use a dependency calculator provided
- * by a language integration (e.g. C, C++ or Fortran) that uses the
- * language's parsing support to return information regarding source file
+ * by a language integration (e.g. C, C++ or Fortran) that uses the
+ * language's parsing support to return information regarding source file
* dependencies. An example of this is using the C/C++ Indexer to
* compute dependencies.
- *
- * 2. The build file generator and the tool-chain cooperate in creating and
+ *
+ * 2. The build file generator and the tool-chain cooperate in creating and
* using separate "dependency" files. In this case, dependency calculation
* is done at "build time", rather than at "build file generation time" as
- * in mode #1. This currently supports the GNU concept of using .d files
+ * in mode #1. This currently supports the GNU concept of using .d files
* in GNU make. See the IManagedDependencyCommands and
* IManagedDependencyPreBuild interfaces for more information.
- *
+ *
*/
public interface IManagedDependencyCalculator extends IManagedDependencyInfo {
-
+
/**
* Returns the list of source file specific dependencies.
- *
- * The paths can be either relative to the project directory, or absolute
+ *
+ * The paths can be either relative to the project directory, or absolute
* in the file system.
*
- * @return IPath[]
+ * @return IPath[]
*/
public IPath[] getDependencies();
-
+
/**
- * Returns the list of source file specific additional targets that the
- * source file creates. Most source files will return null. An example
- * of where additional targets should be returned is for a Fortran 90
+ * Returns the list of source file specific additional targets that the
+ * source file creates. Most source files will return null. An example
+ * of where additional targets should be returned is for a Fortran 90
* source file that creates one or more Fortran Modules.
- *
+ *
* Note that these output files that are dependencies to other invocations
- * of the same tool can be specified here, or as another output type
+ * of the same tool can be specified here, or as another output type
* of the tool. If the output file can be used as the input of a different
* tool, then use the output type mechanism.
- *
- * The paths can be either relative to the top build directory, or absolute
+ *
+ * The paths can be either relative to the top build directory, or absolute
* in the file system.
- *
- * @return IPath[]
+ *
+ * @return IPath[]
*/
public IPath[] getAdditionalTargets();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyCommands.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyCommands.java
index c3b0fb191aa..fbdfe425477 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyCommands.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyCommands.java
@@ -22,61 +22,61 @@ import org.eclipse.core.runtime.IPath;
* IManagedDependencyCalculator or IManagedDependencyPreBuild.
* An object implementing the interface is returned from a call to
* IManagedDependencyGenerator2.getDependencySourceInfo.
- *
+ *
* Discussion of Dependency Calculation:
- *
- * There are two major, and multiple minor, modes of dependency calculation
+ *
+ * There are two major, and multiple minor, modes of dependency calculation
* supported by the MBS. The major modes are:
- *
- * 1. The build file generator invokes tool integrator provided methods
+ *
+ * 1. The build file generator invokes tool integrator provided methods
* that calculate all dependencies using whatever method the tool
* integrator wants. The build file generator then adds the dependencies
- * to the build file using the appropriate build file syntax.
+ * to the build file using the appropriate build file syntax.
* See the IManagedDependencyCalculator interface for more information.
*
- * 2. The build file generator and the tool-chain cooperate in creating and
+ * 2. The build file generator and the tool-chain cooperate in creating and
* using separate "dependency" files. The build file generator calls
* the dependency calculator to get the dependency file names and to get
- * commands that need to be added to the build file. In this case,
- * dependency calculation is done at "build time", rather than at
- * "build file generation time" as in mode #1. This currently
+ * commands that need to be added to the build file. In this case,
+ * dependency calculation is done at "build time", rather than at
+ * "build file generation time" as in mode #1. This currently
* supports the GNU concept of using .d files in GNU make.
- *
+ *
* There are multiple ways that these separate dependency files can
- * be created by the tool-chain and used by the builder.
- *
+ * be created by the tool-chain and used by the builder.
+ *
* a. In some cases (e.g., Fortran 90 using modules) the dependency files
- * must be created/updated prior to invoking the build of the project
- * artifact (e.g., an application). In this case, the dependency
+ * must be created/updated prior to invoking the build of the project
+ * artifact (e.g., an application). In this case, the dependency
* generation step must occur separately before the main build.
* See the IManagedDependencyPreBuild interface for more information.
- *
+ *
* b. In other cases (e.g., C/C++) the dependency files can be created as
- * a side effect of the main build. This implies that the up to date
- * dependency files are not required for the current build, but for
- * the next build. C/C++ builds can be treated in this manner as is
- * described in the following link:
+ * a side effect of the main build. This implies that the up to date
+ * dependency files are not required for the current build, but for
+ * the next build. C/C++ builds can be treated in this manner as is
+ * described in the following link:
* http://www.gnu.org/software/automake/manual/html_node/Dependency-Tracking-Evolution.html#Dependency-Tracking-Evolution
*
- * Use the IManagedDependencyCommands interface defined in this file
+ * Use the IManagedDependencyCommands interface defined in this file
* for this mode.
- *
+ *
* Two sub-scenarios of this mode are to:
- *
- * Create dependency files in the same invocation of the tool that
- * creates the tool's build artifact - by adding additional options
+ *
+ * Create dependency files in the same invocation of the tool that
+ * creates the tool's build artifact - by adding additional options
* to the tool invocation command line.
- *
+ *
* Create dependency files in a separate invocation of the tool, or
* by the invocation of another tool.
- *
+ *
* MBS can also help in the generation of the dependency files. Prior to
* CDT 3.1, MBS and gcc cooperated in generating dependency files using the
* following steps:
- *
- * 1. Gcc is invoked to perform the compilation that generates the object
+ *
+ * 1. Gcc is invoked to perform the compilation that generates the object
* file.
- *
+ *
* 2. An "echo" command creates the .d file, adding the name of the .d
* file to the beginning of the newly created .d file. Note that this
* causes problems with some implementations of "echo" that don't
@@ -84,87 +84,87 @@ import org.eclipse.core.runtime.IPath;
* switch).
* 3. Gcc is invoked again with the appropriate additional command line
- * options to append its dependency file information to the .d file
+ * options to append its dependency file information to the .d file
* that was created by "echo".
- *
+ *
* 4. Steps 1 - 3 are invoked in the make file. Step 4 occurs after the
- * make invocation has finished. In step 4, MBS code post-processes
- * the .d files to add a dummy dependency for each header file, for
+ * make invocation has finished. In step 4, MBS code post-processes
+ * the .d files to add a dummy dependency for each header file, for
* the reason explained in the link above.
- *
- * This mode is no longer used by the default gcc implementation, but can
- * still be used by selecting the DefaultGCCDependencyCalculator.
- *
- *
+ *
+ * This mode is no longer used by the default gcc implementation, but can
+ * still be used by selecting the DefaultGCCDependencyCalculator.
+ *
+ *
* Note for GNU make: these separate dependency files are "include"d by
- * a main makefile. Therefore, if the dependency files are required to
+ * a main makefile. Therefore, if the dependency files are required to
* be up to date before the main build begins, they must be updated by
* a separate invocation of make. Also, the configuration "clean" step
* must be invoked by a separate invocation of make. This is so that
- * we can exclude the dependency files for a "make clean" invocation
+ * we can exclude the dependency files for a "make clean" invocation
* using syntax like:
- *
+ *
* ifneq ($(MAKECMDGOALS), clean)
* -include $(DEPS)
* endif
- *
+ *
* Otherwise, because GNU make attempts to re-make make files, we
- * can end up with out of date or missing dependency files being
+ * can end up with out of date or missing dependency files being
* re-generated and then immediately "clean"ed.
*/
public interface IManagedDependencyCommands extends IManagedDependencyInfo {
-
+
/**
* Returns the list of generated dependency files.
- *
- * The paths can be either relative to the top build directory, or absolute
+ *
+ * The paths can be either relative to the top build directory, or absolute
* in the file system.
*
- * @return IPath[]
+ * @return IPath[]
*/
public IPath[] getDependencyFiles();
/**
- * Returns the command lines to be invoked before the normal tool invocation
+ * Returns the command lines to be invoked before the normal tool invocation
* to calculate dependencies.
- *
- * @return String[] This can be null or an empty array if no dependency
- * generation command needs to be invoked before the normal
+ *
+ * @return String[] This can be null or an empty array if no dependency
+ * generation command needs to be invoked before the normal
* tool invocation.
*/
public String[] getPreToolDependencyCommands();
-
+
/**
* Returns the command line options to be used to calculate dependencies.
- * The options are added to the normal tool invocation.
- *
- * @return String[] This can be null or an empty array if no additional
+ * The options are added to the normal tool invocation.
+ *
+ * @return String[] This can be null or an empty array if no additional
* arguments need to be added to the tool invocation.
* SHOULD THIS RETURN AN IOption[]?
*/
public String[] getDependencyCommandOptions();
// IMPLEMENTATION NOTE: This should be called from addRuleFromSource for both resconfig & non-resconfig
-
+
/**
- * Returns the command lines to be invoked after the normal tool invocation
- * to calculate dependencies.
- *
- * @return String[] This can be null or an empty array if no dependency
- * generation commands needs to be invoked after the normal
+ * Returns the command lines to be invoked after the normal tool invocation
+ * to calculate dependencies.
+ *
+ * @return String[] This can be null or an empty array if no dependency
+ * generation commands needs to be invoked after the normal
* tool invocation
*/
public String[] getPostToolDependencyCommands();
-
+
/**
* Returns true if the command lines and/or options returned by this interface
* are not specific to the particular source file, but are only specific to,
- * at most, the configuration and tool. If the build context is a resource
- * configuration, this method should return false if any of the command lines
- * and/or options are different than if the build context were the parent
+ * at most, the configuration and tool. If the build context is a resource
+ * configuration, this method should return false if any of the command lines
+ * and/or options are different than if the build context were the parent
* configuration. This can be used by the build file generator in helping
* to determine if a "pattern" (generic) rule can be used.
- *
+ *
* @return boolean
*/
public boolean areCommandsGeneric();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyGenerator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyGenerator.java
index d4823c1b9cc..84726d235bc 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyGenerator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyGenerator.java
@@ -20,12 +20,13 @@ import org.eclipse.core.resources.IResource;
/**
* @since 2.0
* @deprecated 3.1
- *
+ *
* Use IManagedDependencyGenerator2 instead.
*/
@Deprecated
public interface IManagedDependencyGenerator extends IManagedDependencyGeneratorType {
-
+
public IResource[] findDependencies(IResource resource, IProject project);
+
public String getDependencyCommand(IResource resource, IManagedBuildInfo info);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyGenerator2.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyGenerator2.java
index baa96e79891..ed384967cbb 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyGenerator2.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyGenerator2.java
@@ -25,120 +25,108 @@ import org.eclipse.cdt.managedbuilder.core.ITool;
*
* A Tool dependency calculator must implement this interface. This interface
* replaces IManagedDependencyGenerator which is deprecated.
- *
+ *
* Discussion of Dependency Calculation:
*
- * There are two major, and multiple minor, modes of dependency calculation
+ * There are two major, and multiple minor, modes of dependency calculation
* supported by the MBS. The major modes are:
- *
- * 1. The build file generator invokes tool integrator provided methods
+ *
+ * 1. The build file generator invokes tool integrator provided methods
* that calculate all dependencies using whatever method the tool
* integrator wants. The build file generator then adds the dependencies
* to the build file using the appropriate build file syntax.
- * This is a TYPE_CUSTOM dependency calculator as defined below.
+ * This is a TYPE_CUSTOM dependency calculator as defined below.
* See the IManagedDependencyCalculator interface for more information.
- *
- * 2. The build file generator and the tool-chain cooperate in creating and
+ *
+ * 2. The build file generator and the tool-chain cooperate in creating and
* using separate "dependency" files. In this case, dependency calculation
* is done at "build time", rather than at "build file generation time" as
- * in mode #1. This currently supports the GNU concept of using .d files
- * in GNU make.
- * This is either a TYPE_BUILD_COMMANDS dependency calculator or a
- * TYPE_PREBUILD_COMMANDS dependency calculator as defined below.
- * See the IManagedDependencyCommands and IManagedDependencyPreBuild
+ * in mode #1. This currently supports the GNU concept of using .d files
+ * in GNU make.
+ * This is either a TYPE_BUILD_COMMANDS dependency calculator or a
+ * TYPE_PREBUILD_COMMANDS dependency calculator as defined below.
+ * See the IManagedDependencyCommands and IManagedDependencyPreBuild
* interfaces for more information.
- *
+ *
*/
public interface IManagedDependencyGenerator2 extends IManagedDependencyGeneratorType {
-
+
/**
* Returns an instance of IManagedDependencyInfo for this source file.
* IManagedDependencyCalculator, IManagedDependencyCommands
* and IManagedDependencyPreBuild are all derived from
* IManagedDependencyInfo, and any one of the three can be returned.
- * This is called when getCalculatorType returns TYPE_BUILD_COMMANDS,
+ * This is called when getCalculatorType returns TYPE_BUILD_COMMANDS,
* TYPE_CUSTOM or TYPE_PREBUILD_COMMANDS.
- *
- * @param source The source file for which dependencies should be calculated
- * The IPath can be either relative to the project directory, or absolute in the file system.
- * @param resource The IResource corresponding to the source file, or null if the file
- * is not a workspace resource.
- * @param buildContext The IConfiguration or IResourceConfiguration that
- * contains the context in which the source file will be built
- * @param tool The tool associated with the source file
- * @param topBuildDirectory The top build directory of the configuration. This is
- * the working directory for the tool. This IPath is relative to the project directory.
- * @return IManagedDependencyInfo
+ *
+ * @param source The source file for which dependencies should be calculated
+ * The IPath can be either relative to the project directory, or absolute in the file system.
+ * @param resource The IResource corresponding to the source file, or null if the file
+ * is not a workspace resource.
+ * @param buildContext The IConfiguration or IResourceConfiguration that
+ * contains the context in which the source file will be built
+ * @param tool The tool associated with the source file
+ * @param topBuildDirectory The top build directory of the configuration. This is
+ * the working directory for the tool. This IPath is relative to the project directory.
+ * @return IManagedDependencyInfo
*/
- public IManagedDependencyInfo getDependencySourceInfo(
- IPath source,
- IResource resource,
- IBuildObject buildContext,
- ITool tool,
- IPath topBuildDirectory);
-
+ public IManagedDependencyInfo getDependencySourceInfo(IPath source, IResource resource, IBuildObject buildContext,
+ ITool tool, IPath topBuildDirectory);
+
/**
* Returns an instance of IManagedDependencyInfo for this source file.
* IManagedDependencyCalculator, IManagedDependencyCommands
* and IManagedDependencyPreBuild are all derived from
* IManagedDependencyInfo, and any one of the three can be returned.
- * This is called when getCalculatorType returns TYPE_BUILD_COMMANDS,
+ * This is called when getCalculatorType returns TYPE_BUILD_COMMANDS,
* TYPE_CUSTOM or TYPE_PREBUILD_COMMANDS.
- *
- * @param source The source file for which dependencies should be calculated
- * The IPath can be either relative to the project directory, or absolute in the file system.
- * @param buildContext The IConfiguration or IResourceConfiguration that
- * contains the context in which the source file will be built
- * @param tool The tool associated with the source file
- * @param topBuildDirectory The top build directory of the configuration. This is
- * the working directory for the tool. This IPath is relative to the project directory.
- * @return IManagedDependencyInfo
+ *
+ * @param source The source file for which dependencies should be calculated
+ * The IPath can be either relative to the project directory, or absolute in the file system.
+ * @param buildContext The IConfiguration or IResourceConfiguration that
+ * contains the context in which the source file will be built
+ * @param tool The tool associated with the source file
+ * @param topBuildDirectory The top build directory of the configuration. This is
+ * the working directory for the tool. This IPath is relative to the project directory.
+ * @return IManagedDependencyInfo
*/
- public IManagedDependencyInfo getDependencySourceInfo(
- IPath source,
- IBuildObject buildContext,
- ITool tool,
- IPath topBuildDirectory);
+ public IManagedDependencyInfo getDependencySourceInfo(IPath source, IBuildObject buildContext, ITool tool,
+ IPath topBuildDirectory);
/**
* Returns the file extension used by dependency files created
* by this dependency generator.
- * This is called when getCalculatorType returns TYPE_BUILD_COMMANDS or
+ * This is called when getCalculatorType returns TYPE_BUILD_COMMANDS or
* TYPE_PREBUILD_COMMANDS.
- *
- * @param buildContext The IConfiguration that contains the context of the build
- * @param tool The tool associated with the dependency generator.
- *
+ *
+ * @param buildContext The IConfiguration that contains the context of the build
+ * @param tool The tool associated with the dependency generator.
+ *
* @return String
*/
- public String getDependencyFileExtension(
- IConfiguration buildContext,
- ITool tool);
+ public String getDependencyFileExtension(IConfiguration buildContext, ITool tool);
/**
* Called to allow the dependency calculator to post-process dependency files.
- * This method is called after the build has completed for at least every
+ * This method is called after the build has completed for at least every
* dependency file that has changed, and possibly for those that have not
* changed as well. It may also be called with dependency files created by
* another tool. This method should be able to recognize dependency files
* that don't belong to it, or that it has already post-processed.
- * This is called when getCalculatorType returns TYPE_BUILD_COMMANDS or
+ * This is called when getCalculatorType returns TYPE_BUILD_COMMANDS or
* TYPE_PREBUILD_COMMANDS.
- *
- * @param dependencyFile The dependency file
- * The IPath can be either relative to the top build directory, or absolute in the file system.
- * @param buildContext The IConfiguration that contains the context of the build
- * @param tool The tool associated with the dependency generator. Note that this is
- * not necessarily the tool that created the dependency file
- * @param topBuildDirectory The top build directory of the project. This is
- * the working directory for the tool.
- *
+ *
+ * @param dependencyFile The dependency file
+ * The IPath can be either relative to the top build directory, or absolute in the file system.
+ * @param buildContext The IConfiguration that contains the context of the build
+ * @param tool The tool associated with the dependency generator. Note that this is
+ * not necessarily the tool that created the dependency file
+ * @param topBuildDirectory The top build directory of the project. This is
+ * the working directory for the tool.
+ *
* @return boolean True if the method modified the dependency (e.g., .d) file
*/
- public boolean postProcessDependencyFile(
- IPath dependencyFile,
- IConfiguration buildContext,
- ITool tool,
- IPath topBuildDirectory);
+ public boolean postProcessDependencyFile(IPath dependencyFile, IConfiguration buildContext, ITool tool,
+ IPath topBuildDirectory);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyGeneratorType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyGeneratorType.java
index 6e57c5c6408..6a480e56fac 100755
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyGeneratorType.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyGeneratorType.java
@@ -15,75 +15,75 @@ package org.eclipse.cdt.managedbuilder.makegen;
/**
* @since 3.1
- *
- * IManagedDependencyGenerator (deprecated) and IManagedDependencyGenerator2
- * extend this interface.
- *
+ *
+ * IManagedDependencyGenerator (deprecated) and IManagedDependencyGenerator2
+ * extend this interface.
+ *
* Discussion of Dependency Calculation:
*
- * There are two major, and multiple minor, modes of dependency calculation
+ * There are two major, and multiple minor, modes of dependency calculation
* supported by the MBS. The major modes are:
- *
- * 1. The build file generator invokes tool integrator provided methods
+ *
+ * 1. The build file generator invokes tool integrator provided methods
* that calculate all dependencies using whatever method the tool
* integrator wants. The build file generator then adds the dependencies
* to the build file using the appropriate build file syntax.
- * This is a TYPE_CUSTOM dependency calculator as defined below.
+ * This is a TYPE_CUSTOM dependency calculator as defined below.
* See the IManagedDependencyCalculator interface for more information.
- *
- * 2. The build file generator and the tool-chain cooperate in creating and
+ *
+ * 2. The build file generator and the tool-chain cooperate in creating and
* using separate "dependency" files. In this case, dependency calculation
* is done at "build time", rather than at "build file generation time" as
- * in mode #1. This currently supports the GNU concept of using .d files
- * in GNU make.
- * This is either a TYPE_BUILD_COMMANDS dependency calculator or a
- * TYPE_PREBUILD_COMMANDS dependency calculator as defined below.
- * See the IManagedDependencyCommands and IManagedDependencyPreBuild
+ * in mode #1. This currently supports the GNU concept of using .d files
+ * in GNU make.
+ * This is either a TYPE_BUILD_COMMANDS dependency calculator or a
+ * TYPE_PREBUILD_COMMANDS dependency calculator as defined below.
+ * See the IManagedDependencyCommands and IManagedDependencyPreBuild
* interfaces for more information.
- *
+ *
*/
public interface IManagedDependencyGeneratorType {
/**
* Constants returned by getCalculatorType
*/
- public int TYPE_NODEPS = 0; // Deprecated - use TYPE_NODEPENDENCIES
- public int TYPE_COMMAND = 1; // Deprecated - use TYPE_BUILD_COMMANDS
- public int TYPE_INDEXER = 2; // Deprecated - use TYPE_CUSTOM
- public int TYPE_EXTERNAL = 3; // Deprecated - use TYPE_CUSTOM
+ public int TYPE_NODEPS = 0; // Deprecated - use TYPE_NODEPENDENCIES
+ public int TYPE_COMMAND = 1; // Deprecated - use TYPE_BUILD_COMMANDS
+ public int TYPE_INDEXER = 2; // Deprecated - use TYPE_CUSTOM
+ public int TYPE_EXTERNAL = 3; // Deprecated - use TYPE_CUSTOM
public int TYPE_OLD_TYPE_LIMIT = 3;
-
+
// Use these types
public int TYPE_NODEPENDENCIES = 4;
public int TYPE_BUILD_COMMANDS = 5;
public int TYPE_PREBUILD_COMMANDS = 6;
public int TYPE_CUSTOM = 7;
-
+
/**
- * Returns the type of dependency generator that is implemented.
- *
- * TYPE_NODEPENDENCIES indicates that no dependency generator is
+ * Returns the type of dependency generator that is implemented.
+ *
+ * TYPE_NODEPENDENCIES indicates that no dependency generator is
* supplied or needed.
* TYPE_CUSTOM indicates that a custom, "build file generation time"
* dependency calculator is implemented. Note that the dependency
- * calculator will be called when the makefile is generated, and
- * for every source file that is built by this tool in the build
+ * calculator will be called when the makefile is generated, and
+ * for every source file that is built by this tool in the build
* file, not just for those that have changed since the last build
* file generation.
- * TYPE_BUILD_COMMANDS indicates that command lines or options will
- * be returned to be used to calculate dependencies. These
+ * TYPE_BUILD_COMMANDS indicates that command lines or options will
+ * be returned to be used to calculate dependencies. These
* commands/options are added to the build file to perform dependency
- * calculation at "build time". This currently supports
+ * calculation at "build time". This currently supports
* compilers/tools that generate .d files either as a
* side-effect of tool invocation, or as a separate step that is
- * invoked immediately before or after the tool invocation.
- * TYPE_PREBUILD_COMMANDS indicates that a separate build step is
- * invoked, prior to the the normal build steps, to update the
+ * invoked immediately before or after the tool invocation.
+ * TYPE_PREBUILD_COMMANDS indicates that a separate build step is
+ * invoked, prior to the the normal build steps, to update the
* dependency information. These commands are added to the build
- * file to perform dependency calculation at "build time". Note
- * that this step will be invoked every time a build is done in
+ * file to perform dependency calculation at "build time". Note
+ * that this step will be invoked every time a build is done in
* order to determine if dependency files need to be re-generated.
- *
+ *
* @return int
*/
public int getCalculatorType();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyInfo.java
index 8f4fbf5062a..7dbd7464ff4 100755
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyInfo.java
@@ -19,12 +19,12 @@ import org.eclipse.core.runtime.IPath;
/**
* @since 3.1
- *
- * This interface is the base interface for IManagedDependencyCalculator,
+ *
+ * This interface is the base interface for IManagedDependencyCalculator,
* IManagedDependencyCommands and IManagedDependencyPreBuild. See these
* interfaces and IManagedDependencyGenerator2 for more information on
* writing a dependency calculator.
- *
+ *
* The methods below simply return the arguments passed to the
* IManagedDependencyGenerator2.getDependency*Info call that created the
* IManagedDependencyInfo instance.
@@ -32,7 +32,10 @@ import org.eclipse.core.runtime.IPath;
*/
public interface IManagedDependencyInfo {
public IPath getSource();
+
public IBuildObject getBuildContext();
+
public ITool getTool();
+
public IPath getTopBuildDirectory();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyPreBuild.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyPreBuild.java
index dae9c71e7ff..a8d0c5eccec 100755
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyPreBuild.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyPreBuild.java
@@ -22,87 +22,87 @@ import org.eclipse.core.runtime.IPath;
* IManagedDependencyCalculator or IManagedDependencyCommands.
* An object implementing the interface is returned from a call to
* IManagedDependencyGenerator2.getDependencySourceInfo.
- *
+ *
* Discussion of Dependency Calculation:
- *
- * There are two major, and multiple minor, modes of dependency calculation
+ *
+ * There are two major, and multiple minor, modes of dependency calculation
* supported by the MBS. The major modes are:
- *
- * 1. The build file generator invokes tool integrator provided methods
+ *
+ * 1. The build file generator invokes tool integrator provided methods
* that calculate all dependencies using whatever method the tool
* integrator wants. The build file generator then adds the dependencies
- * to the build file using the appropriate build file syntax.
+ * to the build file using the appropriate build file syntax.
* See the IManagedDependencyCalculator interface for more information.
- *
- * 2. The build file generator and the tool-chain cooperate in creating and
+ *
+ * 2. The build file generator and the tool-chain cooperate in creating and
* using separate "dependency" files. The build file generator calls
* the dependency calculator to get the dependency file names and to get
- * commands that need to be added to the build file. In this case,
- * dependency calculation is done at "build time", rather than at
- * "build file generation time" as in mode #1. This currently
+ * commands that need to be added to the build file. In this case,
+ * dependency calculation is done at "build time", rather than at
+ * "build file generation time" as in mode #1. This currently
* supports the GNU concept of using .d files in GNU make.
- *
+ *
* There are multiple ways that these separate dependency files can
- * be created by the tool-chain and used by the builder.
- *
+ * be created by the tool-chain and used by the builder.
+ *
* a. In some cases (e.g., Fortran 90 using modules) the dependency files
- * must be created/updated prior to invoking the build of the project
- * artifact (e.g., an application). In this case, the dependency
+ * must be created/updated prior to invoking the build of the project
+ * artifact (e.g., an application). In this case, the dependency
* generation step must occur separately before the main build.
- * Use the IManagedDependencyPreBuild interface defined in this file
+ * Use the IManagedDependencyPreBuild interface defined in this file
* for this mode.
- *
+ *
* b. In other cases (e.g., C/C++) the dependency files can be created as
- * a side effect of the main build. This implies that the up to date
- * dependency files are not required for the current build, but for
- * the next build. C/C++ builds can be treated in this manner as is
- * described in the following link:
+ * a side effect of the main build. This implies that the up to date
+ * dependency files are not required for the current build, but for
+ * the next build. C/C++ builds can be treated in this manner as is
+ * described in the following link:
* http://sourceware.org/automake/automake.html#Dependency-Tracking-Evolution
- *
+ *
* See the IManagedDependencyCommands interface for more information.
*
- *
+ *
* Note for GNU make: these separate dependency files are "include"d by
* a main makefile. Make performs special processing on make files:
- *
- * "To this end, after reading in all makefiles, make will consider
+ *
+ * "To this end, after reading in all makefiles, make will consider
* each as a goal target and attempt to update it. If a makefile has a
- * rule which says how to update it (found either in that very
- * makefile or in another one)..., it will be updated if necessary.
- * After all makefiles have been checked, if any have actually been
- * changed, make starts with a clean slate and reads all the makefiles
+ * rule which says how to update it (found either in that very
+ * makefile or in another one)..., it will be updated if necessary.
+ * After all makefiles have been checked, if any have actually been
+ * changed, make starts with a clean slate and reads all the makefiles
* over again."
- *
+ *
* We can use this to ensure that the dependency files are up to date
* by adding rules to the make file for generating the dependency files.
* These rules are returned by the call to getDependencyCommands.
* However, this has a significant problem when we don't want to build
- * the build target, but only want to "clean" the configuration,
- * for example. If we invoke make just to clean the configuration,
- * make will still update the dependency files if necessary, thereby
+ * the build target, but only want to "clean" the configuration,
+ * for example. If we invoke make just to clean the configuration,
+ * make will still update the dependency files if necessary, thereby
* re-generating the dependency files only to immediately delete them.
- * The workaround suggested by the make documentation is to check for
- * an invocation using the "clean" target, and to not include the
+ * The workaround suggested by the make documentation is to check for
+ * an invocation using the "clean" target, and to not include the
* dependency files it that case. For example,
- *
+ *
* ifneq ($(MAKECMDGOALS),clean)
* include $(DEPS)
* endif
- *
- * The restriction with this is that it only works if "clean" is the only
- * target specified on the make command line. Therefore, the build
+ *
+ * The restriction with this is that it only works if "clean" is the only
+ * target specified on the make command line. Therefore, the build
* "clean" step must be invoked separately.
*/
public interface IManagedDependencyPreBuild extends IManagedDependencyInfo {
-
+
/**
* Returns the list of generated dependency files.
- *
- * The paths can be either relative to the top build directory, or absolute
+ *
+ * The paths can be either relative to the top build directory, or absolute
* in the file system.
*
- * @return IPath[]
+ * @return IPath[]
*/
public IPath[] getDependencyFiles();
@@ -111,28 +111,28 @@ public interface IManagedDependencyPreBuild extends IManagedDependencyInfo {
* build step. Note that this name should be unique to the tool since
* multiple tools in a tool-chain may be using this method of
* dependency calculation.
- *
- * @return String
+ *
+ * @return String
*/
public String getBuildStepName();
/**
- * Returns the command line(s) to be invoked in the separate
+ * Returns the command line(s) to be invoked in the separate
* dependencies pre-build step.
- *
+ *
* @return String[]
*/
public String[] getDependencyCommands();
-
+
/**
* Returns true if the command lines returned by this interface
* are not specific to the particular source file, but are only specific to,
- * at most, the configuration and tool. If the build context is a resource
- * configuration, this method should return false if any of the command lines
- * are different than if the build context were the parent configuration.
- * This can be used by the build file generator in helping to determine if
+ * at most, the configuration and tool. If the build context is a resource
+ * configuration, this method should return false if any of the command lines
+ * are different than if the build context were the parent configuration.
+ * This can be used by the build file generator in helping to determine if
* a "pattern" (generic) rule can be used.
- *
+ *
* @return boolean
*/
public boolean areCommandsGeneric();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator.java
index cd792825eef..0ce05fd7bb0 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator.java
@@ -39,7 +39,7 @@ import org.eclipse.core.resources.IResource;
public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerator {
private static final String[] EMPTY_STRING_ARRAY = new String[0];
- public final String WHITESPACE = " "; //$NON-NLS-1$
+ public final String WHITESPACE = " "; //$NON-NLS-1$
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderDependencyCalculator#findDependencies(org.eclipse.core.resources.IResource)
@@ -75,7 +75,8 @@ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerat
// We need to check whether we have any resource specific build information.
IResourceConfiguration resConfig = null;
- if( config != null ) resConfig = config.getResourceConfiguration(resource.getFullPath().toString());
+ if (config != null)
+ resConfig = config.getResourceConfiguration(resource.getFullPath().toString());
String inputExtension = resource.getFileExtension();
String outputExtension = info.getOutputExtension(inputExtension);
@@ -87,45 +88,37 @@ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerat
relativePath += resourceLocation.getProjectRelativePath().toString();
}
if (relativePath.length() > 0) {
- relativePath += IManagedBuilderMakefileGenerator.SEPARATOR;
+ relativePath += IManagedBuilderMakefileGenerator.SEPARATOR;
}
// Calculate the dependency rule
// <path>/$(@:%.<out_ext>=%.d)
String depRule = "'$(@:%." + //$NON-NLS-1$
- outputExtension +
- "=%." + //$NON-NLS-1$
- IManagedBuilderMakefileGenerator.DEP_EXT +
- ")'"; //$NON-NLS-1$
+ outputExtension + "=%." + //$NON-NLS-1$
+ IManagedBuilderMakefileGenerator.DEP_EXT + ")'"; //$NON-NLS-1$
// Note that X + Y are in-lineable constants by the compiler
// Add the rule that will actually create the right format for the dep
- buffer.append(IManagedBuilderMakefileGenerator.TAB
- + IManagedBuilderMakefileGenerator.ECHO
- + IManagedBuilderMakefileGenerator.WHITESPACE
- + "-n" //$NON-NLS-1$
- + IManagedBuilderMakefileGenerator.WHITESPACE)
+ buffer.append(IManagedBuilderMakefileGenerator.TAB + IManagedBuilderMakefileGenerator.ECHO
+ + IManagedBuilderMakefileGenerator.WHITESPACE + "-n" //$NON-NLS-1$
+ + IManagedBuilderMakefileGenerator.WHITESPACE).append(depRule)
+ .append(IManagedBuilderMakefileGenerator.WHITESPACE + "$(dir $@)" //$NON-NLS-1$
+ + IManagedBuilderMakefileGenerator.WHITESPACE + ">"
+ + IManagedBuilderMakefileGenerator.WHITESPACE)
.append(depRule)
- .append(IManagedBuilderMakefileGenerator.WHITESPACE
- + "$(dir $@)" //$NON-NLS-1$
- + IManagedBuilderMakefileGenerator.WHITESPACE
- + ">"
- + IManagedBuilderMakefileGenerator.WHITESPACE)
- .append(depRule)
- .append(IManagedBuilderMakefileGenerator.WHITESPACE
- + IManagedBuilderMakefileGenerator.LOGICAL_AND
- + IManagedBuilderMakefileGenerator.WHITESPACE
- + IManagedBuilderMakefileGenerator.LINEBREAK);
+ .append(IManagedBuilderMakefileGenerator.WHITESPACE + IManagedBuilderMakefileGenerator.LOGICAL_AND
+ + IManagedBuilderMakefileGenerator.WHITESPACE + IManagedBuilderMakefileGenerator.LINEBREAK);
// Add the line that will do the work to calculate dependencies
IManagedCommandLineInfo cmdLInfo = null;
String buildCmd = null;
- String[] inputs= new String[1]; inputs[0] = IManagedBuilderMakefileGenerator.IN_MACRO;
- String outflag = ""; //$NON-NLS-1$
- String outputPrefix = ""; //$NON-NLS-1$
- String outputFile = ""; //$NON-NLS-1$
+ String[] inputs = new String[1];
+ inputs[0] = IManagedBuilderMakefileGenerator.IN_MACRO;
+ String outflag = ""; //$NON-NLS-1$
+ String outputPrefix = ""; //$NON-NLS-1$
+ String outputFile = ""; //$NON-NLS-1$
ITool[] tools;
- if( resConfig != null && (tools = resConfig.getToolsToInvoke()) != null && tools.length > 0) {
+ if (resConfig != null && (tools = resConfig.getToolsToInvoke()) != null && tools.length > 0) {
ITool tool = tools[0];
String cmd = tool.getToolCommand();
//try to resolve the build macros in the tool command
@@ -135,52 +128,42 @@ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerat
// does the resource have spaces in its name?
if (resource.getProjectRelativePath().toString().indexOf(" ") != -1) { //$NON-NLS-1$
// use fully qualified strings
- resolvedCommand = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveValueToMakefileFormat(
- cmd,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(resource.getLocation(),
- null, null, tool));
+ resolvedCommand = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(cmd, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(resource.getLocation(), null, null, tool));
} else {
// use builder variables
- resolvedCommand = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveValueToMakefileFormat(
- cmd,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(resource.getLocation(),
- null, null, tool));
+ resolvedCommand = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(cmd, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(resource.getLocation(), null, null, tool));
}
- if((resolvedCommand = resolvedCommand.trim()).length() > 0)
+ if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
cmd = resolvedCommand;
- } catch (BuildMacroException e){
+ } catch (BuildMacroException e) {
}
String[] toolFlags = null;
try {
- toolFlags = tool.getToolCommandFlags(resource.getLocation(),null);
- } catch( BuildException ex ) {
+ toolFlags = tool.getToolCommandFlags(resource.getLocation(), null);
+ } catch (BuildException ex) {
// TODO add some routines to catch this
toolFlags = EMPTY_STRING_ARRAY;
}
String[] flags = new String[toolFlags.length + 4];
- flags[0] = "-MM"; //$NON-NLS-1$
- flags[1] = "-MG"; //$NON-NLS-1$
- flags[2] = "-P"; //$NON-NLS-1$
- flags[3] = "-w"; //$NON-NLS-1$
- for (int i=0; i<toolFlags.length; i++) {
- flags[4+i] = toolFlags[i];
+ flags[0] = "-MM"; //$NON-NLS-1$
+ flags[1] = "-MG"; //$NON-NLS-1$
+ flags[2] = "-P"; //$NON-NLS-1$
+ flags[3] = "-w"; //$NON-NLS-1$
+ for (int i = 0; i < toolFlags.length; i++) {
+ flags[4 + i] = toolFlags[i];
}
IManagedCommandLineGenerator cmdLGen = tool.getCommandLineGenerator();
- cmdLInfo = cmdLGen.generateCommandLineInfo( tool, cmd, flags, outflag, outputPrefix,
- outputFile, inputs, tool.getCommandLinePattern() );
+ cmdLInfo = cmdLGen.generateCommandLineInfo(tool, cmd, flags, outflag, outputPrefix, outputFile, inputs,
+ tool.getCommandLinePattern());
buildCmd = cmdLInfo.getCommandLine();
// resolve any remaining macros in the command after it has been generated
@@ -190,37 +173,28 @@ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerat
// does the resource have spaces in its name?
if (resource.getProjectRelativePath().toString().indexOf(" ") != -1) { //$NON-NLS-1$
// use fully qualified strings
- resolvedCommand = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveValueToMakefileFormat(
- buildCmd,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(resource.getLocation(),
- null, null, tool));
+ resolvedCommand = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(buildCmd,
+ "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(resource.getLocation(), null, null, tool));
} else {
// use builder variables
- resolvedCommand = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveValueToMakefileFormat(
- buildCmd,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(resource.getLocation(),
- null, null, tool));
+ resolvedCommand = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(buildCmd,
+ "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(resource.getLocation(), null, null, tool));
}
- if((resolvedCommand = resolvedCommand.trim()).length() > 0)
+ if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
buildCmd = resolvedCommand;
- } catch (BuildMacroException e){
+ } catch (BuildMacroException e) {
}
-
} else {
ITool tool = null;
- IFolderInfo foInfo = (IFolderInfo)config.getResourceInfo(resource.getProjectRelativePath(), false);
+ IFolderInfo foInfo = (IFolderInfo) config.getResourceInfo(resource.getProjectRelativePath(), false);
tools = foInfo.getFilteredTools();
for (int index = 0; index < tools.length; index++) {
ITool tmp = tools[index];
@@ -232,75 +206,63 @@ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerat
String cmd = tool != null ? tool.getToolCommand() : null;
//try to resolve the build macros in the tool command
- try{
+ try {
String resolvedCommand = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(cmd,
"", //$NON-NLS-1$
" ", //$NON-NLS-1$
IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(resource.getLocation(),null,null,tool));
- if((resolvedCommand = resolvedCommand.trim()).length() > 0)
+ new FileContextData(resource.getLocation(), null, null, tool));
+ if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
cmd = resolvedCommand;
- } catch (BuildMacroException e){
+ } catch (BuildMacroException e) {
}
- String buildFlags = "-MM -MG -P -w " + info.getToolFlagsForSource(inputExtension, resource.getLocation(), null); //$NON-NLS-1$
- String[] flags = buildFlags.split( "\\s" ); //$NON-NLS-1$
- cmdLInfo = info.generateToolCommandLineInfo( inputExtension, flags, outflag, outputPrefix,
- outputFile, inputs, resource.getLocation(), null);
+ String buildFlags = "-MM -MG -P -w " //$NON-NLS-1$
+ + info.getToolFlagsForSource(inputExtension, resource.getLocation(), null);
+ String[] flags = buildFlags.split("\\s"); //$NON-NLS-1$
+ cmdLInfo = info.generateToolCommandLineInfo(inputExtension, flags, outflag, outputPrefix, outputFile,
+ inputs, resource.getLocation(), null);
// The command to build
- if( cmdLInfo == null ) buildCmd =
- cmd +
- IManagedBuilderMakefileGenerator.WHITESPACE +
- "-MM -MG -P -w " + //$NON-NLS-1$
- buildFlags +
- IManagedBuilderMakefileGenerator.WHITESPACE +
- IManagedBuilderMakefileGenerator.IN_MACRO;
+ if (cmdLInfo == null)
+ buildCmd = cmd + IManagedBuilderMakefileGenerator.WHITESPACE + "-MM -MG -P -w " + //$NON-NLS-1$
+ buildFlags + IManagedBuilderMakefileGenerator.WHITESPACE
+ + IManagedBuilderMakefileGenerator.IN_MACRO;
else {
buildCmd = cmdLInfo.getCommandLine();
}
- // resolve any remaining macros in the command after it has been
- // generated
+ // resolve any remaining macros in the command after it has been
+ // generated
try {
String resolvedCommand = null;
// does the resource have spaces in its name?
if (resource.getProjectRelativePath().toString().indexOf(" ") != -1) { //$NON-NLS-1$
// use fully qualified strings
- resolvedCommand = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveValueToMakefileFormat(
- buildCmd,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(resource.getLocation(),
- null, null, tool));
+ resolvedCommand = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(buildCmd,
+ "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(resource.getLocation(), null, null, tool));
} else {
// use builder variables
- resolvedCommand = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveValueToMakefileFormat(
- buildCmd,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(resource.getLocation(),
- null, null, tool));
+ resolvedCommand = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(buildCmd,
+ "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(resource.getLocation(), null, null, tool));
}
- if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
- buildCmd = resolvedCommand;
+ if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
+ buildCmd = resolvedCommand;
- } catch (BuildMacroException e) {
- }
+ } catch (BuildMacroException e) {
+ }
}
- buffer.append(IManagedBuilderMakefileGenerator.TAB)
- .append(buildCmd)
- .append(IManagedBuilderMakefileGenerator.WHITESPACE
- + ">>" //$NON-NLS-1$
- + IManagedBuilderMakefileGenerator.WHITESPACE)
+ buffer.append(IManagedBuilderMakefileGenerator.TAB).append(buildCmd)
+ .append(IManagedBuilderMakefileGenerator.WHITESPACE + ">>" //$NON-NLS-1$
+ + IManagedBuilderMakefileGenerator.WHITESPACE)
.append(depRule);
return buffer.toString();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator2.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator2.java
index 17bfaceb3c5..f6871e81044 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator2.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator2.java
@@ -37,8 +37,7 @@ import org.eclipse.core.runtime.IPath;
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
-public class DefaultGCCDependencyCalculator2 implements
- IManagedDependencyGenerator2 {
+public class DefaultGCCDependencyCalculator2 implements IManagedDependencyGenerator2 {
/*
* (non-Javadoc)
@@ -63,7 +62,8 @@ public class DefaultGCCDependencyCalculator2 implements
* @see org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator2#getDependencySourceInfo(org.eclipse.core.runtime.IPath, org.eclipse.cdt.managedbuilder.core.IBuildObject, org.eclipse.cdt.managedbuilder.core.ITool, org.eclipse.core.runtime.IPath)
*/
@Override
- public IManagedDependencyInfo getDependencySourceInfo(IPath source, IResource resource, IBuildObject buildContext, ITool tool, IPath topBuildDirectory) {
+ public IManagedDependencyInfo getDependencySourceInfo(IPath source, IResource resource, IBuildObject buildContext,
+ ITool tool, IPath topBuildDirectory) {
return new DefaultGCCDependencyCalculator2Commands(source, resource, buildContext, tool, topBuildDirectory);
}
@@ -71,7 +71,8 @@ public class DefaultGCCDependencyCalculator2 implements
* @see org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator2#getDependencySourceInfo(org.eclipse.core.runtime.IPath, org.eclipse.cdt.managedbuilder.core.IBuildObject, org.eclipse.cdt.managedbuilder.core.ITool, org.eclipse.core.runtime.IPath)
*/
@Override
- public IManagedDependencyInfo getDependencySourceInfo(IPath source, IBuildObject buildContext, ITool tool, IPath topBuildDirectory) {
+ public IManagedDependencyInfo getDependencySourceInfo(IPath source, IBuildObject buildContext, ITool tool,
+ IPath topBuildDirectory) {
return new DefaultGCCDependencyCalculator2Commands(source, buildContext, tool, topBuildDirectory);
}
@@ -80,7 +81,8 @@ public class DefaultGCCDependencyCalculator2 implements
* @see org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator2#postProcessDependencyFile(org.eclipse.core.runtime.IPath, org.eclipse.cdt.managedbuilder.core.IConfiguration, org.eclipse.cdt.managedbuilder.core.ITool, org.eclipse.core.runtime.IPath)
*/
@Override
- public boolean postProcessDependencyFile(IPath dependencyFile, IConfiguration buildContext, ITool tool, IPath topBuildDirectory) {
+ public boolean postProcessDependencyFile(IPath dependencyFile, IConfiguration buildContext, ITool tool,
+ IPath topBuildDirectory) {
// Nothing
return false;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator2Commands.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator2Commands.java
index 6375d77eed4..2963ac29665 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator2Commands.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator2Commands.java
@@ -43,8 +43,7 @@ import org.eclipse.core.runtime.Path;
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
-public class DefaultGCCDependencyCalculator2Commands implements
- IManagedDependencyCommands {
+public class DefaultGCCDependencyCalculator2Commands implements IManagedDependencyCommands {
// Member variables set by the constructor
IPath source;
@@ -61,18 +60,19 @@ public class DefaultGCCDependencyCalculator2Commands implements
Boolean genericCommands = null;
/**
- * Constructor
+ * Constructor
*
- * @param source The source file for which dependencies should be calculated
- * The IPath can be either relative to the project directory, or absolute in the file system.
- * @param resource The IResource corresponding to the source file.
- * @param buildContext The IConfiguration or IResourceConfiguration that
- * contains the context in which the source file will be built
- * @param tool The tool associated with the source file
- * @param topBuildDirectory The top build directory of the configuration. This is
- * the working directory for the tool. This IPath is relative to the project directory.
+ * @param source The source file for which dependencies should be calculated
+ * The IPath can be either relative to the project directory, or absolute in the file system.
+ * @param resource The IResource corresponding to the source file.
+ * @param buildContext The IConfiguration or IResourceConfiguration that
+ * contains the context in which the source file will be built
+ * @param tool The tool associated with the source file
+ * @param topBuildDirectory The top build directory of the configuration. This is
+ * the working directory for the tool. This IPath is relative to the project directory.
*/
- public DefaultGCCDependencyCalculator2Commands(IPath source, IResource resource, IBuildObject buildContext, ITool tool, IPath topBuildDirectory) {
+ public DefaultGCCDependencyCalculator2Commands(IPath source, IResource resource, IBuildObject buildContext,
+ ITool tool, IPath topBuildDirectory) {
this.source = source;
this.resource = resource;
this.buildContext = buildContext;
@@ -81,10 +81,10 @@ public class DefaultGCCDependencyCalculator2Commands implements
// Compute the project
if (buildContext instanceof IConfiguration) {
- IConfiguration config = (IConfiguration)buildContext;
- project = (IProject)config.getOwner();
+ IConfiguration config = (IConfiguration) buildContext;
+ project = (IProject) config.getOwner();
} else if (buildContext instanceof IResourceInfo) {
- IResourceInfo rcInfo = (IResourceInfo)buildContext;
+ IResourceInfo rcInfo = (IResourceInfo) buildContext;
project = rcInfo.getParent().getOwner().getProject();
}
@@ -104,23 +104,21 @@ public class DefaultGCCDependencyCalculator2Commands implements
*/
boolean resourceNameRequiresExplicitRule = true;
- if(resource != null)
- {
- resourceNameRequiresExplicitRule = (resource.isLinked() && GnuMakefileGenerator
- .containsSpecialCharacters(sourceLocation.toString()))
- || (!resource.isLinked() && GnuMakefileGenerator
- .containsSpecialCharacters(resource.getProjectRelativePath().toString()));
+ if (resource != null) {
+ resourceNameRequiresExplicitRule = (resource.isLinked()
+ && GnuMakefileGenerator.containsSpecialCharacters(sourceLocation.toString()))
+ || (!resource.isLinked() && GnuMakefileGenerator
+ .containsSpecialCharacters(resource.getProjectRelativePath().toString()));
}
- needExplicitRuleForFile = resourceNameRequiresExplicitRule ||
- BuildMacroProvider.getReferencedExplitFileMacros(tool).length > 0
- || BuildMacroProvider.getReferencedExplitFileMacros(
- tool.getToolCommand(),
+ needExplicitRuleForFile = resourceNameRequiresExplicitRule
+ || BuildMacroProvider.getReferencedExplitFileMacros(tool).length > 0
+ || BuildMacroProvider.getReferencedExplitFileMacros(tool.getToolCommand(),
IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(sourceLocation, outputLocation,
- null, tool)).length > 0;
+ new FileContextData(sourceLocation, outputLocation, null, tool)).length > 0;
- if (needExplicitRuleForFile) genericCommands = false;
+ if (needExplicitRuleForFile)
+ genericCommands = false;
}
/**
@@ -147,19 +145,19 @@ public class DefaultGCCDependencyCalculator2Commands implements
*
* @see #DefaultGCCDependencyCalculator2Commands(IPath source, IResource resource, IBuildObject buildContext, ITool tool, IPath topBuildDirectory)
*/
- public DefaultGCCDependencyCalculator2Commands(IPath source, IBuildObject buildContext, ITool tool, IPath topBuildDirectory)
- {
+ public DefaultGCCDependencyCalculator2Commands(IPath source, IBuildObject buildContext, ITool tool,
+ IPath topBuildDirectory) {
this(source, (IResource) null, buildContext, tool, topBuildDirectory);
}
-
/*
* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyCommands#areCommandsGeneric()
*/
@Override
public boolean areCommandsGeneric() {
- if (genericCommands == null) genericCommands = true;
+ if (genericCommands == null)
+ genericCommands = true;
return genericCommands.booleanValue();
}
@@ -172,27 +170,27 @@ public class DefaultGCCDependencyCalculator2Commands implements
String[] options = new String[4];
// -MMD
- options[0] = "-MMD"; //$NON-NLS-1$
+ options[0] = "-MMD"; //$NON-NLS-1$
// -MP
- options[1] = "-MP"; //$NON-NLS-1$
+ options[1] = "-MP"; //$NON-NLS-1$
// -MF$(@:%.o=%.d)
// Due to bug in GNU make $(@:%.o=%.d) applied to "/buggy path_with_3_spaces/f.o"
// becomes "/buggy path_with_3_spaces/f.d". To avoid this we have to insert
// filename explicitly instead of substitution rule
- if ( needExplicitRuleForFile ) {
+ if (needExplicitRuleForFile) {
IPath outPath = getDependencyFiles()[0];
- options[2] = "-MF\"" + outPath.toString() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
+ options[2] = "-MF\"" + outPath.toString() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
} else {
- options[2] = "-MF\"$(@:%.o=%.d)\""; //$NON-NLS-1$
+ options[2] = "-MF\"$(@:%.o=%.d)\""; //$NON-NLS-1$
}
- if( buildContext instanceof IResourceConfiguration || needExplicitRuleForFile ) {
+ if (buildContext instanceof IResourceConfiguration || needExplicitRuleForFile) {
IPath outPath = getDependencyFiles()[0];
// -MT"dependency-file-name"
- String optTxt = "-MT\"" + GnuMakefileGenerator.escapeWhitespaces(outPath.toString()) + "\""; //$NON-NLS-1$ //$NON-NLS-2$
+ String optTxt = "-MT\"" + GnuMakefileGenerator.escapeWhitespaces(outPath.toString()) + "\""; //$NON-NLS-1$ //$NON-NLS-2$
options[3] = optTxt;
} else {
// -MT"$(@:%.o=%.d) %.o"
- options[3] = "-MT\"$(@)\""; //$NON-NLS-1$
+ options[3] = "-MT\"$(@)\""; //$NON-NLS-1$
}
return options;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator3.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator3.java
index 7e9b7accfe4..72a18296f47 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator3.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator3.java
@@ -48,8 +48,7 @@ import org.eclipse.core.runtime.IPath;
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
-public class DefaultGCCDependencyCalculator3 implements
- IManagedDependencyGenerator2 {
+public class DefaultGCCDependencyCalculator3 implements IManagedDependencyGenerator2 {
/*
* (non-Javadoc)
@@ -73,7 +72,8 @@ public class DefaultGCCDependencyCalculator3 implements
* @see org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator2#getDependencySourceInfo(org.eclipse.core.runtime.IPath, org.eclipse.core.resources.IResource, org.eclipse.cdt.managedbuilder.core.IBuildObject, org.eclipse.cdt.managedbuilder.core.ITool, org.eclipse.core.runtime.IPath)
*/
@Override
- public IManagedDependencyInfo getDependencySourceInfo(IPath source, IResource resource, IBuildObject buildContext, ITool tool, IPath topBuildDirectory) {
+ public IManagedDependencyInfo getDependencySourceInfo(IPath source, IResource resource, IBuildObject buildContext,
+ ITool tool, IPath topBuildDirectory) {
return new DefaultGCCDependencyCalculator3Commands(source, resource, buildContext, tool, topBuildDirectory);
}
@@ -81,7 +81,8 @@ public class DefaultGCCDependencyCalculator3 implements
* @see org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator2#getDependencySourceInfo(org.eclipse.core.runtime.IPath, org.eclipse.cdt.managedbuilder.core.IBuildObject, org.eclipse.cdt.managedbuilder.core.ITool, org.eclipse.core.runtime.IPath)
*/
@Override
- public IManagedDependencyInfo getDependencySourceInfo(IPath source, IBuildObject buildContext, ITool tool, IPath topBuildDirectory) {
+ public IManagedDependencyInfo getDependencySourceInfo(IPath source, IBuildObject buildContext, ITool tool,
+ IPath topBuildDirectory) {
return new DefaultGCCDependencyCalculator3Commands(source, buildContext, tool, topBuildDirectory);
}
@@ -90,7 +91,8 @@ public class DefaultGCCDependencyCalculator3 implements
* @see org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator2#postProcessDependencyFile(org.eclipse.core.runtime.IPath, org.eclipse.cdt.managedbuilder.core.IConfiguration, org.eclipse.cdt.managedbuilder.core.ITool, org.eclipse.core.runtime.IPath)
*/
@Override
- public boolean postProcessDependencyFile(IPath dependencyFile, IConfiguration buildContext, ITool tool, IPath topBuildDirectory) {
+ public boolean postProcessDependencyFile(IPath dependencyFile, IConfiguration buildContext, ITool tool,
+ IPath topBuildDirectory) {
try {
IWorkspaceRoot root = CCorePlugin.getWorkspace().getRoot();
IFile makefile;
@@ -106,7 +108,7 @@ public class DefaultGCCDependencyCalculator3 implements
}
makefile = root.getFile(makefilePath);
IResourceInfo rcInfo = tool.getParentResourceInfo();
- if(rcInfo != null)
+ if (rcInfo != null)
return GnuMakefileGenerator.populateDummyTargets(rcInfo, makefile, false);
return GnuMakefileGenerator.populateDummyTargets(buildContext, makefile, false);
} catch (CoreException e) {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator3Commands.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator3Commands.java
index d98fc3e919a..361805fde20 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator3Commands.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator3Commands.java
@@ -50,8 +50,7 @@ import org.eclipse.core.runtime.IPath;
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
-public class DefaultGCCDependencyCalculator3Commands implements
- IManagedDependencyCommands {
+public class DefaultGCCDependencyCalculator3Commands implements IManagedDependencyCommands {
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
@@ -72,17 +71,18 @@ public class DefaultGCCDependencyCalculator3Commands implements
boolean genericCommands = true;
/**
- * Constructor
+ * Constructor
*
- * @param source The source file for which dependencies should be calculated
- * The IPath can be either relative to the project directory, or absolute in the file system.
- * @param buildContext The IConfiguration or IResourceConfiguration that
- * contains the context in which the source file will be built
- * @param tool The tool associated with the source file
- * @param topBuildDirectory The top build directory of the configuration. This is
- * the working directory for the tool. This IPath is relative to the project directory.
+ * @param source The source file for which dependencies should be calculated
+ * The IPath can be either relative to the project directory, or absolute in the file system.
+ * @param buildContext The IConfiguration or IResourceConfiguration that
+ * contains the context in which the source file will be built
+ * @param tool The tool associated with the source file
+ * @param topBuildDirectory The top build directory of the configuration. This is
+ * the working directory for the tool. This IPath is relative to the project directory.
*/
- public DefaultGCCDependencyCalculator3Commands(IPath source, IResource resource, IBuildObject buildContext, ITool tool, IPath topBuildDirectory) {
+ public DefaultGCCDependencyCalculator3Commands(IPath source, IResource resource, IBuildObject buildContext,
+ ITool tool, IPath topBuildDirectory) {
this.source = source;
this.resource = resource;
this.buildContext = buildContext;
@@ -91,13 +91,13 @@ public class DefaultGCCDependencyCalculator3Commands implements
// Compute the project
if (buildContext instanceof IConfiguration) {
- config = (IConfiguration)buildContext;
+ config = (IConfiguration) buildContext;
resInfo = config.getRootFolderInfo();
- project = (IProject)config.getOwner();
+ project = (IProject) config.getOwner();
} else if (buildContext instanceof IResourceInfo) {
- resInfo = (IResourceInfo)buildContext;
+ resInfo = (IResourceInfo) buildContext;
config = resInfo.getParent();
- project = (IProject)config.getOwner();
+ project = (IProject) config.getOwner();
}
sourceLocation = (source.isAbsolute() ? source : project.getLocation().append(source));
@@ -114,21 +114,18 @@ public class DefaultGCCDependencyCalculator3Commands implements
*/
boolean resourceNameRequiresExplicitRule = true;
- if(resource != null)
- {
- resourceNameRequiresExplicitRule = (resource.isLinked() && GnuMakefileGenerator
- .containsSpecialCharacters(sourceLocation.toString()))
- || (!resource.isLinked() && GnuMakefileGenerator
- .containsSpecialCharacters(resource.getProjectRelativePath().toString()));
+ if (resource != null) {
+ resourceNameRequiresExplicitRule = (resource.isLinked()
+ && GnuMakefileGenerator.containsSpecialCharacters(sourceLocation.toString()))
+ || (!resource.isLinked() && GnuMakefileGenerator
+ .containsSpecialCharacters(resource.getProjectRelativePath().toString()));
}
- needExplicitRuleForFile = resourceNameRequiresExplicitRule ||
- BuildMacroProvider.getReferencedExplitFileMacros(tool).length > 0
- || BuildMacroProvider.getReferencedExplitFileMacros(
- tool.getToolCommand(),
+ needExplicitRuleForFile = resourceNameRequiresExplicitRule
+ || BuildMacroProvider.getReferencedExplitFileMacros(tool).length > 0
+ || BuildMacroProvider.getReferencedExplitFileMacros(tool.getToolCommand(),
IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(sourceLocation, outputLocation,
- null, tool)).length > 0;
+ new FileContextData(sourceLocation, outputLocation, null, tool)).length > 0;
if (buildContext instanceof IResourceConfiguration || needExplicitRuleForFile)
genericCommands = false;
@@ -158,8 +155,8 @@ public class DefaultGCCDependencyCalculator3Commands implements
*
* @see #DefaultGCCDependencyCalculator3Commands(IPath source, IResource resource, IBuildObject buildContext, ITool tool, IPath topBuildDirectory)
*/
- public DefaultGCCDependencyCalculator3Commands(IPath source, IBuildObject buildContext, ITool tool, IPath topBuildDirectory)
- {
+ public DefaultGCCDependencyCalculator3Commands(IPath source, IBuildObject buildContext, ITool tool,
+ IPath topBuildDirectory) {
this(source, (IResource) null, buildContext, tool, topBuildDirectory);
}
@@ -224,83 +221,67 @@ public class DefaultGCCDependencyCalculator3Commands implements
// Calculate the dependency rule
// <path>/$(@:%.<out_ext>=%.d)
String depRule = "'$(@:%." + //$NON-NLS-1$
- outputExtension +
- "=%." + //$NON-NLS-1$
- IManagedBuilderMakefileGenerator.DEP_EXT +
- ")'"; //$NON-NLS-1$
+ outputExtension + "=%." + //$NON-NLS-1$
+ IManagedBuilderMakefileGenerator.DEP_EXT + ")'"; //$NON-NLS-1$
// Add the Echo command that will actually create the right format for the dep
- commands[0] =
- IManagedBuilderMakefileGenerator.TAB +
- IManagedBuilderMakefileGenerator.ECHO +
- IManagedBuilderMakefileGenerator.WHITESPACE +
- "-n" + //$NON-NLS-1$
- IManagedBuilderMakefileGenerator.WHITESPACE +
- depRule +
- IManagedBuilderMakefileGenerator.WHITESPACE +
- "$(dir $@)" + //$NON-NLS-1$
- IManagedBuilderMakefileGenerator.WHITESPACE +
- ">" + //$NON-NLS-1$
- IManagedBuilderMakefileGenerator.WHITESPACE +
- depRule;
+ commands[0] = IManagedBuilderMakefileGenerator.TAB + IManagedBuilderMakefileGenerator.ECHO
+ + IManagedBuilderMakefileGenerator.WHITESPACE + "-n" + //$NON-NLS-1$
+ IManagedBuilderMakefileGenerator.WHITESPACE + depRule + IManagedBuilderMakefileGenerator.WHITESPACE
+ + "$(dir $@)" + //$NON-NLS-1$
+ IManagedBuilderMakefileGenerator.WHITESPACE + ">" + //$NON-NLS-1$
+ IManagedBuilderMakefileGenerator.WHITESPACE + depRule;
// Add the line that will do the work to calculate dependencies
IBuildMacroProvider provider = ManagedBuildManager.getBuildMacroProvider();
IManagedCommandLineInfo cmdLInfo = null;
String buildCmd = null;
- String[] inputs= new String[1]; inputs[0] = IManagedBuilderMakefileGenerator.IN_MACRO;
- String outputFile = ""; //$NON-NLS-1$
- String outflag = ""; //$NON-NLS-1$
- String outputPrefix = ""; //$NON-NLS-1$
+ String[] inputs = new String[1];
+ inputs[0] = IManagedBuilderMakefileGenerator.IN_MACRO;
+ String outputFile = ""; //$NON-NLS-1$
+ String outflag = ""; //$NON-NLS-1$
+ String outputPrefix = ""; //$NON-NLS-1$
String cmd = tool.getToolCommand();
//try to resolve the build macros in the tool command
try {
String resolvedCommand = null;
if (!needExplicitRuleForFile) {
- resolvedCommand = provider.resolveValueToMakefileFormat(
- cmd,
- EMPTY_STRING,
- IManagedBuilderMakefileGenerator.WHITESPACE,
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(sourceLocation,
- outputLocation, null, tool));
+ resolvedCommand = provider.resolveValueToMakefileFormat(cmd, EMPTY_STRING,
+ IManagedBuilderMakefileGenerator.WHITESPACE, IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(sourceLocation, outputLocation, null, tool));
} else {
// if we need an explicit rule then don't use any builder
// variables, resolve everything
// to explicit strings
- resolvedCommand = provider.resolveValue(
- cmd,
- EMPTY_STRING,
- IManagedBuilderMakefileGenerator.WHITESPACE,
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(sourceLocation,
- outputLocation, null, tool));
+ resolvedCommand = provider.resolveValue(cmd, EMPTY_STRING, IManagedBuilderMakefileGenerator.WHITESPACE,
+ IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(sourceLocation, outputLocation, null, tool));
}
- if((resolvedCommand = resolvedCommand.trim()).length() > 0)
+ if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
cmd = resolvedCommand;
- } catch (BuildMacroException e){
+ } catch (BuildMacroException e) {
}
String[] toolFlags = null;
try {
toolFlags = tool.getToolCommandFlags(sourceLocation, outputLocation);
- } catch( BuildException ex ) {
+ } catch (BuildException ex) {
toolFlags = new String[0];
}
String[] flags = new String[toolFlags.length + 4];
- flags[0] = "-MM"; //$NON-NLS-1$
- flags[1] = "-MG"; //$NON-NLS-1$
- flags[2] = "-P"; //$NON-NLS-1$
- flags[3] = "-w"; //$NON-NLS-1$
- for (int i=0; i<toolFlags.length; i++) {
- flags[4+i] = toolFlags[i];
+ flags[0] = "-MM"; //$NON-NLS-1$
+ flags[1] = "-MG"; //$NON-NLS-1$
+ flags[2] = "-P"; //$NON-NLS-1$
+ flags[3] = "-w"; //$NON-NLS-1$
+ for (int i = 0; i < toolFlags.length; i++) {
+ flags[4 + i] = toolFlags[i];
}
IManagedCommandLineGenerator cmdLGen = tool.getCommandLineGenerator();
- cmdLInfo = cmdLGen.generateCommandLineInfo( tool, cmd, flags, outflag, outputPrefix,
- outputFile, inputs, tool.getCommandLinePattern() );
+ cmdLInfo = cmdLGen.generateCommandLineInfo(tool, cmd, flags, outflag, outputPrefix, outputFile, inputs,
+ tool.getCommandLinePattern());
// The command to build
buildCmd = cmdLInfo.getCommandLine();
@@ -310,36 +291,25 @@ public class DefaultGCCDependencyCalculator3Commands implements
String resolvedCommand = null;
if (!needExplicitRuleForFile) {
- resolvedCommand = provider.resolveValueToMakefileFormat(
- buildCmd,
- EMPTY_STRING,
- IManagedBuilderMakefileGenerator.WHITESPACE,
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(sourceLocation,
- outputLocation, null, tool));
+ resolvedCommand = provider.resolveValueToMakefileFormat(buildCmd, EMPTY_STRING,
+ IManagedBuilderMakefileGenerator.WHITESPACE, IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(sourceLocation, outputLocation, null, tool));
} else {
// if we need an explicit rule then don't use any builder
// variables, resolve everything to explicit strings
- resolvedCommand = provider.resolveValue(
- buildCmd,
- EMPTY_STRING,
- IManagedBuilderMakefileGenerator.WHITESPACE,
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(sourceLocation,
- outputLocation, null, tool));
+ resolvedCommand = provider.resolveValue(buildCmd, EMPTY_STRING,
+ IManagedBuilderMakefileGenerator.WHITESPACE, IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(sourceLocation, outputLocation, null, tool));
}
- if((resolvedCommand = resolvedCommand.trim()).length() > 0)
+ if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
buildCmd = resolvedCommand;
- } catch (BuildMacroException e){
+ } catch (BuildMacroException e) {
}
- commands[1] =
- IManagedBuilderMakefileGenerator.TAB +
- buildCmd +
- IManagedBuilderMakefileGenerator.WHITESPACE +
- ">>" + //$NON-NLS-1$
+ commands[1] = IManagedBuilderMakefileGenerator.TAB + buildCmd + IManagedBuilderMakefileGenerator.WHITESPACE
+ + ">>" + //$NON-NLS-1$
IManagedBuilderMakefileGenerator.WHITESPACE + depRule;
return commands;
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculatorPreBuild.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculatorPreBuild.java
index 73f133d887b..667a64dc627 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculatorPreBuild.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculatorPreBuild.java
@@ -23,7 +23,6 @@ import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyInfo;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
-
/**
* This dependency calculator uses the GCC -MM -MF -MP -MT options in order to
* generate .d files as separate step prior to the source compilations.
@@ -35,8 +34,7 @@ import org.eclipse.core.runtime.IPath;
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
-public class DefaultGCCDependencyCalculatorPreBuild implements
- IManagedDependencyGenerator2 {
+public class DefaultGCCDependencyCalculatorPreBuild implements IManagedDependencyGenerator2 {
/*
* (non-Javadoc)
@@ -61,8 +59,10 @@ public class DefaultGCCDependencyCalculatorPreBuild implements
* @see org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator2#getDependencySourceInfo(org.eclipse.core.runtime.IPath, org.eclipse.cdt.managedbuilder.core.IBuildObject, org.eclipse.cdt.managedbuilder.core.ITool, org.eclipse.core.runtime.IPath)
*/
@Override
- public IManagedDependencyInfo getDependencySourceInfo(IPath source, IResource resource, IBuildObject buildContext, ITool tool, IPath topBuildDirectory) {
- return new DefaultGCCDependencyCalculatorPreBuildCommands(source, resource, buildContext, tool, topBuildDirectory);
+ public IManagedDependencyInfo getDependencySourceInfo(IPath source, IResource resource, IBuildObject buildContext,
+ ITool tool, IPath topBuildDirectory) {
+ return new DefaultGCCDependencyCalculatorPreBuildCommands(source, resource, buildContext, tool,
+ topBuildDirectory);
}
/*
@@ -70,7 +70,8 @@ public class DefaultGCCDependencyCalculatorPreBuild implements
* @see org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator2#getDependencySourceInfo(org.eclipse.core.runtime.IPath, org.eclipse.cdt.managedbuilder.core.IBuildObject, org.eclipse.cdt.managedbuilder.core.ITool, org.eclipse.core.runtime.IPath)
*/
@Override
- public IManagedDependencyInfo getDependencySourceInfo(IPath source, IBuildObject buildContext, ITool tool, IPath topBuildDirectory) {
+ public IManagedDependencyInfo getDependencySourceInfo(IPath source, IBuildObject buildContext, ITool tool,
+ IPath topBuildDirectory) {
return new DefaultGCCDependencyCalculatorPreBuildCommands(source, buildContext, tool, topBuildDirectory);
}
@@ -79,10 +80,10 @@ public class DefaultGCCDependencyCalculatorPreBuild implements
* @see org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator2#postProcessDependencyFile(org.eclipse.core.runtime.IPath, org.eclipse.cdt.managedbuilder.core.IConfiguration, org.eclipse.cdt.managedbuilder.core.ITool, org.eclipse.core.runtime.IPath)
*/
@Override
- public boolean postProcessDependencyFile(IPath dependencyFile, IConfiguration buildContext, ITool tool, IPath topBuildDirectory) {
+ public boolean postProcessDependencyFile(IPath dependencyFile, IConfiguration buildContext, ITool tool,
+ IPath topBuildDirectory) {
// Nothing
return false;
}
}
-
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculatorPreBuildCommands.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculatorPreBuildCommands.java
index 569c3e23730..70bf3e43c4b 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculatorPreBuildCommands.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculatorPreBuildCommands.java
@@ -68,17 +68,18 @@ public class DefaultGCCDependencyCalculatorPreBuildCommands implements IManagedD
Boolean genericCommands = null;
/**
- * Constructor
+ * Constructor
*
- * @param source The source file for which dependencies should be calculated
- * The IPath can be either relative to the project directory, or absolute in the file system.
- * @param buildContext The IConfiguration or IResourceConfiguration that
- * contains the context in which the source file will be built
- * @param tool The tool associated with the source file
- * @param topBuildDirectory The top build directory of the configuration. This is
- * the working directory for the tool. This IPath is relative to the project directory.
+ * @param source The source file for which dependencies should be calculated
+ * The IPath can be either relative to the project directory, or absolute in the file system.
+ * @param buildContext The IConfiguration or IResourceConfiguration that
+ * contains the context in which the source file will be built
+ * @param tool The tool associated with the source file
+ * @param topBuildDirectory The top build directory of the configuration. This is
+ * the working directory for the tool. This IPath is relative to the project directory.
*/
- public DefaultGCCDependencyCalculatorPreBuildCommands(IPath source, IResource resource, IBuildObject buildContext, ITool tool, IPath topBuildDirectory) {
+ public DefaultGCCDependencyCalculatorPreBuildCommands(IPath source, IResource resource, IBuildObject buildContext,
+ ITool tool, IPath topBuildDirectory) {
this.source = source;
this.resource = resource;
this.buildContext = buildContext;
@@ -87,11 +88,11 @@ public class DefaultGCCDependencyCalculatorPreBuildCommands implements IManagedD
// Compute the project
if (buildContext instanceof IConfiguration) {
- IConfiguration config = (IConfiguration)buildContext;
- project = (IProject)config.getOwner();
+ IConfiguration config = (IConfiguration) buildContext;
+ project = (IProject) config.getOwner();
} else if (buildContext instanceof IResourceInfo) {
- IResourceInfo resInfo = (IResourceInfo)buildContext;
- project = (IProject)resInfo.getParent().getOwner();
+ IResourceInfo resInfo = (IResourceInfo) buildContext;
+ project = (IProject) resInfo.getParent().getOwner();
}
sourceLocation = (source.isAbsolute() ? source : project.getLocation().append(source));
@@ -108,23 +109,21 @@ public class DefaultGCCDependencyCalculatorPreBuildCommands implements IManagedD
*/
boolean resourceNameRequiresExplicitRule = true;
- if(resource != null)
- {
- resourceNameRequiresExplicitRule = (resource.isLinked() && GnuMakefileGenerator
- .containsSpecialCharacters(sourceLocation.toString()))
- || (!resource.isLinked() && GnuMakefileGenerator
- .containsSpecialCharacters(resource.getProjectRelativePath().toString()));
+ if (resource != null) {
+ resourceNameRequiresExplicitRule = (resource.isLinked()
+ && GnuMakefileGenerator.containsSpecialCharacters(sourceLocation.toString()))
+ || (!resource.isLinked() && GnuMakefileGenerator
+ .containsSpecialCharacters(resource.getProjectRelativePath().toString()));
}
- needExplicitRuleForFile = resourceNameRequiresExplicitRule ||
- BuildMacroProvider.getReferencedExplitFileMacros(tool).length > 0
- || BuildMacroProvider.getReferencedExplitFileMacros(
- tool.getToolCommand(),
+ needExplicitRuleForFile = resourceNameRequiresExplicitRule
+ || BuildMacroProvider.getReferencedExplitFileMacros(tool).length > 0
+ || BuildMacroProvider.getReferencedExplitFileMacros(tool.getToolCommand(),
IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(sourceLocation, outputLocation,
- null, tool)).length > 0;
+ new FileContextData(sourceLocation, outputLocation, null, tool)).length > 0;
- if (needExplicitRuleForFile) genericCommands = false;
+ if (needExplicitRuleForFile)
+ genericCommands = false;
}
/**
@@ -151,14 +150,15 @@ public class DefaultGCCDependencyCalculatorPreBuildCommands implements IManagedD
*
* @see #DefaultGCCDependencyCalculatorPreBuildCommands(IPath source, IResource resource, IBuildObject buildContext, ITool tool, IPath topBuildDirectory)
*/
- public DefaultGCCDependencyCalculatorPreBuildCommands(IPath source, IBuildObject buildContext, ITool tool, IPath topBuildDirectory)
- {
+ public DefaultGCCDependencyCalculatorPreBuildCommands(IPath source, IBuildObject buildContext, ITool tool,
+ IPath topBuildDirectory) {
this(source, (IResource) null, buildContext, tool, topBuildDirectory);
}
@Override
public boolean areCommandsGeneric() {
- if (genericCommands != null) return genericCommands.booleanValue();
+ if (genericCommands != null)
+ return genericCommands.booleanValue();
// If the context is a Configuration, yes
if (buildContext instanceof IConfiguration || buildContext instanceof IFolderInfo) {
genericCommands = true;
@@ -174,7 +174,7 @@ public class DefaultGCCDependencyCalculatorPreBuildCommands implements IManagedD
@Override
public String getBuildStepName() {
- return "GCC_DEPENDS"; //$NON-NLS-1$
+ return "GCC_DEPENDS"; //$NON-NLS-1$
}
@Override
@@ -189,24 +189,16 @@ public class DefaultGCCDependencyCalculatorPreBuildCommands implements IManagedD
try {
String resolvedCommand = null;
if (!needExplicitRuleForFile) {
- resolvedCommand = provider.resolveValueToMakefileFormat(
- cmd,
- EMPTY_STRING,
- IManagedBuilderMakefileGenerator.WHITESPACE,
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(sourceLocation,
- outputLocation, null, tool));
+ resolvedCommand = provider.resolveValueToMakefileFormat(cmd, EMPTY_STRING,
+ IManagedBuilderMakefileGenerator.WHITESPACE, IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(sourceLocation, outputLocation, null, tool));
} else {
// if we need an explicit rule then don't use any builder
// variables, resolve everything
// to explicit strings
- resolvedCommand = provider.resolveValue(
- cmd,
- EMPTY_STRING,
- IManagedBuilderMakefileGenerator.WHITESPACE,
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(sourceLocation,
- outputLocation, null, tool));
+ resolvedCommand = provider.resolveValue(cmd, EMPTY_STRING, IManagedBuilderMakefileGenerator.WHITESPACE,
+ IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(sourceLocation, outputLocation, null, tool));
}
if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
@@ -220,32 +212,33 @@ public class DefaultGCCDependencyCalculatorPreBuildCommands implements IManagedD
// Set up the command line options that will generate the dependency file
Vector<String> options = new Vector<String>();
// -w
- options.add("-w"); //$NON-NLS-1$
+ options.add("-w"); //$NON-NLS-1$
// -MM
- options.add("-MM"); //$NON-NLS-1$
+ options.add("-MM"); //$NON-NLS-1$
// -MP
- options.add("-MP"); //$NON-NLS-1$
+ options.add("-MP"); //$NON-NLS-1$
String optTxt;
- if( buildContext instanceof IResourceConfiguration || needExplicitRuleForFile ) {
+ if (buildContext instanceof IResourceConfiguration || needExplicitRuleForFile) {
IPath outPath = getDependencyFiles()[0];
// -MT"dependecy-file-name"
- optTxt = "-MT\""; //$NON-NLS-1$
- optTxt += GnuMakefileGenerator.escapeWhitespaces(outPath.toString()) + "\""; //$NON-NLS-1$
+ optTxt = "-MT\""; //$NON-NLS-1$
+ optTxt += GnuMakefileGenerator.escapeWhitespaces(outPath.toString()) + "\""; //$NON-NLS-1$
options.add(optTxt);
// -MT"object-file-filename"
- optTxt = "-MT\""; //$NON-NLS-1$
+ optTxt = "-MT\""; //$NON-NLS-1$
optTxt += GnuMakefileGenerator.escapeWhitespaces((outPath.removeFileExtension()).toString());
String outExt = tool.getOutputExtension(source.getFileExtension());
- if (outExt != null) optTxt += "." + outExt; //$NON-NLS-1$
- optTxt += "\""; //$NON-NLS-1$
+ if (outExt != null)
+ optTxt += "." + outExt; //$NON-NLS-1$
+ optTxt += "\""; //$NON-NLS-1$
options.add(optTxt);
} else {
// -MT"$@"
- options.add("-MT\"$@\""); //$NON-NLS-1$
+ options.add("-MT\"$@\""); //$NON-NLS-1$
// -MT'$(@:%.d=%.o)'
- optTxt = "-MT\"$(@:%.d=%.o)\""; //$NON-NLS-1$
+ optTxt = "-MT\"$(@:%.d=%.o)\""; //$NON-NLS-1$
//optTxt = "-MT\"${OutputDirRelPath}${OutputFileBaseName}";
//if (outExt != null) optTxt += "." + outExt;
//optTxt += "\""; //$NON-NLS-1$
@@ -256,13 +249,13 @@ public class DefaultGCCDependencyCalculatorPreBuildCommands implements IManagedD
try {
String[] allFlags = tool.getToolCommandFlags(sourceLocation, outputLocation);
for (String flag : allFlags) {
- if (flag.startsWith("-I") || //$NON-NLS-1$
- flag.startsWith("-D") || //$NON-NLS-1$
- flag.startsWith("-U")) { //$NON-NLS-1$
+ if (flag.startsWith("-I") || //$NON-NLS-1$
+ flag.startsWith("-D") || //$NON-NLS-1$
+ flag.startsWith("-U")) { //$NON-NLS-1$
options.add(flag);
}
}
- } catch( BuildException ex ) {
+ } catch (BuildException ex) {
}
// Call the command line generator
@@ -270,38 +263,27 @@ public class DefaultGCCDependencyCalculatorPreBuildCommands implements IManagedD
String[] flags = options.toArray(new String[options.size()]);
String[] inputs = new String[1];
inputs[0] = IManagedBuilderMakefileGenerator.IN_MACRO;
- cmdLInfo = cmdLGen.generateCommandLineInfo(
- tool, cmd, flags, "-MF", EMPTY_STRING, //$NON-NLS-1$
- IManagedBuilderMakefileGenerator.OUT_MACRO,
- inputs,
- tool.getCommandLinePattern() );
+ cmdLInfo = cmdLGen.generateCommandLineInfo(tool, cmd, flags, "-MF", EMPTY_STRING, //$NON-NLS-1$
+ IManagedBuilderMakefileGenerator.OUT_MACRO, inputs, tool.getCommandLinePattern());
// The command to build
if (cmdLInfo != null) {
depCmd = cmdLInfo.getCommandLine();
- // resolve any remaining macros in the command after it has been
- // generated
+ // resolve any remaining macros in the command after it has been
+ // generated
try {
String resolvedCommand;
if (!needExplicitRuleForFile) {
- resolvedCommand = provider.resolveValueToMakefileFormat(
- depCmd,
- EMPTY_STRING,
- IManagedBuilderMakefileGenerator.WHITESPACE,
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(sourceLocation,
- outputLocation, null, tool));
+ resolvedCommand = provider.resolveValueToMakefileFormat(depCmd, EMPTY_STRING,
+ IManagedBuilderMakefileGenerator.WHITESPACE, IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(sourceLocation, outputLocation, null, tool));
} else {
// if we need an explicit rule then don't use any builder
// variables, resolve everything to explicit strings
- resolvedCommand = provider.resolveValue(
- depCmd,
- EMPTY_STRING,
- IManagedBuilderMakefileGenerator.WHITESPACE,
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(sourceLocation,
- outputLocation, null, tool));
+ resolvedCommand = provider.resolveValue(depCmd, EMPTY_STRING,
+ IManagedBuilderMakefileGenerator.WHITESPACE, IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(sourceLocation, outputLocation, null, tool));
}
if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuDependencyGroupInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuDependencyGroupInfo.java
index db1b55494d7..2284b7f3404 100755
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuDependencyGroupInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuDependencyGroupInfo.java
@@ -13,27 +13,26 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.makegen.gnu;
-
/**
- *
+ *
* This class contains the description of a group of generated dependency files,
* e.g., .d files created by compilations
*
*/
public class GnuDependencyGroupInfo {
-
+
// Member Variables
String groupBuildVar;
boolean conditionallyInclude;
-// ArrayList groupFiles;
-
+ // ArrayList groupFiles;
+
// Constructor
public GnuDependencyGroupInfo(String groupName, boolean bConditionallyInclude) {
groupBuildVar = groupName;
conditionallyInclude = bConditionallyInclude;
// Note: not yet needed
-// groupFiles = null;
+ // groupFiles = null;
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuLinkOutputNameProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuLinkOutputNameProvider.java
index 615f7a674cf..88dc7c99abd 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuLinkOutputNameProvider.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuLinkOutputNameProvider.java
@@ -43,47 +43,50 @@ public class GnuLinkOutputNameProvider implements IManagedOutputNameProvider {
IPath[] name = new IPath[1];
// Determine a default name from the input file name
- String fileName = "default"; //$NON-NLS-1$
+ String fileName = "default"; //$NON-NLS-1$
if (primaryInputNames != null && primaryInputNames.length > 0) {
fileName = primaryInputNames[0].removeFileExtension().lastSegment();
- if (fileName.startsWith("$(") && fileName.endsWith(")")) { //$NON-NLS-1$ //$NON-NLS-2$
- fileName = fileName.substring(2,fileName.length()-1);
+ if (fileName.startsWith("$(") && fileName.endsWith(")")) { //$NON-NLS-1$ //$NON-NLS-2$
+ fileName = fileName.substring(2, fileName.length() - 1);
}
}
// If we are building a shared library, determine if the user has specified a name using the
// soname option
boolean isSO = false;
- String soName = ""; //$NON-NLS-1$
- if (hasAncestor(tool, "cdt.managedbuild.tool.gnu.c.linker")) { //$NON-NLS-1$
- IOption optShared = tool.getOptionBySuperClassId("gnu.c.link.option.shared"); //$NON-NLS-1$
+ String soName = ""; //$NON-NLS-1$
+ if (hasAncestor(tool, "cdt.managedbuild.tool.gnu.c.linker")) { //$NON-NLS-1$
+ IOption optShared = tool.getOptionBySuperClassId("gnu.c.link.option.shared"); //$NON-NLS-1$
if (optShared != null) {
try {
isSO = optShared.getBooleanValue();
- } catch (Exception e) {}
+ } catch (Exception e) {
+ }
}
if (isSO) {
- IOption optSOName = tool.getOptionBySuperClassId("gnu.c.link.option.soname"); //$NON-NLS-1$
+ IOption optSOName = tool.getOptionBySuperClassId("gnu.c.link.option.soname"); //$NON-NLS-1$
if (optSOName != null) {
try {
soName = optSOName.getStringValue();
- } catch (Exception e) {}
+ } catch (Exception e) {
+ }
}
}
- } else
- if (hasAncestor(tool, "cdt.managedbuild.tool.gnu.cpp.linker")) { //$NON-NLS-1$
- IOption optShared = tool.getOptionBySuperClassId("gnu.cpp.link.option.shared"); //$NON-NLS-1$
+ } else if (hasAncestor(tool, "cdt.managedbuild.tool.gnu.cpp.linker")) { //$NON-NLS-1$
+ IOption optShared = tool.getOptionBySuperClassId("gnu.cpp.link.option.shared"); //$NON-NLS-1$
if (optShared != null) {
try {
isSO = optShared.getBooleanValue();
- } catch (Exception e) {}
+ } catch (Exception e) {
+ }
}
if (isSO) {
- IOption optSOName = tool.getOptionBySuperClassId("gnu.cpp.link.option.soname"); //$NON-NLS-1$
+ IOption optSOName = tool.getOptionBySuperClassId("gnu.cpp.link.option.soname"); //$NON-NLS-1$
if (optSOName != null) {
try {
soName = optSOName.getStringValue();
- } catch (Exception e) {}
+ } catch (Exception e) {
+ }
}
}
}
@@ -110,19 +113,16 @@ public class GnuLinkOutputNameProvider implements IManagedOutputNameProvider {
config = (IConfiguration) toolParent;
else if (toolParent instanceof IToolChain) {
// must be a toolchain
- config = ((IToolChain) toolParent)
- .getParent();
+ config = ((IToolChain) toolParent).getParent();
}
else if (toolParent instanceof IResourceConfiguration) {
- config = ((IResourceConfiguration) toolParent)
- .getParent();
+ config = ((IResourceConfiguration) toolParent).getParent();
}
else {
// bad
- throw new AssertionError(
- ManagedMakeMessages.getResourceString("GnuLinkOutputNameProvider.0")); //$NON-NLS-1$
+ throw new AssertionError(ManagedMakeMessages.getResourceString("GnuLinkOutputNameProvider.0")); //$NON-NLS-1$
}
if (config != null) {
@@ -131,35 +131,24 @@ public class GnuLinkOutputNameProvider implements IManagedOutputNameProvider {
// if any input files have spaces in the name, then we must
// not use builder variables
- for(int k = 0; k < primaryInputNames.length; k++)
- {
- if(primaryInputNames[k].toString().indexOf(" ") != -1) //$NON-NLS-1$
+ for (int k = 0; k < primaryInputNames.length; k++) {
+ if (primaryInputNames[k].toString().indexOf(" ") != -1) //$NON-NLS-1$
explicitRuleRequired = true;
}
try {
- if(explicitRuleRequired)
- {
- outputPrefix = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveValue(
- outputPrefix,
- "", //$NON-NLS-1$
+ if (explicitRuleRequired) {
+ outputPrefix = ManagedBuildManager.getBuildMacroProvider().resolveValue(outputPrefix, "", //$NON-NLS-1$
" ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- config);
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, config);
}
else {
- outputPrefix = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveValueToMakefileFormat(
- outputPrefix,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- config);
+ outputPrefix = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
+ outputPrefix, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, config);
}
}
@@ -184,7 +173,8 @@ public class GnuLinkOutputNameProvider implements IManagedOutputNameProvider {
protected boolean hasAncestor(ITool tool, String id) {
do {
- if (id.equals(tool.getId())) return true;
+ if (id.equals(tool.getId()))
+ return true;
} while ((tool = tool.getSuperClass()) != null);
return false;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java
index 588b37a549a..f23c29aceef 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java
@@ -15,7 +15,7 @@
* Anna Dushistova (Mentor Graphics) - [307244] extend visibility of fields in GnuMakefileGenerator
* James Blackburn (Broadcom Corp.)
* Marc-Andre Laperle
- * Liviu Ionescu - [322168]
+ * Liviu Ionescu - [322168]
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.makegen.gnu;
@@ -109,7 +109,7 @@ import org.eclipse.core.runtime.SubProgressMonitor;
* @noinstantiate This class is not intended to be instantiated by clients.
*/
public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
- private static final IPath DOT_SLASH_PATH = new Path("./"); //$NON-NLS-1$
+ private static final IPath DOT_SLASH_PATH = new Path("./"); //$NON-NLS-1$
/**
* This class walks the delta supplied by the build system to determine
@@ -127,7 +127,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
*/
public class ResourceDeltaVisitor implements IResourceDeltaVisitor {
private final GnuMakefileGenerator generator;
-// private IManagedBuildInfo info;
+ // private IManagedBuildInfo info;
private final IConfiguration config;
/**
@@ -154,46 +154,46 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
IResourceInfo rcInfo = config.getResourceInfo(resource.getProjectRelativePath(), false);
IFolderInfo fo = null;
boolean isSource = isSource(resource.getProjectRelativePath());
- if(rcInfo instanceof IFolderInfo){
- fo = (IFolderInfo)rcInfo;
+ if (rcInfo instanceof IFolderInfo) {
+ fo = (IFolderInfo) rcInfo;
}
// What kind of resource change has occurred
- if(/*!rcInfo.isExcluded() && */isSource){
+ if (/*!rcInfo.isExcluded() && */isSource) {
if (resource.getType() == IResource.FILE) {
String ext = resource.getFileExtension();
switch (delta.getKind()) {
- case IResourceDelta.ADDED:
- if (!generator.isGeneratedResource(resource)) {
- // This is a source file so just add its container
- if (fo == null || fo.buildsFileType(ext)) {
- generator.appendModifiedSubdirectory(resource);
- }
+ case IResourceDelta.ADDED:
+ if (!generator.isGeneratedResource(resource)) {
+ // This is a source file so just add its container
+ if (fo == null || fo.buildsFileType(ext)) {
+ generator.appendModifiedSubdirectory(resource);
}
- break;
- case IResourceDelta.REMOVED:
- // we get this notification if a resource is moved too
- if (!generator.isGeneratedResource(resource)) {
- // This is a source file so just add its container
- if (fo == null || fo.buildsFileType(ext)) {
- generator.appendDeletedFile(resource);
- generator.appendModifiedSubdirectory(resource);
- }
+ }
+ break;
+ case IResourceDelta.REMOVED:
+ // we get this notification if a resource is moved too
+ if (!generator.isGeneratedResource(resource)) {
+ // This is a source file so just add its container
+ if (fo == null || fo.buildsFileType(ext)) {
+ generator.appendDeletedFile(resource);
+ generator.appendModifiedSubdirectory(resource);
}
- break;
- default:
- keepLooking = true;
- break;
+ }
+ break;
+ default:
+ keepLooking = true;
+ break;
}
}
if (resource.getType() == IResource.FOLDER) {
// I only care about delete event
switch (delta.getKind()) {
- case IResourceDelta.REMOVED:
- if (!generator.isGeneratedResource(resource)) {
- generator.appendDeletedSubdirectory((IContainer)resource);
- }
- break;
+ case IResourceDelta.REMOVED:
+ if (!generator.isGeneratedResource(resource)) {
+ generator.appendDeletedSubdirectory((IContainer) resource);
+ }
+ break;
}
}
}
@@ -205,8 +205,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
}
} else {
// If the resource is part of the generated directory structure don't recurse
- if (resource.getType() == IResource.ROOT ||
- (isSource && !generator.isGeneratedResource(resource))) {
+ if (resource.getType() == IResource.ROOT || (isSource && !generator.isGeneratedResource(resource))) {
keepLooking = true;
}
}
@@ -215,8 +214,6 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
}
}
-
-
/**
* This class is used to recursively walk the project and determine which
* modules contribute buildable source files.
@@ -224,7 +221,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
protected class ResourceProxyVisitor implements IResourceProxyVisitor {
private final GnuMakefileGenerator generator;
private final IConfiguration config;
-// private IManagedBuildInfo info;
+ // private IManagedBuildInfo info;
/**
* Constructs a new resource proxy visitor to quickly visit project
@@ -257,14 +254,14 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
if (proxy.getType() == IResource.FILE) {
// If this resource has a Resource Configuration and is not excluded or
// if it has a file extension that one of the tools builds, add the sudirectory to the list
-// boolean willBuild = false;
+ // boolean willBuild = false;
IResourceInfo rcInfo = config.getResourceInfo(resource.getProjectRelativePath(), false);
if (isSource/* && !rcInfo.isExcluded()*/) {
boolean willBuild = false;
- if(rcInfo instanceof IFolderInfo){
+ if (rcInfo instanceof IFolderInfo) {
String ext = resource.getFileExtension();
- if (((IFolderInfo)rcInfo).buildsFileType(ext) &&
- // If this file resource is a generated resource, then it is uninteresting
+ if (((IFolderInfo) rcInfo).buildsFileType(ext) &&
+ // If this file resource is a generated resource, then it is uninteresting
!generator.isGeneratedResource(resource)) {
willBuild = true;
}
@@ -272,18 +269,18 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
willBuild = true;
}
- if(willBuild)
+ if (willBuild)
generator.appendBuildSubdirectory(resource);
}
-// if (willBuild) {
-// if ((resConfig == null) || (!(resConfig.isExcluded()))) {
-// generator.appendBuildSubdirectory(resource);
-// }
-// }
+ // if (willBuild) {
+ // if ((resConfig == null) || (!(resConfig.isExcluded()))) {
+ // generator.appendBuildSubdirectory(resource);
+ // }
+ // }
return false;
- } else if (proxy.getType() == IResource.FOLDER){
+ } else if (proxy.getType() == IResource.FOLDER) {
- if(!isSource || generator.isGeneratedResource(resource))
+ if (!isSource || generator.isGeneratedResource(resource))
return false;
return true;
}
@@ -295,7 +292,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
}
// String constants for makefile contents and messages
- private static final String COMMENT = "MakefileGenerator.comment"; //$NON-NLS-1$
+ private static final String COMMENT = "MakefileGenerator.comment"; //$NON-NLS-1$
//private static final String AUTO_DEP = COMMENT + ".autodeps"; //$NON-NLS-1$
//private static final String MESSAGE = "ManagedMakeBuilder.message"; //$NON-NLS-1$
//private static final String BUILD_ERROR = MESSAGE + ".error"; //$NON-NLS-1$
@@ -303,39 +300,42 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
//private static final String DEP_INCL = COMMENT + ".module.dep.includes"; //$NON-NLS-1$
private static final String HEADER = COMMENT + ".header"; //$NON-NLS-1$
- protected static final String MESSAGE_FINISH_BUILD = ManagedMakeMessages.getResourceString("MakefileGenerator.message.finish.build"); //$NON-NLS-1$
- protected static final String MESSAGE_FINISH_FILE = ManagedMakeMessages.getResourceString("MakefileGenerator.message.finish.file"); //$NON-NLS-1$
- protected static final String MESSAGE_START_BUILD = ManagedMakeMessages.getResourceString("MakefileGenerator.message.start.build"); //$NON-NLS-1$
- protected static final String MESSAGE_START_FILE = ManagedMakeMessages.getResourceString("MakefileGenerator.message.start.file"); //$NON-NLS-1$
- protected static final String MESSAGE_START_DEPENDENCY = ManagedMakeMessages.getResourceString("MakefileGenerator.message.start.dependency"); //$NON-NLS-1$
- protected static final String MESSAGE_NO_TARGET_TOOL = ManagedMakeMessages.getResourceString("MakefileGenerator.message.no.target"); //$NON-NLS-1$
+ protected static final String MESSAGE_FINISH_BUILD = ManagedMakeMessages
+ .getResourceString("MakefileGenerator.message.finish.build"); //$NON-NLS-1$
+ protected static final String MESSAGE_FINISH_FILE = ManagedMakeMessages
+ .getResourceString("MakefileGenerator.message.finish.file"); //$NON-NLS-1$
+ protected static final String MESSAGE_START_BUILD = ManagedMakeMessages
+ .getResourceString("MakefileGenerator.message.start.build"); //$NON-NLS-1$
+ protected static final String MESSAGE_START_FILE = ManagedMakeMessages
+ .getResourceString("MakefileGenerator.message.start.file"); //$NON-NLS-1$
+ protected static final String MESSAGE_START_DEPENDENCY = ManagedMakeMessages
+ .getResourceString("MakefileGenerator.message.start.dependency"); //$NON-NLS-1$
+ protected static final String MESSAGE_NO_TARGET_TOOL = ManagedMakeMessages
+ .getResourceString("MakefileGenerator.message.no.target"); //$NON-NLS-1$
//private static final String MOD_INCL = COMMENT + ".module.make.includes"; //$NON-NLS-1$
- private static final String MOD_LIST = COMMENT + ".module.list"; //$NON-NLS-1$
- private static final String MOD_VARS = COMMENT + ".module.variables"; //$NON-NLS-1$
- private static final String MOD_RULES = COMMENT + ".build.rule"; //$NON-NLS-1$
- private static final String BUILD_TOP = COMMENT + ".build.toprules"; //$NON-NLS-1$
- private static final String ALL_TARGET = COMMENT + ".build.alltarget"; //$NON-NLS-1$
- private static final String MAINBUILD_TARGET = COMMENT + ".build.mainbuildtarget"; //$NON-NLS-1$
- private static final String BUILD_TARGETS = COMMENT + ".build.toptargets"; //$NON-NLS-1$
- private static final String SRC_LISTS = COMMENT + ".source.list"; //$NON-NLS-1$
+ private static final String MOD_LIST = COMMENT + ".module.list"; //$NON-NLS-1$
+ private static final String MOD_VARS = COMMENT + ".module.variables"; //$NON-NLS-1$
+ private static final String MOD_RULES = COMMENT + ".build.rule"; //$NON-NLS-1$
+ private static final String BUILD_TOP = COMMENT + ".build.toprules"; //$NON-NLS-1$
+ private static final String ALL_TARGET = COMMENT + ".build.alltarget"; //$NON-NLS-1$
+ private static final String MAINBUILD_TARGET = COMMENT + ".build.mainbuildtarget"; //$NON-NLS-1$
+ private static final String BUILD_TARGETS = COMMENT + ".build.toptargets"; //$NON-NLS-1$
+ private static final String SRC_LISTS = COMMENT + ".source.list"; //$NON-NLS-1$
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
private static final String[] EMPTY_STRING_ARRAY = new String[0];
- private static final String OBJS_MACRO = "OBJS"; //$NON-NLS-1$
- private static final String MACRO_ADDITION_ADDPREFIX_HEADER = "${addprefix "; //$NON-NLS-1$
- private static final String MACRO_ADDITION_ADDPREFIX_SUFFIX = "," + WHITESPACE + LINEBREAK; //$NON-NLS-1$
- private static final String MACRO_ADDITION_PREFIX_SUFFIX = "+=" + WHITESPACE + LINEBREAK; //$NON-NLS-1$
+ private static final String OBJS_MACRO = "OBJS"; //$NON-NLS-1$
+ private static final String MACRO_ADDITION_ADDPREFIX_HEADER = "${addprefix "; //$NON-NLS-1$
+ private static final String MACRO_ADDITION_ADDPREFIX_SUFFIX = "," + WHITESPACE + LINEBREAK; //$NON-NLS-1$
+ private static final String MACRO_ADDITION_PREFIX_SUFFIX = "+=" + WHITESPACE + LINEBREAK; //$NON-NLS-1$
private static final String PREBUILD = "pre-build"; //$NON-NLS-1$
private static final String MAINBUILD = "main-build"; //$NON-NLS-1$
private static final String POSTBUILD = "post-build"; //$NON-NLS-1$
private static final String SECONDARY_OUTPUTS = "secondary-outputs"; //$NON-NLS-1$
// Enumerations
- public static final int
- PROJECT_RELATIVE = 1,
- PROJECT_SUBDIR_RELATIVE = 2,
- ABSOLUTE = 3;
+ public static final int PROJECT_RELATIVE = 1, PROJECT_SUBDIR_RELATIVE = 2, ABSOLUTE = 3;
class ToolInfoHolder {
ITool[] buildTools;
@@ -345,20 +345,19 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
List<IPath> dependencyMakefiles;
}
-
// Local variables needed by generator
private String buildTargetName;
private String buildTargetExt;
private IConfiguration config;
private IBuilder builder;
-// private ITool[] buildTools;
-// private boolean[] buildToolsUsed;
-// private ManagedBuildGnuToolInfo[] gnuToolInfos;
+ // private ITool[] buildTools;
+ // private boolean[] buildToolsUsed;
+ // private ManagedBuildGnuToolInfo[] gnuToolInfos;
private PathSettingsContainer toolInfos;
private Vector<IResource> deletedFileList;
private Vector<IResource> deletedDirList;
-// private IManagedBuildInfo info;
-// private IConfiguration cfg
+ // private IManagedBuildInfo info;
+ // private IConfiguration cfg
private Vector<IResource> invalidDirList;
/** Collection of Folders in which sources files have been modified */
private Collection<IContainer> modifiedList;
@@ -366,12 +365,12 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
private IProject project;
private IResource[] projectResources;
private Vector<String> ruleList;
- private Vector<String> depLineList; // String's of additional dependency lines
- private Vector<String> depRuleList; // String's of rules for generating dependency files
+ private Vector<String> depLineList; // String's of additional dependency lines
+ private Vector<String> depRuleList; // String's of rules for generating dependency files
/** Collection of Containers which contribute source files to the build */
private Collection<IContainer> subdirList;
- private IPath topBuildDir; // Build directory - relative to the workspace
-// private Set outputExtensionsSet;
+ private IPath topBuildDir; // Build directory - relative to the workspace
+ // private Set outputExtensionsSet;
//=== Maps of macro names (String) to values (List)
// Map of source file build variable names to a List of source file Path's
private final HashMap<String, List<IPath>> buildSrcVars = new HashMap<String, List<IPath>>();
@@ -381,16 +380,14 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
private final HashMap<String, GnuDependencyGroupInfo> buildDepVars = new HashMap<String, GnuDependencyGroupInfo>();
private final LinkedHashMap<String, String> topBuildOutVars = new LinkedHashMap<String, String>();
// Dependency file variables
-// private Vector dependencyMakefiles; // IPath's - relative to the top build directory or absolute
+ // private Vector dependencyMakefiles; // IPath's - relative to the top build directory or absolute
private ICSourceEntry srcEntries[];
-
public GnuMakefileGenerator() {
super();
}
-
/*************************************************************************
* IManagedBuilderMakefileGenerator M E T H O D S
************************************************************************/
@@ -410,37 +407,32 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Save the monitor reference for reporting back to the user
this.monitor = monitor;
// Get the build info for the project
-// this.info = info;
+ // this.info = info;
// Get the name of the build target
buildTargetName = info.getBuildArtifactName();
// Get its extension
buildTargetExt = info.getBuildArtifactExtension();
- try{
+ try {
//try to resolve the build macros in the target extension
- buildTargetExt = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
- buildTargetExt,
+ buildTargetExt = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(buildTargetExt,
"", //$NON-NLS-1$
" ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- info.getDefaultConfiguration());
- } catch (BuildMacroException e){
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, info.getDefaultConfiguration());
+ } catch (BuildMacroException e) {
}
- try{
+ try {
//try to resolve the build macros in the target name
- String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
- buildTargetName,
+ String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(buildTargetName,
"", //$NON-NLS-1$
" ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- info.getDefaultConfiguration());
- if(resolved != null && (resolved = resolved.trim()).length() > 0)
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, info.getDefaultConfiguration());
+ if (resolved != null && (resolved = resolved.trim()).length() > 0)
buildTargetName = resolved;
- } catch (BuildMacroException e){
+ } catch (BuildMacroException e) {
}
-
if (buildTargetExt == null) {
buildTargetExt = ""; //$NON-NLS-1$
}
@@ -456,27 +448,28 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
* This method calls the dependency postprocessors defined for the tool chain
*/
private void callDependencyPostProcessors(IResourceInfo rcInfo, ToolInfoHolder h, IFile depFile,
- IManagedDependencyGenerator2[] postProcessors, // This array is the same size as the buildTools array and has
- // an entry set when the corresponding tool has a dependency calculator
- boolean callPopulateDummyTargets,
- boolean force) throws CoreException {
+ IManagedDependencyGenerator2[] postProcessors, // This array is the same size as the buildTools array and has
+ // an entry set when the corresponding tool has a dependency calculator
+ boolean callPopulateDummyTargets, boolean force) throws CoreException {
try {
-// IPath path = depFile.getFullPath();
-// path = inFullPathFromOutFullPath(path);
-// IResourceInfo rcInfo = config.getResourceInfo(path, false);
-// IFolderInfo fo;
-// if(rcInfo instanceof IFileInfo){
-// fo = (IFolderInfo)config.getResourceInfo(path.removeLastSegments(1), false);
-// } else {
-// fo = (IFolderInfo)rcInfo;
-// }
-// ToolInfoHolder h = getToolInfo(fo.getPath());
- updateMonitor(ManagedMakeMessages.getFormattedString("GnuMakefileGenerator.message.postproc.dep.file", depFile.getName())); //$NON-NLS-1$
+ // IPath path = depFile.getFullPath();
+ // path = inFullPathFromOutFullPath(path);
+ // IResourceInfo rcInfo = config.getResourceInfo(path, false);
+ // IFolderInfo fo;
+ // if(rcInfo instanceof IFileInfo){
+ // fo = (IFolderInfo)config.getResourceInfo(path.removeLastSegments(1), false);
+ // } else {
+ // fo = (IFolderInfo)rcInfo;
+ // }
+ // ToolInfoHolder h = getToolInfo(fo.getPath());
+ updateMonitor(ManagedMakeMessages.getFormattedString("GnuMakefileGenerator.message.postproc.dep.file", //$NON-NLS-1$
+ depFile.getName()));
if (postProcessors != null) {
- IPath absolutePath = new Path(EFSExtensionManager.getDefault().getPathFromURI(depFile.getLocationURI()));
+ IPath absolutePath = new Path(
+ EFSExtensionManager.getDefault().getPathFromURI(depFile.getLocationURI()));
// Convert to build directory relative
IPath depPath = ManagedBuildManager.calculateRelativePath(getTopBuildDir(), absolutePath);
- for (int i=0; i<postProcessors.length; i++) {
+ for (int i = 0; i < postProcessors.length; i++) {
IManagedDependencyGenerator2 depGen = postProcessors[i];
if (depGen != null) {
depGen.postProcessDependencyFile(depPath, config, h.buildTools[i], getTopBuildDir());
@@ -495,15 +488,14 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
/**
* This method collects the dependency postprocessors and file extensions defined for the tool chain
*/
- private boolean collectDependencyGeneratorInformation(
- ToolInfoHolder h,
- Vector<String> depExts, // Vector of dependency file extensions
- IManagedDependencyGenerator2[] postProcessors) {
+ private boolean collectDependencyGeneratorInformation(ToolInfoHolder h, Vector<String> depExts, // Vector of dependency file extensions
+ IManagedDependencyGenerator2[] postProcessors) {
boolean callPopulateDummyTargets = false;
- for (int i=0; i<h.buildTools.length; i++) {
+ for (int i = 0; i < h.buildTools.length; i++) {
ITool tool = h.buildTools[i];
- IManagedDependencyGeneratorType depType = tool.getDependencyGeneratorForExtension(tool.getDefaultInputExtension());
+ IManagedDependencyGeneratorType depType = tool
+ .getDependencyGeneratorForExtension(tool.getDefaultInputExtension());
if (depType != null) {
int calcType = depType.getCalculatorType();
if (calcType <= IManagedDependencyGeneratorType.TYPE_OLD_TYPE_LIMIT) {
@@ -512,9 +504,9 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
depExts.add(DEP_EXT);
}
} else {
- if (calcType == IManagedDependencyGeneratorType.TYPE_BUILD_COMMANDS ||
- calcType == IManagedDependencyGeneratorType.TYPE_PREBUILD_COMMANDS) {
- IManagedDependencyGenerator2 depGen = (IManagedDependencyGenerator2)depType;
+ if (calcType == IManagedDependencyGeneratorType.TYPE_BUILD_COMMANDS
+ || calcType == IManagedDependencyGeneratorType.TYPE_PREBUILD_COMMANDS) {
+ IManagedDependencyGenerator2 depGen = (IManagedDependencyGenerator2) depType;
String depExt = depGen.getDependencyFileExtension(config, tool);
if (depExt != null) {
postProcessors[i] = depGen;
@@ -527,14 +519,14 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
return callPopulateDummyTargets;
}
- protected boolean isSource(IPath path){
+ protected boolean isSource(IPath path) {
return !CDataUtil.isExcluded(path, srcEntries);
-// path = path.makeRelative();
-// for(int i = 0; i < srcPaths.length; i++){
-// if(srcPaths[i].isPrefixOf(path))
-// return true;
-// }
-// return false;
+ // path = path.makeRelative();
+ // for(int i = 0; i < srcPaths.length; i++){
+ // if(srcPaths[i].isPrefixOf(path))
+ // return true;
+ // }
+ // return false;
}
private class DepInfo {
@@ -552,21 +544,23 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Note: PopulateDummyTargets is a hack for the pre-3.x GCC compilers
// Collect the methods that will need to be called
- toolInfos.accept(new IPathSettingsContainerVisitor(){
+ toolInfos.accept(new IPathSettingsContainerVisitor() {
@Override
- public boolean visit(PathSettingsContainer container){
- ToolInfoHolder h = (ToolInfoHolder)container.getValue();
- Vector<String> depExts = new Vector<String>(); // Vector of dependency file extensions
+ public boolean visit(PathSettingsContainer container) {
+ ToolInfoHolder h = (ToolInfoHolder) container.getValue();
+ Vector<String> depExts = new Vector<String>(); // Vector of dependency file extensions
IManagedDependencyGenerator2[] postProcessors = new IManagedDependencyGenerator2[h.buildTools.length];
boolean callPopulateDummyTargets = collectDependencyGeneratorInformation(h, depExts, postProcessors);
// Is there anyone to call if we do find dependency files?
if (!callPopulateDummyTargets) {
int i;
- for (i=0; i<postProcessors.length; i++) {
- if (postProcessors[i] != null) break;
+ for (i = 0; i < postProcessors.length; i++) {
+ if (postProcessors[i] != null)
+ break;
}
- if (i == postProcessors.length) return true;
+ if (i == postProcessors.length)
+ return true;
}
PathSettingsContainer child = postProcs.getChildContainer(container.getPath(), true, true);
@@ -583,19 +577,20 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
IWorkspaceRoot root = CCorePlugin.getWorkspace().getRoot();
for (IResource res : getSubdirList()) {
// The builder creates a subdir with same name as source in the build location
- IContainer subDir = (IContainer)res;
+ IContainer subDir = (IContainer) res;
IPath projectRelativePath = subDir.getProjectRelativePath();
IResourceInfo rcInfo = config.getResourceInfo(projectRelativePath, false);
PathSettingsContainer cr = postProcs.getChildContainer(rcInfo.getPath(), false, true);
- if(cr == null || cr.getValue() == null)
+ if (cr == null || cr.getValue() == null)
continue;
- DepInfo di = (DepInfo)cr.getValue();
+ DepInfo di = (DepInfo) cr.getValue();
ToolInfoHolder h = getToolInfo(projectRelativePath);
IPath buildRelativePath = topBuildDir.append(projectRelativePath);
IFolder buildFolder = root.getFolder(buildRelativePath);
- if (buildFolder == null) continue;
+ if (buildFolder == null)
+ continue;
// Find all of the dep files in the generated subdirectories
IResource[] files = buildFolder.members();
@@ -604,8 +599,10 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
for (String ext : di.depExts) {
if (ext.equals(fileExt)) {
IFile depFile = root.getFile(file.getFullPath());
- if (depFile == null) continue;
- callDependencyPostProcessors(rcInfo, h, depFile, di.postProcessors, di.callPopulateDummyTargets, false);
+ if (depFile == null)
+ continue;
+ callDependencyPostProcessors(rcInfo, h, depFile, di.postProcessors, di.callPopulateDummyTargets,
+ false);
}
}
}
@@ -632,13 +629,15 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
MultiStatus status;
// Visit the resources in the delta and compile a list of subdirectories to regenerate
- updateMonitor(ManagedMakeMessages.getFormattedString("MakefileGenerator.message.calc.delta", project.getName())); //$NON-NLS-1$
+ updateMonitor(
+ ManagedMakeMessages.getFormattedString("MakefileGenerator.message.calc.delta", project.getName())); //$NON-NLS-1$
ResourceDeltaVisitor visitor = new ResourceDeltaVisitor(this, config);
delta.accept(visitor);
checkCancel();
// Get all the subdirectories participating in the build
- updateMonitor(ManagedMakeMessages.getFormattedString("MakefileGenerator.message.finding.sources", project.getName())); //$NON-NLS-1$
+ updateMonitor(
+ ManagedMakeMessages.getFormattedString("MakefileGenerator.message.finding.sources", project.getName())); //$NON-NLS-1$
ResourceProxyVisitor resourceVisitor = new ResourceProxyVisitor(this, config);
project.accept(resourceVisitor, IResource.NONE);
checkCancel();
@@ -649,18 +648,12 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Make sure there is something to build
if (getSubdirList().isEmpty()) {
- String info = ManagedMakeMessages.getFormattedString("MakefileGenerator.warning.no.source", project.getName()); //$NON-NLS-1$
+ String info = ManagedMakeMessages.getFormattedString("MakefileGenerator.warning.no.source", //$NON-NLS-1$
+ project.getName());
updateMonitor(info);
- status = new MultiStatus(
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
- IStatus.INFO,
- "", //$NON-NLS-1$
+ status = new MultiStatus(ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.INFO, "", //$NON-NLS-1$
null);
- status.add(new Status (
- IStatus.INFO,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
- NO_SOURCE_FOLDERS,
- info,
+ status.add(new Status(IStatus.INFO, ManagedBuilderCorePlugin.getUniqueIdentifier(), NO_SOURCE_FOLDERS, info,
null));
return status;
}
@@ -681,7 +674,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Regenerate any fragments that are missing for the exisiting directories NOT modified
for (IResource res : getSubdirList()) {
- IContainer subdirectory = (IContainer)res;
+ IContainer subdirectory = (IContainer) res;
if (!getModifiedList().contains(subdirectory)) {
// Make sure the directory exists (it may have been deleted)
if (!subdirectory.exists()) {
@@ -689,7 +682,8 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
continue;
}
// Make sure a fragment makefile exists
- IPath fragmentPath = getBuildWorkingDir().append(subdirectory.getProjectRelativePath()).append(MODFILE_NAME);
+ IPath fragmentPath = getBuildWorkingDir().append(subdirectory.getProjectRelativePath())
+ .append(MODFILE_NAME);
IFile makeFragment = project.getFile(fragmentPath);
if (!makeFragment.exists()) {
// If one or both are missing, then add it to the list to be generated
@@ -706,7 +700,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Regenerate any fragments for modified directories
for (IResource res : getModifiedList()) {
- IContainer subDir = (IContainer)res;
+ IContainer subDir = (IContainer) res;
// Make sure the directory exists (it may have been deleted)
if (!subDir.exists()) {
appendDeletedSubdirectory(subDir);
@@ -722,7 +716,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// possibly segmented by subdir so that all fragments didn't need to be
// regenerated
for (IResource res : getSubdirList()) {
- IContainer subDir = (IContainer)res;
+ IContainer subDir = (IContainer) res;
try {
populateFragmentMakefile(subDir);
} catch (CoreException e) {
@@ -733,7 +727,6 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
checkCancel();
}
-
// Calculate the inputs and outputs of the Tools to be generated in the main makefile
calculateToolInputsOutputs();
checkCancel();
@@ -746,34 +739,24 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Remove deleted folders from generated build directory
for (IResource res : getDeletedDirList()) {
- IContainer subDir = (IContainer)res;
+ IContainer subDir = (IContainer) res;
removeGeneratedDirectory(subDir);
checkCancel();
}
// How did we do
if (!getInvalidDirList().isEmpty()) {
- status = new MultiStatus (
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
- IStatus.WARNING,
- "", //$NON-NLS-1$
+ status = new MultiStatus(ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.WARNING, "", //$NON-NLS-1$
null);
// Add a new status for each of the bad folders
// TODO: fix error message
for (IResource res : getInvalidDirList()) {
- IContainer subDir = (IContainer)res;
- status.add(new Status (
- IStatus.WARNING,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
- SPACES_IN_PATH,
- subDir.getFullPath().toString(),
- null));
+ IContainer subDir = (IContainer) res;
+ status.add(new Status(IStatus.WARNING, ManagedBuilderCorePlugin.getUniqueIdentifier(), SPACES_IN_PATH,
+ subDir.getFullPath().toString(), null));
}
} else {
- status = new MultiStatus(
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
- IStatus.OK,
- "", //$NON-NLS-1$
+ status = new MultiStatus(ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.OK, "", //$NON-NLS-1$
null);
}
@@ -811,12 +794,13 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
for (String name : configNames) {
IPath root = new Path(name);
// It is if it is a root of the resource pathname
- if (root.isPrefixOf(path)) return true;
+ if (root.isPrefixOf(path))
+ return true;
}
return false;
}
-
+
private static void save(StringBuffer buffer, IFile file) throws CoreException {
String encoding = null;
try {
@@ -850,22 +834,24 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
final IWorkspaceRoot root = CCorePlugin.getWorkspace().getRoot();
final CoreException[] es = new CoreException[1];
- toolInfos.accept(new IPathSettingsContainerVisitor(){
+ toolInfos.accept(new IPathSettingsContainerVisitor() {
@Override
- public boolean visit(PathSettingsContainer container){
- ToolInfoHolder h = (ToolInfoHolder)container.getValue();
+ public boolean visit(PathSettingsContainer container) {
+ ToolInfoHolder h = (ToolInfoHolder) container.getValue();
// Collect the methods that will need to be called
- Vector<String> depExts = new Vector<String>(); // Vector of dependency file extensions
+ Vector<String> depExts = new Vector<String>(); // Vector of dependency file extensions
IManagedDependencyGenerator2[] postProcessors = new IManagedDependencyGenerator2[h.buildTools.length];
boolean callPopulateDummyTargets = collectDependencyGeneratorInformation(h, depExts, postProcessors);
// Is there anyone to call if we do find dependency files?
if (!callPopulateDummyTargets) {
int i;
- for (i=0; i<postProcessors.length; i++) {
- if (postProcessors[i] != null) break;
+ for (i = 0; i < postProcessors.length; i++) {
+ if (postProcessors[i] != null)
+ break;
}
- if (i == postProcessors.length) return true;
+ if (i == postProcessors.length)
+ return true;
}
IResourceInfo rcInfo = config.getResourceInfo(container.getPath(), false);
@@ -873,9 +859,11 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// The path to search for the dependency makefile
IPath relDepFilePath = topBuildDir.append(path);
IFile depFile = root.getFile(relDepFilePath);
- if (depFile == null || !depFile.isAccessible()) continue;
+ if (depFile == null || !depFile.isAccessible())
+ continue;
try {
- callDependencyPostProcessors(rcInfo, h, depFile, postProcessors, callPopulateDummyTargets, true);
+ callDependencyPostProcessors(rcInfo, h, depFile, postProcessors, callPopulateDummyTargets,
+ true);
} catch (CoreException e) {
es[0] = e;
return false;
@@ -885,7 +873,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
}
});
- if(es[0] != null)
+ if (es[0] != null)
throw es[0];
}
@@ -904,18 +892,12 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Populate the makefile if any buildable source files have been found in the project
if (getSubdirList().isEmpty()) {
- String info = ManagedMakeMessages.getFormattedString("MakefileGenerator.warning.no.source", project.getName()); //$NON-NLS-1$
+ String info = ManagedMakeMessages.getFormattedString("MakefileGenerator.warning.no.source", //$NON-NLS-1$
+ project.getName());
updateMonitor(info);
- status = new MultiStatus(
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
- IStatus.INFO,
- "", //$NON-NLS-1$
+ status = new MultiStatus(ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.INFO, "", //$NON-NLS-1$
null);
- status.add(new Status (
- IStatus.INFO,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
- NO_SOURCE_FOLDERS,
- info,
+ status.add(new Status(IStatus.INFO, ManagedBuilderCorePlugin.getUniqueIdentifier(), NO_SOURCE_FOLDERS, info,
null));
return status;
}
@@ -936,7 +918,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Now populate the module makefiles
for (IResource res : getSubdirList()) {
- IContainer subDir = (IContainer)res;
+ IContainer subDir = (IContainer) res;
try {
populateFragmentMakefile(subDir);
} catch (CoreException e) {
@@ -965,32 +947,21 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// How did we do
if (!getInvalidDirList().isEmpty()) {
- status = new MultiStatus (
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
- IStatus.WARNING,
- "", //$NON-NLS-1$
+ status = new MultiStatus(ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.WARNING, "", //$NON-NLS-1$
null);
// Add a new status for each of the bad folders
// TODO: fix error message
for (IResource dir : getInvalidDirList()) {
- status.add(new Status (
- IStatus.WARNING,
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
- SPACES_IN_PATH,
- dir.getFullPath().toString(),
- null));
+ status.add(new Status(IStatus.WARNING, ManagedBuilderCorePlugin.getUniqueIdentifier(), SPACES_IN_PATH,
+ dir.getFullPath().toString(), null));
}
} else {
- status = new MultiStatus(
- ManagedBuilderCorePlugin.getUniqueIdentifier(),
- IStatus.OK,
- "", //$NON-NLS-1$
+ status = new MultiStatus(ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.OK, "", //$NON-NLS-1$
null);
}
return status;
}
-
/*************************************************************************
* M A K E F I L E S P O P U L A T I O N M E T H O D S
************************************************************************/
@@ -1009,7 +980,8 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
}
IPath moduleOutputPath = buildRoot.append(moduleRelativePath);
- updateMonitor(ManagedMakeMessages.getFormattedString("MakefileGenerator.message.gen.source.makefile", moduleOutputPath.toString())); //$NON-NLS-1$
+ updateMonitor(ManagedMakeMessages.getFormattedString("MakefileGenerator.message.gen.source.makefile", //$NON-NLS-1$
+ moduleOutputPath.toString()));
// Now create the directory
IPath moduleOutputDir = createDirectory(moduleOutputPath.toString());
@@ -1048,7 +1020,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
for (String lib : libs) {
valueList.add(lib);
}
- outputMacros.put("LIBS", valueList); //$NON-NLS-1$
+ outputMacros.put("LIBS", valueList); //$NON-NLS-1$
// Add the extra user-specified objects
valueList = new ArrayList<String>();
@@ -1056,7 +1028,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
for (String obj : userObjs) {
valueList.add(obj);
}
- outputMacros.put("USER_OBJS", valueList); //$NON-NLS-1$
+ outputMacros.put("USER_OBJS", valueList); //$NON-NLS-1$
// Write every macro to the file
for (Entry<String, List<String>> entry : outputMacros.entrySet()) {
@@ -1080,7 +1052,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
macroBuffer.append(NEWLINE);
}
- // For now, just save the buffer that was populated when the rules were created
+ // For now, just save the buffer that was populated when the rules were created
save(macroBuffer, fileHandle);
}
@@ -1093,34 +1065,35 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
toolInfos.accept(new IPathSettingsContainerVisitor() {
@Override
- public boolean visit(PathSettingsContainer container){
- ToolInfoHolder h = (ToolInfoHolder)container.getValue();
+ public boolean visit(PathSettingsContainer container) {
+ ToolInfoHolder h = (ToolInfoHolder) container.getValue();
ITool[] buildTools = h.buildTools;
- HashSet<String> handledInputExtensions = new HashSet<String>();
+ HashSet<String> handledInputExtensions = new HashSet<String>();
String buildMacro;
for (ITool buildTool : buildTools) {
- if(buildTool.getCustomBuildStep())
+ if (buildTool.getCustomBuildStep())
continue;
// Add the known sources macros
- String[] extensionsList = buildTool.getAllInputExtensions();
- for (String ext : extensionsList) {
- // create a macro of the form "EXTENSION_SRCS :="
- String extensionName = ext;
- if(//!getOutputExtensions().contains(extensionName) &&
- !handledInputExtensions.contains(extensionName)) {
- handledInputExtensions.add(extensionName);
- buildMacro = getSourceMacroName(extensionName).toString();
+ String[] extensionsList = buildTool.getAllInputExtensions();
+ for (String ext : extensionsList) {
+ // create a macro of the form "EXTENSION_SRCS :="
+ String extensionName = ext;
+ if (//!getOutputExtensions().contains(extensionName) &&
+ !handledInputExtensions.contains(extensionName)) {
+ handledInputExtensions.add(extensionName);
+ buildMacro = getSourceMacroName(extensionName).toString();
if (!buildSrcVars.containsKey(buildMacro)) {
buildSrcVars.put(buildMacro, new ArrayList<IPath>());
}
// Add any generated dependency file macros
- IManagedDependencyGeneratorType depType = buildTool.getDependencyGeneratorForExtension(extensionName);
- if (depType != null) {
- int calcType = depType.getCalculatorType();
- if (calcType == IManagedDependencyGeneratorType.TYPE_COMMAND ||
- calcType == IManagedDependencyGeneratorType.TYPE_BUILD_COMMANDS ||
- calcType == IManagedDependencyGeneratorType.TYPE_PREBUILD_COMMANDS) {
- buildMacro = getDepMacroName(extensionName).toString();
+ IManagedDependencyGeneratorType depType = buildTool
+ .getDependencyGeneratorForExtension(extensionName);
+ if (depType != null) {
+ int calcType = depType.getCalculatorType();
+ if (calcType == IManagedDependencyGeneratorType.TYPE_COMMAND
+ || calcType == IManagedDependencyGeneratorType.TYPE_BUILD_COMMANDS
+ || calcType == IManagedDependencyGeneratorType.TYPE_PREBUILD_COMMANDS) {
+ buildMacro = getDepMacroName(extensionName).toString();
if (!buildDepVars.containsKey(buildMacro)) {
buildDepVars.put(buildMacro, new GnuDependencyGroupInfo(buildMacro,
(calcType != IManagedDependencyGeneratorType.TYPE_PREBUILD_COMMANDS)));
@@ -1128,10 +1101,10 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
if (!buildOutVars.containsKey(buildMacro)) {
buildOutVars.put(buildMacro, new ArrayList<IPath>());
}
- }
- }
- }
- }
+ }
+ }
+ }
+ }
// Add the specified output build variables
IOutputType[] outTypes = buildTool.getOutputTypes();
if (outTypes != null && outTypes.length > 0) {
@@ -1201,7 +1174,6 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
save(buffer, fileHandle);
}
-
/*************************************************************************
* M A I N (makefile) M A K E F I L E M E T H O D S
************************************************************************/
@@ -1234,10 +1206,9 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
String cleanCommand = config.getCleanCommand();
try {
- cleanCommand = ManagedBuildManager.getBuildMacroProvider()
- .resolveValueToMakefileFormat(config.getCleanCommand(),
- EMPTY_STRING, WHITESPACE,
- IBuildMacroProvider.CONTEXT_CONFIGURATION, config);
+ cleanCommand = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
+ config.getCleanCommand(), EMPTY_STRING, WHITESPACE, IBuildMacroProvider.CONTEXT_CONFIGURATION,
+ config);
} catch (BuildMacroException e) {
}
@@ -1246,19 +1217,21 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
buffer.append(NEWLINE);
// Now add the source providers
- buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(SRC_LISTS)).append(NEWLINE);
+ buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(SRC_LISTS))
+ .append(NEWLINE);
buffer.append("-include sources.mk").append(NEWLINE); //$NON-NLS-1$
// Add includes for each subdir in child-subdir-first order (required for makefile rule matching to work).
List<String> subDirList = new ArrayList<String>();
for (IContainer subDir : getSubdirList()) {
String projectRelativePath = subDir.getProjectRelativePath().toString();
- if(!projectRelativePath.isEmpty())
+ if (!projectRelativePath.isEmpty())
subDirList.add(0, projectRelativePath);
}
Collections.sort(subDirList, Collections.reverseOrder());
for (String dir : subDirList) {
- buffer.append("-include ").append(escapeWhitespaces(dir)).append(SEPARATOR).append("subdir.mk").append(NEWLINE); //$NON-NLS-1$ //$NON-NLS-2$
+ buffer.append("-include ").append(escapeWhitespaces(dir)).append(SEPARATOR).append("subdir.mk") //$NON-NLS-1$//$NON-NLS-2$
+ .append(NEWLINE);
}
buffer.append("-include subdir.mk").append(NEWLINE); //$NON-NLS-1$
@@ -1286,7 +1259,6 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Include makefile.defs supplemental makefile
buffer.append("-include ").append(ROOT).append(SEPARATOR).append(MAKEFILE_DEFS).append(NEWLINE); //$NON-NLS-1$
-
return (buffer.append(NEWLINE));
}
@@ -1299,33 +1271,25 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
private StringBuffer addTargets(List<String> outputVarsAdditionsList, boolean rebuild) {
StringBuffer buffer = new StringBuffer();
-// IConfiguration config = info.getDefaultConfiguration();
+ // IConfiguration config = info.getDefaultConfiguration();
// Assemble the information needed to generate the targets
String prebuildStep = config.getPrebuildStep();
- try{
+ try {
//try to resolve the build macros in the prebuild step
- prebuildStep = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
- prebuildStep,
- EMPTY_STRING,
- WHITESPACE,
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- config);
- } catch (BuildMacroException e){
+ prebuildStep = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(prebuildStep,
+ EMPTY_STRING, WHITESPACE, IBuildMacroProvider.CONTEXT_CONFIGURATION, config);
+ } catch (BuildMacroException e) {
}
prebuildStep = prebuildStep.trim(); // Remove leading and trailing whitespace (and control characters)
String postbuildStep = config.getPostbuildStep();
- try{
+ try {
//try to resolve the build macros in the postbuild step
- postbuildStep = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
- postbuildStep,
- EMPTY_STRING,
- WHITESPACE,
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- config);
+ postbuildStep = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(postbuildStep,
+ EMPTY_STRING, WHITESPACE, IBuildMacroProvider.CONTEXT_CONFIGURATION, config);
- } catch (BuildMacroException e){
+ } catch (BuildMacroException e) {
}
postbuildStep = postbuildStep.trim(); // Remove leading and trailing whitespace (and control characters)
String preannouncebuildStep = config.getPreannouncebuildStep();
@@ -1333,26 +1297,27 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
String targets = rebuild ? "clean all" : "all"; //$NON-NLS-1$ //$NON-NLS-2$
ITool targetTool = config.calculateTargetTool();
-// if (targetTool == null) {
-// targetTool = info.getToolFromOutputExtension(buildTargetExt);
-// }
+ // if (targetTool == null) {
+ // targetTool = info.getToolFromOutputExtension(buildTargetExt);
+ // }
// Get all the projects the build target depends on
// If this configuration produces a static archive, building the archive doesn't depend on the output
// from any of the referenced configurations
IConfiguration[] refConfigs = new IConfiguration[0];
- if (config.getBuildArtefactType() == null || !ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_STATICLIB.equals(config.getBuildArtefactType().getId()))
+ if (config.getBuildArtefactType() == null || !ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_STATICLIB
+ .equals(config.getBuildArtefactType().getId()))
refConfigs = ManagedBuildManager.getReferencedConfigurations(config);
-/* try {
- refdProjects = project.getReferencedProjects();
- } catch (CoreException e) {
- // There are 2 exceptions; the project does not exist or it is not open
- // and neither conditions apply if we are building for it ....
- }
-*/
+ /* try {
+ refdProjects = project.getReferencedProjects();
+ } catch (CoreException e) {
+ // There are 2 exceptions; the project does not exist or it is not open
+ // and neither conditions apply if we are building for it ....
+ }
+ */
// If a prebuild step exists, redefine the all target to be
- // all:
+ // all:
// $(MAKE) pre-build
// $(MAKE) main-build
// and then reset the "traditional" all target to main-build
@@ -1364,12 +1329,15 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
if (prebuildStep.length() > 0) {
// Add the comment for the "All" target
- buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(ALL_TARGET)).append(NEWLINE);
+ buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(ALL_TARGET))
+ .append(NEWLINE);
// Invoke make multiple times to ensure pre-build is executed before main-build
buffer.append(defaultTarget).append(NEWLINE);
- buffer.append(TAB).append(MAKE).append(WHITESPACE).append(NO_PRINT_DIR).append(WHITESPACE).append(PREBUILD).append(NEWLINE);
- buffer.append(TAB).append(MAKE).append(WHITESPACE).append(NO_PRINT_DIR).append(WHITESPACE).append(MAINBUILD).append(NEWLINE);
+ buffer.append(TAB).append(MAKE).append(WHITESPACE).append(NO_PRINT_DIR).append(WHITESPACE).append(PREBUILD)
+ .append(NEWLINE);
+ buffer.append(TAB).append(MAKE).append(WHITESPACE).append(NO_PRINT_DIR).append(WHITESPACE).append(MAINBUILD)
+ .append(NEWLINE);
buffer.append(NEWLINE);
// Update the defaultTarget, main-build, by adding a colon, which is
@@ -1377,11 +1345,12 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
defaultTarget = MAINBUILD.concat(COLON);
// Add the comment for the "main-build" target
- buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(MAINBUILD_TARGET)).append(NEWLINE);
- }
- else
+ buffer.append(COMMENT_SYMBOL).append(WHITESPACE)
+ .append(ManagedMakeMessages.getResourceString(MAINBUILD_TARGET)).append(NEWLINE);
+ } else
// Add the comment for the "All" target
- buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(ALL_TARGET)).append(NEWLINE);
+ buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(ALL_TARGET))
+ .append(NEWLINE);
// Write out the all target first in case someone just runs make
// all: <target_name> or mainbuild: <target_name>
@@ -1409,78 +1378,74 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
* are captured in the deps target: deps: <cd <Proj_Dep_1/build_dir>;
* $(MAKE) [clean all | all]>
*/
-// Vector managedProjectOutputs = new Vector(refdProjects.length);
-// if (refdProjects.length > 0) {
+ // Vector managedProjectOutputs = new Vector(refdProjects.length);
+ // if (refdProjects.length > 0) {
Vector<String> managedProjectOutputs = new Vector<String>(refConfigs.length);
if (refConfigs.length > 0) {
boolean addDeps = true;
-// if (refdProjects != null) {
- for (IConfiguration depCfg : refConfigs) {
-// IProject dep = refdProjects[i];
- if(!depCfg.isManagedBuildOn())
- continue;
+ // if (refdProjects != null) {
+ for (IConfiguration depCfg : refConfigs) {
+ // IProject dep = refdProjects[i];
+ if (!depCfg.isManagedBuildOn())
+ continue;
-// if (!dep.exists()) continue;
- if (addDeps) {
- buffer.append("dependents:").append(NEWLINE); //$NON-NLS-1$
- addDeps = false;
- }
- String buildDir = depCfg.getOwner().getLocation().toString();
- String depTargets = targets;
-// if (ManagedBuildManager.manages(dep)) {
- // Add the current configuration to the makefile path
-// IManagedBuildInfo depInfo = ManagedBuildManager.getBuildInfo(dep);
- buildDir += SEPARATOR + depCfg.getName();
-
- // Extract the build artifact to add to the dependency list
- String depTarget = depCfg.getArtifactName();
- String depExt = depCfg.getArtifactExtension();
-
- try{
- //try to resolve the build macros in the artifact extension
- depExt = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
- depExt,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- depCfg);
- } catch (BuildMacroException e){
- }
+ // if (!dep.exists()) continue;
+ if (addDeps) {
+ buffer.append("dependents:").append(NEWLINE); //$NON-NLS-1$
+ addDeps = false;
+ }
+ String buildDir = depCfg.getOwner().getLocation().toString();
+ String depTargets = targets;
+ // if (ManagedBuildManager.manages(dep)) {
+ // Add the current configuration to the makefile path
+ // IManagedBuildInfo depInfo = ManagedBuildManager.getBuildInfo(dep);
+ buildDir += SEPARATOR + depCfg.getName();
- try{
- //try to resolve the build macros in the artifact name
- String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
- depTarget,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- depCfg);
- if((resolved = resolved.trim()).length() > 0)
- depTarget = resolved;
- } catch (BuildMacroException e){
- }
+ // Extract the build artifact to add to the dependency list
+ String depTarget = depCfg.getArtifactName();
+ String depExt = depCfg.getArtifactExtension();
- String depPrefix = depCfg.getOutputPrefix(depExt);
- if (depCfg.needsRebuild()) {
- depTargets = "clean all"; //$NON-NLS-1$
- }
- String dependency = buildDir + SEPARATOR + depPrefix + depTarget;
- if (depExt.length() > 0) {
- dependency += DOT + depExt;
- }
- dependency = escapeWhitespaces(dependency);
- managedProjectOutputs.add(dependency);
- //}
- buffer.append(TAB).append("-cd").append(WHITESPACE).append(escapeWhitespaces(buildDir)) //$NON-NLS-1$
- .append(WHITESPACE).append(LOGICAL_AND).append(WHITESPACE).append("$(MAKE) ").append(depTargets).append(NEWLINE); //$NON-NLS-1$
+ try {
+ //try to resolve the build macros in the artifact extension
+ depExt = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(depExt, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, depCfg);
+ } catch (BuildMacroException e) {
+ }
+
+ try {
+ //try to resolve the build macros in the artifact name
+ String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
+ depTarget, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, depCfg);
+ if ((resolved = resolved.trim()).length() > 0)
+ depTarget = resolved;
+ } catch (BuildMacroException e) {
}
-// }
+
+ String depPrefix = depCfg.getOutputPrefix(depExt);
+ if (depCfg.needsRebuild()) {
+ depTargets = "clean all"; //$NON-NLS-1$
+ }
+ String dependency = buildDir + SEPARATOR + depPrefix + depTarget;
+ if (depExt.length() > 0) {
+ dependency += DOT + depExt;
+ }
+ dependency = escapeWhitespaces(dependency);
+ managedProjectOutputs.add(dependency);
+ //}
+ buffer.append(TAB).append("-cd").append(WHITESPACE).append(escapeWhitespaces(buildDir)) //$NON-NLS-1$
+ .append(WHITESPACE).append(LOGICAL_AND).append(WHITESPACE).append("$(MAKE) ").append(depTargets) //$NON-NLS-1$
+ .append(NEWLINE);
+ }
+ // }
buffer.append(NEWLINE);
}
// Add the targets tool rules
- buffer.append(addTargetsRules(targetTool,
- outputVarsAdditionsList, managedProjectOutputs, (postbuildStep.length() > 0)));
+ buffer.append(addTargetsRules(targetTool, outputVarsAdditionsList, managedProjectOutputs,
+ (postbuildStep.length() > 0)));
// Add the prebuild step target, if specified
if (prebuildStep.length() > 0) {
@@ -1506,7 +1471,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
if (secondaryOutputs.length > 0) {
buffer.append(SECONDARY_OUTPUTS).append(COLON);
Vector<String> outs2 = calculateSecondaryOutputs(secondaryOutputs);
- for (int i=0; i<outs2.size(); i++) {
+ for (int i = 0; i < outs2.size(); i++) {
buffer.append(WHITESPACE).append("$(").append(outs2.get(i)).append(')'); //$NON-NLS-1$
}
buffer.append(NEWLINE).append(NEWLINE);
@@ -1530,7 +1495,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
buffer.append("-include ").append(ROOT).append(SEPARATOR).append(MAKEFILE_TARGETS).append(NEWLINE); //$NON-NLS-1$
return buffer;
- }
+ }
/**
* Returns the targets rules. The targets make file (top makefile) contains:
@@ -1542,13 +1507,14 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
* @param managedProjectOutputs Other projects in the workspace that this project depends upon
* @return StringBuffer
*/
- private StringBuffer addTargetsRules(ITool targetTool,
- List<String> outputVarsAdditionsList, Vector<String> managedProjectOutputs, boolean postbuildStep) {
+ private StringBuffer addTargetsRules(ITool targetTool, List<String> outputVarsAdditionsList,
+ Vector<String> managedProjectOutputs, boolean postbuildStep) {
StringBuffer buffer = new StringBuffer();
// Add the comment
- buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(BUILD_TOP)).append(NEWLINE);
+ buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(BUILD_TOP))
+ .append(NEWLINE);
- ToolInfoHolder h = (ToolInfoHolder)toolInfos.getValue();
+ ToolInfoHolder h = (ToolInfoHolder) toolInfos.getValue();
ITool[] buildTools = h.buildTools;
boolean[] buildToolsUsed = h.buildToolsUsed;
// Get the target tool and generate the rule
@@ -1556,11 +1522,10 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Note that the name of the target we pass to addRuleForTool does not
// appear to be used there (and tool outputs are consulted directly), but
// we quote it anyway just in case it starts to use it in future.
- if (addRuleForTool(targetTool, buffer, true,
- ensurePathIsGNUMakeTargetRuleCompatibleSyntax(buildTargetName), buildTargetExt,
- outputVarsAdditionsList, managedProjectOutputs, postbuildStep)) {
+ if (addRuleForTool(targetTool, buffer, true, ensurePathIsGNUMakeTargetRuleCompatibleSyntax(buildTargetName),
+ buildTargetExt, outputVarsAdditionsList, managedProjectOutputs, postbuildStep)) {
// Mark the target tool as processed
- for (int i=0; i<buildTools.length; i++) {
+ for (int i = 0; i < buildTools.length; i++) {
if (targetTool == buildTools[i]) {
buildToolsUsed[i] = true;
}
@@ -1573,7 +1538,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Generate the rules for all Tools that specify InputType.multipleOfType, and any Tools that
// consume the output of those tools. This does not apply to pre-3.0 integrations, since
// the only "multipleOfType" tool is the "target" tool
- for (int i=0; i<buildTools.length; i++) {
+ for (int i = 0; i < buildTools.length; i++) {
ITool tool = buildTools[i];
IInputType type = tool.getPrimaryInputType();
if (type != null && type.getMultipleOfType()) {
@@ -1588,7 +1553,8 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
}
// Add the comment
- buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(BUILD_TARGETS)).append(NEWLINE);
+ buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(BUILD_TARGETS))
+ .append(NEWLINE);
// Always add a clean target
buffer.append("clean:").append(NEWLINE); //$NON-NLS-1$
@@ -1627,8 +1593,9 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
* @param managedProjectOutputs Other projects in the workspace that this project depends upon
* @param bEmitPostBuildStepCall Emit post-build step invocation
*/
- protected boolean addRuleForTool(ITool tool, StringBuffer buffer, boolean bTargetTool, String targetName, String targetExt,
- List<String> outputVarsAdditionsList, Vector<String> managedProjectOutputs, boolean bEmitPostBuildStepCall) {
+ protected boolean addRuleForTool(ITool tool, StringBuffer buffer, boolean bTargetTool, String targetName,
+ String targetExt, List<String> outputVarsAdditionsList, Vector<String> managedProjectOutputs,
+ boolean bEmitPostBuildStepCall) {
// Get the tool's inputs and outputs
Vector<String> inputs = new Vector<String>();
@@ -1640,9 +1607,8 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
Vector<String> additionalTargets = new Vector<String>();
String outputPrefix = EMPTY_STRING;
- if (!getToolInputsOutputs(tool, inputs, dependencies, outputs,
- enumeratedPrimaryOutputs, enumeratedSecondaryOutputs,
- outputVariables, additionalTargets, bTargetTool, managedProjectOutputs)) {
+ if (!getToolInputsOutputs(tool, inputs, dependencies, outputs, enumeratedPrimaryOutputs,
+ enumeratedSecondaryOutputs, outputVariables, additionalTargets, bTargetTool, managedProjectOutputs)) {
return false;
}
@@ -1662,7 +1628,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
String primaryOutputs = EMPTY_STRING;
String primaryOutputsQuoted = EMPTY_STRING;
boolean first = true;
- for (int i=0; i<enumeratedPrimaryOutputs.size(); i++) {
+ for (int i = 0; i < enumeratedPrimaryOutputs.size(); i++) {
String output = enumeratedPrimaryOutputs.get(i);
if (!first) {
primaryOutputs += WHITESPACE;
@@ -1677,9 +1643,10 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
first = true;
String calculatedDependencies = EMPTY_STRING;
- for (int i=0; i<dependencies.size(); i++) {
+ for (int i = 0; i < dependencies.size(); i++) {
String input = dependencies.get(i);
- if (!first) calculatedDependencies += WHITESPACE;
+ if (!first)
+ calculatedDependencies += WHITESPACE;
first = false;
calculatedDependencies += input;
}
@@ -1687,8 +1654,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// We can't have duplicates in a makefile
if (getRuleList().contains(buildRule)) {
- }
- else {
+ } else {
getRuleList().add(buildRule);
buffer.append(buildRule).append(NEWLINE);
if (bTargetTool) {
@@ -1699,59 +1665,53 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Get the command line for this tool invocation
String[] flags;
try {
- flags = tool.getToolCommandFlags(null,null);
- } catch( BuildException ex ) {
+ flags = tool.getToolCommandFlags(null, null);
+ } catch (BuildException ex) {
// TODO report error
flags = EMPTY_STRING_ARRAY;
}
String command = tool.getToolCommand();
- try{
+ try {
//try to resolve the build macros in the tool command
- String resolvedCommand = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(command,
- EMPTY_STRING,
- WHITESPACE,
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(null,null,null,tool));
- if((resolvedCommand = resolvedCommand.trim()).length() > 0)
+ String resolvedCommand = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
+ command, EMPTY_STRING, WHITESPACE, IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(null, null, null, tool));
+ if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
command = resolvedCommand;
- } catch (BuildMacroException e){
+ } catch (BuildMacroException e) {
}
String[] cmdInputs = inputs.toArray(new String[inputs.size()]);
IManagedCommandLineGenerator gen = tool.getCommandLineGenerator();
- IManagedCommandLineInfo cmdLInfo = gen.generateCommandLineInfo( tool, command,
- flags, outflag, outputPrefix, primaryOutputs, cmdInputs, tool.getCommandLinePattern() );
+ IManagedCommandLineInfo cmdLInfo = gen.generateCommandLineInfo(tool, command, flags, outflag, outputPrefix,
+ primaryOutputs, cmdInputs, tool.getCommandLinePattern());
// The command to build
String buildCmd = null;
- if( cmdLInfo == null ) {
+ if (cmdLInfo == null) {
String toolFlags;
try {
- toolFlags = tool.getToolCommandFlagsString(null,null);
- } catch( BuildException ex ) {
+ toolFlags = tool.getToolCommandFlagsString(null, null);
+ } catch (BuildException ex) {
// TODO report error
toolFlags = EMPTY_STRING;
}
- buildCmd = command + WHITESPACE + toolFlags + WHITESPACE + outflag + WHITESPACE + outputPrefix + primaryOutputs + WHITESPACE + IN_MACRO;
- }
- else buildCmd = cmdLInfo.getCommandLine();
-
- // resolve any remaining macros in the command after it has been
- // generated
- try {
- String resolvedCommand = ManagedBuildManager
- .getBuildMacroProvider().resolveValueToMakefileFormat(
- buildCmd,
- EMPTY_STRING,
- WHITESPACE,
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(null, null, null, tool));
- if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
- buildCmd = resolvedCommand;
+ buildCmd = command + WHITESPACE + toolFlags + WHITESPACE + outflag + WHITESPACE + outputPrefix
+ + primaryOutputs + WHITESPACE + IN_MACRO;
+ } else
+ buildCmd = cmdLInfo.getCommandLine();
- } catch (BuildMacroException e) {
- }
+ // resolve any remaining macros in the command after it has been
+ // generated
+ try {
+ String resolvedCommand = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
+ buildCmd, EMPTY_STRING, WHITESPACE, IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(null, null, null, tool));
+ if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
+ buildCmd = resolvedCommand;
+ } catch (BuildMacroException e) {
+ }
//buffer.append(TAB).append(AT).append(escapedEcho(buildCmd));
//buffer.append(TAB).append(AT).append(buildCmd);
@@ -1762,19 +1722,20 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Echo finished message
buffer.append(NEWLINE);
- buffer.append(TAB).append(AT).append(escapedEcho((bTargetTool ? MESSAGE_FINISH_BUILD : MESSAGE_FINISH_FILE) + WHITESPACE + OUT_MACRO));
+ buffer.append(TAB).append(AT).append(
+ escapedEcho((bTargetTool ? MESSAGE_FINISH_BUILD : MESSAGE_FINISH_FILE) + WHITESPACE + OUT_MACRO));
buffer.append(TAB).append(AT).append(ECHO_BLANK_LINE);
// If there is a post build step, then add a recursive invocation of MAKE to invoke it after the main build
- // Note that $(MAKE) will instantiate in the recusive invocation to the make command that was used to invoke
- // the makefile originally
- if (bEmitPostBuildStepCall) {
- buffer.append(TAB).append(MAKE).append(WHITESPACE).append(NO_PRINT_DIR).append(WHITESPACE).append(POSTBUILD).append(NEWLINE).append(NEWLINE);
- }
- else {
+ // Note that $(MAKE) will instantiate in the recusive invocation to the make command that was used to invoke
+ // the makefile originally
+ if (bEmitPostBuildStepCall) {
+ buffer.append(TAB).append(MAKE).append(WHITESPACE).append(NO_PRINT_DIR).append(WHITESPACE)
+ .append(POSTBUILD).append(NEWLINE).append(NEWLINE);
+ } else {
// Just emit a blank line
buffer.append(NEWLINE);
- }
+ }
}
// If we have secondary outputs, output dependency rules without commands
@@ -1783,9 +1744,10 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
Vector<String> addlOutputs = new Vector<String>();
addlOutputs.addAll(enumeratedSecondaryOutputs);
addlOutputs.addAll(additionalTargets);
- for (int i=0; i<addlOutputs.size(); i++) {
+ for (int i = 0; i < addlOutputs.size(); i++) {
String output = addlOutputs.get(i);
- String depLine = output + COLON + WHITESPACE + primaryOutput + WHITESPACE + calculatedDependencies + NEWLINE;
+ String depLine = output + COLON + WHITESPACE + primaryOutput + WHITESPACE + calculatedDependencies
+ + NEWLINE;
if (!getDepLineList().contains(depLine)) {
getDepLineList().add(depLine);
buffer.append(depLine);
@@ -1800,27 +1762,27 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
* @param outputVarsAdditionsList list to add needed build output variables to
* @param buffer buffer to add rules to
*/
- private void generateRulesForConsumers(ITool generatingTool, List<String> outputVarsAdditionsList, StringBuffer buffer) {
+ private void generateRulesForConsumers(ITool generatingTool, List<String> outputVarsAdditionsList,
+ StringBuffer buffer) {
// Generate a build rule for any tool that consumes the output of this tool
- ToolInfoHolder h = (ToolInfoHolder)toolInfos.getValue();
- ITool[] buildTools = h.buildTools;
- boolean[] buildToolsUsed = h.buildToolsUsed;
+ ToolInfoHolder h = (ToolInfoHolder) toolInfos.getValue();
+ ITool[] buildTools = h.buildTools;
+ boolean[] buildToolsUsed = h.buildToolsUsed;
IOutputType[] outTypes = generatingTool.getOutputTypes();
for (IOutputType outType : outTypes) {
String[] outExts = outType.getOutputExtensions(generatingTool);
String outVariable = outType.getBuildVariable();
if (outExts != null) {
for (String outExt : outExts) {
- for (int k=0; k<buildTools.length; k++) {
+ for (int k = 0; k < buildTools.length; k++) {
ITool tool = buildTools[k];
if (!buildToolsUsed[k]) {
// Also has to match build variables if specified
IInputType inType = tool.getInputType(outExt);
if (inType != null) {
String inVariable = inType.getBuildVariable();
- if ((outVariable == null && inVariable == null) ||
- (outVariable != null && inVariable != null &&
- outVariable.equals(inVariable))) {
+ if ((outVariable == null && inVariable == null) || (outVariable != null
+ && inVariable != null && outVariable.equals(inVariable))) {
if (addRuleForTool(buildTools[k], buffer, false, null, null,
outputVarsAdditionsList, null, false)) {
buildToolsUsed[k] = true;
@@ -1836,24 +1798,24 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
}
}
- protected boolean getToolInputsOutputs(ITool tool,
- Vector<String> inputs, Vector<String> dependencies, Vector<String> outputs,
- Vector<String> enumeratedPrimaryOutputs, Vector<String> enumeratedSecondaryOutputs,
- Vector<String> outputVariables, Vector<String> additionalTargets,
- boolean bTargetTool, Vector<String> managedProjectOutputs) {
- ToolInfoHolder h = (ToolInfoHolder)toolInfos.getValue();
- ITool[] buildTools = h.buildTools;
- ManagedBuildGnuToolInfo[] gnuToolInfos = h.gnuToolInfos;
+ protected boolean getToolInputsOutputs(ITool tool, Vector<String> inputs, Vector<String> dependencies,
+ Vector<String> outputs, Vector<String> enumeratedPrimaryOutputs, Vector<String> enumeratedSecondaryOutputs,
+ Vector<String> outputVariables, Vector<String> additionalTargets, boolean bTargetTool,
+ Vector<String> managedProjectOutputs) {
+ ToolInfoHolder h = (ToolInfoHolder) toolInfos.getValue();
+ ITool[] buildTools = h.buildTools;
+ ManagedBuildGnuToolInfo[] gnuToolInfos = h.gnuToolInfos;
// Get the information regarding the tool's inputs and outputs from the objects
// created by calculateToolInputsOutputs
IManagedBuildGnuToolInfo toolInfo = null;
- for (int i=0; i<buildTools.length; i++) {
+ for (int i = 0; i < buildTools.length; i++) {
if (tool == buildTools[i]) {
toolInfo = gnuToolInfos[i];
break;
}
}
- if (toolInfo == null) return false;
+ if (toolInfo == null)
+ return false;
// Populate the output Vectors
inputs.addAll(toolInfo.getCommandInputs());
@@ -1877,19 +1839,18 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
}
protected Vector<String> calculateSecondaryOutputs(IOutputType[] secondaryOutputs) {
- ToolInfoHolder h = (ToolInfoHolder)toolInfos.getValue();
+ ToolInfoHolder h = (ToolInfoHolder) toolInfos.getValue();
ITool[] buildTools = h.buildTools;
Vector<String> buildVars = new Vector<String>();
- for (int i=0; i<buildTools.length; i++) {
+ for (int i = 0; i < buildTools.length; i++) {
// Add the specified output build variables
IOutputType[] outTypes = buildTools[i].getOutputTypes();
if (outTypes != null && outTypes.length > 0) {
- for (int j=0; j<outTypes.length; j++) {
+ for (int j = 0; j < outTypes.length; j++) {
IOutputType outType = outTypes[j];
// Is this one of the secondary outputs?
// Look for an outputType with this ID, or one with a superclass with this id
- thisType:
- for (int k = 0; k < secondaryOutputs.length; k++) {
+ thisType: for (int k = 0; k < secondaryOutputs.length; k++) {
IOutputType matchType = outType;
do {
if (matchType.getId().equals(secondaryOutputs[k].getId())) {
@@ -1938,13 +1899,15 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
private StringBuffer addSubdirectories() {
StringBuffer buffer = new StringBuffer();
// Add the comment
- buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(MOD_LIST)).append(NEWLINE);
+ buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(MOD_LIST))
+ .append(NEWLINE);
buffer.append("SUBDIRS := ").append(LINEBREAK); //$NON-NLS-1$
// Get all the module names
for (IResource container : getSubdirList()) {
- updateMonitor(ManagedMakeMessages.getFormattedString("MakefileGenerator.message.adding.source.folder", container.getFullPath().toString())); //$NON-NLS-1$
+ updateMonitor(ManagedMakeMessages.getFormattedString("MakefileGenerator.message.adding.source.folder", //$NON-NLS-1$
+ container.getFullPath().toString()));
// Check the special case where the module is the project root
if (container.getFullPath() == project.getFullPath()) {
buffer.append(DOT).append(WHITESPACE).append(LINEBREAK);
@@ -1958,7 +1921,6 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
return buffer;
}
-
/*************************************************************************
* F R A G M E N T (subdir.mk) M A K E F I L E M E T H O D S
************************************************************************/
@@ -1982,13 +1944,13 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Calculate the new directory relative to the build output
IPath moduleRelativePath = module.getProjectRelativePath();
String relativePath = moduleRelativePath.toString();
- relativePath += relativePath.length() == 0 ? "" : SEPARATOR; //$NON-NLS-1$
+ relativePath += relativePath.length() == 0 ? "" : SEPARATOR; //$NON-NLS-1$
- // For build macros in the configuration, create a map which will map them
+ // For build macros in the configuration, create a map which will map them
// to a string which holds its list of sources.
- LinkedHashMap<String, String> buildVarToRuleStringMap = new LinkedHashMap<String, String>();
+ LinkedHashMap<String, String> buildVarToRuleStringMap = new LinkedHashMap<String, String>();
- // Add statements that add the source files in this folder,
+ // Add statements that add the source files in this folder,
// and generated source files, and generated dependency files
// to the build macros
for (Entry<String, List<IPath>> entry : buildSrcVars.entrySet()) {
@@ -1998,12 +1960,13 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
}
for (Entry<String, List<IPath>> entry : buildOutVars.entrySet()) {
String macroName = entry.getKey();
- addMacroAdditionPrefix(buildVarToRuleStringMap, macroName, "./" + relativePath, false); //$NON-NLS-1$
+ addMacroAdditionPrefix(buildVarToRuleStringMap, macroName, "./" + relativePath, false); //$NON-NLS-1$
}
- // String buffers
- StringBuffer buffer = new StringBuffer(); // Return buffer
- StringBuffer ruleBuffer = new StringBuffer(COMMENT_SYMBOL + WHITESPACE + ManagedMakeMessages.getResourceString(MOD_RULES) + NEWLINE);
+ // String buffers
+ StringBuffer buffer = new StringBuffer(); // Return buffer
+ StringBuffer ruleBuffer = new StringBuffer(
+ COMMENT_SYMBOL + WHITESPACE + ManagedMakeMessages.getResourceString(MOD_RULES) + NEWLINE);
// Visit the resources in this folder and add each one to a sources macro, and generate a build rule, if appropriate
IResource[] resources = module.members();
@@ -2015,13 +1978,13 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
if (resource.getType() == IResource.FILE) {
// Check whether this resource is excluded from build
IPath rcProjRelPath = resource.getProjectRelativePath();
- if(!isSource(rcProjRelPath))
+ if (!isSource(rcProjRelPath))
continue;
rcInfo = config.getResourceInfo(rcProjRelPath, false);
-// if( (rcInfo.isExcluded()) )
-// continue;
- addFragmentMakefileEntriesForSource(buildVarToRuleStringMap, ruleBuffer,
- folder, relativePath, resource, getPathForResource(resource), rcInfo, null, false);
+ // if( (rcInfo.isExcluded()) )
+ // continue;
+ addFragmentMakefileEntriesForSource(buildVarToRuleStringMap, ruleBuffer, folder, relativePath, resource,
+ getPathForResource(resource), rcInfo, null, false);
}
}
@@ -2044,49 +2007,49 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
* if <code>null</code>, use the file extension to find the name
* @param generatedSource if <code>true</code>, this file was generated by another tool in the tool-chain
*/
- protected void addFragmentMakefileEntriesForSource (LinkedHashMap<String, String> buildVarToRuleStringMap, StringBuffer ruleBuffer,
- IFolder folder, String relativePath, IResource resource, IPath sourceLocation, IResourceInfo rcInfo,
- String varName, boolean generatedSource) {
+ protected void addFragmentMakefileEntriesForSource(LinkedHashMap<String, String> buildVarToRuleStringMap,
+ StringBuffer ruleBuffer, IFolder folder, String relativePath, IResource resource, IPath sourceLocation,
+ IResourceInfo rcInfo, String varName, boolean generatedSource) {
// Determine which tool, if any, builds files with this extension
String ext = sourceLocation.getFileExtension();
ITool tool = null;
//TODO: remove
-// IResourceConfiguration resConfig = null;
-// if(rcInfo instanceof IFileInfo){
-// resConfig = (IFileInfo)rcInfo;
-// }
+ // IResourceConfiguration resConfig = null;
+ // if(rcInfo instanceof IFileInfo){
+ // resConfig = (IFileInfo)rcInfo;
+ // }
//end remove
// Use the tool from the resource configuration if there is one
if (rcInfo instanceof IFileInfo) {
- IFileInfo fi = (IFileInfo)rcInfo;
+ IFileInfo fi = (IFileInfo) rcInfo;
ITool[] tools = fi.getToolsToInvoke();
if (tools != null && tools.length > 0) {
tool = tools[0];
-// if(!tool.getCustomBuildStep())
- addToBuildVar(buildVarToRuleStringMap, ext, varName, relativePath, sourceLocation, generatedSource);
+ // if(!tool.getCustomBuildStep())
+ addToBuildVar(buildVarToRuleStringMap, ext, varName, relativePath, sourceLocation, generatedSource);
}
}
ToolInfoHolder h = getToolInfo(rcInfo.getPath());
ITool buildTools[] = h.buildTools;
-// if(tool == null){
-// for (int j=0; j<buildTools.length; j++) {
-// if (buildTools[j].buildsFileType(ext)) {
-// if (tool == null) {
-// tool = buildTools[j];
-// }
-// addToBuildVar(buildVarToRuleStringMap, ext, varName, relativePath, sourceLocation, generatedSource);
-// break;
-// }
-// }
-// }
-//
-// if(tool == null && rcInfo.getPath().segmentCount() != 0){
- if(tool == null){
+ // if(tool == null){
+ // for (int j=0; j<buildTools.length; j++) {
+ // if (buildTools[j].buildsFileType(ext)) {
+ // if (tool == null) {
+ // tool = buildTools[j];
+ // }
+ // addToBuildVar(buildVarToRuleStringMap, ext, varName, relativePath, sourceLocation, generatedSource);
+ // break;
+ // }
+ // }
+ // }
+ //
+ // if(tool == null && rcInfo.getPath().segmentCount() != 0){
+ if (tool == null) {
h = getToolInfo(Path.EMPTY);
buildTools = h.buildTools;
@@ -2103,23 +2066,22 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Generate the rule to build this source file
IInputType primaryInputType = tool.getPrimaryInputType();
IInputType inputType = tool.getInputType(ext);
- if ((primaryInputType != null && !primaryInputType.getMultipleOfType()) ||
- (inputType == null && tool != config.calculateTargetTool())) {
+ if ((primaryInputType != null && !primaryInputType.getMultipleOfType())
+ || (inputType == null && tool != config.calculateTargetTool())) {
// Try to add the rule for the file
- Vector<IPath> generatedOutputs = new Vector<IPath>(); // IPath's - build directory relative
- Vector<IPath> generatedDepFiles = new Vector<IPath>(); // IPath's - build directory relative or absolute
- addRuleForSource(relativePath, ruleBuffer, resource, sourceLocation, rcInfo, generatedSource, generatedDepFiles, generatedOutputs);
+ Vector<IPath> generatedOutputs = new Vector<IPath>(); // IPath's - build directory relative
+ Vector<IPath> generatedDepFiles = new Vector<IPath>(); // IPath's - build directory relative or absolute
+ addRuleForSource(relativePath, ruleBuffer, resource, sourceLocation, rcInfo, generatedSource,
+ generatedDepFiles, generatedOutputs);
// If the rule generates a dependency file(s), add the file(s) to the variable
if (generatedDepFiles.size() > 0) {
- for (int k=0; k<generatedDepFiles.size(); k++) {
+ for (int k = 0; k < generatedDepFiles.size(); k++) {
IPath generatedDepFile = generatedDepFiles.get(k);
- addMacroAdditionFile(
- buildVarToRuleStringMap,
- getDepMacroName(ext).toString(),
- (generatedDepFile.isAbsolute() ? "" : "./") + //$NON-NLS-1$ //$NON-NLS-2$
- generatedDepFile.toString());
+ addMacroAdditionFile(buildVarToRuleStringMap, getDepMacroName(ext).toString(),
+ (generatedDepFile.isAbsolute() ? "" : "./") + //$NON-NLS-1$ //$NON-NLS-2$
+ generatedDepFile.toString());
}
}
@@ -2156,7 +2118,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
buildVariable = OBJS_MACRO;
}
- for (int k=0; k<generatedOutputs.size(); k++) {
+ for (int k = 0; k < generatedOutputs.size(); k++) {
IPath generatedOutput;
IResource generateOutputResource;
if (generatedOutputs.get(k).isAbsolute()) {
@@ -2166,17 +2128,18 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// because the file is not under the project. We use this resource in the calls to the dependency generator
generateOutputResource = project.getFile(generatedOutput);
} else {
- generatedOutput = getPathForResource(project).append(getBuildWorkingDir()).append(generatedOutputs.get(k));
+ generatedOutput = getPathForResource(project).append(getBuildWorkingDir())
+ .append(generatedOutputs.get(k));
generateOutputResource = project.getFile(getBuildWorkingDir().append(generatedOutputs.get(k)));
}
IResourceInfo nextRcInfo;
- if(rcInfo instanceof IFileInfo){
+ if (rcInfo instanceof IFileInfo) {
nextRcInfo = config.getResourceInfo(rcInfo.getPath().removeLastSegments(1), false);
} else {
nextRcInfo = rcInfo;
}
- addFragmentMakefileEntriesForSource(buildVarToRuleStringMap, ruleBuffer,
- folder, relativePath, generateOutputResource, generatedOutput, nextRcInfo, buildVariable, true);
+ addFragmentMakefileEntriesForSource(buildVarToRuleStringMap, ruleBuffer, folder, relativePath,
+ generateOutputResource, generatedOutput, nextRcInfo, buildVariable, true);
}
}
} else {
@@ -2184,7 +2147,8 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
if (varName == null) {
for (ITool buildTool : buildTools) {
if (buildTool.isInputFileType(ext)) {
- addToBuildVar(buildVarToRuleStringMap, ext, varName, relativePath, sourceLocation, generatedSource);
+ addToBuildVar(buildVarToRuleStringMap, ext, varName, relativePath, sourceLocation,
+ generatedSource);
break;
}
}
@@ -2194,14 +2158,14 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
IOutputType[] secondaryOutputs = config.getToolChain().getSecondaryOutputs();
if (secondaryOutputs.length > 0) {
if (isSecondaryOutputVar(h, secondaryOutputs, varName)) {
- addMacroAdditionFile(buildVarToRuleStringMap, varName, relativePath, sourceLocation, generatedSource);
+ addMacroAdditionFile(buildVarToRuleStringMap, varName, relativePath, sourceLocation,
+ generatedSource);
}
}
}
}
}
-
/**
* Gets a path for a resource by extracting the Path field from its
* location URI.
@@ -2223,8 +2187,8 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
* @param sourceLocation the full path of the source
* @param generatedSource if <code>true</code>, this file was generated by another tool in the tool-chain
*/
- protected void addToBuildVar (LinkedHashMap<String, String> buildVarToRuleStringMap, String ext,
- String varName, String relativePath, IPath sourceLocation, boolean generatedSource) {
+ protected void addToBuildVar(LinkedHashMap<String, String> buildVarToRuleStringMap, String ext, String varName,
+ String relativePath, IPath sourceLocation, boolean generatedSource) {
List<IPath> varList = null;
if (varName == null) {
// Get the proper source build variable based upon the extension
@@ -2250,49 +2214,38 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
}
private IManagedCommandLineInfo generateToolCommandLineInfo(ITool tool, String sourceExtension, String[] flags,
- String outputFlag, String outputPrefix, String outputName, String[] inputResources, IPath inputLocation, IPath outputLocation ){
+ String outputFlag, String outputPrefix, String outputName, String[] inputResources, IPath inputLocation,
+ IPath outputLocation) {
String cmd = tool.getToolCommand();
//try to resolve the build macros in the tool command
- try{
+ try {
String resolvedCommand = null;
if ((inputLocation != null && inputLocation.toString().indexOf(" ") != -1) || //$NON-NLS-1$
- (outputLocation != null && outputLocation.toString().indexOf(" ") != -1) ) //$NON-NLS-1$
+ (outputLocation != null && outputLocation.toString().indexOf(" ") != -1)) //$NON-NLS-1$
{
- resolvedCommand = ManagedBuildManager
- .getBuildMacroProvider().resolveValue(
- cmd,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(inputLocation,
- outputLocation, null,
- tool));
+ resolvedCommand = ManagedBuildManager.getBuildMacroProvider().resolveValue(cmd, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(inputLocation, outputLocation, null, tool));
}
else {
- resolvedCommand = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveValueToMakefileFormat(
- cmd,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(inputLocation,
- outputLocation, null,
- tool));
+ resolvedCommand = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(cmd, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(inputLocation, outputLocation, null, tool));
}
- if((resolvedCommand = resolvedCommand.trim()).length() > 0)
+ if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
cmd = resolvedCommand;
- } catch (BuildMacroException e){
+ } catch (BuildMacroException e) {
}
IManagedCommandLineGenerator gen = tool.getCommandLineGenerator();
- return gen.generateCommandLineInfo( tool, cmd,
- flags, outputFlag, outputPrefix, outputName, inputResources,
- tool.getCommandLinePattern() );
+ return gen.generateCommandLineInfo(tool, cmd, flags, outputFlag, outputPrefix, outputName, inputResources,
+ tool.getCommandLinePattern());
}
@@ -2332,36 +2285,36 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
* @param generatedSource <code>true</code> if the resource is a generated output
* @param enumeratedOutputs vector of the filenames that are the output of this rule
*/
- protected void addRuleForSource(String relativePath, StringBuffer buffer, IResource resource,
- IPath sourceLocation, IResourceInfo rcInfo,
- boolean generatedSource, Vector<IPath> generatedDepFiles, Vector<IPath> enumeratedOutputs) {
+ protected void addRuleForSource(String relativePath, StringBuffer buffer, IResource resource, IPath sourceLocation,
+ IResourceInfo rcInfo, boolean generatedSource, Vector<IPath> generatedDepFiles,
+ Vector<IPath> enumeratedOutputs) {
String fileName = sourceLocation.removeFileExtension().lastSegment();
String inputExtension = sourceLocation.getFileExtension();
String outputExtension = null;
ITool tool = null;
- if( rcInfo instanceof IFileInfo) {
- IFileInfo fi = (IFileInfo)rcInfo;
+ if (rcInfo instanceof IFileInfo) {
+ IFileInfo fi = (IFileInfo) rcInfo;
ITool[] tools = fi.getToolsToInvoke();
if (tools != null && tools.length > 0) {
tool = tools[0];
}
} else {
- IFolderInfo foInfo = (IFolderInfo)rcInfo;
+ IFolderInfo foInfo = (IFolderInfo) rcInfo;
tool = foInfo.getToolFromInputExtension(inputExtension);
}
ToolInfoHolder h = getToolInfo(rcInfo.getPath());
- if (tool!=null)
+ if (tool != null)
outputExtension = tool.getOutputExtension(inputExtension);
- if(outputExtension == null)
+ if (outputExtension == null)
outputExtension = EMPTY_STRING;
// Get the dependency generator information for this tool and file extension
- IManagedDependencyGenerator oldDepGen = null; // This interface is deprecated but still supported
- IManagedDependencyGenerator2 depGen = null; // This is the recommended interface
+ IManagedDependencyGenerator oldDepGen = null; // This interface is deprecated but still supported
+ IManagedDependencyGenerator2 depGen = null; // This is the recommended interface
IManagedDependencyInfo depInfo = null;
IManagedDependencyCommands depCommands = null;
IManagedDependencyPreBuild depPreBuild = null;
@@ -2369,12 +2322,12 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
boolean doDepGen = false;
{
IManagedDependencyGeneratorType t = null;
- if (tool!=null)
+ if (tool != null)
t = tool.getDependencyGeneratorForExtension(inputExtension);
if (t != null) {
int calcType = t.getCalculatorType();
if (calcType <= IManagedDependencyGeneratorType.TYPE_OLD_TYPE_LIMIT) {
- oldDepGen = (IManagedDependencyGenerator)t;
+ oldDepGen = (IManagedDependencyGenerator) t;
doDepGen = (calcType == IManagedDependencyGeneratorType.TYPE_COMMAND);
if (doDepGen) {
IPath depFile = Path.fromOSString(relativePath + fileName + DOT + DEP_EXT);
@@ -2382,17 +2335,18 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
generatedDepFiles.add(depFile);
}
} else {
- depGen = (IManagedDependencyGenerator2)t;
+ depGen = (IManagedDependencyGenerator2) t;
doDepGen = (calcType == IManagedDependencyGeneratorType.TYPE_BUILD_COMMANDS);
IBuildObject buildContext = rcInfo;//(resConfig != null) ? (IBuildObject)resConfig : (IBuildObject)config;
- depInfo = depGen.getDependencySourceInfo(resource.getProjectRelativePath(), resource, buildContext, tool, getBuildWorkingDir());
+ depInfo = depGen.getDependencySourceInfo(resource.getProjectRelativePath(), resource, buildContext,
+ tool, getBuildWorkingDir());
if (calcType == IManagedDependencyGeneratorType.TYPE_BUILD_COMMANDS) {
- depCommands = (IManagedDependencyCommands)depInfo;
+ depCommands = (IManagedDependencyCommands) depInfo;
depFiles = depCommands.getDependencyFiles();
} else if (calcType == IManagedDependencyGeneratorType.TYPE_PREBUILD_COMMANDS) {
- depPreBuild = (IManagedDependencyPreBuild)depInfo;
+ depPreBuild = (IManagedDependencyPreBuild) depInfo;
depFiles = depPreBuild.getDependencyFiles();
}
if (depFiles != null) {
@@ -2411,9 +2365,10 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
optDotExt = DOT + outputExtension;
Vector<IPath> ruleOutputs = new Vector<IPath>();
- Vector<IPath> enumeratedPrimaryOutputs = new Vector<IPath>(); // IPaths relative to the top build directory
- Vector<IPath> enumeratedSecondaryOutputs = new Vector<IPath>(); // IPaths relative to the top build directory
- calculateOutputsForSource(tool, relativePath, resource, sourceLocation, ruleOutputs, enumeratedPrimaryOutputs, enumeratedSecondaryOutputs);
+ Vector<IPath> enumeratedPrimaryOutputs = new Vector<IPath>(); // IPaths relative to the top build directory
+ Vector<IPath> enumeratedSecondaryOutputs = new Vector<IPath>(); // IPaths relative to the top build directory
+ calculateOutputsForSource(tool, relativePath, resource, sourceLocation, ruleOutputs, enumeratedPrimaryOutputs,
+ enumeratedSecondaryOutputs);
enumeratedOutputs.addAll(enumeratedPrimaryOutputs);
enumeratedOutputs.addAll(enumeratedSecondaryOutputs);
String primaryOutputName = null;
@@ -2423,7 +2378,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
primaryOutputName = escapeWhitespaces(relativePath + fileName + optDotExt);
}
String otherPrimaryOutputs = EMPTY_STRING;
- for (int i=1; i<enumeratedPrimaryOutputs.size(); i++) { // Starting with 1 is intentional
+ for (int i = 1; i < enumeratedPrimaryOutputs.size(); i++) { // Starting with 1 is intentional
otherPrimaryOutputs += WHITESPACE + escapeWhitespaces(enumeratedPrimaryOutputs.get(i).toString());
}
@@ -2443,17 +2398,15 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
* - The resource is not linked, but its project relative path contains special characters
*/
- boolean resourceNameRequiresExplicitRule = (resource.isLinked() && containsSpecialCharacters(sourceLocation
- .toString()))
- || (!resource.isLinked() && containsSpecialCharacters(resource
- .getProjectRelativePath().toString()));
+ boolean resourceNameRequiresExplicitRule = (resource.isLinked()
+ && containsSpecialCharacters(sourceLocation.toString()))
+ || (!resource.isLinked() && containsSpecialCharacters(resource.getProjectRelativePath().toString()));
- boolean needExplicitRuleForFile = resourceNameRequiresExplicitRule ||
- BuildMacroProvider.getReferencedExplitFileMacros(tool).length > 0
- || BuildMacroProvider.getReferencedExplitFileMacros(tool
- .getToolCommand(), IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(sourceLocation, outputLocation,
- null, tool)).length > 0;
+ boolean needExplicitRuleForFile = resourceNameRequiresExplicitRule
+ || BuildMacroProvider.getReferencedExplitFileMacros(tool).length > 0
+ || BuildMacroProvider.getReferencedExplitFileMacros(tool.getToolCommand(),
+ IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(sourceLocation, outputLocation, null, tool)).length > 0;
// Get and resolve the command
String cmd = tool.getToolCommand();
@@ -2461,26 +2414,16 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
try {
String resolvedCommand = null;
if (!needExplicitRuleForFile) {
- resolvedCommand = ManagedBuildManager.getBuildMacroProvider()
- .resolveValueToMakefileFormat(
- cmd,
- EMPTY_STRING,
- WHITESPACE,
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(sourceLocation,
- outputLocation, null, tool));
+ resolvedCommand = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(cmd,
+ EMPTY_STRING, WHITESPACE, IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(sourceLocation, outputLocation, null, tool));
} else {
// if we need an explicit rule then don't use any builder
// variables, resolve everything
// to explicit strings
- resolvedCommand = ManagedBuildManager.getBuildMacroProvider()
- .resolveValue(
- cmd,
- EMPTY_STRING,
- WHITESPACE,
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(sourceLocation,
- outputLocation, null, tool));
+ resolvedCommand = ManagedBuildManager.getBuildMacroProvider().resolveValue(cmd, EMPTY_STRING,
+ WHITESPACE, IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(sourceLocation, outputLocation, null, tool));
}
if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
@@ -2492,11 +2435,11 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
String defaultOutputName = EMPTY_STRING;
String primaryDependencyName = EMPTY_STRING;
String patternPrimaryDependencyName = EMPTY_STRING;
- String home = (generatedSource)? DOT : ROOT;
+ String home = (generatedSource) ? DOT : ROOT;
String resourcePath = null;
boolean patternRule = true;
boolean isItLinked = false;
- if(resource.isLinked(IResource.CHECK_ANCESTORS)) {
+ if (resource.isLinked(IResource.CHECK_ANCESTORS)) {
// it IS linked, so use the actual location
isItLinked = true;
resourcePath = sourceLocation.toString();
@@ -2509,14 +2452,15 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Use the relative path (not really needed to store per se but in the future someone may want this)
resourcePath = relativePath;
// The rule and command to add to the makefile
- if( rcInfo instanceof IFileInfo || needExplicitRuleForFile) {
+ if (rcInfo instanceof IFileInfo || needExplicitRuleForFile) {
// Need a hardcoded rule, not a pattern rule
defaultOutputName = escapeWhitespaces(resourcePath + fileName + optDotExt);
patternRule = false;
} else {
defaultOutputName = relativePath + WILDCARD + optDotExt;
}
- primaryDependencyName = escapeWhitespaces(home + SEPARATOR + resourcePath + fileName + DOT + inputExtension);
+ primaryDependencyName = escapeWhitespaces(
+ home + SEPARATOR + resourcePath + fileName + DOT + inputExtension);
patternPrimaryDependencyName = home + SEPARATOR + resourcePath + WILDCARD + DOT + inputExtension;
} // end fix for PR 70491
@@ -2531,7 +2475,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
if (patternRule) {
patternRule = false;
// Make sure that at least one of the rule outputs contains a %.
- for (int i=0; i<ruleOutputs.size(); i++) {
+ for (int i = 0; i < ruleOutputs.size(); i++) {
String ruleOutput = ruleOutputs.get(i).toString();
if (ruleOutput.indexOf('%') >= 0) {
patternRule = true;
@@ -2551,7 +2495,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
buildRule += defaultOutputName;
} else {
boolean first = true;
- for (int i=0; i<ruleOutputs.size(); i++) {
+ for (int i = 0; i < ruleOutputs.size(); i++) {
String ruleOutput = ruleOutputs.get(i).toString();
if (ruleOutput.indexOf('%') >= 0) {
if (first) {
@@ -2576,7 +2520,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
for (IPath addlDepPath : addlDepPaths) {
// Translate the path from project relative to build directory relative
IPath addlPath = addlDepPath;
- if (!(addlPath.toString().startsWith("$("))) { //$NON-NLS-1$
+ if (!(addlPath.toString().startsWith("$("))) { //$NON-NLS-1$
if (!addlPath.isAbsolute()) {
IPath tempPath = project.getLocation().append(new Path(ensureUnquoted(addlPath.toString())));
if (tempPath != null) {
@@ -2594,8 +2538,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// No duplicates in a makefile. If we already have this rule, don't add it or the commands to build the file
if (getRuleList().contains(buildRule)) {
// TODO: Should we assert that this is a pattern rule?
- }
- else {
+ } else {
getRuleList().add(buildRule);
// Echo starting message
@@ -2613,23 +2556,15 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
String resolvedCommand;
IBuildMacroProvider provider = ManagedBuildManager.getBuildMacroProvider();
if (!needExplicitRuleForFile) {
- resolvedCommand = provider.resolveValueToMakefileFormat(
- preCmd,
- EMPTY_STRING,
- WHITESPACE,
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(sourceLocation,
- outputLocation, null, tool));
+ resolvedCommand = provider.resolveValueToMakefileFormat(preCmd, EMPTY_STRING,
+ WHITESPACE, IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(sourceLocation, outputLocation, null, tool));
} else {
// if we need an explicit rule then don't use any builder
// variables, resolve everything to explicit strings
- resolvedCommand = provider.resolveValue(
- preCmd,
- EMPTY_STRING,
- WHITESPACE,
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(sourceLocation,
- outputLocation, null, tool));
+ resolvedCommand = provider.resolveValue(preCmd, EMPTY_STRING, WHITESPACE,
+ IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(sourceLocation, outputLocation, null, tool));
}
if (resolvedCommand != null)
buffer.append(resolvedCommand).append(NEWLINE);
@@ -2650,7 +2585,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
for (IPath addlInputPath : addlInputPaths) {
// Translate the path from project relative to build directory relative
IPath addlPath = addlInputPath;
- if (!(addlPath.toString().startsWith("$("))) { //$NON-NLS-1$
+ if (!(addlPath.toString().startsWith("$("))) { //$NON-NLS-1$
if (!addlPath.isAbsolute()) {
IPath tempPath = getPathForResource(project).append(addlPath);
if (tempPath != null) {
@@ -2666,7 +2601,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Get the tool command line options
try {
flags = tool.getToolCommandFlags(sourceLocation, outputLocation);
- } catch( BuildException ex ) {
+ } catch (BuildException ex) {
// TODO add some routines to catch this
flags = EMPTY_STRING_ARRAY;
}
@@ -2681,14 +2616,14 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
String outflag = null;
String outputPrefix = null;
- if( rcInfo instanceof IFileInfo || needExplicitRuleForFile || needExplicitDependencyCommands) {
+ if (rcInfo instanceof IFileInfo || needExplicitRuleForFile || needExplicitDependencyCommands) {
outflag = tool.getOutputFlag();
outputPrefix = tool.getOutputPrefix();
// Call the command line generator
IManagedCommandLineGenerator cmdLGen = tool.getCommandLineGenerator();
- cmdLInfo = cmdLGen.generateCommandLineInfo( tool, cmd, flags, outflag, outputPrefix,
- OUT_MACRO + otherPrimaryOutputs, inputStrings, tool.getCommandLinePattern() );
+ cmdLInfo = cmdLGen.generateCommandLineInfo(tool, cmd, flags, outflag, outputPrefix,
+ OUT_MACRO + otherPrimaryOutputs, inputStrings, tool.getCommandLinePattern());
} else {
outflag = tool.getOutputFlag();//config.getOutputFlag(outputExtension);
@@ -2696,7 +2631,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Call the command line generator
cmdLInfo = generateToolCommandLineInfo(tool, inputExtension, flags, outflag, outputPrefix,
- OUT_MACRO + otherPrimaryOutputs, inputStrings, sourceLocation, outputLocation );
+ OUT_MACRO + otherPrimaryOutputs, inputStrings, sourceLocation, outputLocation);
}
// The command to build
@@ -2706,37 +2641,29 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
} else {
StringBuffer buildFlags = new StringBuffer();
for (String flag : flags) {
- if( flag != null ) {
+ if (flag != null) {
buildFlags.append(flag).append(WHITESPACE);
}
}
- buildCmd = cmd + WHITESPACE + buildFlags.toString().trim() + WHITESPACE + outflag + WHITESPACE +
- outputPrefix + OUT_MACRO + otherPrimaryOutputs + WHITESPACE + IN_MACRO;
+ buildCmd = cmd + WHITESPACE + buildFlags.toString().trim() + WHITESPACE + outflag + WHITESPACE
+ + outputPrefix + OUT_MACRO + otherPrimaryOutputs + WHITESPACE + IN_MACRO;
}
- // resolve any remaining macros in the command after it has been
- // generated
+ // resolve any remaining macros in the command after it has been
+ // generated
try {
String resolvedCommand;
IBuildMacroProvider provider = ManagedBuildManager.getBuildMacroProvider();
if (!needExplicitRuleForFile) {
- resolvedCommand = provider.resolveValueToMakefileFormat(
- buildCmd,
- EMPTY_STRING,
- WHITESPACE,
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(sourceLocation,
- outputLocation, null, tool));
+ resolvedCommand = provider.resolveValueToMakefileFormat(buildCmd, EMPTY_STRING, WHITESPACE,
+ IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(sourceLocation, outputLocation, null, tool));
} else {
// if we need an explicit rule then don't use any builder
// variables, resolve everything to explicit strings
- resolvedCommand = provider.resolveValue(
- buildCmd,
- EMPTY_STRING,
- WHITESPACE,
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(sourceLocation,
- outputLocation, null, tool));
+ resolvedCommand = provider.resolveValue(buildCmd, EMPTY_STRING, WHITESPACE,
+ IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(sourceLocation, outputLocation, null, tool));
}
if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
@@ -2764,32 +2691,20 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
if (depCmds != null) {
for (String depCmd : depCmds) {
- // Resolve any macros in the dep command after it has been generated.
- // Note: do not trim the result because it will strip out necessary tab characters.
+ // Resolve any macros in the dep command after it has been generated.
+ // Note: do not trim the result because it will strip out necessary tab characters.
buffer.append(WHITESPACE).append(LOGICAL_AND).append(WHITESPACE).append(LINEBREAK);
- try {
+ try {
if (!needExplicitRuleForFile) {
- depCmd = ManagedBuildManager.getBuildMacroProvider()
- .resolveValueToMakefileFormat(
- depCmd,
- EMPTY_STRING,
- WHITESPACE,
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(sourceLocation,
- outputLocation, null,
- tool));
+ depCmd = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
+ depCmd, EMPTY_STRING, WHITESPACE, IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(sourceLocation, outputLocation, null, tool));
}
else {
- depCmd = ManagedBuildManager.getBuildMacroProvider()
- .resolveValue(
- depCmd,
- EMPTY_STRING,
- WHITESPACE,
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(sourceLocation,
- outputLocation, null,
- tool));
+ depCmd = ManagedBuildManager.getBuildMacroProvider().resolveValue(depCmd, EMPTY_STRING,
+ WHITESPACE, IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(sourceLocation, outputLocation, null, tool));
}
} catch (BuildMacroException e) {
@@ -2807,8 +2722,8 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
}
// Determine if there are calculated dependencies
- IPath[] addlDeps = null; // IPath's that are relative to the build directory
- IPath[] addlTargets = null; // IPath's that are relative to the build directory
+ IPath[] addlDeps = null; // IPath's that are relative to the build directory
+ IPath[] addlTargets = null; // IPath's that are relative to the build directory
String calculatedDependencies = null;
boolean addedDepLines = false;
String depLine;
@@ -2817,7 +2732,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
} else {
if (depGen != null && depGen.getCalculatorType() == IManagedDependencyGeneratorType.TYPE_CUSTOM) {
if (depInfo instanceof IManagedDependencyCalculator) {
- IManagedDependencyCalculator depCalculator = (IManagedDependencyCalculator)depInfo;
+ IManagedDependencyCalculator depCalculator = (IManagedDependencyCalculator) depInfo;
addlDeps = calculateDependenciesForSource(depCalculator);
addlTargets = depCalculator.getAdditionalTargets();
}
@@ -2844,16 +2759,18 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
Vector<IPath> addlOutputs = new Vector<IPath>();
if (enumeratedPrimaryOutputs.size() > 1) {
// Starting with 1 is intentional in order to skip the primary output
- for (int i=1; i<enumeratedPrimaryOutputs.size(); i++) addlOutputs.add(enumeratedPrimaryOutputs.get(i));
+ for (int i = 1; i < enumeratedPrimaryOutputs.size(); i++)
+ addlOutputs.add(enumeratedPrimaryOutputs.get(i));
}
addlOutputs.addAll(enumeratedSecondaryOutputs);
if (addlTargets != null) {
for (IPath addlTarget : addlTargets)
addlOutputs.add(addlTarget);
}
- for (int i=0; i<addlOutputs.size(); i++) {
+ for (int i = 0; i < addlOutputs.size(); i++) {
depLine = escapeWhitespaces(addlOutputs.get(i).toString()) + COLON + WHITESPACE + primaryOutputName;
- if (calculatedDependencies != null) depLine += calculatedDependencies;
+ if (calculatedDependencies != null)
+ depLine += calculatedDependencies;
depLine += NEWLINE;
if (!getDepLineList().contains(depLine)) {
getDepLineList().add(depLine);
@@ -2871,17 +2788,18 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
addedDepLines = false;
String[] preBuildCommands = depPreBuild.getDependencyCommands();
if (preBuildCommands != null) {
- depLine = ""; //$NON-NLS-1$
+ depLine = ""; //$NON-NLS-1$
// Can we use a pattern rule?
patternRule = !isItLinked && !needExplicitRuleForFile && depPreBuild.areCommandsGeneric();
// Begin building the rule
- for (int i=0; i<depFiles.length; i++) {
- if (i > 0) depLine += WHITESPACE;
+ for (int i = 0; i < depFiles.length; i++) {
+ if (i > 0)
+ depLine += WHITESPACE;
if (patternRule) {
optDotExt = EMPTY_STRING;
String depExt = depFiles[i].getFileExtension();
if (depExt != null && depExt.length() > 0)
- optDotExt = DOT + depExt;
+ optDotExt = DOT + depExt;
depLine += escapeWhitespaces(relativePath + WILDCARD + optDotExt);
} else {
depLine += escapeWhitespaces((depFiles[i]).toString());
@@ -2892,33 +2810,22 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
getDepRuleList().add(depLine);
addedDepLines = true;
buffer.append(depLine).append(NEWLINE);
- buffer.append(TAB).append(AT).append(escapedEcho(MESSAGE_START_DEPENDENCY + WHITESPACE + OUT_MACRO));
+ buffer.append(TAB).append(AT)
+ .append(escapedEcho(MESSAGE_START_DEPENDENCY + WHITESPACE + OUT_MACRO));
for (String preBuildCommand : preBuildCommands) {
depLine = preBuildCommand;
// Resolve macros
- try {
+ try {
if (!needExplicitRuleForFile) {
- depLine = ManagedBuildManager.getBuildMacroProvider()
- .resolveValueToMakefileFormat(
- depLine,
- EMPTY_STRING,
- WHITESPACE,
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(sourceLocation,
- outputLocation, null,
- tool));
+ depLine = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
+ depLine, EMPTY_STRING, WHITESPACE, IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(sourceLocation, outputLocation, null, tool));
}
else {
- depLine = ManagedBuildManager.getBuildMacroProvider()
- .resolveValue(
- depLine,
- EMPTY_STRING,
- WHITESPACE,
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(sourceLocation,
- outputLocation, null,
- tool));
+ depLine = ManagedBuildManager.getBuildMacroProvider().resolveValue(depLine,
+ EMPTY_STRING, WHITESPACE, IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(sourceLocation, outputLocation, null, tool));
}
} catch (BuildMacroException e) {
@@ -2943,10 +2850,10 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
if (depOptions != null && depOptions.length > 0) {
int flagsLen = flags.length;
String[] flagsCopy = new String[flags.length + depOptions.length];
- for (int i=0; i<flags.length; i++) {
+ for (int i = 0; i < flags.length; i++) {
flagsCopy[i] = flags[i];
}
- for (int i=0; i<depOptions.length; i++) {
+ for (int i = 0; i < depOptions.length; i++) {
flagsCopy[i + flagsLen] = depOptions[i];
}
flags = flagsCopy;
@@ -2954,7 +2861,6 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
return flags;
}
-
/**
* Returns any additional resources specified for the tool in other InputType elements and AdditionalInput elements
*/
@@ -2972,15 +2878,15 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
if (!type.getPrimaryInput() && type != tool.getPrimaryInputType()) {
String var = type.getBuildVariable();
if (var != null && var.length() > 0) {
- allRes.add(Path.fromOSString("$(" + type.getBuildVariable() + ")")); //$NON-NLS-1$ //$NON-NLS-2$
+ allRes.add(Path.fromOSString("$(" + type.getBuildVariable() + ")")); //$NON-NLS-1$ //$NON-NLS-2$
} else {
// Use file extensions
String[] typeExts = type.getSourceExtensions(tool);
for (IResource projectResource : projectResources) {
if (projectResource.getType() == IResource.FILE) {
String fileExt = projectResource.getFileExtension();
- if(fileExt == null) {
- fileExt = ""; //$NON-NLS-1$
+ if (fileExt == null) {
+ fileExt = ""; //$NON-NLS-1$
}
for (String typeExt : typeExts) {
if (fileExt.equals(typeExt)) {
@@ -3001,44 +2907,44 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
IResourceInfo rcInfo = tool.getParentResourceInfo();
if (rcInfo != null) {
if (optType == IOption.STRING) {
- String optVal = ""; //$NON-NLS-1$
- for (int j=0; j<allRes.size(); j++) {
+ String optVal = ""; //$NON-NLS-1$
+ for (int j = 0; j < allRes.size(); j++) {
if (j != 0) {
- optVal += " "; //$NON-NLS-1$
+ optVal += " "; //$NON-NLS-1$
}
String resPath = allRes.get(j).toString();
- if (!resPath.startsWith("$(")) { //$NON-NLS-1$
+ if (!resPath.startsWith("$(")) { //$NON-NLS-1$
IResource addlResource = project.getFile(resPath);
if (addlResource != null) {
IPath addlPath = addlResource.getLocation();
if (addlPath != null) {
- resPath = ManagedBuildManager.calculateRelativePath(getTopBuildDir(), addlPath).toString();
+ resPath = ManagedBuildManager
+ .calculateRelativePath(getTopBuildDir(), addlPath).toString();
}
}
}
- optVal += ManagedBuildManager.calculateRelativePath(getTopBuildDir(), Path.fromOSString(resPath)).toString();
+ optVal += ManagedBuildManager
+ .calculateRelativePath(getTopBuildDir(), Path.fromOSString(resPath))
+ .toString();
}
ManagedBuildManager.setOption(rcInfo, tool, assignToOption, optVal);
- } else if (
- optType == IOption.STRING_LIST ||
- optType == IOption.LIBRARIES ||
- optType == IOption.OBJECTS ||
- optType == IOption.INCLUDE_FILES ||
- optType == IOption.LIBRARY_PATHS ||
- optType == IOption.LIBRARY_FILES ||
- optType == IOption.MACRO_FILES) {
+ } else if (optType == IOption.STRING_LIST || optType == IOption.LIBRARIES
+ || optType == IOption.OBJECTS || optType == IOption.INCLUDE_FILES
+ || optType == IOption.LIBRARY_PATHS || optType == IOption.LIBRARY_FILES
+ || optType == IOption.MACRO_FILES) {
//TODO: do we need to do anything with undefs here?
// Note that the path(s) must be translated from project relative
// to top build directory relative
String[] paths = new String[allRes.size()];
- for (int j=0; j<allRes.size(); j++) {
+ for (int j = 0; j < allRes.size(); j++) {
paths[j] = allRes.get(j).toString();
- if (!paths[j].startsWith("$(")) { //$NON-NLS-1$
+ if (!paths[j].startsWith("$(")) { //$NON-NLS-1$
IResource addlResource = project.getFile(paths[j]);
if (addlResource != null) {
IPath addlPath = addlResource.getLocation();
if (addlPath != null) {
- paths[j] = ManagedBuildManager.calculateRelativePath(getTopBuildDir(), addlPath).toString();
+ paths[j] = ManagedBuildManager
+ .calculateRelativePath(getTopBuildDir(), addlPath).toString();
}
}
}
@@ -3046,7 +2952,8 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
ManagedBuildManager.setOption(rcInfo, tool, assignToOption, paths);
} else if (optType == IOption.BOOLEAN) {
boolean b = false;
- if (allRes.size() > 0) b = true;
+ if (allRes.size() > 0)
+ b = true;
ManagedBuildManager.setOption(rcInfo, tool, assignToOption, b);
} else if (optType == IOption.ENUMERATED || optType == IOption.TREE) {
if (allRes.size() > 0) {
@@ -3056,7 +2963,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
}
allRes.clear();
}
- } catch( BuildException ex ) {
+ } catch (BuildException ex) {
}
}
}
@@ -3064,7 +2971,6 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
return allRes.toArray(new IPath[allRes.size()]);
}
-
/**
* Returns the output <code>IPath</code>s for this invocation of the tool with the specified source file
*
@@ -3085,8 +2991,9 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
* @param enumeratedSecondaryOutputs Vector of IPaths of secondary outputs
* that are relative to the build directory
*/
- protected void calculateOutputsForSource(ITool tool, String relativePath, IResource resource,
- IPath sourceLocation, Vector<IPath> ruleOutputs, Vector<IPath> enumeratedPrimaryOutputs, Vector<IPath> enumeratedSecondaryOutputs) {
+ protected void calculateOutputsForSource(ITool tool, String relativePath, IResource resource, IPath sourceLocation,
+ Vector<IPath> ruleOutputs, Vector<IPath> enumeratedPrimaryOutputs,
+ Vector<IPath> enumeratedSecondaryOutputs) {
String inExt = sourceLocation.getFileExtension();
String outExt = tool.getOutputExtension(inExt);
IResourceInfo rcInfo = tool.getParentResourceInfo();
@@ -3098,68 +3005,55 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
//if (primaryOutput && ignorePrimary) continue;
String outputPrefix = type.getOutputPrefix();
- // Resolve any macros in the outputPrefix
- // Note that we cannot use file macros because if we do a clean
- // we need to know the actual name of the file to clean, and
- // cannot use any builder variables such as $@. Hence we use the
- // next best thing, i.e. configuration context.
-
- // figure out the configuration we're using
-// IBuildObject toolParent = tool.getParent();
-// IConfiguration config = null;
- // if the parent is a config then we're done
-// if (toolParent instanceof IConfiguration)
-// config = (IConfiguration) toolParent;
-// else if (toolParent instanceof IToolChain) {
-// // must be a toolchain
-// config = (IConfiguration) ((IToolChain) toolParent)
-// .getParent();
-// }
-//
-// else if (toolParent instanceof IResourceConfiguration) {
-// config = (IConfiguration) ((IResourceConfiguration) toolParent)
-// .getParent();
-// }
-
-// else {
-// // bad
-// throw new AssertionError(
-// "tool parent must be one of configuration, toolchain, or resource configuration");
-// }
-
-// if (config != null) {
-
- try {
-
- if(containsSpecialCharacters(sourceLocation.toString()))
- {
- outputPrefix = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveValue(
- outputPrefix,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- config);
- }
- else {
- outputPrefix = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveValueToMakefileFormat(
- outputPrefix,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- config);
- }
- }
-
- catch (BuildMacroException e) {
- }
-
-// }
+ // Resolve any macros in the outputPrefix
+ // Note that we cannot use file macros because if we do a clean
+ // we need to know the actual name of the file to clean, and
+ // cannot use any builder variables such as $@. Hence we use the
+ // next best thing, i.e. configuration context.
+
+ // figure out the configuration we're using
+ // IBuildObject toolParent = tool.getParent();
+ // IConfiguration config = null;
+ // if the parent is a config then we're done
+ // if (toolParent instanceof IConfiguration)
+ // config = (IConfiguration) toolParent;
+ // else if (toolParent instanceof IToolChain) {
+ // // must be a toolchain
+ // config = (IConfiguration) ((IToolChain) toolParent)
+ // .getParent();
+ // }
+ //
+ // else if (toolParent instanceof IResourceConfiguration) {
+ // config = (IConfiguration) ((IResourceConfiguration) toolParent)
+ // .getParent();
+ // }
+
+ // else {
+ // // bad
+ // throw new AssertionError(
+ // "tool parent must be one of configuration, toolchain, or resource configuration");
+ // }
+
+ // if (config != null) {
+
+ try {
+
+ if (containsSpecialCharacters(sourceLocation.toString())) {
+ outputPrefix = ManagedBuildManager.getBuildMacroProvider().resolveValue(outputPrefix, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, config);
+ } else {
+ outputPrefix = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
+ outputPrefix, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, config);
+ }
+ }
+ catch (BuildMacroException e) {
+ }
+ // }
boolean multOfType = type.getMultipleOfType();
IOption option = tool.getOptionBySuperClassId(type.getOptionId());
@@ -3176,66 +3070,48 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
int optType = option.getValueType();
if (optType == IOption.STRING) {
outputList.add(outputPrefix + option.getStringValue());
- } else if (
- optType == IOption.STRING_LIST ||
- optType == IOption.LIBRARIES ||
- optType == IOption.OBJECTS ||
- optType == IOption.INCLUDE_FILES ||
- optType == IOption.LIBRARY_PATHS ||
- optType == IOption.LIBRARY_FILES ||
- optType == IOption.MACRO_FILES) {
+ } else if (optType == IOption.STRING_LIST || optType == IOption.LIBRARIES
+ || optType == IOption.OBJECTS || optType == IOption.INCLUDE_FILES
+ || optType == IOption.LIBRARY_PATHS || optType == IOption.LIBRARY_FILES
+ || optType == IOption.MACRO_FILES) {
@SuppressWarnings("unchecked")
- List<String> value = (List<String>)option.getValue();
+ List<String> value = (List<String>) option.getValue();
outputList = value;
- ((Tool)tool).filterValues(optType, outputList);
+ ((Tool) tool).filterValues(optType, outputList);
// Add outputPrefix to each if necessary
if (outputPrefix.length() > 0) {
- for (int j=0; j<outputList.size(); j++) {
+ for (int j = 0; j < outputList.size(); j++) {
outputList.set(j, outputPrefix + outputList.get(j));
}
}
}
- for (int j=0; j<outputList.size(); j++) {
+ for (int j = 0; j < outputList.size(); j++) {
String outputName = outputList.get(j);
-
-
// try to resolve the build macros in the output
// names
try {
String resolved = null;
- if (containsSpecialCharacters(sourceLocation.toString()))
- {
- resolved = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveValue(
- outputName,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(
- sourceLocation,
- null, option, tool));
+ if (containsSpecialCharacters(sourceLocation.toString())) {
+ resolved = ManagedBuildManager.getBuildMacroProvider().resolveValue(outputName, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(sourceLocation, null, option, tool));
}
else {
- resolved = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveValueToMakefileFormat(
- outputName,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(
- sourceLocation,
- null, option, tool));
+ resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
+ outputName, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(sourceLocation, null, option, tool));
}
- if((resolved = resolved.trim()).length() > 0)
+ if ((resolved = resolved.trim()).length() > 0)
outputName = resolved;
- } catch (BuildMacroException e){
+ } catch (BuildMacroException e) {
}
IPath outPath = Path.fromOSString(outputName);
@@ -3251,7 +3127,8 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
enumeratedSecondaryOutputs.add(resolvePercent(outPath, sourceLocation));
}
}
- } catch( BuildException ex ) {}
+ } catch (BuildException ex) {
+ }
} else
// 3. If a nameProvider is specified, call it
if (nameProvider != null) {
@@ -3259,41 +3136,28 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
inPaths[0] = sourceLocation;
IPath[] outPaths = nameProvider.getOutputNames(tool, inPaths);
if (outPaths != null) {
- for (int j=0; j<outPaths.length; j++) {
+ for (int j = 0; j < outPaths.length; j++) {
IPath outPath = outPaths[j];
String outputName = outPaths[j].toString();
-
// try to resolve the build macros in the output names
try {
String resolved = null;
- if (containsSpecialCharacters(sourceLocation.toString()))
- {
- resolved = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveValue(
- outputName,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(
- sourceLocation, null,
- option, tool));
+ if (containsSpecialCharacters(sourceLocation.toString())) {
+ resolved = ManagedBuildManager.getBuildMacroProvider().resolveValue(outputName, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(sourceLocation, null, option, tool));
}
else {
- resolved = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveValueToMakefileFormat(
- outputName,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_FILE,
- new FileContextData(
- sourceLocation, null,
- option, tool));
+ resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
+ outputName, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_FILE,
+ new FileContextData(sourceLocation, null, option, tool));
}
if ((resolved = resolved.trim()).length() > 0)
@@ -3319,17 +3183,16 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
if (outputNames != null) {
for (int j = 0; j < outputNames.length; j++) {
String outputName = outputNames[j];
- try{
+ try {
//try to resolve the build macros in the output names
String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
- outputName,
- "", //$NON-NLS-1$
+ outputName, "", //$NON-NLS-1$
" ", //$NON-NLS-1$
IBuildMacroProvider.CONTEXT_FILE,
new FileContextData(sourceLocation, null, option, tool));
- if((resolved = resolved.trim()).length() > 0)
+ if ((resolved = resolved.trim()).length() > 0)
outputName = resolved;
- } catch (BuildMacroException e){
+ } catch (BuildMacroException e) {
}
IPath outPath = Path.fromOSString(outputName);
@@ -3346,9 +3209,9 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
}
}
} else {
- // 5. Use the name pattern to generate a transformation macro
- // so that the source names can be transformed into the target names
- // using the built-in string substitution functions of <code>make</code>.
+ // 5. Use the name pattern to generate a transformation macro
+ // so that the source names can be transformed into the target names
+ // using the built-in string substitution functions of <code>make</code>.
if (multOfType) {
// This case is not handled - a nameProvider or outputNames must be specified
// TODO - report error
@@ -3361,8 +3224,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
namePattern += DOT + outExt;
}
namePatternPath = Path.fromOSString(namePattern);
- }
- else {
+ } else {
if (outputPrefix.length() > 0) {
namePattern = outputPrefix + namePattern;
}
@@ -3392,11 +3254,11 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// the output extension.
//if (!ignorePrimary) {
- String outPrefix = tool.getOutputPrefix();
- IPath outPath = Path.fromOSString(relativePath + outPrefix + WILDCARD);
- outPath = outPath.addFileExtension(outExt);
- ruleOutputs.add(0, outPath);
- enumeratedPrimaryOutputs.add(0, resolvePercent(outPath, sourceLocation));
+ String outPrefix = tool.getOutputPrefix();
+ IPath outPath = Path.fromOSString(relativePath + outPrefix + WILDCARD);
+ outPath = outPath.addFileExtension(outExt);
+ ruleOutputs.add(0, outPath);
+ enumeratedPrimaryOutputs.add(0, resolvePercent(outPath, sourceLocation));
//}
}
}
@@ -3423,7 +3285,8 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
* @param resource source file to scan for dependencies
* @return Vector of IPaths that are relative to the build directory
*/
- protected IPath[] oldCalculateDependenciesForSource(IManagedDependencyGenerator depGen, ITool tool, String relativePath, IResource resource) {
+ protected IPath[] oldCalculateDependenciesForSource(IManagedDependencyGenerator depGen, ITool tool,
+ String relativePath, IResource resource) {
Vector<IPath> deps = new Vector<IPath>();
int type = depGen.getCalculatorType();
@@ -3464,7 +3327,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
protected IPath[] calculateDependenciesForSource(IManagedDependencyCalculator depCalculator) {
IPath[] addlDeps = depCalculator.getDependencies();
if (addlDeps != null) {
- for (int i=0; i<addlDeps.length; i++) {
+ for (int i = 0; i < addlDeps.length; i++) {
if (!addlDeps[i].isAbsolute()) {
// Convert from project relative to build directory relative
IPath absolutePath = project.getLocation().append(addlDeps[i]);
@@ -3475,7 +3338,6 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
return addlDeps;
}
-
/*************************************************************************
* M A K E F I L E G E N E R A T I O N C O M M O N M E T H O D S
************************************************************************/
@@ -3492,13 +3354,13 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// extensions .c_upper, and .C, but realistically speaking the chances of this are
// practically nil so it doesn't seem worth the hassle of generating a truly
// unique name.
- if(extensionName.equals(extensionName.toUpperCase())) {
+ if (extensionName.equals(extensionName.toUpperCase())) {
macroName.append(extensionName.toUpperCase()).append("_UPPER"); //$NON-NLS-1$
} else {
// lower case... no need for "UPPER_"
macroName.append(extensionName.toUpperCase());
}
- macroName.append("_SRCS"); //$NON-NLS-1$
+ macroName.append("_SRCS"); //$NON-NLS-1$
return macroName;
}
@@ -3514,13 +3376,13 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// extensions .c_upper, and .C, but realistically speaking the chances of this are
// practically nil so it doesn't seem worth the hassle of generating a truly
// unique name.
- if(extensionName.equals(extensionName.toUpperCase())) {
+ if (extensionName.equals(extensionName.toUpperCase())) {
macroName.append(extensionName.toUpperCase()).append("_UPPER"); //$NON-NLS-1$
} else {
// lower case... no need for "UPPER_"
macroName.append(extensionName.toUpperCase());
}
- macroName.append("_DEPS"); //$NON-NLS-1$
+ macroName.append("_DEPS"); //$NON-NLS-1$
return macroName;
}
@@ -3546,7 +3408,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
}
}
}
- return h.outputExtensionsSet;
+ return h.outputExtensionsSet;
}
/**
@@ -3563,13 +3425,16 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
*
* @return a <code>true</code> if the dependency file is modified
*/
- static public boolean populateDummyTargets(IConfiguration cfg, IFile makefile, boolean force) throws CoreException, IOException {
+ static public boolean populateDummyTargets(IConfiguration cfg, IFile makefile, boolean force)
+ throws CoreException, IOException {
return populateDummyTargets(cfg.getRootFolderInfo(), makefile, force);
}
- static public boolean populateDummyTargets(IResourceInfo rcInfo, IFile makefile, boolean force) throws CoreException, IOException {
+ static public boolean populateDummyTargets(IResourceInfo rcInfo, IFile makefile, boolean force)
+ throws CoreException, IOException {
- if (makefile == null || !makefile.exists()) return false;
+ if (makefile == null || !makefile.exists())
+ return false;
// Get the contents of the dependency file
InputStream contentStream = makefile.getContents(false);
@@ -3590,12 +3455,12 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// files that do not have a comment
String inBufferString = inBuffer.toString();
if (!force && inBufferString.startsWith(COMMENT_SYMBOL)) {
- return false;
+ return false;
}
// Try to determine if this file already has dummy targets defined.
// If so, we will only add the comment.
- String[] bufferLines = inBufferString.split("[\\r\\n]"); //$NON-NLS-1$
+ String[] bufferLines = inBufferString.split("[\\r\\n]"); //$NON-NLS-1$
for (String bufferLine : bufferLines) {
if (bufferLine.endsWith(":")) { //$NON-NLS-1$
StringBuffer outBuffer = addDefaultHeader();
@@ -3606,17 +3471,17 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
}
// Reconstruct the buffer tokens into useful chunks of dependency information
- Vector<String> bufferTokens = new Vector<String>(Arrays.asList(inBufferString.split("\\s"))); //$NON-NLS-1$
+ Vector<String> bufferTokens = new Vector<String>(Arrays.asList(inBufferString.split("\\s"))); //$NON-NLS-1$
Vector<String> deps = new Vector<String>(bufferTokens.size());
Iterator<String> tokenIter = bufferTokens.iterator();
while (tokenIter.hasNext()) {
String token = tokenIter.next();
- if (token.lastIndexOf("\\") == token.length() - 1 && token.length() > 1) { //$NON-NLS-1$
+ if (token.lastIndexOf("\\") == token.length() - 1 && token.length() > 1) { //$NON-NLS-1$
// This is escaped so keep adding to the token until we find the end
while (tokenIter.hasNext()) {
String nextToken = tokenIter.next();
token += WHITESPACE + nextToken;
- if (!nextToken.endsWith("\\")) { //$NON-NLS-1$
+ if (!nextToken.endsWith("\\")) { //$NON-NLS-1$
break;
}
}
@@ -3718,11 +3583,11 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
save = true;
IFolderInfo fo = null;
- if(rcInfo instanceof IFolderInfo){
- fo = (IFolderInfo)rcInfo;
+ if (rcInfo instanceof IFolderInfo) {
+ fo = (IFolderInfo) rcInfo;
} else {
IConfiguration c = rcInfo.getParent();
- fo = (IFolderInfo)c.getResourceInfo(rcInfo.getPath().removeLastSegments(1), false);
+ fo = (IFolderInfo) c.getResourceInfo(rcInfo.getPath().removeLastSegments(1), false);
}
// Dummy targets to add to the makefile
for (String dummy : deps) {
@@ -3751,7 +3616,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
* @return resulting string
*/
static public String escapedEcho(String string) {
- String escapedString = string.replaceAll("'", "'\"'\"'"); //$NON-NLS-1$ //$NON-NLS-2$
+ String escapedString = string.replaceAll("'", "'\"'\"'"); //$NON-NLS-1$ //$NON-NLS-2$
return ECHO + WHITESPACE + SINGLE_QUOTE + escapedString + SINGLE_QUOTE + NEWLINE;
}
@@ -3766,7 +3631,8 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
static protected StringBuffer addDefaultHeader() {
StringBuffer buffer = new StringBuffer();
outputCommentLine(buffer);
- buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(HEADER)).append(NEWLINE);
+ buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(HEADER))
+ .append(NEWLINE);
outputCommentLine(buffer);
buffer.append(NEWLINE);
return buffer;
@@ -3782,8 +3648,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
buffer.append(NEWLINE);
}
- static public boolean containsSpecialCharacters(String path)
- {
+ static public boolean containsSpecialCharacters(String path) {
return path.matches(".*(\\s|[\\{\\}\\(\\)\\$\\@%=;]).*"); //$NON-NLS-1$
}
@@ -3814,12 +3679,14 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
* ${addprefix $(ROOT)/, \
*/
// TODO fix comment
- protected void addMacroAdditionPrefix(LinkedHashMap<String, String> map, String macroName, String relativePath, boolean addPrefix) {
+ protected void addMacroAdditionPrefix(LinkedHashMap<String, String> map, String macroName, String relativePath,
+ boolean addPrefix) {
// there is no entry in the map, so create a buffer for this macro
StringBuffer tempBuffer = new StringBuffer();
tempBuffer.append(macroName).append(WHITESPACE).append(MACRO_ADDITION_PREFIX_SUFFIX);
if (addPrefix) {
- tempBuffer.append(MACRO_ADDITION_ADDPREFIX_HEADER).append(relativePath).append(MACRO_ADDITION_ADDPREFIX_SUFFIX);
+ tempBuffer.append(MACRO_ADDITION_ADDPREFIX_HEADER).append(relativePath)
+ .append(MACRO_ADDITION_ADDPREFIX_SUFFIX);
}
// have to store the buffer in String form as StringBuffer is not a sublcass of Object
@@ -3848,8 +3715,8 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
* File additions look like:
* example.c, \
*/
- protected void addMacroAdditionFile(HashMap<String, String> map, String macroName,
- String relativePath, IPath sourceLocation, boolean generatedSource) {
+ protected void addMacroAdditionFile(HashMap<String, String> map, String macroName, String relativePath,
+ IPath sourceLocation, boolean generatedSource) {
// Add the source file path to the makefile line that adds source files to the build variable
String srcName;
IPath projectLocation = getPathForResource(project);
@@ -3860,13 +3727,13 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
if (dirLocation.isPrefixOf(sourceLocation)) {
IPath srcPath = sourceLocation.removeFirstSegments(dirLocation.segmentCount()).setDevice(null);
if (generatedSource) {
- srcName = "./" + srcPath.toString(); //$NON-NLS-1$
+ srcName = "./" + srcPath.toString(); //$NON-NLS-1$
} else {
- srcName = ROOT + "/" + srcPath.toString(); //$NON-NLS-1$
+ srcName = ROOT + "/" + srcPath.toString(); //$NON-NLS-1$
}
} else {
if (generatedSource && !sourceLocation.isAbsolute()) {
- srcName = "./" + relativePath + sourceLocation.lastSegment().toString(); //$NON-NLS-1$
+ srcName = "./" + relativePath + sourceLocation.lastSegment().toString(); //$NON-NLS-1$
} else {
// TODO: Should we use relative paths when possible (e.g., see MbsMacroSupplier.calculateRelPath)
srcName = sourceLocation.toString();
@@ -3883,13 +3750,13 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
public void addMacroAdditionFiles(HashMap<String, String> map, String macroName, Vector<String> filenames) {
StringBuffer buffer = new StringBuffer();
buffer.append(map.get(macroName));
- for (int i=0; i<filenames.size(); i++) {
+ for (int i = 0; i < filenames.size(); i++) {
String filename = filenames.get(i);
if (filename.length() > 0) {
-
+
// Bug 417288, ilg@livius.net & freidin.alex@gmail.com
filename = ensurePathIsGNUMakeTargetRuleCompatibleSyntax(filename);
-
+
buffer.append(filename).append(WHITESPACE).append(LINEBREAK);
}
}
@@ -3903,7 +3770,8 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
protected StringBuffer writeAdditionMacros(LinkedHashMap<String, String> map) {
StringBuffer buffer = new StringBuffer();
// Add the comment
- buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(MOD_VARS)).append(NEWLINE);
+ buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(MOD_VARS))
+ .append(NEWLINE);
for (String macroString : map.values()) {
// Check if we added any files to the rule
@@ -3913,9 +3781,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Remove the final "/"
if (macroString.endsWith(LINEBREAK)) {
- macroString = macroString.substring(0, (macroString
- .length() - 2))
- + NEWLINE;
+ macroString = macroString.substring(0, (macroString.length() - 2)) + NEWLINE;
}
currentBuffer.append(macroString);
@@ -3935,16 +3801,17 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
protected StringBuffer writeTopAdditionMacros(List<String> varList, HashMap<String, String> varMap) {
StringBuffer buffer = new StringBuffer();
// Add the comment
- buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(MOD_VARS)).append(NEWLINE);
+ buffer.append(COMMENT_SYMBOL).append(WHITESPACE).append(ManagedMakeMessages.getResourceString(MOD_VARS))
+ .append(NEWLINE);
- for (int i=0; i<varList.size(); i++) {
+ for (int i = 0; i < varList.size(); i++) {
String addition = varMap.get(varList.get(i));
StringBuffer currentBuffer = new StringBuffer();
currentBuffer.append(addition);
currentBuffer.append(NEWLINE);
- // append the contents of the buffer to the master buffer for the whole file
- buffer.append(currentBuffer);
+ // append the contents of the buffer to the master buffer for the whole file
+ buffer.append(currentBuffer);
}
return buffer.append(NEWLINE);
}
@@ -3955,10 +3822,10 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
*/
protected void calculateToolInputsOutputs() {
- toolInfos.accept(new IPathSettingsContainerVisitor(){
+ toolInfos.accept(new IPathSettingsContainerVisitor() {
@Override
- public boolean visit(PathSettingsContainer container){
- ToolInfoHolder h = (ToolInfoHolder)container.getValue();
+ public boolean visit(PathSettingsContainer container) {
+ ToolInfoHolder h = (ToolInfoHolder) container.getValue();
ITool[] buildTools = h.buildTools;
ManagedBuildGnuToolInfo[] gnuToolInfos = h.gnuToolInfos;
// We are "done" when the information for all tools has been calculated,
@@ -3969,45 +3836,39 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Identify the target tool
ITool targetTool = config.calculateTargetTool();
- // if (targetTool == null) {
- // targetTool = info.getToolFromOutputExtension(buildTargetExt);
- // }
+ // if (targetTool == null) {
+ // targetTool = info.getToolFromOutputExtension(buildTargetExt);
+ // }
// Initialize the tool info array and the done state
- if(buildTools.length != 0 && buildTools[0].getCustomBuildStep())
+ if (buildTools.length != 0 && buildTools[0].getCustomBuildStep())
return true;
- for (int i=0; i<buildTools.length; i++) {
+ for (int i = 0; i < buildTools.length; i++) {
if ((buildTools[i] == targetTool)) {
String ext = config.getArtifactExtension();
//try to resolve the build macros in the artifact extension
- try{
- ext = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
- ext,
- "", //$NON-NLS-1$
+ try {
+ ext = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(ext, "", //$NON-NLS-1$
" ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- config);
- } catch (BuildMacroException e){
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, config);
+ } catch (BuildMacroException e) {
}
String name = config.getArtifactName();
//try to resolve the build macros in the artifact name
- try{
+ try {
String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
- name,
- "", //$NON-NLS-1$
+ name, "", //$NON-NLS-1$
" ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- config);
- if((resolved = resolved.trim()).length() > 0)
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, config);
+ if ((resolved = resolved.trim()).length() > 0)
name = resolved;
- } catch (BuildMacroException e){
+ } catch (BuildMacroException e) {
}
- gnuToolInfos[i] = new ManagedBuildGnuToolInfo(project, buildTools[i], true,
- name, ext);
+ gnuToolInfos[i] = new ManagedBuildGnuToolInfo(project, buildTools[i], true, name, ext);
} else {
gnuToolInfos[i] = new ManagedBuildGnuToolInfo(project, buildTools[i], false, null, null);
}
@@ -4019,11 +3880,11 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
Set<Entry<String, List<IPath>>> set = buildOutVars.entrySet();
for (Entry<String, List<IPath>> entry : set) {
String macroName = entry.getKey();
-
+
// for projects with specific setting on folders/files do
// not clear the macro value on subsequent passes
if (!map.containsKey(macroName)) {
- addMacroAdditionPrefix(map, macroName, "", false); //$NON-NLS-1$
+ addMacroAdditionPrefix(map, macroName, "", false); //$NON-NLS-1$
}
}
@@ -4033,34 +3894,38 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
while (!done) {
int[] testState = new int[doneState.length];
- for (int i=0; i<testState.length; i++) testState[i] = 0;
+ for (int i = 0; i < testState.length; i++)
+ testState[i] = 0;
// Calculate inputs
- for (int i=0; i<gnuToolInfos.length; i++) {
+ for (int i = 0; i < gnuToolInfos.length; i++) {
if (gnuToolInfos[i].areInputsCalculated()) {
testState[i]++;
} else {
- if (gnuToolInfos[i].calculateInputs(GnuMakefileGenerator.this, config, projectResources, h, lastChance)) {
+ if (gnuToolInfos[i].calculateInputs(GnuMakefileGenerator.this, config, projectResources, h,
+ lastChance)) {
testState[i]++;
}
}
}
// Calculate dependencies
- for (int i=0; i<gnuToolInfos.length; i++) {
+ for (int i = 0; i < gnuToolInfos.length; i++) {
if (gnuToolInfos[i].areDependenciesCalculated()) {
testState[i]++;
} else {
- if (gnuToolInfos[i].calculateDependencies(GnuMakefileGenerator.this, config, handledDepsInputExtensions, h, lastChance)) {
+ if (gnuToolInfos[i].calculateDependencies(GnuMakefileGenerator.this, config,
+ handledDepsInputExtensions, h, lastChance)) {
testState[i]++;
}
}
}
// Calculate outputs
- for (int i=0; i<gnuToolInfos.length; i++) {
+ for (int i = 0; i < gnuToolInfos.length; i++) {
if (gnuToolInfos[i].areOutputsCalculated()) {
testState[i]++;
} else {
- if (gnuToolInfos[i].calculateOutputs(GnuMakefileGenerator.this, config, handledOutsInputExtensions, lastChance)) {
+ if (gnuToolInfos[i].calculateOutputs(GnuMakefileGenerator.this, config,
+ handledOutsInputExtensions, lastChance)) {
testState[i]++;
}
}
@@ -4078,7 +3943,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// If we have made no progress, give it a "last chance" and then quit
if (!done) {
done = true;
- for (int i=0; i<testState.length; i++) {
+ for (int i = 0; i < testState.length; i++) {
if (testState[i] != doneState[i]) {
done = false;
break;
@@ -4110,15 +3975,17 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
* variable have done so.
* @return List
*/
- public List<String> getBuildVariableList(ToolInfoHolder h, String variable, int locationType, IPath directory, boolean getAll) {
+ public List<String> getBuildVariableList(ToolInfoHolder h, String variable, int locationType, IPath directory,
+ boolean getAll) {
ManagedBuildGnuToolInfo[] gnuToolInfos = h.gnuToolInfos;
boolean done = true;
- for (int i=0; i<gnuToolInfos.length; i++) {
+ for (int i = 0; i < gnuToolInfos.length; i++) {
if (!gnuToolInfos[i].areOutputVariablesCalculated()) {
done = false;
}
}
- if (!done && getAll) return null;
+ if (!done && getAll)
+ return null;
List<IPath> list = buildSrcVars.get(variable);
if (list == null) {
list = buildOutVars.get(variable);
@@ -4135,14 +4002,14 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
dirLocation = dirLocation.append(directory);
}
}
- for (int i=0; i<list.size(); i++) {
+ for (int i = 0; i < list.size(); i++) {
IPath path = list.get(i);
if (locationType != ABSOLUTE) {
- if (dirLocation!=null && dirLocation.isPrefixOf(path)) {
+ if (dirLocation != null && dirLocation.isPrefixOf(path)) {
path = path.removeFirstSegments(dirLocation.segmentCount()).setDevice(null);
}
}
- if ( fileList == null ) {
+ if (fileList == null) {
fileList = new Vector<String>();
}
fileList.add(path.toString());
@@ -4234,8 +4101,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
protected void appendDeletedSubdirectory(IContainer container) {
// No point in adding a folder if the parent is already there
IContainer parent = container.getParent();
- if (!getDeletedDirList().contains(container) &&
- !getDeletedDirList().contains(parent)) {
+ if (!getDeletedDirList().contains(container) && !getDeletedDirList().contains(parent)) {
getDeletedDirList().add(container);
}
}
@@ -4258,12 +4124,11 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
protected void appendModifiedSubdirectory(IResource resource) {
IContainer container = resource.getParent();
- if (!getModifiedList().contains(container)) {
- getModifiedList().add(container);
- }
+ if (!getModifiedList().contains(container)) {
+ getModifiedList().add(container);
+ }
}
-
/*************************************************************************
* O T H E R M E T H O D S
************************************************************************/
@@ -4309,8 +4174,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Now make the requested folder
try {
folder.create(true, true, null);
- }
- catch (CoreException e) {
+ } catch (CoreException e) {
if (e.getStatus().getCode() == IResourceStatus.PATH_OCCUPIED)
folder.refreshLocal(IResource.DEPTH_ZERO, null);
else
@@ -4348,8 +4212,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
newFile.setDerived(true, null);
}
- }
- catch (CoreException e) {
+ } catch (CoreException e) {
// If the file already existed locally, just refresh to get contents
if (e.getStatus().getCode() == IResourceStatus.PATH_OCCUPIED)
newFile.refreshLocal(IResource.DEPTH_ZERO, null);
@@ -4365,16 +4228,16 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
String fileName = getFileName(deletedFile);
String srcExtension = deletedFile.getFileExtension();
IPath folderPath = inFullPathFromOutFullPath(deletedFile.getFullPath().removeLastSegments(1));
- if(folderPath != null){
+ if (folderPath != null) {
folderPath = folderPath.removeFirstSegments(1);
} else {
folderPath = new Path(""); //$NON-NLS-1$
}
IResourceInfo rcInfo = config.getResourceInfo(folderPath, false);
- if(rcInfo instanceof IFileInfo){
+ if (rcInfo instanceof IFileInfo) {
rcInfo = config.getResourceInfo(folderPath.removeLastSegments(1), false);
}
- String targetExtension = ((IFolderInfo)rcInfo).getOutputExtension(srcExtension);
+ String targetExtension = ((IFolderInfo) rcInfo).getOutputExtension(srcExtension);
if (!targetExtension.isEmpty())
fileName += DOT + targetExtension;
IPath projectRelativePath = deletedFile.getProjectRelativePath().removeLastSegments(1);
@@ -4390,9 +4253,9 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
}
}
- private IPath inFullPathFromOutFullPath(IPath path){
+ private IPath inFullPathFromOutFullPath(IPath path) {
IPath inPath = null;
- if(topBuildDir.isPrefixOf(path)){
+ if (topBuildDir.isPrefixOf(path)) {
inPath = path.removeFirstSegments(topBuildDir.segmentCount());
inPath = project.getFullPath().append(path);
}
@@ -4406,7 +4269,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
IManagedDependencyGeneratorType depType = null;
String sourceExtension = deletedFile.getFileExtension();
IPath folderPath = inFullPathFromOutFullPath(deletedFile.getFullPath().removeLastSegments(1));
- if(folderPath != null){
+ if (folderPath != null) {
folderPath = folderPath.removeFirstSegments(1);
} else {
folderPath = new Path(""); //$NON-NLS-1$
@@ -4427,17 +4290,17 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
IPath absolutePath = deletedFile.getLocation();
depFilePaths[0] = ManagedBuildManager.calculateRelativePath(getTopBuildDir(), absolutePath);
depFilePaths[0] = depFilePaths[0].removeFileExtension().addFileExtension(DEP_EXT);
- } else if (calcType == IManagedDependencyGeneratorType.TYPE_BUILD_COMMANDS ||
- calcType == IManagedDependencyGeneratorType.TYPE_PREBUILD_COMMANDS) {
- IManagedDependencyGenerator2 depGen = (IManagedDependencyGenerator2)depType;
- IManagedDependencyInfo depInfo = depGen.getDependencySourceInfo(
- deletedFile.getProjectRelativePath(), deletedFile, config, tool, getBuildWorkingDir());
+ } else if (calcType == IManagedDependencyGeneratorType.TYPE_BUILD_COMMANDS
+ || calcType == IManagedDependencyGeneratorType.TYPE_PREBUILD_COMMANDS) {
+ IManagedDependencyGenerator2 depGen = (IManagedDependencyGenerator2) depType;
+ IManagedDependencyInfo depInfo = depGen.getDependencySourceInfo(deletedFile.getProjectRelativePath(),
+ deletedFile, config, tool, getBuildWorkingDir());
if (depInfo != null) {
if (calcType == IManagedDependencyGeneratorType.TYPE_BUILD_COMMANDS) {
- IManagedDependencyCommands depCommands = (IManagedDependencyCommands)depInfo;
+ IManagedDependencyCommands depCommands = (IManagedDependencyCommands) depInfo;
depFilePaths = depCommands.getDependencyFiles();
} else if (calcType == IManagedDependencyGeneratorType.TYPE_PREBUILD_COMMANDS) {
- IManagedDependencyPreBuild depPreBuild = (IManagedDependencyPreBuild)depInfo;
+ IManagedDependencyPreBuild depPreBuild = (IManagedDependencyPreBuild) depInfo;
depFilePaths = depPreBuild.getDependencyFiles();
}
}
@@ -4564,7 +4427,8 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
private void removeGeneratedDirectory(IContainer subDir) {
try {
// The source directory isn't empty
- if (subDir.exists() && subDir.members().length > 0) return;
+ if (subDir.exists() && subDir.members().length > 0)
+ return;
} catch (CoreException e) {
// The resource doesn't exist so we should delete the output folder
}
@@ -4587,7 +4451,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
}
protected void updateMonitor(String msg) {
- if (monitor!= null && !monitor.isCanceled()) {
+ if (monitor != null && !monitor.isCanceled()) {
monitor.subTask(msg);
monitor.worked(1);
}
@@ -4627,15 +4491,14 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
public static String ensureUnquoted(String path) {
boolean doubleQuoted = path.startsWith("\"") && path.endsWith("\""); //$NON-NLS-1$ //$NON-NLS-2$
boolean singleQuoted = path.startsWith("'") && path.endsWith("'"); //$NON-NLS-1$ //$NON-NLS-2$
- return doubleQuoted || singleQuoted ? path.substring(1,path.length()-1) : path;
+ return doubleQuoted || singleQuoted ? path.substring(1, path.length() - 1) : path;
}
@Override
- public void initialize(int buildKind, IConfiguration cfg, IBuilder builder,
- IProgressMonitor monitor) {
+ public void initialize(int buildKind, IConfiguration cfg, IBuilder builder, IProgressMonitor monitor) {
// Save the project so we can get path and member information
this.project = cfg.getOwner().getProject();
- if(builder == null){
+ if (builder == null) {
builder = cfg.getEditableBuilder();
}
try {
@@ -4646,40 +4509,35 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
// Save the monitor reference for reporting back to the user
this.monitor = monitor;
// Get the build info for the project
-// this.info = info;
+ // this.info = info;
// Get the name of the build target
buildTargetName = cfg.getArtifactName();
// Get its extension
buildTargetExt = cfg.getArtifactExtension();
- try{
+ try {
//try to resolve the build macros in the target extension
- buildTargetExt = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
- buildTargetExt,
+ buildTargetExt = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(buildTargetExt,
"", //$NON-NLS-1$
" ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- builder);
- } catch (BuildMacroException e){
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, builder);
+ } catch (BuildMacroException e) {
}
- try{
+ try {
//try to resolve the build macros in the target name
- String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
- buildTargetName,
+ String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(buildTargetName,
"", //$NON-NLS-1$
" ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- builder);
- if (resolved!=null) {
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, builder);
+ if (resolved != null) {
resolved = resolved.trim();
- if(resolved.length() > 0)
+ if (resolved.length() > 0)
buildTargetName = resolved;
}
- } catch (BuildMacroException e){
+ } catch (BuildMacroException e) {
}
-
if (buildTargetExt == null) {
buildTargetExt = ""; //$NON-NLS-1$
}
@@ -4692,30 +4550,31 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
topBuildDir = project.getFolder(cfg.getName()).getFullPath();
srcEntries = config.getSourceEntries();
- if(srcEntries.length == 0){
- srcEntries = new ICSourceEntry[]{new CSourceEntry(Path.EMPTY, null, ICSettingEntry.RESOLVED | ICSettingEntry.VALUE_WORKSPACE_PATH)};
+ if (srcEntries.length == 0) {
+ srcEntries = new ICSourceEntry[] {
+ new CSourceEntry(Path.EMPTY, null, ICSettingEntry.RESOLVED | ICSettingEntry.VALUE_WORKSPACE_PATH) };
} else {
ICConfigurationDescription cfgDes = ManagedBuildManager.getDescriptionForConfiguration(config);
srcEntries = CDataUtil.resolveEntries(srcEntries, cfgDes);
}
}
- private void initToolInfos(){
+ private void initToolInfos() {
toolInfos = PathSettingsContainer.createRootContainer();
IResourceInfo rcInfos[] = config.getResourceInfos();
for (IResourceInfo rcInfo : rcInfos) {
- if(rcInfo.isExcluded() /*&& !((ResourceInfo)rcInfo).isRoot()*/)
+ if (rcInfo.isExcluded() /*&& !((ResourceInfo)rcInfo).isRoot()*/)
continue;
ToolInfoHolder h = getToolInfo(rcInfo.getPath(), true);
- if(rcInfo instanceof IFolderInfo){
- IFolderInfo fo = (IFolderInfo)rcInfo;
+ if (rcInfo instanceof IFolderInfo) {
+ IFolderInfo fo = (IFolderInfo) rcInfo;
h.buildTools = fo.getFilteredTools();
h.buildToolsUsed = new boolean[h.buildTools.length];
h.gnuToolInfos = new ManagedBuildGnuToolInfo[h.buildTools.length];
} else {
- IFileInfo fi = (IFileInfo)rcInfo;
+ IFileInfo fi = (IFileInfo) rcInfo;
h.buildTools = fi.getToolsToInvoke();
h.buildToolsUsed = new boolean[h.buildTools.length];
h.gnuToolInfos = new ManagedBuildGnuToolInfo[h.buildTools.length];
@@ -4723,25 +4582,25 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 {
}
}
- private ToolInfoHolder getToolInfo(IPath path){
+ private ToolInfoHolder getToolInfo(IPath path) {
return getToolInfo(path, false);
}
- private ToolInfoHolder getFolderToolInfo(IPath path){
+ private ToolInfoHolder getFolderToolInfo(IPath path) {
IResourceInfo rcInfo = config.getResourceInfo(path, false);
- while(rcInfo instanceof IFileInfo){
+ while (rcInfo instanceof IFileInfo) {
path = path.removeLastSegments(1);
rcInfo = config.getResourceInfo(path, false);
}
return getToolInfo(path, false);
}
- private ToolInfoHolder getToolInfo(IPath path, boolean create){
+ private ToolInfoHolder getToolInfo(IPath path, boolean create) {
PathSettingsContainer child = toolInfos.getChildContainer(path, create, create);
ToolInfoHolder h = null;
- if(child != null){
- h = (ToolInfoHolder)child.getValue();
- if(h == null && create){
+ if (child != null) {
+ h = (ToolInfoHolder) child.getValue();
+ if (h == null && create) {
h = new ToolInfoHolder();
child.setValue(h);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/IManagedBuildGnuToolInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/IManagedBuildGnuToolInfo.java
index 588457b74cc..af854c47c40 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/IManagedBuildGnuToolInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/IManagedBuildGnuToolInfo.java
@@ -18,86 +18,86 @@ import java.util.Vector;
/**
* This interface returns information about a Tool's inputs
* and outputs while a Gnu makefile is being generated.
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IManagedBuildGnuToolInfo {
- public final String DOT = "."; //$NON-NLS-1$
+ public final String DOT = "."; //$NON-NLS-1$
/**
- * Returns <code>true</code> if the tool's inputs have been calculated,
+ * Returns <code>true</code> if the tool's inputs have been calculated,
* else <code>false</code>.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean areInputsCalculated();
-
+
/**
* Returns the tool's inputs in command line format. This will use
* variables rather than actual file names as appropriate.
- *
+ *
* @return Vector
*/
public Vector<String> getCommandInputs();
-
+
/**
* Returns the raw list of tool's input file names.
- *
+ *
* @return Vector
*/
public Vector<String> getEnumeratedInputs();
-
+
/**
- * Returns <code>true</code> if the tool's outputs have been calculated,
+ * Returns <code>true</code> if the tool's outputs have been calculated,
* else <code>false</code>.
- *
- * @return boolean
+ *
+ * @return boolean
*/
- public boolean areOutputsCalculated();
+ public boolean areOutputsCalculated();
/**
* Returns the tool's outputs in command line format. This will use
* variables rather than actual file names as appropriate.
- *
+ *
* @return Vector
*/
public Vector<String> getCommandOutputs();
-
+
/**
* Returns the raw list of tool's primary output file names.
- *
+ *
* @return Vector
*/
public Vector<String> getEnumeratedPrimaryOutputs();
-
+
/**
* Returns the raw list of tool's secondary output file names.
- *
+ *
* @return Vector
*/
public Vector<String> getEnumeratedSecondaryOutputs();
-
+
/**
* Returns the raw list of tool's output variable names.
- *
+ *
* @return Vector
*/
public Vector<String> getOutputVariables();
-
+
/**
- * Returns <code>true</code> if the tool's dependencies have been calculated,
+ * Returns <code>true</code> if the tool's dependencies have been calculated,
* else <code>false</code>.
- *
- * @return boolean
+ *
+ * @return boolean
*/
public boolean areDependenciesCalculated();
-
+
/**
* Returns the tool's dependencies in command line format. This will use
* variables rather than actual file names as appropriate.
* Dependencies are top build directory relative.
- *
+ *
* @return Vector
*/
public Vector<String> getCommandDependencies();
@@ -106,23 +106,23 @@ public interface IManagedBuildGnuToolInfo {
* Returns the tool's additional targets as determined by the
* dependency calculator.
* Additional targets are top build directory relative
- *
+ *
* @return Vector
*/
public Vector<String> getAdditionalTargets();
-
+
/**
* Returns the raw list of tool's input dependencies.
- *
+ *
* @return Vector
*/
- //public Vector<String> getEnumeratedDependencies();
-
+ //public Vector<String> getEnumeratedDependencies();
+
/**
- * Returns <code>true</code> if this is the target tool
+ * Returns <code>true</code> if this is the target tool
* else <code>false</code>.
- *
- * @return boolean
+ *
+ * @return boolean
*/
- public boolean isTargetTool();
+ public boolean isTargetTool();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/ManagedBuildGnuToolInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/ManagedBuildGnuToolInfo.java
index 3d93f8a8138..a9565da46a5 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/ManagedBuildGnuToolInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/ManagedBuildGnuToolInfo.java
@@ -85,7 +85,7 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
*/
public ManagedBuildGnuToolInfo(IProject project, ITool tool, boolean targetTool, String name, String ext) {
this.project = project;
- this.tool = (Tool)tool;
+ this.tool = (Tool) tool;
bIsTargetTool = targetTool;
if (bIsTargetTool) {
targetName = name;
@@ -173,7 +173,8 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
* Other Methods
*/
- public boolean calculateInputs(GnuMakefileGenerator makeGen, IConfiguration config, IResource[] projResources, ToolInfoHolder h, boolean lastChance) {
+ public boolean calculateInputs(GnuMakefileGenerator makeGen, IConfiguration config, IResource[] projResources,
+ ToolInfoHolder h, boolean lastChance) {
// Get the inputs for this tool invocation
// Note that command inputs that are also dependencies are also added to the command dependencies list
@@ -184,16 +185,16 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
* 3. Use the file extensions and the resources in the project
*/
boolean done = true;
- Vector<String> myCommandInputs = new Vector<String>(); // Inputs for the tool command line
- Vector<String> myCommandDependencies = new Vector<String>(); // Dependencies for the make rule
- Vector<String> myEnumeratedInputs = new Vector<String>(); // Complete list of individual inputs
+ Vector<String> myCommandInputs = new Vector<String>(); // Inputs for the tool command line
+ Vector<String> myCommandDependencies = new Vector<String>(); // Dependencies for the make rule
+ Vector<String> myEnumeratedInputs = new Vector<String>(); // Complete list of individual inputs
IInputType[] inTypes = tool.getInputTypes();
if (inTypes != null && inTypes.length > 0) {
for (IInputType type : inTypes) {
- Vector<String> itCommandInputs = new Vector<String>(); // Inputs for the tool command line for this input-type
- Vector<String> itCommandDependencies = new Vector<String>(); // Dependencies for the make rule for this input-type
- Vector<String> itEnumeratedInputs = new Vector<String>(); // Complete list of individual inputs for this input-type
+ Vector<String> itCommandInputs = new Vector<String>(); // Inputs for the tool command line for this input-type
+ Vector<String> itCommandDependencies = new Vector<String>(); // Dependencies for the make rule for this input-type
+ Vector<String> itEnumeratedInputs = new Vector<String>(); // Complete list of individual inputs for this input-type
String variable = type.getBuildVariable();
boolean primaryInput = type.getPrimaryInput();
boolean useFileExts = false;
@@ -207,24 +208,19 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
int optType = option.getValueType();
if (optType == IOption.STRING) {
inputs.add(option.getStringValue());
- } else if (
- optType == IOption.STRING_LIST ||
- optType == IOption.LIBRARIES ||
- optType == IOption.OBJECTS ||
- optType == IOption.INCLUDE_FILES ||
- optType == IOption.LIBRARY_PATHS ||
- optType == IOption.LIBRARY_FILES ||
- optType == IOption.MACRO_FILES) {
+ } else if (optType == IOption.STRING_LIST || optType == IOption.LIBRARIES
+ || optType == IOption.OBJECTS || optType == IOption.INCLUDE_FILES
+ || optType == IOption.LIBRARY_PATHS || optType == IOption.LIBRARY_FILES
+ || optType == IOption.MACRO_FILES) {
@SuppressWarnings("unchecked")
- List<String> valueList = (List<String>)option.getValue();
+ List<String> valueList = (List<String>) option.getValue();
inputs = valueList;
tool.filterValues(optType, inputs);
tool.filterValues(optType, inputs);
}
- for (int j=0; j<inputs.size(); j++) {
+ for (int j = 0; j < inputs.size(); j++) {
String inputName = inputs.get(j);
-
try {
// try to resolve the build macros in the output
// names
@@ -236,29 +232,16 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
if (inputName.indexOf(" ") != -1) //$NON-NLS-1$
{
// resolve to string
- resolved = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveValue(
- inputName,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_OPTION,
- new OptionContextData(
- option,
- tool));
+ resolved = ManagedBuildManager.getBuildMacroProvider().resolveValue(inputName, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_OPTION, new OptionContextData(option, tool));
} else {
// resolve to makefile variable format
- resolved = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveValueToMakefileFormat(
- inputName,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_OPTION,
- new OptionContextData(
- option,
- tool));
+ resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
+ inputName, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_OPTION, new OptionContextData(option, tool));
}
if ((resolved = resolved.trim()).length() > 0)
@@ -274,14 +257,14 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
// NO - itCommandInputs.add(inputName);
// NO - itEnumeratedInputs.add(inputName);
}
- } catch( BuildException ex ) {
+ } catch (BuildException ex) {
}
} else {
// Build Variable?
if (variable.length() > 0) {
- String cmdVariable = variable = "$(" + variable + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ String cmdVariable = variable = "$(" + variable + ")"; //$NON-NLS-1$ //$NON-NLS-2$
itCommandInputs.add(cmdVariable);
if (primaryInput) {
itCommandDependencies.add(0, cmdVariable);
@@ -290,8 +273,8 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
}
// If there is an output variable with the same name, get
// the files associated with it.
- List<String> outMacroList = makeGen.getBuildVariableList(h, variable, GnuMakefileGenerator.PROJECT_RELATIVE,
- null, true);
+ List<String> outMacroList = makeGen.getBuildVariableList(h, variable,
+ GnuMakefileGenerator.PROJECT_RELATIVE, null, true);
if (outMacroList != null) {
itEnumeratedInputs.addAll(outMacroList);
} else {
@@ -308,47 +291,47 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
// Use file extensions
if (variable.length() == 0 || useFileExts) {
//if (type.getMultipleOfType()) {
- // Calculate EnumeratedInputs using the file extensions and the resources in the project
- // Note: This is only correct for tools with multipleOfType == true, but for other tools
- // it gives us an input resource for generating default names
- // Determine the set of source input macros to use
- HashSet<String> handledInputExtensions = new HashSet<String>();
- String[] exts = type.getSourceExtensions(tool);
- if (projResources != null) {
- for (IResource rc : projResources) {
- if (rc.getType() == IResource.FILE) {
- String fileExt = rc.getFileExtension();
-
- // fix for NPE, bugzilla 99483
- if(fileExt == null)
- {
- fileExt = ""; //$NON-NLS-1$
- }
+ // Calculate EnumeratedInputs using the file extensions and the resources in the project
+ // Note: This is only correct for tools with multipleOfType == true, but for other tools
+ // it gives us an input resource for generating default names
+ // Determine the set of source input macros to use
+ HashSet<String> handledInputExtensions = new HashSet<String>();
+ String[] exts = type.getSourceExtensions(tool);
+ if (projResources != null) {
+ for (IResource rc : projResources) {
+ if (rc.getType() == IResource.FILE) {
+ String fileExt = rc.getFileExtension();
+
+ // fix for NPE, bugzilla 99483
+ if (fileExt == null) {
+ fileExt = ""; //$NON-NLS-1$
+ }
- for (int k=0; k<exts.length; k++) {
- if (fileExt.equals(exts[k])) {
- if (!useFileExts) {
- if(!handledInputExtensions.contains(fileExt)) {
- handledInputExtensions.add(fileExt);
- String buildMacro = "$(" + makeGen.getSourceMacroName(fileExt).toString() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
- itCommandInputs.add(buildMacro);
- if (primaryInput) {
- itCommandDependencies.add(0, buildMacro);
- } else {
- itCommandDependencies.add(buildMacro);
- }
- }
+ for (int k = 0; k < exts.length; k++) {
+ if (fileExt.equals(exts[k])) {
+ if (!useFileExts) {
+ if (!handledInputExtensions.contains(fileExt)) {
+ handledInputExtensions.add(fileExt);
+ String buildMacro = "$(" //$NON-NLS-1$
+ + makeGen.getSourceMacroName(fileExt).toString() + ")"; //$NON-NLS-1$
+ itCommandInputs.add(buildMacro);
+ if (primaryInput) {
+ itCommandDependencies.add(0, buildMacro);
+ } else {
+ itCommandDependencies.add(buildMacro);
+ }
}
- if (type.getMultipleOfType() || itEnumeratedInputs.size() == 0) {
- // Add a path that is relative to the project directory
- itEnumeratedInputs.add(rc.getProjectRelativePath().toString());
- }
- break;
}
+ if (type.getMultipleOfType() || itEnumeratedInputs.size() == 0) {
+ // Add a path that is relative to the project directory
+ itEnumeratedInputs.add(rc.getProjectRelativePath().toString());
+ }
+ break;
}
}
}
}
+ }
//}
}
}
@@ -356,23 +339,25 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
// Get any additional inputs specified in the manifest file or the project file
IAdditionalInput[] addlInputs = type.getAdditionalInputs();
if (addlInputs != null) {
- for (int j=0; j<addlInputs.length; j++) {
+ for (int j = 0; j < addlInputs.length; j++) {
IAdditionalInput addlInput = addlInputs[j];
int kind = addlInput.getKind();
- if (kind == IAdditionalInput.KIND_ADDITIONAL_INPUT ||
- kind == IAdditionalInput.KIND_ADDITIONAL_INPUT_DEPENDENCY) {
+ if (kind == IAdditionalInput.KIND_ADDITIONAL_INPUT
+ || kind == IAdditionalInput.KIND_ADDITIONAL_INPUT_DEPENDENCY) {
String[] paths = addlInput.getPaths();
if (paths != null) {
for (int k = 0; k < paths.length; k++) {
String path = paths[k];
itEnumeratedInputs.add(path);
// Translate the path from project relative to build directory relative
- if (!(path.startsWith("$("))) { //$NON-NLS-1$
+ if (!(path.startsWith("$("))) { //$NON-NLS-1$
IResource addlResource = project.getFile(path);
if (addlResource != null) {
IPath addlPath = addlResource.getLocation();
if (addlPath != null) {
- path = ManagedBuildManager.calculateRelativePath(makeGen.getTopBuildDir(), addlPath).toString();
+ path = ManagedBuildManager
+ .calculateRelativePath(makeGen.getTopBuildDir(), addlPath)
+ .toString();
}
}
}
@@ -388,33 +373,30 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
try {
int optType = assignToOption.getValueType();
if (optType == IOption.STRING) {
- String optVal = ""; //$NON-NLS-1$
- for (int j=0; j<itCommandInputs.size(); j++) {
+ String optVal = ""; //$NON-NLS-1$
+ for (int j = 0; j < itCommandInputs.size(); j++) {
if (j != 0) {
- optVal += " "; //$NON-NLS-1$
+ optVal += " "; //$NON-NLS-1$
}
optVal += itCommandInputs.get(j);
}
ManagedBuildManager.setOption(config, tool, assignToOption, optVal);
- } else if (
- optType == IOption.STRING_LIST ||
- optType == IOption.LIBRARIES ||
- optType == IOption.OBJECTS ||
- optType == IOption.INCLUDE_FILES ||
- optType == IOption.LIBRARY_PATHS ||
- optType == IOption.LIBRARY_FILES ||
- optType == IOption.MACRO_FILES) {
+ } else if (optType == IOption.STRING_LIST || optType == IOption.LIBRARIES
+ || optType == IOption.OBJECTS || optType == IOption.INCLUDE_FILES
+ || optType == IOption.LIBRARY_PATHS || optType == IOption.LIBRARY_FILES
+ || optType == IOption.MACRO_FILES) {
//TODO: do we need to do anything with undefs here?
// 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[itEnumeratedInputs.size()];
- for (int j=0; j<itEnumeratedInputs.size(); j++) {
+ for (int j = 0; j < itEnumeratedInputs.size(); j++) {
paths[j] = itEnumeratedInputs.get(j);
IResource enumResource = project.getFile(paths[j]);
if (enumResource != null) {
IPath enumPath = enumResource.getLocation();
if (enumPath != null) {
- paths[j] = ManagedBuildManager.calculateRelativePath(makeGen.getTopBuildDir(), enumPath).toString();
+ paths[j] = ManagedBuildManager
+ .calculateRelativePath(makeGen.getTopBuildDir(), enumPath).toString();
}
}
}
@@ -427,12 +409,13 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
}
} else if (optType == IOption.ENUMERATED || optType == IOption.TREE) {
if (itCommandInputs.size() > 0) {
- ManagedBuildManager.setOption(config, tool, assignToOption, itCommandInputs.firstElement());
+ ManagedBuildManager.setOption(config, tool, assignToOption,
+ itCommandInputs.firstElement());
}
}
itCommandInputs.removeAllElements();
//itEnumeratedInputs.removeAllElements();
- } catch( BuildException ex ) {
+ } catch (BuildException ex) {
}
}
@@ -450,9 +433,9 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
// 2. The target name comes from the configuration artifact name
// The rule looks like:
// <targ_prefix><target>.<extension>: $(OBJS) <refd_project_1 ... refd_project_n>
- myCommandInputs.add("$(OBJS)"); //$NON-NLS-1$
- myCommandInputs.add("$(USER_OBJS)"); //$NON-NLS-1$
- myCommandInputs.add("$(LIBS)"); //$NON-NLS-1$
+ myCommandInputs.add("$(OBJS)"); //$NON-NLS-1$
+ myCommandInputs.add("$(USER_OBJS)"); //$NON-NLS-1$
+ myCommandInputs.add("$(LIBS)"); //$NON-NLS-1$
} else {
// Rule will be generated by addRuleForSource
}
@@ -469,26 +452,27 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
return false;
}
- /*
- * The priorities for determining the names of the outputs of a tool are:
- * 1. If the tool is the build target and primary output, use artifact name & extension
- * 2. If an option is specified, use the value of the option
- * 3. If a nameProvider is specified, call it
- * 4. If outputNames is specified, use it
- * 5. Use the name pattern to generate a transformation macro
- * so that the source names can be transformed into the target names
- * using the built-in string substitution functions of <code>make</code>.
- *
- * NOTE: If an option is not specified and this is not the primary output type, the outputs
- * from the type are not added to the command line
- */
- public boolean calculateOutputs(GnuMakefileGenerator makeGen, IConfiguration config, HashSet<String> handledInputExtensions, boolean lastChance) {
+ /*
+ * The priorities for determining the names of the outputs of a tool are:
+ * 1. If the tool is the build target and primary output, use artifact name & extension
+ * 2. If an option is specified, use the value of the option
+ * 3. If a nameProvider is specified, call it
+ * 4. If outputNames is specified, use it
+ * 5. Use the name pattern to generate a transformation macro
+ * so that the source names can be transformed into the target names
+ * using the built-in string substitution functions of <code>make</code>.
+ *
+ * NOTE: If an option is not specified and this is not the primary output type, the outputs
+ * from the type are not added to the command line
+ */
+ public boolean calculateOutputs(GnuMakefileGenerator makeGen, IConfiguration config,
+ HashSet<String> handledInputExtensions, boolean lastChance) {
boolean done = true;
Vector<String> myCommandOutputs = new Vector<String>();
Vector<String> myEnumeratedPrimaryOutputs = new Vector<String>();
Vector<String> myEnumeratedSecondaryOutputs = new Vector<String>();
- HashMap<String, List<IPath>> myOutputMacros = new HashMap<String, List<IPath>>();
+ HashMap<String, List<IPath>> myOutputMacros = new HashMap<String, List<IPath>>();
// The next two fields are used together
Vector<String> myBuildVars = new Vector<String>();
Vector<Vector<String>> myBuildVarsValues = new Vector<Vector<String>>();
@@ -496,35 +480,30 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
// Get the outputs for this tool invocation
IOutputType[] outTypes = tool.getOutputTypes();
if (outTypes != null && outTypes.length > 0) {
- for (int i=0; i<outTypes.length; i++) {
+ for (int i = 0; i < outTypes.length; i++) {
Vector<String> typeEnumeratedOutputs = new Vector<String>();
IOutputType type = outTypes[i];
String outputPrefix = type.getOutputPrefix();
// Resolve any macros in the outputPrefix
// Note that we cannot use file macros because if we do a clean
- // we need to know the actual name of the file to clean, and
- // cannot use any builder variables such as $@. Hence we use the
- // next best thing, i.e. configuration context.
+ // we need to know the actual name of the file to clean, and
+ // cannot use any builder variables such as $@. Hence we use the
+ // next best thing, i.e. configuration context.
if (config != null) {
try {
- outputPrefix = ManagedBuildManager
- .getBuildMacroProvider()
- .resolveValueToMakefileFormat(
- outputPrefix,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- config);
+ outputPrefix = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
+ outputPrefix, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, config);
}
catch (BuildMacroException e) {
}
}
-
String variable = type.getBuildVariable();
boolean multOfType = type.getMultipleOfType();
boolean primaryOutput = (type == tool.getPrimaryOutputType());
@@ -550,38 +529,33 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
int optType = option.getValueType();
if (optType == IOption.STRING) {
outputs.add(outputPrefix + option.getStringValue());
- } else if (
- optType == IOption.STRING_LIST ||
- optType == IOption.LIBRARIES ||
- optType == IOption.OBJECTS ||
- optType == IOption.INCLUDE_FILES ||
- optType == IOption.LIBRARY_PATHS ||
- optType == IOption.LIBRARY_FILES ||
- optType == IOption.MACRO_FILES) {
+ } else if (optType == IOption.STRING_LIST || optType == IOption.LIBRARIES
+ || optType == IOption.OBJECTS || optType == IOption.INCLUDE_FILES
+ || optType == IOption.LIBRARY_PATHS || optType == IOption.LIBRARY_FILES
+ || optType == IOption.MACRO_FILES) {
@SuppressWarnings("unchecked")
- List<String> value = (List<String>)option.getValue();
+ List<String> value = (List<String>) option.getValue();
outputs = value;
tool.filterValues(optType, outputs);
// Add outputPrefix to each if necessary
if (outputPrefix.length() > 0) {
- for (int j=0; j<outputs.size(); j++) {
+ for (int j = 0; j < outputs.size(); j++) {
outputs.set(j, outputPrefix + outputs.get(j));
}
}
}
- for (int j=0; j<outputs.size(); j++) {
+ for (int j = 0; j < outputs.size(); j++) {
String outputName = outputs.get(j);
- try{
+ try {
//try to resolve the build macros in the output names
- String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
- outputName,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_OPTION,
- new OptionContextData(option, tool));
- if((resolved = resolved.trim()).length() > 0)
+ String resolved = ManagedBuildManager.getBuildMacroProvider()
+ .resolveValueToMakefileFormat(outputName, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_OPTION,
+ new OptionContextData(option, tool));
+ if ((resolved = resolved.trim()).length() > 0)
outputs.set(j, resolved);
- } catch (BuildMacroException e){
+ } catch (BuildMacroException e) {
}
}
@@ -589,7 +563,7 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
typeEnumeratedOutputs.addAll(outputs);
if (variable.length() > 0) {
List<IPath> outputPaths = new ArrayList<IPath>();
- for (int j=0; j<outputs.size(); j++) {
+ for (int j = 0; j < outputs.size(); j++) {
outputPaths.add(Path.fromOSString(outputs.get(j)));
}
if (myOutputMacros.containsKey(variable)) {
@@ -600,7 +574,7 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
myOutputMacros.put(variable, outputPaths);
}
}
- } catch( BuildException ex ) {
+ } catch (BuildException ex) {
}
} else
// 3. If a nameProvider is specified, call it
@@ -612,26 +586,24 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
} else {
Vector<String> inputs = getEnumeratedInputs();
IPath[] inputPaths = new IPath[inputs.size()];
- for (int j=0; j<inputPaths.length; j++) {
+ for (int j = 0; j < inputPaths.length; j++) {
inputPaths[j] = Path.fromOSString(inputs.get(j));
}
outNames = nameProvider.getOutputNames(tool, inputPaths);
if (outNames != null) {
- for (int j=0; j<outNames.length; j++) {
+ for (int j = 0; j < outNames.length; j++) {
String outputName = outNames[j].toString();
- try{
+ try {
//try to resolve the build macros in the output names
- String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
- outputName,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_CONFIGURATION,
- config);
- if((resolved = resolved.trim()).length() > 0) {
+ String resolved = ManagedBuildManager.getBuildMacroProvider()
+ .resolveValueToMakefileFormat(outputName, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, config);
+ if ((resolved = resolved.trim()).length() > 0) {
outputName = resolved;
outNames[j] = Path.fromOSString(resolved);
}
- } catch (BuildMacroException e){
+ } catch (BuildMacroException e) {
}
if (primaryOutput) {
@@ -654,19 +626,18 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
// 4. If outputNames is specified, use it
if (outputNames != null) {
if (outputNames.length > 0) {
- for (int j=0; j<outputNames.length; j++) {
+ for (int j = 0; j < outputNames.length; j++) {
String outputName = outputNames[j];
- try{
+ try {
//try to resolve the build macros in the output names
- String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
- outputName,
- "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
- IBuildMacroProvider.CONTEXT_OPTION,
- new OptionContextData(option, tool));
- if((resolved = resolved.trim()).length() > 0)
+ String resolved = ManagedBuildManager.getBuildMacroProvider()
+ .resolveValueToMakefileFormat(outputName, "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_OPTION,
+ new OptionContextData(option, tool));
+ if ((resolved = resolved.trim()).length() > 0)
outputNames[j] = resolved;
- } catch (BuildMacroException e){
+ } catch (BuildMacroException e) {
}
}
List<String> namesList = Arrays.asList(outputNames);
@@ -676,7 +647,7 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
typeEnumeratedOutputs.addAll(namesList);
if (variable.length() > 0) {
List<IPath> outputPaths = new ArrayList<IPath>();
- for (int j=0; j<namesList.size(); j++) {
+ for (int j = 0; j < namesList.size(); j++) {
outputPaths.add(Path.fromOSString(namesList.get(j)));
}
if (myOutputMacros.containsKey(variable)) {
@@ -689,13 +660,13 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
}
}
} else {
- // 5. Use the name pattern to generate a transformation macro
- // so that the source names can be transformed into the target names
- // using the built-in string substitution functions of <code>make</code>.
+ // 5. Use the name pattern to generate a transformation macro
+ // so that the source names can be transformed into the target names
+ // using the built-in string substitution functions of <code>make</code>.
if (multOfType) {
// This case is not handled - a nameProvider or outputNames must be specified
List<String> errList = new ArrayList<String>();
- errList.add(ManagedMakeMessages.getResourceString("MakefileGenerator.error.no.nameprovider")); //$NON-NLS-1$
+ errList.add(ManagedMakeMessages.getResourceString("MakefileGenerator.error.no.nameprovider")); //$NON-NLS-1$
myCommandOutputs.addAll(errList);
} else {
String namePattern = type.getNamePattern();
@@ -705,8 +676,7 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
if (outExt != null && outExt.length() > 0) {
namePattern += DOT + outExt;
}
- }
- else if (outputPrefix.length() > 0) {
+ } else if (outputPrefix.length() > 0) {
namePattern = outputPrefix + namePattern;
}
@@ -721,8 +691,8 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
// Get the input file name
fileName = (Path.fromOSString(inputs.get(0))).removeFileExtension().lastSegment();
// Check if this is a build macro. If so, use the raw macro name.
- if (fileName.startsWith("$(") && fileName.endsWith(")")) { //$NON-NLS-1$ //$NON-NLS-2$
- fileName = fileName.substring(2,fileName.length()-1);
+ if (fileName.startsWith("$(") && fileName.endsWith(")")) { //$NON-NLS-1$ //$NON-NLS-2$
+ fileName = fileName.substring(2, fileName.length() - 1);
}
} else {
fileName = "default"; //$NON-NLS-1$
@@ -795,8 +765,9 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
enumeratedSecondaryOutputs.addAll(myEnumeratedSecondaryOutputs);
outputVariables.addAll(myOutputMacros.keySet());
outputsCalculated = true;
- for (int i=0; i<myBuildVars.size(); i++) {
- makeGen.addMacroAdditionFiles(makeGen.getTopBuildOutputVars(), myBuildVars.get(i), myBuildVarsValues.get(i));
+ for (int i = 0; i < myBuildVars.size(); i++) {
+ makeGen.addMacroAdditionFiles(makeGen.getTopBuildOutputVars(), myBuildVars.get(i),
+ myBuildVarsValues.get(i));
}
return true;
}
@@ -804,27 +775,30 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
return false;
}
- private boolean callDependencyCalculator (GnuMakefileGenerator makeGen, IConfiguration config, HashSet<String> handledInputExtensions,
- IManagedDependencyGeneratorType depGen, String[] extensionsList, Vector<String> myCommandDependencies, HashMap<String, List<IPath>> myOutputMacros,
+ private boolean callDependencyCalculator(GnuMakefileGenerator makeGen, IConfiguration config,
+ HashSet<String> handledInputExtensions, IManagedDependencyGeneratorType depGen, String[] extensionsList,
+ Vector<String> myCommandDependencies, HashMap<String, List<IPath>> myOutputMacros,
Vector<String> myAdditionalTargets, ToolInfoHolder h, boolean done) {
int calcType = depGen.getCalculatorType();
switch (calcType) {
case IManagedDependencyGeneratorType.TYPE_COMMAND:
case IManagedDependencyGeneratorType.TYPE_BUILD_COMMANDS:
- // iterate over all extensions that the tool knows how to handle
- for (int i=0; i<extensionsList.length; i++) {
- String extensionName = extensionsList[i];
-
- // Generated files should not appear in the list.
- if(!makeGen.getOutputExtensions(h).contains(extensionName) && !handledInputExtensions.contains(extensionName)) {
- handledInputExtensions.add(extensionName);
- String depExt = IManagedBuilderMakefileGenerator.DEP_EXT;
- if (calcType == IManagedDependencyGeneratorType.TYPE_BUILD_COMMANDS) {
- IManagedDependencyGenerator2 depGen2 = (IManagedDependencyGenerator2)depGen;
- String xt = depGen2.getDependencyFileExtension(config, tool);
- if (xt != null && xt.length() > 0) depExt = xt;
- }
+ // iterate over all extensions that the tool knows how to handle
+ for (int i = 0; i < extensionsList.length; i++) {
+ String extensionName = extensionsList[i];
+
+ // Generated files should not appear in the list.
+ if (!makeGen.getOutputExtensions(h).contains(extensionName)
+ && !handledInputExtensions.contains(extensionName)) {
+ handledInputExtensions.add(extensionName);
+ String depExt = IManagedBuilderMakefileGenerator.DEP_EXT;
+ if (calcType == IManagedDependencyGeneratorType.TYPE_BUILD_COMMANDS) {
+ IManagedDependencyGenerator2 depGen2 = (IManagedDependencyGenerator2) depGen;
+ String xt = depGen2.getDependencyFileExtension(config, tool);
+ if (xt != null && xt.length() > 0)
+ depExt = xt;
+ }
String depsMacroEntry = calculateSourceMacro(makeGen, extensionName, depExt,
IManagedBuilderMakefileGenerator.WILDCARD);
@@ -838,8 +812,8 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
} else {
myOutputMacros.put(depsMacro, depsList);
}
- }
- }
+ }
+ }
break;
case IManagedDependencyGeneratorType.TYPE_INDEXER:
@@ -852,37 +826,37 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
Vector<String> inputs = getEnumeratedInputs();
if (calcType == IManagedDependencyGeneratorType.TYPE_CUSTOM) {
- IManagedDependencyGenerator2 depGen2 = (IManagedDependencyGenerator2)depGen;
+ IManagedDependencyGenerator2 depGen2 = (IManagedDependencyGenerator2) depGen;
IManagedDependencyInfo depInfo = null;
- for (int i=0; i<inputs.size(); i++) {
+ for (int i = 0; i < inputs.size(); i++) {
- depInfo = depGen2.getDependencySourceInfo(
- Path.fromOSString(inputs.get(i)), config, tool, makeGen.getBuildWorkingDir());
+ depInfo = depGen2.getDependencySourceInfo(Path.fromOSString(inputs.get(i)), config, tool,
+ makeGen.getBuildWorkingDir());
if (depInfo instanceof IManagedDependencyCalculator) {
- IManagedDependencyCalculator depCalc = (IManagedDependencyCalculator)depInfo;
+ IManagedDependencyCalculator depCalc = (IManagedDependencyCalculator) depInfo;
IPath[] depPaths = depCalc.getDependencies();
if (depPaths != null) {
- for (int j=0; j<depPaths.length; j++) {
+ for (int j = 0; j < depPaths.length; j++) {
if (!depPaths[j].isAbsolute()) {
// Convert from project relative to build directory relative
IPath absolutePath = project.getLocation().append(depPaths[j]);
- depPaths[j] = ManagedBuildManager.calculateRelativePath(
- makeGen.getTopBuildDir(), absolutePath);
+ depPaths[j] = ManagedBuildManager
+ .calculateRelativePath(makeGen.getTopBuildDir(), absolutePath);
}
myCommandDependencies.add(depPaths[j].toString());
}
}
IPath[] targetPaths = depCalc.getAdditionalTargets();
if (targetPaths != null) {
- for (int j=0; j<targetPaths.length; j++) {
+ for (int j = 0; j < targetPaths.length; j++) {
myAdditionalTargets.add(targetPaths[j].toString());
}
}
}
}
} else {
- IManagedDependencyGenerator oldDepGen = (IManagedDependencyGenerator)depGen;
+ IManagedDependencyGenerator oldDepGen = (IManagedDependencyGenerator) depGen;
for (String input : inputs) {
IResource[] outNames = oldDepGen.findDependencies(project.getFile(input), project);
if (outNames != null) {
@@ -902,48 +876,50 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
return done;
}
- public boolean calculateDependencies(GnuMakefileGenerator makeGen, IConfiguration config, HashSet<String> handledInputExtensions, ToolInfoHolder h, boolean lastChance) {
+ public boolean calculateDependencies(GnuMakefileGenerator makeGen, IConfiguration config,
+ HashSet<String> handledInputExtensions, ToolInfoHolder h, boolean lastChance) {
// Get the dependencies for this tool invocation
boolean done = true;
Vector<String> myCommandDependencies = new Vector<String>();
Vector<String> myAdditionalTargets = new Vector<String>();
//Vector myEnumeratedDependencies = new Vector();
- HashMap<String, List<IPath>> myOutputMacros = new HashMap<String, List<IPath>>();
+ HashMap<String, List<IPath>> myOutputMacros = new HashMap<String, List<IPath>>();
IInputType[] inTypes = tool.getInputTypes();
if (inTypes != null && inTypes.length > 0) {
- for (int i=0; i<inTypes.length; i++) {
+ for (int i = 0; i < inTypes.length; i++) {
IInputType type = inTypes[i];
// Handle dependencies from the dependencyCalculator
IManagedDependencyGeneratorType depGen = type.getDependencyGenerator();
String[] extensionsList = type.getSourceExtensions(tool);
if (depGen != null) {
- done = callDependencyCalculator (makeGen, config, handledInputExtensions,
- depGen, extensionsList, myCommandDependencies, myOutputMacros,
- myAdditionalTargets, h, done);
+ done = callDependencyCalculator(makeGen, config, handledInputExtensions, depGen, extensionsList,
+ myCommandDependencies, myOutputMacros, myAdditionalTargets, h, done);
}
// Add additional dependencies specified in AdditionalInput elements
IAdditionalInput[] addlInputs = type.getAdditionalInputs();
if (addlInputs != null && addlInputs.length > 0) {
- for (int j=0; j<addlInputs.length; j++) {
+ for (int j = 0; j < addlInputs.length; j++) {
IAdditionalInput addlInput = addlInputs[j];
int kind = addlInput.getKind();
- if (kind == IAdditionalInput.KIND_ADDITIONAL_DEPENDENCY ||
- kind == IAdditionalInput.KIND_ADDITIONAL_INPUT_DEPENDENCY) {
+ if (kind == IAdditionalInput.KIND_ADDITIONAL_DEPENDENCY
+ || kind == IAdditionalInput.KIND_ADDITIONAL_INPUT_DEPENDENCY) {
String[] paths = addlInput.getPaths();
if (paths != null) {
for (int k = 0; k < paths.length; k++) {
// Translate the path from project relative to
// build directory relative
String path = paths[k];
- if (!(path.startsWith("$("))) { //$NON-NLS-1$
+ if (!(path.startsWith("$("))) { //$NON-NLS-1$
IResource addlResource = project.getFile(path);
if (addlResource != null) {
IPath addlPath = addlResource.getLocation();
if (addlPath != null) {
- path = ManagedBuildManager.calculateRelativePath(makeGen.getTopBuildDir(), addlPath).toString();
+ path = ManagedBuildManager
+ .calculateRelativePath(makeGen.getTopBuildDir(), addlPath)
+ .toString();
}
}
}
@@ -965,16 +941,15 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
// 2. The target name comes from the configuration artifact name
// The rule looks like:
// <targ_prefix><target>.<extension>: $(OBJS) <refd_project_1 ... refd_project_n>
- myCommandDependencies.add("$(OBJS)"); //$NON-NLS-1$
- myCommandDependencies.add("$(USER_OBJS)"); //$NON-NLS-1$
+ myCommandDependencies.add("$(OBJS)"); //$NON-NLS-1$
+ myCommandDependencies.add("$(USER_OBJS)"); //$NON-NLS-1$
} else {
// Handle dependencies from the dependencyCalculator
IManagedDependencyGeneratorType depGen = tool.getDependencyGenerator();
- String[] extensionsList = tool.getAllInputExtensions();
+ String[] extensionsList = tool.getAllInputExtensions();
if (depGen != null) {
- done = callDependencyCalculator (makeGen, config, handledInputExtensions,
- depGen, extensionsList, myCommandDependencies, myOutputMacros,
- myAdditionalTargets, h, done);
+ done = callDependencyCalculator(makeGen, config, handledInputExtensions, depGen, extensionsList,
+ myCommandDependencies, myOutputMacros, myAdditionalTargets, h, done);
}
}
@@ -1006,25 +981,24 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
return false;
}
-
/*
* Calculate the source macro for the given extension
*/
- protected String calculateSourceMacro(GnuMakefileGenerator makeGen, String srcExtensionName, String outExtensionName, String wildcard) {
+ protected String calculateSourceMacro(GnuMakefileGenerator makeGen, String srcExtensionName,
+ String outExtensionName, String wildcard) {
StringBuffer macroName = makeGen.getSourceMacroName(srcExtensionName);
String OptDotExt = ""; //$NON-NLS-1$
if (outExtensionName != null) {
- OptDotExt = DOT + outExtensionName;
- } else
- if (!tool.getOutputExtension(srcExtensionName).isEmpty())
- OptDotExt = DOT + tool.getOutputExtension(srcExtensionName);
+ OptDotExt = DOT + outExtensionName;
+ } else if (!tool.getOutputExtension(srcExtensionName).isEmpty())
+ OptDotExt = DOT + tool.getOutputExtension(srcExtensionName);
// create rule of the form
// OBJS = $(macroName1: ../%.input1=%.output1) ... $(macroNameN: ../%.inputN=%.outputN)
- return IManagedBuilderMakefileGenerator.WHITESPACE + "$(" + macroName + //$NON-NLS-1$
- IManagedBuilderMakefileGenerator.COLON + IManagedBuilderMakefileGenerator.ROOT +
- IManagedBuilderMakefileGenerator.SEPARATOR + IManagedBuilderMakefileGenerator.WILDCARD +
- DOT + srcExtensionName + "=" + wildcard + OptDotExt + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ return IManagedBuilderMakefileGenerator.WHITESPACE + "$(" + macroName + //$NON-NLS-1$
+ IManagedBuilderMakefileGenerator.COLON + IManagedBuilderMakefileGenerator.ROOT
+ + IManagedBuilderMakefileGenerator.SEPARATOR + IManagedBuilderMakefileGenerator.WILDCARD + DOT
+ + srcExtensionName + "=" + wildcard + OptDotExt + ")"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/internal/DefaultIndexerDependencyCalculator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/internal/DefaultIndexerDependencyCalculator.java
index 2e1151e350b..6d6289c2254 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/internal/DefaultIndexerDependencyCalculator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/internal/DefaultIndexerDependencyCalculator.java
@@ -28,37 +28,37 @@ public class DefaultIndexerDependencyCalculator implements IManagedDependencyGen
*/
@Override
public IResource[] findDependencies(IResource resource, IProject project) {
-// PathCollector pathCollector = new PathCollector();
-// ICSearchScope scope = SearchEngine.createWorkspaceScope();
-// CSearchPattern pattern = CSearchPattern.createPattern(resource.getLocation().toOSString(), ICSearchConstants.INCLUDE, ICSearchConstants.REFERENCES, ICSearchConstants.EXACT_MATCH, true);
-// IndexManager indexManager = CCorePlugin.getDefault().getCoreModel().getIndexManager();
-// indexManager.performConcurrentJob(
-// new PatternSearchJob(
-// (CSearchPattern) pattern,
-// scope,
-// pathCollector,
-// indexManager),
-// ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
-// null, null);
-//
-// // We will get back an array of resource names relative to the workspace
-// String[] deps = pathCollector.getPaths();
-//
-// // Convert them to something useful
-// List depList = new ArrayList();
-// IResource res = null;
-// IWorkspaceRoot root = null;
-// if (project != null) {
-// root = project.getWorkspace().getRoot();
-// }
-// for (int index = 0; index < deps.length; ++index) {
-// res = root.findMember(deps[index]);
-// if (res != null) {
-// depList.add(res);
-// }
-// }
-//
-// return (IResource[]) depList.toArray(new IResource[depList.size()]);
+ // PathCollector pathCollector = new PathCollector();
+ // ICSearchScope scope = SearchEngine.createWorkspaceScope();
+ // CSearchPattern pattern = CSearchPattern.createPattern(resource.getLocation().toOSString(), ICSearchConstants.INCLUDE, ICSearchConstants.REFERENCES, ICSearchConstants.EXACT_MATCH, true);
+ // IndexManager indexManager = CCorePlugin.getDefault().getCoreModel().getIndexManager();
+ // indexManager.performConcurrentJob(
+ // new PatternSearchJob(
+ // (CSearchPattern) pattern,
+ // scope,
+ // pathCollector,
+ // indexManager),
+ // ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
+ // null, null);
+ //
+ // // We will get back an array of resource names relative to the workspace
+ // String[] deps = pathCollector.getPaths();
+ //
+ // // Convert them to something useful
+ // List depList = new ArrayList();
+ // IResource res = null;
+ // IWorkspaceRoot root = null;
+ // if (project != null) {
+ // root = project.getWorkspace().getRoot();
+ // }
+ // for (int index = 0; index < deps.length; ++index) {
+ // res = root.findMember(deps[index]);
+ // if (res != null) {
+ // depList.add(res);
+ // }
+ // }
+ //
+ // return (IResource[]) depList.toArray(new IResource[depList.size()]);
// TODO this needs to be redone to fit on the PDOM
return new IResource[0];
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/pdomdepgen/PDOMDependencyCalculator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/pdomdepgen/PDOMDependencyCalculator.java
index 8f2ba7a2a37..2d5ae707461 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/pdomdepgen/PDOMDependencyCalculator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/pdomdepgen/PDOMDependencyCalculator.java
@@ -50,7 +50,8 @@ public class PDOMDependencyCalculator implements IManagedDependencyCalculator {
private final IPath topBuildDirectory;
private IPath[] dependencies;
- public PDOMDependencyCalculator(IPath source, IResource resource, IBuildObject buildContext, ITool tool, IPath topBuildDirectory) {
+ public PDOMDependencyCalculator(IPath source, IResource resource, IBuildObject buildContext, ITool tool,
+ IPath topBuildDirectory) {
this.source = source;
this.resource = resource;
this.buildContext = buildContext;
@@ -72,7 +73,7 @@ public class PDOMDependencyCalculator implements IManagedDependencyCalculator {
IIndex index = CCorePlugin.getIndexManager().getIndex(project, IIndexManager.ADD_DEPENDENCIES);
index.acquireReadLock();
try {
- IIndexFile[] files = index.getFiles(IndexLocationFactory.getWorkspaceIFL((IFile)resource));
+ IIndexFile[] files = index.getFiles(IndexLocationFactory.getWorkspaceIFL((IFile) resource));
if (files.length > 0) {
IIndexInclude[] includes = index.findIncludes(files[0], IIndex.DEPTH_INFINITE);
@@ -85,12 +86,11 @@ public class PDOMDependencyCalculator implements IManagedDependencyCalculator {
dependencies = list.toArray(new IPath[list.size()]);
} else
dependencies = new IPath[0];
- }
- finally {
+ } finally {
index.releaseReadLock();
}
} catch (CoreException e) {
-// Activator.getDefault().getLog().log(e.getStatus());
+ // Activator.getDefault().getLog().log(e.getStatus());
dependencies = new IPath[0];
} catch (InterruptedException e) {
dependencies = new IPath[0];
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/pdomdepgen/PDOMDependencyGenerator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/pdomdepgen/PDOMDependencyGenerator.java
index 61112949fbc..2ce3a92a9ec 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/pdomdepgen/PDOMDependencyGenerator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/pdomdepgen/PDOMDependencyGenerator.java
@@ -43,18 +43,20 @@ public class PDOMDependencyGenerator implements IManagedDependencyGenerator2 {
}
@Override
- public IManagedDependencyInfo getDependencySourceInfo(IPath source, IBuildObject buildContext, ITool tool, IPath topBuildDirectory) {
+ public IManagedDependencyInfo getDependencySourceInfo(IPath source, IBuildObject buildContext, ITool tool,
+ IPath topBuildDirectory) {
return getDependencySourceInfo(source, null, buildContext, tool, topBuildDirectory);
}
@Override
- public IManagedDependencyInfo getDependencySourceInfo(IPath source, IResource resource, IBuildObject buildContext, ITool tool, IPath topBuildDirectory) {
- if(resource == null && source != null){
- if(!source.isAbsolute())
+ public IManagedDependencyInfo getDependencySourceInfo(IPath source, IResource resource, IBuildObject buildContext,
+ ITool tool, IPath topBuildDirectory) {
+ if (resource == null && source != null) {
+ if (!source.isAbsolute())
source = topBuildDirectory.append(source);
IFile files[] = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(source);
- if(files.length > 0)
+ if (files.length > 0)
resource = files[0];
}
@@ -62,7 +64,8 @@ public class PDOMDependencyGenerator implements IManagedDependencyGenerator2 {
}
@Override
- public boolean postProcessDependencyFile(IPath dependencyFile, IConfiguration buildContext, ITool tool, IPath topBuildDirectory) {
+ public boolean postProcessDependencyFile(IPath dependencyFile, IConfiguration buildContext, ITool tool,
+ IPath topBuildDirectory) {
return false;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/ConverterMessages.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/ConverterMessages.java
index f23e31d4de6..3915ab8163d 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/ConverterMessages.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/ConverterMessages.java
@@ -24,21 +24,21 @@ import java.util.ResourceBundle;
public class ConverterMessages {
private static final String BUNDLE_NAME = "org.eclipse.cdt.managedbuilder.projectconverter.PluginResources";//$NON-NLS-1$
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
private ConverterMessages() {
}
-/*
- public static String getString(String key) {
- // TODO Auto-generated method stub
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
+
+ /*
+ public static String getString(String key) {
+ // TODO Auto-generated method stub
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
}
- }
-*/
+ */
public static String getResourceString(String key) {
try {
return RESOURCE_BUNDLE.getString(key);
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject12.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject12.java
index 8bdbc4c53dc..b8dee4902d1 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject12.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject12.java
@@ -57,44 +57,44 @@ import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
class UpdateManagedProject12 {
-
- private static final String ID_CYGWIN = "cygwin"; //$NON-NLS-1$
- private static final String ID_DEBUG = "debug"; //$NON-NLS-1$
- private static final String ID_DIRS = "dirs"; //$NON-NLS-1$
- private static final String ID_EXE = "exe"; //$NON-NLS-1$
- private static final String ID_EXEC = "exec"; //$NON-NLS-1$
- private static final String ID_GENERAL = "general"; //$NON-NLS-1$
- private static final String ID_GNU = "gnu"; //$NON-NLS-1$
- private static final String ID_INCPATHS = "incpaths"; //$NON-NLS-1$
- private static final String ID_INCLUDE = "include"; //$NON-NLS-1$
- private static final String ID_LIBS = "libs"; //$NON-NLS-1$
- private static final String ID_LINUX = "linux"; //$NON-NLS-1$
- private static final String ID_OPTION = "option"; //$NON-NLS-1$
- private static final String ID_OPTIONS = "options"; //$NON-NLS-1$
- private static final String ID_PATHS = "paths"; //$NON-NLS-1$
- private static final String ID_PREPROC = "preprocessor"; //$NON-NLS-1$
-// private static final String ID_RELEASE = "release"; //$NON-NLS-1$
- private static final String ID_SEPARATOR = "."; //$NON-NLS-1$
- private static final String ID_SHARED = "so"; //$NON-NLS-1$
- private static final String ID_SOLARIS = "solaris"; //$NON-NLS-1$
- private static final String ID_STATIC = "lib"; //$NON-NLS-1$
- private static final String NEW_CONFIG_ROOT = "cdt.managedbuild.config.gnu"; //$NON-NLS-1$
- private static final String NEW_CYGWIN_TARGET_ROOT = "cdt.managedbuild.target.gnu.cygwin"; //$NON-NLS-1$
- private static final String NEW_POSIX_TARGET_ROOT = "cdt.managedbuild.target.gnu"; //$NON-NLS-1$
- private static final String NEW_TOOL_ROOT = "cdt.managedbuild.tool.gnu"; //$NON-NLS-1$
- private static final String OLD_TOOL_ROOT_LONG = "org.eclipse.cdt.build.tool"; //$NON-NLS-1$
- private static final String OLD_TOOL_ROOT_SHORT = "cdt.build.tool"; //$NON-NLS-1$
- private static final String REGEXP_SEPARATOR = "\\."; //$NON-NLS-1$
- private static final String TOOL_LANG_BOTH = "both"; //$NON-NLS-1$
- private static final String TOOL_LANG_C = "c"; //$NON-NLS-1$
- private static final String TOOL_LANG_CPP = "cpp"; //$NON-NLS-1$
- private static final String TOOL_NAME_AR = "ar"; //$NON-NLS-1$
- private static final String TOOL_NAME_ARCHIVER = "archiver"; //$NON-NLS-1$
- private static final String TOOL_NAME_COMPILER = "compiler"; //$NON-NLS-1$
- private static final String TOOL_NAME_LIB = "lib"; //$NON-NLS-1$
- private static final String TOOL_NAME_LINK = "link"; //$NON-NLS-1$
- private static final String TOOL_NAME_LINKER = "linker"; //$NON-NLS-1$
- private static final String TOOL_NAME_SOLINK = "solink"; //$NON-NLS-1$
+
+ private static final String ID_CYGWIN = "cygwin"; //$NON-NLS-1$
+ private static final String ID_DEBUG = "debug"; //$NON-NLS-1$
+ private static final String ID_DIRS = "dirs"; //$NON-NLS-1$
+ private static final String ID_EXE = "exe"; //$NON-NLS-1$
+ private static final String ID_EXEC = "exec"; //$NON-NLS-1$
+ private static final String ID_GENERAL = "general"; //$NON-NLS-1$
+ private static final String ID_GNU = "gnu"; //$NON-NLS-1$
+ private static final String ID_INCPATHS = "incpaths"; //$NON-NLS-1$
+ private static final String ID_INCLUDE = "include"; //$NON-NLS-1$
+ private static final String ID_LIBS = "libs"; //$NON-NLS-1$
+ private static final String ID_LINUX = "linux"; //$NON-NLS-1$
+ private static final String ID_OPTION = "option"; //$NON-NLS-1$
+ private static final String ID_OPTIONS = "options"; //$NON-NLS-1$
+ private static final String ID_PATHS = "paths"; //$NON-NLS-1$
+ private static final String ID_PREPROC = "preprocessor"; //$NON-NLS-1$
+ // private static final String ID_RELEASE = "release"; //$NON-NLS-1$
+ private static final String ID_SEPARATOR = "."; //$NON-NLS-1$
+ private static final String ID_SHARED = "so"; //$NON-NLS-1$
+ private static final String ID_SOLARIS = "solaris"; //$NON-NLS-1$
+ private static final String ID_STATIC = "lib"; //$NON-NLS-1$
+ private static final String NEW_CONFIG_ROOT = "cdt.managedbuild.config.gnu"; //$NON-NLS-1$
+ private static final String NEW_CYGWIN_TARGET_ROOT = "cdt.managedbuild.target.gnu.cygwin"; //$NON-NLS-1$
+ private static final String NEW_POSIX_TARGET_ROOT = "cdt.managedbuild.target.gnu"; //$NON-NLS-1$
+ private static final String NEW_TOOL_ROOT = "cdt.managedbuild.tool.gnu"; //$NON-NLS-1$
+ private static final String OLD_TOOL_ROOT_LONG = "org.eclipse.cdt.build.tool"; //$NON-NLS-1$
+ private static final String OLD_TOOL_ROOT_SHORT = "cdt.build.tool"; //$NON-NLS-1$
+ private static final String REGEXP_SEPARATOR = "\\."; //$NON-NLS-1$
+ private static final String TOOL_LANG_BOTH = "both"; //$NON-NLS-1$
+ private static final String TOOL_LANG_C = "c"; //$NON-NLS-1$
+ private static final String TOOL_LANG_CPP = "cpp"; //$NON-NLS-1$
+ private static final String TOOL_NAME_AR = "ar"; //$NON-NLS-1$
+ private static final String TOOL_NAME_ARCHIVER = "archiver"; //$NON-NLS-1$
+ private static final String TOOL_NAME_COMPILER = "compiler"; //$NON-NLS-1$
+ private static final String TOOL_NAME_LIB = "lib"; //$NON-NLS-1$
+ private static final String TOOL_NAME_LINK = "link"; //$NON-NLS-1$
+ private static final String TOOL_NAME_LINKER = "linker"; //$NON-NLS-1$
+ private static final String TOOL_NAME_SOLINK = "solink"; //$NON-NLS-1$
private static final int TOOL_TYPE_COMPILER = 0;
private static final int TOOL_TYPE_LINKER = 1;
private static final int TOOL_TYPE_ARCHIVER = 2;
@@ -102,47 +102,47 @@ class UpdateManagedProject12 {
private static final int TYPE_SHARED = 1;
private static final int TYPE_STATIC = 2;
private static Map<String, IConfiguration> configIdMap;
-
+
/* (non-Javadoc)
* Generates a valid 2.1 eqivalent ID for an old 1.2 format
* configuration. Old built-in configurations had the format
* cygin.[exec|so|exp|lib].[debug|release]
* [linux|solaris].gnu.[exec|so|lib].[release|debug]
- *
+ *
* @param oldId
* @return
*/
- protected static String getNewConfigurationId(String oldId){
- boolean builtIn = false;
+ protected static String getNewConfigurationId(String oldId) {
+ boolean builtIn = false;
boolean cygwin = false;
boolean debug = false;
int type = -1;
-
+
Vector<String> idTokens = new Vector<String>(Arrays.asList(oldId.split(REGEXP_SEPARATOR)));
try {
- String platform = idTokens.get(0);
- if (platform.equalsIgnoreCase(ID_CYGWIN)) {
- cygwin = builtIn = true;
- } else if ((platform.equalsIgnoreCase(ID_LINUX) || platform.equalsIgnoreCase(ID_SOLARIS))
- && (idTokens.get(1)).equalsIgnoreCase(ID_GNU)) {
- builtIn = true;
- }
-
+ String platform = idTokens.get(0);
+ if (platform.equalsIgnoreCase(ID_CYGWIN)) {
+ cygwin = builtIn = true;
+ } else if ((platform.equalsIgnoreCase(ID_LINUX) || platform.equalsIgnoreCase(ID_SOLARIS))
+ && (idTokens.get(1)).equalsIgnoreCase(ID_GNU)) {
+ builtIn = true;
+ }
+
} catch (ArrayIndexOutOfBoundsException e) {
- // This just means the ID is not a built-in
- builtIn = false;
+ // This just means the ID is not a built-in
+ builtIn = false;
}
-
+
// If this isn't a built-in configuration, don't convert it
- if(!builtIn) {
- return oldId;
+ if (!builtIn) {
+ return oldId;
}
-
+
// Otherwise make the conversion
for (String id : idTokens) {
- if(id.equalsIgnoreCase(ID_EXEC)) {
+ if (id.equalsIgnoreCase(ID_EXEC)) {
type = TYPE_EXE;
- } else if(id.equalsIgnoreCase(ID_SHARED)) {
+ } else if (id.equalsIgnoreCase(ID_SHARED)) {
type = TYPE_SHARED;
} else if (id.equalsIgnoreCase(ID_STATIC)) {
type = TYPE_STATIC;
@@ -151,37 +151,37 @@ class UpdateManagedProject12 {
}
}
String defId = NEW_CONFIG_ROOT + ID_SEPARATOR;
- if (cygwin) defId += ID_CYGWIN + ID_SEPARATOR;
+ if (cygwin)
+ defId += ID_CYGWIN + ID_SEPARATOR;
switch (type) {
- case TYPE_EXE:
- defId += ID_EXE;
- break;
- case TYPE_SHARED :
- defId += ID_SHARED;
- break;
- case TYPE_STATIC :
- defId += ID_STATIC;
- break;
+ case TYPE_EXE:
+ defId += ID_EXE;
+ break;
+ case TYPE_SHARED:
+ defId += ID_SHARED;
+ break;
+ case TYPE_STATIC:
+ defId += ID_STATIC;
+ break;
}
- defId += ID_SEPARATOR + (debug ? "debug" : "release"); //$NON-NLS-1$ //$NON-NLS-2$
+ defId += ID_SEPARATOR + (debug ? "debug" : "release"); //$NON-NLS-1$ //$NON-NLS-2$
return defId;
}
-
- protected static void convertConfiguration(IManagedProject newProject, IProjectType newParent, Element oldConfig, IProgressMonitor monitor)
- throws CoreException {
+
+ protected static void convertConfiguration(IManagedProject newProject, IProjectType newParent, Element oldConfig,
+ IProgressMonitor monitor) throws CoreException {
IConfiguration newParentConfig = null;
IConfiguration newConfig = null;
-
// Figure out what the original parent of the config is
String parentId = oldConfig.getAttribute(IConfigurationV2.PARENT);
parentId = getNewConfigurationId(parentId);
-
+
newParentConfig = newParent.getConfiguration(parentId);
if (newParentConfig == null) {
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
- ConverterMessages.getFormattedString("UpdateManagedProject12.2",parentId), null)); //$NON-NLS-1$
- }
+ ConverterMessages.getFormattedString("UpdateManagedProject12.2", parentId), null)); //$NON-NLS-1$
+ }
// Generate a random number for the new config id
int randomElement = ManagedBuildManager.getRandomNumber();
@@ -190,9 +190,9 @@ class UpdateManagedProject12 {
// Create the new configuration
newConfig = newProject.createConfiguration(newParentConfig, newConfigId);
newConfig.setName(oldConfig.getAttribute(IConfigurationV2.NAME));
-
- Element oldTarget = (Element)oldConfig.getParentNode();
- if(oldTarget.hasAttribute(ITarget.ARTIFACT_NAME)){
+
+ Element oldTarget = (Element) oldConfig.getParentNode();
+ if (oldTarget.hasAttribute(ITarget.ARTIFACT_NAME)) {
String buildGoal = oldTarget.getAttribute(ITarget.ARTIFACT_NAME);
// The name may be in the form <name>[.ext1[.ext2[...]]]
String[] nameElements = buildGoal.split(REGEXP_SEPARATOR);
@@ -201,14 +201,14 @@ class UpdateManagedProject12 {
try {
name = nameElements[0];
} catch (ArrayIndexOutOfBoundsException e) {
- name = "default"; //$NON-NLS-1$
+ name = "default"; //$NON-NLS-1$
}
// Reconstruct the extension
String extension = ""; //$NON-NLS-1$
for (int index = 1; index < nameElements.length; ++index) {
extension += nameElements[index];
if (index < nameElements.length - 1) {
- extension += ID_SEPARATOR;
+ extension += ID_SEPARATOR;
}
}
newConfig.setArtifactName(name);
@@ -216,17 +216,16 @@ class UpdateManagedProject12 {
newConfig.setArtifactExtension(extension);
}
}
-
+
// Convert the tool references
IToolChain toolChain = newConfig.getToolChain();
- ((ToolChain)toolChain).checkForMigrationSupport();
-
+ ((ToolChain) toolChain).checkForMigrationSupport();
+
NodeList toolRefNodes = oldConfig.getElementsByTagName(IConfigurationV2.TOOLREF_ELEMENT_NAME);
for (int refIndex = 0; refIndex < toolRefNodes.getLength(); ++refIndex) {
- try{
+ try {
convertToolRef(toolChain, (Element) toolRefNodes.item(refIndex), monitor);
- }
- catch(CoreException e){
+ } catch (CoreException e) {
// TODO: Need error dialog!
newProject.removeConfiguration(newConfigId);
throw e;
@@ -236,31 +235,30 @@ class UpdateManagedProject12 {
getConfigIdMap().put(oldConfig.getAttribute(IConfigurationV2.ID), newConfig);
monitor.worked(1);
}
-
- protected static String getNewOptionId(IToolChain toolChain, ITool tool, String oldId)
- throws CoreException{
- String optId = null;
+ protected static String getNewOptionId(IToolChain toolChain, ITool tool, String oldId) throws CoreException {
+
+ String optId = null;
String[] idTokens = oldId.split(REGEXP_SEPARATOR);
Vector<String> oldIdVector = new Vector<String>(Arrays.asList(idTokens));
if (isBuiltInOption(oldIdVector)) {
-
+
// New ID will be in form gnu.[c|c++|both].[compiler|link|lib].option.{1.2_component}
Vector<String> newIdVector = new Vector<String>(idTokens.length + 2);
-
+
// We can ignore the first element of the old IDs since it is just [cygwin|linux|solaris]
for (int index = 1; index < idTokens.length; ++index) {
newIdVector.add(idTokens[index]);
}
-
+
// In the case of some Cygwin C++ tools, the old ID will be missing gnu
if (!(newIdVector.firstElement()).equals(ID_GNU)) {
newIdVector.add(0, ID_GNU);
}
-
+
// In some old IDs the language specifier is missing for librarian and C++ options
- String langToken = newIdVector.get(1);
- if(!langToken.equals(TOOL_LANG_C)) {
+ String langToken = newIdVector.get(1);
+ if (!langToken.equals(TOOL_LANG_C)) {
// In the case of the librarian the language must be set to both
if (langToken.equals(TOOL_NAME_LIB) || langToken.equals(TOOL_NAME_AR)) {
newIdVector.add(1, TOOL_LANG_BOTH);
@@ -268,7 +266,7 @@ class UpdateManagedProject12 {
newIdVector.add(1, TOOL_LANG_CPP);
}
}
-
+
// Standardize the next token to compiler, link, or lib
String toolToken = newIdVector.get(2);
if (toolToken.equals(ID_PREPROC)) {
@@ -281,9 +279,9 @@ class UpdateManagedProject12 {
} else if (toolToken.equals(TOOL_NAME_AR)) {
// The cygwin librarian uses ar
newIdVector.remove(2);
- newIdVector.add(2, TOOL_NAME_LIB);
+ newIdVector.add(2, TOOL_NAME_LIB);
}
-
+
// Add in the option tag
String optionToken = newIdVector.get(3);
if (optionToken.equals(ID_OPTIONS)) {
@@ -291,7 +289,7 @@ class UpdateManagedProject12 {
newIdVector.remove(3);
}
newIdVector.add(3, ID_OPTION);
-
+
// Convert any lingering "incpaths" to "include.paths"
String badToken = newIdVector.lastElement();
if (badToken.equals(ID_INCPATHS)) {
@@ -299,7 +297,7 @@ class UpdateManagedProject12 {
newIdVector.addElement(ID_INCLUDE);
newIdVector.addElement(ID_PATHS);
}
-
+
// Edit out the "general" or "dirs" categories that may be in some older IDs
int generalIndex = newIdVector.indexOf(ID_GENERAL);
if (generalIndex != -1) {
@@ -309,12 +307,12 @@ class UpdateManagedProject12 {
if (dirIndex != -1) {
newIdVector.remove(dirIndex);
}
-
+
// Another boundary condition to check is the case where the linker option
- // has gnu.[c|cpp].link.option.libs.paths or gnu.[c|cpp].link.option.libs.paths
+ // has gnu.[c|cpp].link.option.libs.paths or gnu.[c|cpp].link.option.libs.paths
// because the new option format does away with the libs in the second last element
try {
- if ((newIdVector.lastElement().equals(ID_PATHS) || newIdVector.lastElement().equals(ID_LIBS))
+ if ((newIdVector.lastElement().equals(ID_PATHS) || newIdVector.lastElement().equals(ID_LIBS))
&& newIdVector.get(newIdVector.size() - 2).equals(ID_LIBS)) {
newIdVector.remove(newIdVector.size() - 2);
}
@@ -323,10 +321,10 @@ class UpdateManagedProject12 {
} catch (ArrayIndexOutOfBoundsException e) {
// ignore this exception too
}
-
+
// Construct the new ID
optId = ""; //$NON-NLS-1$
- for (int rebuildIndex = 0; rebuildIndex < newIdVector.size(); ++ rebuildIndex) {
+ for (int rebuildIndex = 0; rebuildIndex < newIdVector.size(); ++rebuildIndex) {
String token = newIdVector.get(rebuildIndex);
optId += token;
if (rebuildIndex < newIdVector.size() - 1) {
@@ -334,116 +332,117 @@ class UpdateManagedProject12 {
}
}
} else {
- optId = oldId;
+ optId = oldId;
}
-
+
// Now look it up
IConfiguration configuration = toolChain.getParent();
-
- IOption options[] = tool.getOptions();
- for(int i = 0; i < options.length; i++){
+
+ IOption options[] = tool.getOptions();
+ for (int i = 0; i < options.length; i++) {
IOption curOption = options[i];
// This can be null
IOption parent = curOption.getSuperClass();
String curOptionId = curOption.getId();
-
- if(parent == null) {
+
+ if (parent == null) {
if (!curOptionId.equals(optId))
continue;
} else {
String parentId = parent.getId();
- if(!parentId.equals(optId))
+ if (!parentId.equals(optId))
continue;
-
+
}
-
+
return curOption.getId();
}
- return optId;
+ return optId;
}
-
- protected static void convertOptionRef(IToolChain toolChain, ITool tool, Element optRef)
- throws CoreException {
+
+ protected static void convertOptionRef(IToolChain toolChain, ITool tool, Element optRef) throws CoreException {
String optId = optRef.getAttribute(IOption.ID);
- if (optId == null) return;
-
+ if (optId == null)
+ return;
+
optId = getNewOptionId(toolChain, tool, optId);
// Get the option from the new tool
IOption newOpt = tool.getOptionById(optId);
- if (newOpt != null) { // Ignore options that don't have a match
+ if (newOpt != null) { // Ignore options that don't have a match
IConfiguration configuration = toolChain.getParent();
-
+
try {
switch (newOpt.getValueType()) {
- case IOption.BOOLEAN:
- Boolean bool = Boolean.valueOf(optRef.getAttribute(IOption.DEFAULT_VALUE));
- configuration.setOption(tool, newOpt, bool.booleanValue());
- break;
- case IOption.STRING:
- String strVal = optRef.getAttribute(IOption.DEFAULT_VALUE);
- configuration.setOption(tool, newOpt, strVal);
- break;
- case IOption.ENUMERATED:
- // This is going to be the human readable form of the enumerated value
- String name = optRef.getAttribute(IOption.DEFAULT_VALUE);
- // Convert it to the ID
- String idValue = newOpt.getEnumeratedId(name);
- if (idValue == null) {
- // If the name does not match one of the enumerations values, probably because
- // the list of enumerands has changed, set the name to be the name used for the
- // enumeration's default value
- name = (String)newOpt.getDefaultValue();
- }
- configuration.setOption(tool, newOpt, idValue != null ? idValue : name);
- break;
- case IOption.TREE:
- // This is going to be the human readable form of the tree value
- name = optRef.getAttribute(IOption.DEFAULT_VALUE);
- // Convert it to the ID
- idValue = newOpt.getId(name);
- if (idValue == null) {
- // If the name does not match one of the enumerations values, probably because
- // the list of enumerands has changed, set the name to be the name used for the
- // enumeration's default value
- name = (String)newOpt.getDefaultValue();
- }
- configuration.setOption(tool, newOpt, idValue != null ? idValue : name);
- break;
- case IOption.STRING_LIST:
- case IOption.INCLUDE_PATH:
- case IOption.PREPROCESSOR_SYMBOLS:
- case IOption.LIBRARIES:
- case IOption.OBJECTS:
- Vector<String> values = new Vector<String>();
- NodeList nodes = optRef.getElementsByTagName(IOption.LIST_VALUE);
- for (int i = 0; i < nodes.getLength(); ++i) {
- Node node = nodes.item(i);
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- Boolean isBuiltIn = Boolean.valueOf(((Element)node).getAttribute(IOption.LIST_ITEM_BUILTIN));
- if (!isBuiltIn.booleanValue()) {
- values.add(((Element)node).getAttribute(IOption.LIST_ITEM_VALUE));
- }
+ case IOption.BOOLEAN:
+ Boolean bool = Boolean.valueOf(optRef.getAttribute(IOption.DEFAULT_VALUE));
+ configuration.setOption(tool, newOpt, bool.booleanValue());
+ break;
+ case IOption.STRING:
+ String strVal = optRef.getAttribute(IOption.DEFAULT_VALUE);
+ configuration.setOption(tool, newOpt, strVal);
+ break;
+ case IOption.ENUMERATED:
+ // This is going to be the human readable form of the enumerated value
+ String name = optRef.getAttribute(IOption.DEFAULT_VALUE);
+ // Convert it to the ID
+ String idValue = newOpt.getEnumeratedId(name);
+ if (idValue == null) {
+ // If the name does not match one of the enumerations values, probably because
+ // the list of enumerands has changed, set the name to be the name used for the
+ // enumeration's default value
+ name = (String) newOpt.getDefaultValue();
+ }
+ configuration.setOption(tool, newOpt, idValue != null ? idValue : name);
+ break;
+ case IOption.TREE:
+ // This is going to be the human readable form of the tree value
+ name = optRef.getAttribute(IOption.DEFAULT_VALUE);
+ // Convert it to the ID
+ idValue = newOpt.getId(name);
+ if (idValue == null) {
+ // If the name does not match one of the enumerations values, probably because
+ // the list of enumerands has changed, set the name to be the name used for the
+ // enumeration's default value
+ name = (String) newOpt.getDefaultValue();
+ }
+ configuration.setOption(tool, newOpt, idValue != null ? idValue : name);
+ break;
+ case IOption.STRING_LIST:
+ case IOption.INCLUDE_PATH:
+ case IOption.PREPROCESSOR_SYMBOLS:
+ case IOption.LIBRARIES:
+ case IOption.OBJECTS:
+ Vector<String> values = new Vector<String>();
+ NodeList nodes = optRef.getElementsByTagName(IOption.LIST_VALUE);
+ for (int i = 0; i < nodes.getLength(); ++i) {
+ Node node = nodes.item(i);
+ if (node.getNodeType() == Node.ELEMENT_NODE) {
+ Boolean isBuiltIn = Boolean
+ .valueOf(((Element) node).getAttribute(IOption.LIST_ITEM_BUILTIN));
+ if (!isBuiltIn.booleanValue()) {
+ values.add(((Element) node).getAttribute(IOption.LIST_ITEM_VALUE));
}
}
- configuration.setOption(tool, newOpt, values.toArray(new String[values.size()]));
- break;
+ }
+ configuration.setOption(tool, newOpt, values.toArray(new String[values.size()]));
+ break;
}
} catch (BuildException e) {
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
- ConverterMessages.getFormattedString("UpdateManagedProject12.5",e.getMessage()), e)); //$NON-NLS-1$
+ ConverterMessages.getFormattedString("UpdateManagedProject12.5", e.getMessage()), e)); //$NON-NLS-1$
}
- }
+ }
}
-
+
/* (non-Javadoc)
- * Converts an old built-in target ID from 1.2 format to
+ * Converts an old built-in target ID from 1.2 format to
* 2.1 format. A 1.2 target will have the format :
* cygyin.[exec|so|lib]
* [linux|solaris].gnu.[exec|so|lib]
* @param oldId
* @return
*/
- protected static String getNewProjectId(String oldId){
+ protected static String getNewProjectId(String oldId) {
// The type of target we are converting from/to
int type = -1;
// Use the Cygwin or generic target form
@@ -453,116 +452,116 @@ class UpdateManagedProject12 {
Vector<String> idTokens = new Vector<String>(Arrays.asList(oldId.split(REGEXP_SEPARATOR)));
try {
- String platform = idTokens.get(0);
- if (platform.equalsIgnoreCase(ID_CYGWIN)) {
- builtIn = true;
- } else if ((platform.equalsIgnoreCase(ID_LINUX) || platform.equalsIgnoreCase(ID_SOLARIS))
- && (idTokens.get(1)).equalsIgnoreCase(ID_GNU)) {
- posix = builtIn = true;
- }
-
+ String platform = idTokens.get(0);
+ if (platform.equalsIgnoreCase(ID_CYGWIN)) {
+ builtIn = true;
+ } else if ((platform.equalsIgnoreCase(ID_LINUX) || platform.equalsIgnoreCase(ID_SOLARIS))
+ && (idTokens.get(1)).equalsIgnoreCase(ID_GNU)) {
+ posix = builtIn = true;
+ }
+
} catch (ArrayIndexOutOfBoundsException e) {
- builtIn = false;
+ builtIn = false;
}
-
+
// Just answer the original ID if this isn't something we know how to convert
if (!builtIn) {
- return oldId;
+ return oldId;
}
-
+
for (String token : idTokens) {
- if (token.equalsIgnoreCase(ID_EXEC)){
+ if (token.equalsIgnoreCase(ID_EXEC)) {
type = TYPE_EXE;
- } else if (token.equalsIgnoreCase(ID_SHARED)){
+ } else if (token.equalsIgnoreCase(ID_SHARED)) {
type = TYPE_SHARED;
- } else if (token.equalsIgnoreCase(ID_STATIC)){
+ } else if (token.equalsIgnoreCase(ID_STATIC)) {
type = TYPE_STATIC;
}
}
// Create a target based on the new target type
String defID = (posix ? NEW_POSIX_TARGET_ROOT : NEW_CYGWIN_TARGET_ROOT) + ID_SEPARATOR;
- switch (type) {
- case TYPE_EXE :
- defID += ID_EXE;
- break;
- case TYPE_SHARED :
- defID += ID_SHARED;
- break;
- case TYPE_STATIC :
- defID += ID_STATIC;
- break;
+ switch (type) {
+ case TYPE_EXE:
+ defID += ID_EXE;
+ break;
+ case TYPE_SHARED:
+ defID += ID_SHARED;
+ break;
+ case TYPE_STATIC:
+ defID += ID_STATIC;
+ break;
}
return defID;
}
/* (non-Javadoc)
- *
+ *
* @param project the project being upgraded
* @param oldTarget a document element contain the old target information
- * @param monitor
- * @return new 2.1 managed project
+ * @param monitor
+ * @return new 2.1 managed project
* @throws CoreException if the target is unknown
*/
- protected static IManagedProject convertTarget(IProject project, Element oldTarget, IProgressMonitor monitor) throws CoreException{
+ protected static IManagedProject convertTarget(IProject project, Element oldTarget, IProgressMonitor monitor)
+ throws CoreException {
// What we want to create
IManagedProject newProject = null;
IProjectType newParent = null;
-
+
// Get the parent
String id = oldTarget.getAttribute(ITarget.PARENT);
- String parentID = getNewProjectId(id);
-
+ String parentID = getNewProjectId(id);
+
// Get the new target definitions we need for the conversion
newParent = ManagedBuildManager.getProjectType(parentID);
if (newParent == null) {
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
- ConverterMessages.getFormattedString("UpdateManagedProject12.6",parentID), null)); //$NON-NLS-1$
+ ConverterMessages.getFormattedString("UpdateManagedProject12.6", parentID), null)); //$NON-NLS-1$
}
try {
// Create a new target based on the new parent
newProject = ManagedBuildManager.createManagedProject(project, newParent);
-
+
// Create new configurations
NodeList configNodes = oldTarget.getElementsByTagName(IConfigurationV2.CONFIGURATION_ELEMENT_NAME);
for (int configIndex = 0; configIndex < configNodes.getLength(); ++configIndex) {
- try{
+ try {
convertConfiguration(newProject, newParent, (Element) configNodes.item(configIndex), monitor);
- }
- catch(CoreException e){
+ } catch (CoreException e) {
// Keep trying
continue;
}
}
} catch (BuildException e) {
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
- ConverterMessages.getFormattedString("UpdateManagedProject12.8",new String[]{project.getName(),e.getMessage()}), null)); //$NON-NLS-1$
+ ConverterMessages.getFormattedString("UpdateManagedProject12.8", //$NON-NLS-1$
+ new String[] { project.getName(), e.getMessage() }),
+ null));
}
-
+
monitor.worked(1);
return newProject;
}
-
- protected static String getNewToolId(IToolChain toolChain, String oldId)
- throws CoreException {
- String toolId = null;
-
- // Make sure we can convert the ID
- if (!(oldId.startsWith(OLD_TOOL_ROOT_SHORT) ||
- oldId.startsWith(OLD_TOOL_ROOT_LONG))) {
- toolId= oldId;
- } else {
+
+ protected static String getNewToolId(IToolChain toolChain, String oldId) throws CoreException {
+ String toolId = null;
+
+ // Make sure we can convert the ID
+ if (!(oldId.startsWith(OLD_TOOL_ROOT_SHORT) || oldId.startsWith(OLD_TOOL_ROOT_LONG))) {
+ toolId = oldId;
+ } else {
// All known tools have id NEW_TOOL_ROOT.[c|cpp].[compiler|linker|archiver]
toolId = NEW_TOOL_ROOT;
boolean cppFlag = true;
int toolType = -1;
-
+
// Figure out what kind of tool the ref pointed to
Vector<String> idTokens = new Vector<String>(Arrays.asList(oldId.split(REGEXP_SEPARATOR)));
-
+
for (String token : idTokens) {
- if(token.equals(TOOL_LANG_C)) {
+ if (token.equals(TOOL_LANG_C)) {
cppFlag = false;
} else if (token.equalsIgnoreCase(TOOL_NAME_COMPILER)) {
toolType = TOOL_TYPE_COMPILER;
@@ -576,60 +575,58 @@ class UpdateManagedProject12 {
toolType = TOOL_TYPE_LINKER;
}
}
-
+
// Now complete the new tool id
toolId += ID_SEPARATOR + (cppFlag ? "cpp" : "c") + ID_SEPARATOR; //$NON-NLS-1$ //$NON-NLS-2$
switch (toolType) {
- case TOOL_TYPE_COMPILER:
- toolId += TOOL_NAME_COMPILER;
- break;
- case TOOL_TYPE_LINKER:
- toolId += TOOL_NAME_LINKER;
- break;
- case TOOL_TYPE_ARCHIVER:
- toolId += TOOL_NAME_ARCHIVER;
- break;
+ case TOOL_TYPE_COMPILER:
+ toolId += TOOL_NAME_COMPILER;
+ break;
+ case TOOL_TYPE_LINKER:
+ toolId += TOOL_NAME_LINKER;
+ break;
+ case TOOL_TYPE_ARCHIVER:
+ toolId += TOOL_NAME_ARCHIVER;
+ break;
}
- }
-
+ }
+
IConfiguration configuration = toolChain.getParent();
ITool tools[] = configuration.getTools();
- if(tools == null) {
+ if (tools == null) {
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
ConverterMessages.getResourceString("UpdateManagedProject12.9"), null)); //$NON-NLS-1$
}
-
- for(int i = 0; i < tools.length; i++){
- ITool curTool = tools[i];
+
+ for (int i = 0; i < tools.length; i++) {
+ ITool curTool = tools[i];
ITool parent = curTool.getSuperClass();
String curToolId = curTool.getId();
-
+
while (parent != null) {
String parentId = parent.getId();
- if(parentId.equals(toolId))
+ if (parentId.equals(toolId))
break;
parent = parent.getSuperClass();
}
- if(parent == null)
+ if (parent == null)
continue;
-
- try{
- Integer.decode(curToolId.substring(curToolId.lastIndexOf('.')+1));
- }
- catch(IndexOutOfBoundsException e){
+
+ try {
+ Integer.decode(curToolId.substring(curToolId.lastIndexOf('.') + 1));
+ } catch (IndexOutOfBoundsException e) {
continue;
- }
- catch(NumberFormatException e){
+ } catch (NumberFormatException e) {
continue;
}
return curTool.getId();
- }
+ }
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
- ConverterMessages.getFormattedString("UpdateManagedProject12.10",toolId), null)); //$NON-NLS-1$
+ ConverterMessages.getFormattedString("UpdateManagedProject12.10", toolId), null)); //$NON-NLS-1$
}
- protected static void convertToolRef(IToolChain toolChain, Element oldToolRef, IProgressMonitor monitor)
- throws CoreException {
+ protected static void convertToolRef(IToolChain toolChain, Element oldToolRef, IProgressMonitor monitor)
+ throws CoreException {
String toolId = oldToolRef.getAttribute(IToolReference.ID);
toolId = getNewToolId(toolChain, toolId);
IConfiguration configuration = toolChain.getParent();
@@ -637,54 +634,54 @@ class UpdateManagedProject12 {
// Get the new tool out of the configuration
ITool newTool = configuration.getTool(toolId);
// Check that this is not null
- if(newTool == null)
+ if (newTool == null)
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
- ConverterMessages.getFormattedString("UpdateManagedProject12.11",toolId), null)); //$NON-NLS-1$
-
-// Check for migration support
- ((Tool)newTool).checkForMigrationSupport();
-
+ ConverterMessages.getFormattedString("UpdateManagedProject12.11", toolId), null)); //$NON-NLS-1$
+
+ // Check for migration support
+ ((Tool) newTool).checkForMigrationSupport();
+
// The ref may or may not contain overridden options
NodeList optRefs = oldToolRef.getElementsByTagName(ITool.OPTION_REF);
for (int refIndex = optRefs.getLength() - 1; refIndex >= 0; --refIndex) {
- convertOptionRef(toolChain, newTool, (Element) optRefs.item(refIndex));
+ convertOptionRef(toolChain, newTool, (Element) optRefs.item(refIndex));
}
monitor.worked(1);
}
/* (non-Javadoc)
- * Answers true if the target is one supplied by the CDT which will have the
+ * Answers true if the target is one supplied by the CDT which will have the
* format :
* cygyin.[exec|so|lib]
* [linux|solaris].gnu.[exec|so|lib]
- *
+ *
* @param id id to test
* @return true if the target is recognized as built-in
*/
-// private static boolean isBuiltInTarget(String id) {
-// // Do the deed
-// if (id == null) return false;
-// String[] idTokens = id.split(REGEXP_SEPARATOR);
-// if (!(idTokens.length == 2 || idTokens.length == 3)) return false;
-// try {
-// String platform = idTokens[0];
-// if (platform.equals(ID_CYGWIN)) {
-// return (idTokens[1].equals(ID_EXEC)
-// || idTokens[1].equals(ID_SHARED)
-// || idTokens[1].equals(ID_STATIC));
-// } else if (platform.equals(ID_LINUX)
-// || platform.equals(ID_SOLARIS)) {
-// if (idTokens[1].equals(ID_GNU)) {
-// return (idTokens[2].equals(ID_EXEC)
-// || idTokens[2].equals(ID_SHARED)
-// || idTokens[2].equals(ID_STATIC));
-// }
-// }
-// } catch (ArrayIndexOutOfBoundsException e) {
-// return false;
-// }
-// return false;
-// }
+ // private static boolean isBuiltInTarget(String id) {
+ // // Do the deed
+ // if (id == null) return false;
+ // String[] idTokens = id.split(REGEXP_SEPARATOR);
+ // if (!(idTokens.length == 2 || idTokens.length == 3)) return false;
+ // try {
+ // String platform = idTokens[0];
+ // if (platform.equals(ID_CYGWIN)) {
+ // return (idTokens[1].equals(ID_EXEC)
+ // || idTokens[1].equals(ID_SHARED)
+ // || idTokens[1].equals(ID_STATIC));
+ // } else if (platform.equals(ID_LINUX)
+ // || platform.equals(ID_SOLARIS)) {
+ // if (idTokens[1].equals(ID_GNU)) {
+ // return (idTokens[2].equals(ID_EXEC)
+ // || idTokens[2].equals(ID_SHARED)
+ // || idTokens[2].equals(ID_STATIC));
+ // }
+ // }
+ // } catch (ArrayIndexOutOfBoundsException e) {
+ // return false;
+ // }
+ // return false;
+ // }
/**
* @param monitor the monitor to allow users to cancel the long-running operation
@@ -692,7 +689,7 @@ class UpdateManagedProject12 {
* @throws CoreException if the update fails
*/
public static void doProjectUpdate(IProgressMonitor monitor, final IProject project) throws CoreException {
- String[] projectName = new String[]{project.getName()};
+ String[] projectName = new String[] { project.getName() };
IFile file = project.getFile(ManagedBuildManager.SETTINGS_FILE_NAME);
File settingsFile = file.getLocation().toFile();
@@ -700,37 +697,38 @@ class UpdateManagedProject12 {
monitor.done();
return;
}
-
+
// Backup the file
monitor.beginTask(ConverterMessages.getFormattedString("UpdateManagedProject12.0", projectName), 1); //$NON-NLS-1$
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
- UpdateManagedProjectManager.backupFile(file, "_12backup", monitor, project); //$NON-NLS-1$
+ UpdateManagedProjectManager.backupFile(file, "_12backup", monitor, project); //$NON-NLS-1$
IManagedProject newProject = null;
-
+
//Now convert each target to the new format
try {
// Load the old build file
InputStream stream = new FileInputStream(settingsFile);
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document document = parser.parse(stream);
-
+
// Clone the target based on the proper target definition
NodeList targetNodes = document.getElementsByTagName(ITarget.TARGET_ELEMENT_NAME);
// This is a guess, but typically the project has 1 target, 2 configs, and 6 tool defs
int listSize = targetNodes.getLength();
- monitor.beginTask(ConverterMessages.getFormattedString("UpdateManagedProject12.1", projectName), listSize * 9); //$NON-NLS-1$
+ monitor.beginTask(ConverterMessages.getFormattedString("UpdateManagedProject12.1", projectName), //$NON-NLS-1$
+ listSize * 9);
for (int targIndex = 0; targIndex < listSize; ++targIndex) {
Element oldTarget = (Element) targetNodes.item(targIndex);
String oldTargetId = oldTarget.getAttribute(ITarget.ID);
- newProject = convertTarget(project, oldTarget, monitor);
+ newProject = convertTarget(project, oldTarget, monitor);
// Remove the old target
if (newProject != null) {
info.removeTarget(oldTargetId);
monitor.worked(1);
}
}
-
+
// Set the default configuration
NodeList defaultConfiguration = document.getElementsByTagName(IManagedBuildInfo.DEFAULT_CONFIGURATION);
try {
@@ -741,52 +739,51 @@ class UpdateManagedProject12 {
info.setDefaultConfiguration(newDefaultConfig);
info.setSelectedConfiguration(newDefaultConfig);
} else {
- // The only safe thing to do if there wasn't a default configuration for a built-in
- // target is to set the first defined configuration as the default
- IConfiguration[] newConfigs = newProject.getConfigurations();
- if (newConfigs.length > 0) {
- info.setDefaultConfiguration(newConfigs[0]);
- info.setSelectedConfiguration(newConfigs[0]);
- }
+ // The only safe thing to do if there wasn't a default configuration for a built-in
+ // target is to set the first defined configuration as the default
+ IConfiguration[] newConfigs = newProject.getConfigurations();
+ if (newConfigs.length > 0) {
+ info.setDefaultConfiguration(newConfigs[0]);
+ info.setSelectedConfiguration(newConfigs[0]);
+ }
}
} catch (IndexOutOfBoundsException e) {
- throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
- ConverterMessages.getFormattedString("UpdateManagedProject12.7",newProject.getName()), null)); //$NON-NLS-1$
+ throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
+ ConverterMessages.getFormattedString("UpdateManagedProject12.7", newProject.getName()), null)); //$NON-NLS-1$
}
-
+
// Upgrade the version
- ((ManagedBuildInfo)info).setVersion("2.1.0"); //$NON-NLS-1$
+ ((ManagedBuildInfo) info).setVersion("2.1.0"); //$NON-NLS-1$
info.setValid(true);
- } catch (CoreException e){
+ } catch (CoreException e) {
throw e;
} catch (Exception e) {
- throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
- e.getMessage(), e));
+ throw new CoreException(
+ new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1, e.getMessage(), e));
} finally {
// If the tree is locked spawn a job to this.
IWorkspace workspace = project.getWorkspace();
-// boolean treeLock = workspace.isTreeLocked();
+ // boolean treeLock = workspace.isTreeLocked();
ISchedulingRule rule = workspace.getRuleFactory().createRule(project);
//since the java synchronized mechanism is now used for the build info loadding,
//initiate the job in all cases
-// if (treeLock) {
- WorkspaceJob job = new WorkspaceJob(ConverterMessages.getResourceString("UpdateManagedProject.notice")) { //$NON-NLS-1$
- @Override
- public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
- ManagedBuildManager.saveBuildInfoLegacy(project, false);
- return Status.OK_STATUS;
- }
- };
- job.setRule(rule);
- job.schedule();
-// } else {
-// ManagedBuildManager.saveBuildInfo(project, false);
-// }
+ // if (treeLock) {
+ WorkspaceJob job = new WorkspaceJob(ConverterMessages.getResourceString("UpdateManagedProject.notice")) { //$NON-NLS-1$
+ @Override
+ public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
+ ManagedBuildManager.saveBuildInfoLegacy(project, false);
+ return Status.OK_STATUS;
+ }
+ };
+ job.setRule(rule);
+ job.schedule();
+ // } else {
+ // ManagedBuildManager.saveBuildInfo(project, false);
+ // }
monitor.done();
}
}
-
-
+
/* (non-Javadoc)
* @return Returns the configIdMap.
*/
@@ -798,45 +795,40 @@ class UpdateManagedProject12 {
}
protected static boolean isBuiltInOption(Vector<String> idTokens) {
- try {
- String platform = idTokens.firstElement();
- String secondToken = idTokens.get(1);
- if (platform.equals(ID_CYGWIN)) {
- // bit of a mess since was done first
- // but valid second tokens are 'compiler',
- // 'preprocessor', 'c', 'gnu', 'link',
- // 'solink', or 'ar'
- if (secondToken.equals(TOOL_NAME_COMPILER) ||
- secondToken.equals(ID_PREPROC) ||
- secondToken.equals(TOOL_LANG_C) ||
- secondToken.equals(ID_GNU) ||
- secondToken.equals(TOOL_NAME_LINK) ||
- secondToken.equals(TOOL_NAME_SOLINK)||
- secondToken.equals(TOOL_NAME_AR)) {
- return true;
- }
- } else if (platform.equals(ID_LINUX)) {
- // Only going to see 'gnu' or 'c'
- if (secondToken.equals(ID_GNU) ||
- secondToken.equals(TOOL_LANG_C)) {
- return true;
- }
- } else if (platform.equals(ID_SOLARIS)) {
- // Only going to see 'gnu', 'c', or 'compiler'
- if ( secondToken.equals(ID_GNU) ||
- secondToken.equals(TOOL_LANG_C) ||
- secondToken.equals(TOOL_NAME_COMPILER)) {
- return true;
- }
- } else {
- return false;
- }
- } catch (NoSuchElementException e) {
- // If the string is empty, it isn't valid
- return false;
- } catch (ArrayIndexOutOfBoundsException e) {
- return false;
- }
- return false;
+ try {
+ String platform = idTokens.firstElement();
+ String secondToken = idTokens.get(1);
+ if (platform.equals(ID_CYGWIN)) {
+ // bit of a mess since was done first
+ // but valid second tokens are 'compiler',
+ // 'preprocessor', 'c', 'gnu', 'link',
+ // 'solink', or 'ar'
+ if (secondToken.equals(TOOL_NAME_COMPILER) || secondToken.equals(ID_PREPROC)
+ || secondToken.equals(TOOL_LANG_C) || secondToken.equals(ID_GNU)
+ || secondToken.equals(TOOL_NAME_LINK) || secondToken.equals(TOOL_NAME_SOLINK)
+ || secondToken.equals(TOOL_NAME_AR)) {
+ return true;
+ }
+ } else if (platform.equals(ID_LINUX)) {
+ // Only going to see 'gnu' or 'c'
+ if (secondToken.equals(ID_GNU) || secondToken.equals(TOOL_LANG_C)) {
+ return true;
+ }
+ } else if (platform.equals(ID_SOLARIS)) {
+ // Only going to see 'gnu', 'c', or 'compiler'
+ if (secondToken.equals(ID_GNU) || secondToken.equals(TOOL_LANG_C)
+ || secondToken.equals(TOOL_NAME_COMPILER)) {
+ return true;
+ }
+ } else {
+ return false;
+ }
+ } catch (NoSuchElementException e) {
+ // If the string is empty, it isn't valid
+ return false;
+ } catch (ArrayIndexOutOfBoundsException e) {
+ return false;
+ }
+ return false;
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject20.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject20.java
index f685304c747..793ce9d99e7 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject20.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject20.java
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.projectconverter;
-
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
@@ -56,42 +55,43 @@ import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
class UpdateManagedProject20 {
- private static final String ID_SEPARATOR = "."; //$NON-NLS-1$
-
+ private static final String ID_SEPARATOR = "."; //$NON-NLS-1$
+
/**
* @param monitor the monitor to allow users to cancel the long-running operation
* @param project the <code>IProject</code> that needs to be upgraded
*/
static void doProjectUpdate(IProgressMonitor monitor, final IProject project) throws CoreException {
- String[] projectName = new String[]{project.getName()};
+ String[] projectName = new String[] { project.getName() };
IFile file = project.getFile(ManagedBuildManager.SETTINGS_FILE_NAME);
File settingsFile = file.getLocation().toFile();
if (!settingsFile.exists()) {
monitor.done();
return;
}
-
+
// Backup the file
monitor.beginTask(ConverterMessages.getFormattedString("UpdateManagedProject20.0", projectName), 1); //$NON-NLS-1$
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
UpdateManagedProjectManager.backupFile(file, "_20backup", monitor, project); //$NON-NLS-1$
-
+
try {
// Load the old build file
InputStream stream = new FileInputStream(settingsFile);
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document document = parser.parse(stream);
-
+
// Clone the target based on the proper target definition
NodeList targetNodes = document.getElementsByTagName(ITarget.TARGET_ELEMENT_NAME);
// This is a guess, but typically the project has 1 target, 2 configs, and 6 tool defs
int listSize = targetNodes.getLength();
- monitor.beginTask(ConverterMessages.getFormattedString("UpdateManagedProject20.1", projectName), listSize * 9); //$NON-NLS-1$
+ monitor.beginTask(ConverterMessages.getFormattedString("UpdateManagedProject20.1", projectName), //$NON-NLS-1$
+ listSize * 9);
for (int targIndex = 0; targIndex < listSize; ++targIndex) {
Element oldTarget = (Element) targetNodes.item(targIndex);
String oldTargetId = oldTarget.getAttribute(ITarget.ID);
IManagedProject newProject = convertTarget(project, oldTarget, monitor);
-
+
// Remove the old target
if (newProject != null) {
info.removeTarget(oldTargetId);
@@ -99,94 +99,94 @@ class UpdateManagedProject20 {
}
}
// Upgrade the version
- ((ManagedBuildInfo)info).setVersion("2.1.0"); //$NON-NLS-1$
+ ((ManagedBuildInfo) info).setVersion("2.1.0"); //$NON-NLS-1$
info.setValid(true);
- }catch (CoreException e){
+ } catch (CoreException e) {
throw e;
- }catch (Exception e) {
- throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
- e.getMessage(), e));
+ } catch (Exception e) {
+ throw new CoreException(
+ new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1, e.getMessage(), e));
} finally {
// If the tree is locked spawn a job to this.
IWorkspace workspace = project.getWorkspace();
-// boolean treeLock = workspace.isTreeLocked();
+ // boolean treeLock = workspace.isTreeLocked();
ISchedulingRule rule = workspace.getRuleFactory().createRule(project);
-// if (treeLock) {
+ // if (treeLock) {
//since the java synchronized mechanism is now used for the build info loadding,
//initiate the job in all cases
- WorkspaceJob job = new WorkspaceJob(ConverterMessages.getResourceString("UpdateManagedProject.notice")) { //$NON-NLS-1$
- @Override
- public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
- ManagedBuildManager.saveBuildInfoLegacy(project, false);
- return Status.OK_STATUS;
- }
- };
- job.setRule(rule);
- job.schedule();
-// } else {
-// ManagedBuildManager.saveBuildInfo(project, false);
-// }
+ WorkspaceJob job = new WorkspaceJob(ConverterMessages.getResourceString("UpdateManagedProject.notice")) { //$NON-NLS-1$
+ @Override
+ public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
+ ManagedBuildManager.saveBuildInfoLegacy(project, false);
+ return Status.OK_STATUS;
+ }
+ };
+ job.setRule(rule);
+ job.schedule();
+ // } else {
+ // ManagedBuildManager.saveBuildInfo(project, false);
+ // }
monitor.done();
}
}
-
+
protected static IManagedProject convertTarget(IProject project, Element oldTarget, IProgressMonitor monitor)
- throws CoreException{
+ throws CoreException {
// What we want to create
IManagedProject newProject = null;
IProjectType newParent = null;
-
+
// Get the parent
String parentID = oldTarget.getAttribute(ITarget.PARENT);
-
+
String targetID = oldTarget.getAttribute(ITarget.ID);
-
+
// Get the new target definitions we need for the conversion
newParent = ManagedBuildManager.getProjectType(parentID);
-
+
if (newParent == null) {
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
- ConverterMessages.getFormattedString("UpdateManagedProject20.9",parentID), null)); //$NON-NLS-1$
+ ConverterMessages.getFormattedString("UpdateManagedProject20.9", parentID), null)); //$NON-NLS-1$
}
try {
// Create a new ManagedProject based on the new parent
newProject = ManagedBuildManager.createManagedProject(project, newParent);
-
+
// Create new configurations
NodeList configNodes = oldTarget.getElementsByTagName(IConfigurationV2.CONFIGURATION_ELEMENT_NAME);
for (int configIndex = 0; configIndex < configNodes.getLength(); ++configIndex) {
- try{
+ try {
convertConfiguration(newProject, newParent, (Element) configNodes.item(configIndex), monitor);
- }
- catch(CoreException e){
- //TODO: implement logging
+ } catch (CoreException e) {
+ //TODO: implement logging
//should we continue or fail ??
}
}
-
+
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
IConfiguration[] newConfigs = newProject.getConfigurations();
if (newConfigs.length > 0) {
info.setDefaultConfiguration(newConfigs[0]);
info.setSelectedConfiguration(newConfigs[0]);
- }
- else{
+ } else {
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
- ConverterMessages.getFormattedString("UpdateManagedProject20.10",newProject.getName()), null)); //$NON-NLS-1$
+ ConverterMessages.getFormattedString("UpdateManagedProject20.10", newProject.getName()), null)); //$NON-NLS-1$
}
} catch (BuildException e) {
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
- ConverterMessages.getFormattedString("UpdateManagedProject20.11",new String[]{project.getName(),e.getMessage()}), null)); //$NON-NLS-1$
+ ConverterMessages.getFormattedString("UpdateManagedProject20.11", //$NON-NLS-1$
+ new String[] { project.getName(), e.getMessage() }),
+ null));
}
-
+
monitor.worked(1);
return newProject;
}
- protected static void convertConfiguration(IManagedProject newProject, IProjectType newParent, Element oldConfig, IProgressMonitor monitor)
- throws CoreException {
+ protected static void convertConfiguration(IManagedProject newProject, IProjectType newParent, Element oldConfig,
+ IProgressMonitor monitor) throws CoreException {
IConfiguration newParentConfig = null;
IConfiguration newConfig = null;
@@ -197,101 +197,100 @@ class UpdateManagedProject20 {
if (newParentConfig == null) {
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
ConverterMessages.getFormattedString("UpdateManagedProject20.2", parentId), null)); //$NON-NLS-1$
- }
+ }
// Generate a random number for the new config id
int randomElement = ManagedBuildManager.getRandomNumber();
String newConfigId = parentId + ID_SEPARATOR + randomElement;
// Create the new configuration
newConfig = newProject.createConfiguration(newParentConfig, newConfigId);
- if(oldConfig.hasAttribute(IConfigurationV2.NAME))
+ if (oldConfig.hasAttribute(IConfigurationV2.NAME))
newConfig.setName(oldConfig.getAttribute(IConfigurationV2.NAME));
- Element targetEl = (Element)oldConfig.getParentNode();
+ Element targetEl = (Element) oldConfig.getParentNode();
- if(targetEl.hasAttribute(ITarget.ARTIFACT_NAME))
+ if (targetEl.hasAttribute(ITarget.ARTIFACT_NAME))
newConfig.setArtifactName(targetEl.getAttribute(ITarget.ARTIFACT_NAME));
- if(targetEl.hasAttribute(ITarget.ERROR_PARSERS))
+ if (targetEl.hasAttribute(ITarget.ERROR_PARSERS))
newConfig.setErrorParserIds(targetEl.getAttribute(ITarget.ERROR_PARSERS));
- if(targetEl.hasAttribute(ITarget.CLEAN_COMMAND))
+ if (targetEl.hasAttribute(ITarget.CLEAN_COMMAND))
newConfig.setCleanCommand(targetEl.getAttribute(ITarget.CLEAN_COMMAND));
- if(targetEl.hasAttribute(ITarget.EXTENSION))
+ if (targetEl.hasAttribute(ITarget.EXTENSION))
newConfig.setArtifactExtension(targetEl.getAttribute(ITarget.EXTENSION));
-
+
// Convert the tool references
-
+
IToolChain toolChain = newConfig.getToolChain();
- ((ToolChain)toolChain).checkForMigrationSupport();
+ ((ToolChain) toolChain).checkForMigrationSupport();
- if(targetEl.hasAttribute(ITarget.OS_LIST)){
+ if (targetEl.hasAttribute(ITarget.OS_LIST)) {
String oses = targetEl.getAttribute(ITarget.OS_LIST);
String osList[] = oses.split(","); //$NON-NLS-1$
for (int i = 0; i < osList.length; ++i) {
- osList[i]=osList[i].trim();
+ osList[i] = osList[i].trim();
}
toolChain.setOSList(osList);
}
-
- if(targetEl.hasAttribute(ITarget.ARCH_LIST)){
+
+ if (targetEl.hasAttribute(ITarget.ARCH_LIST)) {
String archs = targetEl.getAttribute(ITarget.ARCH_LIST);
String archList[] = archs.split(","); //$NON-NLS-1$
for (int i = 0; i < archList.length; ++i) {
- archList[i]=archList[i].trim();
+ archList[i] = archList[i].trim();
}
toolChain.setArchList(archList);
}
-
- if(targetEl.hasAttribute(ITarget.BINARY_PARSER)){
+
+ if (targetEl.hasAttribute(ITarget.BINARY_PARSER)) {
String binaryParser = targetEl.getAttribute(ITarget.BINARY_PARSER);
ITargetPlatform targetPlatform = toolChain.getTargetPlatform();
- if(targetPlatform.isExtensionElement()){
+ if (targetPlatform.isExtensionElement()) {
int nnn = ManagedBuildManager.getRandomNumber();
- String subId = targetPlatform.getId() + "." + nnn; //$NON-NLS-1$
- String builderName = targetPlatform.getName() + "." + newConfig.getName(); //$NON-NLS-1$
- toolChain.createTargetPlatform(targetPlatform,subId,builderName,false);
+ String subId = targetPlatform.getId() + "." + nnn; //$NON-NLS-1$
+ String builderName = targetPlatform.getName() + "." + newConfig.getName(); //$NON-NLS-1$
+ toolChain.createTargetPlatform(targetPlatform, subId, builderName, false);
}
- targetPlatform.setBinaryParserList(new String[]{binaryParser}); // Older projects have only a single binary parser.
+ targetPlatform.setBinaryParserList(new String[] { binaryParser }); // Older projects have only a single binary parser.
}
-
- if(targetEl.hasAttribute(ITarget.MAKE_COMMAND)){
- String makeCommand = targetEl.getAttribute(ITarget.MAKE_COMMAND);
+
+ if (targetEl.hasAttribute(ITarget.MAKE_COMMAND)) {
+ String makeCommand = targetEl.getAttribute(ITarget.MAKE_COMMAND);
IBuilder builder = toolChain.getBuilder();
if (builder.isExtensionElement()) {
int nnn = ManagedBuildManager.getRandomNumber();
- String subId = builder.getId() + "." + nnn; //$NON-NLS-1$
- String builderName = builder.getName() + "." + newConfig.getName(); //$NON-NLS-1$
+ String subId = builder.getId() + "." + nnn; //$NON-NLS-1$
+ String builderName = builder.getName() + "." + newConfig.getName(); //$NON-NLS-1$
builder = toolChain.createBuilder(builder, subId, builderName, false);
}
builder.setCommand(makeCommand);
}
- if(targetEl.hasAttribute(ITarget.MAKE_ARGS)){
- String makeArguments = targetEl.getAttribute(ITarget.MAKE_ARGS);
+ if (targetEl.hasAttribute(ITarget.MAKE_ARGS)) {
+ String makeArguments = targetEl.getAttribute(ITarget.MAKE_ARGS);
IBuilder builder = toolChain.getBuilder();
if (builder.isExtensionElement()) {
int nnn = ManagedBuildManager.getRandomNumber();
- String subId = builder.getId() + "." + nnn; //$NON-NLS-1$
- String builderName = builder.getName() + "." + newConfig.getName(); //$NON-NLS-1$
+ String subId = builder.getId() + "." + nnn; //$NON-NLS-1$
+ String builderName = builder.getName() + "." + newConfig.getName(); //$NON-NLS-1$
builder = toolChain.createBuilder(builder, subId, builderName, false);
}
builder.setArguments(makeArguments);
}
-// by now if a builder is going to be created, it will have been
- Builder builder = (Builder)toolChain.getBuilder();
- if (! builder.isExtensionElement()) {
+ // by now if a builder is going to be created, it will have been
+ Builder builder = (Builder) toolChain.getBuilder();
+ if (!builder.isExtensionElement()) {
builder.checkForMigrationSupport();
}
NodeList toolRefNodes = oldConfig.getElementsByTagName(IConfigurationV2.TOOLREF_ELEMENT_NAME);
for (int refIndex = 0; refIndex < toolRefNodes.getLength(); ++refIndex) {
- try{
+ try {
convertToolRef(toolChain, (Element) toolRefNodes.item(refIndex), monitor);
- }
- catch(CoreException e){
+ } catch (CoreException e) {
newProject.removeConfiguration(newConfigId);
throw e;
}
@@ -299,167 +298,163 @@ class UpdateManagedProject20 {
monitor.worked(1);
}
-
- protected static void convertToolRef(IToolChain toolChain, Element oldToolRef, IProgressMonitor monitor)
- throws CoreException {
- if(!oldToolRef.hasAttribute(IToolReference.ID)) {
+
+ protected static void convertToolRef(IToolChain toolChain, Element oldToolRef, IProgressMonitor monitor)
+ throws CoreException {
+ if (!oldToolRef.hasAttribute(IToolReference.ID)) {
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
ConverterMessages.getResourceString("UpdateManagedProject20.3"), null)); //$NON-NLS-1$
}
String toolId = oldToolRef.getAttribute(IToolReference.ID);
IConfiguration configuration = toolChain.getParent();
-
+
ITool tools[] = configuration.getTools();
- if(tools == null) {
+ if (tools == null) {
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
ConverterMessages.getResourceString("UpdateManagedProject20.4"), null)); //$NON-NLS-1$
}
-
+
ITool tool = null;
- for(int i = 0; i < tools.length; i++){
- ITool curTool = tools[i];
+ for (int i = 0; i < tools.length; i++) {
+ ITool curTool = tools[i];
ITool parent = curTool.getSuperClass();
String curToolId = curTool.getId();
-
+
while (parent != null) {
String parentId = parent.getId();
- if(parentId.equals(toolId))
+ if (parentId.equals(toolId))
break;
parent = parent.getSuperClass();
}
- if(parent == null)
+ if (parent == null)
continue;
- try{
- Integer.decode(curToolId.substring(curToolId.lastIndexOf('.')+1));
- }
- catch(IndexOutOfBoundsException e){
+ try {
+ Integer.decode(curToolId.substring(curToolId.lastIndexOf('.') + 1));
+ } catch (IndexOutOfBoundsException e) {
continue;
- }
- catch(NumberFormatException e){
+ } catch (NumberFormatException e) {
continue;
}
tool = curTool;
break;
}
- if(tool == null){
+ if (tool == null) {
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
- ConverterMessages.getFormattedString("UpdateManagedProject20.5",toolId), null)); //$NON-NLS-1$
+ ConverterMessages.getFormattedString("UpdateManagedProject20.5", toolId), null)); //$NON-NLS-1$
}
-
- // Check for migration support
- ((Tool)tool).checkForMigrationSupport();
-
+
+ // Check for migration support
+ ((Tool) tool).checkForMigrationSupport();
+
//the tool found, proceed with conversion ...
- if(oldToolRef.hasAttribute(IToolReference.COMMAND))
+ if (oldToolRef.hasAttribute(IToolReference.COMMAND))
tool.setToolCommand(oldToolRef.getAttribute(IToolReference.COMMAND));
- if(oldToolRef.hasAttribute(IToolReference.OUTPUT_FLAG))
+ if (oldToolRef.hasAttribute(IToolReference.OUTPUT_FLAG))
tool.setOutputFlag(oldToolRef.getAttribute(IToolReference.OUTPUT_FLAG));
- if(oldToolRef.hasAttribute(IToolReference.OUTPUT_PREFIX))
+ if (oldToolRef.hasAttribute(IToolReference.OUTPUT_PREFIX))
tool.setOutputPrefix(oldToolRef.getAttribute(IToolReference.OUTPUT_PREFIX));
-
- if(oldToolRef.hasAttribute(IToolReference.OUTPUTS)){
+ if (oldToolRef.hasAttribute(IToolReference.OUTPUTS)) {
String outputs = oldToolRef.getAttribute(IToolReference.OUTPUTS);
tool.setOutputsAttribute(outputs);
}
NodeList optRefs = oldToolRef.getElementsByTagName(ITool.OPTION_REF);
for (int refIndex = optRefs.getLength() - 1; refIndex >= 0; --refIndex) {
- convertOptionRef(toolChain, tool, (Element) optRefs.item(refIndex), monitor);
+ convertOptionRef(toolChain, tool, (Element) optRefs.item(refIndex), monitor);
}
monitor.worked(1);
}
-
- protected static void convertOptionRef(IToolChain toolChain, ITool tool, Element optRef, IProgressMonitor monitor)
- throws CoreException {
- if(!optRef.hasAttribute(IOption.ID)){
+ protected static void convertOptionRef(IToolChain toolChain, ITool tool, Element optRef, IProgressMonitor monitor)
+ throws CoreException {
+
+ if (!optRef.hasAttribute(IOption.ID)) {
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
ConverterMessages.getResourceString("UpdateManagedProject20.6"), null)); //$NON-NLS-1$
}
-
+
String optId = optRef.getAttribute(IOption.ID);
-
+
IConfiguration configuration = toolChain.getParent();
-
- IOption options[] = tool.getOptions();
+
+ IOption options[] = tool.getOptions();
IOption option = null;
- for(int i = 0; i < options.length; i++){
- IOption curOption = options[i];
+ for (int i = 0; i < options.length; i++) {
+ IOption curOption = options[i];
IOption parent = curOption.getSuperClass();
- if(parent == null)
+ if (parent == null)
continue;
-
- for (;parent.getSuperClass()!=null;parent = parent.getSuperClass()) {
+
+ for (; parent.getSuperClass() != null; parent = parent.getSuperClass()) {
// empty body, the loop is to find superclass
}
-
+
String parentId = parent.getId();
- if(!parentId.equals(optId))
+ if (!parentId.equals(optId))
continue;
-
+
option = curOption;
break;
}
-
- if(option == null)
+
+ if (option == null)
option = tool.getOptionById(optId);
-
- if (option != null) { // Ignore options that don't have a match
- try{
+
+ if (option != null) { // Ignore options that don't have a match
+ try {
int type = option.getValueType();
-
- switch(type){
- case IOption.BOOLEAN:{
- if(optRef.hasAttribute(IOption.DEFAULT_VALUE)){
- Boolean bool = Boolean.valueOf(optRef.getAttribute(IOption.DEFAULT_VALUE));
- configuration.setOption(tool,option,bool.booleanValue());
- }
- break;
+
+ switch (type) {
+ case IOption.BOOLEAN: {
+ if (optRef.hasAttribute(IOption.DEFAULT_VALUE)) {
+ Boolean bool = Boolean.valueOf(optRef.getAttribute(IOption.DEFAULT_VALUE));
+ configuration.setOption(tool, option, bool.booleanValue());
}
+ break;
+ }
case IOption.ENUMERATED:
case IOption.TREE:
- case IOption.STRING:{
- if(optRef.hasAttribute(IOption.DEFAULT_VALUE))
- configuration.setOption(tool,option,optRef.getAttribute(IOption.DEFAULT_VALUE));
- break;
- }
+ case IOption.STRING: {
+ if (optRef.hasAttribute(IOption.DEFAULT_VALUE))
+ configuration.setOption(tool, option, optRef.getAttribute(IOption.DEFAULT_VALUE));
+ break;
+ }
case IOption.STRING_LIST:
case IOption.INCLUDE_PATH:
case IOption.PREPROCESSOR_SYMBOLS:
case IOption.LIBRARIES:
- case IOption.OBJECTS:{
- Vector<String> values = new Vector<String>();
- NodeList nodes = optRef.getElementsByTagName(IOption.LIST_VALUE);
- for (int j = 0; j < nodes.getLength(); ++j) {
- Node node = nodes.item(j);
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- Boolean isBuiltIn = Boolean.valueOf(((Element)node).getAttribute(IOption.LIST_ITEM_BUILTIN));
- if (!isBuiltIn.booleanValue()) {
- values.add(((Element)node).getAttribute(IOption.LIST_ITEM_VALUE));
- }
+ case IOption.OBJECTS: {
+ Vector<String> values = new Vector<String>();
+ NodeList nodes = optRef.getElementsByTagName(IOption.LIST_VALUE);
+ for (int j = 0; j < nodes.getLength(); ++j) {
+ Node node = nodes.item(j);
+ if (node.getNodeType() == Node.ELEMENT_NODE) {
+ Boolean isBuiltIn = Boolean
+ .valueOf(((Element) node).getAttribute(IOption.LIST_ITEM_BUILTIN));
+ if (!isBuiltIn.booleanValue()) {
+ values.add(((Element) node).getAttribute(IOption.LIST_ITEM_VALUE));
}
}
- configuration.setOption(tool,option,values.toArray(new String[values.size()]));
- break;
}
+ configuration.setOption(tool, option, values.toArray(new String[values.size()]));
+ break;
+ }
default:
break;
}
- }
- catch(BuildException e){
+ } catch (BuildException e) {
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
- ConverterMessages.getFormattedString("UpdateManagedProject20.8",e.getMessage()), e)); //$NON-NLS-1$
+ ConverterMessages.getFormattedString("UpdateManagedProject20.8", e.getMessage()), e)); //$NON-NLS-1$
}
}
}
}
-
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject21.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject21.java
index c3aebf81791..bb7b9da5173 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject21.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject21.java
@@ -14,7 +14,6 @@
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.projectconverter;
-
import java.io.File;
import org.eclipse.cdt.core.CCorePlugin;
@@ -50,7 +49,7 @@ class UpdateManagedProject21 {
* @param project the <code>IProject</code> that needs to be upgraded
*/
static void doProjectUpdate(IProgressMonitor monitor, final IProject project) throws CoreException {
- String[] projectName = new String[]{project.getName()};
+ String[] projectName = new String[] { project.getName() };
IFile file = project.getFile(ManagedBuildManager.SETTINGS_FILE_NAME);
File settingsFile = file.getLocation().toFile();
if (!settingsFile.exists()) {
@@ -65,7 +64,7 @@ class UpdateManagedProject21 {
// No physical conversion is need since the 3.0 model is a superset of the 2.1 model
// We need to upgrade the version
- ((ManagedBuildInfo)info).setVersion("3.0.0"); //$NON-NLS-1$
+ ((ManagedBuildInfo) info).setVersion("3.0.0"); //$NON-NLS-1$
info.setValid(true);
// Save the updated file.
@@ -75,27 +74,27 @@ class UpdateManagedProject21 {
// Eclipse content types.
// If the tree is locked spawn a job to this.
IWorkspace workspace = project.getWorkspace();
-// boolean treeLock = workspace.isTreeLocked();
+ // boolean treeLock = workspace.isTreeLocked();
ISchedulingRule rule1 = workspace.getRuleFactory().createRule(project);
ISchedulingRule rule2 = workspace.getRuleFactory().refreshRule(project);
ISchedulingRule rule = MultiRule.combine(rule1, rule2);
//since the java synchronized mechanism is now used for the build info loadding,
//initiate the job in all cases
-// if (treeLock) {
- WorkspaceJob job = new WorkspaceJob(ConverterMessages.getResourceString("UpdateManagedProject.notice")) { //$NON-NLS-1$
- @Override
- public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
- checkForCPPWithC(monitor, project);
- ManagedBuildManager.saveBuildInfoLegacy(project, true);
- return Status.OK_STATUS;
- }
- };
- job.setRule(rule);
- job.schedule();
-// } else {
-// checkForCPPWithC(monitor, project);
-// ManagedBuildManager.saveBuildInfo(project, true);
-// }
+ // if (treeLock) {
+ WorkspaceJob job = new WorkspaceJob(ConverterMessages.getResourceString("UpdateManagedProject.notice")) { //$NON-NLS-1$
+ @Override
+ public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
+ checkForCPPWithC(monitor, project);
+ ManagedBuildManager.saveBuildInfoLegacy(project, true);
+ return Status.OK_STATUS;
+ }
+ };
+ job.setRule(rule);
+ job.schedule();
+ // } else {
+ // checkForCPPWithC(monitor, project);
+ // ManagedBuildManager.saveBuildInfo(project, true);
+ // }
monitor.done();
}
@@ -121,32 +120,32 @@ class UpdateManagedProject21 {
}
};
workspace.run(runnable, project, IWorkspace.AVOID_UPDATE, monitor);
- } catch (Exception e) {} // Ignore the error - the user may have to add .c extensions to
- // the local definition of C++ file extensions
+ } catch (Exception e) {
+ } // Ignore the error - the user may have to add .c extensions to
+ // the local definition of C++ file extensions
final boolean found[] = new boolean[1];
- project.accept(new IResourceProxyVisitor(){
+ project.accept(new IResourceProxyVisitor() {
- /* (non-Javadoc)
- * @see org.eclipse.core.resources.IResourceProxyVisitor#visit(org.eclipse.core.resources.IResourceProxy)
- */
- @Override
- public boolean visit(IResourceProxy proxy) throws CoreException {
- if(found[0] || proxy.isDerived())
- return false;
- if(proxy.getType() == IResource.FILE){
- String ext = proxy.requestFullPath().getFileExtension();
- if (ext != null && "c".equals(ext)) { //$NON-NLS-1$
- found[0] = true;
- }
- return false;
+ /* (non-Javadoc)
+ * @see org.eclipse.core.resources.IResourceProxyVisitor#visit(org.eclipse.core.resources.IResourceProxy)
+ */
+ @Override
+ public boolean visit(IResourceProxy proxy) throws CoreException {
+ if (found[0] || proxy.isDerived())
+ return false;
+ if (proxy.getType() == IResource.FILE) {
+ String ext = proxy.requestFullPath().getFileExtension();
+ if (ext != null && "c".equals(ext)) { //$NON-NLS-1$
+ found[0] = true;
}
- return true;
+ return false;
}
- },
- IResource.NONE);
+ return true;
+ }
+ }, IResource.NONE);
- if(found[0]){
+ if (found[0]) {
IScopeContext projectScope = new ProjectScope(project);
// First, we need to enable user settings on the project __explicitely__
@@ -161,10 +160,10 @@ class UpdateManagedProject21 {
// the conflict resolution of the ContentTypeManager framework
// will give preference to the project settings.
IContentTypeManager manager = Platform.getContentTypeManager();
- IContentType contentType = manager.getContentType("org.eclipse.cdt.core.cxxSource"); //$NON-NLS-1$
+ IContentType contentType = manager.getContentType("org.eclipse.cdt.core.cxxSource"); //$NON-NLS-1$
IContentTypeSettings settings = contentType.getSettings(projectScope);
// Add the .c extension on the C++ content type.
- settings.addFileSpec("c", IContentType.FILE_EXTENSION_SPEC); //$NON-NLS-1$
+ settings.addFileSpec("c", IContentType.FILE_EXTENSION_SPEC); //$NON-NLS-1$
}
} catch (CoreException e) {
// Ignore errors. User will need to manually add .c extension if necessary
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject30.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject30.java
index b727cc0311e..1d9258b3dae 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject30.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject30.java
@@ -34,47 +34,47 @@ public class UpdateManagedProject30 {
* @param project the <code>IProject</code> that needs to be upgraded
*/
static void doProjectUpdate(IProgressMonitor monitor, final IProject project) throws CoreException {
- String[] projectName = new String[]{project.getName()};
+ String[] projectName = new String[] { project.getName() };
IFile file = project.getFile(ManagedBuildManager.SETTINGS_FILE_NAME);
File settingsFile = file.getLocation().toFile();
if (!settingsFile.exists()) {
monitor.done();
return;
}
-
+
// Backup the file
monitor.beginTask(ConverterMessages.getFormattedString("UpdateManagedProject20.0", projectName), 1); //$NON-NLS-1$
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
UpdateManagedProjectManager.backupFile(file, "_30backup", monitor, project); //$NON-NLS-1$
- // No physical conversion is need since the 3.1 model is a superset of the 3.0 model
+ // No physical conversion is need since the 3.1 model is a superset of the 3.0 model
// We need to upgrade the version
- ((ManagedBuildInfo)info).setVersion("3.1.0"); //$NON-NLS-1$
-// info.setValid(true);
+ ((ManagedBuildInfo) info).setVersion("3.1.0"); //$NON-NLS-1$
+ // info.setValid(true);
//no need to persist data here
-// // Save the updated file.
-// IWorkspace workspace = project.getWorkspace();
-//// boolean treeLock = workspace.isTreeLocked();
-// ISchedulingRule rule1 = workspace.getRuleFactory().createRule(project);
-// ISchedulingRule rule2 = workspace.getRuleFactory().refreshRule(project);
-// ISchedulingRule rule = MultiRule.combine(rule1, rule2);
-// //since the java synchronized mechanism is now used for the build info loadding,
-// //initiate the job in all cases
-//// if (treeLock) {
-// WorkspaceJob job = new WorkspaceJob(ConverterMessages.getResourceString("UpdateManagedProject.notice")) { //$NON-NLS-1$
-// public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
-// ManagedBuildManager.saveBuildInfo(project, true);
-// return Status.OK_STATUS;
-// }
-// };
-// job.setRule(rule);
-// job.schedule();
-//// } else {
-//// checkForCPPWithC(monitor, project);
-//// ManagedBuildManager.saveBuildInfo(project, true);
-//// }
-// monitor.done();
+ // // Save the updated file.
+ // IWorkspace workspace = project.getWorkspace();
+ //// boolean treeLock = workspace.isTreeLocked();
+ // ISchedulingRule rule1 = workspace.getRuleFactory().createRule(project);
+ // ISchedulingRule rule2 = workspace.getRuleFactory().refreshRule(project);
+ // ISchedulingRule rule = MultiRule.combine(rule1, rule2);
+ // //since the java synchronized mechanism is now used for the build info loadding,
+ // //initiate the job in all cases
+ //// if (treeLock) {
+ // WorkspaceJob job = new WorkspaceJob(ConverterMessages.getResourceString("UpdateManagedProject.notice")) { //$NON-NLS-1$
+ // public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
+ // ManagedBuildManager.saveBuildInfo(project, true);
+ // return Status.OK_STATUS;
+ // }
+ // };
+ // job.setRule(rule);
+ // job.schedule();
+ //// } else {
+ //// checkForCPPWithC(monitor, project);
+ //// ManagedBuildManager.saveBuildInfo(project, true);
+ //// }
+ // monitor.done();
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject31.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject31.java
index 60a5cc3113d..a352707b49a 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject31.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProject31.java
@@ -32,90 +32,90 @@ import org.eclipse.core.runtime.IProgressMonitor;
*/
public class UpdateManagedProject31 {
private static final String INEXISTEND_PROP_ID = ""; //$NON-NLS-1$
-
+
static void doProjectUpdate(IProgressMonitor monitor, final IProject project) throws CoreException {
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
- ((ManagedBuildInfo)info).setVersion(ManagedBuildManager.getBuildInfoVersion().toString());
+ ((ManagedBuildInfo) info).setVersion(ManagedBuildManager.getBuildInfoVersion().toString());
- info.setValid(true);
+ info.setValid(true);
adjustProperties(info);
}
-
- private static void adjustProperties(IManagedBuildInfo info){
+ private static void adjustProperties(IManagedBuildInfo info) {
IManagedProject mProj = info.getManagedProject();
IConfiguration[] cfgs = mProj.getConfigurations();
- for(int i = 0; i < cfgs.length; i++){
+ for (int i = 0; i < cfgs.length; i++) {
adjustProperties(cfgs[i]);
}
}
- private static void adjustProperties(IConfiguration cfg){
+ private static void adjustProperties(IConfiguration cfg) {
IBuildObjectProperties props = cfg.getBuildProperties();
- if(props == null)
+ if (props == null)
return;
-
+
boolean artefactTypeSupported = props.supportsType(ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID);
boolean buildTypeSupported = props.supportsType(ManagedBuildManager.BUILD_TYPE_PROPERTY_ID);
- if(!artefactTypeSupported && !buildTypeSupported)
+ if (!artefactTypeSupported && !buildTypeSupported)
return;
-
+
String artefactType = artefactTypeSupported ? null : INEXISTEND_PROP_ID;
String buildType = buildTypeSupported ? null : INEXISTEND_PROP_ID;
- String artExt = ((Configuration)cfg).getArtifactExtensionAttribute(false);
+ String artExt = ((Configuration) cfg).getArtifactExtensionAttribute(false);
String id = cfg.getId();
- if(artefactType == null){
+ if (artefactType == null) {
artefactType = getBuildArtefactTypeFromId(id);
}
- if(buildType == null){
+ if (buildType == null) {
buildType = getBuildTypeFromId(id);
}
-
- if(artefactType == null || buildType == null){
- for(IToolChain tc = cfg.getToolChain(); tc != null && (artefactType == null || buildType == null); tc = tc.getSuperClass()){
+
+ if (artefactType == null || buildType == null) {
+ for (IToolChain tc = cfg.getToolChain(); tc != null
+ && (artefactType == null || buildType == null); tc = tc.getSuperClass()) {
id = tc.getId();
- if(artefactType == null){
+ if (artefactType == null) {
artefactType = getBuildArtefactTypeFromId(id);
}
- if(buildType == null){
+ if (buildType == null) {
buildType = getBuildTypeFromId(id);
}
}
}
-
- if(artefactType != null && artefactType != INEXISTEND_PROP_ID){
+
+ if (artefactType != null && artefactType != INEXISTEND_PROP_ID) {
try {
props.setProperty(ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID, artefactType);
} catch (CoreException e) {
ManagedBuilderCorePlugin.log(e);
}
}
- if(buildType != null && buildType != INEXISTEND_PROP_ID){
+ if (buildType != null && buildType != INEXISTEND_PROP_ID) {
try {
props.setProperty(ManagedBuildManager.BUILD_TYPE_PROPERTY_ID, buildType);
} catch (CoreException e) {
ManagedBuilderCorePlugin.log(e);
}
}
-
- if(artExt != null)
+
+ if (artExt != null)
cfg.setArtifactExtension(artExt);
}
-
- private static String getBuildArtefactTypeFromId(String id){
- if(id.indexOf(".exe") != -1) //$NON-NLS-1$
+
+ private static String getBuildArtefactTypeFromId(String id) {
+ if (id.indexOf(".exe") != -1) //$NON-NLS-1$
return ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_EXE;
- if(id.indexOf(".so") != -1) //$NON-NLS-1$
+ if (id.indexOf(".so") != -1) //$NON-NLS-1$
return ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_SHAREDLIB;
- if(id.indexOf(".lib") != -1) //$NON-NLS-1$
+ if (id.indexOf(".lib") != -1) //$NON-NLS-1$
return ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_STATICLIB;
return null;
}
- private static String getBuildTypeFromId(String id){
- if(id.indexOf(".debug") != -1) //$NON-NLS-1$
+ private static String getBuildTypeFromId(String id) {
+ if (id.indexOf(".debug") != -1) //$NON-NLS-1$
return ManagedBuildManager.BUILD_TYPE_PROPERTY_DEBUG;
- if(id.indexOf(".release") != -1) //$NON-NLS-1$
+ if (id.indexOf(".release") != -1) //$NON-NLS-1$
return ManagedBuildManager.BUILD_TYPE_PROPERTY_RELEASE;
return null;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProjectManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProjectManager.java
index b0083aa141d..153451b2356 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProjectManager.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/UpdateManagedProjectManager.java
@@ -52,41 +52,42 @@ public class UpdateManagedProjectManager {
static private IOverwriteQuery fOpenQuestionQuery = null;
static private IOverwriteQuery fUpdateProjectQuery = null;
- private ManagedBuildInfo fConvertedInfo= null;
+ private ManagedBuildInfo fConvertedInfo = null;
private boolean fIsInfoReadOnly = false;
final private IProject fProject;
- private UpdateManagedProjectManager(IProject project){
+ private UpdateManagedProjectManager(IProject project) {
fProject = project;
}
- public static void setBackupFileOverwriteQuery(IOverwriteQuery backupFileOverwriteQuery){
+ public static void setBackupFileOverwriteQuery(IOverwriteQuery backupFileOverwriteQuery) {
fBackupFileOverwriteQuery = backupFileOverwriteQuery;
}
-/*
- public static void setOpenQuestionQuery(IOverwriteQuery openQuestionQuery){
- fOpenQuestionQuery = openQuestionQuery;
- }
-*/
- public static void setUpdateProjectQuery(IOverwriteQuery updateProjectQuery){
+
+ /*
+ public static void setOpenQuestionQuery(IOverwriteQuery openQuestionQuery){
+ fOpenQuestionQuery = openQuestionQuery;
+ }
+ */
+ public static void setUpdateProjectQuery(IOverwriteQuery updateProjectQuery) {
fUpdateProjectQuery = updateProjectQuery;
}
- synchronized static private UpdateManagedProjectManager getUpdateManager(IProject project){
+ synchronized static private UpdateManagedProjectManager getUpdateManager(IProject project) {
UpdateManagedProjectManager mngr = getExistingUpdateManager(project);
- if(mngr == null)
+ if (mngr == null)
mngr = createUpdateManager(project);
return mngr;
}
- static private UpdateManagedProjectManager getExistingUpdateManager(IProject project){
+ static private UpdateManagedProjectManager getExistingUpdateManager(IProject project) {
Map<String, UpdateManagedProjectManager> map = getManagerMap(false);
- return map != null ? (UpdateManagedProjectManager)map.get(project.getName()) : null;
+ return map != null ? (UpdateManagedProjectManager) map.get(project.getName()) : null;
}
- static private UpdateManagedProjectManager createUpdateManager(IProject project){
+ static private UpdateManagedProjectManager createUpdateManager(IProject project) {
UpdateManagedProjectManager mngr = new UpdateManagedProjectManager(project);
- getManagerMap(true).put(project.getName(),mngr);
+ getManagerMap(true).put(project.getName(), mngr);
return mngr;
}
@@ -98,16 +99,16 @@ public class UpdateManagedProjectManager {
removeUpdateManager(project);
}
- static private void removeUpdateManager(IProject project){
+ static private void removeUpdateManager(IProject project) {
UpdateManagedProjectManager mngr = getExistingUpdateManager(project);
- if(mngr == null)
+ if (mngr == null)
return;
getManagerMap(false).remove(project.getName());
}
- static private Map<String, UpdateManagedProjectManager> getManagerMap(boolean create){
+ static private Map<String, UpdateManagedProjectManager> getManagerMap(boolean create) {
Map<String, UpdateManagedProjectManager> map = fThreadInfo.get();
- if(map == null && create){
+ if (map == null && create) {
map = new HashMap<String, UpdateManagedProjectManager>();
fThreadInfo.set(map);
}
@@ -117,21 +118,21 @@ public class UpdateManagedProjectManager {
/**
* @since 8.0
*/
- static protected Version getManagedBuildInfoVersion(String version){
- if(version == null)
+ static protected Version getManagedBuildInfoVersion(String version) {
+ if (version == null)
version = "1.2"; //$NON-NLS-1$
return new Version(version);
}
static public boolean isCompatibleProject(IManagedBuildInfo info) {
- if(info == null)
+ if (info == null)
return false;
Version projVersion = getManagedBuildInfoVersion(info.getVersion());
Version compVersion = ManagedBuildManager.getBuildInfoVersion();
- if(compVersion.equals(projVersion))
+ if (compVersion.equals(projVersion))
return true;
return false;
}
@@ -144,32 +145,33 @@ public class UpdateManagedProjectManager {
* @param monitor
* @param project
*/
- static void backupFile(IFile settingsFile, String suffix, IProgressMonitor monitor, IProject project){
+ static void backupFile(IFile settingsFile, String suffix, IProgressMonitor monitor, IProject project) {
UpdateManagedProjectManager mngr = getExistingUpdateManager(project);
- if(mngr == null || mngr.fIsInfoReadOnly)
+ if (mngr == null || mngr.fIsInfoReadOnly)
return;
IContainer destFolder = project;
- IFile dstFile = destFolder.getFile(new Path(settingsFile.getName()+suffix));
- mngr.backupFile(settingsFile, dstFile, monitor, project, fBackupFileOverwriteQuery);
+ IFile dstFile = destFolder.getFile(new Path(settingsFile.getName() + suffix));
+ mngr.backupFile(settingsFile, dstFile, monitor, project, fBackupFileOverwriteQuery);
}
/*
* Creates a back-up file. This method is useful for the vendor who wants
* to create a backup of '.cdtbuild' file before project conversion.
- * @param settingsFile
+ * @param settingsFile
* @param suffix
* @param monitor
* @param project
*/
- public static void backupSettingsFile(IFile settingsFile, String suffix, IProgressMonitor monitor, IProject project){
+ public static void backupSettingsFile(IFile settingsFile, String suffix, IProgressMonitor monitor,
+ IProject project) {
UpdateManagedProjectManager mngr = getUpdateManager(project);
- if(mngr == null || mngr.fIsInfoReadOnly)
+ if (mngr == null || mngr.fIsInfoReadOnly)
return;
IContainer destFolder = project;
- IFile dstFile = destFolder.getFile(new Path(settingsFile.getName()+suffix));
- mngr.backupFile(settingsFile, dstFile, monitor, project, fBackupFileOverwriteQuery);
+ IFile dstFile = destFolder.getFile(new Path(settingsFile.getName() + suffix));
+ mngr.backupFile(settingsFile, dstFile, monitor, project, fBackupFileOverwriteQuery);
}
/* (non-Javadoc)
@@ -181,30 +183,36 @@ public class UpdateManagedProjectManager {
* @param project
* @param query
*/
- private void backupFile(IFile srcFile, IFile dstFile, IProgressMonitor monitor, IProject project, IOverwriteQuery query){
+ private void backupFile(IFile srcFile, IFile dstFile, IProgressMonitor monitor, IProject project,
+ IOverwriteQuery query) {
File src = srcFile.getLocation().toFile();
File dst = dstFile.getLocation().toFile();
backupFile(src, dst, monitor, project, query);
}
- private void backupFile(File srcFile, File dstFile, IProgressMonitor monitor, IProject project, IOverwriteQuery query){
+ private void backupFile(File srcFile, File dstFile, IProgressMonitor monitor, IProject project,
+ IOverwriteQuery query) {
try {
if (dstFile.exists()) {
boolean shouldUpdate;
- if(query != null)
+ if (query != null)
shouldUpdate = ProjectConverter.getBooleanFromQueryAnswer(query.queryOverwrite(dstFile.getName()));
else
- shouldUpdate = ProjectConverter.openQuestion(fProject, "UpdateManagedProjectManager.0", ConverterMessages.getResourceString("UpdateManagedProjectManager.0"), //$NON-NLS-1$ //$NON-NLS-2$
- ConverterMessages.getFormattedString("UpdateManagedProjectManager.1", new String[] {dstFile.getName(),project.getName()}), fOpenQuestionQuery, false); //$NON-NLS-1$
+ shouldUpdate = ProjectConverter.openQuestion(fProject, "UpdateManagedProjectManager.0", //$NON-NLS-1$
+ ConverterMessages.getResourceString("UpdateManagedProjectManager.0"), //$NON-NLS-1$
+ ConverterMessages.getFormattedString("UpdateManagedProjectManager.1", //$NON-NLS-1$
+ new String[] { dstFile.getName(), project.getName() }),
+ fOpenQuestionQuery, false);
if (shouldUpdate) {
dstFile.delete();
} else {
- throw new OperationCanceledException(ConverterMessages.getFormattedString("UpdateManagedProjectManager.2", project.getName())); //$NON-NLS-1$
+ throw new OperationCanceledException(
+ ConverterMessages.getFormattedString("UpdateManagedProjectManager.2", project.getName())); //$NON-NLS-1$
}
}
copyFile(srcFile, dstFile);
- } catch(Exception e){
+ } catch (Exception e) {
fIsInfoReadOnly = true;
}
}
@@ -234,42 +242,43 @@ public class UpdateManagedProjectManager {
}
}
- private void restoreFile(String backupFileName, String restoreFileName, IProgressMonitor monitor, IProject project){
+ private void restoreFile(String backupFileName, String restoreFileName, IProgressMonitor monitor,
+ IProject project) {
IContainer destFolder = project;
File restoreFile = destFolder.getFile(new Path(restoreFileName)).getLocation().toFile();
File backupFile = destFolder.getFile(new Path(backupFileName)).getLocation().toFile();
- try{
+ try {
if (restoreFile.exists()) {
restoreFile.delete();
}
copyFile(backupFile, restoreFile);
- } catch(Exception e){
+ } catch (Exception e) {
fIsInfoReadOnly = true;
}
}
-// static private boolean openQuestion(IResource rc, final String title, final String message){
-// return ProjectConverter.openQuestion(rc, message, title, message, fOpenQuestionQuery, false);
-// }
-
-// static public void openInformation(final String title, final String message){
-// if(fOpenQuestionQuery != null)
-// return;// getBooleanFromQueryAnswer(fOpenQuestionQuery.queryOverwrite(message));
-//
-// IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-// if(window == null){
-// IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows();
-// window = windows[0];
-// }
-//
-// final Shell shell = window.getShell();
-// shell.getDisplay().syncExec(new Runnable() {
-// public void run() {
-// MessageDialog.openInformation(shell,title,message);
-// }
-// });
-// }
+ // static private boolean openQuestion(IResource rc, final String title, final String message){
+ // return ProjectConverter.openQuestion(rc, message, title, message, fOpenQuestionQuery, false);
+ // }
+
+ // static public void openInformation(final String title, final String message){
+ // if(fOpenQuestionQuery != null)
+ // return;// getBooleanFromQueryAnswer(fOpenQuestionQuery.queryOverwrite(message));
+ //
+ // IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ // if(window == null){
+ // IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows();
+ // window = windows[0];
+ // }
+ //
+ // final Shell shell = window.getShell();
+ // shell.getDisplay().syncExec(new Runnable() {
+ // public void run() {
+ // MessageDialog.openInformation(shell,title,message);
+ // }
+ // });
+ // }
/**
* returns ManagedBuildInfo for the current project
@@ -278,14 +287,14 @@ public class UpdateManagedProjectManager {
* @return the pointer to the project ManagedBuildInfo or null
* if converter is no running
*/
- static public ManagedBuildInfo getConvertedManagedBuildInfo(IProject project){
+ static public ManagedBuildInfo getConvertedManagedBuildInfo(IProject project) {
UpdateManagedProjectManager mngr = getExistingUpdateManager(project);
- if(mngr == null)
+ if (mngr == null)
return null;
return mngr.getConvertedManagedBuildInfo();
}
- private ManagedBuildInfo getConvertedManagedBuildInfo(){
+ private ManagedBuildInfo getConvertedManagedBuildInfo() {
return fConvertedInfo;
}
@@ -293,84 +302,84 @@ public class UpdateManagedProjectManager {
fConvertedInfo = info;
}
- private void doProjectUpdate(ManagedBuildInfo info)
- throws CoreException {
+ private void doProjectUpdate(ManagedBuildInfo info) throws CoreException {
fConvertedInfo = info;
NullProgressMonitor monitor = new NullProgressMonitor();
IFile settingsFile = fProject.getFile(ManagedBuildManager.SETTINGS_FILE_NAME);
IFile backupFile = fProject.getFile(ManagedBuildManager.SETTINGS_FILE_NAME + "_initial"); //$NON-NLS-1$
- if(isCompatibleProject(info))
+ if (isCompatibleProject(info))
return;
try {
if (!settingsFile.getLocation().toFile().exists())
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
- ConverterMessages.getResourceString("UpdateManagedProjectManager.6"),null)); //$NON-NLS-1$
+ ConverterMessages.getResourceString("UpdateManagedProjectManager.6"), null)); //$NON-NLS-1$
-
- backupFile(settingsFile, backupFile, monitor, fProject, new IOverwriteQuery(){
- @Override
- public String queryOverwrite(String file) {
- return ALL;
- }
- });
+ backupFile(settingsFile, backupFile, monitor, fProject, new IOverwriteQuery() {
+ @Override
+ public String queryOverwrite(String file) {
+ return ALL;
+ }
+ });
Version version = getManagedBuildInfoVersion(info.getVersion());
boolean shouldUpdate;
- if(fUpdateProjectQuery != null)
- shouldUpdate = ProjectConverter.getBooleanFromQueryAnswer(fUpdateProjectQuery.queryOverwrite(fProject.getFullPath().toString()));
+ if (fUpdateProjectQuery != null)
+ shouldUpdate = ProjectConverter.getBooleanFromQueryAnswer(
+ fUpdateProjectQuery.queryOverwrite(fProject.getFullPath().toString()));
else
- shouldUpdate = ProjectConverter.openQuestion(fProject, "UpdateManagedProjectManager.3", ConverterMessages.getResourceString("UpdateManagedProjectManager.3"), //$NON-NLS-1$ //$NON-NLS-2$
- ConverterMessages.getFormattedString("UpdateManagedProjectManager.4", new String[]{fProject.getName(),version.toString(),ManagedBuildManager.getBuildInfoVersion().toString()}), //$NON-NLS-1$
- fOpenQuestionQuery, false);
-
- if (!shouldUpdate){
+ shouldUpdate = ProjectConverter.openQuestion(fProject, "UpdateManagedProjectManager.3", //$NON-NLS-1$
+ ConverterMessages.getResourceString("UpdateManagedProjectManager.3"), //$NON-NLS-1$
+ ConverterMessages.getFormattedString("UpdateManagedProjectManager.4", //$NON-NLS-1$
+ new String[] { fProject.getName(), version.toString(),
+ ManagedBuildManager.getBuildInfoVersion().toString() }),
+ fOpenQuestionQuery, false);
+
+ if (!shouldUpdate) {
fIsInfoReadOnly = true;
- throw new CoreException(new Status(IStatus.CANCEL, ManagedBuilderCorePlugin.getUniqueIdentifier(), ConverterMessages.getResourceString("UpdateManagedProjectManager.7"))); //$NON-NLS-1$
+ throw new CoreException(new Status(IStatus.CANCEL, ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ ConverterMessages.getResourceString("UpdateManagedProjectManager.7"))); //$NON-NLS-1$
}
IFile projectFile = fProject.getFile(".project"); //$NON-NLS-1$
- if(projectFile.exists())
+ if (projectFile.exists())
backupFile(projectFile, "_initial", monitor, fProject); //$NON-NLS-1$
- if(version.equals(new Version(1,2,0))){
+ if (version.equals(new Version(1, 2, 0))) {
UpdateManagedProject12.doProjectUpdate(monitor, fProject);
version = getManagedBuildInfoVersion(info.getVersion());
}
- if(version.equals(new Version(2,0,0))){
+ if (version.equals(new Version(2, 0, 0))) {
UpdateManagedProject20.doProjectUpdate(monitor, fProject);
version = getManagedBuildInfoVersion(info.getVersion());
}
- if(version.equals(new Version(2,1,0))){
+ if (version.equals(new Version(2, 1, 0))) {
UpdateManagedProject21.doProjectUpdate(monitor, fProject);
version = getManagedBuildInfoVersion(info.getVersion());
}
- if(version.equals(new Version(3,0,0))){
+ if (version.equals(new Version(3, 0, 0))) {
UpdateManagedProject30.doProjectUpdate(monitor, fProject);
version = getManagedBuildInfoVersion(info.getVersion());
}
- if (new Version(4,0,0).compareTo(version)>0){
+ if (new Version(4, 0, 0).compareTo(version) > 0) {
UpdateManagedProject31.doProjectUpdate(monitor, fProject);
version = getManagedBuildInfoVersion(info.getVersion());
}
- if(!isCompatibleProject(info)){
+ if (!isCompatibleProject(info)) {
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
- ConverterMessages.getFormattedString("UpdateManagedProjectManager.5", //$NON-NLS-1$
- new String [] {
- ManagedBuildManager.getBuildInfoVersion().toString(),
- version.toString(),
- info.getManagedProject().getId()
- }
- ),null));
+ ConverterMessages.getFormattedString("UpdateManagedProjectManager.5", //$NON-NLS-1$
+ new String[] { ManagedBuildManager.getBuildInfoVersion().toString(), version.toString(),
+ info.getManagedProject().getId() }),
+ null));
}
} catch (CoreException e) {
fIsInfoReadOnly = true;
throw e;
- } finally{
- if(fIsInfoReadOnly){
+ } finally {
+ if (fIsInfoReadOnly) {
restoreFile(backupFile.getName(), settingsFile.getName(), monitor, fProject);
info.setReadOnly(true);
}
@@ -384,8 +393,7 @@ public class UpdateManagedProjectManager {
* @param info the ManagedBuildInfo for the current project
* @throws CoreException if conversion failed
*/
- static public void updateProject(final IProject project, ManagedBuildInfo info)
- throws CoreException{
+ static public void updateProject(final IProject project, ManagedBuildInfo info) throws CoreException {
try {
getUpdateManager(project).doProjectUpdate(info);
} finally {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/scannerconfig/IManagedScannerInfoCollector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/scannerconfig/IManagedScannerInfoCollector.java
index b39e6323471..0bd33476c8c 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/scannerconfig/IManagedScannerInfoCollector.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/scannerconfig/IManagedScannerInfoCollector.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM - Initial API and implementation
*******************************************************************************/
@@ -25,27 +25,26 @@ import org.eclipse.core.resources.IProject;
*/
public interface IManagedScannerInfoCollector extends IScannerInfoCollector {
/**
- * Answers a map of collected defines that the the compiler uses by default.
- * The symbols are defined in the map as a (macro, value) pair as follows
+ * Answers a map of collected defines that the the compiler uses by default.
+ * The symbols are defined in the map as a (macro, value) pair as follows
* <p><p><code>-DFOO</code> will be stored as ("FOO","")
* <p><code>-DFOO=BAR</code> will be stored as ("FOO","BAR")
- * <p><p>Duplicates will not be stored in the map and any whitespaces in
+ * <p><p>Duplicates will not be stored in the map and any whitespaces in
* the macro or value will be trimmed out.
- *
+ *
* @return a <code>Map</code> of defined symbols and values
*/
public Map<String, String> getDefinedSymbols();
-
-
+
/**
- * Answers a <code>List</code> of unique built-in includes paths that have been
- * collected for the receiver. The paths are stored as <code>String</code> in the proper
- * format for the host tools.
- *
- * @return a <code>List</code> of built-in compiler include search paths.
+ * Answers a <code>List</code> of unique built-in includes paths that have been
+ * collected for the receiver. The paths are stored as <code>String</code> in the proper
+ * format for the host tools.
+ *
+ * @return a <code>List</code> of built-in compiler include search paths.
*/
public List<String> getIncludePaths();
-
+
/**
* Sets the <code>IProject</code> for the receiver.
*/
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/CompatibilityStatus.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/CompatibilityStatus.java
index 98dd88651e0..5252e35f067 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/CompatibilityStatus.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/CompatibilityStatus.java
@@ -18,46 +18,46 @@ import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
import org.eclipse.cdt.managedbuilder.internal.tcmodification.ConflictSet;
import org.eclipse.core.runtime.Status;
-
public final class CompatibilityStatus extends Status {
- public static final CompatibilityStatus OK_COMPATIBILITY_STATUS = new CompatibilityStatus(OK, ManagedBuilderCorePlugin.getUniqueIdentifier(), ""); //$NON-NLS-1$
-
+ public static final CompatibilityStatus OK_COMPATIBILITY_STATUS = new CompatibilityStatus(OK,
+ ManagedBuilderCorePlugin.getUniqueIdentifier(), ""); //$NON-NLS-1$
+
private ConflictSet fConflictSet;
-// private CompatibilityStatus(int severity, String pluginId, int code,
-// String message, Throwable exception) {
-// super(severity, pluginId, code, message, exception);
-// }
+ // private CompatibilityStatus(int severity, String pluginId, int code,
+ // String message, Throwable exception) {
+ // super(severity, pluginId, code, message, exception);
+ // }
-// private CompatibilityStatus(int severity, String pluginId, String message,
-// Throwable exception) {
-// super(severity, pluginId, message, exception);
-// }
+ // private CompatibilityStatus(int severity, String pluginId, String message,
+ // Throwable exception) {
+ // super(severity, pluginId, message, exception);
+ // }
private CompatibilityStatus(int severity, String pluginId, String message) {
super(severity, pluginId, message);
}
-
+
public CompatibilityStatus(int severity, String message, ConflictSet cs) {
this(severity, ManagedBuilderCorePlugin.getUniqueIdentifier(), message);
-
+
fConflictSet = cs;
}
-
- public IConflict[] getConflicts(){
+
+ public IConflict[] getConflicts() {
return fConflictSet != null ? fConflictSet.getConflicts() : ConflictSet.EMPTY_CONFLICT_ARRAY;
}
-
- public IConflict[] getConflictsWith(int objectType){
+
+ public IConflict[] getConflictsWith(int objectType) {
return fConflictSet != null ? fConflictSet.getConflictsWith(objectType) : ConflictSet.EMPTY_CONFLICT_ARRAY;
}
-
- public IBuildObject[] getConflictingObjects(int objectType){
+
+ public IBuildObject[] getConflictingObjects(int objectType) {
return fConflictSet != null ? fConflictSet.getConflictingObjects(objectType) : ConflictSet.EMPTY_BO_ARRAY;
}
-
- public IConflict getConflictWith(IBuildObject bo){
+
+ public IConflict getConflictWith(IBuildObject bo) {
return fConflictSet != null ? fConflictSet.getConflictWith(bo) : null;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IApplicableModification.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IApplicableModification.java
index fa9f1cd1eb7..1458c3654b4 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IApplicableModification.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IApplicableModification.java
@@ -15,7 +15,6 @@ package org.eclipse.cdt.managedbuilder.tcmodification;
import org.eclipse.core.runtime.CoreException;
-
/**
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
@@ -23,7 +22,7 @@ import org.eclipse.core.runtime.CoreException;
public interface IApplicableModification extends IModification {
/**
* applies the settings made to the given modification to the underlying
- * resource info
+ * resource info
*/
void apply() throws CoreException;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IConfigurationModification.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IConfigurationModification.java
index baf6348783b..03329ecadc2 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IConfigurationModification.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IConfigurationModification.java
@@ -24,30 +24,30 @@ public interface IConfigurationModification extends IFolderInfoModification {
* @return a builder currently assigned to this Configuration Modification
*/
IBuilder getBuilder();
-
+
IBuilder getRealBuilder();
-
+
/**
- * @return a set of compatible builders
+ * @return a set of compatible builders
*/
IBuilder[] getCompatibleBuilders();
-
+
/**
* @return the compatibility status for the builder
*/
CompatibilityStatus getBuilderCompatibilityStatus();
-
+
/**
- * @return the compatibility status for the builder,
+ * @return the compatibility status for the builder,
* i.e. true when the getCompatibilityStatus() returns an non-ERROR status,
* and false otherwise
*/
boolean isBuilderCompatible();
-
+
/**
* sets the builder to this Configuration Modification
* Note that this does NOT apply the builder to the underlying configuration
- * For applying the Modification settings the {@link IApplicableModification#apply()}
+ * For applying the Modification settings the {@link IApplicableModification#apply()}
* method should be called
*/
void setBuilder(IBuilder builder);
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IConflict.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IConflict.java
index fd29241b667..55e9c26ab32 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IConflict.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IConflict.java
@@ -23,13 +23,12 @@ import org.eclipse.core.runtime.IPath;
public interface IConflict {
int INCOMPATIBLE = 1;
int SOURCE_EXT_CONFLICT = 1 << 1;
-
+
int getConflictType();
-
+
int getObjectType();
-
+
IBuildObject getBuildObject();
-
-
+
IPath[] getPaths();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IFolderInfoModification.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IFolderInfoModification.java
index 4b64bb91bd3..2dd12aee6d9 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IFolderInfoModification.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IFolderInfoModification.java
@@ -25,19 +25,19 @@ public interface IFolderInfoModification extends IToolListModification {
* @return a set of tool-chains compatible with the current one
*/
IToolChain[] getCompatibleToolChains();
-
+
/**
- * @return compatibility status for the current tool-chain
+ * @return compatibility status for the current tool-chain
*/
CompatibilityStatus getToolChainCompatibilityStatus();
-
+
/**
* @return whether the current tool-chain is compatible,
* i.e. whether the {@link #getToolChainCompatibilityStatus()} returns a
* non-ERROR status
*/
boolean isToolChainCompatible();
-
+
/**
* @return the current tool-chain
*/
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IModificationOperation.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IModificationOperation.java
index 6ab3ccfce44..02922001c73 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IModificationOperation.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IModificationOperation.java
@@ -29,7 +29,7 @@ public interface IModificationOperation {
* to be replaced with the system tool
*/
ITool getReplacementTool();
-
+
/**
* returns the containing {@link IToolModification}
*/
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IToolChainModificationManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IToolChainModificationManager.java
index c8232ccf458..f063cef9347 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IToolChainModificationManager.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IToolChainModificationManager.java
@@ -27,7 +27,7 @@ public interface IToolChainModificationManager {
int OBJECT_TOOLCHAIN = IRealBuildObjectAssociation.OBJECT_TOOLCHAIN;
int OBJECT_TOOL = IRealBuildObjectAssociation.OBJECT_TOOL;
int OBJECT_BUILDER = IRealBuildObjectAssociation.OBJECT_BUILDER;
-
+
/**
* returns the modification info calculator for the given folder info
* if the folder info is a root folder info,
@@ -39,8 +39,10 @@ public interface IToolChainModificationManager {
* returns the modification info calculator for the given file info
*/
IFileInfoModification createModification(IFileInfo rcInfo);
-
- IFolderInfoModification createModification(IConfiguration cfg, IFolderInfoModification base) throws IllegalArgumentException;
- IFileInfoModification createModification(IConfiguration cfg, IFileInfoModification base) throws IllegalArgumentException;
+ IFolderInfoModification createModification(IConfiguration cfg, IFolderInfoModification base)
+ throws IllegalArgumentException;
+
+ IFileInfoModification createModification(IConfiguration cfg, IFileInfoModification base)
+ throws IllegalArgumentException;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IToolListModification.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IToolListModification.java
index 18cb14c3a1a..acd7a530dde 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IToolListModification.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IToolListModification.java
@@ -29,7 +29,7 @@ public interface IToolListModification extends IApplicableModification {
* For applying the settings the {@link IApplicableModification#apply()} method should be called
*/
void changeProjectTools(ITool removeTools, ITool addTool);
-
+
/**
* returns the list of tools assigned to the given resource info
* on the ToolListModificatrion creation the tool-list is the one
@@ -38,17 +38,17 @@ public interface IToolListModification extends IApplicableModification {
*/
ITool[] getProjectTools();
-// ITool[] getSystemTools();
+ // ITool[] getSystemTools();
/**
- * returns a list of tool modifications for all project tools contained
- * by this toollist modification
+ * returns a list of tool modifications for all project tools contained
+ * by this toollist modification
*/
IToolModification[] getProjectToolModifications();
/**
- * returns a list of tool modifications for all system tools not contained
- * by this toollist modification
+ * returns a list of tool modifications for all system tools not contained
+ * by this toollist modification
*/
IToolModification[] getSystemToolModifications();
@@ -60,6 +60,6 @@ public interface IToolListModification extends IApplicableModification {
* given system tool
*/
IToolModification getToolModification(ITool tool);
-
+
void restoreDefaults();
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IToolModification.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IToolModification.java
index 642c79cf0f9..63eb48774fa 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IToolModification.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/tcmodification/IToolModification.java
@@ -28,29 +28,29 @@ public interface IToolModification extends IModification {
* configuration
*/
CompatibilityStatus getCompatibilityStatus();
-
+
/**
- * returns the compatibility status for this tool,
+ * returns the compatibility status for this tool,
* i.e. true when the getCompatibilityStatus() returns an non-ERROR status,
* and false otherwise
- *
+ *
* for project tools specifies whether the tool is compatible
* with the configuration
* for system tools specifies whether the tool can be added to the
* configuration
*/
boolean isCompatible();
-
+
/**
- * returns the tool of the given Modification
+ * returns the tool of the given Modification
*/
ITool getTool();
-
+
/**
* specifies whether the current tools belongs to the resource configuration
*/
boolean isProjectTool();
-
+
/**
* returns the list of supported operations
*/
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/CreateProjectProgressMonitor.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/CreateProjectProgressMonitor.java
index 62d7da48f44..f3935fef5e5 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/CreateProjectProgressMonitor.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/CreateProjectProgressMonitor.java
@@ -28,16 +28,16 @@ public class CreateProjectProgressMonitor extends NullProgressMonitor {
public CreateProjectProgressMonitor() {
super();
}
-
+
public CreateProjectProgressMonitor(String taskName) {
super();
super.setTaskName(taskName);
}
-
+
/**
* Override this method to do something
* with the name of the task.
- *
+ *
* @see IProgressMonitor#setTaskName(String)
*/
@Override
@@ -57,7 +57,7 @@ public class CreateProjectProgressMonitor extends NullProgressMonitor {
}
/**
- * This implementation returns the value of the internal
+ * This implementation returns the value of the internal
* state variable set by <code>setCanceled</code>.
*
* @see IProgressMonitor#isCanceled()
@@ -68,6 +68,4 @@ public class CreateProjectProgressMonitor extends NullProgressMonitor {
return super.isCanceled();
}
-
-
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/ProjectCreatedActions.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/ProjectCreatedActions.java
index e548d991766..6762c2df814 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/ProjectCreatedActions.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/ProjectCreatedActions.java
@@ -49,10 +49,10 @@ import org.eclipse.core.runtime.Preferences;
/**
* This class is a helper for creating general CDT projects
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
- *
+ *
* Note that this class is used by ISVs, see bug 318063.
*/
public class ProjectCreatedActions {
@@ -62,15 +62,16 @@ public class ProjectCreatedActions {
String artifactExtension;
private static final String PROPERTY = "org.eclipse.cdt.build.core.buildType"; //$NON-NLS-1$
private static final String PROP_VAL = PROPERTY + ".debug"; //$NON-NLS-1$
-
+
/*
* create a project and do things common to project creationr from the new project
* wizard.
*/
- public ProjectCreatedActions() {}
+ public ProjectCreatedActions() {
+ }
Map<IConfiguration, IConfiguration> original2newConfigs;
-
+
/**
* Utility method that
* <ul>
@@ -78,11 +79,12 @@ public class ProjectCreatedActions {
* <li>Autoexpands the project in the C/C++ Projects view
* </ul>
* <p>
- *
+ *
* @return an IManagedBuildInfo instance (from which the IManagedProject can be retrieved)
*/
- public IManagedBuildInfo createProject(IProgressMonitor monitor, String indexerId, boolean isCProject) throws CoreException, BuildException {
- if(!areFieldsValid()) {
+ public IManagedBuildInfo createProject(IProgressMonitor monitor, String indexerId, boolean isCProject)
+ throws CoreException, BuildException {
+ if (!areFieldsValid()) {
throw new IllegalArgumentException(Messages.ProjectCreatedActions_insufficient_information);
}
@@ -101,7 +103,7 @@ public class ProjectCreatedActions {
if (!project.isOpen()) {
project.open(monitor);
}
-
+
if (isCProject) {
CProjectNature.addCNature(project, monitor);
} else {
@@ -115,14 +117,16 @@ public class ProjectCreatedActions {
ManagedProject newManagedProject = new ManagedProject(project, configs[0].getProjectType());
info.setManagedProject(newManagedProject);
- original2newConfigs = new HashMap<IConfiguration,IConfiguration>();
+ original2newConfigs = new HashMap<IConfiguration, IConfiguration>();
ICConfigurationDescription active = null;
for (IConfiguration cfg : configs) {
if (cfg != null) {
String id = ManagedBuildManager.calculateChildId(cfg.getId(), null);
- Configuration configuration = new Configuration(newManagedProject, (Configuration)cfg, id, false, true);
+ Configuration configuration = new Configuration(newManagedProject, (Configuration) cfg, id, false,
+ true);
CConfigurationData data = configuration.getConfigurationData();
- ICConfigurationDescription cfgDes = des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
+ ICConfigurationDescription cfgDes = des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID,
+ data);
configuration.setConfigurationDescription(cfgDes);
configuration.exportArtifactInfo();
configuration.setArtifactExtension(artifactExtension);
@@ -130,21 +134,22 @@ public class ProjectCreatedActions {
IBuilder builder = configuration.getEditableBuilder();
if (builder != null) {
- builder.setManagedBuildOn(builder.isManagedBuildOn());
+ builder.setManagedBuildOn(builder.isManagedBuildOn());
}
configuration.setName(cfg.getName());
configuration.setArtifactName(newManagedProject.getDefaultArtifactName());
IBuildProperty buildProperty = configuration.getBuildProperties().getProperty(PROPERTY);
- if (buildProperty != null && buildProperty.getValue() != null && PROP_VAL.equals(buildProperty.getValue().getId())) {
+ if (buildProperty != null && buildProperty.getValue() != null
+ && PROP_VAL.equals(buildProperty.getValue().getId())) {
active = cfgDes;
- } else if (active == null) {// select at least first configuration
+ } else if (active == null) {// select at least first configuration
active = cfgDes;
}
}
}
-
+
if (active != null) {
active.setActive();
}
@@ -162,18 +167,18 @@ public class ProjectCreatedActions {
// An attempt is made to do this earlier when the project is being
// created, but the build info may not be ready then.
CCorePlugin.getDefault().getCProjectDescription(project, false).get(CCorePlugin.BINARY_PARSER_UNIQ_ID, true);
-
+
return info;
}
-
+
protected boolean areFieldsValid() {
- return project!=null && configs!=null && artifactExtension!=null;
+ return project != null && configs != null && artifactExtension != null;
}
-
+
public IConfiguration getNewConfiguration(IConfiguration original) {
return original2newConfigs.get(original);
}
-
+
public Set<IConfiguration> getNewConfigurations(Collection<IConfiguration> originalConfigs) {
Set<IConfiguration> result = new HashSet<IConfiguration>();
for (IConfiguration cfg : originalConfigs) {
@@ -181,7 +186,7 @@ public class ProjectCreatedActions {
}
return result;
}
-
+
/**
* Chooses the IConfiguration which should be considered the project default.
* @param configs an array containing each of the newly created IConfigurations
@@ -198,7 +203,6 @@ public class ProjectCreatedActions {
this.artifactExtension = artifactExtension;
}
-
/**
* @return the configs
*/
@@ -206,7 +210,6 @@ public class ProjectCreatedActions {
return configs;
}
-
/**
* @param configs the configs to set
*/
@@ -214,7 +217,6 @@ public class ProjectCreatedActions {
this.configs = configs;
}
-
/**
* @return the project
*/
@@ -222,7 +224,6 @@ public class ProjectCreatedActions {
return project;
}
-
/**
* @param project the project to set
*/
@@ -230,7 +231,6 @@ public class ProjectCreatedActions {
this.project = project;
}
-
/**
* @return the projectLocation
*/
@@ -238,7 +238,6 @@ public class ProjectCreatedActions {
return projectLocation;
}
-
/**
* @param projectLocation the projectLocation to set
*/
@@ -246,7 +245,6 @@ public class ProjectCreatedActions {
this.projectLocation = projectLocation;
}
-
protected IConfiguration createNewConfiguration(IManagedProject managedProject, IConfiguration config) {
return managedProject.createConfiguration(config, config.getId() + "." + ManagedBuildManager.getRandomNumber()); //$NON-NLS-1$
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/AddLanguageSettingsProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/AddLanguageSettingsProvider.java
index 21bc7f875c1..2833edef3d1 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/AddLanguageSettingsProvider.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/AddLanguageSettingsProvider.java
@@ -53,7 +53,8 @@ public class AddLanguageSettingsProvider extends ProcessRunner {
private static final String PROVIDERS_VARNAME = "languageSettingsProviderIds"; //$NON-NLS-1$
@Override
- public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor) throws ProcessFailureException {
+ public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor)
+ throws ProcessFailureException {
IProject project = null;
String[] extraProviderIds = null;
@@ -61,7 +62,7 @@ public class AddLanguageSettingsProvider extends ProcessRunner {
String argName = arg.getName();
if (PROJECTNAME_VARNAME.equals(argName))
project = ResourcesPlugin.getWorkspace().getRoot().getProject(arg.getSimpleValue());
- else if(PROVIDERS_VARNAME.equals(argName))
+ else if (PROVIDERS_VARNAME.equals(argName))
extraProviderIds = arg.getSimpleArrayValue();
}
@@ -90,7 +91,7 @@ public class AddLanguageSettingsProvider extends ProcessRunner {
try {
mngr.setProjectDescription(project, des);
- } catch(CoreException e) {
+ } catch (CoreException e) {
ManagedBuilderCorePlugin.log(e);
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/AppendToMBSStringListOptionValues.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/AppendToMBSStringListOptionValues.java
index 944b8e3fd8c..75dea0ce400 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/AppendToMBSStringListOptionValues.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/AppendToMBSStringListOptionValues.java
@@ -36,7 +36,6 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-
/**
* This class Appends contents to Managed Build System StringList Option Values.
*
@@ -49,7 +48,8 @@ public class AppendToMBSStringListOptionValues extends ProcessRunner {
* This method Appends contents to Managed Build System StringList Option Values.
*/
@Override
- public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor) throws ProcessFailureException {
+ public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor)
+ throws ProcessFailureException {
String projectName = args[0].getSimpleValue();
IProject projectHandle = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
IWorkspace workspace = ResourcesPlugin.getWorkspace();
@@ -70,7 +70,8 @@ public class AppendToMBSStringListOptionValues extends ProcessRunner {
try {
modified |= setOptionValue(projectHandle, id, values, path);
} catch (BuildException e) {
- throw new ProcessFailureException(Messages.getString("AppendToMBSStringListOptionValues.0") + e.getMessage(), e); //$NON-NLS-1$
+ throw new ProcessFailureException(
+ Messages.getString("AppendToMBSStringListOptionValues.0") + e.getMessage(), e); //$NON-NLS-1$
}
}
if (modified) {
@@ -84,8 +85,10 @@ public class AppendToMBSStringListOptionValues extends ProcessRunner {
}
}
- private boolean setOptionValue(IProject projectHandle, String id, String[] value, String path) throws BuildException, ProcessFailureException {
- IConfiguration[] projectConfigs = ManagedBuildManager.getBuildInfo(projectHandle).getManagedProject().getConfigurations();
+ private boolean setOptionValue(IProject projectHandle, String id, String[] value, String path)
+ throws BuildException, ProcessFailureException {
+ IConfiguration[] projectConfigs = ManagedBuildManager.getBuildInfo(projectHandle).getManagedProject()
+ .getConfigurations();
boolean resource = !(path == null || path.isEmpty() || path.equals("/")); //$NON-NLS-1$
boolean modified = false;
@@ -97,7 +100,8 @@ public class AppendToMBSStringListOptionValues extends ProcessRunner {
if (resourceConfig == null) {
IFile file = projectHandle.getFile(path);
if (file == null) {
- throw new ProcessFailureException(Messages.getString("AppendToMBSStringListOptionValues.3") + path); //$NON-NLS-1$
+ throw new ProcessFailureException(
+ Messages.getString("AppendToMBSStringListOptionValues.3") + path); //$NON-NLS-1$
}
resourceConfig = config.createResourceConfiguration(file);
}
@@ -119,12 +123,13 @@ public class AppendToMBSStringListOptionValues extends ProcessRunner {
return modified;
}
- private boolean setOptionForResourceConfig(String id, String[] value, IResourceConfiguration resourceConfig, IOption[] options, IHoldsOptions optionHolder) throws BuildException {
+ private boolean setOptionForResourceConfig(String id, String[] value, IResourceConfiguration resourceConfig,
+ IOption[] options, IHoldsOptions optionHolder) throws BuildException {
boolean modified = false;
String lowerId = id.toLowerCase();
for (IOption option : options) {
if (option.getBaseId().toLowerCase().matches(lowerId)) {
- switch(option.getValueType()) {
+ switch (option.getValueType()) {
case IOption.STRING_LIST:
case IOption.INCLUDE_PATH:
case IOption.PREPROCESSOR_SYMBOLS:
@@ -135,8 +140,8 @@ public class AppendToMBSStringListOptionValues extends ProcessRunner {
case IOption.LIBRARY_FILES:
case IOption.MACRO_FILES:
@SuppressWarnings("unchecked")
- List<String> list= (List<String>) option.getValue();
- String[] newValue= concat(list.toArray(new String[list.size()]), value);
+ List<String> list = (List<String>) option.getValue();
+ String[] newValue = concat(list.toArray(new String[list.size()]), value);
ManagedBuildManager.setOption(resourceConfig, optionHolder, option, newValue);
modified = true;
}
@@ -145,12 +150,13 @@ public class AppendToMBSStringListOptionValues extends ProcessRunner {
return modified;
}
- private boolean setOptionForConfig(String id, String[] value, IConfiguration config, IOption[] options, IHoldsOptions optionHolder) throws BuildException {
+ private boolean setOptionForConfig(String id, String[] value, IConfiguration config, IOption[] options,
+ IHoldsOptions optionHolder) throws BuildException {
boolean modified = false;
String lowerId = id.toLowerCase();
for (IOption option : options) {
if (option.getBaseId().toLowerCase().matches(lowerId)) {
- switch(option.getValueType()) {
+ switch (option.getValueType()) {
case IOption.STRING_LIST:
case IOption.INCLUDE_PATH:
case IOption.PREPROCESSOR_SYMBOLS:
@@ -161,8 +167,8 @@ public class AppendToMBSStringListOptionValues extends ProcessRunner {
case IOption.LIBRARY_FILES:
case IOption.MACRO_FILES:
@SuppressWarnings("unchecked")
- List<String> list= (List<String>) option.getValue();
- String[] newValue= concat(list.toArray(new String[list.size()]), value);
+ List<String> list = (List<String>) option.getValue();
+ String[] newValue = concat(list.toArray(new String[list.size()]), value);
ManagedBuildManager.setOption(config, optionHolder, option, newValue);
modified = true;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/AppendToMBSStringOptionValue.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/AppendToMBSStringOptionValue.java
index b546e258d22..487cd83506e 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/AppendToMBSStringOptionValue.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/AppendToMBSStringOptionValue.java
@@ -34,7 +34,6 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-
/**
* This class Appends contents to Managed Build System String Option Value.
*
@@ -47,7 +46,8 @@ public class AppendToMBSStringOptionValue extends ProcessRunner {
* This method Appends contents to Managed Build System StringList Option Values.
*/
@Override
- public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor) throws ProcessFailureException {
+ public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor)
+ throws ProcessFailureException {
String projectName = args[0].getSimpleValue();
IProject projectHandle = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
IWorkspace workspace = ResourcesPlugin.getWorkspace();
@@ -69,7 +69,8 @@ public class AppendToMBSStringOptionValue extends ProcessRunner {
try {
modified |= setOptionValue(projectHandle, id, value, path);
} catch (BuildException e) {
- throw new ProcessFailureException(Messages.getString("AppendToMBSStringOptionValue.0") + e.getMessage(), e); //$NON-NLS-1$
+ throw new ProcessFailureException(Messages.getString("AppendToMBSStringOptionValue.0") + e.getMessage(), //$NON-NLS-1$
+ e);
}
}
if (modified) {
@@ -83,8 +84,10 @@ public class AppendToMBSStringOptionValue extends ProcessRunner {
}
}
- private boolean setOptionValue(IProject projectHandle, String id, String value, String path) throws BuildException, ProcessFailureException {
- IConfiguration[] projectConfigs = ManagedBuildManager.getBuildInfo(projectHandle).getManagedProject().getConfigurations();
+ private boolean setOptionValue(IProject projectHandle, String id, String value, String path)
+ throws BuildException, ProcessFailureException {
+ IConfiguration[] projectConfigs = ManagedBuildManager.getBuildInfo(projectHandle).getManagedProject()
+ .getConfigurations();
boolean resource = !(path == null || path.isEmpty() || path.equals("/")); //$NON-NLS-1$
boolean modified = false;
@@ -118,7 +121,8 @@ public class AppendToMBSStringOptionValue extends ProcessRunner {
return modified;
}
- private boolean setOptionForResourceConfig(String id, String value, IResourceConfiguration resourceConfig, IOption[] options, IHoldsOptions optionHolder) throws BuildException {
+ private boolean setOptionForResourceConfig(String id, String value, IResourceConfiguration resourceConfig,
+ IOption[] options, IHoldsOptions optionHolder) throws BuildException {
boolean modified = false;
String lowerId = id.toLowerCase();
for (IOption option : options) {
@@ -134,7 +138,8 @@ public class AppendToMBSStringOptionValue extends ProcessRunner {
return modified;
}
- private boolean setOptionForConfig(String id, String value, IConfiguration config, IOption[] options, IHoldsOptions optionHolder) throws BuildException {
+ private boolean setOptionForConfig(String id, String value, IConfiguration config, IOption[] options,
+ IHoldsOptions optionHolder) throws BuildException {
boolean modified = false;
String lowerId = id.toLowerCase();
for (IOption option : options) {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/CreateIncludeFolder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/CreateIncludeFolder.java
index 9f634a70a1f..4d186eb6d42 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/CreateIncludeFolder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/CreateIncludeFolder.java
@@ -30,7 +30,6 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IProgressMonitor;
-
/**
* Creates a include Folder to the project.
*
@@ -44,7 +43,8 @@ public class CreateIncludeFolder extends CreateSourceFolder {
*
*/
@Override
- public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor) throws ProcessFailureException {
+ public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor)
+ throws ProcessFailureException {
String projectName = args[0].getSimpleValue();
String targetPath = args[1].getSimpleValue();
createSourceFolder(projectName, targetPath, monitor);
@@ -68,7 +68,8 @@ public class CreateIncludeFolder extends CreateSourceFolder {
ManagedBuildManager.saveBuildInfo(projectHandle, true);
}
- private void setIncludePathOptionForConfig(String path, IConfiguration config, IOption[] options, IHoldsOptions optionHolder) throws BuildException {
+ private void setIncludePathOptionForConfig(String path, IConfiguration config, IOption[] options,
+ IHoldsOptions optionHolder) throws BuildException {
for (IOption option : options) {
if (option.getValueType() == IOption.INCLUDE_PATH) {
String[] includePaths = option.getIncludePaths();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/ExcludeResources.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/ExcludeResources.java
index 48f9ce220ad..e7f716f7bc5 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/ExcludeResources.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/ExcludeResources.java
@@ -37,7 +37,6 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-
/**
* Exclude Resources from a CDT project. This takes three arguments
* <ul>
@@ -58,7 +57,8 @@ import org.eclipse.core.runtime.IProgressMonitor;
public class ExcludeResources extends ProcessRunner {
@Override
- public void process(TemplateCore template, final ProcessArgument[] args, String processId, IProgressMonitor monitor) throws ProcessFailureException {
+ public void process(TemplateCore template, final ProcessArgument[] args, String processId, IProgressMonitor monitor)
+ throws ProcessFailureException {
String projectName = args[0].getSimpleValue();
String configIdPattern = args[1].getSimpleValue();
final String[] filePatterns = args[2].getSimpleArrayValue();
@@ -69,7 +69,7 @@ public class ExcludeResources extends ProcessRunner {
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
- if(info==null) {
+ if (info == null) {
throw new ProcessFailureException(Messages.getString("ExcludeResources.0")); //$NON-NLS-1$
}
IManagedProject managedProject = info.getManagedProject();
@@ -79,14 +79,14 @@ public class ExcludeResources extends ProcessRunner {
*/
IConfiguration[] allConfigs = managedProject.getConfigurations();
List<IConfiguration> matchingConfigs = new ArrayList<IConfiguration>();
- for(int i=0; i<allConfigs.length; i++) {
+ for (int i = 0; i < allConfigs.length; i++) {
IConfiguration config = allConfigs[i];
- if(config.getId().matches(configIdPattern)) {
+ if (config.getId().matches(configIdPattern)) {
matchingConfigs.add(config);
}
}
- if(invert) {
+ if (invert) {
List<IConfiguration> invertedConfigs = new ArrayList<IConfiguration>(Arrays.asList(allConfigs));
invertedConfigs.removeAll(matchingConfigs);
matchingConfigs = invertedConfigs;
@@ -101,26 +101,26 @@ public class ExcludeResources extends ProcessRunner {
public boolean visit(IResourceProxy proxy) throws CoreException {
IPath lPath = proxy.requestFullPath();
- if(proxy.getType() == IResource.FILE) { /* CDT does not support directory resource configurations */
+ if (proxy.getType() == IResource.FILE) { /* CDT does not support directory resource configurations */
boolean isDerived = false;
- for(IResource res = proxy.requestResource(); res!=null; res = res.getParent()) {
+ for (IResource res = proxy.requestResource(); res != null; res = res.getParent()) {
isDerived |= res.isDerived();
}
- if(!isDerived) {
+ if (!isDerived) {
for (IConfiguration config : configsToProcess) {
IResourceConfiguration resourceConfig = config.getResourceConfiguration(lPath.toString());
// Only add a resource configuration if the file pattern matches something that
//is actually supposed to be excluded. Adding a resrouce configuration for all files
// regardless of wheter they need it or not mess up the makefile generation.
for (String filePattern : filePatterns) {
- if(lPath.toString().matches(filePattern)) {
- if(resourceConfig==null) {
+ if (lPath.toString().matches(filePattern)) {
+ if (resourceConfig == null) {
IFile file = (IFile) proxy.requestResource();
- resourceConfig = config.createResourceConfiguration(file);
+ resourceConfig = config.createResourceConfiguration(file);
}
- if (resourceConfig != null){
+ if (resourceConfig != null) {
resourceConfig.setExclude(true);
}
@@ -138,7 +138,7 @@ public class ExcludeResources extends ProcessRunner {
try {
project.accept(visitor, IResource.DEPTH_INFINITE);
- if (info.isDirty()){
+ if (info.isDirty()) {
ManagedBuildManager.saveBuildInfo(project, true);
}
} catch (CoreException ce) {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/GenerateMakefileWithBuildDescription.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/GenerateMakefileWithBuildDescription.java
index d2b8bb487e1..5d9acc604ae 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/GenerateMakefileWithBuildDescription.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/GenerateMakefileWithBuildDescription.java
@@ -37,20 +37,21 @@ import org.eclipse.core.runtime.IProgressMonitor;
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
-public class GenerateMakefileWithBuildDescription extends ProcessRunner{
+public class GenerateMakefileWithBuildDescription extends ProcessRunner {
/**
- *
+ *
*/
@Override
- public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor) throws ProcessFailureException {
+ public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor)
+ throws ProcessFailureException {
String projectName = args[0].getSimpleValue();
IProject projectHandle = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(projectHandle);
- if(info == null)
+ if (info == null)
throw new ProcessFailureException(ManagedMakeMessages.getString("GenerateMakefileWithBuildDescription.0")); //$NON-NLS-1$
-
+
IConfiguration cfg = info.getDefaultConfiguration();
- if(cfg == null)
+ if (cfg == null)
throw new ProcessFailureException(ManagedMakeMessages.getString("GenerateMakefileWithBuildDescription.1")); //$NON-NLS-1$
IBuildDescription des;
@@ -62,8 +63,8 @@ public class GenerateMakefileWithBuildDescription extends ProcessRunner{
gen.store(oStream);
byte[] bytes = oStream.toByteArray();
ByteArrayInputStream iStream = new ByteArrayInputStream(bytes);
-
- if(!file.exists()){
+
+ if (!file.exists()) {
file.create(iStream, true, monitor);
} else {
file.setContents(iStream, true, false, monitor);
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/NewManagedProject.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/NewManagedProject.java
index 7e743fe828d..7c87aa3a723 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/NewManagedProject.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/NewManagedProject.java
@@ -36,10 +36,9 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
-
/**
* Creates a new Project in the workspace.
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
@@ -47,19 +46,20 @@ public class NewManagedProject extends ProcessRunner {
protected boolean savedAutoBuildingValue;
protected ProjectCreatedActions pca;
protected IManagedBuildInfo info;
-
+
public NewManagedProject() {
pca = new ProjectCreatedActions();
}
-
+
@Override
- public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor) throws ProcessFailureException {
+ public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor)
+ throws ProcessFailureException {
String projectName = args[0].getSimpleValue();
String location = args[1].getSimpleValue();
String artifactExtension = args[2].getSimpleValue();
String isCProjectValue = args[3].getSimpleValue();
boolean isCProject = Boolean.valueOf(isCProjectValue).booleanValue();
-
+
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
if (!project.exists()) {
@@ -71,13 +71,13 @@ public class NewManagedProject extends ProcessRunner {
if (location != null && !location.trim().isEmpty()) {
locationPath = Path.fromPortableString(location);
}
-
+
@SuppressWarnings("unchecked")
List<IConfiguration> configs = (List<IConfiguration>) template.getTemplateInfo().getConfigurations();
if (configs == null || configs.size() == 0) {
throw new ProcessFailureException(Messages.getString("NewManagedProject.4") + projectName); //$NON-NLS-1$
}
-
+
pca.setProject(project);
pca.setProjectLocation(locationPath);
pca.setConfigs(configs.toArray(new IConfiguration[configs.size()]));
@@ -88,14 +88,14 @@ public class NewManagedProject extends ProcessRunner {
ManagedBuildManager.saveBuildInfo(project, true);
restoreAutoBuild(workspace);
-
+
} catch (CoreException e) {
throw new ProcessFailureException(Messages.getString("NewManagedProject.3") + e.getMessage(), e); //$NON-NLS-1$
} catch (BuildException e) {
throw new ProcessFailureException(Messages.getString("NewManagedProject.3") + e.getMessage(), e); //$NON-NLS-1$
}
} else {
-// throw new ProcessFailureException(Messages.getString("NewManagedProject.5") + projectName); //$NON-NLS-1$
+ // throw new ProcessFailureException(Messages.getString("NewManagedProject.5") + projectName); //$NON-NLS-1$
}
}
@@ -105,13 +105,13 @@ public class NewManagedProject extends ProcessRunner {
workspaceDesc.setAutoBuilding(false);
workspace.setDescription(workspaceDesc);
}
-
+
protected final void restoreAutoBuild(IWorkspace workspace) throws CoreException {
IWorkspaceDescription workspaceDesc = workspace.getDescription();
workspaceDesc.setAutoBuilding(savedAutoBuildingValue);
workspace.setDescription(workspaceDesc);
}
-
+
/**
* setOptionValue
*/
@@ -120,7 +120,8 @@ public class NewManagedProject extends ProcessRunner {
if (!option.isExtensionElement()) {
option.setValue(val);
} else {
- IOption newOption = config.getToolChain().createOption(option, option.getId() + "." + ManagedBuildManager.getRandomNumber(), option.getName(), false); //$NON-NLS-1$
+ IOption newOption = config.getToolChain().createOption(option,
+ option.getId() + "." + ManagedBuildManager.getRandomNumber(), option.getName(), false); //$NON-NLS-1$
newOption.setValue(val);
}
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/SetMBSBooleanOptionValue.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/SetMBSBooleanOptionValue.java
index 9dbf4fd0fd6..a24ab6f56a8 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/SetMBSBooleanOptionValue.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/SetMBSBooleanOptionValue.java
@@ -11,7 +11,7 @@
* Contributors:
* Bala Torati (Symbian) - Initial API and implementation
*******************************************************************************/
- package org.eclipse.cdt.managedbuilder.templateengine.processes;
+package org.eclipse.cdt.managedbuilder.templateengine.processes;
import org.eclipse.cdt.core.templateengine.TemplateCore;
import org.eclipse.cdt.core.templateengine.process.ProcessArgument;
@@ -34,7 +34,6 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-
/**
* This class sets the Managed Build System Option boolean Values.
*
@@ -44,7 +43,8 @@ import org.eclipse.core.runtime.IProgressMonitor;
public class SetMBSBooleanOptionValue extends ProcessRunner {
@Override
- public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor) throws ProcessFailureException {
+ public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor)
+ throws ProcessFailureException {
String projectName = args[0].getSimpleValue();
IProject projectHandle = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
IWorkspace workspace = ResourcesPlugin.getWorkspace();
@@ -79,8 +79,10 @@ public class SetMBSBooleanOptionValue extends ProcessRunner {
}
}
- private boolean setOptionValue(IProject projectHandle, String id, String value, String path) throws BuildException, ProcessFailureException {
- IConfiguration[] projectConfigs = ManagedBuildManager.getBuildInfo(projectHandle).getManagedProject().getConfigurations();
+ private boolean setOptionValue(IProject projectHandle, String id, String value, String path)
+ throws BuildException, ProcessFailureException {
+ IConfiguration[] projectConfigs = ManagedBuildManager.getBuildInfo(projectHandle).getManagedProject()
+ .getConfigurations();
boolean resource = !(path == null || path.isEmpty() || path.equals("/")); //$NON-NLS-1$
boolean modified = false;
@@ -114,13 +116,15 @@ public class SetMBSBooleanOptionValue extends ProcessRunner {
return modified;
}
- private boolean setOptionForResourceConfig(String id, String value, IResourceConfiguration resourceConfig, IOption[] options, IHoldsOptions optionHolder) throws BuildException {
+ private boolean setOptionForResourceConfig(String id, String value, IResourceConfiguration resourceConfig,
+ IOption[] options, IHoldsOptions optionHolder) throws BuildException {
boolean modified = false;
String lowerId = id.toLowerCase();
for (IOption option : options) {
if (option.getBaseId().toLowerCase().matches(lowerId)) {
if (option.getValueType() == IOption.BOOLEAN) {
- ManagedBuildManager.setOption(resourceConfig, optionHolder, option, Boolean.valueOf(value).booleanValue());
+ ManagedBuildManager.setOption(resourceConfig, optionHolder, option,
+ Boolean.valueOf(value).booleanValue());
modified = true;
}
}
@@ -128,7 +132,8 @@ public class SetMBSBooleanOptionValue extends ProcessRunner {
return modified;
}
- private boolean setOptionForConfig(String id, String value, IConfiguration config, IOption[] options, IHoldsOptions optionHolder) throws BuildException {
+ private boolean setOptionForConfig(String id, String value, IConfiguration config, IOption[] options,
+ IHoldsOptions optionHolder) throws BuildException {
boolean modified = false;
String lowerId = id.toLowerCase();
for (IOption option : options) {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/SetMBSStringListOptionValues.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/SetMBSStringListOptionValues.java
index b649cbe5ffa..b99eb1830ef 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/SetMBSStringListOptionValues.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/SetMBSStringListOptionValues.java
@@ -34,7 +34,6 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-
/**
* This class Sets (overwrites) contents of Managed Build System StringList Option Values.
*
@@ -44,7 +43,8 @@ import org.eclipse.core.runtime.IProgressMonitor;
public class SetMBSStringListOptionValues extends ProcessRunner {
@Override
- public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor) throws ProcessFailureException {
+ public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor)
+ throws ProcessFailureException {
String projectName = args[0].getSimpleValue();
IProject projectHandle = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
IWorkspace workspace = ResourcesPlugin.getWorkspace();
@@ -65,7 +65,8 @@ public class SetMBSStringListOptionValues extends ProcessRunner {
try {
modified |= setOptionValue(projectHandle, id, values, path);
} catch (BuildException e) {
- throw new ProcessFailureException(Messages.getString("SetMBSStringListOptionValues.0") + e.getMessage(), e); //$NON-NLS-1$
+ throw new ProcessFailureException(Messages.getString("SetMBSStringListOptionValues.0") + e.getMessage(), //$NON-NLS-1$
+ e);
}
}
if (modified) {
@@ -79,8 +80,10 @@ public class SetMBSStringListOptionValues extends ProcessRunner {
}
}
- private boolean setOptionValue(IProject projectHandle, String id, String[] value, String path) throws BuildException, ProcessFailureException {
- IConfiguration[] projectConfigs = ManagedBuildManager.getBuildInfo(projectHandle).getManagedProject().getConfigurations();
+ private boolean setOptionValue(IProject projectHandle, String id, String[] value, String path)
+ throws BuildException, ProcessFailureException {
+ IConfiguration[] projectConfigs = ManagedBuildManager.getBuildInfo(projectHandle).getManagedProject()
+ .getConfigurations();
boolean resource = !(path == null || path.isEmpty() || path.equals("/")); //$NON-NLS-1$
boolean modified = false;
@@ -114,7 +117,8 @@ public class SetMBSStringListOptionValues extends ProcessRunner {
return modified;
}
- private boolean setOptionForResourceConfig(String id, String[] value, IResourceConfiguration resourceConfig, IOption[] options, IHoldsOptions optionHolder) throws BuildException {
+ private boolean setOptionForResourceConfig(String id, String[] value, IResourceConfiguration resourceConfig,
+ IOption[] options, IHoldsOptions optionHolder) throws BuildException {
boolean modified = false;
String lowerId = id.toLowerCase();
for (IOption option : options) {
@@ -140,7 +144,8 @@ public class SetMBSStringListOptionValues extends ProcessRunner {
return modified;
}
- private boolean setOptionForConfig(String id, String[] value, IConfiguration config, IOption[] options, IHoldsOptions optionHolder) throws BuildException {
+ private boolean setOptionForConfig(String id, String[] value, IConfiguration config, IOption[] options,
+ IHoldsOptions optionHolder) throws BuildException {
boolean modified = false;
String lowerId = id.toLowerCase();
for (IOption option : options) {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/SetMBSStringOptionValue.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/SetMBSStringOptionValue.java
index 730157461c5..38d1be07f11 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/SetMBSStringOptionValue.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/templateengine/processes/SetMBSStringOptionValue.java
@@ -34,7 +34,6 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-
/**
* This class sets the Managed Build System Option Values. Note that this class
* handles both string options and enumerated options.
@@ -45,7 +44,8 @@ import org.eclipse.core.runtime.IProgressMonitor;
public class SetMBSStringOptionValue extends ProcessRunner {
@Override
- public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor) throws ProcessFailureException {
+ public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor)
+ throws ProcessFailureException {
String projectName = args[0].getSimpleValue();
IProject projectHandle = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
IWorkspace workspace = ResourcesPlugin.getWorkspace();
@@ -80,8 +80,10 @@ public class SetMBSStringOptionValue extends ProcessRunner {
}
}
- private boolean setOptionValue(IProject projectHandle, String id, String value, String path) throws BuildException, ProcessFailureException {
- IConfiguration[] projectConfigs = ManagedBuildManager.getBuildInfo(projectHandle).getManagedProject().getConfigurations();
+ private boolean setOptionValue(IProject projectHandle, String id, String value, String path)
+ throws BuildException, ProcessFailureException {
+ IConfiguration[] projectConfigs = ManagedBuildManager.getBuildInfo(projectHandle).getManagedProject()
+ .getConfigurations();
boolean resource = !(path == null || path.isEmpty() || path.equals("/")); //$NON-NLS-1$
boolean modified = false;
@@ -115,13 +117,15 @@ public class SetMBSStringOptionValue extends ProcessRunner {
return modified;
}
- private boolean setOptionForResourceConfig(String id, String value, IResourceConfiguration resourceConfig, IOption[] options, IHoldsOptions optionHolder) throws BuildException {
+ private boolean setOptionForResourceConfig(String id, String value, IResourceConfiguration resourceConfig,
+ IOption[] options, IHoldsOptions optionHolder) throws BuildException {
boolean modified = false;
String lowerId = id.toLowerCase();
for (IOption option : options) {
if (option.getBaseId().toLowerCase().matches(lowerId)) {
int optionType = option.getValueType();
- if ((optionType == IOption.STRING) || (optionType == IOption.ENUMERATED) || (optionType == IOption.TREE)) {
+ if ((optionType == IOption.STRING) || (optionType == IOption.ENUMERATED)
+ || (optionType == IOption.TREE)) {
ManagedBuildManager.setOption(resourceConfig, optionHolder, option, value);
modified = true;
}
@@ -130,13 +134,15 @@ public class SetMBSStringOptionValue extends ProcessRunner {
return modified;
}
- private boolean setOptionForConfig(String id, String value, IConfiguration config, IOption[] options, IHoldsOptions optionHolder) throws BuildException {
+ private boolean setOptionForConfig(String id, String value, IConfiguration config, IOption[] options,
+ IHoldsOptions optionHolder) throws BuildException {
boolean modified = false;
String lowerId = id.toLowerCase();
for (IOption option : options) {
if (option.getBaseId().toLowerCase().matches(lowerId)) {
int optionType = option.getValueType();
- if ((optionType == IOption.STRING) || (optionType == IOption.ENUMERATED) || (optionType == IOption.TREE)) {
+ if ((optionType == IOption.STRING) || (optionType == IOption.ENUMERATED)
+ || (optionType == IOption.TREE)) {
ManagedBuildManager.setOption(config, optionHolder, option, value);
modified = true;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/IMakeBuilderInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/IMakeBuilderInfo.java
index ce2e0f427ff..e868f47018b 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/IMakeBuilderInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/IMakeBuilderInfo.java
@@ -31,8 +31,9 @@ public interface IMakeBuilderInfo extends IMakeCommonBuildInfo {
/** @deprecated as of CDT 4.0 */
@Deprecated
public final static String BUILD_TARGET_FULL = ARGS_PREFIX + ".build.target.full"; //$NON-NLS-1$
-
+
boolean isAutoBuildEnable();
+
void setAutoBuildEnable(boolean enabled) throws CoreException;
String getAutoBuildTarget();
@@ -44,6 +45,7 @@ public interface IMakeBuilderInfo extends IMakeCommonBuildInfo {
void setAutoBuildTarget(String target) throws CoreException;
boolean isIncrementalBuildEnabled();
+
void setIncrementalBuildEnable(boolean enabled) throws CoreException;
String getIncrementalBuildTarget();
@@ -55,6 +57,7 @@ public interface IMakeBuilderInfo extends IMakeCommonBuildInfo {
void setIncrementalBuildTarget(String target) throws CoreException;
boolean isFullBuildEnabled();
+
void setFullBuildEnable(boolean enabled) throws CoreException;
String getFullBuildTarget();
@@ -74,6 +77,7 @@ public interface IMakeBuilderInfo extends IMakeCommonBuildInfo {
void setCleanBuildTarget(String target) throws CoreException;
boolean isCleanBuildEnabled();
+
void setCleanBuildEnable(boolean enabled) throws CoreException;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/IMakeCommonBuildInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/IMakeCommonBuildInfo.java
index e2966f5fba8..5637fa7618e 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/IMakeCommonBuildInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/IMakeCommonBuildInfo.java
@@ -19,7 +19,6 @@ import org.eclipse.cdt.managedbuilder.internal.core.Builder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-
/**
* @noextend This class is not intended to be subclassed by clients.
* @noimplement This interface is not intended to be implemented by clients.
@@ -32,6 +31,7 @@ public interface IMakeCommonBuildInfo {
public final static String BUILD_ARGUMENTS = ARGS_PREFIX + ".build.arguments"; //$NON-NLS-1$
void setBuildAttribute(String name, String value) throws CoreException;
+
String getBuildAttribute(String name, String defaultValue);
IPath getBuildLocation();
@@ -43,7 +43,9 @@ public interface IMakeCommonBuildInfo {
void setBuildLocation(IPath location) throws CoreException;
boolean isStopOnError();
+
void setStopOnError(boolean on) throws CoreException;
+
boolean supportsStopOnError(boolean on);
/**
@@ -82,6 +84,7 @@ public interface IMakeCommonBuildInfo {
void setParallelBuildOn(boolean on) throws CoreException;
boolean isDefaultBuildCmd();
+
void setUseDefaultBuildCmd(boolean on) throws CoreException;
IPath getBuildCommand();
@@ -101,18 +104,23 @@ public interface IMakeCommonBuildInfo {
void setBuildArguments(String args) throws CoreException;
String[] getErrorParsers();
+
void setErrorParsers(String[] parsers) throws CoreException;
Map<String, String> getExpandedEnvironment() throws CoreException;
Map<String, String> getEnvironment();
+
void setEnvironment(Map<String, String> env) throws CoreException;
boolean appendEnvironment();
+
void setAppendEnvironment(boolean append) throws CoreException;
boolean isManagedBuildOn();
+
void setManagedBuildOn(boolean on) throws CoreException;
+
boolean supportsBuild(boolean managed);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/MakeScannerInfo.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/MakeScannerInfo.java
index 7adf1101d27..499988445ce 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/MakeScannerInfo.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/MakeScannerInfo.java
@@ -70,6 +70,7 @@ public class MakeScannerInfo implements IScannerInfo {
getPathList().addAll(Arrays.asList(paths));
}
}
+
/*
* (non-Javadoc)
*
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/MakeScannerProvider.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/MakeScannerProvider.java
index bda25843c4c..a6fd11f4c21 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/MakeScannerProvider.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/core/MakeScannerProvider.java
@@ -54,8 +54,8 @@ public class MakeScannerProvider extends ScannerProvider {
public static final String INTERFACE_IDENTITY = MAKE_CORE_ID + ".MakeScannerProvider"; //$NON-NLS-1$
// Name we will use to store build property with the project
- private static final QualifiedName scannerInfoProperty = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(),
- "makeBuildInfo"); //$NON-NLS-1$
+ private static final QualifiedName scannerInfoProperty = new QualifiedName(
+ ManagedBuilderCorePlugin.getUniqueIdentifier(), "makeBuildInfo"); //$NON-NLS-1$
static final String CDESCRIPTOR_ID = MAKE_CORE_ID + ".makeScannerInfo"; //$NON-NLS-1$
public static final String INCLUDE_PATH = "includePath"; //$NON-NLS-1$
@@ -76,7 +76,7 @@ public class MakeScannerProvider extends ScannerProvider {
MakeScannerInfo scannerInfo = null;
// See if there's already one associated with the resource for this
// session
- scannerInfo = (MakeScannerInfo)project.getSessionProperty(scannerInfoProperty);
+ scannerInfo = (MakeScannerInfo) project.getSessionProperty(scannerInfoProperty);
// Try to load one for the project
if (scannerInfo == null) {
@@ -147,14 +147,15 @@ public class MakeScannerProvider extends ScannerProvider {
List<IPathEntry> cPaths = new ArrayList<IPathEntry>(Arrays.asList(entries));
Iterator<IPathEntry> cpIter = cPaths.iterator();
- while(cpIter.hasNext()) {
+ while (cpIter.hasNext()) {
int kind = cpIter.next().getEntryKind();
- if(kind == IPathEntry.CDT_INCLUDE || kind == IPathEntry.CDT_MACRO) {
+ if (kind == IPathEntry.CDT_INCLUDE || kind == IPathEntry.CDT_MACRO) {
cpIter.remove();
}
}
for (int i = 0; i < includes.length; i++) {
- IIncludeEntry include = CoreModel.newIncludeEntry(info.getProject().getFullPath(), null, new Path(includes[i]), true);
+ IIncludeEntry include = CoreModel.newIncludeEntry(info.getProject().getFullPath(), null,
+ new Path(includes[i]), true);
if (!cPaths.contains(include)) {
cPaths.add(include);
}
@@ -162,7 +163,8 @@ public class MakeScannerProvider extends ScannerProvider {
Iterator<Entry<String, String>> syms = symbols.entrySet().iterator();
while (syms.hasNext()) {
Entry<String, String> entry = syms.next();
- IMacroEntry sym = CoreModel.newMacroEntry(info.getProject().getFullPath(), entry.getKey(), entry.getValue());
+ IMacroEntry sym = CoreModel.newMacroEntry(info.getProject().getFullPath(), entry.getKey(),
+ entry.getValue());
if (!cPaths.contains(sym)) {
cPaths.add(sym);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/internal/core/MakeMessages.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/internal/core/MakeMessages.java
index f1d163076a5..308a691dbf5 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/internal/core/MakeMessages.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/internal/core/MakeMessages.java
@@ -17,10 +17,9 @@ import com.ibm.icu.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-
public class MakeMessages {
- private static final String RESOURCE_BUNDLE= MakeMessages.class.getName();
+ private static final String RESOURCE_BUNDLE = MakeMessages.class.getName();
private static ResourceBundle fgResourceBundle;
static {
try {
@@ -29,10 +28,10 @@ public class MakeMessages {
fgResourceBundle = null;
}
}
-
+
private MakeMessages() {
}
-
+
public static String getString(String key) {
try {
return fgResourceBundle.getString(key);
@@ -42,10 +41,10 @@ public class MakeMessages {
return "#" + key + "#"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
-
+
/**
* Gets a string from the resource bundle and formats it with the argument
- *
+ *
* @param key the string used to get the bundle value, must not be null
*/
public static String getFormattedString(String key, Object arg) {
@@ -54,7 +53,7 @@ public class MakeMessages {
/**
* Gets a string from the resource bundle and formats it with arguments
- */
+ */
public static String getFormattedString(String key, Object[] args) {
return MessageFormat.format(getString(key), args);
}

Back to the top