Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.project11
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsEnvironmentVariableSupplier.java4
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java105
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsPropertyConstants.java6
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/ErrorParser.java14
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/PkgconfigErrorResolution.java6
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/VersionComparator.java4
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AbstractConfigurationOption.java2
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java12
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfigurationManager.java10
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsOptionValueHandler.java4
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/ConfigureMessages.java2
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/ConfigureOptionCategory.java6
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java2
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagValueConfigureOption.java2
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/InternalConfigureOption.java2
-rw-r--r--build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/StringConfigureOption.java2
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AcInitElement.java4
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfCodeScanner.java2
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfMacroCodeScanner.java4
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfPartitionScanner.java2
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/InlineDataRule.java2
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/outline/AutoconfContentProvider.java2
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/outline/AutoconfLabelProvider.java10
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfCaseConditionElement.java2
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfMacroArgumentElement.java2
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfOutlineErrorHandler.java2
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java16
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfTokenizer.java68
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/Token.java2
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/actions/AbstractAutotoolsHandler.java2
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeConfigMacro.java2
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeErrorHandler.java8
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeTextHover.java6
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakefileCodeScanner.java25
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakefileContentOutlinePage.java6
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/GNUAutomakefile.java4
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/MakefilePartitionScanner.java2
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/NullMakefile.java2
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/preferences/AbstractEditorPreferencePage.java4
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/preferences/AutoconfEditorPreferencePage.java2
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/preferences/AutotoolsEditorPreferenceConstants.java4
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsBuildPropertyPage.java2
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsCategoryPropertyOptionPage.java8
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsConfigurePrefStore.java2
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsConfigurePropertyTab.java2
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsEditorPropertyTab.java8
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsToolPropertyOptionPage.java2
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsToolsPropertyTab.java2
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/text/hover/AutoconfTextHover.java20
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/wizards/AutotoolsProjectImportWizardPage.java10
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/wizards/ConfigurationLabelProvider.java2
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/wizards/ConvertToAutotoolsProjectWizardPage.java6
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/wizards/ReferenceBlock.java2
-rw-r--r--build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/internal/GCCPathToolChainProvider.java4
-rw-r--r--build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java2
-rw-r--r--build/org.eclipse.cdt.cmake.ui/src/org/eclipse/cdt/cmake/internal/ui/properties/CMakePropertyPage.java14
-rw-r--r--build/org.eclipse.cdt.core.autotools.core/src/org/eclipse/cdt/core/autotools/core/AutotoolsProjectGenerator.java2
-rw-r--r--build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/builder/tests/CDataProviderTests.java1
-rw-r--r--build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/builder/tests/StandardBuildTests.java1
-rw-r--r--build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/core/tests/MakeTestsPlugin.java1
-rw-r--r--build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/core/tests/MakefileReaderProviderTests.java1
-rw-r--r--build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/core/tests/StandardBuildTestHelper.java1
-rw-r--r--build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/GCCPerFileBOPConsoleParserTests.java1
-rw-r--r--build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/ScannerConfigDiscoveryTests.java1
-rw-r--r--build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/ScannerConfigProfileTests.java1
-rw-r--r--build/org.eclipse.cdt.make.core/META-INF/MANIFEST.MF4
-rw-r--r--build/org.eclipse.cdt.make.ui/META-INF/MANIFEST.MF5
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeEnvironmentBlock.java6
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties15
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/actions/FoldingMessages.java6
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/MakeTargetDndUtil.java6
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/TextTransferDropTargetListener.java6
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/WizardCheckboxTablePart.java7
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/AbstractMakefileEditorPreferencePage.java6
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/IMakeHelpContextIds.java7
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/DeleteTargetAction.java6
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/ConvertToMakeProjectWizard.java123
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/ConvertToMakeProjectWizardPage.java116
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/MakeProjectWizardOptionPage.java139
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeCCProjectWizard.java67
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeCProjectWizard.java52
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeProjectWizard.java93
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core.tests/plugin.xml184
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/CustomOptionCommandGenerator2.java34
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedCommandLineGeneratorTest.java123
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/CompilationDatabaseParserTest.java47
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF5
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgScannerConfigUtil.java6
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildModelMessages.java6
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java128
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ManagedMakeMessages.java6
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Option.java6
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java38
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/ConfigurationDataProvider.java1
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/DataProviderMessages.java6
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompilationDatabaseParser.java15
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompileCommand.java4
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/macros/MbsMacroSupplier.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/projectconverter/ConverterMessages.java16
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/newmake/internal/core/MakeMessages.java6
-rw-r--r--build/org.eclipse.cdt.managedbuilder.gnu.ui/META-INF/MANIFEST.MF4
-rw-r--r--build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/META-INF/MANIFEST.MF3
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/commands/BuildConfigurationsJob.java7
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/wizards/Messages.java33
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/wizards/messages.properties18
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildStepsTab.java49
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java10
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewVarDialog.java6
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/ConvertToMakeWizardPage.java25
-rw-r--r--build/org.eclipse.cdt.meson.core/META-INF/MANIFEST.MF2
-rw-r--r--build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonBuildConfiguration.java6
-rw-r--r--build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/meson/core/MesonProjectGenerator.java3
-rw-r--r--build/org.eclipse.cdt.meson.ui/META-INF/MANIFEST.MF2
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/MesonBuildTab.java10
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/SWTImagesFactory.java2
-rw-r--r--build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/commands/RunNinjaCommandHandler.java2
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.arm.tests/src/main/java/org/eclipse/cdt/cmake/is/arm/ToolDetectionParticipantTest.java4
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.arm/help_content_extension.xml4
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.arm/src/main/java/org/eclipse/cdt/cmake/is/arm/ArmClangToolDetectionParticipant.java12
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.arm/src/main/java/org/eclipse/cdt/cmake/is/arm/ArmccBuiltinDetectionBehavior.java20
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.arm/src/main/java/org/eclipse/cdt/cmake/is/arm/ArmccToolDetectionParticipant.java12
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core.doc/doc/html/builtins-detection.xhtml16
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core.doc/doc/html/languageSettingsProviders.xhtml29
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/BuiltinsDetectLangStd_GCC_Test.java4
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/BuiltinsDetectSysroot_GCC_Test.java4
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/IncludePath_C_POSIXTest.java183
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/MacroDefine_C_POSIXTest.java303
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/MacroUndefine_C_POSIXTest.java37
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserDetectionTest.java74
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserLookupResultTest.java22
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/SystemIncludePath_C_Test.java118
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/SystemIncludePath_armcc_Test.java57
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ToolCommandlineParserTest.java87
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/GccOutputProcessorTest.java38
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core.ui/META-INF/MANIFEST.MF12
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core.ui/plugin.xml7
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core.ui/src/org/eclipse/cdt/cmake/is/core/ui/CMakeISPlugin.java53
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core.ui/src/org/eclipse/cdt/cmake/is/core/ui/PreferenceConstants.java24
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core.ui/src/org/eclipse/cdt/cmake/is/core/ui/internal/IndexerSupportPreferencePage.java76
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core.ui/src/org/eclipse/cdt/cmake/is/core/ui/internal/Messages.java33
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core.ui/src/org/eclipse/cdt/cmake/is/core/ui/internal/PreferenceInitializer.java27
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core.ui/src/org/eclipse/cdt/cmake/is/core/ui/internal/messages.properties17
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/.project5
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/.settings/org.eclipse.pde.ds.annotations.prefs8
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/META-INF/MANIFEST.MF20
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/OSGI-INF/org.eclipse.cdt.cmake.is.core.internal.ParserPreferencesAccess.xml7
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/build.properties3
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/plugin.properties3
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/plugin.xml13
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/schema/participant.exsd38
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/CommandEntry.java43
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/CompileCommandsJsonParser.java543
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IIndexerInfoConsumer.java (renamed from cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/language/settings/providers/IIndexerInfoConsumer.java)2
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IParserPreferences.java40
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IParserPreferencesAccess.java33
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IParserPreferencesMetadata.java42
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/Messages.java37
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/builtins/IBuiltinsOutputProcessor.java61
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/Messages.java35
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParseContext.java4
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserDetection.java18
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserPreferences.java63
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserPreferencesAccess.java70
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserPreferencesMetadata.java51
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/CompilerBuiltinsDetector.java272
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/DetectorConsole.java3
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/MaybeGccBuiltinDetectionBehavior.java18
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/Messages.java33
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/ProcessingContext.java49
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/RawIndexerInfo.java109
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/messages.properties17
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/messages.properties19
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/language/settings/providers/BuiltinsCompileCommandsJsonParser.java273
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/language/settings/providers/CompileCommandsJsonParser.java867
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/messages.properties21
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/package-info.java5
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/Arglets.java (renamed from cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/Arglets.java)8
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/DefaultToolCommandlineParser.java (renamed from cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/DefaultToolCommandlineParser.java)21
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/DefaultToolDetectionParticipant.java (renamed from cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/DefaultToolDetectionParticipant.java)2
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/IArglet.java (renamed from cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IArglet.java)2
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/IParserHandler.java (renamed from cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IParserHandler.java)2
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/IRawIndexerInfo.java (renamed from cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IRawIndexerInfo.java)2
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/IRawIndexerInfoCollector.java (renamed from cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IRawIndexerInfoCollector.java)2
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/IResponseFileArglet.java (renamed from cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IResponseFileArglet.java)2
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/IToolCommandlineParser.java (renamed from cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IToolCommandlineParser.java)4
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/IToolDetectionParticipant.java (renamed from cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IToolDetectionParticipant.java)45
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/ParticipantTestUtil.java (renamed from cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/ParticipantTestUtil.java)2
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/ResponseFileArglets.java (renamed from cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/ResponseFileArglets.java)4
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/builtins/GccOutputProcessor.java (renamed from cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/builtins/GccOutputProcessor.java)25
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/builtins/IBuiltinsDetectionBehavior.java (renamed from cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/builtins/IBuiltinsDetectionBehavior.java)15
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/builtins/IBuiltinsOutputProcessor.java29
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/builtins/OutputSniffer.java (renamed from cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/builtins/OutputSniffer.java)19
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/package-info.java (renamed from cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/package-info.java)7
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.hpenonstop.tests/src/main/java/org/eclipse/cdt/cmake/is/hpenonstop/ToolDetectionParticipantTest.java4
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.hpenonstop/help_content_extension.xml4
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.hpenonstop/src/main/java/org/eclipse/cdt/cmake/is/hpenonstop/HpeC11ToolDetectionParticipant.java16
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.hpenonstop/src/main/java/org/eclipse/cdt/cmake/is/hpenonstop/HpeC89ToolDetectionParticipant.java16
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.hpenonstop/src/main/java/org/eclipse/cdt/cmake/is/hpenonstop/HpeC99ToolDetectionParticipant.java16
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.intel/help_content_extension.xml4
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.intel/src/main/java/org/eclipse/cdt/cmake/is/intel/IccToolDetectionParticipant.java4
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.intel/src/main/java/org/eclipse/cdt/cmake/is/intel/IclCandCppToolDetectionParticipant.java16
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.intel/src/main/java/org/eclipse/cdt/cmake/is/intel/IclToolDetectionParticipant.java4
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.intel/src/main/java/org/eclipse/cdt/cmake/is/intel/IcpcClangToolDetectionParticipant.java4
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.intel/src/main/java/org/eclipse/cdt/cmake/is/intel/IcpcToolDetectionParticipant.java4
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.intel/src/main/java/org/eclipse/cdt/cmake/is/intel/IntelCToolCommandlineParser.java14
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.intel/src/main/java/org/eclipse/cdt/cmake/is/intel/IntelCppToolCommandlineParser.java14
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.microsoft.tests/src/main/java/org/eclipse/cdt/cmake/is/microsoft/ToolDetectionParticipantTest.java4
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.microsoft/help_content_extension.xml2
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.microsoft/src/main/java/org/eclipse/cdt/cmake/is/microsoft/MsclToolCommandlineParser.java64
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.microsoft/src/main/java/org/eclipse/cdt/cmake/is/microsoft/MsclToolDetectionParticipant.java4
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.nvidia.tests/src/main/java/org/eclipse/cdt/cmake/is/nvidia/NvccSystemIncludePathTest.java35
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.nvidia.tests/src/main/java/org/eclipse/cdt/cmake/is/nvidia/ToolDetectionParticipantTest.java4
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.nvidia.tests/src/main/java/org/eclipse/cdt/cmake/is/nvidia/builtins/NvccBuiltins_DetectLangStdTest.java10
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.nvidia.tests/src/main/java/org/eclipse/cdt/cmake/is/nvidia/builtins/NvccOutputProcessorTest.java70
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.nvidia/doc/compiler.xhtml8
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.nvidia/help_content_extension.xml6
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.nvidia/src/main/java/org/eclipse/cdt/cmake/is/nvidia/NvccBuiltinDetectionBehavior.java23
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.nvidia/src/main/java/org/eclipse/cdt/cmake/is/nvidia/NvccLangStdArglet.java12
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.nvidia/src/main/java/org/eclipse/cdt/cmake/is/nvidia/NvccSystemIncludePathArglet.java14
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.nvidia/src/main/java/org/eclipse/cdt/cmake/is/nvidia/NvccToolDetectionParticipant.java24
-rw-r--r--cmake/pom.xml33
-rw-r--r--codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/CToolChecker.java24
-rw-r--r--codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/GrepChecker.java4
-rw-r--r--codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/uicontrib/FlexlintHelpLink.java6
-rw-r--r--codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/uicontrib/GrepCheckerExamplePreferenceChangeListener.java12
-rw-r--r--codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/uicontrib/GrepCheckerHelpLink.java6
-rw-r--r--codan/org.eclipse.cdt.codan.ui.cfgview/src/org/eclipse/cdt/codan/ui/cfgview/views/ControlFlowGraphView.java26
-rw-r--r--core/org.eclipse.cdt.core.linux.ppc64le/META-INF/MANIFEST.MF4
-rw-r--r--core/org.eclipse.cdt.core.linux.ppc64le/pom.xml2
-rw-r--r--core/org.eclipse.cdt.core.linux.x86_64/META-INF/MANIFEST.MF4
-rw-r--r--core/org.eclipse.cdt.core.linux.x86_64/pom.xml2
-rw-r--r--core/org.eclipse.cdt.core.linux/META-INF/MANIFEST.MF4
-rw-r--r--core/org.eclipse.cdt.core.linux/pom.xml2
-rw-r--r--core/org.eclipse.cdt.core.macosx/META-INF/MANIFEST.MF4
-rw-r--r--core/org.eclipse.cdt.core.macosx/pom.xml2
-rw-r--r--core/org.eclipse.cdt.core.native/META-INF/MANIFEST.MF2
-rw-r--r--core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/spawner/EnvironmentReader.java54
-rw-r--r--core/org.eclipse.cdt.core.tests/pom.xml1
-rw-r--r--core/org.eclipse.cdt.core.win32.x86_64/META-INF/MANIFEST.MF4
-rwxr-xr-x[-rw-r--r--]core/org.eclipse.cdt.core.win32.x86_64/os/win32/x86_64/listtasks.exebin165888 -> 165888 bytes
-rwxr-xr-x[-rw-r--r--]core/org.eclipse.cdt.core.win32.x86_64/os/win32/x86_64/pty.dllbin89088 -> 89088 bytes
-rwxr-xr-x[-rw-r--r--]core/org.eclipse.cdt.core.win32.x86_64/os/win32/x86_64/spawner.dllbin68608 -> 68608 bytes
-rwxr-xr-x[-rw-r--r--]core/org.eclipse.cdt.core.win32.x86_64/os/win32/x86_64/starter.exebin60416 -> 60416 bytes
-rwxr-xr-x[-rw-r--r--]core/org.eclipse.cdt.core.win32.x86_64/os/win32/x86_64/winpty-agent.exebin154624 -> 154624 bytes
-rwxr-xr-x[-rw-r--r--]core/org.eclipse.cdt.core.win32.x86_64/os/win32/x86_64/winpty.dllbin183296 -> 183296 bytes
-rwxr-xr-x[-rw-r--r--]core/org.eclipse.cdt.core.win32.x86_64/os/win32/x86_64/winreg.dllbin39936 -> 39936 bytes
-rw-r--r--core/org.eclipse.cdt.core.win32.x86_64/pom.xml2
-rw-r--r--core/org.eclipse.cdt.core.win32/META-INF/MANIFEST.MF4
-rw-r--r--core/org.eclipse.cdt.core.win32/pom.xml2
-rw-r--r--core/org.eclipse.cdt.core/META-INF/MANIFEST.MF4
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IFunction.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTDeductionGuide.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTFunctionDeclarator.java4
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTParameterListOwner.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassType.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPEnumeration.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/AttributeUtil.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVariableReadWriteFlags.java3
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/token/KeywordSets.java4
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java14
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/DefaultCodeFormatterConstants.java4
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/formatter/DefaultCodeFormatterOptions.java4
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/CdtMacroSupplier.java2
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java16
-rw-r--r--core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateCore.java4
-rw-r--r--core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateEngine.java6
-rw-r--r--core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/TemplateEngineUtil.java5
-rw-r--r--core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ConditionalProcessGroup.java3
-rw-r--r--core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/Process.java3
-rw-r--r--core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/process/ProcessRunnerFactory.java9
-rw-r--r--core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/internal/core/templateengine/TemplateProcessTypes.java24
-rw-r--r--core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/CommandLineUtil.java1
-rw-r--r--core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/ERandomAccessFile.java4
-rw-r--r--core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/Platform.java114
-rw-r--r--core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/Elf.java8
-rw-r--r--core/org.eclipse.cdt.ui.tests/pom.xml1
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java15
-rw-r--r--core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF4
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/formatter/LineWrappingTabPage.java2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/CResourceRenameRefactoringInputPage.java101
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/CResourceRenameRefactoringWizard.java6
-rw-r--r--cross/org.eclipse.cdt.build.crossgcc/src/org/eclipse/cdt/internal/build/crossgcc/SetCrossCommandWizardPage.java4
-rw-r--r--debug/org.eclipse.cdt.debug.application.product/debug.product5
-rw-r--r--debug/org.eclipse.cdt.debug.application.tests/pom.xml1
-rw-r--r--debug/org.eclipse.cdt.debug.core/META-INF/MANIFEST.MF4
-rw-r--r--debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/InitializeLaunchConfigurations.java24
-rw-r--r--debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/MemoryBlock.java2
-rw-r--r--debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF2
-rw-r--r--doc/org.eclipse.cdt.doc.isv/guide/deprecated_API_removals.html57
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/META-INF/MANIFEST.MF2
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/META-INF/MANIFEST.MF4
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunchDelegate.java13
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/pom.xml1
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/VMExpressionUpdate.java2
-rw-r--r--jtag/org.eclipse.cdt.debug.dap.gdbjtag/META-INF/MANIFEST.MF2
-rw-r--r--jtag/org.eclipse.cdt.debug.dap.gdbjtag/src/org/eclipse/cdt/debug/dap/gdbjtag/DapGdbJtagLaunchDelegate.java8
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/pom.xml1
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/META-INF/MANIFEST.MF2
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/Activator.java2
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java18
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/DefaultGDBJtagDeviceImpl.java6
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/GDBJtagDeviceContributionFactory.java4
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.ui/META-INF/MANIFEST.MF2
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/META-INF/MANIFEST.MF4
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/ContainerCommandLauncherFactory.java2
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java10
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java18
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/DataVolumeModel.java4
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ExposedPortModel.java6
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/GdbDebuggerPage.java2
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/SWTImagesFactory.java10
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/ContainerGCCToolChain.java4
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizardPage.java6
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/preferences/PreferenceInitializer.java2
-rw-r--r--launch/org.eclipse.cdt.launch/META-INF/MANIFEST.MF2
-rw-r--r--launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptorType.java2
-rw-r--r--launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java2
-rw-r--r--launchbar/org.eclipse.launchbar.ui.tests/pom.xml1
-rw-r--r--llvm/org.eclipse.cdt.llvm.dsf.lldb.core/META-INF/MANIFEST.MF2
-rw-r--r--llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/launching/LLDBLaunchDelegate.java18
-rw-r--r--llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/launching/Messages.java2
-rw-r--r--llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/launching/messages.properties2
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/META-INF/MANIFEST.MF2
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/GoToAddressBarWidget.java16
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowser.java14
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowserPreferenceInitializer.java2
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.search/META-INF/MANIFEST.MF1
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.traditional/META-INF/MANIFEST.MF2
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/internal/MemorySpacePreferencesHelper.java9
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/AddressPane.java2
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/ColorAndEffectFieldEditor.java6
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/DataPane.java15
-rwxr-xr-xmemory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java26
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/RenderingAddressInfo.java4
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/TraditionalRendering.java2
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/TraditionalRenderingPreferenceConstants.java46
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/TraditionalRenderingPreferenceInitializer.java20
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/ExportMemoryDialog.java6
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/ImportMemoryDialog.java4
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/PlainTextExporter.java2
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/RAWBinaryExporter.java2
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/SRecordExporter.java2
-rw-r--r--pom.xml6
-rw-r--r--qt/org.eclipse.cdt.qt.core/META-INF/MANIFEST.MF2
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/ASTUtil.java6
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtFunctionCallUtil.java4
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtIncludePaths.java12
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtIncludePathsProvider.java4
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtKeywords.java48
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtMethodReference.java3
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtMethodUtil.java27
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/QtNature.java2
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/IQProperty.java12
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeInfo.java44
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeParser.java32
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeProjectInfo.java2
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QMakeVersion.java2
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QProperty.java2
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QmlRegistration.java4
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtFactory.java8
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtIndexImpl.java2
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/parser/QtParser.java2
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QmlTypeRegistration.java4
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTClass.java4
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtASTVisitor.java16
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/pdom/QtPDOMProperty.java2
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/provider/LinuxQtInstallProvider.java2
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/provider/QtInstallProvider.java2
-rw-r--r--qt/org.eclipse.cdt.qt.ui/META-INF/MANIFEST.MF2
-rw-r--r--qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectConnectCompletion.java6
-rw-r--r--qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QObjectDeclarationCompletion.java4
-rw-r--r--qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/QPropertyCompletion.java6
-rw-r--r--qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyAttributeProposal.java20
-rw-r--r--qt/org.eclipse.cdt.qt.ui/src/org/eclipse/cdt/internal/qt/ui/assist/QPropertyExpansion.java26
-rw-r--r--releng/CDT.setup126
-rw-r--r--releng/org.eclipse.cdt.target/cdt-baseline.target20
-rw-r--r--releng/org.eclipse.cdt.target/cdt.target28
-rwxr-xr-xreleng/scripts/check_code_cleanliness.sh8
-rwxr-xr-xreleng/scripts/check_features.sh2
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.connector.cdtserial/META-INF/MANIFEST.MF3
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.connector.remote/META-INF/MANIFEST.MF3
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.connector.ssh/META-INF/MANIFEST.MF3
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.view.core/META-INF/MANIFEST.MF2
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.view.core/src/org/eclipse/tm/terminal/view/core/utils/Env.java214
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/internal/dialogs/ErrorSettingsPanel.java56
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/internal/dialogs/LaunchTerminalSettingsDialog.java41
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/nls/Messages.java1
-rw-r--r--terminal/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/nls/Messages.properties1
-rw-r--r--tools.templates/org.eclipse.tools.templates.ui/src/org/eclipse/tools/templates/ui/TemplateWizard.java2
-rw-r--r--util/org.eclipse.cdt.util/META-INF/MANIFEST.MF2
-rw-r--r--util/org.eclipse.cdt.util/src/org/eclipse/cdt/internal/core/parser/util/DOMSearchUtil.java2
-rwxr-xr-xvisualizer/org.eclipse.cdt.visualizer.core/META-INF/MANIFEST.MF2
-rwxr-xr-xvisualizer/org.eclipse.cdt.visualizer.core/src/org/eclipse/cdt/visualizer/core/ExtensionElement.java2
-rwxr-xr-xvisualizer/org.eclipse.cdt.visualizer.core/src/org/eclipse/cdt/visualizer/core/ResourceManager.java10
-rwxr-xr-xvisualizer/org.eclipse.cdt.visualizer.ui/META-INF/MANIFEST.MF2
-rw-r--r--visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/VisualizerViewer.java6
-rwxr-xr-xvisualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/BufferedCanvas.java3
-rw-r--r--visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/VirtualBoundsGraphicObject.java10
-rw-r--r--visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/events/VisualizerViewerEvent.java4
-rwxr-xr-xvisualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/test/TestCanvas.java2
-rw-r--r--visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/test/TestCanvasVisualizer.java4
-rwxr-xr-xvisualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/util/Event.java10
-rwxr-xr-xvisualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/util/UIResourceManager.java4
-rw-r--r--windows/org.eclipse.cdt.msw.build/META-INF/MANIFEST.MF2
-rw-r--r--windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/Activator.java2
-rw-r--r--windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinEnvironmentVariableSupplier.java48
410 files changed, 4014 insertions, 4607 deletions
diff --git a/.project b/.project
new file mode 100644
index 00000000000..d3a94771890
--- /dev/null
+++ b/.project
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.cdt.root</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsEnvironmentVariableSupplier.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsEnvironmentVariableSupplier.java
index ad37a2f5658..763cf01ec86 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsEnvironmentVariableSupplier.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsEnvironmentVariableSupplier.java
@@ -32,8 +32,8 @@ import org.eclipse.core.runtime.Platform;
public class AutotoolsEnvironmentVariableSupplier implements IConfigurationEnvironmentVariableSupplier {
private static class VerboseEnvironmentVariable extends EnvironmentVariable implements IBuildEnvironmentVariable {
- private static final String VERBOSE_VAR_NAME = "V";
- private static final String VERBOSE_VAR_VALUE = "1";
+ private static final String VERBOSE_VAR_NAME = "V"; //$NON-NLS-1$
+ private static final String VERBOSE_VAR_VALUE = "1"; //$NON-NLS-1$
private VerboseEnvironmentVariable(String name, String value, int op, String delimiter) {
super(name, value, op, delimiter);
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java
index 9d765ee3a8a..296fbfdf692 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java
@@ -93,6 +93,8 @@ import org.eclipse.remote.core.exception.RemoteConnectionException;
@SuppressWarnings("deprecation")
public class AutotoolsNewMakeGenerator extends MarkerGenerator {
+ private static final String EMPTY_STRING = ""; //$NON-NLS-1$
+
public static final String CONFIG_STATUS = "config.status"; //$NON-NLS-1$
public static final String MAKEFILE = "Makefile"; //$NON-NLS-1$
public static final String MAKEFILE_CVS = "Makefile.cvs"; //$NON-NLS-1$
@@ -114,7 +116,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
private static final String TARGET_USE_DEFAULT_CMD = "useDefaultCommand"; //$NON-NLS-1$
private static final String TARGET_ARGUMENTS = "buildArguments"; //$NON-NLS-1$
private static final String TARGET_COMMAND = "buildCommand"; //$NON-NLS-1$
- private static final String TARGET_RUN_ALL_BUILDERS = "runAllBuilders";
+ private static final String TARGET_RUN_ALL_BUILDERS = "runAllBuilders"; //$NON-NLS-1$
private static final String TARGET = "buildTarget"; //$NON-NLS-1$
private static final String DEFAULT_AUTORECONF = "autoreconf"; //$NON-NLS-1$
@@ -127,7 +129,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
private IPath buildLocation;
private String buildDir;
private String srcDir;
- private String winOSType = "";
+ private String winOSType = EMPTY_STRING;
private IConfiguration cfg;
private ICConfigurationDescription cdesc;
@@ -154,7 +156,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
buildDir = buildDirectory.toString();
srcDir = a.getConfigToolDirectory();
try {
- String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValue(srcDir, "", null,
+ String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValue(srcDir, EMPTY_STRING, null,
IBuildMacroProvider.CONTEXT_CONFIGURATION, c);
srcDir = resolved;
} catch (BuildMacroException e) {
@@ -169,7 +171,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
this.cfg = info.getDefaultConfiguration();
this.builder = cfg.getBuilder();
this.monitor = monitor;
- CUIPlugin.getDefault().getPreferenceStore().getString("dummy");
+ CUIPlugin.getDefault().getPreferenceStore().getString("dummy"); //$NON-NLS-1$
}
@Override
@@ -250,7 +252,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
// Create or get the handle for the build directory
IPath path = new Path(dirName);
boolean rc = true;
- if (dirName.length() == 0 || dirName.equals("."))
+ if (dirName.length() == 0 || dirName.equals(".")) //$NON-NLS-1$
path = getProjectLocation().append(dirName);
File f = path.toFile();
if (!f.exists()) {
@@ -297,7 +299,8 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
Status rc = regenerateMakefiles(icfg, reconfigure);
if (!rc.isOK()) {
if (status == null) {
- status = new MultiStatus(AutotoolsPlugin.getUniqueIdentifier(), IStatus.ERROR, "", null);
+ status = new MultiStatus(AutotoolsPlugin.getUniqueIdentifier(), IStatus.ERROR, EMPTY_STRING,
+ null);
}
status.add(rc);
}
@@ -305,14 +308,12 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
} else {
Status rc = regenerateMakefiles(cfg, reconfigure);
if (!rc.isOK()) {
- if (status == null) {
- status = new MultiStatus(AutotoolsPlugin.getUniqueIdentifier(), IStatus.ERROR, "", null);
- }
+ status = new MultiStatus(AutotoolsPlugin.getUniqueIdentifier(), IStatus.ERROR, EMPTY_STRING, null);
status.add(rc);
}
}
if (status == null) {
- status = new MultiStatus(ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.OK, "", null);
+ status = new MultiStatus(ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.OK, EMPTY_STRING, null);
}
return status;
}
@@ -320,7 +321,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
private Status regenerateMakefiles(IConfiguration icfg, boolean reconfigure) throws CoreException {
MultiStatus status;
int rc = IStatus.OK;
- String errMsg = "";
+ String errMsg = EMPTY_STRING;
boolean needFullConfigure = false;
// See if the user has cancelled the build
@@ -645,46 +646,46 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
* @return stripped command
*/
public static String stripEnvVars(String command, List<String> envVars) {
- Pattern p1 = Pattern.compile("(\\w+[=]\\\".*?\\\"\\s+)\\w+.*");
- Pattern p2 = Pattern.compile("(\\w+[=]'.*?'\\s+)\\w+.*");
- Pattern p3 = Pattern.compile("(\\w+[=][^\\s]+\\s+)\\w+.*");
- Pattern p4 = Pattern.compile("\\w+\\s+(\\w+[=]\\\".*?\\\"\\s*)+.*");
- Pattern p5 = Pattern.compile("\\w+\\s+(\\w+[=]'.*?'\\s*)+.*");
- Pattern p6 = Pattern.compile("\\w+\\s+(\\w+[=][^\\s]+).*");
+ Pattern p1 = Pattern.compile("(\\w+[=]\\\".*?\\\"\\s+)\\w+.*"); //$NON-NLS-1$
+ Pattern p2 = Pattern.compile("(\\w+[=]'.*?'\\s+)\\w+.*"); //$NON-NLS-1$
+ Pattern p3 = Pattern.compile("(\\w+[=][^\\s]+\\s+)\\w+.*"); //$NON-NLS-1$
+ Pattern p4 = Pattern.compile("\\w+\\s+(\\w+[=]\\\".*?\\\"\\s*)+.*"); //$NON-NLS-1$
+ Pattern p5 = Pattern.compile("\\w+\\s+(\\w+[=]'.*?'\\s*)+.*"); //$NON-NLS-1$
+ Pattern p6 = Pattern.compile("\\w+\\s+(\\w+[=][^\\s]+).*"); //$NON-NLS-1$
boolean finished = false;
while (!finished) {
Matcher m1 = p1.matcher(command);
if (m1.matches()) {
- command = command.replaceFirst("\\w+[=]\\\".*?\\\"", "").trim();
+ command = command.replaceFirst("\\w+[=]\\\".*?\\\"", EMPTY_STRING).trim(); //$NON-NLS-1$
String s = m1.group(1).trim();
- envVars.add(s.replaceAll("\\\"", ""));
+ envVars.add(s.replaceAll("\\\"", EMPTY_STRING)); //$NON-NLS-1$
} else {
Matcher m2 = p2.matcher(command);
if (m2.matches()) {
- command = command.replaceFirst("\\w+[=]'.*?'", "").trim();
+ command = command.replaceFirst("\\w+[=]'.*?'", EMPTY_STRING).trim(); //$NON-NLS-1$
String s = m2.group(1).trim();
- envVars.add(s.replaceAll("'", ""));
+ envVars.add(s.replaceAll("'", EMPTY_STRING)); //$NON-NLS-1$
} else {
Matcher m3 = p3.matcher(command);
if (m3.matches()) {
- command = command.replaceFirst("\\w+[=][^\\s]+", "").trim();
+ command = command.replaceFirst("\\w+[=][^\\s]+", EMPTY_STRING).trim(); //$NON-NLS-1$
envVars.add(m3.group(1).trim());
} else {
Matcher m4 = p4.matcher(command);
if (m4.matches()) {
- command = command.replaceFirst("\\w+[=]\\\".*?\\\"", "").trim();
+ command = command.replaceFirst("\\w+[=]\\\".*?\\\"", EMPTY_STRING).trim(); //$NON-NLS-1$
String s = m4.group(1).trim();
- envVars.add(s.replaceAll("\\\"", ""));
+ envVars.add(s.replaceAll("\\\"", EMPTY_STRING)); //$NON-NLS-1$
} else {
Matcher m5 = p5.matcher(command);
if (m5.matches()) {
- command = command.replaceFirst("\\w+[=]'.*?'", "").trim();
+ command = command.replaceFirst("\\w+[=]'.*?'", EMPTY_STRING).trim(); //$NON-NLS-1$
String s = m5.group(1).trim();
- envVars.add(s.replaceAll("'", ""));
+ envVars.add(s.replaceAll("'", EMPTY_STRING)); //$NON-NLS-1$
} else {
Matcher m6 = p6.matcher(command);
if (m6.matches()) {
- command = command.replaceFirst("\\w+[=][^\\s+]+", "").trim();
+ command = command.replaceFirst("\\w+[=][^\\s+]+", EMPTY_STRING).trim(); //$NON-NLS-1$
envVars.add(m6.group(1).trim());
} else {
finished = true;
@@ -707,26 +708,26 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
* @return stripped option
*/
public static String stripEnvVarsFromOption(String str, List<String> envVars) {
- Pattern p1 = Pattern.compile("(\\w+[=]\\\".*?\\\"\\s*).*");
- Pattern p2 = Pattern.compile("(\\w+[=]'.*?'\\s*).*");
- Pattern p3 = Pattern.compile("(\\w+[=][^\\s]+).*");
+ Pattern p1 = Pattern.compile("(\\w+[=]\\\".*?\\\"\\s*).*"); //$NON-NLS-1$
+ Pattern p2 = Pattern.compile("(\\w+[=]'.*?'\\s*).*"); //$NON-NLS-1$
+ Pattern p3 = Pattern.compile("(\\w+[=][^\\s]+).*"); //$NON-NLS-1$
boolean finished = false;
while (!finished) {
Matcher m1 = p1.matcher(str);
if (m1.matches()) {
- str = str.replaceFirst("\\w+[=]\\\".*?\\\"", "").trim();
+ str = str.replaceFirst("\\w+[=]\\\".*?\\\"", EMPTY_STRING).trim(); //$NON-NLS-1$
String s = m1.group(1).trim();
- envVars.add(s.replaceAll("\\\"", ""));
+ envVars.add(s.replaceAll("\\\"", EMPTY_STRING)); //$NON-NLS-1$
} else {
Matcher m2 = p2.matcher(str);
if (m2.matches()) {
- str = str.replaceFirst("\\w+[=]'.*?'", "").trim();
+ str = str.replaceFirst("\\w+[=]'.*?'", EMPTY_STRING).trim(); //$NON-NLS-1$
String s = m2.group(1).trim();
- envVars.add(s.replaceAll("'", ""));
+ envVars.add(s.replaceAll("'", EMPTY_STRING)); //$NON-NLS-1$
} else {
Matcher m3 = p3.matcher(str);
if (m3.matches()) {
- str = str.replaceFirst("\\w+[=][^\\s]+", "").trim();
+ str = str.replaceFirst("\\w+[=][^\\s]+", EMPTY_STRING).trim(); //$NON-NLS-1$
envVars.add(m3.group(1).trim());
} else {
finished = true;
@@ -766,7 +767,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
if (configOption != null)
command = stripEnvVars(configOption.getValue().trim(), envVars);
- String[] tokens = command.split("\\s");
+ String[] tokens = command.split("\\s"); //$NON-NLS-1$
if (tokens.length > 1) {
command = tokens[0];
for (int i = 1; i < tokens.length; ++i)
@@ -798,7 +799,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
if (autogenOption != null)
command = stripEnvVars(autogenOption.getValue().trim(), envVars);
- String[] tokens = command.split("\\s");
+ String[] tokens = command.split("\\s"); //$NON-NLS-1$
if (tokens.length > 1) {
command = tokens[0];
for (int i = 1; i < tokens.length; ++i)
@@ -840,8 +841,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
// try to resolve the build macros in any argument
try {
String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
- configTargets[i], "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
+ configTargets[i], EMPTY_STRING, " ", //$NON-NLS-1$
IBuildMacroProvider.CONTEXT_CONFIGURATION, cfg);
configTargets[i] = resolved;
} catch (BuildMacroException e) {
@@ -1062,10 +1062,10 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
private String getPathString(IPath path) {
String s = path.toString();
if (getOSName().equals(Platform.OS_WIN32)) {
- if (getWinOSType().equals("cygwin")) {
- s = s.replaceAll("^([a-zA-Z]):", "/cygdrive/$1");
+ if (getWinOSType().equals("cygwin")) { //$NON-NLS-1$
+ s = s.replaceAll("^([a-zA-Z]):", "/cygdrive/$1"); //$NON-NLS-1$ //$NON-NLS-2$
} else {
- s = s.replaceAll("^([a-zA-Z]):", "/$1");
+ s = s.replaceAll("^([a-zA-Z]):", "/$1"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
return s;
@@ -1073,9 +1073,9 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
// Fix any escape characters in sh -c command arguments
private String fixEscapeChars(String s) {
- s = s.replaceAll("\\\\", "\\\\\\\\");
- s = s.replaceAll("\\(", "\\\\(");
- s = s.replaceAll("\\)", "\\\\)");
+ s = s.replaceAll("\\\\", "\\\\\\\\"); //$NON-NLS-1$ //$NON-NLS-2$
+ s = s.replaceAll("\\(", "\\\\("); //$NON-NLS-1$ //$NON-NLS-2$
+ s = s.replaceAll("\\)", "\\\\)"); //$NON-NLS-1$ //$NON-NLS-2$
return s;
}
@@ -1116,16 +1116,15 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
if (command == null)
command = arg;
else
- command += " " + arg;
+ command += " " + arg; //$NON-NLS-1$
}
- configTargets = new String[] { "-c", command };
+ configTargets = new String[] { "-c", command }; //$NON-NLS-1$
for (int i = 0; i < configTargets.length; ++i) {
// try to resolve the build macros in any argument
try {
String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
- configTargets[i], "", //$NON-NLS-1$
- " ", //$NON-NLS-1$
+ configTargets[i], EMPTY_STRING, " ", //$NON-NLS-1$
IBuildMacroProvider.CONTEXT_CONFIGURATION, cfg);
// strip any env-var settings from options
// fix for bug #356278
@@ -1161,12 +1160,12 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
// Display command-line environment variables that have been stripped by us
// because launch showCommand won't do this.
if (additionalEnvs != null && additionalEnvs.size() > 0) {
- buf.append(AutotoolsPlugin.getResourceString("MakeGenerator.commandline.envvars"));
+ buf.append(AutotoolsPlugin.getResourceString("MakeGenerator.commandline.envvars")); //$NON-NLS-1$
buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
- buf.append("\t");
+ buf.append("\t"); //$NON-NLS-1$
for (int i = 0; i < additionalEnvs.size(); ++i) {
String envvar = additionalEnvs.get(i);
- buf.append(envvar.replaceFirst("(\\w+=)(.*)", " $1\"$2\""));
+ buf.append(envvar.replaceFirst("(\\w+=)(.*)", " $1\"$2\"")); //$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$
@@ -1474,7 +1473,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
Class<? extends IMakeTargetManager> c = makeTargetManager.getClass();
boolean targetsAdded = false;
try {
- Method m = c.getMethod("setTargets", IContainer.class, IMakeTarget[].class);
+ Method m = c.getMethod("setTargets", IContainer.class, IMakeTarget[].class); //$NON-NLS-1$
m.invoke(makeTargetManager, project, makeTargetArray);
targetsAdded = true;
} catch (NoSuchMethodException | IllegalArgumentException | IllegalAccessException
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsPropertyConstants.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsPropertyConstants.java
index 314e7ecf232..147d142afd7 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsPropertyConstants.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsPropertyConstants.java
@@ -37,12 +37,13 @@ public class AutotoolsPropertyConstants {
public static final QualifiedName LIBTOOLIZE_TOOL = new QualifiedName(PREFIX, "LibtoolizePath"); //$NON-NLS-1$
public static final QualifiedName CLEAN_DELETE = new QualifiedName(PREFIX, "CleanDelete"); //$NON-NLS-1$
public static final QualifiedName CLEAN_MAKE_TARGET = new QualifiedName(PREFIX, "CleanMakeTarget"); //$NON-NLS-1$
- public static final QualifiedName SCANNER_USE_MAKE_W = new QualifiedName(PREFIX, "ScannerUseMakeW");
+ public static final QualifiedName SCANNER_USE_MAKE_W = new QualifiedName(PREFIX, "ScannerUseMakeW"); //$NON-NLS-1$
public static final QualifiedName AUTO_BUILD_NAME = new QualifiedName(PREFIX, "AutoBuildName"); //$NON-NLS-1$
public static final QualifiedName OPEN_INCLUDE = new QualifiedName(PREFIX, "IncludeResourceMapping"); //$NON-NLS-1$
public static final QualifiedName OPEN_INCLUDE_P = new QualifiedName(PREFIX, "PersistentIncludeResourceMapping"); //$NON-NLS-1$
- public static final QualifiedName SCANNER_INFO_DIRTY = new QualifiedName(PREFIX, "ScannerInfoDirty"); // $NON-NLSp-1$
+ public static final QualifiedName SCANNER_INFO_DIRTY = new QualifiedName(PREFIX, "ScannerInfoDirty"); //$NON-NLS-1$
+ @SuppressWarnings("nls")
public static final String[] fACVersions = { "2.13", "2.59", "2.61", "2.67", "2.68" }; //$NON-NLS-1$
public static final String AC_VERSION_2_13 = fACVersions[0];
public static final String AC_VERSION_2_59 = fACVersions[1];
@@ -51,6 +52,7 @@ public class AutotoolsPropertyConstants {
public static final String AC_VERSION_2_68 = fACVersions[4];
public static final String LATEST_AC_VERSION = fACVersions[fACVersions.length - 1];
+ @SuppressWarnings("nls")
public static final String[] fAMVersions = { "1.4-p6", "1.9.5", "1.9.6", "1.11.1" }; //$NON-NLS-1$
public static final String LATEST_AM_VERSION = fAMVersions[fAMVersions.length - 1];
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/ErrorParser.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/ErrorParser.java
index 5873edf923d..a8c2ed8a5da 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/ErrorParser.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/ErrorParser.java
@@ -71,7 +71,7 @@ public class ErrorParser extends MarkerGenerator implements IErrorParser {
if (marker != null) {
// Check to see if addProblemMarker exists.
try {
- Method method = eoParser.getClass().getMethod("addProblemMarker", ProblemMarkerInfo.class);
+ Method method = eoParser.getClass().getMethod("addProblemMarker", ProblemMarkerInfo.class); //$NON-NLS-1$
try {
method.invoke(eoParser, marker);
return true;
@@ -145,7 +145,7 @@ public class ErrorParser extends MarkerGenerator implements IErrorParser {
int lineNumber = getErrorConfigLineNumber(name);
// now open configure file.
- File file = new File(sourcePath + "/configure");
+ File file = new File(sourcePath + "/configure"); //$NON-NLS-1$
// If the log file is not present there is nothing we can do.
if (!file.exists())
return null;
@@ -166,13 +166,13 @@ public class ErrorParser extends MarkerGenerator implements IErrorParser {
Matcher m = errorPattern.matcher(line);
if (m.matches()) {
String typeString = m.group(1);
- if (typeString.equals("prog"))
+ if (typeString.equals("prog")) //$NON-NLS-1$
return AutotoolsProblemMarkerInfo.Type.PROG;
- if (typeString.equals("header"))
+ if (typeString.equals("header")) //$NON-NLS-1$
return AutotoolsProblemMarkerInfo.Type.HEADER;
- if (typeString.equals("file"))
+ if (typeString.equals("file")) //$NON-NLS-1$
return AutotoolsProblemMarkerInfo.Type.FILE;
- if (typeString.equals("lib"))
+ if (typeString.equals("lib")) //$NON-NLS-1$
return AutotoolsProblemMarkerInfo.Type.LIB;
return null;
@@ -194,7 +194,7 @@ public class ErrorParser extends MarkerGenerator implements IErrorParser {
* @return
*/
private int getErrorConfigLineNumber(String name) {
- File file = new File(buildDir + "/config.log");
+ File file = new File(buildDir + "/config.log"); //$NON-NLS-1$
// If the log file is not present there is nothing we can do.
if (!file.exists())
return -1;
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/PkgconfigErrorResolution.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/PkgconfigErrorResolution.java
index 8fb79eb627e..624b401a1db 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/PkgconfigErrorResolution.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/PkgconfigErrorResolution.java
@@ -62,7 +62,7 @@ public class PkgconfigErrorResolution implements IMarkerResolution {
public PkgconfigErrorResolution(String pkgconfigRequirement) {
// Get the pkgconfig package name from the requirement message.
- Pattern p = Pattern.compile("(.*?)[\\s,>,<,=].*");
+ Pattern p = Pattern.compile("(.*?)[\\s,>,<,=].*"); //$NON-NLS-1$
Matcher m = p.matcher(pkgconfigRequirement);
if (m.matches()) {
pkgName = m.group(1);
@@ -98,7 +98,7 @@ public class PkgconfigErrorResolution implements IMarkerResolution {
// Use CDT launcher to run rpm to query the package that provides
// the pkgconfig .pc file for the package in question.
ConsoleOutputStream output = new ConsoleOutputStream();
- Process proc = launcher.execute(commandPath, commandArgs, null, new Path("."), new NullProgressMonitor());
+ Process proc = launcher.execute(commandPath, commandArgs, null, new Path("."), new NullProgressMonitor()); //$NON-NLS-1$
if (proc != null) {
try {
// Close the input of the process since we will never write to
@@ -111,7 +111,7 @@ public class PkgconfigErrorResolution implements IMarkerResolution {
} else {
String result = output.readBuffer();
if (!result.startsWith("error:")) //$NON-NLS-1$
- System.out.println("need to execute update of " + result);
+ System.out.println("need to execute update of " + result); //$NON-NLS-1$
}
}
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/VersionComparator.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/VersionComparator.java
index b980ec8dfc2..8160469bbd3 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/VersionComparator.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/VersionComparator.java
@@ -31,8 +31,8 @@ public class VersionComparator {
* VersionComparator.compare("1.5.1", "1.5.1") returns 0
*/
public static int compare(String v1, String v2) {
- String[] v1digits = v1.split("\\.");
- String[] v2digits = v2.split("\\.");
+ String[] v1digits = v1.split("\\."); //$NON-NLS-1$
+ String[] v2digits = v2.split("\\."); //$NON-NLS-1$
for (int i = 0; i < v1digits.length && i < v2digits.length; i++) {
int d1 = Integer.valueOf(v1digits[i]);
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AbstractConfigurationOption.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AbstractConfigurationOption.java
index 38916f0d45b..97d7e2a2ba2 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AbstractConfigurationOption.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AbstractConfigurationOption.java
@@ -64,7 +64,7 @@ public abstract class AbstractConfigurationOption implements IConfigureOption {
}
public String getParameterName() {
- return "--" + getName();
+ return "--" + getName(); //$NON-NLS-1$
}
@Override
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java
index 6e3ce526df5..0e5514fcbd5 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfiguration.java
@@ -133,11 +133,11 @@ public class AutotoolsConfiguration implements IAConfiguration {
IConfigureOption.BIN),
new Option(AutotoolsOptionConstants.FLAG_CFLAGS, "cflags", AutotoolsOptionConstants.FLAG_CFLAGS_FLAGS, //$NON-NLS-1$
IConfigureOption.FLAG),
- new Option(AutotoolsOptionConstants.OPT_CFLAGS_DEBUG, "cflags_debug", IConfigureOption.FLAGVALUE), //$NON-NLS-1$ //$NON-NLS-2$
- new Option(AutotoolsOptionConstants.OPT_CFLAGS_GPROF, "cflags_gprof", IConfigureOption.FLAGVALUE), //$NON-NLS-1$ //$NON-NLS-2$
- new Option(AutotoolsOptionConstants.OPT_CFLAGS_GCOV, "cflags_gcov", IConfigureOption.FLAGVALUE), //$NON-NLS-1$ //$NON-NLS-2$
+ new Option(AutotoolsOptionConstants.OPT_CFLAGS_DEBUG, "cflags_debug", IConfigureOption.FLAGVALUE), //$NON-NLS-1$
+ new Option(AutotoolsOptionConstants.OPT_CFLAGS_GPROF, "cflags_gprof", IConfigureOption.FLAGVALUE), //$NON-NLS-1$
+ new Option(AutotoolsOptionConstants.OPT_CFLAGS_GCOV, "cflags_gcov", IConfigureOption.FLAGVALUE), //$NON-NLS-1$
new Option(AutotoolsOptionConstants.OPT_USER, IConfigureOption.MULTIARG),
- new Option(AutotoolsOptionConstants.TOOL_AUTOGEN, "autogen", "autogen.sh", IConfigureOption.TOOL), //$NON-NLS-1$
+ new Option(AutotoolsOptionConstants.TOOL_AUTOGEN, "autogen", "autogen.sh", IConfigureOption.TOOL), //$NON-NLS-1$ //$NON-NLS-2$
new Option(AutotoolsOptionConstants.CATEGORY_OPTIONS, IConfigureOption.CATEGORY),
new Option(AutotoolsOptionConstants.OPT_AUTOGENOPTS, IConfigureOption.MULTIARG), };
@@ -406,12 +406,12 @@ public class AutotoolsConfiguration implements IAConfiguration {
@Override
public void setConfigToolDirectory(String configToolDirectory) {
- setOption("configdir", configToolDirectory);
+ setOption("configdir", configToolDirectory); //$NON-NLS-1$
}
@Override
public String getConfigToolDirectory() {
- IConfigureOption option = configOptions.get("configdir");
+ IConfigureOption option = configOptions.get("configdir"); //$NON-NLS-1$
return option.getValue();
}
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfigurationManager.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfigurationManager.java
index c86e682eb0e..aa418c7c7a6 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfigurationManager.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsConfigurationManager.java
@@ -417,19 +417,19 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
String childName = children.get(k);
IConfigureOption childopt = cfg.getOption(childName);
p.println("<flagvalue id=\"" + childopt.getName() + "\" value=\"" //$NON-NLS-1$ //$NON-NLS-2$
- + xmlEscape(childopt.getValue()) + "\"/>"); //$NON-NLS-3$
+ + xmlEscape(childopt.getValue()) + "\"/>"); //$NON-NLS-1$
}
p.println("</flag>"); //$NON-NLS-1$
} else if (!opt.isCategory() && !opt.isFlagValue())
p.println("<option id=\"" + option.getName() + "\" value=\"" + xmlEscape(opt.getValue()) //$NON-NLS-1$ //$NON-NLS-2$
- + "\"/>"); //$NON-NLS-3$
+ + "\"/>"); //$NON-NLS-1$
}
p.println("</configuration>"); //$NON-NLS-1$
// Sync name field as this configuration is now
// officially saved
syncNameField(cfgd);
}
- p.println("</configurations>");
+ p.println("</configurations>"); //$NON-NLS-1$
}
}
} catch (IOException e) {
@@ -503,7 +503,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
p.println("</configuration>"); //$NON-NLS-1$
}
}
- p.println("</configurations>");
+ p.println("</configurations>"); //$NON-NLS-1$
}
}
} catch (IOException e) {
@@ -602,7 +602,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
private String createDummyId() {
for (;;) {
- String id = "TEMP_" + rand.nextInt();
+ String id = "TEMP_" + rand.nextInt(); //$NON-NLS-1$
if (tmpConfigs.get(id) == null)
return id;
}
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsOptionValueHandler.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsOptionValueHandler.java
index 53249c96f28..069a0fad1ec 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsOptionValueHandler.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/AutotoolsOptionValueHandler.java
@@ -49,7 +49,7 @@ public class AutotoolsOptionValueHandler extends ManagedOptionValueHandler imple
// SortedSet<Integer> nums = new TreeSet<Integer>();
IConfiguration configuration = (IConfiguration) buildObject;
ICConfigurationDescription cfgd = ManagedBuildManager.getDescriptionForConfiguration(configuration);
- if (option.getName().equals("Name") && cfgd != null) {
+ if (option.getName().equals("Name") && cfgd != null) { //$NON-NLS-1$
String cfgId = cfgd.getId();
if (!value.isEmpty() && !value.equals(cfgId)) {
// we have a cloned configuration and we know that the
@@ -95,7 +95,7 @@ public class AutotoolsOptionValueHandler extends ManagedOptionValueHandler imple
private String fixName(String cfgName) {
// Replace whitespace with underscores.
- return cfgName.replaceAll("\\s", "_");
+ return cfgName.replaceAll("\\s", "_"); //$NON-NLS-1$ //$NON-NLS-2$
}
// IOptionApplicability methods
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/ConfigureMessages.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/ConfigureMessages.java
index b3d6d866785..55c5a4f3e03 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/ConfigureMessages.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/ConfigureMessages.java
@@ -26,7 +26,7 @@ public class ConfigureMessages {
}
public static String getConfigureDescription(String name) {
- return getString("Option.configure." + name); //$NON-NLS-11$
+ return getString("Option.configure." + name); //$NON-NLS-1$
}
public static String getConfigureTip(String name) {
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/ConfigureOptionCategory.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/ConfigureOptionCategory.java
index 9fbdc8f9eea..235b393a7fb 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/ConfigureOptionCategory.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/ConfigureOptionCategory.java
@@ -40,7 +40,7 @@ public class ConfigureOptionCategory implements IConfigureOption {
@Override
public String getParameter() {
- return "";
+ return ""; //$NON-NLS-1$
}
@Override
@@ -50,12 +50,12 @@ public class ConfigureOptionCategory implements IConfigureOption {
@Override
public String getToolTip() {
- return "";
+ return ""; //$NON-NLS-1$
}
@Override
public String getValue() {
- return "null";
+ return "null"; //$NON-NLS-1$
}
@Override
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java
index a4a175fcd79..2b1b684e5e5 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagConfigureOption.java
@@ -43,7 +43,7 @@ public class FlagConfigureOption extends AbstractConfigurationOption {
StringBuilder parms = new StringBuilder();
// Multiple flags are designated by putting multiple flags together using "|" as delimiter
String[] flagNames = getValue().split("\\|"); //$NON-NLS-1$
- String flagSeparator = "";
+ String flagSeparator = ""; //$NON-NLS-1$
for (String flagName : flagNames) {
parms.append(flagSeparator);
flagSeparator = " "; //$NON-NLS-1$
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagValueConfigureOption.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagValueConfigureOption.java
index 8346f5595ff..aea788dbef1 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagValueConfigureOption.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/FlagValueConfigureOption.java
@@ -37,7 +37,7 @@ public class FlagValueConfigureOption extends BinConfigureOption implements IFla
@Override
public String getParameter() {
- return "";
+ return ""; //$NON-NLS-1$
}
@Override
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/InternalConfigureOption.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/InternalConfigureOption.java
index e2b337542b2..9c1b414cea3 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/InternalConfigureOption.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/InternalConfigureOption.java
@@ -52,7 +52,7 @@ public class InternalConfigureOption extends AbstractConfigurationOption {
@Override
public String getParameter() {
- return "";
+ return ""; //$NON-NLS-1$
}
@Override
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/StringConfigureOption.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/StringConfigureOption.java
index 747269c184b..65ad0020fc0 100644
--- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/StringConfigureOption.java
+++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/configure/StringConfigureOption.java
@@ -54,7 +54,7 @@ public class StringConfigureOption extends AbstractConfigurationOption {
public String getParameter() {
if (isParmSet())
return getParameterName() + "=" + getValue(); //$NON-NLS-1$
- return "";
+ return ""; //$NON-NLS-1$
}
@Override
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AcInitElement.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AcInitElement.java
index 1447e6b1727..988dedb21d1 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AcInitElement.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AcInitElement.java
@@ -22,7 +22,7 @@ import org.eclipse.cdt.internal.autotools.core.VersionComparator;
public class AcInitElement extends AutoconfMacroElement {
- private static final String BAD_VERSION_NUMBER = "AC_INIT_badVersionNumber";
+ private static final String BAD_VERSION_NUMBER = "AC_INIT_badVersionNumber"; //$NON-NLS-1$
public AcInitElement(String name) {
super(name);
@@ -56,7 +56,7 @@ public class AcInitElement extends AutoconfMacroElement {
AutoconfElement argument = this.getChildren()[1];
// match a digit followed by a dot zero or more times
// but always end with a digit
- if (!argument.getName().matches("(\\d*\\.)*((\\d+))")) {
+ if (!argument.getName().matches("(\\d*\\.)*((\\d+))")) { //$NON-NLS-1$
throw new InvalidMacroException(AutoconfEditorMessages.getString(BAD_VERSION_NUMBER), argument);
}
}
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfCodeScanner.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfCodeScanner.java
index a6014b48cab..b53c868fe6d 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfCodeScanner.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfCodeScanner.java
@@ -120,7 +120,7 @@ public class AutoconfCodeScanner extends RuleBasedScanner {
rules.add(new AutoconfIdentifierRule(other));
// Make sure we don't treat "\#" as comment start.
- rules.add(new SingleLineRule("\\#", null, Token.UNDEFINED));
+ rules.add(new SingleLineRule("\\#", null, Token.UNDEFINED)); //$NON-NLS-1$
rules.add(new WhitespaceRule(new AutoconfWhitespaceDetector()));
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfMacroCodeScanner.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfMacroCodeScanner.java
index f1300431f42..697d308e2c6 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfMacroCodeScanner.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfMacroCodeScanner.java
@@ -81,8 +81,8 @@ public class AutoconfMacroCodeScanner extends RuleBasedScanner {
List<IRule> rules = new ArrayList<>();
// Add rule for single line comments.
- rules.add(new RestrictedEndOfLineRule("dnl", "[]", comment)); //$NON-NLS-1$
- rules.add(new RestrictedEndOfLineRule("#", "[]", comment, '\\')); //$NON-NLS-1$
+ rules.add(new RestrictedEndOfLineRule("dnl", "[]", comment)); //$NON-NLS-1$ //$NON-NLS-2$
+ rules.add(new RestrictedEndOfLineRule("#", "[]", comment, '\\')); //$NON-NLS-1$ //$NON-NLS-2$
// Add special recursive rule for strings which allows variable
// references to be internally tokenized.
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfPartitionScanner.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfPartitionScanner.java
index 58ede93f70c..8ce411beee1 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfPartitionScanner.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/AutoconfPartitionScanner.java
@@ -43,7 +43,7 @@ public class AutoconfPartitionScanner extends RuleBasedPartitionScanner {
rules.add(new AutoconfMacroPartitionRule(macro));
rules.add(new EndOfLineRule("dnl", comment)); //$NON-NLS-1$
- rules.add(new SingleLineRule("\\#", null, Token.UNDEFINED));
+ rules.add(new SingleLineRule("\\#", null, Token.UNDEFINED)); //$NON-NLS-1$
rules.add(new EndOfLineRule("#", comment, '\\')); //$NON-NLS-1$
// We want to process identifiers that might have macro
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/InlineDataRule.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/InlineDataRule.java
index 31a59f02742..7c1b85a59b4 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/InlineDataRule.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/InlineDataRule.java
@@ -39,7 +39,7 @@ public class InlineDataRule implements IRule {
/** Buffer used for pattern detection */
private StringBuilder fBuffer = new StringBuilder();
- private String fStartingSequence = "<<";
+ private String fStartingSequence = "<<"; //$NON-NLS-1$
public InlineDataRule(IToken inToken) {
token = inToken;
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/outline/AutoconfContentProvider.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/outline/AutoconfContentProvider.java
index 7d198314853..29db2b4f159 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/outline/AutoconfContentProvider.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/outline/AutoconfContentProvider.java
@@ -28,7 +28,7 @@ public class AutoconfContentProvider implements ITreeContentProvider {
private IDocumentProvider documentProvider;
private AutoconfEditor editor;
- protected final static String SECTION_POSITIONS = "section_positions";
+ protected final static String SECTION_POSITIONS = "section_positions"; //$NON-NLS-1$
protected IPositionUpdater positionUpdater = new DefaultPositionUpdater(SECTION_POSITIONS);
public AutoconfContentProvider(ITextEditor editor) {
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/outline/AutoconfLabelProvider.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/outline/AutoconfLabelProvider.java
index d7f92b41c91..89342d4abda 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/outline/AutoconfLabelProvider.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/outline/AutoconfLabelProvider.java
@@ -88,21 +88,21 @@ public class AutoconfLabelProvider implements ILabelProvider {
String result;
String name = e.getName();
if (name.length() > 31)
- name = name.substring(0, 31) + "...";
+ name = name.substring(0, 31) + "..."; //$NON-NLS-1$
String var = e.getVar();
if (var != null) {
if (var.length() > 15)
- var = var.substring(0, 15) + "...";
+ var = var.substring(0, 15) + "..."; //$NON-NLS-1$
var = " " + var; //$NON-NLS-1$
} else {
- var = "";
+ var = ""; //$NON-NLS-1$
}
- result = (name + var).replaceAll("(\r|\n| |\t|\f)+", " ");
+ result = (name + var).replaceAll("(\r|\n| |\t|\f)+", " "); //$NON-NLS-1$ //$NON-NLS-2$
return result;
} else if (element instanceof String) {
return (String) element;
}
- return "";
+ return ""; //$NON-NLS-1$
}
}
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfCaseConditionElement.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfCaseConditionElement.java
index e20bb4c4d5a..77aca201956 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfCaseConditionElement.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfCaseConditionElement.java
@@ -16,7 +16,7 @@ package org.eclipse.cdt.autotools.ui.editors.parser;
public class AutoconfCaseConditionElement extends AutoconfElement {
public AutoconfCaseConditionElement() {
- super("");
+ super(""); //$NON-NLS-1$
}
public AutoconfCaseConditionElement(String name) {
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfMacroArgumentElement.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfMacroArgumentElement.java
index 672401fb43a..5bae2d108cb 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfMacroArgumentElement.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfMacroArgumentElement.java
@@ -24,7 +24,7 @@ package org.eclipse.cdt.autotools.ui.editors.parser;
public class AutoconfMacroArgumentElement extends AutoconfElement {
public AutoconfMacroArgumentElement() {
- super(""); // //$NON-NLS-N$
+ super(""); // //$NON-NLS-1$
}
public AutoconfMacroArgumentElement(String name) {
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfOutlineErrorHandler.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfOutlineErrorHandler.java
index 195bcbdd609..f8d29a38ae3 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfOutlineErrorHandler.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfOutlineErrorHandler.java
@@ -43,7 +43,7 @@ public class AutoconfOutlineErrorHandler {
try {
IPath absPath = input.getStorage().getFullPath();
IPath rootPath = root.getLocation();
- IPath relPath = new Path("");
+ IPath relPath = new Path(""); //$NON-NLS-1$
for (int i = 0; i < rootPath.segmentCount(); ++i) {
relPath = relPath.append("../"); //$NON-NLS-1$
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java
index 19fce55b7c9..ff80904550d 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java
@@ -56,7 +56,8 @@ public class AutoconfParser {
private AutoconfTokenizer tokenizer;
private IAutoconfMacroDetector macroDetector;
- private static final String M4_BUILTINS = "define undefine defn pushdef popdef indir builtin ifdef ifelse shift reverse cond " //$NON-NLS-1$
+ @SuppressWarnings("nls")
+ private static final String M4_BUILTINS = "define undefine defn pushdef popdef indir builtin ifdef ifelse shift reverse cond "
+ "dumpdef traceon traceoff debugmode debugfile dnl changequote changecom changeword " + "m4wrap "
+ "include sinclude divert undivert divnum len index regexp substr translit patsubst "
+ "format incr decr eval syscmd esyscmd sysval mkstemp maketemp errprint m4exit "
@@ -240,9 +241,9 @@ public class AutoconfParser {
} else {
String exp;
if (block instanceof AutoconfIfElement || block instanceof AutoconfElifElement)
- exp = "then";
+ exp = "then"; //$NON-NLS-1$
else
- exp = "do";
+ exp = "do"; //$NON-NLS-1$
handleError(token, AutoconfEditorMessages.getFormattedString(MISSING_SPECIFIER, exp));
@@ -606,6 +607,7 @@ public class AutoconfParser {
// fall through
// 5. Abort on unexpected tokens
+ //$FALL-THROUGH$
case ITokenConstants.SH_DO:
case ITokenConstants.SH_THEN:
handleError(token, AutoconfEditorMessages.getFormattedString(INVALID_SPECIFIER, token.getText()));
@@ -863,11 +865,11 @@ public class AutoconfParser {
private void validateMacroParameterCount(AutoconfMacroElement macro, Token token, int count) {
if (macro.getParameterCount() < count) {
- handleError(token, AutoconfEditorMessages.getFormattedString("M4MacroArgsTooFew", macro.getName(),
- Integer.valueOf(2))); //$NON-NLS-1$
+ handleError(token, AutoconfEditorMessages.getFormattedString("M4MacroArgsTooFew", macro.getName(), //$NON-NLS-1$
+ Integer.valueOf(2)));
} else if (macro.getParameterCount() > count) {
- handleError(token, AutoconfEditorMessages.getFormattedString("M4MacroArgsTooMany", macro.getName(),
- Integer.valueOf(2))); //$NON-NLS-1$
+ handleError(token, AutoconfEditorMessages.getFormattedString("M4MacroArgsTooMany", macro.getName(), //$NON-NLS-1$
+ Integer.valueOf(2)));
}
}
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfTokenizer.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfTokenizer.java
index 4cbb147f526..aa46faf31fc 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfTokenizer.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/AutoconfTokenizer.java
@@ -69,7 +69,7 @@ public class AutoconfTokenizer {
this.chars = document.get().toCharArray();
this.offset = 0;
- this.eofToken = new Token(ITokenConstants.EOF, "", document, chars.length, 0);
+ this.eofToken = new Token(ITokenConstants.EOF, "", document, chars.length, 0); //$NON-NLS-1$
this.m4OpenQuote = "`"; //$NON-NLS-1$
this.m4CloseQuote = "'"; //$NON-NLS-1$
@@ -179,7 +179,7 @@ public class AutoconfTokenizer {
}
if (!found) {
handleError(startOffset, offset, AutoconfEditorMessages.getFormattedString(UNMATCHED_CLOSE_COMMENT,
- m4CloseComment.equals("\n") ? "newline" : m4CloseComment)); //$NON-NLS-1$
+ m4CloseComment.equals("\n") ? "newline" : m4CloseComment)); //$NON-NLS-1$ //$NON-NLS-2$
}
return makeToken(ITokenConstants.M4_COMMENT);
}
@@ -270,35 +270,39 @@ public class AutoconfTokenizer {
String text = buffer.toString();
if (!isM4Context) {
- // detect sh tokens
- if ("case".equals(text))
- return makeToken(ITokenConstants.SH_CASE, text);
- if ("in".equals(text))
- return makeToken(ITokenConstants.SH_IN, text);
- if ("esac".equals(text))
- return makeToken(ITokenConstants.SH_ESAC, text);
- if ("while".equals(text))
- return makeToken(ITokenConstants.SH_WHILE, text);
- if ("select".equals(text))
- return makeToken(ITokenConstants.SH_SELECT, text);
- if ("until".equals(text))
- return makeToken(ITokenConstants.SH_UNTIL, text);
- if ("for".equals(text))
- return makeToken(ITokenConstants.SH_FOR, text);
- if ("do".equals(text))
- return makeToken(ITokenConstants.SH_DO, text);
- if ("done".equals(text))
- return makeToken(ITokenConstants.SH_DONE, text);
- if ("if".equals(text))
- return makeToken(ITokenConstants.SH_IF, text);
- if ("then".equals(text))
- return makeToken(ITokenConstants.SH_THEN, text);
- if ("else".equals(text))
- return makeToken(ITokenConstants.SH_ELSE, text);
- if ("elif".equals(text))
- return makeToken(ITokenConstants.SH_ELIF, text);
- if ("fi".equals(text))
- return makeToken(ITokenConstants.SH_FI, text);
+ if (text != null) {
+ // detect sh tokens
+ switch (text) {
+ case "case": //$NON-NLS-1$
+ return makeToken(ITokenConstants.SH_CASE, text);
+ case "in": //$NON-NLS-1$
+ return makeToken(ITokenConstants.SH_IN, text);
+ case "esac": //$NON-NLS-1$
+ return makeToken(ITokenConstants.SH_ESAC, text);
+ case "while": //$NON-NLS-1$
+ return makeToken(ITokenConstants.SH_WHILE, text);
+ case "select": //$NON-NLS-1$
+ return makeToken(ITokenConstants.SH_SELECT, text);
+ case "until": //$NON-NLS-1$
+ return makeToken(ITokenConstants.SH_UNTIL, text);
+ case "for": //$NON-NLS-1$
+ return makeToken(ITokenConstants.SH_FOR, text);
+ case "do": //$NON-NLS-1$
+ return makeToken(ITokenConstants.SH_DO, text);
+ case "done": //$NON-NLS-1$
+ return makeToken(ITokenConstants.SH_DONE, text);
+ case "if": //$NON-NLS-1$
+ return makeToken(ITokenConstants.SH_IF, text);
+ case "then": //$NON-NLS-1$
+ return makeToken(ITokenConstants.SH_THEN, text);
+ case "else": //$NON-NLS-1$
+ return makeToken(ITokenConstants.SH_ELSE, text);
+ case "elif": //$NON-NLS-1$
+ return makeToken(ITokenConstants.SH_ELIF, text);
+ case "fi": //$NON-NLS-1$
+ return makeToken(ITokenConstants.SH_FI, text);
+ }
+ }
}
// other identifier-looking word
@@ -360,7 +364,7 @@ public class AutoconfTokenizer {
}
if (ch != terminal) {
- handleError(startOffset, offset, AutoconfEditorMessages.getFormattedString(UNTERMINATED_STRING, "" + ch));
+ handleError(startOffset, offset, AutoconfEditorMessages.getFormattedString(UNTERMINATED_STRING, "" + ch)); //$NON-NLS-1$
}
return makeToken(type, buffer.toString());
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/Token.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/Token.java
index 16044448c6a..3a873a3af19 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/Token.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/autotools/ui/editors/parser/Token.java
@@ -82,7 +82,7 @@ public class Token implements ITokenConstants {
char[] text = document.get().toCharArray();
if (offset == 0)
return false;
- return (" \t\r\n\f".indexOf(text[offset - 1]) >= 0);
+ return (" \t\r\n\f".indexOf(text[offset - 1]) >= 0); //$NON-NLS-1$
}
}
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/actions/AbstractAutotoolsHandler.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/actions/AbstractAutotoolsHandler.java
index 6cdec5f7c93..be53d49b021 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/actions/AbstractAutotoolsHandler.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/actions/AbstractAutotoolsHandler.java
@@ -359,7 +359,7 @@ public abstract class AbstractAutotoolsHandler extends AbstractHandler {
for (String arg : argumentList) {
command1.append(' ').append(arg);
}
- newArgumentList = new String[] { "-c", command1.toString() };
+ newArgumentList = new String[] { "-c", command1.toString() }; //$NON-NLS-1$
OutputStream stdout = consoleOutStream;
OutputStream stderr = consoleOutStream;
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeConfigMacro.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeConfigMacro.java
index 939265c2fa7..1b7592d60c8 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeConfigMacro.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeConfigMacro.java
@@ -28,6 +28,6 @@ public class AutomakeConfigMacro extends Directive {
@Override
public String toString() {
- return name + "\n";
+ return name + "\n"; //$NON-NLS-1$
}
}
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeErrorHandler.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeErrorHandler.java
index 621f4d882be..352e8d4bad7 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeErrorHandler.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeErrorHandler.java
@@ -27,14 +27,14 @@ import org.eclipse.jface.text.source.AnnotationModel;
import org.eclipse.ui.IEditorInput;
public class AutomakeErrorHandler {
- public static final String AUTOMAKE_ERROR_MARKER_ID = AutotoolsUIPlugin.PLUGIN_ID + ".parsefileerror";
+ public static final String AUTOMAKE_ERROR_MARKER_ID = AutotoolsUIPlugin.PLUGIN_ID + ".parsefileerror"; //$NON-NLS-1$
private IDocument document;
private AnnotationModel fAnnotationModel;
- public static final String CDT_ANNOTATION_INFO = "org.eclipse.cdt.ui.info";
- public static final String CDT_ANNOTATION_WARNING = "org.eclipse.cdt.ui.warning";
- public static final String CDT_ANNOTATION_ERROR = "org.eclipse.cdt.ui.error";
+ public static final String CDT_ANNOTATION_INFO = "org.eclipse.cdt.ui.info"; //$NON-NLS-1$
+ public static final String CDT_ANNOTATION_WARNING = "org.eclipse.cdt.ui.warning"; //$NON-NLS-1$
+ public static final String CDT_ANNOTATION_ERROR = "org.eclipse.cdt.ui.error"; //$NON-NLS-1$
// TODO: no quickfixes yet implemented, but maybe in the future
private static class AutomakeAnnotation extends Annotation implements IQuickFixableAnnotation {
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeTextHover.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeTextHover.java
index 24a0d3d0951..49727c3ed20 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeTextHover.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakeTextHover.java
@@ -54,13 +54,13 @@ public class AutomakeTextHover implements ITextHover, ITextHoverExtension {
}
// Automatic variables
- if (hoverText.startsWith("$")) {
+ if (hoverText.startsWith("$")) { //$NON-NLS-1$
IDirective containingDirective = makefile.getDirectiveContainingLine(hoverLine);
if (containingDirective instanceof TargetRule) {
target = (TargetRule) containingDirective;
}
if (target == null)
- return "";
+ return ""; //$NON-NLS-1$
switch (hoverText.charAt(1)) {
case '@':
return target.getTarget().toString();
@@ -103,7 +103,7 @@ public class AutomakeTextHover implements ITextHover, ITextHoverExtension {
}
}
- return "";
+ return ""; //$NON-NLS-1$
}
@Override
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakefileCodeScanner.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakefileCodeScanner.java
index 5c220704ded..ce0f48e64e5 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakefileCodeScanner.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakefileCodeScanner.java
@@ -33,20 +33,17 @@ import org.eclipse.jface.text.rules.WordRule;
public class AutomakefileCodeScanner extends AbstractMakefileCodeScanner {
- private final static String[] keywords = { "define", "endef", "ifdef", "ifndef", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- "ifeq", "ifneq", "else", "endif", "include", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- "-include", "sinclude", "override", "endef", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- "export", "unexport", "vpath", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "if", "@if", "@endif" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- private final static String[] functions = { "subst", "patsubst", "strip", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "findstring", "filter", "sort", "dir", "notdir", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- "suffix", "basename", "addsuffix", "addprefix", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- "join", "word", "words", "wordlist", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- "firstword", "wildcard", "error", "warning", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- "shell", "origin", "foreach", "call" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- };
+ @SuppressWarnings("nls")
+ private final static String[] keywords = { "define", "endef", "ifdef", "ifndef", "ifeq", "ifneq", "else", "endif",
+ "include", "-include", "sinclude", "override", "endef", "export", "unexport", "vpath", "if", "@if",
+ "@endif" };
+ @SuppressWarnings("nls")
+ private final static String[] functions = { "subst", "patsubst", "strip", "findstring", "filter", "sort", "dir",
+ "notdir", "suffix", "basename", "addsuffix", "addprefix", "join", "word", "words", "wordlist", "firstword",
+ "wildcard", "error", "warning", "shell", "origin", "foreach", "call" };
+
+ @SuppressWarnings("nls")
private final static String[] automaticVariables = { "$<", "$*", "$@", "$?", "$%" };
static final String[] fTokenProperties = new String[] { ColorManager.MAKE_COMMENT_COLOR,
@@ -117,7 +114,7 @@ public class AutomakefileCodeScanner extends AbstractMakefileCodeScanner {
rules.add(new AutoconfIdentifierRule(other));
// Make sure we don't treat "\#" as comment start.
- rules.add(new SingleLineRule("\\#", null, Token.UNDEFINED));
+ rules.add(new SingleLineRule("\\#", null, Token.UNDEFINED)); //$NON-NLS-1$
rules.add(new WhitespaceRule(new AutoconfWhitespaceDetector()));
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakefileContentOutlinePage.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakefileContentOutlinePage.java
index 5e86a02d75d..3160bf7d118 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakefileContentOutlinePage.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/AutomakefileContentOutlinePage.java
@@ -189,10 +189,10 @@ public class AutomakefileContentOutlinePage extends ContentOutlinePage {
} else if (element instanceof AutomakeIfElse) {
AutomakeIfElse ifelse = (AutomakeIfElse) element;
// FIXME: make this not a string comparison
- if (ifelse.getType().equals("if")) {
- name = "if " + ifelse.getCondition();
+ if (ifelse.getType().equals("if")) { //$NON-NLS-1$
+ name = "if " + ifelse.getCondition(); //$NON-NLS-1$
} else
- name = "else";
+ name = "else"; //$NON-NLS-1$
} else if (element instanceof AutomakeConfigMacro) {
AutomakeConfigMacro macro = (AutomakeConfigMacro) element;
name = macro.getName();
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/GNUAutomakefile.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/GNUAutomakefile.java
index 0ebd0f89875..e3d41e3588d 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/GNUAutomakefile.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/GNUAutomakefile.java
@@ -573,7 +573,7 @@ public class GNUAutomakefile extends AbstractMakefile implements IGNUMakefile {
* An Autoconf directive of the form @xxx@
*/
protected AutomakeConfigMacro parseConfigMacro(String line) {
- String extraChars = "_-";
+ String extraChars = "_-"; //$NON-NLS-1$
char[] ch = line.toCharArray();
int i = 1;
while (Character.isLetterOrDigit(ch[i]) || extraChars.indexOf(ch[i]) >= 0) {
@@ -646,7 +646,7 @@ public class GNUAutomakefile extends AbstractMakefile implements IGNUMakefile {
}
directories = dirs.toArray(new String[0]);
if (pattern == null) {
- pattern = "";
+ pattern = ""; //$NON-NLS-1$
}
return new VPath(this, pattern, directories);
}
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/MakefilePartitionScanner.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/MakefilePartitionScanner.java
index cab5a77b6c3..0a0ef3acc2a 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/MakefilePartitionScanner.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/MakefilePartitionScanner.java
@@ -75,7 +75,7 @@ public class MakefilePartitionScanner extends RuleBasedPartitionScanner {
rules.add(new MultiLineRule("ifnneq", "endif", tIf)); //$NON-NLS-1$ //$NON-NLS-2$
// Last rule must be supplied with default token!
- rules.add(new MacroDefinitionRule(tMacro, tOther)); //$NON-NLS-1$
+ rules.add(new MacroDefinitionRule(tMacro, tOther));
IPredicateRule[] result = new IPredicateRule[rules.size()];
rules.toArray(result);
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/NullMakefile.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/NullMakefile.java
index bd461cee641..3b832e0c511 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/NullMakefile.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/NullMakefile.java
@@ -59,7 +59,7 @@ public class NullMakefile extends AbstractMakefile {
@Override
public String toString() {
- return "";
+ return ""; //$NON-NLS-1$
}
@Override
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/preferences/AbstractEditorPreferencePage.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/preferences/AbstractEditorPreferencePage.java
index 4ed3f92a270..f243f97dbb8 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/preferences/AbstractEditorPreferencePage.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/preferences/AbstractEditorPreferencePage.java
@@ -217,9 +217,9 @@ public abstract class AbstractEditorPreferencePage extends PreferencePage implem
try {
int value = Integer.parseInt(number);
if (value < 0)
- status.setError(MessageFormat.format(errorMessages[1], new Object[] { number })); //$NON-NLS-1$
+ status.setError(MessageFormat.format(errorMessages[1], new Object[] { number }));
} catch (NumberFormatException e) {
- status.setError(MessageFormat.format(errorMessages[1], new Object[] { number })); //$NON-NLS-1$
+ status.setError(MessageFormat.format(errorMessages[1], new Object[] { number }));
}
}
return status;
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/preferences/AutoconfEditorPreferencePage.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/preferences/AutoconfEditorPreferencePage.java
index d9cd8db9de8..ad5fbb43ba3 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/preferences/AutoconfEditorPreferencePage.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/preferences/AutoconfEditorPreferencePage.java
@@ -52,9 +52,11 @@ import org.eclipse.ui.model.WorkbenchViewerComparator;
*/
public class AutoconfEditorPreferencePage extends AbstractEditorPreferencePage {
+ @SuppressWarnings("nls")
private static String[] fACVersions = { "2.13", "2.59", "2.61", "2.68" };
public static final String LATEST_AC_VERSION = fACVersions[fACVersions.length - 1];
+ @SuppressWarnings("nls")
private static String[] fAMVersions = { "1.4-p6", "1.9.5", "1.9.6", "1.11.1" };
public static final String LATEST_AM_VERSION = fAMVersions[fAMVersions.length - 1];
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/preferences/AutotoolsEditorPreferenceConstants.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/preferences/AutotoolsEditorPreferenceConstants.java
index f25e4f793dd..ff52c98b411 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/preferences/AutotoolsEditorPreferenceConstants.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/preferences/AutotoolsEditorPreferenceConstants.java
@@ -59,9 +59,9 @@ public class AutotoolsEditorPreferenceConstants {
public static final String EDITOR_FOLDING_ENABLED = "editor_folding_enabled"; //$NON-NLS-1$
- public static final String AUTOCONF_VERSION = "autoconf_version";
+ public static final String AUTOCONF_VERSION = "autoconf_version"; //$NON-NLS-1$
- public static final String AUTOMAKE_VERSION = "automake_version";
+ public static final String AUTOMAKE_VERSION = "automake_version"; //$NON-NLS-1$
public static void initializeDefaultValues(IPreferenceStore store) {
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsBuildPropertyPage.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsBuildPropertyPage.java
index b394401485e..96970d81c87 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsBuildPropertyPage.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsBuildPropertyPage.java
@@ -70,7 +70,7 @@ public class AutotoolsBuildPropertyPage extends AbstractCBuildPropertyTab {
composite.setLayout(layout);
Group g = new Group(composite, SWT.SHADOW_ETCHED_IN);
- g.setText(AutotoolsPropertyMessages.getString("CleanBehavior.title"));
+ g.setText(AutotoolsPropertyMessages.getString("CleanBehavior.title")); //$NON-NLS-1$
gd = new GridData(
GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsCategoryPropertyOptionPage.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsCategoryPropertyOptionPage.java
index b0e137a947b..674c29cee97 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsCategoryPropertyOptionPage.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsCategoryPropertyOptionPage.java
@@ -43,7 +43,7 @@ import org.eclipse.swt.widgets.Text;
public class AutotoolsCategoryPropertyOptionPage extends AbstractConfigurePropertyOptionsPage {
private static final int MARGIN = 3;
- private String catName = "";
+ private String catName = ""; //$NON-NLS-1$
private IAConfiguration cfg;
// Label class for a preference page.
@@ -153,7 +153,7 @@ public class AutotoolsCategoryPropertyOptionPage extends AbstractConfigureProper
@Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
- newShell.setText(AutotoolsPropertyMessages.getString("NewEnvVarDialog.title"));
+ newShell.setText(AutotoolsPropertyMessages.getString("NewEnvVarDialog.title")); //$NON-NLS-1$
}
@Override
@@ -171,7 +171,7 @@ public class AutotoolsCategoryPropertyOptionPage extends AbstractConfigureProper
int fieldWidthHint = convertWidthInCharsToPixels(metrics, 50);
Label label = new Label(composite, SWT.NONE);
- label.setText(AutotoolsPropertyMessages.getString("NewEnvVarDialog.name_field"));
+ label.setText(AutotoolsPropertyMessages.getString("NewEnvVarDialog.name_field")); //$NON-NLS-1$
fTextName = new Text(composite, SWT.SINGLE | SWT.BORDER);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.grabExcessHorizontalSpace = true;
@@ -188,7 +188,7 @@ public class AutotoolsCategoryPropertyOptionPage extends AbstractConfigureProper
}
});
label = new Label(composite, SWT.NONE);
- label.setText(AutotoolsPropertyMessages.getString("NewEnvVarDialog.value_field"));
+ label.setText(AutotoolsPropertyMessages.getString("NewEnvVarDialog.value_field")); //$NON-NLS-1$
fTextValue = new Text(composite, SWT.SINGLE | SWT.BORDER);
gd = new GridData(GridData.FILL_BOTH);
gd.grabExcessHorizontalSpace = true;
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsConfigurePrefStore.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsConfigurePrefStore.java
index 4630aa371b9..5cef750f1b5 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsConfigurePrefStore.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsConfigurePrefStore.java
@@ -26,7 +26,7 @@ import org.eclipse.jface.util.PropertyChangeEvent;
*/
public class AutotoolsConfigurePrefStore implements IPreferenceStore {
- public final static String EMPTY_STRING = "";
+ public final static String EMPTY_STRING = ""; //$NON-NLS-1$
public final static String ALL_OPTIONS_ID = EMPTY_STRING;
private static AutotoolsConfigurePrefStore instance = null;
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsConfigurePropertyTab.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsConfigurePropertyTab.java
index 03a985a6636..5632d2c0b53 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsConfigurePropertyTab.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsConfigurePropertyTab.java
@@ -120,7 +120,7 @@ public class AutotoolsConfigurePropertyTab extends AbstractAutotoolsCPropertyTab
fTree.addSelectionChangedListener(event -> handleOptionSelection());
fTree.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
// Create a temporary default AutotoolsConfiguration to use for label info
- IAConfiguration tmp = AutotoolsConfigurationManager.getInstance().createDefaultConfiguration("");
+ IAConfiguration tmp = AutotoolsConfigurationManager.getInstance().createDefaultConfiguration(""); //$NON-NLS-1$
fTree.setLabelProvider(new ToolListLabelProvider(tmp));
}
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsEditorPropertyTab.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsEditorPropertyTab.java
index 72d2963bc60..fd148b990a6 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsEditorPropertyTab.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsEditorPropertyTab.java
@@ -92,8 +92,8 @@ public class AutotoolsEditorPropertyTab extends AbstractAutotoolsCPropertyTab {
acVer = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_VERSION);
amVer = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_VERSION);
} catch (CoreException e) {
- acVer = "";
- amVer = "";
+ acVer = ""; //$NON-NLS-1$
+ amVer = ""; //$NON-NLS-1$
}
int index = fACVersionCombo.getSelectionIndex();
String acVerSelected = fACVersionCombo.getItem(index);
@@ -179,7 +179,7 @@ public class AutotoolsEditorPropertyTab extends AbstractAutotoolsCPropertyTab {
}
void initializeACVersion() {
- String version = "";
+ String version = ""; //$NON-NLS-1$
try {
version = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_VERSION);
if (version == null)
@@ -202,7 +202,7 @@ public class AutotoolsEditorPropertyTab extends AbstractAutotoolsCPropertyTab {
}
void initializeAMVersion() {
- String version = "";
+ String version = ""; //$NON-NLS-1$
try {
version = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_VERSION);
if (version == null)
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsToolPropertyOptionPage.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsToolPropertyOptionPage.java
index c982fc7969f..541c2467a04 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsToolPropertyOptionPage.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsToolPropertyOptionPage.java
@@ -29,7 +29,7 @@ import org.eclipse.swt.widgets.Composite;
public class AutotoolsToolPropertyOptionPage extends AbstractConfigurePropertyOptionsPage {
private static final int MARGIN = 3;
- private String toolName = "";
+ private String toolName = ""; //$NON-NLS-1$
private IAConfiguration cfg;
public AutotoolsToolPropertyOptionPage(ToolListElement element, IAConfiguration cfg) {
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsToolsPropertyTab.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsToolsPropertyTab.java
index 39931cc1419..d72ab455d91 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsToolsPropertyTab.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/properties/AutotoolsToolsPropertyTab.java
@@ -89,7 +89,7 @@ public class AutotoolsToolsPropertyTab extends AbstractAutotoolsCPropertyTab {
/* text window for automake path */
fAutomakePath = new Text(composite, SWT.BORDER | SWT.SINGLE);
- fAutomakePath.setToolTipText(AutotoolsPropertyMessages.getString("Autotools.automakePath.tooltip")); //$NON-NLS-1#
+ fAutomakePath.setToolTipText(AutotoolsPropertyMessages.getString("Autotools.automakePath.tooltip")); //$NON-NLS-1$
gd = new GridData(
GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
fAutomakePath.setLayoutData(gd);
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/text/hover/AutoconfTextHover.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/text/hover/AutoconfTextHover.java
index 9217a88d08b..39ce54a840c 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/text/hover/AutoconfTextHover.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/text/hover/AutoconfTextHover.java
@@ -73,8 +73,8 @@ import org.xml.sax.SAXException;
public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
- public static final String LOCAL_AUTOCONF_MACROS_DOC_NAME = "macros/acmacros";
- public static final String LOCAL_AUTOMAKE_MACROS_DOC_NAME = "macros/ammacros";
+ public static final String LOCAL_AUTOCONF_MACROS_DOC_NAME = "macros/acmacros"; //$NON-NLS-1$
+ public static final String LOCAL_AUTOMAKE_MACROS_DOC_NAME = "macros/ammacros"; //$NON-NLS-1$
public static final String AUTOCONF_MACROS_DOC_NAME = "http://www.sourceware.org/eclipse/autotools/acmacros"; //$NON-NLS-1$
public static final String AUTOMAKE_MACROS_DOC_NAME = "http://www.sourceware.org/eclipse/autotools/ammacros"; //$NON-NLS-1$
@@ -296,7 +296,7 @@ public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
Element elem = document.getElementById(name);
if (null != elem) {
int prototypeCount = 0;
- buffer.append("<B>Macro:</B> ").append(name);
+ buffer.append("<B>Macro:</B> ").append(name); //$NON-NLS-1$
NodeList nl = elem.getChildNodes();
for (int i = 0; i < nl.getLength(); ++i) {
Node n = nl.item(i);
@@ -305,11 +305,11 @@ public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
StringBuilder prototype = new StringBuilder();
++prototypeCount;
if (prototypeCount == 1) {
- buffer.append(" (");
+ buffer.append(" ("); //$NON-NLS-1$
} else {
- buffer.append(" <B>or</B> "); //$NON-NLS-2$
+ buffer.append(" <B>or</B> "); //$NON-NLS-1$
buffer.append(name);
- buffer.append(" (<I>"); //$NON-NLS-2$
+ buffer.append(" (<I>"); //$NON-NLS-1$
}
NodeList varList = n.getChildNodes();
for (int j = 0; j < varList.getLength(); ++j) {
@@ -322,14 +322,14 @@ public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
if (prototype.length() == 0)
prototype.append(parm);
else
- prototype.append(", ").append(parm);
+ prototype.append(", ").append(parm); //$NON-NLS-1$
}
}
buffer.append(prototype).append("</I>)<br>"); //$NON-NLS-1$
}
if (nodeName.equals("synopsis")) { //$NON-NLS-1$
Node textNode = n.getLastChild();
- buffer.append("<br><B>Synopsis:</B> ");
+ buffer.append("<br><B>Synopsis:</B> "); //$NON-NLS-1$
buffer.append(textNode.getNodeValue());
}
}
@@ -444,11 +444,11 @@ public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
String parm = parmNode.getNodeValue();
// Check for first optional parameter which means
// we know the minimum number of parameters needed.
- if (minParmCount < 0 && (parm.charAt(0) == '[' || parm.startsWith("...")))
+ if (minParmCount < 0 && (parm.charAt(0) == '[' || parm.startsWith("..."))) //$NON-NLS-1$
minParmCount = parmCount - 1;
// Old style documentation sometimes had '[' in
// prototypes so look for one at end of a parm too.
- else if (minParmCount < 0 && parm.endsWith("["))
+ else if (minParmCount < 0 && parm.endsWith("[")) //$NON-NLS-1$
minParmCount = parmCount;
p.setParmName(prototypeCount, parmCount - 1, parm);
}
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/wizards/AutotoolsProjectImportWizardPage.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/wizards/AutotoolsProjectImportWizardPage.java
index 501032e3603..d71a7c1d37b 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/wizards/AutotoolsProjectImportWizardPage.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/wizards/AutotoolsProjectImportWizardPage.java
@@ -50,8 +50,8 @@ public class AutotoolsProjectImportWizardPage extends NewMakeProjFromExistingPag
private Button langcpp;
protected AutotoolsProjectImportWizardPage() {
- setTitle(AutotoolsWizardMessages.getResourceString("ImportWizardPage.title"));
- setDescription(AutotoolsWizardMessages.getResourceString("ImportWizardPage.description"));
+ setTitle(AutotoolsWizardMessages.getResourceString("ImportWizardPage.title")); //$NON-NLS-1$
+ setDescription(AutotoolsWizardMessages.getResourceString("ImportWizardPage.description")); //$NON-NLS-1$
}
protected IProjectType getProjectType() {
@@ -110,10 +110,10 @@ public class AutotoolsProjectImportWizardPage extends NewMakeProjFromExistingPag
AutotoolsUIPlugin.getResourceString("WizardMakeProjectConversion.monitor.convertingToMakeProject"), 7); //$NON-NLS-1$
IConfiguration defaultCfg = null;
try {
- monitor.subTask(AutotoolsUIPlugin.getResourceString("adding project nature"));
+ monitor.subTask(AutotoolsUIPlugin.getResourceString("adding project nature")); //$NON-NLS-1$
ManagedCProjectNature.addManagedNature(project, SubMonitor.convert(monitor, 1));
AutotoolsNewProjectNature.addAutotoolsNature(project, SubMonitor.convert(monitor, 1));
- monitor.subTask(AutotoolsUIPlugin.getResourceString("adding builder"));
+ monitor.subTask(AutotoolsUIPlugin.getResourceString("adding builder")); //$NON-NLS-1$
AutotoolsNewProjectNature.addAutotoolsBuilder(project, SubMonitor.convert(monitor, 1));
project.setPersistentProperty(AutotoolsPropertyConstants.SCANNER_USE_MAKE_W,
AutotoolsPropertyConstants.TRUE);
@@ -167,7 +167,7 @@ public class AutotoolsProjectImportWizardPage extends NewMakeProjFromExistingPag
}
// Save the build options
- monitor.subTask(AutotoolsUIPlugin.getResourceString("saving project"));
+ monitor.subTask(AutotoolsUIPlugin.getResourceString("saving project")); //$NON-NLS-1$
if (info != null) {
info.setValid(true);
ManagedBuildManager.saveBuildInfo(project, true);
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/wizards/ConfigurationLabelProvider.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/wizards/ConfigurationLabelProvider.java
index 172691d0fc2..ef3d3a40c6c 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/wizards/ConfigurationLabelProvider.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/wizards/ConfigurationLabelProvider.java
@@ -34,7 +34,7 @@ public class ConfigurationLabelProvider extends LabelProvider implements ITableL
else
return (tmpConfig.getName() + " ( " + tmpConfig.getDescription() + " )"); //$NON-NLS-1$ //$NON-NLS-2$
}
- return "";
+ return ""; //$NON-NLS-1$
}
@Override
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/wizards/ConvertToAutotoolsProjectWizardPage.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/wizards/ConvertToAutotoolsProjectWizardPage.java
index ef85c2263d3..282c4d9d633 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/wizards/ConvertToAutotoolsProjectWizardPage.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/wizards/ConvertToAutotoolsProjectWizardPage.java
@@ -55,9 +55,9 @@ import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
*/
public class ConvertToAutotoolsProjectWizardPage extends ConvertProjectWizardPage {
- private static final String WZ_TITLE = "WizardAutotoolsProjectConversion.title"; //$NON-NLS-1$
- private static final String WZ_DESC = "WizardAutotoolsProjectConversion.description"; //$NON-NLS-1$
- private static final String PREFIX = "WizardAutotoolsProjectConversion";
+ private static final String PREFIX = "WizardAutotoolsProjectConversion"; //$NON-NLS-1$
+ private static final String WZ_TITLE = PREFIX + ".title"; //$NON-NLS-1$
+ private static final String WZ_DESC = PREFIX + ".description"; //$NON-NLS-1$
protected static final String MSG_ADD_NATURE = PREFIX + ".message.add_nature"; //$NON-NLS-1$
protected static final String MSG_ADD_BUILDER = PREFIX + ".message.add_builder"; //$NON-NLS-1$
protected static final String MSG_SAVE = PREFIX + ".message.save"; //$NON-NLS-1$
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/wizards/ReferenceBlock.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/wizards/ReferenceBlock.java
index 6177dabacfe..928d4bc024b 100644
--- a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/wizards/ReferenceBlock.java
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/wizards/ReferenceBlock.java
@@ -171,7 +171,7 @@ public class ReferenceBlock extends AbstractCOptionPage {
if (monitor == null) {
monitor = new NullProgressMonitor();
}
- monitor.beginTask(AutotoolsWizardMessages.getResourceString("ReferenceBlock_task_ReferenceProjects"), 1);
+ monitor.beginTask(AutotoolsWizardMessages.getResourceString("ReferenceBlock_task_ReferenceProjects"), 1); //$NON-NLS-1$
try {
IProjectDescription description = project.getDescription();
description.setReferencedProjects(refProjects);
diff --git a/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/internal/GCCPathToolChainProvider.java b/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/internal/GCCPathToolChainProvider.java
index 3ba8b73df42..9f4cedd39c6 100644
--- a/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/internal/GCCPathToolChainProvider.java
+++ b/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/internal/GCCPathToolChainProvider.java
@@ -77,10 +77,10 @@ public class GCCPathToolChainProvider implements IToolChainProvider {
break;
default:
switch (tuple[2]) {
- case "linux":
+ case "linux": //$NON-NLS-1$
gcc.setProperty(IToolChain.ATTR_OS, Platform.OS_LINUX);
break;
- case "elf":
+ case "elf": //$NON-NLS-1$
gcc.setProperty(IToolChain.ATTR_OS, tuple[1]);
break;
}
diff --git a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java
index 31e9d3c8a0f..5e89c87c2f5 100644
--- a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java
+++ b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java
@@ -35,12 +35,12 @@ import org.eclipse.cdt.core.envvar.EnvironmentVariable;
import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
import org.eclipse.cdt.core.model.ICModelMarker;
import org.eclipse.cdt.core.resources.IConsole;
-import org.eclipse.cdt.utils.Platform;
import org.eclipse.core.resources.IBuildConfiguration;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.jobs.Job;
import com.google.gson.Gson;
diff --git a/build/org.eclipse.cdt.cmake.ui/src/org/eclipse/cdt/cmake/internal/ui/properties/CMakePropertyPage.java b/build/org.eclipse.cdt.cmake.ui/src/org/eclipse/cdt/cmake/internal/ui/properties/CMakePropertyPage.java
index 3a863f2dd27..290aa8af8c8 100644
--- a/build/org.eclipse.cdt.cmake.ui/src/org/eclipse/cdt/cmake/internal/ui/properties/CMakePropertyPage.java
+++ b/build/org.eclipse.cdt.cmake.ui/src/org/eclipse/cdt/cmake/internal/ui/properties/CMakePropertyPage.java
@@ -95,7 +95,7 @@ public class CMakePropertyPage extends PropertyPage {
if (launcher instanceof ICBuildCommandLauncher) {
((ICBuildCommandLauncher) launcher).setBuildConfiguration(cconfig);
}
- IPath buildPath = project.getLocation().append("build")
+ IPath buildPath = project.getLocation().append("build") //$NON-NLS-1$
.append(((CBuildConfiguration) cconfig).getName());
Process p = launcher.execute(new Path("cmake"), new String[] { "-LAH", "." }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
new String[0], buildPath, new NullProgressMonitor());
@@ -153,7 +153,7 @@ public class CMakePropertyPage extends PropertyPage {
args.add("-LAH"); //$NON-NLS-1$
for (ICMakePropertyPageControl control : componentList) {
if (control.isValueChanged()) {
- args.add(control.getConfiguredString()); //$NON-NLS-1$ //$NON-NLS-2$
+ args.add(control.getConfiguredString());
}
}
if (args.size() == 2) {
@@ -170,7 +170,7 @@ public class CMakePropertyPage extends PropertyPage {
if (launcher instanceof ICBuildCommandLauncher) {
((ICBuildCommandLauncher) launcher).setBuildConfiguration(buildConfig);
}
- args.add(".");
+ args.add("."); //$NON-NLS-1$
Process p = launcher.execute(new Path("cmake"), args.toArray(new String[0]), new String[0], buildDir, //$NON-NLS-1$
new NullProgressMonitor());
int rc = -1;
@@ -259,19 +259,19 @@ public class CMakePropertyPage extends PropertyPage {
String optionString = optionMatcher.group(1).trim();
String[] options = optionString.split("\\s+"); //$NON-NLS-1$
for (int i = 0; i < options.length; ++i) {
- options[i] = options[i].replaceAll("\\(.*?\\)", "").trim(); //$NON-NLS-1$
+ options[i] = options[i].replaceAll("\\(.*?\\)", "").trim(); //$NON-NLS-1$ //$NON-NLS-2$
}
ICMakePropertyPageControl control = new CMakePropertyCombo(composite, name, options,
initialValue, lastComment);
controls.add(control);
} else {
- if ("BOOL".equals(type)) {
- if ("ON".equals(initialValue) || ("OFF".equals(initialValue))) {
+ if ("BOOL".equals(type)) { //$NON-NLS-1$
+ if ("ON".equals(initialValue) || ("OFF".equals(initialValue))) { //$NON-NLS-1$ //$NON-NLS-2$
ICMakePropertyPageControl control = new CMakePropertyCombo(composite, name,
new String[] { "ON", "OFF" }, //$NON-NLS-1$ //$NON-NLS-2$
initialValue, lastComment);
controls.add(control);
- } else if ("YES".equals(initialValue) || "NO".equals(initialValue)) {
+ } else if ("YES".equals(initialValue) || "NO".equals(initialValue)) { //$NON-NLS-1$ //$NON-NLS-2$
ICMakePropertyPageControl control = new CMakePropertyCombo(composite, name,
new String[] { "YES", "NO" }, //$NON-NLS-1$ //$NON-NLS-2$
initialValue, lastComment);
diff --git a/build/org.eclipse.cdt.core.autotools.core/src/org/eclipse/cdt/core/autotools/core/AutotoolsProjectGenerator.java b/build/org.eclipse.cdt.core.autotools.core/src/org/eclipse/cdt/core/autotools/core/AutotoolsProjectGenerator.java
index 90f90e4c2e9..f17902ad057 100644
--- a/build/org.eclipse.cdt.core.autotools.core/src/org/eclipse/cdt/core/autotools/core/AutotoolsProjectGenerator.java
+++ b/build/org.eclipse.cdt.core.autotools.core/src/org/eclipse/cdt/core/autotools/core/AutotoolsProjectGenerator.java
@@ -80,7 +80,7 @@ public class AutotoolsProjectGenerator extends FMProjectGenerator {
}
}
- entries.add(CoreModel.newOutputEntry(getProject().getFullPath())); //$NON-NLS-1$
+ entries.add(CoreModel.newOutputEntry(getProject().getFullPath()));
CoreModel.getDefault().create(project).setRawPathEntries(entries.toArray(new IPathEntry[entries.size()]),
monitor);
diff --git a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/builder/tests/CDataProviderTests.java b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/builder/tests/CDataProviderTests.java
index 9c8f6df033d..b058c29c43b 100644
--- a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/builder/tests/CDataProviderTests.java
+++ b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/builder/tests/CDataProviderTests.java
@@ -31,6 +31,7 @@ import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
+@SuppressWarnings("nls")
public class CDataProviderTests extends TestCase {
/**
* @param name
diff --git a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/builder/tests/StandardBuildTests.java b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/builder/tests/StandardBuildTests.java
index 946608453a6..d94a4269dd4 100644
--- a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/builder/tests/StandardBuildTests.java
+++ b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/builder/tests/StandardBuildTests.java
@@ -39,6 +39,7 @@ import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
+@SuppressWarnings("nls")
public class StandardBuildTests extends TestCase {
private static final boolean OFF = false;
private static final boolean ON = true;
diff --git a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/core/tests/MakeTestsPlugin.java b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/core/tests/MakeTestsPlugin.java
index e9d67f59bfb..243ae7c5a4d 100644
--- a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/core/tests/MakeTestsPlugin.java
+++ b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/core/tests/MakeTestsPlugin.java
@@ -22,6 +22,7 @@ import org.osgi.framework.BundleContext;
/**
* The main plugin class to be used in the desktop.
*/
+@SuppressWarnings("nls")
public class MakeTestsPlugin extends Plugin {
//The shared instance.
private static MakeTestsPlugin plugin;
diff --git a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/core/tests/MakefileReaderProviderTests.java b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/core/tests/MakefileReaderProviderTests.java
index 1bfae57911a..a155f7eaa86 100644
--- a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/core/tests/MakefileReaderProviderTests.java
+++ b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/core/tests/MakefileReaderProviderTests.java
@@ -39,6 +39,7 @@ import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
+@SuppressWarnings("nls")
public class MakefileReaderProviderTests extends TestCase {
private String[] inclDirs;
diff --git a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/core/tests/StandardBuildTestHelper.java b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/core/tests/StandardBuildTestHelper.java
index f45aa656278..553f6fa78ea 100644
--- a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/core/tests/StandardBuildTestHelper.java
+++ b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/core/tests/StandardBuildTestHelper.java
@@ -32,6 +32,7 @@ import org.eclipse.core.runtime.Path;
import junit.framework.Assert;
+@SuppressWarnings("nls")
public class StandardBuildTestHelper {
/* (non-Javadoc)
* Create a new project named <code>name</code> or return the project in
diff --git a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/GCCPerFileBOPConsoleParserTests.java b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/GCCPerFileBOPConsoleParserTests.java
index 76d5d99688d..a1fa688f8cd 100644
--- a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/GCCPerFileBOPConsoleParserTests.java
+++ b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/GCCPerFileBOPConsoleParserTests.java
@@ -33,6 +33,7 @@ import org.eclipse.core.runtime.Path;
import junit.framework.TestSuite;
+@SuppressWarnings("nls")
public class GCCPerFileBOPConsoleParserTests extends BaseBOPConsoleParserTests {
private final static IMarkerGenerator MARKER_GENERATOR = new IMarkerGenerator() {
@Override
diff --git a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/ScannerConfigDiscoveryTests.java b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/ScannerConfigDiscoveryTests.java
index c64067130f0..eca38bad4dd 100644
--- a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/ScannerConfigDiscoveryTests.java
+++ b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/ScannerConfigDiscoveryTests.java
@@ -38,6 +38,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
*
* @author vhirsl
*/
+@SuppressWarnings("nls")
public class ScannerConfigDiscoveryTests extends BaseTestCase {
private IProject fCProject = null;
private IFile fCFile = null;
diff --git a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/ScannerConfigProfileTests.java b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/ScannerConfigProfileTests.java
index 34055e1da26..0eb43d73dd1 100644
--- a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/ScannerConfigProfileTests.java
+++ b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/ScannerConfigProfileTests.java
@@ -31,6 +31,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
/**
* This class tests ScannerConfigProfileManager
*/
+@SuppressWarnings("nls")
public class ScannerConfigProfileTests extends BaseTestCase {
private IProject fCProject = null;
private IFile fCFile = null;
diff --git a/build/org.eclipse.cdt.make.core/META-INF/MANIFEST.MF b/build/org.eclipse.cdt.make.core/META-INF/MANIFEST.MF
index 910dce7768e..0746a1e9542 100644
--- a/build/org.eclipse.cdt.make.core/META-INF/MANIFEST.MF
+++ b/build/org.eclipse.cdt.make.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.make.core; singleton:=true
-Bundle-Version: 7.4.200.qualifier
+Bundle-Version: 7.4.300.qualifier
Bundle-Activator: org.eclipse.cdt.make.core.MakeCorePlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -19,7 +19,7 @@ Export-Package: org.eclipse.cdt.make.core,
org.eclipse.cdt.make.internal.core.scannerconfig.jobs;x-internal:=true,
org.eclipse.cdt.make.internal.core.scannerconfig.util;x-internal:=true,
org.eclipse.cdt.make.internal.core.scannerconfig2;x-internal:=true
-Require-Bundle: org.eclipse.cdt.core;bundle-version="[5.0.0,7.0.0)",
+Require-Bundle: org.eclipse.cdt.core;bundle-version="[7.0.0,8.0.0)",
org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
org.eclipse.core.variables;bundle-version="[3.1.100,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
diff --git a/build/org.eclipse.cdt.make.ui/META-INF/MANIFEST.MF b/build/org.eclipse.cdt.make.ui/META-INF/MANIFEST.MF
index 06a9395261b..0a80acfb022 100644
--- a/build/org.eclipse.cdt.make.ui/META-INF/MANIFEST.MF
+++ b/build/org.eclipse.cdt.make.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.make.ui; singleton:=true
-Bundle-Version: 7.3.400.qualifier
+Bundle-Version: 8.0.0.qualifier
Bundle-Activator: org.eclipse.cdt.make.internal.ui.MakeUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -28,7 +28,7 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)",
org.eclipse.ui.editors;bundle-version="[3.2.0,4.0.0)",
org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.cdt.core;bundle-version="[5.0.0,7.0.0)",
+ org.eclipse.cdt.core;bundle-version="[7.0.0,8.0.0)",
org.eclipse.cdt.ui;bundle-version="[7.0.0,8.0.0)",
org.eclipse.cdt.make.core;bundle-version="[7.0.0,8.1.0)",
org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
@@ -41,5 +41,4 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)",
org.eclipse.cdt.launch;bundle-version="9.2.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Import-Package: com.ibm.icu.text
Automatic-Module-Name: org.eclipse.cdt.make.ui
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeEnvironmentBlock.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeEnvironmentBlock.java
index de4e28f8d14..0965433fa65 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeEnvironmentBlock.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeEnvironmentBlock.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2015 QNX Software Systems and others.
+ * Copyright (c) 2004, 2020 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,9 +10,11 @@
*
* Contributors:
* QNX Software Systems - initial API and implementation
+ * Sergei Kovalchuk (NXP) - Switch dependency from com.ibm.icu to java.text
*******************************************************************************/
package org.eclipse.cdt.make.internal.ui;
+import java.text.MessageFormat;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Hashtable;
@@ -68,8 +70,6 @@ import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.ui.dialogs.ListSelectionDialog;
-import com.ibm.icu.text.MessageFormat;
-
/**
* @deprecated as of CDT 4.0. This tab was used to set preferences/properties
* for 3.X style projects.
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties
index 0b891312884..f6b7cc42994 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties
@@ -15,8 +15,6 @@
# IBM Corporation
###############################################################################
-MakeCWizard.title=C/Make Project
-MakeCWizard.description=Create a New C Project using 'make' to build it
MakeEnvironmentBlock.10=&Remove
MakeEnvironmentBlock.11=New Environment Variable
MakeEnvironmentBlock.12=Overwrite variable?
@@ -26,11 +24,7 @@ MakeEnvironmentBlock.15=Select Environment Variables
MakeEnvironmentBlock.16=Edit Environment Variable
MakeEnvironmentBlock.17=&Append environment to native environment
MakeEnvironmentBlock.18=Re&place native environment with specified environment
-MakeCWizard.task_name=Creating C project with Make builder...
-MakeCCWizard.title=C++/Make Project
-MakeCCWizard.description=Create a New C++ Project using 'make' to build it
-MakeCCWizard.task_name=Creating C++ project with Make builder...
MakeEnvironmentBlock.0=Variable
MakeEnvironmentBlock.1=Value
MakeEnvironmentBlock.2=&Name:
@@ -42,15 +36,6 @@ MakeEnvironmentBlock.7=N&ew...
MakeEnvironmentBlock.8=Se&lect...
MakeEnvironmentBlock.9=E&dit...
-MakeCWizardSettings.title=C/Make Project Settings
-MakeCWizardSettings.description=Define the project and 'make' builder settings
-
-MakeCCWizardSettings.title=C++/Make Project Settings
-MakeCCWizardSettings.description=Define the project and 'make' builder settings
-
-WizardMakeProjectConversion.title=Convert to a C/C++ project
-WizardMakeProjectConversion.description=The wizard adds C/C++ Nature to the selected projects to enable C/C++ Tools Support for them.
-WizardMakeProjectConversion.monitor.convertingToMakeProject=Converting to C/C++ Project...
WizardMakeProjectConversion.projectOptions.title=Project options
WizardMakeProjectConversion.projectOptions.projectType=Specify project type
WizardMakeProjectConversion.projectOptions.projectTypeTable=Project type:
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/actions/FoldingMessages.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/actions/FoldingMessages.java
index cf18a1f6ce0..60730ebe5a4 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/actions/FoldingMessages.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/actions/FoldingMessages.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -11,17 +11,17 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Patrick Hofer - Bug 326265
+ * Sergei Kovalchuk (NXP) - Switch dependency from com.ibm.icu to java.text
*******************************************************************************/
// this file is based on org.eclipse.cdt.internal.ui.actions.FoldingMessages
package org.eclipse.cdt.make.internal.ui.actions;
+import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-import com.ibm.icu.text.MessageFormat;
-
/**
* Class that gives access to the folding messages resource bundle.
*/
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/MakeTargetDndUtil.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/MakeTargetDndUtil.java
index 135321b5871..aae59fc88ec 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/MakeTargetDndUtil.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/MakeTargetDndUtil.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2011 Andrew Gvozdev.
+ * Copyright (c) 2008, 2020 Andrew Gvozdev and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,11 +10,13 @@
*
* Contributors:
* Andrew Gvozdev (Quoin Inc.) - Initial implementation
+ * Sergei Kovalchuk (NXP) - Switch dependency from com.ibm.icu to java.text
*******************************************************************************/
package org.eclipse.cdt.make.internal.ui.dnd;
import java.lang.reflect.InvocationTargetException;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
@@ -43,8 +45,6 @@ import org.eclipse.swt.SWTException;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.widgets.Shell;
-import com.ibm.icu.text.MessageFormat;
-
/**
* A collection of various functions for Make Target View drag and drop support.
*/
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/TextTransferDropTargetListener.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/TextTransferDropTargetListener.java
index 2da17066acf..e29fd2ff4d0 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/TextTransferDropTargetListener.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/dnd/TextTransferDropTargetListener.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2016 Andrew Gvozdev.
+ * Copyright (c) 2008, 2020 Andrew Gvozdev and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,10 +10,12 @@
*
* Contributors:
* Andrew Gvozdev (Quoin Inc.) - Initial implementation
+ * Sergei Kovalchuk (NXP) - Switch dependency from com.ibm.icu to java.text
*******************************************************************************/
package org.eclipse.cdt.make.internal.ui.dnd;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
@@ -28,8 +30,6 @@ import org.eclipse.swt.dnd.TextTransfer;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.widgets.Shell;
-import com.ibm.icu.text.MessageFormat;
-
/**
* {@code TextTransferDropTargetListener} handles dropping of selected text to
* Make Target View. Each line of miltiline text passed is treated as separate
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/WizardCheckboxTablePart.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/WizardCheckboxTablePart.java
index db8f2a27ddd..66d451977d7 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/WizardCheckboxTablePart.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/part/WizardCheckboxTablePart.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,9 +10,12 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Sergei Kovalchuk (NXP) - Switch dependency from com.ibm.icu to java.text
*******************************************************************************/
package org.eclipse.cdt.make.internal.ui.part;
+import java.text.MessageFormat;
+
import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.StructuredViewer;
@@ -22,8 +25,6 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
-import com.ibm.icu.text.MessageFormat;
-
/**
* @version 1.0
*/
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/AbstractMakefileEditorPreferencePage.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/AbstractMakefileEditorPreferencePage.java
index 9dfe6de71aa..9e893457641 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/AbstractMakefileEditorPreferencePage.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/preferences/AbstractMakefileEditorPreferencePage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2002, 2016 QNX Software Systems and others.
+ * Copyright (c) 2002, 2020 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,6 +10,7 @@
*
* Contributors:
* QNX Software Systems - Initial API and implementation
+ * Sergei Kovalchuk (NXP) - Switch dependency from com.ibm.icu to java.text
*******************************************************************************/
package org.eclipse.cdt.make.internal.ui.preferences;
@@ -17,6 +18,7 @@ package org.eclipse.cdt.make.internal.ui.preferences;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
+import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@@ -42,8 +44,6 @@ import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
-import com.ibm.icu.text.MessageFormat;
-
/**
* AbstraceMakeEditorPreferencePage
*/
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/IMakeHelpContextIds.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/IMakeHelpContextIds.java
index 10c6557f44a..74f0991f05e 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/IMakeHelpContextIds.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/IMakeHelpContextIds.java
@@ -28,13 +28,6 @@ public interface IMakeHelpContextIds {
public static final String SCANNER_CONFIG_DISCOVERY_OPTIONS = PREFIX + "discovery_preferences"; //$NON-NLS-1$
public static final String MAKE_PROP_DISCOVERY = PREFIX + "std_prop_discovery"; //$NON-NLS-1$
public static final String MAKE_VIEW = PREFIX + "make_targets_view"; //$NON-NLS-1$
- public static final String MAKE_PROJ_WIZ_NAME_PAGE = PREFIX + "new_proj_wiz_s_name"; //$NON-NLS-1$
- public static final String MAKE_PROJ_WIZ_PROJECTS_TAB = PREFIX + "new_proj_wiz_s_proj"; //$NON-NLS-1$
- public static final String MAKE_PROJ_WIZ_MAKEBUILDER_TAB = PREFIX + "new_proj_wiz_s_mbuilder"; //$NON-NLS-1$
- public static final String MAKE_PROJ_WIZ_ERRORPARSER_TAB = PREFIX + "new_proj_wiz_s_errorp"; //$NON-NLS-1$
- public static final String MAKE_PROJ_WIZ_BINARYPARSER_TAB = PREFIX + "new_proj_wiz_s_binary"; //$NON-NLS-1$
- public static final String MAKE_PROJ_WIZ_DISCOVERY_TAB = PREFIX + "new_proj_wiz_s_discovery"; //$NON-NLS-1$
- public static final String MAKE_PROJ_WIZ_INDEXER_TAB = PREFIX + "new_proj_wiz_s_cindexer"; //$NON-NLS-1$
public static final String MAKE_PROP_ERROR_PARSER = PREFIX + "std_prop_error"; //$NON-NLS-1$
public static final String MAKE_PROP_BINARY_PARSER = PREFIX + "std_prop_binary"; //$NON-NLS-1$
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/DeleteTargetAction.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/DeleteTargetAction.java
index ce35cf9faad..4f3e4f98bc6 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/DeleteTargetAction.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/DeleteTargetAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 QNX Software Systems and others.
+ * Copyright (c) 2000, 2020 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,9 +10,11 @@
*
* Contributors:
* QNX Software Systems - Initial API and implementation
+ * Sergei Kovalchuk (NXP) - Switch dependency from com.ibm.icu to java.text
*******************************************************************************/
package org.eclipse.cdt.make.ui.views;
+import java.text.MessageFormat;
import java.util.List;
import org.eclipse.cdt.make.core.IMakeTarget;
@@ -30,8 +32,6 @@ import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.SelectionListenerAction;
-import com.ibm.icu.text.MessageFormat;
-
/**
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/ConvertToMakeProjectWizard.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/ConvertToMakeProjectWizard.java
deleted file mode 100644
index 8d35034f16e..00000000000
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/ConvertToMakeProjectWizard.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2010 QNX Software Systems and others.
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.make.ui.wizards;
-
-import org.eclipse.cdt.make.core.MakeCorePlugin;
-import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
-import org.eclipse.cdt.ui.wizards.conversion.ConversionWizard;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.wizard.Wizard;
-
-/**
- * This wizard provides a method by which the user can
- * add a C nature to a project that previously had no nature associated with it.
- *
- * This wizard was used for 3.X style projects. It is left here for compatibility
- * reasons only. The wizard is superseded by MBS Project Conversion Wizard,
- * class {@code org.eclipse.cdt.managedbuilder.ui.wizards.ConvertToMakeWizard}.
- *
- * @deprecated as of CDT 4.0.
- *
- * @noextend This class is not intended to be subclassed by clients.
- * @noinstantiate This class is not intended to be instantiated by clients.
- */
-@Deprecated
-public class ConvertToMakeProjectWizard extends ConversionWizard {
-
- private static final String WZ_TITLE = "WizardMakeProjectConversion.title"; //$NON-NLS-1$
- private static final String WZ_DESC = "WizardMakeProjectConversion.description"; //$NON-NLS-1$
- private static final String PREFIX = "WizardMakeConversion"; //$NON-NLS-1$
- private static final String WINDOW_TITLE = "WizardMakeConversion.windowTitle"; //$NON-NLS-1$
-
- /**
- * ConvertToStdMakeConversionWizard Wizard constructor
- */
- public ConvertToMakeProjectWizard() {
- this(getWindowTitleResource(), getWzDescriptionResource());
- }
-
- /**
- * ConvertToStdMakeConversionWizard Wizard constructor
- */
- public ConvertToMakeProjectWizard(String title, String desc) {
- super(title, desc);
- }
-
- /**
- * Method getWzDescriptionResource, allows Wizard description label value
- * to be changed by subclasses
- *
- * @return String
- */
- protected static String getWzDescriptionResource() {
- return MakeUIPlugin.getResourceString(WZ_DESC);
- }
-
- /**
- * Method getWzTitleResource, allows Wizard description label value
- * to be changed by subclasses
- *
- * @return String
- */
- protected static String getWzTitleResource() {
- return MakeUIPlugin.getResourceString(WZ_TITLE);
- }
-
- /**
- * Method getWindowTitleResource, allows Wizard Title label value to be
- * changed by subclasses
- *
- * @return String
- */
- protected static String getWindowTitleResource() {
- return MakeUIPlugin.getResourceString(WINDOW_TITLE);
- }
-
- /**
- * Method getPrefix, allows prefix value to be changed by subclasses
- *
- * @return String
- */
- protected static String getPrefix() {
- return PREFIX;
- }
-
- /**
- * Method addPages adds our Simple to C conversion Wizard page.
- *
- * @see Wizard#addPages
- */
- @Override
- public void addPages() {
- addPage(mainPage = new ConvertToMakeProjectWizardPage(getPrefix()));
- }
-
- @Override
- public String getProjectID() {
- return MakeCorePlugin.MAKE_PROJECT_ID;
- }
-
- @Override
- protected void doRun(IProgressMonitor monitor) throws CoreException {
- monitor.beginTask(MakeUIPlugin.getResourceString("WizardMakeProjectConversion.monitor.convertingToMakeProject"), //$NON-NLS-1$
- 2);
- try {
- super.doRun(new SubProgressMonitor(monitor, 1));
- } finally {
- monitor.done();
- }
- }
-}
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/ConvertToMakeProjectWizardPage.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/ConvertToMakeProjectWizardPage.java
deleted file mode 100644
index df7effb66f1..00000000000
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/ConvertToMakeProjectWizardPage.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2010 QNX Software Systems and others.
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.make.ui.wizards;
-
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.make.core.MakeProjectNature;
-import org.eclipse.cdt.make.core.scannerconfig.ScannerConfigNature;
-import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
-import org.eclipse.cdt.ui.wizards.conversion.ConvertProjectWizardPage;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
-
-/**
- *
- * ConvertToStdMakeProjectWizardPage
- * Standard main page for a wizard that adds a C project Nature to a project with no nature associated with it.
- * This conversion is one way in that the project cannot be converted back (i.e have the nature removed).
- *
- * @author Judy N. Green
- * @since Aug 6, 2002
- *<p>
- * Example useage:
- * <pre>
- * mainPage = new ConvertToStdMakeProjectWizardPage("ConvertProjectPage");
- * mainPage.setTitle("Project Conversion");
- * mainPage.setDescription("Add C or C++ a Nature to a project.");
- * </pre>
- * </p>
- *
- * @deprecated as of CDT 4.0. This page was used for 3.X style projects.
- * It is left here for compatibility reasons only.
- *
- * @noextend This class is not intended to be subclassed by clients.
- * @noinstantiate This class is not intended to be instantiated by clients.
- */
-@Deprecated
-public class ConvertToMakeProjectWizardPage extends ConvertProjectWizardPage {
-
- private static final String WZ_TITLE = "WizardMakeProjectConversion.title"; //$NON-NLS-1$
- private static final String WZ_DESC = "WizardMakeProjectConversion.description"; //$NON-NLS-1$
-
- /**
- * Constructor for ConvertToStdMakeProjectWizardPage.
- */
- public ConvertToMakeProjectWizardPage(String pageName) {
- super(pageName);
- }
-
- /**
- * Method getWzTitleResource returns the correct Title Label for this class
- * overriding the default in the superclass.
- */
- @Override
- protected String getWzTitleResource() {
- return MakeUIPlugin.getResourceString(WZ_TITLE);
- }
-
- /**
- * Method getWzDescriptionResource returns the correct description
- * Label for this class overriding the default in the superclass.
- */
- @Override
- protected String getWzDescriptionResource() {
- return MakeUIPlugin.getResourceString(WZ_DESC);
- }
-
- /**
- * Method isCandidate returns true for all projects.
- */
- @Override
- public boolean isCandidate(IProject project) {
- return true; // all
- }
-
- @Override
- public void convertProject(IProject project, IProgressMonitor monitor, String projectID) throws CoreException {
- monitor.beginTask(MakeUIPlugin.getResourceString("WizardMakeProjectConversion.monitor.convertingToMakeProject"), //$NON-NLS-1$
- 3);
- try {
- super.convertProject(project, new SubProgressMonitor(monitor, 1), projectID);
- MakeProjectNature.addNature(project, new SubProgressMonitor(monitor, 1));
- ScannerConfigNature.addScannerConfigNature(project);
- ScannerConfigNature.initializeDiscoveryOptions(project);
- CCorePlugin.getDefault().mapCProjectOwner(project, projectID, true);
- } finally {
- monitor.done();
- }
- }
-
- @Override
- public void createControl(Composite parent) {
- super.createControl(parent);
- IStructuredSelection sel = ((BasicNewResourceWizard) getWizard()).getSelection();
- if (sel != null) {
- tableViewer.setCheckedElements(sel.toArray());
- setPageComplete(validatePage());
- }
- }
-
-}
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/MakeProjectWizardOptionPage.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/MakeProjectWizardOptionPage.java
deleted file mode 100644
index 334470d109b..00000000000
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/MakeProjectWizardOptionPage.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * QNX Software System
- *******************************************************************************/
-
-package org.eclipse.cdt.make.ui.wizards;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.cdt.make.core.MakeCorePlugin;
-import org.eclipse.cdt.make.internal.ui.MakeProjectOptionBlock;
-import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
-import org.eclipse.cdt.make.ui.IMakeHelpContextIds;
-import org.eclipse.cdt.ui.dialogs.ICOptionContainer;
-import org.eclipse.cdt.ui.dialogs.ICOptionPage;
-import org.eclipse.cdt.ui.dialogs.IndexerBlock;
-import org.eclipse.cdt.ui.dialogs.ReferenceBlock;
-import org.eclipse.cdt.ui.dialogs.TabFolderOptionBlock;
-import org.eclipse.cdt.ui.wizards.NewCProjectWizard;
-import org.eclipse.cdt.ui.wizards.NewCProjectWizardOptionPage;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.Preferences;
-
-/**
- * Standard main page for a wizard that is creates a project resource.
- * <p>
- * This page may be used by clients as-is; it may be also be subclassed to suit.
- * </p>
- * <p>
- * Example usage:
- * <pre>
- * mainPage = new CProjectWizardPage("basicCProjectPage");
- * mainPage.setTitle("Project");
- * mainPage.setDescription("Create a new project resource.");
- * </pre>
- * </p>
- *
- * @deprecated as of CDT 4.0. This option page was used for New Project Wizard
- * for 3.X style projects.
- *
- * @noextend This class is not intended to be subclassed by clients.
- * @noinstantiate This class is not intended to be instantiated by clients.
- */
-@Deprecated
-public class MakeProjectWizardOptionPage extends NewCProjectWizardOptionPage {
- MakeWizardOptionBlock makeWizardBlock;
-
- public class MakeWizardOptionBlock extends MakeProjectOptionBlock {
- IndexerBlock indexBlock;
-
- public MakeWizardOptionBlock(ICOptionContainer parent) {
- super(parent);
- }
-
- @Override
- protected void addTabs() {
- addTab(new ReferenceBlock());
- super.addTabs();
- addTab(indexBlock = new IndexerBlock());
- }
-
- public void setupHelpContextIds() {
- List<ICOptionPage> pages = getOptionPages();
-
- Iterator<ICOptionPage> iter = pages.iterator();
- for (int i = 0; i < 6 && iter.hasNext(); i++) {
- ICOptionPage page = iter.next();
-
- String id = null;
- switch (i) {
- case 0:
- id = IMakeHelpContextIds.MAKE_PROJ_WIZ_PROJECTS_TAB;
- break;
- case 1:
- id = IMakeHelpContextIds.MAKE_PROJ_WIZ_MAKEBUILDER_TAB;
- break;
- case 2:
- id = IMakeHelpContextIds.MAKE_PROJ_WIZ_ERRORPARSER_TAB;
- break;
- case 3:
- id = IMakeHelpContextIds.MAKE_PROJ_WIZ_BINARYPARSER_TAB;
- break;
- case 4:
- id = IMakeHelpContextIds.MAKE_PROJ_WIZ_DISCOVERY_TAB;
- break;
- case 5:
- id = IMakeHelpContextIds.MAKE_PROJ_WIZ_INDEXER_TAB;
- break;
- }
- MakeUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(page.getControl(), id);
- }
- }
- }
-
- public MakeProjectWizardOptionPage(String title, String description) {
- super("MakeProjectSettingsPage"); //$NON-NLS-1$
- setTitle(title);
- setDescription(description);
- }
-
- @Override
- protected TabFolderOptionBlock createOptionBlock() {
- return (makeWizardBlock = new MakeWizardOptionBlock(this));
- }
-
- @Override
- public IProject getProject() {
- return ((NewCProjectWizard) getWizard()).getNewProject();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.ui.dialogs.ICOptionContainer#getPreference()
- */
- @Override
- public Preferences getPreferences() {
- return MakeCorePlugin.getDefault().getPluginPreferences();
- }
-
- public boolean isIndexerEnabled() {
- // isIndexEnabled() * @deprecated always returns false
- // return makeWizardBlock.indexBlock.isIndexEnabled();
- return false;
- }
-
- public void setupHelpContextIds() {
- makeWizardBlock.setupHelpContextIds();
- }
-}
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeCCProjectWizard.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeCCProjectWizard.java
deleted file mode 100644
index 514910e3646..00000000000
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeCCProjectWizard.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2010 QNX Software Systems and others.
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.make.ui.wizards;
-
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
-
-/**
- * This wizard was used for 3.X style projects. It is left here for compatibility
- * reasons only. The wizard is superseded by MBS C++ Project Wizard,
- * class {@link org.eclipse.cdt.ui.wizards.CCProjectWizard}.
- *
- * @deprecated as of CDT 4.0.
- *
- * @noextend This class is not intended to be subclassed by clients.
- * @noinstantiate This class is not intended to be instantiated by clients.
- */
-@Deprecated
-public class NewMakeCCProjectWizard extends NewMakeProjectWizard {
-
- private static final String WZ_TITLE = "MakeCCWizard.title"; //$NON-NLS-1$
- private static final String WZ_DESC = "MakeCCWizard.description"; //$NON-NLS-1$
-
- private static final String WZ_SETTINGS_TITLE = "MakeCCWizard.title"; //$NON-NLS-1$
- private static final String WZ_SETTINGS_DESC = "MakeCCWizard.description"; //$NON-NLS-1$
-
- public NewMakeCCProjectWizard() {
- super(MakeUIPlugin.getResourceString(WZ_TITLE), MakeUIPlugin.getResourceString(WZ_DESC));
- }
-
- @Override
- public void addPages() {
- super.addPages();
- addPage(fOptionPage = new MakeProjectWizardOptionPage(MakeUIPlugin.getResourceString(WZ_SETTINGS_TITLE),
- MakeUIPlugin.getResourceString(WZ_SETTINGS_DESC)));
- }
-
- @Override
- protected void doRun(IProgressMonitor monitor) throws CoreException {
- if (monitor == null) {
- monitor = new NullProgressMonitor();
- }
- monitor.beginTask(MakeUIPlugin.getResourceString("MakeCCWizard.task_name"), 10); //$NON-NLS-1$
- super.doRun(new SubProgressMonitor(monitor, 9));
- // Add C++ Nature.
- if (newProject != null) {
- // Add C++ Nature to the newly created project.
- CCorePlugin.getDefault().convertProjectFromCtoCC(newProject, new SubProgressMonitor(monitor, 1));
- }
- monitor.done();
- }
-}
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeCProjectWizard.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeCProjectWizard.java
deleted file mode 100644
index fff3b8c8202..00000000000
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeCProjectWizard.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2010 QNX Software Systems and others.
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.make.ui.wizards;
-
-import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
-
-/**
- * This wizard was used for 3.X style projects. It is left here for compatibility
- * reasons only. The wizard is superseded by MBS C Project Wizard,
- * class {@link org.eclipse.cdt.ui.wizards.CProjectWizard}.
- *
- * @deprecated as of CDT 4.0.
- *
- * @noextend This class is not intended to be subclassed by clients.
- * @noinstantiate This class is not intended to be instantiated by clients.
- */
-@Deprecated
-public class NewMakeCProjectWizard extends NewMakeProjectWizard {
-
- private static final String WZ_TITLE = "MakeCWizard.title"; //$NON-NLS-1$
- private static final String WZ_DESC = "MakeCWizard.description"; //$NON-NLS-1$'
-
- private static final String WZ_SETTINGS_TITLE = "MakeCWizardSettings.title"; //$NON-NLS-1$
- private static final String WZ_SETTINGS_DESC = "MakeCWizardSettings.description"; //$NON-NLS-1$'
-
- public NewMakeCProjectWizard() {
- this(MakeUIPlugin.getResourceString(WZ_TITLE), MakeUIPlugin.getResourceString(WZ_DESC));
- }
-
- public NewMakeCProjectWizard(String title, String desc) {
- super(title, desc);
- }
-
- @Override
- public void addPages() {
- super.addPages();
- addPage(fOptionPage = new MakeProjectWizardOptionPage(MakeUIPlugin.getResourceString(WZ_SETTINGS_TITLE),
- MakeUIPlugin.getResourceString(WZ_SETTINGS_DESC)));
- }
-
-}
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeProjectWizard.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeProjectWizard.java
deleted file mode 100644
index 2d72a9b8db8..00000000000
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/NewMakeProjectWizard.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2010 QNX Software Systems and others.
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.make.ui.wizards;
-
-import org.eclipse.cdt.make.core.MakeCorePlugin;
-import org.eclipse.cdt.make.core.MakeProjectNature;
-import org.eclipse.cdt.make.core.scannerconfig.ScannerConfigNature;
-import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
-import org.eclipse.cdt.make.ui.IMakeHelpContextIds;
-import org.eclipse.cdt.ui.wizards.NewCProjectWizard;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This abstract wizard was used for 3.X style projects. It is left here for compatibility
- * reasons only. The wizards are superseded by MBS C++ Project Wizards.
- *
- * @deprecated as of CDT 4.0.
- *
- * @noextend This class is not intended to be subclassed by clients.
- */
-@Deprecated
-public abstract class NewMakeProjectWizard extends NewCProjectWizard {
-
- protected MakeProjectWizardOptionPage fOptionPage;
-
- public NewMakeProjectWizard(String title, String desc) {
- super(title, desc);
- }
-
- @Override
- protected void doRunPrologue(IProgressMonitor monitor) {
- }
-
- @Override
- protected void doRunEpilogue(IProgressMonitor monitor) {
- }
-
- @Override
- protected void doRun(IProgressMonitor monitor) throws CoreException {
- if (monitor == null) {
- monitor = new NullProgressMonitor();
- }
- monitor.beginTask(MakeUIPlugin.getResourceString("MakeCWizard.task_name"), 10); //$NON-NLS-1$
-
- // super.doRun() just creates the project and does not assign a builder to it.
- super.doRun(new SubProgressMonitor(monitor, 5));
-
- MakeProjectNature.addNature(getProjectHandle(), new SubProgressMonitor(monitor, 1));
- ScannerConfigNature.addScannerConfigNature(getProjectHandle());
-
- // Modify the project based on what the user has selected
- if (newProject != null) {
- fOptionPage.performApply(new SubProgressMonitor(monitor, 4));
- monitor.done();
- }
- }
-
- @Override
- public String getProjectID() {
- return MakeCorePlugin.MAKE_PROJECT_ID;
- }
-
- @Override
- public void createPageControls(Composite pageContainer) {
- super.createPageControls(pageContainer);
-
- IWizardPage[] pages = getPages();
-
- if (pages != null && pages.length == 2) {
- MakeUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(pages[0].getControl(),
- IMakeHelpContextIds.MAKE_PROJ_WIZ_NAME_PAGE);
-
- MakeProjectWizardOptionPage optionPage = (MakeProjectWizardOptionPage) pages[1];
- optionPage.setupHelpContextIds();
- }
- }
-}
diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/plugin.xml b/build/org.eclipse.cdt.managedbuilder.core.tests/plugin.xml
index 3d4ea53d48c..2d145e30ce0 100644
--- a/build/org.eclipse.cdt.managedbuilder.core.tests/plugin.xml
+++ b/build/org.eclipse.cdt.managedbuilder.core.tests/plugin.xml
@@ -4944,21 +4944,23 @@
<configuration
id="cdt.test.customOptionCommand.one"
name="One">
- <toolChain isSystem="true"
+ <toolChain
id="cdt.test.customOptionCommand.Toolchain"
isAbstract="false"
- name="Tools">
+ isSystem="true"
+ name="Tools"
+ targetTool="cdt.test.customOptionCommand.Tool2">
<tool
command="xxx"
- id="cdt.test.customOptionCommand.Tool"
+ id="cdt.test.customOptionCommand.Tool1"
isAbstract="false"
- name="Tool"
+ name="Tool1"
natureFilter="both"
outputFlag="-o">
<optionCategory
id="cdt.test.customOptionCommand.optionCategory1"
name="Test Options"
- owner="cdt.test.customOptionCommand.Tool"/>
+ owner="cdt.test.customOptionCommand.Tool1"/>
<option
category="cdt.test.customOptionCommand.optionCategory1"
command="-opt1="
@@ -4987,6 +4989,178 @@
name="Option4"
valueType="string"/>
</tool>
+ <tool
+ command="xxx"
+ id="cdt.test.customOptionCommand.Tool2"
+ isAbstract="false"
+ name="Tool2"
+ natureFilter="both"
+ outputFlag="-o">
+ <optionCategory
+ id="cdt.test.customOptionCommand.optionCategory2"
+ name="Test Options"
+ owner="cdt.test.customOptionCommand.Tool2"/>
+ <option
+ category="cdt.test.customOptionCommand.optionCategory2"
+ command="-optString="
+ id="cdt.test.customOptionCommand.optionString"
+ name="OptionString"
+ commandGenerator="org.eclipse.cdt.managedbuilder.core.tests.CustomOptionCommandGenerator"
+ valueType="string"/>
+ <option
+ category="cdt.test.customOptionCommand.optionCategory2"
+ command="-optStringList="
+ id="cdt.test.customOptionCommand.optionStringList"
+ name="OptionStringList"
+ commandGenerator="org.eclipse.cdt.managedbuilder.core.tests.CustomOptionCommandGenerator"
+ valueType="stringList"/>
+ <option
+ category="cdt.test.customOptionCommand.optionCategory2"
+ command="-optBoolean=true"
+ commandFalse="-optBoolean=false"
+ commandGenerator="org.eclipse.cdt.managedbuilder.core.tests.CustomOptionCommandGenerator"
+ id="cdt.test.customOptionCommand.optionBoolean"
+ name="OptionBoolean"
+ valueType="boolean"/>
+ <option
+ category="cdt.test.customOptionCommand.optionCategory2"
+ command="-optEnumerated="
+ commandGenerator="org.eclipse.cdt.managedbuilder.core.tests.CustomOptionCommandGenerator"
+ id="cdt.test.customOptionCommand.optionEnumerated"
+ name="OptionEnumerated"
+ valueType="enumerated">
+ <enumeratedOptionValue
+ command="-optEnumerated=value1"
+ id="org.eclipse.cdt.managedbuilder.core.tests.enumeratedOptionValue1"
+ name="EnumeratedOptionValue1">
+ </enumeratedOptionValue>
+ <enumeratedOptionValue
+ command="-optEnumerated=value2"
+ id="org.eclipse.cdt.managedbuilder.core.tests.enumeratedOptionValue2"
+ name="EnumeratedOptionValue2">
+ </enumeratedOptionValue>
+ </option>
+ <option
+ category="cdt.test.customOptionCommand.optionCategory2"
+ command="-optIncludePath="
+ id="cdt.test.customOptionCommand.optionIncludePath"
+ name="OptionIncludePath"
+ commandGenerator="org.eclipse.cdt.managedbuilder.core.tests.CustomOptionCommandGenerator"
+ valueType="includePath"/>
+ <option
+ category="cdt.test.customOptionCommand.optionCategory2"
+ command="-optDefinedSymbols="
+ id="cdt.test.customOptionCommand.optionDefinedSymbols"
+ name="OptionDefinedSymbols"
+ commandGenerator="org.eclipse.cdt.managedbuilder.core.tests.CustomOptionCommandGenerator"
+ valueType="definedSymbols"/>
+ <option
+ category="cdt.test.customOptionCommand.optionCategory2"
+ command="-optLibs="
+ id="cdt.test.customOptionCommand.optionLibs"
+ name="OptionLibs"
+ commandGenerator="org.eclipse.cdt.managedbuilder.core.tests.CustomOptionCommandGenerator"
+ valueType="libs"/>
+ <option
+ category="cdt.test.customOptionCommand.optionCategory2"
+ command="-optUserObjs="
+ id="cdt.test.customOptionCommand.optionUserObjs"
+ name="OptionUserObjs"
+ commandGenerator="org.eclipse.cdt.managedbuilder.core.tests.CustomOptionCommandGenerator"
+ valueType="userObjs"/>
+ <option
+ category="cdt.test.customOptionCommand.optionCategory2"
+ command="-optSymbolFiles="
+ id="cdt.test.customOptionCommand.optionSymbolFiles"
+ name="OptionSymbolFiles"
+ commandGenerator="org.eclipse.cdt.managedbuilder.core.tests.CustomOptionCommandGenerator"
+ valueType="symbolFiles"/>
+ <option
+ category="cdt.test.customOptionCommand.optionCategory2"
+ command="-optIncludeFiles="
+ id="cdt.test.customOptionCommand.optionIncludeFiles"
+ name="OptionIncludeFiles"
+ commandGenerator="org.eclipse.cdt.managedbuilder.core.tests.CustomOptionCommandGenerator"
+ valueType="includeFiles"/>
+ <option
+ category="cdt.test.customOptionCommand.optionCategory2"
+ command="-optLibPaths="
+ id="cdt.test.customOptionCommand.optionLibPaths"
+ name="OptionLibPaths"
+ commandGenerator="org.eclipse.cdt.managedbuilder.core.tests.CustomOptionCommandGenerator"
+ valueType="libPaths"/>
+ <option
+ category="cdt.test.customOptionCommand.optionCategory2"
+ command="-optLibFiles="
+ id="cdt.test.customOptionCommand.optionLibFiles"
+ name="OptionLibFiles"
+ commandGenerator="org.eclipse.cdt.managedbuilder.core.tests.CustomOptionCommandGenerator"
+ valueType="libFiles"/>
+ <option
+ category="cdt.test.customOptionCommand.optionCategory2"
+ command="-optUndefIncludePath="
+ id="cdt.test.customOptionCommand.optionUndefIncludePath"
+ name="OptionUndefIncludePath"
+ commandGenerator="org.eclipse.cdt.managedbuilder.core.tests.CustomOptionCommandGenerator"
+ valueType="undefIncludePath"/>
+ <option
+ category="cdt.test.customOptionCommand.optionCategory2"
+ command="-optUndefDefinedSymbols="
+ id="cdt.test.customOptionCommand.optionUndefDefinedSymbols"
+ name="OptionUndefDefinedSymbols"
+ commandGenerator="org.eclipse.cdt.managedbuilder.core.tests.CustomOptionCommandGenerator"
+ valueType="undefDefinedSymbols"/>
+ <option
+ category="cdt.test.customOptionCommand.optionCategory2"
+ command="-optUndefLibPaths="
+ id="cdt.test.customOptionCommand.optionUndefLibPaths"
+ name="OptionUndefLibPaths"
+ commandGenerator="org.eclipse.cdt.managedbuilder.core.tests.CustomOptionCommandGenerator"
+ valueType="undefLibPaths"/>
+ <option
+ category="cdt.test.customOptionCommand.optionCategory2"
+ command="-optUndefLibFiles="
+ id="cdt.test.customOptionCommand.optionUndefLibFiles"
+ name="OptionUndefLibFiles"
+ commandGenerator="org.eclipse.cdt.managedbuilder.core.tests.CustomOptionCommandGenerator"
+ valueType="undefLibFiles"/>
+ <option
+ category="cdt.test.customOptionCommand.optionCategory2"
+ command="-optUndefIncludeFiles="
+ id="cdt.test.customOptionCommand.optionUndefIncludeFiles"
+ name="OptionUndefIncludeFiles"
+ commandGenerator="org.eclipse.cdt.managedbuilder.core.tests.CustomOptionCommandGenerator"
+ valueType="undefIncludeFiles"/>
+ <option
+ category="cdt.test.customOptionCommand.optionCategory2"
+ command="-optUndefSymbolFiles="
+ id="cdt.test.customOptionCommand.optionUndefSymbolFiles"
+ name="OptionUndefSymbolFiles"
+ commandGenerator="org.eclipse.cdt.managedbuilder.core.tests.CustomOptionCommandGenerator"
+ valueType="undefSymbolFiles"/>
+ <option
+ category="cdt.test.customOptionCommand.optionCategory2"
+ command="-optTree="
+ commandGenerator="org.eclipse.cdt.managedbuilder.core.tests.CustomOptionCommandGenerator"
+ id="cdt.test.customOptionCommand.optionTree"
+ name="OptionTree"
+ valueType="tree">
+ <treeOptionRoot
+ id="org.eclipse.cdt.managedbuilder.core.tests.treeOptionRoot1"
+ name="org.eclipse.cdt.managedbuilder.core.tests.treeOptionRoot1">
+ <treeOption
+ command="-optTree=value1"
+ id="org.eclipse.cdt.managedbuilder.core.tests.treeOption1"
+ name="TreeOption1">
+ </treeOption>
+ <treeOption
+ command="-optTree=value2"
+ id="org.eclipse.cdt.managedbuilder.core.tests.treeOption2"
+ name="TreeOption2">
+ </treeOption>
+ </treeOptionRoot>
+ </option>
+ </tool>
<builder
id="cdt.test.customOptionCommand.builder"
name="Builder"
diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/CustomOptionCommandGenerator2.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/CustomOptionCommandGenerator2.java
new file mode 100644
index 00000000000..2d76300e07b
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/CustomOptionCommandGenerator2.java
@@ -0,0 +1,34 @@
+package org.eclipse.cdt.managedbuilder.core.tests;
+
+import org.eclipse.cdt.managedbuilder.core.BuildException;
+import org.eclipse.cdt.managedbuilder.core.IOption;
+import org.eclipse.cdt.utils.cdtvariables.IVariableSubstitutor;
+
+public class CustomOptionCommandGenerator2 extends CustomOptionCommandGenerator {
+
+ public CustomOptionCommandGenerator2() {
+ }
+
+ @Override
+ public String generateCommand(IOption option, IVariableSubstitutor macroSubstitutor) {
+ String command = super.generateCommand(option, macroSubstitutor);
+ if (command == null) {
+ try {
+ switch (option.getValueType()) {
+ case IOption.BOOLEAN:
+ return option.getBooleanValue() ? option.getCommand() : option.getCommandFalse();
+ case IOption.ENUMERATED:
+ return option.getEnumCommand(option.getSelectedEnum());
+ case IOption.TREE:
+ return option.getCommand(option.getStringValue());
+ default:
+ return option.getCommand() + option.getValue();
+ }
+ } catch (BuildException e) {
+ return "CustomOptionCommandGenerator2-error";
+ }
+ }
+ return command;
+ }
+
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedCommandLineGeneratorTest.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedCommandLineGeneratorTest.java
index 7d559a3222d..e661cb1f668 100644
--- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedCommandLineGeneratorTest.java
+++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedCommandLineGeneratorTest.java
@@ -15,6 +15,7 @@
package org.eclipse.cdt.managedbuilder.core.tests;
import java.util.ArrayList;
+import java.util.Arrays;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
@@ -194,8 +195,8 @@ public class ManagedCommandLineGeneratorTest extends TestCase {
"cdt.test.customOptionCommand.ProjectType");
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
IConfiguration config = info.getDefaultConfiguration();
- ITool[] tools = config.getToolsBySuperClassId("cdt.test.customOptionCommand.Tool");
- assertEquals(tools.length, 1);
+ ITool[] tools = config.getToolsBySuperClassId("cdt.test.customOptionCommand.Tool1");
+ assertEquals(1, tools.length);
ITool tool = tools[0];
@@ -229,6 +230,124 @@ public class ManagedCommandLineGeneratorTest extends TestCase {
}
}
+ public final void testCustomOptionCommandGenerator2() {
+ try {
+ IProject project = ManagedBuildTestHelper.createProject("COCG2", null, (IPath) null,
+ "cdt.test.customOptionCommand.ProjectType");
+ IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
+ IConfiguration config = info.getDefaultConfiguration();
+
+ ITool[] tools = config.getToolsBySuperClassId("cdt.test.customOptionCommand.Tool2");
+ assertEquals(1, tools.length);
+
+ ITool tool = tools[0];
+
+ IOption optionString = tool.getOptionBySuperClassId("cdt.test.customOptionCommand.optionString");
+ IOption optionStringList = tool.getOptionBySuperClassId("cdt.test.customOptionCommand.optionStringList");
+ IOption optionBoolean = tool.getOptionBySuperClassId("cdt.test.customOptionCommand.optionBoolean");
+ IOption optionEnumerated = tool.getOptionBySuperClassId("cdt.test.customOptionCommand.optionEnumerated");
+ IOption optionIncludePath = tool.getOptionBySuperClassId("cdt.test.customOptionCommand.optionIncludePath");
+ IOption optionDefinedSymbols = tool
+ .getOptionBySuperClassId("cdt.test.customOptionCommand.optionDefinedSymbols");
+ IOption optionLibs = tool.getOptionBySuperClassId("cdt.test.customOptionCommand.optionLibs");
+ IOption optionUserObjs = tool.getOptionBySuperClassId("cdt.test.customOptionCommand.optionUserObjs");
+ IOption optionSymbolFiles = tool.getOptionBySuperClassId("cdt.test.customOptionCommand.optionSymbolFiles");
+ IOption optionIncludeFiles = tool
+ .getOptionBySuperClassId("cdt.test.customOptionCommand.optionIncludeFiles");
+ IOption optionLibPaths = tool.getOptionBySuperClassId("cdt.test.customOptionCommand.optionLibPaths");
+ IOption optionLibFiles = tool.getOptionBySuperClassId("cdt.test.customOptionCommand.optionLibFiles");
+ IOption optionUndefIncludePath = tool
+ .getOptionBySuperClassId("cdt.test.customOptionCommand.optionUndefIncludePath");
+ IOption optionUndefDefinedSymbols = tool
+ .getOptionBySuperClassId("cdt.test.customOptionCommand.optionUndefDefinedSymbols");
+ IOption optionUndefLibPaths = tool
+ .getOptionBySuperClassId("cdt.test.customOptionCommand.optionUndefLibPaths");
+ IOption optionUndefLibFiles = tool
+ .getOptionBySuperClassId("cdt.test.customOptionCommand.optionUndefLibFiles");
+ IOption optionUndefIncludeFiles = tool
+ .getOptionBySuperClassId("cdt.test.customOptionCommand.optionUndefIncludeFiles");
+ IOption optionUndefSymbolFiles = tool
+ .getOptionBySuperClassId("cdt.test.customOptionCommand.optionUndefSymbolFiles");
+ IOption optionTree = tool.getOptionBySuperClassId("cdt.test.customOptionCommand.optionTree");
+
+ assertTrue(optionString.getCommandGenerator() instanceof CustomOptionCommandGenerator);
+ assertTrue(optionStringList.getCommandGenerator() instanceof CustomOptionCommandGenerator);
+ assertTrue(optionBoolean.getCommandGenerator() instanceof CustomOptionCommandGenerator);
+ assertTrue(optionEnumerated.getCommandGenerator() instanceof CustomOptionCommandGenerator);
+ assertTrue(optionIncludePath.getCommandGenerator() instanceof CustomOptionCommandGenerator);
+ assertTrue(optionDefinedSymbols.getCommandGenerator() instanceof CustomOptionCommandGenerator);
+ assertTrue(optionLibs.getCommandGenerator() instanceof CustomOptionCommandGenerator);
+ assertTrue(optionUserObjs.getCommandGenerator() instanceof CustomOptionCommandGenerator);
+ assertTrue(optionSymbolFiles.getCommandGenerator() instanceof CustomOptionCommandGenerator);
+ assertTrue(optionIncludeFiles.getCommandGenerator() instanceof CustomOptionCommandGenerator);
+ assertTrue(optionLibPaths.getCommandGenerator() instanceof CustomOptionCommandGenerator);
+ assertTrue(optionLibFiles.getCommandGenerator() instanceof CustomOptionCommandGenerator);
+ assertTrue(optionUndefIncludePath.getCommandGenerator() instanceof CustomOptionCommandGenerator);
+ assertTrue(optionUndefDefinedSymbols.getCommandGenerator() instanceof CustomOptionCommandGenerator);
+ assertTrue(optionUndefLibPaths.getCommandGenerator() instanceof CustomOptionCommandGenerator);
+ assertTrue(optionUndefLibFiles.getCommandGenerator() instanceof CustomOptionCommandGenerator);
+ assertTrue(optionUndefIncludeFiles.getCommandGenerator() instanceof CustomOptionCommandGenerator);
+ assertTrue(optionUndefSymbolFiles.getCommandGenerator() instanceof CustomOptionCommandGenerator);
+ assertTrue(optionTree.getCommandGenerator() instanceof CustomOptionCommandGenerator);
+
+ optionString = config.setOption(tool, optionString, "${ProjName}");
+ optionStringList = config.setOption(tool, optionStringList, new String[] { "val1", "${ProjName}" });
+ optionBoolean = config.setOption(tool, optionBoolean, true);
+ optionEnumerated = config.setOption(tool, optionEnumerated,
+ "org.eclipse.cdt.managedbuilder.core.tests.enumeratedOptionValue2");
+ optionIncludePath = config.setOption(tool, optionIncludePath, new String[] { "val2", "${ProjName}" });
+ optionDefinedSymbols = config.setOption(tool, optionDefinedSymbols, new String[] { "val3", "${ProjName}" });
+ optionLibs = config.setOption(tool, optionLibs, new String[] { "val4", "${ProjName}" });
+ optionUserObjs = config.setOption(tool, optionUserObjs, new String[] { "val5", "${ProjName}" });
+ optionSymbolFiles = config.setOption(tool, optionSymbolFiles, new String[] { "val6", "${ProjName}" });
+ optionIncludeFiles = config.setOption(tool, optionIncludeFiles, new String[] { "val7", "${ProjName}" });
+ optionLibPaths = config.setOption(tool, optionLibPaths, new String[] { "val8", "${ProjName}" });
+ optionLibFiles = config.setOption(tool, optionLibFiles, new String[] { "val9", "${ProjName}" });
+ optionUndefIncludePath = config.setOption(tool, optionUndefIncludePath,
+ new String[] { "val10", "${ProjName}" });
+ optionUndefDefinedSymbols = config.setOption(tool, optionUndefDefinedSymbols,
+ new String[] { "val11", "${ProjName}" });
+ optionUndefLibPaths = config.setOption(tool, optionUndefLibPaths, new String[] { "val12", "${ProjName}" });
+ optionUndefLibFiles = config.setOption(tool, optionUndefLibFiles, new String[] { "val13", "${ProjName}" });
+ optionUndefIncludeFiles = config.setOption(tool, optionUndefIncludeFiles,
+ new String[] { "val14", "${ProjName}" });
+ optionUndefSymbolFiles = config.setOption(tool, optionUndefSymbolFiles,
+ new String[] { "val15", "${ProjName}" });
+ optionTree = config.setOption(tool, optionTree, "org.eclipse.cdt.managedbuilder.core.tests.treeOption2");
+
+ String command = tool.getToolCommandFlagsString(null, null);
+ assertEquals(String.join(" ", "-optString=COCG2", //
+ "-optStringList=\"val1;COCG2;\"", //
+ "-optBoolean=true", //
+ "-optEnumerated=value2", //
+ "-optIncludePath=\"val2;COCG2;\"", //
+ "-optDefinedSymbols=\"val3;COCG2;\"", //
+ "-optSymbolFiles=\"val6;COCG2;\"", //
+ "-optIncludeFiles=\"val7;COCG2;\"", //
+ "-optLibPaths=\"val8;COCG2;\"", //
+ "-optLibFiles=\"val9;COCG2;\"", //
+ "-optUndefIncludePath=\"val10;COCG2;\"", //
+ "-optUndefDefinedSymbols=\"val11;COCG2;\"", //
+ "-optUndefLibPaths=\"val12;COCG2;\"", //
+ "-optUndefLibFiles=\"val13;COCG2;\"", //
+ "-optUndefIncludeFiles=\"val14;COCG2;\"", //
+ "-optUndefSymbolFiles=\"val15;COCG2;\"", //
+ "-optTree=value2"), //
+ command);
+
+ String[] libs = config.getLibs(config.getArtifactExtension());
+ assertEquals(Arrays.asList("-optLibs=\"val4;COCG2;\"").toString(), Arrays.asList(libs).toString());
+
+ String[] userObjs = config.getUserObjects(config.getArtifactExtension());
+ assertEquals(Arrays.asList("-optUserObjs=\"val5;COCG2;\"").toString(), Arrays.asList(userObjs).toString());
+
+ ManagedBuildTestHelper.removeProject("COCG2");
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail("Test failed on project creation: " + e.getLocalizedMessage());
+ }
+ }
+
public final void testDollarValue() {
try {
IProject project = ManagedBuildTestHelper.createProject("CDV", null, (IPath) null,
diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/CompilationDatabaseParserTest.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/CompilationDatabaseParserTest.java
index 09877e1ae60..3e77a2bfda7 100644
--- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/CompilationDatabaseParserTest.java
+++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/CompilationDatabaseParserTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2019 Marc-Andre Laperle.
+ * Copyright (c) 2019, 2020 Marc-Andre Laperle.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -88,11 +88,17 @@ public class CompilationDatabaseParserTest extends BaseTestCase {
}
private void createTestProject() throws Exception {
- createTestProject(true, true, true, true, true);
+ createTestProject(true, true, true, true, true, false);
}
private void createTestProject(boolean useAbsoluteSourcePath, boolean haveCommandDir, boolean validCommandDir,
boolean haveCommandLine, boolean validCommandLine) throws Exception {
+ createTestProject(useAbsoluteSourcePath, haveCommandDir, validCommandDir, haveCommandLine, validCommandLine,
+ false);
+ }
+
+ private void createTestProject(boolean useAbsoluteSourcePath, boolean haveCommandDir, boolean validCommandDir,
+ boolean haveCommandLine, boolean validCommandLine, boolean haveCommandArguments) throws Exception {
fProject = ResourceHelper.createCDTProjectWithConfig(getName());
fFolder = ResourceHelper.createFolder(fProject, "folder");
@@ -140,6 +146,10 @@ public class CompilationDatabaseParserTest extends BaseTestCase {
else
command.command = "foo";
}
+ if (haveCommandArguments) {
+ command.arguments = new String[] { "g++", "-I" + fFolder.getLocation().toOSString(), "-DFOO=2",
+ sourceFilePath };
+ }
// Command for proj/test.cpp
CompileCommand command2 = new CompileCommand();
@@ -162,6 +172,11 @@ public class CompilationDatabaseParserTest extends BaseTestCase {
command2.command = "foo";
}
+ if (haveCommandArguments) {
+ command2.arguments = new String[] { "g++", "-I" + fFolder.getLocation().toOSString(), "-DFOO=3",
+ sourceFilePath2 };
+ }
+
CompileCommand[] commands = new CompileCommand[2];
commands[0] = command;
commands[1] = command2;
@@ -820,6 +835,34 @@ public class CompilationDatabaseParserTest extends BaseTestCase {
assertFalse(CDataUtil.isExcluded(tu.getPath(), resCfgDescription.getSourceEntries()));
}
+ public void testParseCDB_CommandArguments() throws Exception {
+ createTestProject(true, true, true, false, false, true);
+
+ ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(fProject);
+ ICElement ce = CCorePlugin.getDefault().getCoreModel().create(fOutsideCdbSourceFile.getFullPath());
+ ITranslationUnit tu = (ITranslationUnit) ce;
+ assertFalse(
+ CDataUtil.isExcluded(tu.getPath(), getConfigurationDescription(fProject, false).getSourceEntries()));
+
+ CompilationDatabaseParser parser = (CompilationDatabaseParser) LanguageSettingsManager
+ .getExtensionProviderCopy(COMPILATION_DATABASE_PARSER_EXT, true);
+ assertTrue(parser.isEmpty());
+ parser.setBuildParserId(GCC_BUILD_COMMAND_PARSER_EXT);
+ parser.setCompilationDataBasePathProperty(fCdbFile.getLocation().toOSString());
+ addLanguageSettingsProvider(parser);
+
+ ICConfigurationDescription cfgDescription = getConfigurationDescription(fProject, true);
+
+ parser.processCompileCommandsFile(null, cfgDescription);
+ CoreModel.getDefault().setProjectDescription(cfgDescription.getProjectDescription().getProject(),
+ cfgDescription.getProjectDescription());
+ joingLanguageSettingsJobs();
+
+ assertExpectedEntries(parser);
+
+ ICConfigurationDescription resCfgDescription = getConfigurationDescription(fProject, false);
+ }
+
public void testClear() throws Exception {
createTestProject();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF b/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF
index fb26e2a50dd..6f16afc19a2 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF
+++ b/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF
@@ -32,7 +32,7 @@ Export-Package: org.eclipse.cdt.build.core.scannerconfig,
org.eclipse.cdt.managedbuilder.templateengine,
org.eclipse.cdt.managedbuilder.templateengine.processes,
org.eclipse.cdt.newmake.core
-Require-Bundle: org.eclipse.cdt.core;bundle-version="[5.0.0,7.0.0)",
+Require-Bundle: org.eclipse.cdt.core;bundle-version="[7.0.0,8.0.0)",
org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
@@ -41,6 +41,5 @@ Require-Bundle: org.eclipse.cdt.core;bundle-version="[5.0.0,7.0.0)",
org.eclipse.core.filesystem;bundle-version="1.2.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Import-Package: com.google.gson;version="2.8.0",
- com.ibm.icu.text
+Import-Package: com.google.gson;version="2.8.0"
Automatic-Module-Name: org.eclipse.cdt.managedbuilder.core
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 b0355bec955..2c0474b4c63 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2012 Intel Corporation and others.
+ * Copyright (c) 2007, 2020 Intel Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,9 +10,11 @@
*
* Contributors:
* Intel Corporation - Initial API and implementation
+ * Sergei Kovalchuk (NXP)
*******************************************************************************/
package org.eclipse.cdt.build.internal.core.scannerconfig;
+import java.text.MessageFormat;
import java.util.Set;
import java.util.TreeSet;
@@ -30,8 +32,6 @@ import org.eclipse.cdt.managedbuilder.internal.core.Tool;
import org.eclipse.cdt.managedbuilder.internal.core.ToolChain;
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())
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 1c15980a3f0..4eb1fb944a2 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2011 Intel Corporation and others.
+ * Copyright (c) 2007, 2020 Intel Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -11,14 +11,14 @@
* Contributors:
* Intel Corporation - Initial API and implementation
* IBM Corporation
+ * Sergei Kovalchuk (NXP)
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.internal.buildmodel;
+import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-import com.ibm.icu.text.MessageFormat;
-
public class BuildModelMessages {
private static final String BUNDLE_NAME = "org.eclipse.cdt.managedbuilder.internal.buildmodel.BuildModelMessages"; //$NON-NLS-1$
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 81d6821d0eb..bf4b762ffab 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
@@ -30,6 +30,7 @@ import java.util.Vector;
import org.eclipse.cdt.build.core.scannerconfig.ICfgScannerConfigBuilderInfo2Set;
import org.eclipse.cdt.build.internal.core.scannerconfig.CfgDiscoveredPathManager.PathInfoCache;
import org.eclipse.cdt.core.ErrorParserManager;
+import org.eclipse.cdt.core.cdtvariables.CdtVariableException;
import org.eclipse.cdt.core.settings.model.CSourceEntry;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICExternalSetting;
@@ -65,6 +66,7 @@ import org.eclipse.cdt.managedbuilder.core.IManagedOptionValueHandler;
import org.eclipse.cdt.managedbuilder.core.IManagedProject;
import org.eclipse.cdt.managedbuilder.core.IOption;
import org.eclipse.cdt.managedbuilder.core.IOptionApplicability;
+import org.eclipse.cdt.managedbuilder.core.IOptionCommandGenerator;
import org.eclipse.cdt.managedbuilder.core.IProjectType;
import org.eclipse.cdt.managedbuilder.core.IResourceConfiguration;
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
@@ -77,11 +79,15 @@ import org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSu
import org.eclipse.cdt.managedbuilder.internal.dataprovider.BuildConfigurationData;
import org.eclipse.cdt.managedbuilder.internal.enablement.OptionEnablementExpression;
import org.eclipse.cdt.managedbuilder.internal.macros.BuildMacroProvider;
+import org.eclipse.cdt.managedbuilder.internal.macros.BuildfileMacroSubstitutor;
import org.eclipse.cdt.managedbuilder.internal.macros.FileContextData;
+import org.eclipse.cdt.managedbuilder.internal.macros.IMacroContextInfo;
+import org.eclipse.cdt.managedbuilder.internal.macros.IMacroContextInfoProvider;
import org.eclipse.cdt.managedbuilder.internal.macros.OptionContextData;
import org.eclipse.cdt.managedbuilder.macros.BuildMacroException;
import org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider;
import org.eclipse.cdt.managedbuilder.macros.IConfigurationBuildMacroSupplier;
+import org.eclipse.cdt.utils.cdtvariables.SupplierBasedCdtVariableSubstitutor;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceDelta;
@@ -95,6 +101,7 @@ import org.osgi.framework.Version;
public class Configuration extends BuildObject implements IConfiguration, IBuildPropertiesRestriction,
IBuildPropertyChangeListener, IRealBuildObjectAssociation {
+ private static final String WHITE_SPACE = " "; //$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$
@@ -2600,25 +2607,51 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
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;
+ // check to see if the option has an applicability calculator
+ IOptionApplicability applicabilityCalculator = option.getApplicabilityCalculator();
+
+ if (applicabilityCalculator == null
+ || applicabilityCalculator.isOptionUsedInCommandLine(this, tool, option)) {
+ boolean generateDefaultCommand = true;
+ IOptionCommandGenerator commandGenerator = option.getCommandGenerator();
+ if (commandGenerator != null) {
+ SupplierBasedCdtVariableSubstitutor macroSubstitutor = new BuildfileMacroSubstitutor(
+ null, EMPTY_STRING, WHITE_SPACE);
+ IMacroContextInfoProvider provider = BuildMacroProvider.getDefault();
+ IMacroContextInfo info = provider.getMacroContextInfo(BuildMacroProvider.CONTEXT_OPTION,
+ new OptionContextData(option, tool));
+ if (info != null) {
+ macroSubstitutor.setMacroContextInfo(info);
+ String command = commandGenerator.generateCommand(option, macroSubstitutor);
+ if (command != null) {
+ objs.add(command);
+ generateDefaultCommand = false;
+ }
+ }
+ }
+
+ if (generateDefaultCommand) {
+ 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) {
+ } catch (BuildException | CdtVariableException e) {
// TODO: report error
continue;
}
@@ -2643,35 +2676,54 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
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);
- }
+ IOptionApplicability applicabilityCalculator = option.getApplicabilityCalculator();
+
+ if (applicabilityCalculator == null
+ || applicabilityCalculator.isOptionUsedInCommandLine(this, tool, option)) {
+ boolean generateDefaultCommand = true;
+ IOptionCommandGenerator commandGenerator = option.getCommandGenerator();
+ if (commandGenerator != null) {
+ SupplierBasedCdtVariableSubstitutor macroSubstitutor = new BuildfileMacroSubstitutor(
+ null, EMPTY_STRING, WHITE_SPACE);
+ IMacroContextInfoProvider provider = BuildMacroProvider.getDefault();
+ IMacroContextInfo info = provider.getMacroContextInfo(BuildMacroProvider.CONTEXT_OPTION,
+ new OptionContextData(option, tool));
+ if (info != null) {
+ macroSubstitutor.setMacroContextInfo(info);
+ String command = commandGenerator.generateCommand(option, macroSubstitutor);
+ if (command != null) {
+ libs.add(command);
+ generateDefaultCommand = false;
}
- } catch (BuildMacroException e) {
- // TODO: report error
- continue;
}
+ }
+ if (generateDefaultCommand) {
+ 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 (BuildException e) {
+ } catch (BuildException | CdtVariableException e) {
// TODO: report error
continue;
}
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 0380c9cf5fb..053e7b3e906 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
+ * Copyright (c) 2004, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,14 +10,14 @@
*
* Contributors:
* IBM - Initial API and implementation
+ * Sergei Kovalchuk (NXP)
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.internal.core;
+import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-import com.ibm.icu.text.MessageFormat;
-
/**
* @since 2.0
*/
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 6f4d9b20023..74a02ce33ff 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
@@ -54,10 +54,10 @@ import org.eclipse.core.runtime.Status;
import org.osgi.framework.Version;
public class Option extends BuildObject implements IOption, IBuildPropertiesRestriction {
- private static final String IS_BUILTIN_EMPTY = "IS_BUILTIN_EMPTY";
- private static final String IS_VALUE_EMPTY = "IS_VALUE_EMPTY";
+ private static final String IS_BUILTIN_EMPTY = "IS_BUILTIN_EMPTY"; //$NON-NLS-1$
+ private static final String IS_VALUE_EMPTY = "IS_VALUE_EMPTY"; //$NON-NLS-1$
// Static default return values
- public static final String EMPTY_STRING = "";
+ public static final String EMPTY_STRING = ""; //$NON-NLS-1$
public static final String[] EMPTY_STRING_ARRAY = new String[0];
public static final OptionStringValue[] EMPTY_LV_ARRAY = new OptionStringValue[0];
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 894a6c9eea6..0fd5e1076c4 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
@@ -2655,15 +2655,37 @@ public class Tool extends HoldsOptions
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;
+ switch (option.getValueType()) {
+ case IOption.BOOLEAN:
+ case IOption.ENUMERATED:
+ case IOption.TREE:
+ case IOption.STRING:
+ 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:
+ case IOption.PREPROCESSOR_SYMBOLS:
+ case IOption.UNDEF_PREPROCESSOR_SYMBOLS:
+ 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;
+ }
}
+ break;
+ default:
+ break;
}
}
if (generateDefaultCommand) {
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 33203750cc5..37b4064c516 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
@@ -355,7 +355,6 @@ public class ConfigurationDataProvider extends CConfigurationDataProvider implem
}
}
} catch (CoreException e) {
- mProj = null;
}
if (mProj == null) {
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 372edb43ed4..cb747980a31 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2011 Intel Corporation and others.
+ * Copyright (c) 2007, 2020 Intel Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,14 +10,14 @@
*
* Contributors:
* Intel Corporation - Initial API and implementation
+ * Sergei Kovalchuk (NXP)
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.internal.dataprovider;
+import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-import com.ibm.icu.text.MessageFormat;
-
public class DataProviderMessages {
private static final String BUNDLE_NAME = "org.eclipse.cdt.managedbuilder.internal.dataprovider.DataProviderMessages"; //$NON-NLS-1$
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompilationDatabaseParser.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompilationDatabaseParser.java
index 50619c09c19..008b05e9c11 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompilationDatabaseParser.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompilationDatabaseParser.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2019 Marc-Andre Laperle.
+ * Copyright (c) 2019, 2020 Marc-Andre Laperle and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -7,6 +7,10 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Marc-Andre Laperle - Initial API and implementation
+ * Sergei Kovalchuk (NXP)
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.internal.language.settings.providers;
@@ -17,6 +21,7 @@ import java.net.URI;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.attribute.FileTime;
+import java.text.MessageFormat;
import java.util.List;
import java.util.Set;
@@ -57,7 +62,6 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubMonitor;
import com.google.gson.Gson;
-import com.ibm.icu.text.MessageFormat;
/**
* This language settings provider takes a compile_commands.json file as input (aka, Compilation Database or CDB) and parses the commands
@@ -304,7 +308,12 @@ public class CompilationDatabaseParser extends LanguageSettingsSerializableProvi
}
}
- outputParser.processLine(c.getCommand());
+ String command = c.getCommand();
+ if (command != null) {
+ outputParser.processLine(command);
+ } else if (c.getArguments() != null) {
+ outputParser.processLine(String.join(" ", c.getArguments())); //$NON-NLS-1$
+ }
parseCmdsMonitor.worked(1);
}
LanguageSettingsStorage storage = outputParser.copyStorage();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompileCommand.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompileCommand.java
index 3675d94dc07..fa58863dee4 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompileCommand.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompileCommand.java
@@ -18,6 +18,7 @@ public class CompileCommand {
public String directory;
public String command;
public String file;
+ public String[] arguments;
public String getDirectory() {
return directory;
@@ -31,4 +32,7 @@ public class CompileCommand {
return file;
}
+ public String[] getArguments() {
+ return arguments;
+ }
}
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 2872e375c94..ae90cf4a416 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
@@ -39,11 +39,11 @@ import org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider;
import org.eclipse.cdt.managedbuilder.macros.IFileContextBuildMacroValues;
import org.eclipse.cdt.managedbuilder.macros.IFileContextData;
import org.eclipse.cdt.managedbuilder.macros.IOptionContextData;
-import org.eclipse.cdt.utils.Platform;
import org.eclipse.cdt.utils.cdtvariables.CdtVariableResolver;
import org.eclipse.cdt.utils.cdtvariables.IVariableSubstitutor;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Platform;
import org.osgi.framework.Bundle;
import org.osgi.framework.Version;
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 0ce05fd7bb0..dd090453622 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
@@ -103,7 +103,7 @@ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerat
+ IManagedBuilderMakefileGenerator.WHITESPACE + "-n" //$NON-NLS-1$
+ IManagedBuilderMakefileGenerator.WHITESPACE).append(depRule)
.append(IManagedBuilderMakefileGenerator.WHITESPACE + "$(dir $@)" //$NON-NLS-1$
- + IManagedBuilderMakefileGenerator.WHITESPACE + ">"
+ + IManagedBuilderMakefileGenerator.WHITESPACE + ">" //$NON-NLS-1$
+ IManagedBuilderMakefileGenerator.WHITESPACE)
.append(depRule)
.append(IManagedBuilderMakefileGenerator.WHITESPACE + IManagedBuilderMakefileGenerator.LOGICAL_AND
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 6f446c40b0a..bbf7a3bff10 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2011 Intel Corporation and others.
+ * Copyright (c) 2004, 2020 Intel Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,14 +10,14 @@
*
* Contributors:
* Intel Corporation - Initial API and implementation
+ * Sergei Kovalchuk (NXP)
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.projectconverter;
+import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-import com.ibm.icu.text.MessageFormat;
-
/**
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
@@ -30,16 +30,6 @@ public class ConverterMessages {
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 getResourceString(String key) {
try {
return RESOURCE_BUNDLE.getString(key);
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 ebf7b2ba9c1..95b7b1f79bd 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2002, 2009 QNX Software Systems and others.
+ * Copyright (c) 2002, 2020 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,14 +10,14 @@
*
* Contributors:
* QNX Software Systems - initial API and implementation
+ * Sergei Kovalchuk (NXP)
*******************************************************************************/
package org.eclipse.cdt.newmake.internal.core;
+import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-import com.ibm.icu.text.MessageFormat;
-
public class MakeMessages {
private static final String RESOURCE_BUNDLE = MakeMessages.class.getName();
diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/META-INF/MANIFEST.MF b/build/org.eclipse.cdt.managedbuilder.gnu.ui/META-INF/MANIFEST.MF
index 25f6444ba4d..93f29742738 100644
--- a/build/org.eclipse.cdt.managedbuilder.gnu.ui/META-INF/MANIFEST.MF
+++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.gnu.ui; singleton:=true
-Bundle-Version: 8.3.200.qualifier
+Bundle-Version: 8.3.300.qualifier
Bundle-Activator: org.eclipse.cdt.managedbuilder.gnu.ui.GnuUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -12,7 +12,7 @@ Export-Package: org.eclipse.cdt.managedbuilder.gnu.cygwin,
org.eclipse.cdt.managedbuilder.gnu.ui
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
org.eclipse.cdt.managedbuilder.core;bundle-version="[8.1.0,9.0.0)",
- org.eclipse.cdt.core;bundle-version="[5.0.0,7.0.0)",
+ org.eclipse.cdt.core;bundle-version="[7.0.0,8.0.0)",
org.eclipse.core.resources
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java
index 297cd23644e..a408bc85ea1 100644
--- a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java
+++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/cygwin/CygwinPathResolver.java
@@ -250,7 +250,7 @@ public class CygwinPathResolver implements IBuildPathResolver {
}
} catch (IOException e) {
GnuUIPlugin.getDefault()
- .log(new Status(IStatus.ERROR, GnuUIPlugin.PLUGIN_ID, "Error executing program [" + cmd + "]", e));
+ .log(new Status(IStatus.ERROR, GnuUIPlugin.PLUGIN_ID, "Error executing program [" + cmd + "]", e)); //$NON-NLS-1$ //$NON-NLS-2$
}
return result;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/META-INF/MANIFEST.MF b/build/org.eclipse.cdt.managedbuilder.ui/META-INF/MANIFEST.MF
index 54f9caadf8c..7826256dfb0 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/META-INF/MANIFEST.MF
+++ b/build/org.eclipse.cdt.managedbuilder.ui/META-INF/MANIFEST.MF
@@ -14,7 +14,7 @@ Export-Package: org.eclipse.cdt.managedbuilder.internal.ui.commands;x-internal:=
Require-Bundle: org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
org.eclipse.core.variables;bundle-version="[3.1.100,4.0.0)",
- org.eclipse.cdt.core;bundle-version="[5.0.0,7.0.0)",
+ org.eclipse.cdt.core;bundle-version="[7.0.0,8.0.0)",
org.eclipse.cdt.make.core,
org.eclipse.cdt.make.ui,
org.eclipse.cdt.managedbuilder.core;bundle-version="[8.7.0,9.0.0)",
@@ -26,5 +26,4 @@ Require-Bundle: org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
org.eclipse.core.expressions
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Import-Package: com.ibm.icu.text
Automatic-Module-Name: org.eclipse.cdt.managedbuilder.ui
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/commands/BuildConfigurationsJob.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/commands/BuildConfigurationsJob.java
index 82683d692be..b0a9dcc5ca0 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/commands/BuildConfigurationsJob.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/commands/BuildConfigurationsJob.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 Andrew Gvozdev and others.
+ * Copyright (c) 2010, 2020 Andrew Gvozdev and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,9 +10,12 @@
*
* Contributors:
* Andrew Gvozdev (Quoin Inc) - initial API and implementation
+ * Sergei Kovalchuk (NXP USA Inc)
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.internal.ui.commands;
+import java.text.MessageFormat;
+
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
@@ -25,8 +28,6 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
-import com.ibm.icu.text.MessageFormat;
-
/**
* A job to build CDT build configurations.
*/
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/wizards/Messages.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/wizards/Messages.java
new file mode 100644
index 00000000000..b9c0506d206
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/wizards/Messages.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Marc-Andre Laperle.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+
+package org.eclipse.cdt.managedbuilder.internal.ui.wizards;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.cdt.managedbuilder.internal.ui.wizards.messages"; //$NON-NLS-1$
+ public static String WizardMakeProjectConversion_title;
+ public static String WizardMakeProjectConversion_description;
+ public static String WizardMakeProjectConversion_monitor_convertingToMakeProject;
+ public static String WizardMakeProjectConversion_projectOptions_title;
+ public static String WizardMakeProjectConversion_projectOptions_projectType;
+ public static String WizardMakeProjectConversion_projectOptions_projectTypeTable;
+ public static String WizardMakeProjectConversion_projectOptions_showSuppressed;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/wizards/messages.properties b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/wizards/messages.properties
new file mode 100644
index 00000000000..9310ffef0fe
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/wizards/messages.properties
@@ -0,0 +1,18 @@
+###############################################################################
+# Copyright (c) 2020 Marc-Andre Laperle and others.
+#
+# This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+###############################################################################
+
+WizardMakeProjectConversion_title=Convert to a C/C++ project
+WizardMakeProjectConversion_description=The wizard adds C/C++ Nature to the selected projects to enable C/C++ Tools Support for them.
+WizardMakeProjectConversion_monitor_convertingToMakeProject=Converting to C/C++ Project...
+WizardMakeProjectConversion_projectOptions_title=Project options
+WizardMakeProjectConversion_projectOptions_projectType=Specify project type
+WizardMakeProjectConversion_projectOptions_projectTypeTable=Project type:
+WizardMakeProjectConversion_projectOptions_showSuppressed=Show project types and toolchains only if they are supported on the platform
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildStepsTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildStepsTab.java
index a5207a2dbe7..c5965880e80 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildStepsTab.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildStepsTab.java
@@ -466,31 +466,44 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
boolean prj = page.isForProject();
if (prj || tool != null) {
for (ICConfigurationDescription cf : page.getCfgsEditable()) {
- IConfiguration c = null;
- ITool t = null;
+ String s = null;
if (prj) {
- c = getCfg(cf);
+ IConfiguration c = getCfg(cf);
+ switch (field) {
+ case PRECMD:
+ s = c.getPrebuildStep();
+ break;
+ case PREANN:
+ s = c.getPreannouncebuildStep();
+ break;
+ case PSTCMD:
+ s = c.getPostbuildStep();
+ break;
+ case PSTANN:
+ s = c.getPostannouncebuildStep();
+ break;
+ }
} else {
+ ITool t = null;
ICResourceDescription r = cf.getResourceDescription(cfgdescr.getPath(), true);
if (r != null && r instanceof ICFileDescription)
t = getRcbsTool((IFileInfo) getResCfg(r));
if (t == null)
continue; // there's no specific resconfig for this configuration
- }
- String s = null;
- switch (field) {
- case PRECMD:
- s = prj ? c.getPrebuildStep() : getInputTypes(t);
- break;
- case PREANN:
- s = prj ? c.getPreannouncebuildStep() : getOutputNames(t);
- break;
- case PSTCMD:
- s = prj ? c.getPostbuildStep() : t.getToolCommand();
- break;
- case PSTANN:
- s = prj ? c.getPostannouncebuildStep() : t.getAnnouncement();
- break;
+ switch (field) {
+ case PRECMD:
+ s = getInputTypes(t);
+ break;
+ case PREANN:
+ s = getOutputNames(t);
+ break;
+ case PSTCMD:
+ s = t.getToolCommand();
+ break;
+ case PSTANN:
+ s = t.getAnnouncement();
+ break;
+ }
}
if (s != null && s.trim().length() > 0)
set.add(s.trim());
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java
index 055459411f0..87be6667330 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java
@@ -19,6 +19,7 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import java.util.Set;
import java.util.TreeSet;
@@ -31,7 +32,6 @@ import org.eclipse.cdt.core.language.settings.providers.ScannerDiscoveryLegacySu
import org.eclipse.cdt.core.model.util.CDTListComparator;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
-import org.eclipse.cdt.core.settings.model.util.CDataUtil;
import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProvidersPage;
import org.eclipse.cdt.internal.ui.newui.StatusMessageLine;
import org.eclipse.cdt.make.core.MakeCorePlugin;
@@ -734,13 +734,13 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
}
private boolean settingsEqual(IScannerConfigBuilderInfo2 info1, IScannerConfigBuilderInfo2 info2) {
- if (!CDataUtil.objectsEqual(info1.getSelectedProfileId(), info2.getSelectedProfileId()))
+ if (!Objects.equals(info1.getSelectedProfileId(), info2.getSelectedProfileId()))
return false;
- if (!CDataUtil.objectsEqual(info1.getBuildOutputFilePath(), info2.getBuildOutputFilePath()))
+ if (!Objects.equals(info1.getBuildOutputFilePath(), info2.getBuildOutputFilePath()))
return false;
- if (!CDataUtil.objectsEqual(info1.getContext(), info2.getContext()))
+ if (!Objects.equals(info1.getContext(), info2.getContext()))
return false;
- if (!CDataUtil.objectsEqual(info1.getSelectedProfileId(), info2.getSelectedProfileId()))
+ if (!Objects.equals(info1.getSelectedProfileId(), info2.getSelectedProfileId()))
return false;
if (info1.isAutoDiscoveryEnabled() != info2.isAutoDiscoveryEnabled()
|| info1.isBuildOutputFileActionEnabled() != info2.isBuildOutputFileActionEnabled()
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewVarDialog.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewVarDialog.java
index 52da2e22d56..05e357cebda 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewVarDialog.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/NewVarDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2016 Intel Corporation and others.
+ * Copyright (c) 2005, 2020 Intel Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,9 +10,11 @@
*
* Contributors:
* Intel Corporation - Initial API and implementation
+ * Sergei Kovalchuk (NXP USA Inc)
*******************************************************************************/
package org.eclipse.cdt.managedbuilder.ui.properties;
+import java.text.Collator;
import java.util.Arrays;
import java.util.Comparator;
@@ -49,8 +51,6 @@ import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
-import com.ibm.icu.text.Collator;
-
/**
* the dialog used to create or edit the build macro
*
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/ConvertToMakeWizardPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/ConvertToMakeWizardPage.java
index 35f04bdaf6c..a2e266b558d 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/ConvertToMakeWizardPage.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/wizards/ConvertToMakeWizardPage.java
@@ -20,7 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.cdt.core.CCProjectNature;
-import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
+import org.eclipse.cdt.managedbuilder.internal.ui.wizards.Messages;
import org.eclipse.cdt.ui.newui.AbstractPage;
import org.eclipse.cdt.ui.newui.CDTPrefUtil;
import org.eclipse.cdt.ui.newui.PageLayout;
@@ -53,9 +53,6 @@ import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
* @noinstantiate This class is not intended to be instantiated by clients.
*/
public class ConvertToMakeWizardPage extends ConvertProjectWizardPage {
- private static final String WZ_TITLE = "WizardMakeProjectConversion.title"; //$NON-NLS-1$
- private static final String WZ_DESC = "WizardMakeProjectConversion.description"; //$NON-NLS-1$
-
/**
* @since 5.1
*/
@@ -96,14 +93,13 @@ public class ConvertToMakeWizardPage extends ConvertProjectWizardPage {
layoutData.heightHint = 200;
optionsGroup.setLayoutData(layoutData);
optionsGroup.setLayout(new GridLayout(1, true));
- optionsGroup.setText(MakeUIPlugin.getResourceString("WizardMakeProjectConversion.projectOptions.title")); //$NON-NLS-1$
+ optionsGroup.setText(Messages.WizardMakeProjectConversion_projectOptions_title);
Composite c = new Composite(optionsGroup, SWT.NONE);
c.setLayoutData(new GridData(GridData.FILL_BOTH));
c.setLayout(new GridLayout(2, true));
specifyProjectTypeButton = new Button(c, SWT.CHECK);
- specifyProjectTypeButton
- .setText(MakeUIPlugin.getResourceString("WizardMakeProjectConversion.projectOptions.projectType")); //$NON-NLS-1$
+ specifyProjectTypeButton.setText(Messages.WizardMakeProjectConversion_projectOptions_projectType);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
specifyProjectTypeButton.setLayoutData(gd);
@@ -115,8 +111,7 @@ public class ConvertToMakeWizardPage extends ConvertProjectWizardPage {
});
left_label = new Label(c, SWT.NONE);
- left_label
- .setText(MakeUIPlugin.getResourceString("WizardMakeProjectConversion.projectOptions.projectTypeTable")); //$NON-NLS-1$
+ left_label.setText(Messages.WizardMakeProjectConversion_projectOptions_projectTypeTable);
left_label.setFont(container.getFont());
left_label.setLayoutData(new GridData(GridData.BEGINNING));
@@ -141,7 +136,7 @@ public class ConvertToMakeWizardPage extends ConvertProjectWizardPage {
show_sup = new Button(c, SWT.CHECK);
show_sup.setSelection(true);
- show_sup.setText(MakeUIPlugin.getResourceString("WizardMakeProjectConversion.projectOptions.showSuppressed")); //$NON-NLS-1$
+ show_sup.setText(Messages.WizardMakeProjectConversion_projectOptions_showSuppressed);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
show_sup.setLayoutData(gd);
@@ -233,7 +228,7 @@ public class ConvertToMakeWizardPage extends ConvertProjectWizardPage {
*/
@Override
protected String getWzTitleResource() {
- return MakeUIPlugin.getResourceString(WZ_TITLE);
+ return Messages.WizardMakeProjectConversion_title;
}
/**
@@ -242,7 +237,7 @@ public class ConvertToMakeWizardPage extends ConvertProjectWizardPage {
*/
@Override
protected String getWzDescriptionResource() {
- return MakeUIPlugin.getResourceString(WZ_DESC);
+ return Messages.WizardMakeProjectConversion_description;
}
/**
@@ -265,8 +260,7 @@ public class ConvertToMakeWizardPage extends ConvertProjectWizardPage {
@Override
public void convertProject(IProject project, String bsId, IProgressMonitor monitor) throws CoreException {
- monitor.beginTask(MakeUIPlugin.getResourceString("WizardMakeProjectConversion.monitor.convertingToMakeProject"), //$NON-NLS-1$
- 3);
+ monitor.beginTask(Messages.WizardMakeProjectConversion_monitor_convertingToMakeProject, 3);
try {
boolean wasCDTProject = AbstractPage.isCDTPrj(project);
super.convertProject(project, bsId, new SubProgressMonitor(monitor, 1));
@@ -280,8 +274,7 @@ public class ConvertToMakeWizardPage extends ConvertProjectWizardPage {
@Override
public void convertProject(IProject project, IProgressMonitor monitor, String projectID) throws CoreException {
- monitor.beginTask(MakeUIPlugin.getResourceString("WizardMakeProjectConversion.monitor.convertingToMakeProject"), //$NON-NLS-1$
- 3);
+ monitor.beginTask(Messages.WizardMakeProjectConversion_monitor_convertingToMakeProject, 3);
try {
boolean wasCDTProject = AbstractPage.isCDTPrj(project);
super.convertProject(project, new SubProgressMonitor(monitor, 1), projectID);
diff --git a/build/org.eclipse.cdt.meson.core/META-INF/MANIFEST.MF b/build/org.eclipse.cdt.meson.core/META-INF/MANIFEST.MF
index 9d18a0de78b..7a4a9f4b1d0 100644
--- a/build/org.eclipse.cdt.meson.core/META-INF/MANIFEST.MF
+++ b/build/org.eclipse.cdt.meson.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name.0
Bundle-SymbolicName: org.eclipse.cdt.meson.core;singleton:=true
-Bundle-Version: 1.0.300.qualifier
+Bundle-Version: 1.0.400.qualifier
Bundle-Activator: org.eclipse.cdt.meson.core.Activator
Bundle-Vendor: %provider
Require-Bundle: org.eclipse.core.runtime,
diff --git a/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonBuildConfiguration.java b/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonBuildConfiguration.java
index 6e9d56bb7f4..25d064b9659 100644
--- a/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonBuildConfiguration.java
+++ b/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonBuildConfiguration.java
@@ -34,13 +34,13 @@ import org.eclipse.cdt.meson.core.Activator;
import org.eclipse.cdt.meson.core.IMesonConstants;
import org.eclipse.cdt.meson.core.IMesonToolChainFile;
import org.eclipse.cdt.meson.core.IMesonToolChainManager;
-import org.eclipse.cdt.utils.Platform;
import org.eclipse.core.resources.IBuildConfiguration;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.osgi.service.prefs.BackingStoreException;
@@ -159,11 +159,11 @@ public class MesonBuildConfiguration extends CBuildConfiguration {
String userArgs = getProperty(IMesonConstants.MESON_ARGUMENTS);
if (userArgs != null && !userArgs.isEmpty()) {
- commandList.addAll(Arrays.asList(userArgs.split(" ")));
+ commandList.addAll(Arrays.asList(userArgs.split(" "))); //$NON-NLS-1$
}
String projOptions = getProperty(IMesonConstants.MESON_PROJECT_OPTIONS);
if (projOptions != null && !projOptions.isEmpty()) {
- commandList.addAll(Arrays.asList(projOptions.split(" ")));
+ commandList.addAll(Arrays.asList(projOptions.split(" "))); //$NON-NLS-1$
}
commandList.add(getBuildDirectory().toString());
diff --git a/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/meson/core/MesonProjectGenerator.java b/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/meson/core/MesonProjectGenerator.java
index 6b0179c5b1c..aa4c14a096a 100644
--- a/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/meson/core/MesonProjectGenerator.java
+++ b/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/meson/core/MesonProjectGenerator.java
@@ -81,8 +81,7 @@ public class MesonProjectGenerator extends FMProjectGenerator {
}
}
- entries.add(CoreModel.newOutputEntry(buildFolder.getFullPath(), // $NON-NLS-1$
- new IPath[] {})); //$NON-NLS-1$
+ entries.add(CoreModel.newOutputEntry(buildFolder.getFullPath(), new IPath[] {}));
CoreModel.getDefault().create(project).setRawPathEntries(entries.toArray(new IPathEntry[entries.size()]),
monitor);
}
diff --git a/build/org.eclipse.cdt.meson.ui/META-INF/MANIFEST.MF b/build/org.eclipse.cdt.meson.ui/META-INF/MANIFEST.MF
index a87ef80bac4..18378369351 100644
--- a/build/org.eclipse.cdt.meson.ui/META-INF/MANIFEST.MF
+++ b/build/org.eclipse.cdt.meson.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name.0
Bundle-SymbolicName: org.eclipse.cdt.meson.ui;singleton:=true
-Bundle-Version: 1.0.400.qualifier
+Bundle-Version: 1.0.500.qualifier
Bundle-Vendor: %vendorName
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Activator: org.eclipse.cdt.meson.ui.Activator
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/MesonBuildTab.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/MesonBuildTab.java
index 0e2359d1ed3..8840b3dfc1e 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/MesonBuildTab.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/MesonBuildTab.java
@@ -34,7 +34,7 @@ import org.eclipse.swt.widgets.Text;
public class MesonBuildTab extends CommonBuildTab {
- private static final String NINJA = "Ninja";
+ private static final String NINJA = "Ninja"; //$NON-NLS-1$
private Button unixGenButton;
private Button ninjaGenButton;
private Text mesonArgsText;
@@ -135,7 +135,7 @@ public class MesonBuildTab extends CommonBuildTab {
}
private void updateGeneratorButtons(String generator) {
- if (generator == null || generator.equals(NINJA)) { //$NON-NLS-1$
+ if (generator == null || generator.equals(NINJA)) {
ninjaGenButton.setSelection(true);
} else {
unixGenButton.setSelection(true);
@@ -149,7 +149,7 @@ public class MesonBuildTab extends CommonBuildTab {
ICBuildConfiguration buildConfig = getBuildConfiguration();
buildConfig.setProperty(IMesonConstants.MESON_GENERATOR,
- ninjaGenButton.getSelection() ? NINJA : "Unix Makefiles"); //$NON-NLS-1$ //$NON-NLS-2$
+ ninjaGenButton.getSelection() ? NINJA : "Unix Makefiles"); //$NON-NLS-1$
String mesonArgs = mesonArgsText.getText().trim();
if (!mesonArgs.isEmpty()) {
@@ -176,7 +176,7 @@ public class MesonBuildTab extends CommonBuildTab {
@Override
protected void saveProperties(Map<String, String> properties) {
super.saveProperties(properties);
- properties.put(IMesonConstants.MESON_GENERATOR, ninjaGenButton.getSelection() ? NINJA : "Unix Makefiles"); //$NON-NLS-1$ //$NON-NLS-2$
+ properties.put(IMesonConstants.MESON_GENERATOR, ninjaGenButton.getSelection() ? NINJA : "Unix Makefiles"); //$NON-NLS-1$
properties.put(IMesonConstants.MESON_ARGUMENTS, mesonArgsText.getText().trim());
properties.put(IMesonConstants.BUILD_COMMAND, buildCommandText.getText().trim());
@@ -190,7 +190,7 @@ public class MesonBuildTab extends CommonBuildTab {
String gen = properties.get(IMesonConstants.MESON_GENERATOR);
if (gen != null) {
switch (gen) {
- case NINJA: //$NON-NLS-1$
+ case NINJA:
ninjaGenButton.setSelection(true);
unixGenButton.setSelection(false);
break;
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/SWTImagesFactory.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/SWTImagesFactory.java
index 5c56c670950..0995fed8283 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/SWTImagesFactory.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/SWTImagesFactory.java
@@ -40,7 +40,7 @@ public class SWTImagesFactory {
private static final String NAME_PREFIX = Activator.PLUGIN_ID + '.';
private static final int NAME_PREFIX_LENGTH = NAME_PREFIX.length();
public static final String IMG_MESON = NAME_PREFIX + "meson-logo.png"; //$NON-NLS-1$
- public static final ImageDescriptor DESC_MESON = createManaged("", IMG_MESON);
+ public static final ImageDescriptor DESC_MESON = createManaged("", IMG_MESON); //$NON-NLS-1$
private static ImageDescriptor createManaged(String prefix, String name) {
return createManaged(imageRegistry, prefix, name);
diff --git a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/commands/RunNinjaCommandHandler.java b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/commands/RunNinjaCommandHandler.java
index 8e79f194cba..22a4f477056 100644
--- a/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/commands/RunNinjaCommandHandler.java
+++ b/build/org.eclipse.cdt.meson.ui/src/org/eclipse/cdt/internal/meson/ui/commands/RunNinjaCommandHandler.java
@@ -79,7 +79,7 @@ public class RunNinjaCommandHandler extends AbstractMesonCommandHandler {
String[] ninjaArgs = null;
if (argString != null) {
List<String> ninjaArgList = new ArrayList<>();
- Matcher m = Pattern.compile("([^\"]\\S*|\".+?\")\\s*").matcher(argString);
+ Matcher m = Pattern.compile("([^\"]\\S*|\".+?\")\\s*").matcher(argString); //$NON-NLS-1$
while (m.find()) {
ninjaArgList.add(m.group(1));
}
diff --git a/cmake/org.eclipse.cdt.cmake.is.arm.tests/src/main/java/org/eclipse/cdt/cmake/is/arm/ToolDetectionParticipantTest.java b/cmake/org.eclipse.cdt.cmake.is.arm.tests/src/main/java/org/eclipse/cdt/cmake/is/arm/ToolDetectionParticipantTest.java
index 23a25b7f08d..17d67415ffe 100644
--- a/cmake/org.eclipse.cdt.cmake.is.arm.tests/src/main/java/org/eclipse/cdt/cmake/is/arm/ToolDetectionParticipantTest.java
+++ b/cmake/org.eclipse.cdt.cmake.is.arm.tests/src/main/java/org/eclipse/cdt/cmake/is/arm/ToolDetectionParticipantTest.java
@@ -13,8 +13,8 @@ import static org.junit.Assert.assertNotNull;
import java.util.Locale;
-import org.eclipse.cdt.cmake.is.core.IToolDetectionParticipant;
-import org.eclipse.cdt.cmake.is.core.ParticipantTestUtil;
+import org.eclipse.cdt.cmake.is.core.participant.IToolDetectionParticipant;
+import org.eclipse.cdt.cmake.is.core.participant.ParticipantTestUtil;
import org.junit.Test;
/**
diff --git a/cmake/org.eclipse.cdt.cmake.is.arm/help_content_extension.xml b/cmake/org.eclipse.cdt.cmake.is.arm/help_content_extension.xml
index 89a0db52ea1..3b92d111788 100644
--- a/cmake/org.eclipse.cdt.cmake.is.arm/help_content_extension.xml
+++ b/cmake/org.eclipse.cdt.cmake.is.arm/help_content_extension.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<contentExtension>
<contribution content="doc/compiler.xhtml#lsp"
- path="/de.marw.cdt.cmake.core/doc/html/languageSettingsProviders.xhtml#extra_lsp_detection_participant_list"/>
+ path="/org.eclipse.cdt.cmake.is.core.doc/doc/html/languageSettingsProviders.xhtml#extra_detection_participant_list"/>
<contribution content="doc/compiler.xhtml#builtins"
- path="/de.marw.cdt.cmake.core/doc/html/builtins-detection.xhtml#extra_lsp_detection_participant_builtins_list"/>
+ path="/org.eclipse.cdt.cmake.is.core.doc/doc/html/builtins-detection.xhtml#extra_detection_participant_builtins_list"/>
</contentExtension> \ No newline at end of file
diff --git a/cmake/org.eclipse.cdt.cmake.is.arm/src/main/java/org/eclipse/cdt/cmake/is/arm/ArmClangToolDetectionParticipant.java b/cmake/org.eclipse.cdt.cmake.is.arm/src/main/java/org/eclipse/cdt/cmake/is/arm/ArmClangToolDetectionParticipant.java
index 0c42b5e65b6..1d491d776ef 100644
--- a/cmake/org.eclipse.cdt.cmake.is.arm/src/main/java/org/eclipse/cdt/cmake/is/arm/ArmClangToolDetectionParticipant.java
+++ b/cmake/org.eclipse.cdt.cmake.is.arm/src/main/java/org/eclipse/cdt/cmake/is/arm/ArmClangToolDetectionParticipant.java
@@ -9,11 +9,11 @@
package org.eclipse.cdt.cmake.is.arm;
-import org.eclipse.cdt.cmake.is.core.Arglets;
-import org.eclipse.cdt.cmake.is.core.DefaultToolCommandlineParser;
-import org.eclipse.cdt.cmake.is.core.DefaultToolDetectionParticipant;
-import org.eclipse.cdt.cmake.is.core.IArglet;
-import org.eclipse.cdt.cmake.is.core.ResponseFileArglets;
+import org.eclipse.cdt.cmake.is.core.participant.Arglets;
+import org.eclipse.cdt.cmake.is.core.participant.DefaultToolCommandlineParser;
+import org.eclipse.cdt.cmake.is.core.participant.DefaultToolDetectionParticipant;
+import org.eclipse.cdt.cmake.is.core.participant.IArglet;
+import org.eclipse.cdt.cmake.is.core.participant.ResponseFileArglets;
/**
* armclang C & C++.
@@ -33,7 +33,7 @@ public class ArmClangToolDetectionParticipant extends DefaultToolDetectionPartic
new Arglets.MacroUndefine_C_POSIX() };
private ToolCommandlineParser() {
- super(null, new ResponseFileArglets.At(), null, arglets);
+ super(new ResponseFileArglets.At(), null, arglets);
}
}
}
diff --git a/cmake/org.eclipse.cdt.cmake.is.arm/src/main/java/org/eclipse/cdt/cmake/is/arm/ArmccBuiltinDetectionBehavior.java b/cmake/org.eclipse.cdt.cmake.is.arm/src/main/java/org/eclipse/cdt/cmake/is/arm/ArmccBuiltinDetectionBehavior.java
index 8b1d9ff9b83..335d40b2661 100644
--- a/cmake/org.eclipse.cdt.cmake.is.arm/src/main/java/org/eclipse/cdt/cmake/is/arm/ArmccBuiltinDetectionBehavior.java
+++ b/cmake/org.eclipse.cdt.cmake.is.arm/src/main/java/org/eclipse/cdt/cmake/is/arm/ArmccBuiltinDetectionBehavior.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2019 Martin Weber.
+ * Copyright (c) 2019-2020 Martin Weber.
*
* Content is provided to you under the terms and conditions of the Eclipse Public License Version 2.0 "EPL".
* A copy of the EPL is available at http://www.eclipse.org/legal/epl-2.0.
@@ -12,9 +12,9 @@ package org.eclipse.cdt.cmake.is.arm;
import java.util.Arrays;
import java.util.List;
-import org.eclipse.cdt.cmake.is.core.builtins.GccOutputProcessor;
-import org.eclipse.cdt.cmake.is.core.builtins.IBuiltinsDetectionBehavior;
-import org.eclipse.cdt.cmake.is.core.builtins.IBuiltinsOutputProcessor;
+import org.eclipse.cdt.cmake.is.core.participant.builtins.GccOutputProcessor;
+import org.eclipse.cdt.cmake.is.core.participant.builtins.IBuiltinsDetectionBehavior;
+import org.eclipse.cdt.cmake.is.core.participant.builtins.IBuiltinsOutputProcessor;
/**
* The {link IBuiltinsDetectionBehavior} for the ARM C or C++ version 5
@@ -43,16 +43,4 @@ class ArmccBuiltinDetectionBehavior implements IBuiltinsDetectionBehavior {
// enable built-in detection
return false;
}
-
- @SuppressWarnings("nls")
- @Override
- public String getInputFileExtension(String languageId) {
- if (languageId.equals("org.eclipse.cdt.core.gcc")) {
- return "c";
- }
- if (languageId.equals("org.eclipse.cdt.core.g++")) {
- return "cpp";
- }
- return null;
- }
}
diff --git a/cmake/org.eclipse.cdt.cmake.is.arm/src/main/java/org/eclipse/cdt/cmake/is/arm/ArmccToolDetectionParticipant.java b/cmake/org.eclipse.cdt.cmake.is.arm/src/main/java/org/eclipse/cdt/cmake/is/arm/ArmccToolDetectionParticipant.java
index 9ac8c8c17b3..b3f71329c51 100644
--- a/cmake/org.eclipse.cdt.cmake.is.arm/src/main/java/org/eclipse/cdt/cmake/is/arm/ArmccToolDetectionParticipant.java
+++ b/cmake/org.eclipse.cdt.cmake.is.arm/src/main/java/org/eclipse/cdt/cmake/is/arm/ArmccToolDetectionParticipant.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2019 Martin Weber.
+ * Copyright (c) 2019-2020 Martin Weber.
*
* Content is provided to you under the terms and conditions of the Eclipse Public License Version 2.0 "EPL".
* A copy of the EPL is available at http://www.eclipse.org/legal/epl-2.0.
@@ -9,10 +9,10 @@
package org.eclipse.cdt.cmake.is.arm;
-import org.eclipse.cdt.cmake.is.core.Arglets;
-import org.eclipse.cdt.cmake.is.core.DefaultToolCommandlineParser;
-import org.eclipse.cdt.cmake.is.core.DefaultToolDetectionParticipant;
-import org.eclipse.cdt.cmake.is.core.IArglet;
+import org.eclipse.cdt.cmake.is.core.participant.Arglets;
+import org.eclipse.cdt.cmake.is.core.participant.DefaultToolCommandlineParser;
+import org.eclipse.cdt.cmake.is.core.participant.DefaultToolDetectionParticipant;
+import org.eclipse.cdt.cmake.is.core.participant.IArglet;
/**
* armcc C & C++.
@@ -32,7 +32,7 @@ public class ArmccToolDetectionParticipant extends DefaultToolDetectionParticipa
new Arglets.MacroUndefine_C_POSIX(), new Arglets.SystemIncludePath_armcc() };
private ToolCommandlineParser() {
- super(null, null, new ArmccBuiltinDetectionBehavior(), arglets);
+ super(null, new ArmccBuiltinDetectionBehavior(), arglets);
}
}
}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core.doc/doc/html/builtins-detection.xhtml b/cmake/org.eclipse.cdt.cmake.is.core.doc/doc/html/builtins-detection.xhtml
index f9eb219e7e2..ff1d8355b01 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core.doc/doc/html/builtins-detection.xhtml
+++ b/cmake/org.eclipse.cdt.cmake.is.core.doc/doc/html/builtins-detection.xhtml
@@ -20,7 +20,7 @@ td {
<p>CDT CMake support can detect compiler-built-in include paths and preprocessor macros.<br/>
Unfortunately, it has no knowledge about the generated build system structure, the <code>compile_commads.json</code>
file generated by CMake only reports source-files. To avoid the cost of running the built-ins detector for
- <strong>each</strong> source-file, CDT CMAke support assumes that compiler built-ins
+ <strong>each</strong> source-file, CDT CMake support assumes that compiler built-ins
are the same for each source-file in a CMake project. Therefore, detection is run just once
(on the first source file found per language) per Eclipse project.
</p>
@@ -75,7 +75,7 @@ td {
<h3>Compilers supported through separate plug-ins</h3>
<!-- extra compilers go here -->
- <anchor id="extra_lsp_detection_participant_builtins_list"/>
+ <anchor id="extra_detection_participant_builtins_list"/>
<h2>Enhanced Built-ins Detection Support</h2>
<p>Some compilers, mainly those of the GNU Compiler Collection and derivatives, report different built-ins
@@ -106,16 +106,6 @@ td {
</tr>
</tbody>
</table>
- <p>
- Please note that for performance reasons, compiler built-ins assumes that compiler built-ins
- are the <strong>same for each source-file</strong> in a CMake project and built-ins detection is run only for the
- first source-file.<br/>
- In contrast, CMake has commands like <code>add_compile_options</code>, <code>target_compile_features</code> and
- <code>target_compile_options</code> allowing you to specify the language standard and
- non-standard system include paths on a
- <strong>per-source-directory</strong> or <strong>per-artifact</strong> level.
- Hence the syntax highlighting may not always exactly reflect the built-ins specified on that levels.
- </p>
<p>Remarks:</p>
<ul style="list-style-type:none">
<li id="fw-help-gcc">[1] Help wanted! To implement this, the output of <code>gcc -E -P -dM -Wp,-v emty.c</code>
@@ -126,6 +116,6 @@ td {
<h3>Compilers supported through separate plug-ins</h3>
<!-- extra compilers go here -->
- <anchor id="extra_lsp_detection_participant_builtins_enhanced_list"/>
+ <anchor id="extra_detection_participant_builtins_enhanced_list"/>
</body>
</html> \ No newline at end of file
diff --git a/cmake/org.eclipse.cdt.cmake.is.core.doc/doc/html/languageSettingsProviders.xhtml b/cmake/org.eclipse.cdt.cmake.is.core.doc/doc/html/languageSettingsProviders.xhtml
index 3ae21f56596..edf7d563d9a 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core.doc/doc/html/languageSettingsProviders.xhtml
+++ b/cmake/org.eclipse.cdt.cmake.is.core.doc/doc/html/languageSettingsProviders.xhtml
@@ -2,10 +2,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
-<title>Available Language Setting Providers</title>
-<!--
-TODO update this! We do not use Language Setting Providers in core build!
--->
+<title>Available Compiler Support for the Indexer</title>
<style type="text/css">
table, th, td {
border: 1px solid black;
@@ -17,23 +14,10 @@ th, td {
</head>
<body>
<h1>Preprocessor Include Paths, Macros</h1>
- <P>Include paths and preprocessor macros for the CDT source code indexer are supplied by
- <strong>Language Settings Providers</strong> using the
- <a href="PLUGINS_ROOT/org.eclipse.cdt.doc.user/tasks/cdt_t_sd.htm">Scanner Discovery</a>
- mechanism. The C/C++/CUDA editors use the indexer to improve syntax highlighting, allowing you to jump to
+ <P>The C/C++/CUDA editors use the CDT indexer to improve syntax highlighting, allowing you to jump to
macro definitions and to browse through include files.
</P>
- <p>The CDT CMake support provides two <a href="PLUGINS_ROOT/org.eclipse.cdt.doc.user/concepts/cdt_c_scanner_discovery.htm">Language Settings Providers</a>:</p>
-
- <h2>CMAKE_EXPORT_COMPILE_COMMANDS Parser</h2>
- <p>This provider instructs CMake to generate a file that contains all the compiler command-lines
- which will be executed when a project is build.<br/>
- The provider will parse that file and feed any preprocessor include path, macro definition or
- macro undefine that originates from your <em>CMakeLists.txt</em> files to the indexer.<br/>
- Parsing is done rarely, since the internal cache is invalidated only when the
- file`s time-stamp is newer, so it should be reasonably fast.
- </p>
- <p>The following table lists the compiler executables supported by the CMAKE_EXPORT_COMPILE_COMMANDS Parser.</p>
+ <p>The following table lists the compiler executables supported by the CDT CMake build integration.</p>
<table id="overview_table" style="border-collapse:collapse">
<thead>
<tr>
@@ -115,11 +99,10 @@ th, td {
</ul>
<h3>Compilers supported through separate plug-ins</h3>
<!-- extra compilers go here -->
- <anchor id="extra_lsp_detection_participant_list"/>
+ <anchor id="extra_detection_participant_list"/>
- <h2>CMAKE_EXPORT_COMPILE_COMMANDS Compiler Built-ins</h2>
- <p>This provider works similar to <q>CMAKE_EXPORT_COMPILE_COMMANDS Parser</q>, but invokes
- the compiler with arguments to get the include paths and preprocessor macros
+ <h2>CDT CMake build integration Compiler Built-ins detection</h2>
+ <p>This feature also invokes tries to get the include paths and preprocessor macros
<strong>built-in to the compiler</strong>.<br/>
Note that this works only for compilers that supporting it.
See <a href="builtins-detection.xhtml">built-ins detection</a> for supported compilers.
diff --git a/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/BuiltinsDetectLangStd_GCC_Test.java b/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/BuiltinsDetectLangStd_GCC_Test.java
index 39d2f81db55..1d33de353ab 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/BuiltinsDetectLangStd_GCC_Test.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/BuiltinsDetectLangStd_GCC_Test.java
@@ -10,8 +10,8 @@ package org.eclipse.cdt.cmake.is.core.internal;
import static org.junit.Assert.assertEquals;
-import org.eclipse.cdt.cmake.is.core.Arglets;
-import org.eclipse.cdt.cmake.is.core.Arglets.LangStd_GCC;
+import org.eclipse.cdt.cmake.is.core.participant.Arglets;
+import org.eclipse.cdt.cmake.is.core.participant.Arglets.LangStd_GCC;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.junit.Before;
diff --git a/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/BuiltinsDetectSysroot_GCC_Test.java b/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/BuiltinsDetectSysroot_GCC_Test.java
index 3c543d36138..c9f08bcdb14 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/BuiltinsDetectSysroot_GCC_Test.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/BuiltinsDetectSysroot_GCC_Test.java
@@ -10,8 +10,8 @@ package org.eclipse.cdt.cmake.is.core.internal;
import static org.junit.Assert.assertEquals;
-import org.eclipse.cdt.cmake.is.core.Arglets;
-import org.eclipse.cdt.cmake.is.core.Arglets.Sysroot_GCC;
+import org.eclipse.cdt.cmake.is.core.participant.Arglets;
+import org.eclipse.cdt.cmake.is.core.participant.Arglets.Sysroot_GCC;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.junit.Before;
diff --git a/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/IncludePath_C_POSIXTest.java b/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/IncludePath_C_POSIXTest.java
index 2e82730b0f0..3539ec889cc 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/IncludePath_C_POSIXTest.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/IncludePath_C_POSIXTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015 Martin Weber.
+ * Copyright (c) 2015-2020 Martin Weber.
*
* Content is provided to you under the terms and conditions of the Eclipse Public License Version 2.0 "EPL".
* A copy of the EPL is available at http://www.eclipse.org/legal/epl-2.0.
@@ -10,10 +10,8 @@ package org.eclipse.cdt.cmake.is.core.internal;
import static org.junit.Assert.assertEquals;
-import org.eclipse.cdt.cmake.is.core.Arglets.IncludePath_C_POSIX;
-import org.eclipse.cdt.cmake.is.core.IArglet.IParseContext;
-import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
-import org.eclipse.cdt.core.settings.model.ICSettingEntry;
+import org.eclipse.cdt.cmake.is.core.participant.Arglets.IncludePath_C_POSIX;
+import org.eclipse.cdt.cmake.is.core.participant.IArglet.IArgumentCollector;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.junit.Before;
@@ -36,178 +34,141 @@ public class IncludePath_C_POSIXTest {
/**
* Test method for
- * {@link IncludePath_C_POSIX#processArgument(IParseContext, IPath, java.lang.String)}
+ * {@link IncludePath_C_POSIX#processArgument(IArgumentCollector, IPath, java.lang.String)}
* .
*/
@Test
public final void testProcessArgument() {
final String more = " -g -MMD -MT CMakeFiles/execut1.dir/util1.c.o -MF \"CMakeFiles/execut1.dir/util1.c.o.d\""
+ " -o CMakeFiles/execut1.dir/util1.c.o -c /testprojects/C-subsrc/src/src-sub/main1.c";
- ParseContext entries;
- ICLanguageSettingEntry parsed;
+ ParseContext result;
String name = "/an/Include/Path";
IPath cwd = new Path("");
// -I/an/Include/Path
- entries = new ParseContext();
- assertEquals(2 + name.length(), testee.processArgument(entries, cwd, "-I" + name + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ result = new ParseContext();
+ assertEquals(2 + name.length(), testee.processArgument(result, cwd, "-I" + name + more));
+ assertEquals("#entries", 1, result.getIncludePaths().size());
+ assertEquals("name", name, result.getIncludePaths().get(0));
// -I'/an/Include/Path'
- entries = new ParseContext();
- assertEquals(2 + name.length() + 2, testee.processArgument(entries, cwd, "-I" + "'" + name + "'" + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ result = new ParseContext();
+ assertEquals(2 + name.length() + 2, testee.processArgument(result, cwd, "-I" + "'" + name + "'" + more));
+ assertEquals("#entries", 1, result.getIncludePaths().size());
+ assertEquals("name", name, result.getIncludePaths().get(0));
// -I"/an/Include/Path"
- entries = new ParseContext();
- assertEquals(2 + name.length() + 2, testee.processArgument(entries, cwd, "-I" + "\"" + name + "\"" + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ result = new ParseContext();
+ assertEquals(2 + name.length() + 2, testee.processArgument(result, cwd, "-I" + "\"" + name + "\"" + more));
+ assertEquals("#entries", 1, result.getIncludePaths().size());
+ assertEquals("name", name, result.getIncludePaths().get(0));
// -I /an/Include/Path
- entries = new ParseContext();
- assertEquals(2 + name.length() + 3, testee.processArgument(entries, cwd, "-I " + name + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ result = new ParseContext();
+ assertEquals(2 + name.length() + 3, testee.processArgument(result, cwd, "-I " + name + more));
+ assertEquals("#entries", 1, result.getIncludePaths().size());
+ assertEquals("name", name, result.getIncludePaths().get(0));
// -I '/an/Include/Path'
- entries = new ParseContext();
- assertEquals(2 + name.length() + 3 + 2,
- testee.processArgument(entries, cwd, "-I " + "'" + name + "'" + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ result = new ParseContext();
+ assertEquals(2 + name.length() + 3 + 2, testee.processArgument(result, cwd, "-I " + "'" + name + "'" + more));
+ assertEquals("#entries", 1, result.getIncludePaths().size());
+ assertEquals("name", name, result.getIncludePaths().get(0));
// -I "/an/Include/Path"
- entries = new ParseContext();
+ result = new ParseContext();
assertEquals(2 + name.length() + 3 + 2,
- testee.processArgument(entries, cwd, "-I " + "\"" + name + "\"" + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ testee.processArgument(result, cwd, "-I " + "\"" + name + "\"" + more));
+ assertEquals("#entries", 1, result.getIncludePaths().size());
+ assertEquals("name", name, result.getIncludePaths().get(0));
name = (new Path("A:an\\Include/Path")).toOSString();
// -IA:an\Include/Path
- entries = new ParseContext();
- assertEquals(2 + name.length(), testee.processArgument(entries, cwd, "-I" + name + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ result = new ParseContext();
+ assertEquals(2 + name.length(), testee.processArgument(result, cwd, "-I" + name + more));
+ assertEquals("#entries", 1, result.getIncludePaths().size());
+ assertEquals("name", name, result.getIncludePaths().get(0));
}
/**
* Test method for
- * {@link IncludePath_C_POSIX#processArgument(IParseContext, IPath, java.lang.String)}
+ * {@link IncludePath_C_POSIX#processArgument(IArgumentCollector, IPath, java.lang.String)}
*/
@Test
public final void testProcessArgument_WS() {
final String more = " -g -MMD -MT CMakeFiles/execut1.dir/util1.c.o -MF \"CMakeFiles/execut1.dir/util1.c.o.d\""
+ " -o CMakeFiles/execut1.dir/util1.c.o -c /testprojects/C-subsrc/src/src-sub/main1.c";
- ParseContext entries = new ParseContext();
- ICLanguageSettingEntry parsed;
+ ParseContext result = new ParseContext();
String name = "/ye olde/In clu de/Pa the";
IPath cwd = new Path("");
// -I'/ye olde/In clu de/Pa the'
- entries = new ParseContext();
- assertEquals(2 + name.length() + 2, testee.processArgument(entries, cwd, "-I" + "'" + name + "'" + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ result = new ParseContext();
+ assertEquals(2 + name.length() + 2, testee.processArgument(result, cwd, "-I" + "'" + name + "'" + more));
+ assertEquals("#entries", 1, result.getIncludePaths().size());
+ assertEquals("name", name, result.getIncludePaths().get(0));
// -I"/ye olde/In clu de/Pa the"
- entries = new ParseContext();
- assertEquals(2 + name.length() + 2, testee.processArgument(entries, cwd, "-I" + "\"" + name + "\"" + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ result = new ParseContext();
+ assertEquals(2 + name.length() + 2, testee.processArgument(result, cwd, "-I" + "\"" + name + "\"" + more));
+ assertEquals("#entries", 1, result.getIncludePaths().size());
+ assertEquals("name", name, result.getIncludePaths().get(0));
// -I '/ye olde/In clu de/Pa the'
- entries = new ParseContext();
- assertEquals(2 + name.length() + 3 + 2,
- testee.processArgument(entries, cwd, "-I " + "'" + name + "'" + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ result = new ParseContext();
+ assertEquals(2 + name.length() + 3 + 2, testee.processArgument(result, cwd, "-I " + "'" + name + "'" + more));
+ assertEquals("#entries", 1, result.getIncludePaths().size());
+ assertEquals("name", name, result.getIncludePaths().get(0));
// -I "/ye olde/In clu de/Pa the"
- entries = new ParseContext();
+ result = new ParseContext();
assertEquals(2 + name.length() + 3 + 2,
- testee.processArgument(entries, cwd, "-I " + "\"" + name + "\"" + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ testee.processArgument(result, cwd, "-I " + "\"" + name + "\"" + more));
+ assertEquals("#entries", 1, result.getIncludePaths().size());
+ assertEquals("name", name, result.getIncludePaths().get(0));
name = (new Path("A:an\\In CLU de/Pat h")).toOSString();
// -I'A:an\In CLU de/Pat h'
- entries = new ParseContext();
- assertEquals(2 + name.length() + 2, testee.processArgument(entries, cwd, "-I" + "\"" + name + "\"" + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ result = new ParseContext();
+ assertEquals(2 + name.length() + 2, testee.processArgument(result, cwd, "-I" + "\"" + name + "\"" + more));
+ assertEquals("#entries", 1, result.getIncludePaths().size());
+ assertEquals("name", name, result.getIncludePaths().get(0));
}
/**
* Test method for
- * {@link IncludePath_C_POSIX#processArgument(IParseContext, IPath, java.lang.String)}
+ * {@link IncludePath_C_POSIX#processArgument(IArgumentCollector, IPath, java.lang.String)}
* .
*/
@Test
public final void testProcessArgument_RelativePath() {
final String more = " -g -MMD -MT CMakeFiles/execut1.dir/util1.c.o -MF \"CMakeFiles/execut1.dir/util1.c.o.d\""
+ " -o CMakeFiles/execut1.dir/util1.c.o -c /testprojects/C-subsrc/src/src-sub/main1.c";
- ICLanguageSettingEntry parsed;
String name = (new Path("a/relative/Include/Path")).toOSString();
IPath cwd = new Path("/compiler/working/dir");
- ParseContext entries = new ParseContext();
- assertEquals(2 + name.length(), testee.processArgument(entries, cwd, "-I" + name + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
+ ParseContext result = new ParseContext();
+ assertEquals(2 + name.length(), testee.processArgument(result, cwd, "-I" + name + more));
+ assertEquals("#entries", 1, result.getIncludePaths().size());
String absPath = cwd.append(name).toString();
- assertEquals("name", absPath, parsed.getName());
+ assertEquals("name", absPath, result.getIncludePaths().get(0));
name = (new Path("a\\relative\\Include\\Path")).toOSString();
cwd = new Path("\\compiler\\working\\dir");
- entries = new ParseContext();
- assertEquals(2 + name.length(), testee.processArgument(entries, cwd, "-I" + name + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
+ result = new ParseContext();
+ assertEquals(2 + name.length(), testee.processArgument(result, cwd, "-I" + name + more));
+ assertEquals("#entries", 1, result.getIncludePaths().size());
absPath = cwd.append(name).toString();
- assertEquals("name", absPath, parsed.getName());
+ assertEquals("name", absPath, result.getIncludePaths().get(0));
name = (new Path("../../src/Include/Path")).toOSString();
cwd = new Path("/compiler/working/dir");
- entries = new ParseContext();
- assertEquals(2 + name.length(), testee.processArgument(entries, cwd, "-I" + name + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
+ result = new ParseContext();
+ assertEquals(2 + name.length(), testee.processArgument(result, cwd, "-I" + name + more));
+ assertEquals("#entries", 1, result.getIncludePaths().size());
absPath = cwd.append(name).toString();
- assertEquals("name", absPath, parsed.getName());
+ assertEquals("name", absPath, result.getIncludePaths().get(0));
name = (new Path("..\\..\\src\\Include\\Path")).toOSString();
cwd = new Path("\\compiler\\working\\dir");
- entries = new ParseContext();
- assertEquals(2 + name.length(), testee.processArgument(entries, cwd, "-I" + name + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
+ result = new ParseContext();
+ assertEquals(2 + name.length(), testee.processArgument(result, cwd, "-I" + name + more));
+ assertEquals("#entries", 1, result.getIncludePaths().size());
absPath = cwd.append(name).toString();
- assertEquals("name", absPath, parsed.getName());
+ assertEquals("name", absPath, result.getIncludePaths().get(0));
}
}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/MacroDefine_C_POSIXTest.java b/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/MacroDefine_C_POSIXTest.java
index 31e21b58785..eed321c1f1e 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/MacroDefine_C_POSIXTest.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/MacroDefine_C_POSIXTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015 Martin Weber.
+ * Copyright (c) 2015-2020 Martin Weber.
*
* Content is provided to you under the terms and conditions of the Eclipse Public License Version 2.0 "EPL".
* A copy of the EPL is available at http://www.eclipse.org/legal/epl-2.0.
@@ -9,11 +9,12 @@
package org.eclipse.cdt.cmake.is.core.internal;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
-import org.eclipse.cdt.cmake.is.core.Arglets;
-import org.eclipse.cdt.cmake.is.core.Arglets.MacroDefine_C_POSIX;
-import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
-import org.eclipse.cdt.core.settings.model.ICSettingEntry;
+import java.util.Map;
+
+import org.eclipse.cdt.cmake.is.core.participant.Arglets;
+import org.eclipse.cdt.cmake.is.core.participant.Arglets.MacroDefine_C_POSIX;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.junit.Before;
@@ -41,8 +42,7 @@ public class MacroDefine_C_POSIXTest {
public final void testProcessArgument() {
final String more = " -g -MMD -MT CMakeFiles/execut1.dir/util1.c.o -MF \"CMakeFiles/execut1.dir/util1.c.o.d\""
+ " -o CMakeFiles/execut1.dir/util1.c.o -c /testprojects/C-subsrc/src/src-sub/main1.c";
- ParseContext entries;
- ICLanguageSettingEntry parsed;
+ ParseContext result;
final IPath cwd = new Path("");
int len;
@@ -50,23 +50,17 @@ public class MacroDefine_C_POSIXTest {
String name = "FOO";
String arg = "-D" + name;
- entries = new ParseContext();
- len = testee.processArgument(entries, cwd, arg + " " + arg + more);
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", name, parsed.getName());
- assertEquals("value", "", parsed.getValue());
+ result = new ParseContext();
+ len = testee.processArgument(result, cwd, arg + " " + arg + more);
+ assertTrue("found", result.getDefines().containsKey(name));
+ assertEquals("value", "", result.getDefines().get(name));
assertEquals(2 + name.length(), len);
// -D FOO
- entries = new ParseContext();
+ result = new ParseContext();
arg = "-D " + name;
- len = testee.processArgument(entries, cwd, arg + " " + arg + more);
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", name, parsed.getName());
- assertEquals("value", "", parsed.getValue());
+ len = testee.processArgument(result, cwd, arg + " " + arg + more);
+ assertTrue("found", result.getDefines().containsKey(name));
+ assertEquals("value", "", result.getDefines().get(name));
assertEquals(2 + name.length() + 3, len);
}
@@ -77,52 +71,39 @@ public class MacroDefine_C_POSIXTest {
public final void testProcessArgument_Value() {
final String more = " -g -MMD -MT CMakeFiles/execut1.dir/util1.c.o -MF \"CMakeFiles/execut1.dir/util1.c.o.d\""
+ " -o CMakeFiles/execut1.dir/util1.c.o -c /testprojects/C-subsrc/src/src-sub/main1.c";
- ParseContext entries;
- ICLanguageSettingEntry parsed;
+ ParseContext result;
final IPath cwd = new Path("");
final String name = "FOO";
String val = "noWhiteSpace";
// -DFOO=noWhiteSpace
- entries = new ParseContext();
+ result = new ParseContext();
assertEquals(2 + name.length() + 1 + val.length(),
- testee.processArgument(entries, cwd, "-D" + name + "=" + val + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", name, parsed.getName());
- assertEquals("value", val, parsed.getValue());
+ testee.processArgument(result, cwd, "-D" + name + "=" + val + more));
+ assertTrue("found", result.getDefines().containsKey(name));
+ assertEquals("value", val, result.getDefines().get(name));
// -D FOO=noWhiteSpace
- entries = new ParseContext();
+ result = new ParseContext();
assertEquals(2 + name.length() + 1 + 3 + val.length(),
- testee.processArgument(entries, cwd, "-D " + name + "=" + val + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", name, parsed.getName());
- assertEquals("value", val, parsed.getValue());
+ testee.processArgument(result, cwd, "-D " + name + "=" + val + more));
+ assertTrue("found", result.getDefines().containsKey(name));
+ assertEquals("value", val, result.getDefines().get(name));
// ----------------------------------------
val = "Wh it e s ap ac ";
// -D 'FOO=Wh it e s ap ac '
- entries = new ParseContext();
+ result = new ParseContext();
assertEquals(2 + name.length() + 1 + 2 + 3 + val.length(),
- testee.processArgument(entries, cwd, "-D " + "'" + name + "=" + val + "'" + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", name, parsed.getName());
- assertEquals("value", val, parsed.getValue());
+ testee.processArgument(result, cwd, "-D " + "'" + name + "=" + val + "'" + more));
+ assertTrue("found", result.getDefines().containsKey(name));
+ assertEquals("value", val, result.getDefines().get(name));
// -D "FOO=Wh it e s ap ac "
- entries = new ParseContext();
+ result = new ParseContext();
assertEquals(2 + name.length() + 1 + 2 + 3 + val.length(),
- testee.processArgument(entries, cwd, "-D " + "\"" + name + "=" + val + "\"" + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", name, parsed.getName());
- assertEquals("value", val, parsed.getValue());
+ testee.processArgument(result, cwd, "-D " + "\"" + name + "=" + val + "\"" + more));
+ assertTrue("found", result.getDefines().containsKey(name));
+ assertEquals("value", val, result.getDefines().get(name));
}
/**
@@ -132,8 +113,7 @@ public class MacroDefine_C_POSIXTest {
public final void testProcessArgument_Value_CharLiteral() {
final String more = " -g -MMD -MT CMakeFiles/execut1.dir/util1.c.o -MF \"CMakeFiles/execut1.dir/util1.c.o.d\""
+ " -o CMakeFiles/execut1.dir/util1.c.o -c /testprojects/C-subsrc/src/src-sub/main1.c";
- ParseContext entries;
- ICLanguageSettingEntry parsed;
+ ParseContext result;
final IPath cwd = new Path("");
int len;
String val, arg;
@@ -144,90 +124,66 @@ public class MacroDefine_C_POSIXTest {
// -DFOO='noWhiteSpace'
val = "'noWhiteSpace'";
arg = "-D" + name + "=" + val;
- entries = new ParseContext();
- len = testee.processArgument(entries, cwd, arg + " " + arg + more);
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", name, parsed.getName());
- assertEquals("value", val, parsed.getValue());
+ result = new ParseContext();
+ len = testee.processArgument(result, cwd, arg + " " + arg + more);
+ assertTrue("found", result.getDefines().containsKey(name));
+ assertEquals("value", val, result.getDefines().get(name));
assertEquals(arg.length(), len);
// -D FOO='noWhiteSpace'
arg = "-D " + name + "=" + val;
- entries = new ParseContext();
- len = testee.processArgument(entries, cwd, arg + " " + arg + more);
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", name, parsed.getName());
- assertEquals("value", val, parsed.getValue());
+ result = new ParseContext();
+ len = testee.processArgument(result, cwd, arg + " " + arg + more);
+ assertTrue("found", result.getDefines().containsKey(name));
+ assertEquals("value", val, result.getDefines().get(name));
assertEquals(arg.length(), len);
// ----------------------------------------
// -DFOO='noWhite\'escapedQuoteChar' (values with single quotes)
val = "'noWhite\\'escapedQuoteChar'";
arg = "-D" + name + "=" + val;
- entries = new ParseContext();
- len = testee.processArgument(entries, cwd, arg + " " + arg + more);
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", name, parsed.getName());
- assertEquals("value", val, parsed.getValue());
+ result = new ParseContext();
+ len = testee.processArgument(result, cwd, arg + " " + arg + more);
+ assertTrue("found", result.getDefines().containsKey(name));
+ assertEquals("value", val, result.getDefines().get(name));
assertEquals(arg.length(), len);
// -DFOO='noWhite\\escapedEscapeChar'
val = "'noWhite\\\\escapedEscapeChar'";
arg = "-D" + name + "=" + val;
- entries = new ParseContext();
- len = testee.processArgument(entries, cwd, arg + " " + arg + more);
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", name, parsed.getName());
- assertEquals("value", val, parsed.getValue());
+ result = new ParseContext();
+ len = testee.processArgument(result, cwd, arg + " " + arg + more);
+ assertTrue("found", result.getDefines().containsKey(name));
+ assertEquals("value", val, result.getDefines().get(name));
assertEquals(arg.length(), len);
// ----------------------------------------
// -DFOO='Wh it e s ap ac '
val = "'Wh it e s ap ac '";
arg = "-D" + name + "=" + val;
- entries = new ParseContext();
- len = testee.processArgument(entries, cwd, arg + " " + arg + more);
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", name, parsed.getName());
- assertEquals("value", val, parsed.getValue());
+ result = new ParseContext();
+ len = testee.processArgument(result, cwd, arg + " " + arg + more);
+ assertTrue("found", result.getDefines().containsKey(name));
+ assertEquals("value", val, result.getDefines().get(name));
assertEquals(arg.length(), len);
// -D FOO='Wh it e s ap ac '
arg = "-D " + name + "=" + val;
- entries = new ParseContext();
- len = testee.processArgument(entries, cwd, arg + " " + arg + more);
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", name, parsed.getName());
- assertEquals("value", val, parsed.getValue());
+ result = new ParseContext();
+ len = testee.processArgument(result, cwd, arg + " " + arg + more);
+ assertTrue("found", result.getDefines().containsKey(name));
+ assertEquals("value", val, result.getDefines().get(name));
assertEquals(arg.length(), len);
// -DFOO='Wh it e s ap ac \'escaped Quote Char' (values with single quotes)
val = "'Wh it e s ap ac \\'escaped Quote Char'";
arg = "-D" + name + "=" + val;
- entries = new ParseContext();
- len = testee.processArgument(entries, cwd, arg + " " + arg + more);
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", name, parsed.getName());
- assertEquals("value", val, parsed.getValue());
+ result = new ParseContext();
+ len = testee.processArgument(result, cwd, arg + " " + arg + more);
+ assertTrue("found", result.getDefines().containsKey(name));
+ assertEquals("value", val, result.getDefines().get(name));
assertEquals(arg.length(), len);
// -DFOO='Wh it e s ap ac \\escaped Escape Char'
val = "'Wh it e s ap ac \\\\escaped Escape Char'";
arg = "-D" + name + "=" + val;
- entries = new ParseContext();
- len = testee.processArgument(entries, cwd, arg + " " + arg + more);
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", name, parsed.getName());
- assertEquals("value", val, parsed.getValue());
+ result = new ParseContext();
+ len = testee.processArgument(result, cwd, arg + " " + arg + more);
+ assertTrue("found", result.getDefines().containsKey(name));
+ assertEquals("value", val, result.getDefines().get(name));
assertEquals(arg.length(), len);
}
@@ -238,8 +194,7 @@ public class MacroDefine_C_POSIXTest {
public final void testProcessArgument_Value_StringLiteral() {
final String more = " -g -MMD -MT CMakeFiles/execut1.dir/util1.c.o -MF \"CMakeFiles/execut1.dir/util1.c.o.d\""
+ " -o CMakeFiles/execut1.dir/util1.c.o -c /testprojects/C-subsrc/src/src-sub/main1.c";
- ParseContext entries;
- ICLanguageSettingEntry parsed;
+ ParseContext result;
final IPath cwd = new Path("");
int len;
String val, arg;
@@ -249,90 +204,66 @@ public class MacroDefine_C_POSIXTest {
// -DFOO="noWhiteSpace"
val = "\"noWhiteSpace\"";
arg = "-D" + name + "=" + val;
- entries = new ParseContext();
- len = testee.processArgument(entries, cwd, arg + " " + arg + more);
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", name, parsed.getName());
- assertEquals("value", val, parsed.getValue());
+ result = new ParseContext();
+ len = testee.processArgument(result, cwd, arg + " " + arg + more);
+ assertTrue("found", result.getDefines().containsKey(name));
+ assertEquals("value", val, result.getDefines().get(name));
assertEquals(arg.length(), len);
// -D FOO="noWhiteSpace"
arg = "-D " + name + "=" + val;
- entries = new ParseContext();
- len = testee.processArgument(entries, cwd, arg + " " + arg + more);
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", name, parsed.getName());
- assertEquals("value", val, parsed.getValue());
+ result = new ParseContext();
+ len = testee.processArgument(result, cwd, arg + " " + arg + more);
+ assertTrue("found", result.getDefines().containsKey(name));
+ assertEquals("value", val, result.getDefines().get(name));
assertEquals(arg.length(), len);
// ----------------------------------------
// -DFOO="noWhite\"escapedQuoteChar" (values with single quotes)
val = "\"noWhite\\\"escapedQuoteChar\"";
arg = "-D" + name + "=" + val;
- entries = new ParseContext();
- len = testee.processArgument(entries, cwd, arg + " " + arg + more);
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", name, parsed.getName());
- assertEquals("value", val, parsed.getValue());
+ result = new ParseContext();
+ len = testee.processArgument(result, cwd, arg + " " + arg + more);
+ assertTrue("found", result.getDefines().containsKey(name));
+ assertEquals("value", val, result.getDefines().get(name));
assertEquals(arg.length(), len);
// -DFOO="noWhite\\escapedEscapeChar"
val = "\"noWhite\\\\escapedEscapeChar\"";
arg = "-D" + name + "=" + val;
- entries = new ParseContext();
- len = testee.processArgument(entries, cwd, arg + " " + arg + more);
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", name, parsed.getName());
- assertEquals("value", val, parsed.getValue());
+ result = new ParseContext();
+ len = testee.processArgument(result, cwd, arg + " " + arg + more);
+ assertTrue("found", result.getDefines().containsKey(name));
+ assertEquals("value", val, result.getDefines().get(name));
assertEquals(arg.length(), len);
// ----------------------------------------
// -DFOO="Wh it e s ap ac "
val = "\"Wh it e s ap ac \"";
arg = "-D" + name + "=" + val;
- entries = new ParseContext();
- len = testee.processArgument(entries, cwd, arg + " " + arg + more);
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", name, parsed.getName());
- assertEquals("value", val, parsed.getValue());
+ result = new ParseContext();
+ len = testee.processArgument(result, cwd, arg + " " + arg + more);
+ assertTrue("found", result.getDefines().containsKey(name));
+ assertEquals("value", val, result.getDefines().get(name));
assertEquals(arg.length(), len);
// -D FOO="Wh it e s ap ac "
arg = "-D " + name + "=" + val;
- entries = new ParseContext();
- len = testee.processArgument(entries, cwd, arg + " " + arg + more);
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", name, parsed.getName());
- assertEquals("value", val, parsed.getValue());
+ result = new ParseContext();
+ len = testee.processArgument(result, cwd, arg + " " + arg + more);
+ assertTrue("found", result.getDefines().containsKey(name));
+ assertEquals("value", val, result.getDefines().get(name));
assertEquals(arg.length(), len);
// -DFOO="Wh it e s ap ac \"escaped Quote Char" (values with single quotes)
val = "\"Wh it e s ap ac \\\"escaped Quote Char\"";
arg = "-D" + name + "=" + val;
- entries = new ParseContext();
- len = testee.processArgument(entries, cwd, arg + " " + arg + more);
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", name, parsed.getName());
- assertEquals("value", val, parsed.getValue());
+ result = new ParseContext();
+ len = testee.processArgument(result, cwd, arg + " " + arg + more);
+ assertTrue("found", result.getDefines().containsKey(name));
+ assertEquals("value", val, result.getDefines().get(name));
assertEquals(arg.length(), len);
// -DFOO="Wh it e s ap ac \\escaped Escape Char"
val = "\"Wh it e s ap ac \\\\escaped Escape Char\"";
arg = "-D" + name + "=" + val;
- entries = new ParseContext();
- len = testee.processArgument(entries, cwd, arg + " " + arg + more);
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", name, parsed.getName());
- assertEquals("value", val, parsed.getValue());
+ result = new ParseContext();
+ len = testee.processArgument(result, cwd, arg + " " + arg + more);
+ assertTrue("found", result.getDefines().containsKey(name));
+ assertEquals("value", val, result.getDefines().get(name));
assertEquals(arg.length(), len);
// ----------------------------------------
@@ -340,14 +271,11 @@ public class MacroDefine_C_POSIXTest {
// -DFOO="2(vtkIOMySQL,vtkIOPostgreSQL)"
val = "\"2(vtkIOMySQL,vtkIOPostgreSQL)\"";
arg = "-D" + name + "=" + val;
- entries = new ParseContext();
- len = testee.processArgument(entries, cwd, arg + " " + arg + more);
+ result = new ParseContext();
+ len = testee.processArgument(result, cwd, arg + " " + arg + more);
assertEquals(arg.length(), len);
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", name, parsed.getName());
- assertEquals("value", val, parsed.getValue());
+ assertTrue("found", result.getDefines().containsKey(name));
+ assertEquals("value", val, result.getDefines().get(name));
}
/**
@@ -357,8 +285,7 @@ public class MacroDefine_C_POSIXTest {
public final void testProcessArgument_MacroWithArgs() {
final String more = " -g -MMD -MT CMakeFiles/execut1.dir/util1.c.o -MF \"CMakeFiles/execut1.dir/util1.c.o.d\""
+ " -o CMakeFiles/execut1.dir/util1.c.o -c /testprojects/C-subsrc/src/src-sub/main1.c";
- ParseContext entries;
- ICLanguageSettingEntry parsed;
+ ParseContext result;
final IPath cwd = new Path("");
// -DFOO=noWhiteSpace
@@ -367,22 +294,18 @@ public class MacroDefine_C_POSIXTest {
String val = "(a)/((b)+(c))";
// -DFOO(a,b,c)=(a)/((b)+(c))
- entries = new ParseContext();
+ result = new ParseContext();
assertEquals(2 + name.length() + args.length() + 1 + val.length(),
- testee.processArgument(entries, cwd, "-D" + name + args + "=" + val + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", name, parsed.getName());
- assertEquals("value", val, parsed.getValue());
+ testee.processArgument(result, cwd, "-D" + name + args + "=" + val + more));
+ Map<String, String> defines = result.getDefines();
+ assertEquals("#entries", 1, defines.size());
+ assertEquals("value", val, result.getDefines().get(name));
// -D FOO(a,b,c)=(a)/((b)+(c))
- entries = new ParseContext();
+ result = new ParseContext();
assertEquals(2 + name.length() + args.length() + 1 + 3 + val.length(),
- testee.processArgument(entries, cwd, "-D " + name + args + "=" + val + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", name, parsed.getName());
- assertEquals("value", val, parsed.getValue());
+ testee.processArgument(result, cwd, "-D " + name + args + "=" + val + more));
+ defines = result.getDefines();
+ assertEquals("#entries", 1, defines.size());
+ assertEquals("value", val, result.getDefines().get(name));
}
}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/MacroUndefine_C_POSIXTest.java b/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/MacroUndefine_C_POSIXTest.java
index f3daa195980..b91a2b53a9e 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/MacroUndefine_C_POSIXTest.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/MacroUndefine_C_POSIXTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015 Martin Weber.
+ * Copyright (c) 2015-2020 Martin Weber.
*
* Content is provided to you under the terms and conditions of the Eclipse Public License Version 2.0 "EPL".
* A copy of the EPL is available at http://www.eclipse.org/legal/epl-2.0.
@@ -10,10 +10,8 @@ package org.eclipse.cdt.cmake.is.core.internal;
import static org.junit.Assert.assertEquals;
-import org.eclipse.cdt.cmake.is.core.Arglets.MacroUndefine_C_POSIX;
-import org.eclipse.cdt.cmake.is.core.IArglet.IParseContext;
-import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
-import org.eclipse.cdt.core.settings.model.ICSettingEntry;
+import org.eclipse.cdt.cmake.is.core.participant.Arglets.MacroUndefine_C_POSIX;
+import org.eclipse.cdt.cmake.is.core.participant.IArglet.IArgumentCollector;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.junit.Before;
@@ -36,35 +34,26 @@ public class MacroUndefine_C_POSIXTest {
/**
* Test method for
- * {@link MacroUndefine_C_POSIX#processArgument(IParseContext, IPath, java.lang.String)}
+ * {@link MacroUndefine_C_POSIX#processArgument(IArgumentCollector, IPath, java.lang.String)}
* .
*/
@Test
public final void testProcessArgument() {
final String more = " -g -MMD -MT CMakeFiles/execut1.dir/util1.c.o -MF \"CMakeFiles/execut1.dir/util1.c.o.d\""
+ " -o CMakeFiles/execut1.dir/util1.c.o -c /testprojects/C-subsrc/src/src-sub/main1.c";
- ParseContext entries;
- ICLanguageSettingEntry parsed;
+ ParseContext result;
final IPath cwd = new Path("");
String name = "FOO";
// -UFOO
- entries = new ParseContext();
- assertEquals(2 + name.length(), testee.processArgument(entries, cwd, "-U" + name + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("kind", ICSettingEntry.UNDEFINED, (parsed.getFlags() & ICSettingEntry.UNDEFINED));
- assertEquals("name", name, parsed.getName());
- assertEquals("value", "", parsed.getValue());
+ result = new ParseContext();
+ assertEquals(2 + name.length(), testee.processArgument(result, cwd, "-U" + name + more));
+ assertEquals("#entries", 1, result.getUndefines().size());
+ assertEquals("name", name, result.getUndefines().get(0));
// -U FOO
- entries = new ParseContext();
- assertEquals(2 + 2 + name.length(), testee.processArgument(entries, cwd, "-U " + name + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("kind", ICSettingEntry.UNDEFINED, (parsed.getFlags() & ICSettingEntry.UNDEFINED));
- assertEquals("name", name, parsed.getName());
- assertEquals("value", "", parsed.getValue());
+ result = new ParseContext();
+ assertEquals(2 + 2 + name.length(), testee.processArgument(result, cwd, "-U " + name + more));
+ assertEquals("#entries", 1, result.getUndefines().size());
+ assertEquals("name", name, result.getUndefines().get(0));
}
}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserDetectionTest.java b/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserDetectionTest.java
index 95c213f6856..fe7a3ce9282 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserDetectionTest.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserDetectionTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2016-2018 Martin Weber.
+ * Copyright (c) 2016-2020 Martin Weber.
*
* Content is provided to you under the terms and conditions of the Eclipse Public License Version 2.0 "EPL".
* A copy of the EPL is available at http://www.eclipse.org/legal/epl-2.0.
@@ -31,9 +31,6 @@ public class ParserDetectionTest {
ParserDetection.ParserDetectionResult result = ParserDetection.determineDetector("/usr/bin/clang -C blah.c",
null, true);
assertNotNull(result);
- // verify that we got a C parser
- assertEquals("C", "org.eclipse.cdt.core.gcc",
- result.getDetectorWithMethod().getToolDetectionParticipant().getParser().getLanguageId("c"));
}
@Test
@@ -41,9 +38,6 @@ public class ParserDetectionTest {
ParserDetection.ParserDetectionResult result = ParserDetection.determineDetector("/usr/bin/clang++ -C blah.c",
null, true);
assertNotNull(result);
- // verify that we got a C++ parser
- assertEquals("C++", "org.eclipse.cdt.core.g++",
- result.getDetectorWithMethod().getToolDetectionParticipant().getParser().getLanguageId("c"));
}
@Test
@@ -51,9 +45,6 @@ public class ParserDetectionTest {
ParserDetection.ParserDetectionResult result = ParserDetection.determineDetector("clang++ -C blah.c", null,
false);
assertNotNull(result);
- // verify that we got a C++ parser
- assertEquals("C++", "org.eclipse.cdt.core.g++",
- result.getDetectorWithMethod().getToolDetectionParticipant().getParser().getLanguageId("c"));
}
/**
@@ -66,15 +57,9 @@ public class ParserDetectionTest {
ParserDetection.ParserDetectionResult result = ParserDetection
.determineDetector("/usr/bin/arm-none-eabi-gcc -C blah.c", null, true);
assertNotNull(result);
- // verify that we got a C parser
- assertEquals("C", "org.eclipse.cdt.core.gcc",
- result.getDetectorWithMethod().getToolDetectionParticipant().getParser().getLanguageId("c"));
result = ParserDetection.determineDetector("/usr/bin/arm-none-eabi-gcc.exe -C blah.c", null, true);
assertNotNull(result);
- // verify that we got a C parser
- assertEquals("C", "org.eclipse.cdt.core.gcc",
- result.getDetectorWithMethod().getToolDetectionParticipant().getParser().getLanguageId("c"));
}
@Test
@@ -84,16 +69,10 @@ public class ParserDetectionTest {
ParserDetection.ParserDetectionResult result = ParserDetection
.determineDetector("/usr/bin/arm-none-eabi-gcc-9.2.0 -C blah.c", versionSuffixRegex, true);
assertNotNull(result);
- // verify that we got a C parser
- assertEquals("C", "org.eclipse.cdt.core.gcc",
- result.getDetectorWithMethod().getToolDetectionParticipant().getParser().getLanguageId("c"));
result = ParserDetection.determineDetector("/usr/bin/arm-none-eabi-gcc-9.2.0.exe -C blah.c", versionSuffixRegex,
true);
assertNotNull(result);
- // verify that we got a C parser
- assertEquals("C", "org.eclipse.cdt.core.gcc",
- result.getDetectorWithMethod().getToolDetectionParticipant().getParser().getLanguageId("c"));
}
/**
@@ -104,15 +83,9 @@ public class ParserDetectionTest {
ParserDetection.ParserDetectionResult result = ParserDetection
.determineDetector("/usr/bin/arm-none-eabi-g++ -C blah.c", null, true);
assertNotNull(result);
- // verify that we got a C++ parser
- assertEquals("C++", "org.eclipse.cdt.core.g++",
- result.getDetectorWithMethod().getToolDetectionParticipant().getParser().getLanguageId("c"));
result = ParserDetection.determineDetector("/usr/bin/arm-none-eabi-g++.exe -C blah.c", null, true);
assertNotNull(result);
- // verify that we got a C++ parser
- assertEquals("C++", "org.eclipse.cdt.core.g++",
- result.getDetectorWithMethod().getToolDetectionParticipant().getParser().getLanguageId("c"));
}
/**
@@ -125,16 +98,10 @@ public class ParserDetectionTest {
ParserDetection.ParserDetectionResult result = ParserDetection
.determineDetector("/usr/bin/arm-none-eabi-g++-9.2.0 -C blah.c", versionSuffixRegex, true);
assertNotNull(result);
- // verify that we got a C++ parser
- assertEquals("C++", "org.eclipse.cdt.core.g++",
- result.getDetectorWithMethod().getToolDetectionParticipant().getParser().getLanguageId("c"));
result = ParserDetection.determineDetector("/usr/bin/arm-none-eabi-g++-9.2.0.exe -C blah.c", versionSuffixRegex,
true);
assertNotNull(result);
- // verify that we got a C++ parser
- assertEquals("C++", "org.eclipse.cdt.core.g++",
- result.getDetectorWithMethod().getToolDetectionParticipant().getParser().getLanguageId("c"));
}
/**
@@ -145,15 +112,9 @@ public class ParserDetectionTest {
ParserDetection.ParserDetectionResult result = ParserDetection.determineDetector("arm-none-eabi-g++ -C blah.c",
null, false);
assertNotNull(result);
- // verify that we got a C++ parser
- assertEquals("C++", "org.eclipse.cdt.core.g++",
- result.getDetectorWithMethod().getToolDetectionParticipant().getParser().getLanguageId("c"));
result = ParserDetection.determineDetector("arm-none-eabi-g++.exe -C blah.c", null, false);
assertNotNull(result);
- // verify that we got a C++ parser
- assertEquals("C++", "org.eclipse.cdt.core.g++",
- result.getDetectorWithMethod().getToolDetectionParticipant().getParser().getLanguageId("c"));
}
@Test
@@ -162,9 +123,6 @@ public class ParserDetectionTest {
ParserDetection.ParserDetectionResult result = ParserDetection
.determineDetector("C:\\PROGRA2\\Atmel\\AVR8-G1\\bin\\AVR-G_~1.EXE -C blah.c", null, true);
assertNotNull(result);
- // verify that we got a C parser
- assertEquals("C", "org.eclipse.cdt.core.gcc",
- result.getDetectorWithMethod().getToolDetectionParticipant().getParser().getLanguageId("c"));
}
@Test
@@ -174,48 +132,36 @@ public class ParserDetectionTest {
ParserDetection.ParserDetectionResult result = ParserDetection.determineDetector("/usr/bin/cc-4.1 -C blah.c",
versionSuffixRegex, false);
assertNotNull(result);
- // verify that we got a C parser
- assertEquals("org.eclipse.cdt.core.gcc",
- result.getDetectorWithMethod().getToolDetectionParticipant().getParser().getLanguageId("c"));
result = ParserDetection.determineDetector("/usr/bin/cc-4.1.exe -C blah.c", versionSuffixRegex, true);
assertNotNull(result);
- // verify that we got a C parser
- assertEquals("org.eclipse.cdt.core.gcc",
- result.getDetectorWithMethod().getToolDetectionParticipant().getParser().getLanguageId("c"));
result = ParserDetection.determineDetector("/usr/bin/c++-4.1 -C blah.c", versionSuffixRegex, false);
assertNotNull(result);
- // verify that we got a C++ parser
- assertEquals("org.eclipse.cdt.core.g++",
- result.getDetectorWithMethod().getToolDetectionParticipant().getParser().getLanguageId("c"));
result = ParserDetection.determineDetector("/usr/bin/c++-4.1.exe -C blah.c", versionSuffixRegex, true);
assertNotNull(result);
- // verify that we got a C++ parser
- assertEquals("org.eclipse.cdt.core.g++",
- result.getDetectorWithMethod().getToolDetectionParticipant().getParser().getLanguageId("c"));
// clang for issue #43
result = ParserDetection.determineDetector("/usr/local/bin/clang++40 -C blah.c", versionSuffixRegex, false);
assertNotNull(result);
- assertEquals("org.eclipse.cdt.core.g++",
- result.getDetectorWithMethod().getToolDetectionParticipant().getParser().getLanguageId("c"));
result = ParserDetection.determineDetector("/usr/local/bin/clang++40 -C blah.c", "40", false);
- // result = ParserDetection.determineDetector("/usr/local/bin/clang++40 -I/home/me/workspace/first/test/../utility -I/home/me/workspace/first/test/../include -I/home/me/workspace/first/test -g -std=c++1y -stdlib=libc++ -include-pch /home/me/workspace/first/build/Debug/test/catch.hpp.pch -include-pch /home/me/workspace/first/build/Debug/test/pch.hpp.pch -o CMakeFiles/first_test.test.dir/__/utility/fun.cpp.o -c /home/me/workspace/first/utility/fun.cpp",
- // "40", false);
+ // result = ParserDetection.determineDetector("/usr/local/bin/clang++40
+ // -I/home/me/workspace/first/test/../utility
+ // -I/home/me/workspace/first/test/../include -I/home/me/workspace/first/test -g
+ // -std=c++1y -stdlib=libc++ -include-pch
+ // /home/me/workspace/first/build/Debug/test/catch.hpp.pch -include-pch
+ // /home/me/workspace/first/build/Debug/test/pch.hpp.pch -o
+ // CMakeFiles/first_test.test.dir/__/utility/fun.cpp.o -c
+ // /home/me/workspace/first/utility/fun.cpp",
+ // "40", false);
assertNotNull(result);
- assertEquals("org.eclipse.cdt.core.g++",
- result.getDetectorWithMethod().getToolDetectionParticipant().getParser().getLanguageId("c"));
result = ParserDetection.determineDetector("/apps/tools/cent_os72/binlinks/g++-7.1 "
+ "-I/apps/tools/cent_os72/thirdparty/boost/boost_1_64_0/include "
+ "-I/home/XXX/repositories/bepa/common/include -g -Wall "
+ "-c /home/XXX/repositories/bepa/common/settings/src/settings.cpp", versionSuffixRegex, true);
assertNotNull(result);
- // verify that we got a C++ parser
- assertEquals("org.eclipse.cdt.core.g++",
- result.getDetectorWithMethod().getToolDetectionParticipant().getParser().getLanguageId("cpp"));
}
@Test
diff --git a/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserLookupResultTest.java b/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserLookupResultTest.java
index 286ed54cf4e..ad066eedc90 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserLookupResultTest.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserLookupResultTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2016-2017 Martin Weber.
+ * Copyright (c) 2016-2020 Martin Weber.
*
* Content is provided to you under the terms and conditions of the Eclipse Public License Version 2.0 "EPL".
* A copy of the EPL is available at http://www.eclipse.org/legal/epl-2.0.
@@ -11,17 +11,9 @@ package org.eclipse.cdt.cmake.is.core.internal;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import org.eclipse.cdt.cmake.is.core.language.settings.providers.CompileCommandsJsonParser;
import org.junit.Test;
-/**
- * @author weber
- *
- */
public class ParserLookupResultTest {
-
- CompileCommandsJsonParser testee = new CompileCommandsJsonParser();
-
/**
* Test method for
* {@link org.eclipse.cdt.cmake.is.core.internal.ParserDetection#determineDetector(String, String,boolean)}
@@ -52,9 +44,6 @@ public class ParserLookupResultTest {
String cmd = compiler + " " + args;
ParserDetection.ParserDetectionResult result = ParserDetection.determineDetector(cmd, null, false);
assertNotNull(result);
- // verify that we got a C++ parser
- assertEquals("C++", "org.eclipse.cdt.core.g++",
- result.getDetectorWithMethod().getToolDetectionParticipant().getParser().getLanguageId("cpp"));
assertEquals("reducedCommandLine", args, result.getReducedCommandLine());
// test without leading path
@@ -62,9 +51,6 @@ public class ParserLookupResultTest {
cmd = compiler + " " + args;
result = ParserDetection.determineDetector(cmd, null, false);
assertNotNull(result);
- // verify that we got a C++ parser
- assertEquals("C++", "org.eclipse.cdt.core.g++",
- result.getDetectorWithMethod().getToolDetectionParticipant().getParser().getLanguageId("cpp"));
assertEquals("reducedCommandLine", args, result.getReducedCommandLine());
}
@@ -82,9 +68,6 @@ public class ParserLookupResultTest {
String cmd = compiler + " " + args;
ParserDetection.ParserDetectionResult result = ParserDetection.determineDetector(cmd, null, false);
assertNotNull(result);
- // verify that we got a C++ parser
- assertEquals("C++", "org.eclipse.cdt.core.g++",
- result.getDetectorWithMethod().getToolDetectionParticipant().getParser().getLanguageId("cpp"));
assertEquals("command", compiler, result.getCommandLine().getCommand());
assertEquals("args", args, result.getCommandLine().getArguments());
@@ -93,9 +76,6 @@ public class ParserLookupResultTest {
cmd = compiler + " " + args;
result = ParserDetection.determineDetector(cmd, null, false);
assertNotNull(result);
- // verify that we got a C++ parser
- assertEquals("C++", "org.eclipse.cdt.core.g++",
- result.getDetectorWithMethod().getToolDetectionParticipant().getParser().getLanguageId("cpp"));
assertEquals("command", compiler, result.getCommandLine().getCommand());
assertEquals("args", args, result.getCommandLine().getArguments());
}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/SystemIncludePath_C_Test.java b/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/SystemIncludePath_C_Test.java
index 40337cbfb16..a7bd742b9fb 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/SystemIncludePath_C_Test.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/SystemIncludePath_C_Test.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015-2018 Martin Weber.
+ * Copyright (c) 2015-2020 Martin Weber.
*
* Content is provided to you under the terms and conditions of the Eclipse Public License Version 2.0 "EPL".
* A copy of the EPL is available at http://www.eclipse.org/legal/epl-2.0.
@@ -10,11 +10,9 @@ package org.eclipse.cdt.cmake.is.core.internal;
import static org.junit.Assert.assertEquals;
-import org.eclipse.cdt.cmake.is.core.Arglets.IncludePath_C_POSIX;
-import org.eclipse.cdt.cmake.is.core.Arglets.SystemIncludePath_C;
-import org.eclipse.cdt.cmake.is.core.IArglet.IParseContext;
-import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
-import org.eclipse.cdt.core.settings.model.ICSettingEntry;
+import org.eclipse.cdt.cmake.is.core.participant.Arglets.IncludePath_C_POSIX;
+import org.eclipse.cdt.cmake.is.core.participant.Arglets.SystemIncludePath_C;
+import org.eclipse.cdt.cmake.is.core.participant.IArglet.IArgumentCollector;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.junit.Before;
@@ -39,110 +37,88 @@ public class SystemIncludePath_C_Test {
public final void testProcessArgument() {
final String more = " -g -MMD -MT CMakeFiles/execut1.dir/util1.c.o -MF \"CMakeFiles/execut1.dir/util1.c.o.d\""
+ " -o CMakeFiles/execut1.dir/util1.c.o -c /testprojects/C-subsrc/src/src-sub/main1.c";
- ParseContext entries;
- ICLanguageSettingEntry parsed;
+ ParseContext result;
final IPath cwd = new Path("");
String name = "/an/Include/Path";
// -isystem /an/Include/Path
- entries = new ParseContext();
- assertEquals(8 + name.length() + 3, testee.processArgument(entries, cwd, "-isystem " + name + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ result = new ParseContext();
+ assertEquals(8 + name.length() + 3, testee.processArgument(result, cwd, "-isystem " + name + more));
+ assertEquals("#entries", 1, result.getSystemIncludePaths().size());
+ assertEquals("name", name, result.getSystemIncludePaths().get(0));
// -isystem '/an/Include/Path'
- entries = new ParseContext();
+ result = new ParseContext();
assertEquals(8 + name.length() + 3 + 2,
- testee.processArgument(entries, cwd, "-isystem " + "'" + name + "'" + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ testee.processArgument(result, cwd, "-isystem " + "'" + name + "'" + more));
+ assertEquals("#entries", 1, result.getSystemIncludePaths().size());
+ assertEquals("name", name, result.getSystemIncludePaths().get(0));
// -isystem "/an/Include/Path"
- entries = new ParseContext();
+ result = new ParseContext();
assertEquals(8 + name.length() + 3 + 2,
- testee.processArgument(entries, cwd, "-isystem " + "\"" + name + "\"" + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ testee.processArgument(result, cwd, "-isystem " + "\"" + name + "\"" + more));
+ assertEquals("#entries", 1, result.getSystemIncludePaths().size());
+ assertEquals("name", name, result.getSystemIncludePaths().get(0));
name = (new Path("A:an\\Include/Path")).toOSString();
// -isystem A:an\Include/Path
- entries = new ParseContext();
- assertEquals(8 + 1 + name.length(), testee.processArgument(entries, cwd, "-isystem " + name + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ result = new ParseContext();
+ assertEquals(8 + 1 + name.length(), testee.processArgument(result, cwd, "-isystem " + name + more));
+ assertEquals("#entries", 1, result.getSystemIncludePaths().size());
+ assertEquals("name", name, result.getSystemIncludePaths().get(0));
// -isystemA:an\Include/Path
- entries = new ParseContext();
- assertEquals(8 + name.length(), testee.processArgument(entries, cwd, "-isystem" + name + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ result = new ParseContext();
+ assertEquals(8 + name.length(), testee.processArgument(result, cwd, "-isystem" + name + more));
+ assertEquals("#entries", 1, result.getSystemIncludePaths().size());
+ assertEquals("name", name, result.getSystemIncludePaths().get(0));
}
/**
* Test method for
- * {@link IncludePath_C_POSIX#processArgument(IParseContext, IPath, java.lang.String)}
+ * {@link IncludePath_C_POSIX#processArgument(IArgumentCollector, IPath, java.lang.String)}
*/
@Test
public final void testProcessArgument_WS() {
final String more = " -g -MMD -MT CMakeFiles/execut1.dir/util1.c.o -MF \"CMakeFiles/execut1.dir/util1.c.o.d\""
+ " -o CMakeFiles/execut1.dir/util1.c.o -c /testprojects/C-subsrc/src/src-sub/main1.c";
- ParseContext entries;
- ICLanguageSettingEntry parsed;
+ ParseContext result;
final IPath cwd = new Path("");
String name = "/ye olde/In clu de/Pa the";
// -isystem '/ye olde/In clu de/Pa the'
- entries = new ParseContext();
+ result = new ParseContext();
assertEquals(8 + name.length() + 3 + 2,
- testee.processArgument(entries, cwd, "-isystem " + "'" + name + "'" + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ testee.processArgument(result, cwd, "-isystem " + "'" + name + "'" + more));
+ assertEquals("#entries", 1, result.getSystemIncludePaths().size());
+ assertEquals("name", name, result.getSystemIncludePaths().get(0));
// -isystem "/ye olde/In clu de/Pa the"
- entries = new ParseContext();
+ result = new ParseContext();
assertEquals(8 + name.length() + 3 + 2,
- testee.processArgument(entries, cwd, "-isystem " + "\"" + name + "\"" + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ testee.processArgument(result, cwd, "-isystem " + "\"" + name + "\"" + more));
+ assertEquals("#entries", 1, result.getSystemIncludePaths().size());
+ assertEquals("name", name, result.getSystemIncludePaths().get(0));
name = (new Path("A:an\\In CLU de/Pat h")).toOSString();
// -isystem"A:an\In CLU de/Pat h"
- entries = new ParseContext();
+ result = new ParseContext();
assertEquals(8 + name.length() + 2,
- testee.processArgument(entries, cwd, "-isystem" + "\"" + name + "\"" + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ testee.processArgument(result, cwd, "-isystem" + "\"" + name + "\"" + more));
+ assertEquals("#entries", 1, result.getSystemIncludePaths().size());
+ assertEquals("name", name, result.getSystemIncludePaths().get(0));
// -isystem'A:an\In CLU de/Pat h'
- entries = new ParseContext();
- assertEquals(8 + name.length() + 2, testee.processArgument(entries, cwd, "-isystem" + "'" + name + "'" + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ result = new ParseContext();
+ assertEquals(8 + name.length() + 2, testee.processArgument(result, cwd, "-isystem" + "'" + name + "'" + more));
+ assertEquals("#entries", 1, result.getSystemIncludePaths().size());
+ assertEquals("name", name, result.getSystemIncludePaths().get(0));
name = (new Path("/Inc/CLUde/Path")).toOSString();
// -isystem/Inc/CLUde/Path
- entries = new ParseContext();
- assertEquals(8 + name.length(), testee.processArgument(entries, cwd, "-isystem" + name + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ result = new ParseContext();
+ assertEquals(8 + name.length(), testee.processArgument(result, cwd, "-isystem" + name + more));
+ assertEquals("#entries", 1, result.getSystemIncludePaths().size());
+ assertEquals("name", name, result.getSystemIncludePaths().get(0));
}
}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/SystemIncludePath_armcc_Test.java b/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/SystemIncludePath_armcc_Test.java
index 7895502077c..ca4e7fe25a5 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/SystemIncludePath_armcc_Test.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/SystemIncludePath_armcc_Test.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2019 Martin Weber.
+ * Copyright (c) 2019-2020 Martin Weber.
*
* Content is provided to you under the terms and conditions of the Eclipse Public License Version 2.0 "EPL".
* A copy of the EPL is available at http://www.eclipse.org/legal/epl-2.0.
@@ -10,9 +10,8 @@ package org.eclipse.cdt.cmake.is.core.internal;
import static org.junit.Assert.assertEquals;
-import org.eclipse.cdt.cmake.is.core.Arglets.SystemIncludePath_armcc;
+import org.eclipse.cdt.cmake.is.core.participant.Arglets.SystemIncludePath_armcc;
import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
-import org.eclipse.cdt.core.settings.model.ICSettingEntry;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.junit.Before;
@@ -37,50 +36,40 @@ public class SystemIncludePath_armcc_Test {
public final void testProcessArgument() {
final String more = " -g "
+ " -o CMakeFiles/execut1.dir/util1.c.o -c /testprojects/C-subsrc/src/src-sub/main1.c";
- ParseContext entries;
+ ParseContext result;
ICLanguageSettingEntry parsed;
final IPath cwd = new Path("");
String name = "/an/Include/Path";
// -J/an/Include/Path
- entries = new ParseContext();
- assertEquals(2 + name.length(), testee.processArgument(entries, cwd, "-J" + name + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ result = new ParseContext();
+ assertEquals(2 + name.length(), testee.processArgument(result, cwd, "-J" + name + more));
+ assertEquals("#entries", 1, result.getSystemIncludePaths().size());
+ assertEquals("name", name, result.getSystemIncludePaths().get(0));
// -J'/an/Include/Path'
- entries = new ParseContext();
- assertEquals(2 + name.length() + 2, testee.processArgument(entries, cwd, "-J" + "'" + name + "'" + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ result = new ParseContext();
+ assertEquals(2 + name.length() + 2, testee.processArgument(result, cwd, "-J" + "'" + name + "'" + more));
+ assertEquals("#entries", 1, result.getSystemIncludePaths().size());
+ assertEquals("name", name, result.getSystemIncludePaths().get(0));
// -J"/an/Include/Path"
- entries = new ParseContext();
- assertEquals(2 + name.length() + 2, testee.processArgument(entries, cwd, "-J" + "\"" + name + "\"" + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ result = new ParseContext();
+ assertEquals(2 + name.length() + 2, testee.processArgument(result, cwd, "-J" + "\"" + name + "\"" + more));
+ assertEquals("#entries", 1, result.getSystemIncludePaths().size());
+ assertEquals("name", name, result.getSystemIncludePaths().get(0));
name = (new Path("A:an\\In CLU de/Pat h")).toOSString();
// -J"A:an\In CLU de/Pat h"
- entries = new ParseContext();
- assertEquals(2 + name.length() + 2, testee.processArgument(entries, cwd, "-J" + "\"" + name + "\"" + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ result = new ParseContext();
+ assertEquals(2 + name.length() + 2, testee.processArgument(result, cwd, "-J" + "\"" + name + "\"" + more));
+ assertEquals("#entries", 1, result.getSystemIncludePaths().size());
+ assertEquals("name", name, result.getSystemIncludePaths().get(0));
// -J'A:an\In CLU de/Pat h'
- entries = new ParseContext();
- assertEquals(2 + name.length() + 2, testee.processArgument(entries, cwd, "-J" + "'" + name + "'" + more));
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ result = new ParseContext();
+ assertEquals(2 + name.length() + 2, testee.processArgument(result, cwd, "-J" + "'" + name + "'" + more));
+ assertEquals("#entries", 1, result.getSystemIncludePaths().size());
+ assertEquals("name", name, result.getSystemIncludePaths().get(0));
}
}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ToolCommandlineParserTest.java b/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ToolCommandlineParserTest.java
index 59b46ccb9ec..fb6c835d203 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ToolCommandlineParserTest.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ToolCommandlineParserTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015 Martin Weber.
+ * Copyright (c) 2015-2020 Martin Weber.
*
* Content is provided to you under the terms and conditions of the Eclipse Public License Version 2.0 "EPL".
* A copy of the EPL is available at http://www.eclipse.org/legal/epl-2.0.
@@ -9,18 +9,17 @@
package org.eclipse.cdt.cmake.is.core.internal;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import java.io.PrintWriter;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
-import org.eclipse.cdt.cmake.is.core.Arglets;
-import org.eclipse.cdt.cmake.is.core.DefaultToolCommandlineParser;
-import org.eclipse.cdt.cmake.is.core.IToolCommandlineParser;
-import org.eclipse.cdt.cmake.is.core.ResponseFileArglets;
-import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
-import org.eclipse.cdt.core.settings.model.ICSettingEntry;
+import org.eclipse.cdt.cmake.is.core.participant.Arglets;
+import org.eclipse.cdt.cmake.is.core.participant.DefaultToolCommandlineParser;
+import org.eclipse.cdt.cmake.is.core.participant.IToolCommandlineParser;
+import org.eclipse.cdt.cmake.is.core.participant.ResponseFileArglets;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.junit.Test;
@@ -33,14 +32,13 @@ public class ToolCommandlineParserTest {
@Test
public final void testResponseFileArgumentParser_At() throws Exception {
- DefaultToolCommandlineParser testee = new DefaultToolCommandlineParser("egal", new ResponseFileArglets.At(),
- null, new Arglets.IncludePath_C_POSIX(), new Arglets.MacroDefine_C_POSIX());
+ DefaultToolCommandlineParser testee = new DefaultToolCommandlineParser(new ResponseFileArglets.At(), null,
+ new Arglets.IncludePath_C_POSIX(), new Arglets.MacroDefine_C_POSIX());
- IToolCommandlineParser.IResult entries;
+ IToolCommandlineParser.IResult result;
final String more = " -g -MMD -o CMakeFiles/execut1.dir/util1.c.o"
+ " -c /testprojects/C-subsrc/src/src-sub/main.c";
- ICLanguageSettingEntry parsed;
// generate response file
final java.nio.file.Path dirP = Files.createTempDirectory("rfpt");
@@ -59,36 +57,30 @@ public class ToolCommandlineParserTest {
rspFilePw.close();
}
// @a/response/file.txt
- entries = testee.processArgs(new Path(cwdP.toString()), "@" + relRspP.toString() + " -D" + defName + more);
- assertEquals("#entries", 4, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", def1Name, parsed.getName());
- parsed = entries.getSettingEntries().get(1);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", cwdP.resolve(incDirName).toString(), parsed.getName());
- parsed = entries.getSettingEntries().get(2);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", def2Name, parsed.getName());
- parsed = entries.getSettingEntries().get(3);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", defName, parsed.getName());
+ result = testee.processArgs(new Path(cwdP.toString()), "@" + relRspP.toString() + " -D" + defName + more);
+ assertEquals("#defines", 3, result.getDefines().size());
+ assertTrue("found", result.getDefines().containsKey(def1Name));
+ assertEquals("value", "234", result.getDefines().get(def1Name));
+ assertTrue("found", result.getDefines().containsKey(def2Name));
+ assertEquals("value", "987", result.getDefines().get(def2Name));
+ assertTrue("found", result.getDefines().containsKey(defName));
+ assertEquals("value", "", result.getDefines().get(defName));
+
+ assertEquals("#paths", 1, result.getIncludePaths().size());
+ assertEquals("value", cwdP.resolve(incDirName).toString(), result.getIncludePaths().get(0));
// @ a/response.file.txt
- entries = testee.processArgs(new Path(cwdP.toString()), "@ " + relRspP.toString() + " -D" + defName + more);
- assertEquals("#entries", 4, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", def1Name, parsed.getName());
- parsed = entries.getSettingEntries().get(1);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", cwdP.resolve(incDirName).toString(), parsed.getName());
- parsed = entries.getSettingEntries().get(2);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", def2Name, parsed.getName());
- parsed = entries.getSettingEntries().get(3);
- assertEquals("kind", ICSettingEntry.MACRO, parsed.getKind());
- assertEquals("name", defName, parsed.getName());
+ result = testee.processArgs(new Path(cwdP.toString()), "@ " + relRspP.toString() + " -D" + defName + more);
+ assertEquals("#defines", 3, result.getDefines().size());
+ assertTrue("found", result.getDefines().containsKey(def1Name));
+ assertEquals("value", "234", result.getDefines().get(def1Name));
+ assertTrue("found", result.getDefines().containsKey(def2Name));
+ assertEquals("value", "987", result.getDefines().get(def2Name));
+ assertTrue("found", result.getDefines().containsKey(defName));
+ assertEquals("value", "", result.getDefines().get(defName));
+
+ assertEquals("#paths", 1, result.getIncludePaths().size());
+ assertEquals("value", cwdP.resolve(incDirName).toString(), result.getIncludePaths().get(0));
Files.delete(absRspP);
}
@@ -98,22 +90,19 @@ public class ToolCommandlineParserTest {
*/
@Test
public final void testResponseFileArgumentParser_At_heredoc() throws Exception {
- DefaultToolCommandlineParser testee = new DefaultToolCommandlineParser("egal", new ResponseFileArglets.At(),
- null, new Arglets.IncludePath_C_POSIX(), new Arglets.MacroDefine_C_POSIX());
+ DefaultToolCommandlineParser testee = new DefaultToolCommandlineParser(new ResponseFileArglets.At(), null,
+ new Arglets.IncludePath_C_POSIX(), new Arglets.MacroDefine_C_POSIX());
final String more = " -g -MMD -o CMakeFiles/execut1.dir/util1.c.o"
+ " -c /testprojects/C-subsrc/src/src-sub/main.c";
- IToolCommandlineParser.IResult entries;
- ICLanguageSettingEntry parsed;
+ IToolCommandlineParser.IResult result;
String name = "/ye/olde/Include/Pathe";
IPath cwd = new Path("");
- entries = new ParseContext();
+ result = new ParseContext();
// @<< ... <<
- entries = testee.processArgs(cwd, "@<<" + " -I" + name + " <<" + more);
- assertEquals("#entries", 1, entries.getSettingEntries().size());
- parsed = entries.getSettingEntries().get(0);
- assertEquals("kind", ICSettingEntry.INCLUDE_PATH, parsed.getKind());
- assertEquals("name", name, parsed.getName());
+ result = testee.processArgs(cwd, "@<<" + " -I" + name + " <<" + more);
+ assertEquals("#paths", 1, result.getIncludePaths().size());
+ assertEquals("name", name, result.getIncludePaths().get(0));
}
}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/GccOutputProcessorTest.java b/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/GccOutputProcessorTest.java
index 5089ad27327..5eeb55d137d 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/GccOutputProcessorTest.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core.tests/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/GccOutputProcessorTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2018 Martin Weber.
+ * Copyright (c) 2018-2020 Martin Weber.
*
* Content is provided to you under the terms and conditions of the Eclipse Public License Version 2.0 "EPL".
* A copy of the EPL is available at http://www.eclipse.org/legal/epl-2.0.
@@ -10,14 +10,14 @@
package org.eclipse.cdt.cmake.is.core.internal.builtins;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.io.InputStream;
-import org.eclipse.cdt.cmake.is.core.builtins.GccOutputProcessor;
-import org.eclipse.cdt.cmake.is.core.builtins.OutputSniffer;
-import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
+import org.eclipse.cdt.cmake.is.core.participant.builtins.GccOutputProcessor;
+import org.eclipse.cdt.cmake.is.core.participant.builtins.OutputSniffer;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
@@ -41,13 +41,13 @@ public class GccOutputProcessorTest {
@Test
@Ignore
public void testProcessLine() {
- testee.processLine("#define AAA xyz", new ProcessingContext());
+ testee.processLine("#define AAA xyz", new RawIndexerInfo());
}
@Test
public void testProcessFile() throws IOException {
// pass resource content line-wise to the testee...
- ProcessingContext pc = new ProcessingContext();
+ RawIndexerInfo pc = new RawIndexerInfo();
try (InputStream is = getClass().getResourceAsStream("cbd-gcc.output.txt");
OutputSniffer os = new OutputSniffer(testee, null, pc)) {
byte[] buffer = new byte[1024];
@@ -57,27 +57,11 @@ public class GccOutputProcessorTest {
}
}
- // check __GNUC__
- for (ICLanguageSettingEntry entry : pc.getSettingEntries()) {
- if (entry.getKind() == ICLanguageSettingEntry.MACRO) {
- if ("__GNUC__".equals(entry.getName()))
- assertEquals("value (" + entry.getName() + ")", "4", entry.getValue());
- }
- }
+ assertEquals("# include paths", 5, pc.getSystemIncludePaths().size());
+ assertEquals("# macros", 238, pc.getDefines().size());
- int inc = 0;
- int macro = 0;
- for (ICLanguageSettingEntry entry : pc.getSettingEntries()) {
- if (entry.getKind() == ICLanguageSettingEntry.INCLUDE_PATH) {
- inc++;
- assertTrue("path", !"".equals(entry.getName()));
- } else if (entry.getKind() == ICLanguageSettingEntry.MACRO) {
- macro++;
- assertTrue("macro", !"".equals(entry.getName()));
- assertTrue("value (" + entry.getName() + ")", entry.getValue() != null);
- }
- }
- assertEquals("# include paths", 5, inc);
- assertEquals("# macros", 238, macro);
+ // check __GNUC__
+ assertTrue("__GNUC__", pc.getDefines().containsKey("__GNUC__"));
+ assertNotNull("value", pc.getDefines().get("__GNUC__"));
}
}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core.ui/META-INF/MANIFEST.MF b/cmake/org.eclipse.cdt.cmake.is.core.ui/META-INF/MANIFEST.MF
index b40a1b31b0e..321c1f55703 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core.ui/META-INF/MANIFEST.MF
+++ b/cmake/org.eclipse.cdt.cmake.is.core.ui/META-INF/MANIFEST.MF
@@ -3,11 +3,13 @@ Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: org.eclipse.cdt.cmake.is.core.ui;singleton:=true
Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.ui
-Automatic-Module-Name: org.eclipse.cdt.cmake.is.core.ui
+ org.eclipse.ui,
+ org.eclipse.cdt.cmake.is.core;bundle-version="1.0.0",
+ org.eclipse.e4.ui.model.workbench;bundle-version="2.1.700.v20191222-1048"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Automatic-Module-Name: org.eclipse.cdt.cmake.is.core.ui
Bundle-ActivationPolicy: lazy
-Bundle-Activator: org.eclipse.cdt.cmake.is.core.ui.CMakeISPlugin
-Export-Package: org.eclipse.cdt.cmake.is.core.ui;x-friends:="org.eclipse.cdt.cmake.is.core"
-Bundle-Vendor: %Bundle-Vendor
+Import-Package: org.eclipse.cdt.core.options,
+ org.eclipse.e4.core.contexts
diff --git a/cmake/org.eclipse.cdt.cmake.is.core.ui/plugin.xml b/cmake/org.eclipse.cdt.cmake.is.core.ui/plugin.xml
index 589507043fe..c6b59d16554 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core.ui/plugin.xml
+++ b/cmake/org.eclipse.cdt.cmake.is.core.ui/plugin.xml
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
<plugin>
<extension
@@ -11,11 +10,5 @@
name="%page.name">
</page>
</extension>
- <extension
- point="org.eclipse.core.runtime.preferences">
- <initializer
- class="org.eclipse.cdt.cmake.is.core.ui.internal.PreferenceInitializer">
- </initializer>
- </extension>
</plugin>
diff --git a/cmake/org.eclipse.cdt.cmake.is.core.ui/src/org/eclipse/cdt/cmake/is/core/ui/CMakeISPlugin.java b/cmake/org.eclipse.cdt.cmake.is.core.ui/src/org/eclipse/cdt/cmake/is/core/ui/CMakeISPlugin.java
deleted file mode 100644
index b02b727dac3..00000000000
--- a/cmake/org.eclipse.cdt.cmake.is.core.ui/src/org/eclipse/cdt/cmake/is/core/ui/CMakeISPlugin.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2020 Martin Weber.
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *******************************************************************************/
-package org.eclipse.cdt.cmake.is.core.ui;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public final class CMakeISPlugin extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.cdt.cmake.is.core.ui"; //$NON-NLS-1$
-
- // The shared instance
- private static CMakeISPlugin plugin;
-
- /**
- * The constructor
- */
- public CMakeISPlugin() {
- }
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static CMakeISPlugin getDefault() {
- return plugin;
- }
-}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core.ui/src/org/eclipse/cdt/cmake/is/core/ui/PreferenceConstants.java b/cmake/org.eclipse.cdt.cmake.is.core.ui/src/org/eclipse/cdt/cmake/is/core/ui/PreferenceConstants.java
deleted file mode 100644
index 7ddf3de5520..00000000000
--- a/cmake/org.eclipse.cdt.cmake.is.core.ui/src/org/eclipse/cdt/cmake/is/core/ui/PreferenceConstants.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2020 Martin Weber.
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *******************************************************************************/
-package org.eclipse.cdt.cmake.is.core.ui;
-
-/**
- * Constant definitions for plug-in preferences
- */
-public class PreferenceConstants {
-
- /** preferences key for version suffix regex pattern */
- public static final String P_PATTERN = "vPattern";
- /** preferences key for version suffix regex pattern enabled */
- public static final String P_PATTERN_ENABLED = "vPatternEnabled";
- /** preferences key for built-ins detection output showing a console */
- public static final String P_WITH_CONSOLE = "console";
-}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core.ui/src/org/eclipse/cdt/cmake/is/core/ui/internal/IndexerSupportPreferencePage.java b/cmake/org.eclipse.cdt.cmake.is.core.ui/src/org/eclipse/cdt/cmake/is/core/ui/internal/IndexerSupportPreferencePage.java
index 63b03709b7a..c7dd3bdf009 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core.ui/src/org/eclipse/cdt/cmake/is/core/ui/internal/IndexerSupportPreferencePage.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core.ui/src/org/eclipse/cdt/cmake/is/core/ui/internal/IndexerSupportPreferencePage.java
@@ -13,16 +13,16 @@ package org.eclipse.cdt.cmake.is.core.ui.internal;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
-import org.eclipse.cdt.cmake.is.core.ui.CMakeISPlugin;
-import org.eclipse.cdt.cmake.is.core.ui.PreferenceConstants;
+import org.eclipse.cdt.cmake.is.core.IParserPreferences;
+import org.eclipse.cdt.cmake.is.core.IParserPreferencesAccess;
+import org.eclipse.cdt.cmake.is.core.IParserPreferencesMetadata;
+import org.eclipse.core.runtime.preferences.PreferenceMetadata;
+import org.eclipse.e4.core.contexts.EclipseContextFactory;
import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridLayout;
@@ -34,6 +34,7 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.osgi.framework.FrameworkUtil;
/**
* Preference page for indexer support.
@@ -43,47 +44,41 @@ public class IndexerSupportPreferencePage extends PreferencePage implements IWor
private Text pattern;
private Button btnVersionsEnabled;
private Button btnWithConsole;
+ private final IParserPreferencesAccess prefsAccess;
public IndexerSupportPreferencePage() {
- super();
- setPreferenceStore(CMakeISPlugin.getDefault().getPreferenceStore());
- setDescription("Configure how macros and include paths get extracted from the compile_commands.json file");
+ prefsAccess = EclipseContextFactory.getServiceContext(FrameworkUtil.getBundle(getClass()).getBundleContext())
+ .get(IParserPreferencesAccess.class);
+ setDescription(Messages.IndexerSupportPreferencePage_description);
}
/**
- * Creates the field editors. Field editors are abstractions of the common GUI
- * blocks needed to manipulate various types of preferences. Each field editor
- * knows how to save and restore itself.
+ * Creates the field editors.
*/
@Override
protected Control createContents(Composite parent) {
+ final IParserPreferencesMetadata prefsMeta = prefsAccess.metadata();
+ final IParserPreferences prefs = prefsAccess.getWorkspacePreferences();
+
final Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(1, false));
GridDataFactory.swtDefaults().applyTo(composite);
- final Group gr = createGroup(composite, SWT.FILL, 1, "For compilers with version in name", 2);
- btnVersionsEnabled = createCheckbox(gr, SWT.BEGINNING, 2, "&Also try with version suffix");
- btnVersionsEnabled.setToolTipText("Can recognize gcc-12.9.2, clang++-7.5.4, ...");
- IPreferenceStore preferenceStore = getPreferenceStore();
- btnVersionsEnabled.setSelection(preferenceStore.getBoolean(PreferenceConstants.P_PATTERN_ENABLED));
+ final Group gr = createGroup(composite, SWT.FILL, 1,
+ Messages.IndexerSupportPreferencePage_label_version_suffix_group, 2);
+ btnVersionsEnabled = createCheckbox(gr, SWT.BEGINNING, 2, prefsMeta.tryVersionSuffix());
+ btnVersionsEnabled.setSelection(prefs.getTryVersionSuffix());
{
Label label = new Label(gr, SWT.NONE);
- label.setText("&Suffix pattern:");
+ label.setText(Messages.IndexerSupportPreferencePage_label_suffix_pattern);
GridDataFactory.defaultsFor(label).applyTo(label);
}
pattern = new Text(gr, SWT.SINGLE | SWT.BORDER);
GridDataFactory.defaultsFor(pattern).applyTo(pattern);
- pattern.setToolTipText("Specify a Java regular expression pattern here");
+ pattern.setToolTipText(prefsMeta.versionSuffixPattern().description());
pattern.setEnabled(btnVersionsEnabled.getSelection());
- pattern.setText(preferenceStore.getString(PreferenceConstants.P_PATTERN));
- pattern.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- final String text = ((Text) e.widget).getText();
- // provider.setVersionPattern(text);
- }
- });
+ pattern.setText(prefs.getVersionSuffixPattern());
pattern.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
@@ -93,7 +88,7 @@ public class IndexerSupportPreferencePage extends PreferencePage implements IWor
Pattern.compile(text);
setErrorMessage(null);
} catch (PatternSyntaxException ex) {
- String msg = String.format("Suffix pattern regular expression: %1$s in '%2$s' at index %3$d",
+ String msg = String.format(Messages.IndexerSupportPreferencePage_errmsg_suffix_regex,
ex.getDescription(), ex.getPattern(), ex.getIndex());
setErrorMessage(msg);
}
@@ -113,9 +108,8 @@ public class IndexerSupportPreferencePage extends PreferencePage implements IWor
}
});
- btnWithConsole = createCheckbox(composite, SWT.BEGINNING, 1,
- "&Show output of compiler built-in detection in a console in the Console View");
- btnWithConsole.setSelection(preferenceStore.getBoolean(PreferenceConstants.P_WITH_CONSOLE));
+ btnWithConsole = createCheckbox(composite, SWT.BEGINNING, 1, prefsMeta.allocateConsole());
+ btnWithConsole.setSelection(prefs.getAllocateConsole());
return composite;
}
@@ -131,20 +125,20 @@ public class IndexerSupportPreferencePage extends PreferencePage implements IWor
@Override
protected void performDefaults() {
- IPreferenceStore preferenceStore = getPreferenceStore();
- btnVersionsEnabled.setSelection(preferenceStore.getDefaultBoolean(PreferenceConstants.P_PATTERN_ENABLED));
- pattern.setText(preferenceStore.getDefaultString(PreferenceConstants.P_PATTERN));
- btnWithConsole.setSelection(preferenceStore.getDefaultBoolean(PreferenceConstants.P_WITH_CONSOLE));
+ final IParserPreferencesMetadata prefsMeta = prefsAccess.metadata();
+ btnVersionsEnabled.setSelection(prefsMeta.tryVersionSuffix().defaultValue());
+ pattern.setText(prefsMeta.versionSuffixPattern().defaultValue());
+ btnWithConsole.setSelection(prefsMeta.allocateConsole().defaultValue());
setErrorMessage(null);
super.performDefaults();
}
@Override
public boolean performOk() {
- IPreferenceStore preferenceStore = getPreferenceStore();
- preferenceStore.setValue(PreferenceConstants.P_PATTERN_ENABLED, btnVersionsEnabled.getSelection());
- preferenceStore.setValue(PreferenceConstants.P_PATTERN, pattern.getText());
- preferenceStore.setValue(PreferenceConstants.P_WITH_CONSOLE, btnWithConsole.getSelection());
+ final IParserPreferences prefs = prefsAccess.getWorkspacePreferences();
+ prefs.setTryVersionSuffix(btnVersionsEnabled.getSelection());
+ prefs.setVersionSuffixPattern(pattern.getText());
+ prefs.setAllocateConsole(btnWithConsole.getSelection());
return true;
}
@@ -160,9 +154,11 @@ public class IndexerSupportPreferencePage extends PreferencePage implements IWor
* that the control will take up.
* @param text text to display on the check-box
*/
- private static Button createCheckbox(Composite parent, int horizontalAlignment, int horizontalSpan, String text) {
+ private static Button createCheckbox(Composite parent, int horizontalAlignment, int horizontalSpan,
+ PreferenceMetadata<Boolean> option) {
Button b = new Button(parent, SWT.CHECK);
- b.setText(text);
+ b.setText(option.name());
+ b.setToolTipText(option.description());
GridDataFactory.defaultsFor(b).align(horizontalAlignment, SWT.CENTER).span(horizontalSpan, 1).grab(true, false)
.applyTo(b);
return b;
diff --git a/cmake/org.eclipse.cdt.cmake.is.core.ui/src/org/eclipse/cdt/cmake/is/core/ui/internal/Messages.java b/cmake/org.eclipse.cdt.cmake.is.core.ui/src/org/eclipse/cdt/cmake/is/core/ui/internal/Messages.java
new file mode 100644
index 00000000000..360b6fef5d7
--- /dev/null
+++ b/cmake/org.eclipse.cdt.cmake.is.core.ui/src/org/eclipse/cdt/cmake/is/core/ui/internal/Messages.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Martin Weber.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+
+package org.eclipse.cdt.cmake.is.core.ui.internal;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author weber
+ *
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.cdt.cmake.is.core.ui.internal.messages"; //$NON-NLS-1$
+ public static String IndexerSupportPreferencePage_description;
+ public static String IndexerSupportPreferencePage_errmsg_suffix_regex;
+ public static String IndexerSupportPreferencePage_label_suffix_pattern;
+ public static String IndexerSupportPreferencePage_label_version_suffix_group;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core.ui/src/org/eclipse/cdt/cmake/is/core/ui/internal/PreferenceInitializer.java b/cmake/org.eclipse.cdt.cmake.is.core.ui/src/org/eclipse/cdt/cmake/is/core/ui/internal/PreferenceInitializer.java
deleted file mode 100644
index 967d84b40a9..00000000000
--- a/cmake/org.eclipse.cdt.cmake.is.core.ui/src/org/eclipse/cdt/cmake/is/core/ui/internal/PreferenceInitializer.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2020 Martin Weber.
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *******************************************************************************/
-package org.eclipse.cdt.cmake.is.core.ui.internal;
-
-import org.eclipse.cdt.cmake.is.core.ui.CMakeISPlugin;
-import org.eclipse.cdt.cmake.is.core.ui.PreferenceConstants;
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jface.preference.IPreferenceStore;
-
-/**
- * Class used to initialize default preference values.
- */
-public class PreferenceInitializer extends AbstractPreferenceInitializer {
- public void initializeDefaultPreferences() {
- IPreferenceStore store = CMakeISPlugin.getDefault().getPreferenceStore();
- store.setDefault(PreferenceConstants.P_PATTERN_ENABLED, false);
- store.setDefault(PreferenceConstants.P_PATTERN, "-?\\d+(\\.\\d+)*");
- }
-}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core.ui/src/org/eclipse/cdt/cmake/is/core/ui/internal/messages.properties b/cmake/org.eclipse.cdt.cmake.is.core.ui/src/org/eclipse/cdt/cmake/is/core/ui/internal/messages.properties
new file mode 100644
index 00000000000..4beadc880de
--- /dev/null
+++ b/cmake/org.eclipse.cdt.cmake.is.core.ui/src/org/eclipse/cdt/cmake/is/core/ui/internal/messages.properties
@@ -0,0 +1,17 @@
+###############################################################################
+# Copyright (c) 2020 Martin Weber and others.
+#
+# This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Martin Weber - initial API and implementation
+###############################################################################
+IndexerSupportPreferencePage_description=Configure how macros and include paths get extracted from the compile_commands.json file
+IndexerSupportPreferencePage_errmsg_suffix_regex=Suffix pattern regular expression: %1$s in '%2$s' at index %3$d
+IndexerSupportPreferencePage_label_suffix_pattern=&Suffix pattern:
+IndexerSupportPreferencePage_label_version_suffix_group=For compilers with version in name
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/.project b/cmake/org.eclipse.cdt.cmake.is.core/.project
index e2569a8ca81..a7dc02110c5 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/.project
+++ b/cmake/org.eclipse.cdt.cmake.is.core/.project
@@ -25,6 +25,11 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/.settings/org.eclipse.pde.ds.annotations.prefs b/cmake/org.eclipse.cdt.cmake.is.core/.settings/org.eclipse.pde.ds.annotations.prefs
new file mode 100644
index 00000000000..73a356b6d05
--- /dev/null
+++ b/cmake/org.eclipse.cdt.cmake.is.core/.settings/org.eclipse.pde.ds.annotations.prefs
@@ -0,0 +1,8 @@
+classpath=true
+dsVersion=V1_3
+eclipse.preferences.version=1
+enabled=true
+generateBundleActivationPolicyLazy=true
+path=OSGI-INF
+validationErrorLevel=error
+validationErrorLevel.missingImplicitUnbindMethod=error
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/META-INF/MANIFEST.MF b/cmake/org.eclipse.cdt.cmake.is.core/META-INF/MANIFEST.MF
index 455675b0542..443bc29f17f 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/META-INF/MANIFEST.MF
+++ b/cmake/org.eclipse.cdt.cmake.is.core/META-INF/MANIFEST.MF
@@ -10,19 +10,21 @@ Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.eclipse.cdt.cmake.is.core.internal.Plugin
-Export-Package: org.eclipse.cdt.cmake.is.core;x-internal:=true;uses:="org.eclipse.core.runtime,org.eclipse.cdt.core.settings.model,org.eclipse.cdt.cmake.is.core.builtins",
- org.eclipse.cdt.cmake.is.core.builtins;x-internal:=true;uses:="org.eclipse.cdt.core.settings.model"
+Export-Package: org.eclipse.cdt.cmake.is.core;x-friends:="org.eclipse.cdt.cmake.is.core.ui";
+ uses:="org.eclipse.core.runtime,
+ org.eclipse.cdt.core.settings.model,
+ org.eclipse.cdt.cmake.is.core.builtins",
+ org.eclipse.cdt.cmake.is.core.participant;uses:="org.eclipse.core.runtime,org.eclipse.cdt.cmake.is.core.participant.builtins",
+ org.eclipse.cdt.cmake.is.core.participant.builtins;uses:="org.eclipse.cdt.cmake.is.core.participant"
Require-Bundle: org.eclipse.ui.workbench;bundle-version="3.8.0",
org.eclipse.cdt.ui,
- org.eclipse.osgi,
org.eclipse.core.resources;bundle-version="3.13.700",
org.eclipse.core.runtime;bundle-version="3.17.100",
org.eclipse.cdt.core,
- org.eclipse.cdt.managedbuilder.core;bundle-version="8.7.400",
- org.eclipse.swt;bundle-version="3.113.100",
org.eclipse.jface,
- org.eclipse.osgi,
- org.eclipse.core.resources;bundle-version="3.13.700",
- org.eclipse.core.runtime;bundle-version="3.17.100",
- org.eclipse.swt;bundle-version="3.113.100"
+ com.google.gson,
+ org.apache.commons.io;bundle-version="2.6.0"
Automatic-Module-Name: org.eclipse.cdt.cmake.is.core
+Import-Package: org.eclipse.e4.core.contexts;version="1.7.0",
+ org.osgi.service.component.annotations;version="1.2.0"
+Service-Component: OSGI-INF/org.eclipse.cdt.cmake.is.core.internal.ParserPreferencesAccess.xml
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/OSGI-INF/org.eclipse.cdt.cmake.is.core.internal.ParserPreferencesAccess.xml b/cmake/org.eclipse.cdt.cmake.is.core/OSGI-INF/org.eclipse.cdt.cmake.is.core.internal.ParserPreferencesAccess.xml
new file mode 100644
index 00000000000..2e38abe76e9
--- /dev/null
+++ b/cmake/org.eclipse.cdt.cmake.is.core/OSGI-INF/org.eclipse.cdt.cmake.is.core.internal.ParserPreferencesAccess.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.cdt.cmake.is.core.internal.ParserPreferencesAccess">
+ <service>
+ <provide interface="org.eclipse.cdt.cmake.is.core.IParserPreferencesAccess"/>
+ </service>
+ <implementation class="org.eclipse.cdt.cmake.is.core.internal.ParserPreferencesAccess"/>
+</scr:component> \ No newline at end of file
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/build.properties b/cmake/org.eclipse.cdt.cmake.is.core/build.properties
index 97f20e727d5..f829fa37597 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/build.properties
+++ b/cmake/org.eclipse.cdt.cmake.is.core/build.properties
@@ -6,4 +6,5 @@ bin.includes = META-INF/,\
plugin.properties,\
about.html,\
.options,\
- schema/
+ schema/,\
+ OSGI-INF/
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/plugin.properties b/cmake/org.eclipse.cdt.cmake.is.core/plugin.properties
index d4e704ddd36..a12de8f02fa 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/plugin.properties
+++ b/cmake/org.eclipse.cdt.cmake.is.core/plugin.properties
@@ -8,4 +8,5 @@ This program and the accompanying materials are made\n\
available under the terms of the Eclipse Public License 2.0\n\
which is available at https://www.eclipse.org/legal/epl-2.0/\n\
\n\
-SPDX-License-Identifier: EPL-2.0\n\ \ No newline at end of file
+SPDX-License-Identifier: EPL-2.0
+extension-point.name = Detection Participant \ No newline at end of file
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/plugin.xml b/cmake/org.eclipse.cdt.cmake.is.core/plugin.xml
index 1da39483055..5ef8cc69b04 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/plugin.xml
+++ b/cmake/org.eclipse.cdt.cmake.is.core/plugin.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
- <extension-point id="detectionParticipant" name="Detection Participant" schema="schema/participant.exsd"/>
+ <extension-point id="detectionParticipant" name="%extension-point.name" schema="schema/participant.exsd"/>
"org.eclipse.cdt.cmake.is.core.internal.ui.CompileCommandsJsonParserOptionPage">
<extension
point="org.eclipse.cdt.core.CBuildConsole">
@@ -10,4 +10,15 @@
id="org.eclipse.cdt.cmake.is.core.detectorConsole">
</CBuildConsole>
</extension>
+ <extension
+ id="CompileCommandsJsonParserMarker"
+ name="CMake compile_commands.json parser"
+ point="org.eclipse.core.resources.markers">
+ <persistent
+ value="false">
+ </persistent>
+ <super
+ type="org.eclipse.core.resources.problemmarker">
+ </super>
+ </extension>
</plugin>
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/schema/participant.exsd b/cmake/org.eclipse.cdt.cmake.is.core/schema/participant.exsd
index db0e796688a..7fe04f42ece 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/schema/participant.exsd
+++ b/cmake/org.eclipse.cdt.cmake.is.core/schema/participant.exsd
@@ -6,8 +6,8 @@
<meta.schema plugin="org.eclipse.cdt.cmake.is.core" id="detectionParticipant" name="Tool Detection Participants"/>
</appinfo>
<documentation>
- Allows plug-ins to contribute to detection of compiler include paths, preprocessor defines and preprocessor un-defines from a command-line text.
-&lt;p&gt;This extension point teaches the &lt;i&gt;CMAKE_EXPORT_COMPILE_COMMANDS Parser&lt;/i&gt; and the &lt;i&gt;CMAKE_EXPORT_COMPILE_COMMANDS Compiler Built-ins&lt;/i&gt; language settings providers to analyze compiler-specific command-lines incl. options for a specific compiler. The detected include paths, preprocessor defines and preprocessor un-defines from the compiler command-line get passed to the CDT indexer.&lt;/p&gt;
+ Allows plug-ins to contribute to detection of compiler include paths and preprocessor defines from a command-line text.
+&lt;p&gt;This extension point teaches the &lt;i&gt;CompileCommandsParser&lt;/i&gt; to analyze compiler-specific command-lines incl. options for a specific compiler. The detected include paths, preprocessor defines and preprocessor un-defines from the compiler command-line get passed to the CDT indexer.&lt;/p&gt;
&lt;p&gt;Third party compiler vendors may use this extension point to add their compiler (or other tool) for improved syntax highlighting in the CDT&apos;s C/C++ editors.
&lt;/p&gt;
</documentation>
@@ -53,18 +53,18 @@
<element name="tool">
<annotation>
<documentation>
- Specifies the details for detectiion of a specific compiler by its executable name and how the include paths, preprocessor defines and preprocessor un-defines are processed.
+ Specifies the details for detection of a specific compiler by its executable name and how the include paths, preprocessor defines and preprocessor un-defines are processed.
</documentation>
</annotation>
<complexType>
<attribute name="class" type="string" use="required">
<annotation>
<documentation>
- The fully qualified name of a class that implements &lt;code&gt;org.eclipse.cdt.cmake.is.IToolDetectionParticipant&lt;/code&gt;, The implementation must provide a public no-argument constructor.&lt;br/&gt;
-You may want to consider sub-classing &lt;code&gt;org.eclipse.cdt.cmake.is.DefaultToolDetectionParticipant&lt;/code&gt; for convenience instead of directly implementing the interface.
+ The fully qualified name of a class that implements &lt;code&gt;org.eclipse.cdt.cmake.is.participant.IToolDetectionParticipant&lt;/code&gt;, The implementation must provide a public no-argument constructor.&lt;br/&gt;
+You may want to consider sub-classing &lt;code&gt;org.eclipse.cdt.cmake.is.participant.DefaultToolDetectionParticipant&lt;/code&gt; for convenience instead of directly implementing the interface.
</documentation>
<appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.cdt.cmake.is.IToolDetectionParticipant"/>
+ <meta.attribute kind="java" basedOn=":org.eclipse.cdt.cmake.is.participant.IToolDetectionParticipant"/>
</appinfo>
</annotation>
</attribute>
@@ -90,7 +90,7 @@ You may want to consider sub-classing &lt;code&gt;org.eclipse.cdt.cmake.is.Defau
<meta.section type="since"/>
</appinfo>
<documentation>
- 2.0.0
+ 1.0.0
</documentation>
</annotation>
@@ -109,28 +109,28 @@ the Foobar company:
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
-To provide online help that lists the supported compilers anlong with and the recognized arguments,
+To provide online help that lists the supported compilers along with the recognized arguments,
the extension point &lt;code&gt;org.eclipse.help.contentExtension&lt;/code&gt; can be used.&lt;br/&gt;
-Plugin &lt;i&gt;de.marw.cdt.cmake.core&lt;/i&gt; provides predefined help-anchors that allow to integrate the online help:
+Plugin &lt;i&gt;org.eclipse.cdt.cmake.is.core.doc&lt;/i&gt; provides predefined help-anchors that allow to integrate the online help:
&lt;ol&gt;
-&lt;li&gt;&lt;i&gt;extra_lsp_detection_participant_list&lt;/i&gt; for the CMAKE_EXPORT_COMPILE_COMMANDS Parser,&lt;/li&gt;
-&lt;li&gt;&lt;i&gt;extra_lsp_detection_participant_builtins_list&lt;/i&gt; and
-&lt;i&gt;extra_lsp_detection_participant_builtins_enhanced_list&lt;/i&gt; for the CMAKE_EXPORT_COMPILE_COMMANDS Compiler Built-ins Parser.&lt;/li&gt;
+&lt;li&gt;&lt;i&gt;extra_detection_participant_list&lt;/i&gt; for the commandline parser,&lt;/li&gt;
+&lt;li&gt;&lt;i&gt;extra_detection_participant_builtins_list&lt;/i&gt; and
+&lt;i&gt;extra_detection_participant_builtins_enhanced_list&lt;/i&gt; for the compiler built-ins parser.&lt;/li&gt;
&lt;/ol&gt;
Example file &lt;code&gt;help_content_extension.xml&lt;/code&gt;:
&lt;pre&gt;
&lt;contentExtension&gt;
&lt;contribution content=&quot;doc/compiler.xhtml#lsp&quot;
- path=&quot;/de.marw.cdt.cmake.core/doc/html/languageSettingsProviders.xhtml#extra_lsp_detection_participant_list&quot;/&gt;
+ path=&quot;/org.eclipse.cdt.cmake.is.core.doc/doc/html/languageSettingsProviders.xhtml#extra_detection_participant_list&quot;/&gt;
&lt;contribution content=&quot;doc/compiler.xhtml#builtins&quot;
- path=&quot;/de.marw.cdt.cmake.core/doc/html/builtins-detection.xhtml#extra_lsp_detection_participant_builtins_list&quot;/&gt;
+ path=&quot;/org.eclipse.cdt.cmake.is.core.doc/doc/html/builtins-detection.xhtml#extra_detection_participant_builtins_list&quot;/&gt;
&lt;/contentExtension&gt;
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
-The easiest way to implement a tool detection participant would be to sub-class &lt;code&gt;org.eclipse.cdt.cmake.is.DefaultToolDetectionParticipant&lt;/code&gt;.
-To configure your class, pass an instance of &lt;code&gt;org.eclipse.cdt.cmake.is.DefaultToolCommandlineParser&lt;/code&gt; in its super-constructor.&lt;br/&gt;
+The easiest way to implement a tool detection participant would be to sub-class &lt;code&gt;org.eclipse.cdt.cmake.is.participant.DefaultToolDetectionParticipant&lt;/code&gt;.
+To configure your class, pass an instance of &lt;code&gt;org.eclipse.cdt.cmake.is.participant.DefaultToolCommandlineParser&lt;/code&gt; in its super-constructor.&lt;br/&gt;
Some predifined parsers for tool arguments can be found in the classes &lt;code&gt;Arglets&lt;/code&gt; and &lt;code&gt;ResponseFileArglets&lt;/code&gt;.
&lt;/p&gt;
</documentation>
@@ -142,8 +142,8 @@ Some predifined parsers for tool arguments can be found in the classes &lt;code&
<meta.section type="implementation"/>
</appinfo>
<documentation>
- The plugin org.eclipse.cdt.cmake.is.intel provides inplementations for various compiler made by Intel Corp.&lt;/br&gt;
-See, for example &lt;code&gt;de/marw/cmake/cdt/lsp/intel/IccToolDetectionParticipant.java&lt;/code&gt;.
+ The plugin &lt;i&gt;org.eclipse.cdt.cmake.is.intel&lt;i&gt; provides implementations for various compiler made by Intel Corp.&lt;/br&gt;
+See, for example &lt;code&gt;org.eclipse.cdt.cmake.is.intel.IcpcToolDetectionParticipant.java&lt;/code&gt;.
</documentation>
</annotation>
@@ -152,7 +152,7 @@ See, for example &lt;code&gt;de/marw/cmake/cdt/lsp/intel/IccToolDetectionPartici
<meta.section type="copyright"/>
</appinfo>
<documentation>
- Copyright (c) 2019 Martin Weber&lt;br&gt;
+ Copyright (c) 2019-20 Martin Weber&lt;br&gt;
All rights reserved. Content is provided to you under the terms and conditions of the Eclipse Public License Version 2.0 &quot;EPL&quot;.
A copy of the EPL is available at http://www.eclipse.org/legal/epl-2.0.
</documentation>
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/CommandEntry.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/CommandEntry.java
new file mode 100644
index 00000000000..2d585aaa1ce
--- /dev/null
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/CommandEntry.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Martin Weber.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+
+package org.eclipse.cdt.cmake.is.core;
+
+/**
+ * Represents a parsed command entry of a compile_commands.json file.
+ * @author weber
+ */
+class CommandEntry {
+ private String directory;
+ private String command;
+ private String file;
+
+ /**
+ * Gets the build directory as a String.
+ */
+ public String getDirectory() {
+ return directory;
+ }
+
+ /**
+ * Gets the command-line to compile the source file.
+ */
+ public String getCommand() {
+ return command;
+ }
+
+ /**
+ * Gets the source file path as a String.
+ */
+ public String getFile() {
+ return file;
+ }
+}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/CompileCommandsJsonParser.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/CompileCommandsJsonParser.java
new file mode 100644
index 00000000000..1535d984d4f
--- /dev/null
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/CompileCommandsJsonParser.java
@@ -0,0 +1,543 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2020 Martin Weber.
+ *
+ * Content is provided to you under the terms and conditions of the Eclipse Public License Version 2.0 "EPL".
+ * A copy of the EPL is available at http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package org.eclipse.cdt.cmake.is.core;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.Reader;
+import java.nio.file.Files;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.Set;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import org.apache.commons.io.FilenameUtils;
+import org.eclipse.cdt.cmake.is.core.internal.ParserDetection;
+import org.eclipse.cdt.cmake.is.core.internal.ParserDetection.DetectorWithMethod;
+import org.eclipse.cdt.cmake.is.core.internal.ParserDetection.ParserDetectionResult;
+import org.eclipse.cdt.cmake.is.core.internal.Plugin;
+import org.eclipse.cdt.cmake.is.core.internal.StringUtil;
+import org.eclipse.cdt.cmake.is.core.internal.builtins.CompilerBuiltinsDetector;
+import org.eclipse.cdt.cmake.is.core.participant.DefaultToolDetectionParticipant;
+import org.eclipse.cdt.cmake.is.core.participant.IRawIndexerInfo;
+import org.eclipse.cdt.cmake.is.core.participant.IToolCommandlineParser;
+import org.eclipse.cdt.cmake.is.core.participant.IToolCommandlineParser.IResult;
+import org.eclipse.cdt.cmake.is.core.participant.IToolDetectionParticipant;
+import org.eclipse.cdt.cmake.is.core.participant.builtins.IBuiltinsDetectionBehavior;
+import org.eclipse.cdt.core.ICommandLauncher;
+import org.eclipse.cdt.core.build.CBuildConfiguration;
+import org.eclipse.cdt.core.resources.IConsole;
+import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.e4.core.contexts.EclipseContextFactory;
+import org.osgi.framework.FrameworkUtil;
+
+import com.google.gson.Gson;
+import com.google.gson.JsonIOException;
+import com.google.gson.JsonSyntaxException;
+
+/**
+ * Parses the file 'compile_commands.json' produced by cmake when option
+ * {@code -DCMAKE_EXPORT_COMPILE_COMMANDS=ON} is given and generates information
+ * about preprocessor symbols and include paths of the files being compiled for
+ * the CDT indexer.
+ *
+ * @author Martin Weber
+ */
+/*
+ * TODO introduce separate packages for consumers of this class and for
+ * implementors of the extension point (this package vs. packages
+ * org.eclipse.cdt.cmake.is.core, org.eclipse.cdt.cmake.is.core.builtins)
+ *
+ *
+ */
+public class CompileCommandsJsonParser {
+ private static final boolean DEBUG_TIME = Boolean
+ .parseBoolean(Platform.getDebugOption(Plugin.PLUGIN_ID + "/debug/performance")); //$NON-NLS-1$
+ private static final boolean DEBUG_ENTRIES = Boolean
+ .parseBoolean(Platform.getDebugOption(Plugin.PLUGIN_ID + "/debug/detected.entries")); //$NON-NLS-1$
+ /**
+ * property to store the file modification time of the "compile_commands.json"
+ * file
+ */
+ private static final QualifiedName TIMESTAMP_COMPILE_COMMANDS_PROPERTY = new QualifiedName(null,
+ "timestamp:compile_commands.json"); //$NON-NLS-1$
+
+ private static final String WORKBENCH_WILL_NOT_KNOW_ALL_MSG = Messages.CompileCommandsJsonParser_MSG_WORKBENCH_WILL_NOT_KNOW;
+
+ private static final String MARKER_ID = Plugin.PLUGIN_ID + ".CompileCommandsJsonParserMarker"; //$NON-NLS-1$
+
+ private final CBuildConfiguration cBuildConfiguration;
+ private final IIndexerInfoConsumer indexerInfoConsumer;
+ private final IParserPreferencesAccess prefsAccess;
+
+ /**
+ * last known working tool detector and its tool option parsers or {@code null},
+ * if unknown (to speed up parsing)
+ */
+ private DetectorWithMethod lastDetector;
+
+ /**
+ * markers for commands without a cmdline parser for the tool. just for error
+ * reporting, no technical effect
+ */
+ private Set<String> knownUnsupportedTools = new HashSet<>();
+
+ /**
+ * the raw scanner info results for each source file (source file name ->
+ * IResult)
+ */
+ private Map<String, IRawIndexerInfo> fileResults;
+
+ /**
+ * minimized set of CompilerBuiltinsDetector to run. (detector key ->
+ * CompilerBuiltinsDetector). Key is created by
+ * {@link #makeBuiltinsDetectorKey(String, List, String)}.
+ */
+ private Map<String, CompilerBuiltinsDetector> builtinDetectorsToRun;
+
+ /**
+ * the built-ins detectors for each source file (source file name -> detector
+ * key)
+ */
+ private Map<String, String> fileToBuiltinDetectorLinks;
+
+ /**
+ * Creates a new object that will try to parse the {@code compile_commands.json}
+ * file in the build directory of the specified {@code CBuildConfiguration}.
+ *
+ * @param buildConfiguration the CBuildConfiguration of the project
+ * @param indexerInfoConsumer the objects that receives the indexer relevant
+ * information for each source file
+ */
+ public CompileCommandsJsonParser(CBuildConfiguration buildConfiguration, IIndexerInfoConsumer indexerInfoConsumer) {
+ this.cBuildConfiguration = Objects.requireNonNull(buildConfiguration, "buildConfiguration"); //$NON-NLS-1$
+ this.indexerInfoConsumer = Objects.requireNonNull(indexerInfoConsumer, "indexerInfoConsumer"); //$NON-NLS-1$
+ prefsAccess = EclipseContextFactory.getServiceContext(FrameworkUtil.getBundle(getClass()).getBundleContext())
+ .get(IParserPreferencesAccess.class);
+ }
+
+ /**
+ * Parses the content of the 'compile_commands.json' file corresponding to the
+ * specified configuration, if timestamps differ.
+ *
+ * @param launcher the launcher to run the compiler for built-in detection.
+ * Should be capable to run in docker container, if build in
+ * container is configured for the project.
+ * @param console the console to print the compiler output during built-in
+ * detection to or <code>null</code> if a separate console is to
+ * be allocated.
+ * @param monitor the job's progress monitor
+ *
+ * @return {@code true} if the json file did change since the last invocation of
+ * this method (new setting entries were discovered), otherwise
+ * {@code false}
+ * @throws CoreException
+ */
+ private boolean processJsonFile(ICommandLauncher launcher, IConsole console, IProgressMonitor monitor)
+ throws CoreException {
+ final IProject project = cBuildConfiguration.getBuildConfiguration().getProject();
+ java.nio.file.Path buildRoot = cBuildConfiguration.getBuildDirectory();
+ final java.nio.file.Path jsonFile = buildRoot.resolve("compile_commands.json"); //$NON-NLS-1$
+ if (!Files.exists(jsonFile)) {
+ // no json file was produced in the build
+ final String msg = String.format(Messages.CompileCommandsJsonParser_errmsg_file_not_found, jsonFile,
+ WORKBENCH_WILL_NOT_KNOW_ALL_MSG);
+ createMarker(project, msg);
+ return false;
+ }
+ // file exists on disk...
+ long tsJsonModified = 0;
+ try {
+ tsJsonModified = Files.getLastModifiedTime(jsonFile).toMillis();
+ } catch (IOException e) {
+ // tread as 'file does nor exist'
+ return false;
+ }
+ IContainer buildContainer = cBuildConfiguration.getBuildContainer();
+ final IFile jsonFileRc = buildContainer.getFile(new Path("compile_commands.json")); //$NON-NLS-1$
+
+ Long sessionLastModified = (Long) buildContainer.getSessionProperty(TIMESTAMP_COMPILE_COMMANDS_PROPERTY);
+ if (sessionLastModified == null || sessionLastModified.longValue() < tsJsonModified) {
+ // must parse json file...
+ monitor.setTaskName(Messages.CompileCommandsJsonParser_msg_processing);
+ project.deleteMarkers(MARKER_ID, false, IResource.DEPTH_INFINITE);
+
+ try (Reader in = new FileReader(jsonFile.toFile())) {
+ // parse file...
+ Gson gson = new Gson();
+ CommandEntry[] sourceFileInfos = gson.fromJson(in, CommandEntry[].class);
+ for (CommandEntry sourceFileInfo : sourceFileInfos) {
+ processCommandEntry(sourceFileInfo, jsonFileRc);
+ }
+ } catch (JsonSyntaxException | JsonIOException ex) {
+ // file format error
+ final String msg = String.format(Messages.CompileCommandsJsonParser_errmsg_not_json, jsonFile,
+ WORKBENCH_WILL_NOT_KNOW_ALL_MSG);
+ createMarker(jsonFileRc, msg);
+ return false;
+ } catch (IOException ex) {
+ final String msg = String.format(Messages.CompileCommandsJsonParser_errmsg_read_error, jsonFile,
+ WORKBENCH_WILL_NOT_KNOW_ALL_MSG);
+ createMarker(jsonFileRc, msg);
+ return false;
+ }
+
+ detectBuiltins(launcher, console, monitor);
+ // store time-stamp
+ buildContainer.setSessionProperty(TIMESTAMP_COMPILE_COMMANDS_PROPERTY, tsJsonModified);
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Processes an entry from a {@code compile_commands.json} file and stores a
+ * {@link ICLanguageSettingEntry} for the file given the specified map.
+ *
+ * @param sourceFileInfo parsed command entry of a compile_commands.json file
+ * @param jsonFile the JSON file being parsed (for marker creation only)
+ *
+ * @throws CoreException if marker creation failed
+ */
+ private void processCommandEntry(CommandEntry sourceFileInfo, IFile jsonFile) throws CoreException {
+ // NOTE that this is the absolute file system path of the source file in
+ // CMake-notation (directory separator are forward slashes, even on windows)
+ final String file = sourceFileInfo.getFile();
+ final String cmdLine = sourceFileInfo.getCommand();
+ if (file != null && !file.isEmpty() && cmdLine != null && !cmdLine.isEmpty()) {
+ ParserDetection.ParserDetectionResult pdr = fastDetermineDetector(cmdLine);
+ if (pdr != null) {
+ // found a matching command-line parser
+ final IToolCommandlineParser parser = pdr.getDetectorWithMethod().getToolDetectionParticipant()
+ .getParser();
+ // cwdStr is the absolute working directory of the compiler in
+ // CMake-notation (fileSep are forward slashes)
+ final String cwdStr = sourceFileInfo.getDirectory();
+ IPath cwd = cwdStr != null ? Path.fromOSString(cwdStr) : new Path(""); //$NON-NLS-1$
+ IResult result = parser.processArgs(cwd, StringUtil.trimLeadingWS(pdr.getReducedCommandLine()));
+ // remember result together with file name
+ rememberFileResult(file, result);
+
+ final Optional<IBuiltinsDetectionBehavior> builtinDetection = parser.getIBuiltinsDetectionBehavior();
+ if (builtinDetection.isPresent()) {
+ rememberBuiltinsDetection(file, builtinDetection.get(), pdr.getCommandLine().getCommand(),
+ result.getBuiltinDetectionArgs());
+ }
+ } else {
+ // no matching parser found
+
+ // complain only once if no cmdline parser for the tool is known (fortran,
+ // assembler, etc)
+ int idx = cmdLine.indexOf(' ');
+ String unkownMarker = (idx != -1 ? cmdLine.substring(0, idx) : cmdLine)
+ + FilenameUtils.getExtension(file);
+ if (knownUnsupportedTools.contains(unkownMarker)) {
+ return;
+ }
+ knownUnsupportedTools.add(unkownMarker);
+
+ final String msg = String.format(Messages.CompileCommandsJsonParser_errmsg_no_parser_for_commandline,
+ cmdLine, WORKBENCH_WILL_NOT_KNOW_ALL_MSG);
+ createMarker(jsonFile, msg);
+ }
+ return;
+ }
+ // unrecognized entry, skipping
+ final String msg = String.format(Messages.CompileCommandsJsonParser_errmsg_unexpected_json, jsonFile,
+ WORKBENCH_WILL_NOT_KNOW_ALL_MSG);
+ createMarker(jsonFile, msg);
+ }
+
+ /**
+ * @param launcher the launcher to run the compiler for built-in detection.
+ * Should be capable to run in docker container, if build in
+ * container is configured for the project.
+ * @param console the console to print the compiler output during built-in
+ * detection to or <code>null</code> if a separate console is to
+ * be allocated.
+ * @param monitor
+ * @throws CoreException
+ */
+ private void detectBuiltins(ICommandLauncher launcher, IConsole console, IProgressMonitor monitor)
+ throws CoreException {
+ if (builtinDetectorsToRun == null || builtinDetectorsToRun.isEmpty())
+ return;
+ monitor.setTaskName(Messages.CompileCommandsJsonParser_msg_detecting_builtins);
+
+ java.nio.file.Path buildDir = cBuildConfiguration.getBuildDirectory();
+ // run each built-in detector and collect the results..
+ Map<String, IRawIndexerInfo> builtinDetectorsResults = new HashMap<>();
+ for (Entry<String, CompilerBuiltinsDetector> entry : builtinDetectorsToRun.entrySet()) {
+ IRawIndexerInfo result = entry.getValue().detectBuiltins(cBuildConfiguration.getBuildConfiguration(),
+ buildDir, launcher, console, monitor);
+ // store detector key with result
+ builtinDetectorsResults.put(entry.getKey(), result);
+ }
+ // all built-in detectors have been run at this point
+ builtinDetectorsToRun.clear();
+
+ // most of the time we get different String objects for different source files
+ // that have the same sequence of characters. So reduce the number of String
+ // objects by pooling them..
+ Map<String, String> strPool = new HashMap<>();
+ Function<String, String> stringPooler = v -> {
+ String old = strPool.putIfAbsent(v, v);
+ return old == null ? v : old;
+ };
+
+ // merge built-in results with source file results
+ for (Entry<String, String> link : fileToBuiltinDetectorLinks.entrySet()) {
+ String sourceFileName = link.getKey();
+ IRawIndexerInfo fileResult = fileResults.get(sourceFileName);
+ IRawIndexerInfo builtinDetectorsResult = builtinDetectorsResults.get(link.getValue());
+ mergeResultsForFile(stringPooler, sourceFileName, fileResult, builtinDetectorsResult);
+ }
+ }
+
+ /**
+ * Merges preprocessor symbols and macros for a source file with compiler
+ * built-in preprocessor symbols and macros and passes the to the
+ * {@code IIndexerInfoConsumer} that was specified in the constructor.
+ *
+ * @param fileResult source file preprocessor symbols and macros
+ * @param builtinDetectorsResult compiler built-in preprocessor symbols and
+ * macros
+ * @param stringPooler a function that returns a String from a pool
+ * for a given String
+ * @param sourceFileName the name of the source file
+ */
+ private void mergeResultsForFile(Function<String, String> stringPooler, String sourceFileName,
+ IRawIndexerInfo fileResult, IRawIndexerInfo builtinDetectorsResult) {
+ /*
+ * Handling of -U and -D is ambivalent here. - The GCC man page states: '-U name
+ * Cancel any previous definition of name, either built in or provided with a -D
+ * option.' - The POSIX c99 man page states: '-U name Remove any initial
+ * definition of name.' We implement handling of defines according to GCC here.
+ */
+ Map<String, String> builtinDefines = new HashMap<>(builtinDetectorsResult.getDefines());
+ for (String name : fileResult.getUndefines()) {
+ String value;
+ if ((value = builtinDefines.remove(name)) != null) {
+ if (DEBUG_ENTRIES)
+ System.out.printf(" Removed define: %s=%s%n", name, value); //$NON-NLS-1$
+ }
+ }
+
+ Map<String, String> effectiveDefines = Stream
+ .concat(builtinDefines.entrySet().stream(), fileResult.getDefines().entrySet().stream())
+ .collect(Collectors.toMap(stringPooler.compose(Map.Entry::getKey),
+ stringPooler.compose(Map.Entry::getValue)));
+ List<String> includePaths = Stream
+ .concat(fileResult.getIncludePaths().stream(), builtinDetectorsResult.getIncludePaths().stream())
+ .map(stringPooler).collect(Collectors.toList());
+ List<String> systemIncludePaths = Stream
+ .concat(fileResult.getSystemIncludePaths().stream(),
+ builtinDetectorsResult.getSystemIncludePaths().stream())
+ .map(stringPooler).collect(Collectors.toList());
+
+ // feed the paths and defines with the file name to the indexer..
+ indexerInfoConsumer.acceptSourceFileInfo(sourceFileName, systemIncludePaths, effectiveDefines, includePaths);
+ }
+
+ private static void createMarker(IResource rc, String message) throws CoreException {
+ IMarker marker = rc.createMarker(MARKER_ID);
+ marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_WARNING);
+ marker.setAttribute(IMarker.MESSAGE, message);
+ marker.setAttribute(IMarker.LOCATION, CompileCommandsJsonParser.class.getName());
+ }
+
+ /**
+ * Determines the parser detector that can parse the specified command-line.<br>
+ * Tries to be fast: That is, it tries the last known working detector first and
+ * will perform expensive detection required under windows only if needed.
+ *
+ * @param line the command line to process
+ *
+ * @return {@code null} if none of the detectors matched the tool name in the
+ * specified command-line string. Otherwise, if the tool name matches, a
+ * {@code ParserDetectionResult} holding the de-composed command-line is
+ * returned.
+ */
+ private ParserDetectionResult fastDetermineDetector(String line) {
+ final IParserPreferences prefs = prefsAccess.getWorkspacePreferences();
+ // try last known matching detector first...
+ if (lastDetector != null) {
+ Optional<DefaultToolDetectionParticipant.MatchResult> matchResult = Optional.empty();
+ final IToolDetectionParticipant detector = lastDetector.getToolDetectionParticipant();
+ switch (lastDetector.getHow()) {
+ case BASENAME:
+ matchResult = detector.basenameMatches(line, lastDetector.isMatchBackslash());
+ break;
+ case WITH_EXTENSION:
+ matchResult = detector.basenameWithExtensionMatches(line, lastDetector.isMatchBackslash());
+ break;
+ case WITH_VERSION:
+ if (prefs.getTryVersionSuffix()) {
+ matchResult = detector.basenameWithVersionMatches(line, lastDetector.isMatchBackslash(),
+ prefs.getVersionSuffixPattern());
+ }
+ break;
+ case WITH_VERSION_EXTENSION:
+ if (prefs.getTryVersionSuffix()) {
+ matchResult = detector.basenameWithVersionAndExtensionMatches(line, lastDetector.isMatchBackslash(),
+ prefs.getVersionSuffixPattern());
+ }
+ break;
+ default:
+ break;
+ }
+ if (matchResult.isPresent()) {
+ return new ParserDetection.ParserDetectionResult(lastDetector, matchResult.get());
+ } else {
+ lastDetector = null; // invalidate last working detector
+ }
+ }
+
+ // no working detector found, determine a new one...
+ String versionPattern = prefs.getTryVersionSuffix() ? prefs.getVersionSuffixPattern() : null;
+ ParserDetection.ParserDetectionResult result = ParserDetection.determineDetector(line, versionPattern,
+ File.separatorChar == '\\');
+ if (result != null) {
+ // cache last working detector
+ lastDetector = result.getDetectorWithMethod();
+ }
+ return result;
+ }
+
+ /**
+ * Parses the {@code compile_commands.json} file in the build directory of the
+ * project if necessary and generates indexer information.
+ *
+ * @param launcher the launcher to run the compiler for built-in detection.
+ * Should be capable to run in docker container, if build in
+ * container is configured for the project.
+ * @param console the console to print the compiler output during built-in
+ * detection to or <code>null</code> if a separate console is to
+ * be allocated.
+ * @param monitor the job's progress monitor
+ *
+ * @return {@code true} if the {@code compile_commands.json} file did change
+ * since the last invocation of this method, otherwise {@code false}. If
+ * {@code true}, new scanner information was detected and the CDT
+ * indexer should be notified.
+ * @throws CoreException
+ */
+ public boolean parse(ICommandLauncher launcher, IConsole console, IProgressMonitor monitor) throws CoreException {
+ long start = 0;
+ try {
+ if (DEBUG_TIME) {
+ System.out.printf("Project %s parsing compile_commands.json ...%n", //$NON-NLS-1$
+ cBuildConfiguration.getProject().getName());
+ start = System.currentTimeMillis();
+ }
+ return processJsonFile(launcher, console, monitor);
+ } finally {
+ if (DEBUG_TIME) {
+ long end = System.currentTimeMillis();
+ System.out.printf("Project %s parsed compile_commands.json file in %dms%n", //$NON-NLS-1$
+ cBuildConfiguration.getProject().getName(), end - start);
+ }
+ // clean up
+ builtinDetectorsToRun = null;
+ fileResults = null;
+ fileToBuiltinDetectorLinks = null;
+ }
+ }
+
+ /**
+ * Creates a Map-key suitable to minimize the set of CompilerBuiltinsDetector to
+ * run.
+ *
+ * @param compilerCommand the command name of the compiler
+ * @param builtinDetectionArgs compiler arguments that affect built-ins
+ * detection
+ * @param sourceFileExtension the extension of the source file name
+ */
+ @SuppressWarnings("nls")
+ private static String makeBuiltinsDetectorKey(String compilerCommand, List<String> builtinDetectionArgs,
+ String sourceFileExtension) {
+ switch (sourceFileExtension) {
+ case "C":
+ case "cc":
+ case "cpp":
+ case "CPP":
+ case "cp":
+ case "cxx":
+ case "c++":
+ // make sure we run built-ins detection only once for C++ files..
+ sourceFileExtension = "cpp";
+ break;
+ }
+ return compilerCommand + "#" + sourceFileExtension + "#"
+ // make sure we run the compiler for built-ins detection for each set of args
+ // that affect built-ins detection..
+ + String.join(" ", builtinDetectionArgs);
+ }
+
+ /**
+ * @param file
+ * @param result
+ */
+ private void rememberFileResult(String sourceFileName, IRawIndexerInfo result) {
+ if (fileResults == null)
+ fileResults = new HashMap<>();
+ fileResults.put(sourceFileName, result);
+ }
+
+ /**
+ * @param sourceFileName the name of the source file
+ * @param builtinDetectionArgs the compiler arguments from the command-line that
+ * affect built-in detection. For the GNU compilers,
+ * these are options like {@code --sysroot} and
+ * options that specify the language's standard
+ * ({@code -std=c++17}.
+ * @return a Map-key suitable to minimize the set of CompilerBuiltinsDetector to
+ * run
+ */
+ private String rememberBuiltinsDetection(String sourceFileName,
+ IBuiltinsDetectionBehavior builtinsDetectionBehavior, String compilerCommand,
+ List<String> builtinDetectionArgs) {
+ if (builtinDetectorsToRun == null)
+ builtinDetectorsToRun = new HashMap<>(3, 1.0f);
+
+ String extension = FilenameUtils.getExtension(sourceFileName);
+ String key = makeBuiltinsDetectorKey(compilerCommand, builtinDetectionArgs, extension);
+ if (!builtinDetectorsToRun.containsKey(key)) {
+ CompilerBuiltinsDetector detector = new CompilerBuiltinsDetector(builtinsDetectionBehavior, compilerCommand,
+ builtinDetectionArgs, extension);
+ builtinDetectorsToRun.put(key, detector);
+ }
+ // remember the built-ins detector for the source file
+ if (fileToBuiltinDetectorLinks == null)
+ fileToBuiltinDetectorLinks = new HashMap<>();
+
+ fileToBuiltinDetectorLinks.put(sourceFileName, key);
+ return key;
+ }
+
+}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/language/settings/providers/IIndexerInfoConsumer.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IIndexerInfoConsumer.java
index 76761668327..2d3e7c27175 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/language/settings/providers/IIndexerInfoConsumer.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IIndexerInfoConsumer.java
@@ -9,7 +9,7 @@
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
-package org.eclipse.cdt.cmake.is.core.language.settings.providers;
+package org.eclipse.cdt.cmake.is.core;
import java.util.List;
import java.util.Map;
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IParserPreferences.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IParserPreferences.java
new file mode 100644
index 00000000000..0dfaa93cf41
--- /dev/null
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IParserPreferences.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Martin Weber.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+
+package org.eclipse.cdt.cmake.is.core;
+
+/**
+ * Preferences to configure the {@code compile_commands.json} parser.
+ *
+ * @author weber
+ */
+public interface IParserPreferences {
+ /** Gets whether to also try a version suffix to detect a compiler. */
+ boolean getTryVersionSuffix();
+
+ /** Sets whether to also try a version suffix to detect a compiler. */
+ void setTryVersionSuffix(boolean tryVersionSuffix);
+
+ /** Sets the version suffix to detect a compiler. This is interpreted as a regular expression pattern. */
+ String getVersionSuffixPattern();
+
+ /** Sets the version suffix to detect a compiler.
+ *
+ * @param versionSuffixPattern The version suffix as a regular expression pattern
+ */
+ void setVersionSuffixPattern(String versionSuffixPattern);
+
+ /** Gets whether to allocate a console showing the output of compiler built-ins detection. */
+ boolean getAllocateConsole();
+
+ /** Sets whether to allocate a console showing the output of compiler built-ins detection. */
+ void setAllocateConsole(boolean allocateConsole);
+}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IParserPreferencesAccess.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IParserPreferencesAccess.java
new file mode 100644
index 00000000000..a13a30fa7dc
--- /dev/null
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IParserPreferencesAccess.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Martin Weber.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+
+package org.eclipse.cdt.cmake.is.core;
+
+/**
+ * Provides access to the {@code compile_commands.json} parser preferences and its preference metadata.<br>
+ *
+ * A concrete implementation object of this interface can be retrieved through the OSGI service feature.
+ *
+ * @author weber
+ */
+public interface IParserPreferencesAccess {
+ /**
+ * Gets the workspace {@code compile_commands.json} parser preferences.
+ */
+ IParserPreferences getWorkspacePreferences();
+
+ /**
+ * Gets the metadata for the parser preferences to be used in UI.
+ *
+ * @return the parser option metadata
+ */
+ IParserPreferencesMetadata metadata();
+}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IParserPreferencesMetadata.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IParserPreferencesMetadata.java
new file mode 100644
index 00000000000..db3da662124
--- /dev/null
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IParserPreferencesMetadata.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Martin Weber.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+
+package org.eclipse.cdt.cmake.is.core;
+
+import org.eclipse.core.runtime.preferences.PreferenceMetadata;
+
+/**
+ * The metadata for options to configure the {@code compile_commands.json} parser.
+ *
+ * @author weber
+ */
+public interface IParserPreferencesMetadata {
+ /**
+ * Returns the metadata for the {@link IParserPreferences#getTryVersionSuffix()} preference.
+ *
+ * @return the metadata for the preference option, never {@null}
+ */
+ PreferenceMetadata<Boolean> tryVersionSuffix();
+
+ /**
+ * Returns the metadata for the {@link IParserPreferences#getVersionSuffixPattern()} preference.
+ *
+ * @return the metadata for the preference option, never {@null}
+ */
+ PreferenceMetadata<String> versionSuffixPattern();
+
+ /**
+ * Returns the metadata for the {@link IParserPreferences#getAllocateConsole()} preference.
+ *
+ * @return the metadata for the preference option, never {@null}
+ */
+ PreferenceMetadata<Boolean> allocateConsole();
+}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/Messages.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/Messages.java
new file mode 100644
index 00000000000..4ed2a8174c5
--- /dev/null
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/Messages.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Martin Weber.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+
+package org.eclipse.cdt.cmake.is.core;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author weber
+ *
+ */
+/* package */ public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.cdt.cmake.is.core.messages"; //$NON-NLS-1$
+ public static String CompileCommandsJsonParser_errmsg_file_not_found;
+ public static String CompileCommandsJsonParser_errmsg_no_parser_for_commandline;
+ public static String CompileCommandsJsonParser_errmsg_not_json;
+ public static String CompileCommandsJsonParser_errmsg_read_error;
+ public static String CompileCommandsJsonParser_errmsg_unexpected_json;
+ public static String CompileCommandsJsonParser_msg_detecting_builtins;
+ public static String CompileCommandsJsonParser_msg_processing;
+ public static String CompileCommandsJsonParser_MSG_WORKBENCH_WILL_NOT_KNOW;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/builtins/IBuiltinsOutputProcessor.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/builtins/IBuiltinsOutputProcessor.java
deleted file mode 100644
index ef9c869e9f8..00000000000
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/builtins/IBuiltinsOutputProcessor.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2018-2020 Martin Weber.
- *
- * Content is provided to you under the terms and conditions of the Eclipse Public License Version 2.0 "EPL".
- * A copy of the EPL is available at http://www.eclipse.org/legal/epl-2.0.
- *
- * SPDX-License-Identifier: EPL-2.0
- *******************************************************************************/
-
-package org.eclipse.cdt.cmake.is.core.builtins;
-
-import java.util.List;
-
-import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
-
-/**
- * Responsible for parsing the output that is produced when a compiler is
- * invoked to detect its-built-in preprocessor macros and include paths.
- */
-public interface IBuiltinsOutputProcessor {
-
- /**
- * Parsers the given line from the compiler output and places each
- * ICLanguageSettingEntry found in the given {@code IProcessingContext}.
- *
- * @param line a line from the compiler output to parse
- * @param processingContext the buffer that receives the new
- * {@code LanguageSetting} entries
- */
- void processLine(String line, IProcessingContext processingContext);
-
- /**
- * Gathers the results of argument parsing.
- *
- * @author Martin Weber
- */
- public interface IProcessingContext {
- /**
- * Adds a ICLanguageSettingEntry to the result list.
- *
- * @param entry the entry to add to the result list
- */
- void addSettingEntry(ICLanguageSettingEntry entry);
- } // IProcessingContext
-
- /**
- * The result of processing the complete compiler output.
- *
- * @author Martin Weber
- *
- * @see IBuiltinsOutputProcessor#processLine(String, IProcessingContext)
- */
- public interface IResult {
- /**
- * Gets the language setting entries produced during processing.
- *
- * @return the language setting entries
- */
- List<ICLanguageSettingEntry> getSettingEntries();
- } // IResult
-}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/Messages.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/Messages.java
new file mode 100644
index 00000000000..a49ee8853ac
--- /dev/null
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/Messages.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Martin Weber.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+
+package org.eclipse.cdt.cmake.is.core.internal;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author weber
+ *
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.cdt.cmake.is.core.internal.messages"; //$NON-NLS-1$
+ public static String ParserPreferencesAccess_e_get_preferences;
+ public static String ParserPreferencesMetadata_label_console;
+ public static String ParserPreferencesMetadata_label_suffix;
+ public static String ParserPreferencesMetadata_label_try_suffix;
+ public static String ParserPreferencesMetadata_ttip_suffix;
+ public static String ParserPreferencesMetadata_ttip_try_suffix;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParseContext.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParseContext.java
index 0dd73f68b06..89a5f347fb7 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParseContext.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParseContext.java
@@ -12,9 +12,9 @@ package org.eclipse.cdt.cmake.is.core.internal;
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.cdt.cmake.is.core.IArglet;
-import org.eclipse.cdt.cmake.is.core.IToolCommandlineParser;
import org.eclipse.cdt.cmake.is.core.internal.builtins.RawIndexerInfo;
+import org.eclipse.cdt.cmake.is.core.participant.IArglet;
+import org.eclipse.cdt.cmake.is.core.participant.IToolCommandlineParser;
/**
* Default implementation of IArgumentCollector.
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserDetection.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserDetection.java
index 5a630ecc526..92647f5b249 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserDetection.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserDetection.java
@@ -17,17 +17,17 @@ import java.util.Map;
import java.util.Optional;
import java.util.function.Consumer;
-import org.eclipse.cdt.cmake.is.core.Arglets;
-import org.eclipse.cdt.cmake.is.core.DefaultToolCommandlineParser;
-import org.eclipse.cdt.cmake.is.core.DefaultToolDetectionParticipant;
-import org.eclipse.cdt.cmake.is.core.IArglet;
-import org.eclipse.cdt.cmake.is.core.IToolCommandlineParser;
-import org.eclipse.cdt.cmake.is.core.IToolDetectionParticipant;
-import org.eclipse.cdt.cmake.is.core.IToolDetectionParticipant.MatchResult;
-import org.eclipse.cdt.cmake.is.core.ResponseFileArglets;
-import org.eclipse.cdt.cmake.is.core.builtins.IBuiltinsDetectionBehavior;
import org.eclipse.cdt.cmake.is.core.internal.builtins.GccBuiltinDetectionBehavior;
import org.eclipse.cdt.cmake.is.core.internal.builtins.MaybeGccBuiltinDetectionBehavior;
+import org.eclipse.cdt.cmake.is.core.participant.Arglets;
+import org.eclipse.cdt.cmake.is.core.participant.DefaultToolCommandlineParser;
+import org.eclipse.cdt.cmake.is.core.participant.DefaultToolDetectionParticipant;
+import org.eclipse.cdt.cmake.is.core.participant.IArglet;
+import org.eclipse.cdt.cmake.is.core.participant.IToolCommandlineParser;
+import org.eclipse.cdt.cmake.is.core.participant.IToolDetectionParticipant;
+import org.eclipse.cdt.cmake.is.core.participant.ResponseFileArglets;
+import org.eclipse.cdt.cmake.is.core.participant.IToolDetectionParticipant.MatchResult;
+import org.eclipse.cdt.cmake.is.core.participant.builtins.IBuiltinsDetectionBehavior;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.ILog;
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserPreferences.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserPreferences.java
new file mode 100644
index 00000000000..16784f9c3ed
--- /dev/null
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserPreferences.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Martin Weber.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+
+package org.eclipse.cdt.cmake.is.core.internal;
+
+import java.util.Objects;
+
+import org.eclipse.cdt.cmake.is.core.IParserPreferences;
+import org.eclipse.cdt.cmake.is.core.IParserPreferencesMetadata;
+import org.eclipse.core.runtime.preferences.IPreferenceMetadataStore;
+
+/**
+ * @author weber
+ */
+final class ParserPreferences implements IParserPreferences {
+
+ private final IPreferenceMetadataStore optionStorage;
+ private final IParserPreferencesMetadata metadata;
+
+ public ParserPreferences(IPreferenceMetadataStore optionStorage, IParserPreferencesMetadata metadata) {
+ this.optionStorage = Objects.requireNonNull(optionStorage, "optionStorage"); //$NON-NLS-1$
+ this.metadata = Objects.requireNonNull(metadata, "metadata"); //$NON-NLS-1$
+ }
+
+ @Override
+ public boolean getTryVersionSuffix() {
+ return optionStorage.load(metadata.tryVersionSuffix());
+ }
+
+ @Override
+ public void setTryVersionSuffix(boolean tryVersionSuffix) {
+ optionStorage.save(tryVersionSuffix, metadata.tryVersionSuffix());
+ }
+
+ @Override
+ public String getVersionSuffixPattern() {
+ return optionStorage.load(metadata.versionSuffixPattern());
+ }
+
+ @Override
+ public void setVersionSuffixPattern(String versionSuffixPattern) {
+ Objects.requireNonNull(versionSuffixPattern);
+ optionStorage.save(versionSuffixPattern, metadata.versionSuffixPattern());
+ }
+
+ @Override
+ public boolean getAllocateConsole() {
+ return optionStorage.load(metadata.allocateConsole());
+ }
+
+ @Override
+ public void setAllocateConsole(boolean allocateConsole) {
+ optionStorage.save(allocateConsole, metadata.allocateConsole());
+ }
+}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserPreferencesAccess.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserPreferencesAccess.java
new file mode 100644
index 00000000000..939736c3931
--- /dev/null
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserPreferencesAccess.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Martin Weber.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+
+package org.eclipse.cdt.cmake.is.core.internal;
+
+import java.util.Optional;
+
+import org.eclipse.cdt.cmake.is.core.IParserPreferences;
+import org.eclipse.cdt.cmake.is.core.IParserPreferencesAccess;
+import org.eclipse.cdt.cmake.is.core.IParserPreferencesMetadata;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IPreferenceMetadataStore;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.core.runtime.preferences.OsgiPreferenceMetadataStore;
+import org.eclipse.osgi.util.NLS;
+import org.osgi.service.component.annotations.Component;
+
+/**
+ * @author weber
+ */
+@Component
+public class ParserPreferencesAccess implements IParserPreferencesAccess {
+
+ private final ParserPreferencesMetadata metadata;
+
+ public ParserPreferencesAccess() {
+ this.metadata = new ParserPreferencesMetadata();
+ }
+
+ private IPreferenceMetadataStore workspaceStorage() {
+ return new OsgiPreferenceMetadataStore(preferences(InstanceScope.INSTANCE));
+ }
+
+ @Override
+ public IParserPreferences getWorkspacePreferences() {
+ return new ParserPreferences(workspaceStorage(), metadata);
+ }
+
+ @Override
+ public IParserPreferencesMetadata metadata() {
+ return metadata;
+ }
+
+ private IEclipsePreferences preferences(IScopeContext scope) {
+ return Optional.ofNullable(scope.getNode(nodeQualifier()))//
+ .map(n -> n.node(nodePath()))//
+ .filter(IEclipsePreferences.class::isInstance)//
+ .map(IEclipsePreferences.class::cast)//
+ .orElseThrow(() -> new IllegalStateException(//
+ NLS.bind(Messages.ParserPreferencesAccess_e_get_preferences, //
+ nodeQualifier(), nodePath())));
+ }
+
+ private String nodeQualifier() {
+ return Plugin.PLUGIN_ID;
+ }
+
+ private String nodePath() {
+ return "parser"; //$NON-NLS-1$
+ }
+}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserPreferencesMetadata.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserPreferencesMetadata.java
new file mode 100644
index 00000000000..33649278b4c
--- /dev/null
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/ParserPreferencesMetadata.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Martin Weber.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+
+package org.eclipse.cdt.cmake.is.core.internal;
+
+import org.eclipse.cdt.cmake.is.core.IParserPreferencesMetadata;
+import org.eclipse.core.runtime.preferences.PreferenceMetadata;
+
+/**
+ * @author weber
+ */
+final class ParserPreferencesMetadata implements IParserPreferencesMetadata {
+
+ private final PreferenceMetadata<Boolean> tryVersionSuffixOption;
+ private final PreferenceMetadata<String> versionSuffixPatternOption;
+ private final PreferenceMetadata<Boolean> allocateConsoleOption;
+
+ public ParserPreferencesMetadata() {
+ this.tryVersionSuffixOption = new PreferenceMetadata<>(Boolean.class, "versionSuffixPatternEnabled", false, //$NON-NLS-1$
+ Messages.ParserPreferencesMetadata_label_try_suffix,
+ Messages.ParserPreferencesMetadata_ttip_try_suffix);
+ this.versionSuffixPatternOption = new PreferenceMetadata<>(String.class, "versionSuffixPattern", //$NON-NLS-1$
+ "-?\\d+(\\.\\d+)*", //$NON-NLS-1$
+ Messages.ParserPreferencesMetadata_label_suffix, Messages.ParserPreferencesMetadata_ttip_suffix);
+ this.allocateConsoleOption = new PreferenceMetadata<>(Boolean.class, "allocateConsole", false, //$NON-NLS-1$
+ Messages.ParserPreferencesMetadata_label_console);
+ }
+
+ @Override
+ public PreferenceMetadata<Boolean> tryVersionSuffix() {
+ return tryVersionSuffixOption;
+ }
+
+ @Override
+ public PreferenceMetadata<String> versionSuffixPattern() {
+ return versionSuffixPatternOption;
+ }
+
+ @Override
+ public PreferenceMetadata<Boolean> allocateConsole() {
+ return allocateConsoleOption;
+ }
+}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/CompilerBuiltinsDetector.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/CompilerBuiltinsDetector.java
index 92e882c9531..f8331b29706 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/CompilerBuiltinsDetector.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/CompilerBuiltinsDetector.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2018-2019 Martin Weber.
+ * Copyright (c) 2018-2020 Martin Weber.
*
* Content is provided to you under the terms and conditions of the Eclipse Public License Version 2.0 "EPL".
* A copy of the EPL is available at http://www.eclipse.org/legal/epl-2.0.
@@ -9,42 +9,40 @@
package org.eclipse.cdt.cmake.is.core.internal.builtins;
-import java.io.File;
import java.io.IOException;
+import java.nio.file.Files;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.Set;
-import org.eclipse.cdt.cmake.is.core.builtins.IBuiltinsDetectionBehavior;
-import org.eclipse.cdt.cmake.is.core.builtins.IBuiltinsOutputProcessor;
-import org.eclipse.cdt.cmake.is.core.builtins.OutputSniffer;
+import org.eclipse.cdt.cmake.is.core.IParserPreferences;
+import org.eclipse.cdt.cmake.is.core.IParserPreferencesAccess;
import org.eclipse.cdt.cmake.is.core.internal.Plugin;
+import org.eclipse.cdt.cmake.is.core.participant.IRawIndexerInfo;
+import org.eclipse.cdt.cmake.is.core.participant.builtins.IBuiltinsDetectionBehavior;
+import org.eclipse.cdt.cmake.is.core.participant.builtins.IBuiltinsOutputProcessor;
+import org.eclipse.cdt.cmake.is.core.participant.builtins.OutputSniffer;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.ConsoleOutputStream;
import org.eclipse.cdt.core.ICommandLauncher;
import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
import org.eclipse.cdt.core.envvar.IEnvironmentVariableManager;
-import org.eclipse.cdt.core.model.ILanguage;
-import org.eclipse.cdt.core.model.LanguageManager;
import org.eclipse.cdt.core.resources.IConsole;
-import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
-import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
-import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.core.resources.IBuildConfiguration;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
+import org.eclipse.e4.core.contexts.EclipseContextFactory;
+import org.osgi.framework.FrameworkUtil;
/**
* Detects preprocessor macros and include paths that are built-in to a
@@ -57,83 +55,69 @@ public class CompilerBuiltinsDetector {
* console ID for extension point org.eclipse.cdt.core.CBuildConsole (see
* plugin.xml)
*/
- @SuppressWarnings("nls")
- private static final String CONSOLE_ID = Plugin.PLUGIN_ID + ".detectorConsole";
+ private static final String CONSOLE_ID = Plugin.PLUGIN_ID + ".detectorConsole"; //$NON-NLS-1$
/** error marker ID */
- @SuppressWarnings("nls")
- private static final String MARKER_ID = Plugin.PLUGIN_ID + ".CompilerBuiltinsDetectorMarker";
-
- private ICConfigurationDescription cfgDescription;
-
- /** environment variables, lazily instantiated */
- private String[] envp;
-
- private final String languageId;
+ private static final String MARKER_ID = Plugin.PLUGIN_ID + ".CompilerBuiltinsDetectorMarker"; //$NON-NLS-1$
+ private final String sourceFileExtension;
private final String command;
-
- private List<String> builtinsDetectionArgs;
-
+ private final List<String> builtinsDetectionArgs;
private final IBuiltinsDetectionBehavior builtinsDetectionBehavior;
+ private IBuildConfiguration buildConfiguration;
+ private java.nio.file.Path buildDirectory;
+
/**
- * @param cfgDescription configuration description.
- * @param languageId language id
* @param builtinsDetectionBehavior how compiler built-ins are to be detected
* @param command the compiler command (argument # 0)
* @param builtinsDetectionArgs the compiler arguments from the command-line
* that affect built-in detection. For the GNU
* compilers, these are options like
* {@code --sysroot} and options that specify
- * the language's standard ({@code -std=c++17}.
- */
- @SuppressWarnings("nls")
- public CompilerBuiltinsDetector(ICConfigurationDescription cfgDescription, String languageId,
- IBuiltinsDetectionBehavior builtinsDetectionBehavior, String command, List<String> builtinsDetectionArgs) {
- this.languageId = Objects.requireNonNull(languageId, "languageId");
- this.builtinsDetectionBehavior = Objects.requireNonNull(builtinsDetectionBehavior, "builtinsDetectionBehavior");
- this.command = Objects.requireNonNull(command, "command");
- this.builtinsDetectionArgs = Objects.requireNonNull(builtinsDetectionArgs, "builtinsDetectionArgs");
- this.cfgDescription = Objects.requireNonNull(cfgDescription);
- }
-
- /**
- * Gets the language ID of this detector.
+ * the language's standard (e.g.
+ * {@code -std=c++17}).
+ * @param sourceFileExtension the extension of the source file name
*/
- public String getLanguageId() {
- return languageId;
+ public CompilerBuiltinsDetector(IBuiltinsDetectionBehavior builtinsDetectionBehavior, String command,
+ List<String> builtinsDetectionArgs, String sourceFileExtension) {
+ this.sourceFileExtension = Objects.requireNonNull(sourceFileExtension, "sourceFileExtension"); //$NON-NLS-1$
+ this.builtinsDetectionBehavior = Objects.requireNonNull(builtinsDetectionBehavior, "builtinsDetectionBehavior"); //$NON-NLS-1$
+ this.command = Objects.requireNonNull(command, "command"); //$NON-NLS-1$
+ this.builtinsDetectionArgs = Objects.requireNonNull(builtinsDetectionArgs, "builtinsDetectionArgs"); //$NON-NLS-1$
}
/**
- * Run built-in detection builtinsDetectionArgs.
- *
- * @param withConsole whether to show a console for the builtinsDetectionArgs
- * output
+ * Runs built-in detection.
*
+ * @param buildConfiguration the project build configuration to use
+ * @param theBuildDirectory the build directory of the build configuration
+ * @param launcher the launcher that can run in docker container, if
+ * any
+ * @param console the console to print the compiler output to or
+ * <code>null</code> if a separate console is to be
+ * allocated.
* @throws CoreException
*/
- public List<ICLanguageSettingEntry> run(boolean withConsole) throws CoreException {
- ProcessingContext entries = new ProcessingContext();
+ public IRawIndexerInfo detectBuiltins(IBuildConfiguration buildConfiguration, java.nio.file.Path theBuildDirectory,
+ ICommandLauncher launcher, IConsole console, IProgressMonitor monitor) throws CoreException {
+ this.buildConfiguration = Objects.requireNonNull(buildConfiguration, "buildConfiguration"); //$NON-NLS-1$
+ this.buildDirectory = Objects.requireNonNull(theBuildDirectory, "buildDirectory"); //$NON-NLS-1$
+
+ if (monitor == null) {
+ monitor = new NullProgressMonitor();
+ }
- final List<String> argList = getCompilerArguments(languageId);
+ RawIndexerInfo result = new RawIndexerInfo();
+
+ final List<String> argList = getCompilerArguments();
argList.addAll(builtinsDetectionArgs);
- IConsole console = null;
- if (withConsole) {
- console = startOutputConsole();
- }
+ console = startOutputConsole(console);
- IProject project = cfgDescription.getProjectDescription().getProject();
- // get the launcher that runs in docker container, if any
- ICommandLauncher launcher = ManagedBuildManager.getConfigurationForDescription(cfgDescription)
- .getEditableBuilder().getCommandLauncher();
- launcher.setProject(project);
+ launcher.setProject(buildConfiguration.getProject());
launcher.showCommand(console != null);
- final NullProgressMonitor monitor = new NullProgressMonitor();
- final IPath builderCWD = cfgDescription.getBuildSetting().getBuilderCWD();
- IPath buildRoot = ResourcesPlugin.getWorkspace().getRoot().getFolder(builderCWD).getLocation();
final Process proc = launcher.execute(new Path(command), argList.toArray(new String[argList.size()]), getEnvp(),
- buildRoot, monitor);
+ new Path(this.buildDirectory.toString()), monitor);
if (proc != null) {
try {
// Close the input of the process since we will never write to it
@@ -141,19 +125,29 @@ public class CompilerBuiltinsDetector {
} catch (IOException e) {
}
// NOTE: we need 2 of these, since the output streams are not synchronized,
- // causing loss of
- // the internal processor state
+ // causing loss of the output processors' internal state
final IBuiltinsOutputProcessor bopOut = builtinsDetectionBehavior.createCompilerOutputProcessor();
final IBuiltinsOutputProcessor bopErr = builtinsDetectionBehavior.createCompilerOutputProcessor();
+ long start = System.currentTimeMillis();
int state = launcher.waitAndRead(
- new OutputSniffer(bopOut, console == null ? null : console.getOutputStream(), entries),
- new OutputSniffer(bopErr, console == null ? null : console.getErrorStream(), entries), monitor);
+ new OutputSniffer(bopOut, console == null ? null : console.getOutputStream(), result),
+ new OutputSniffer(bopErr, console == null ? null : console.getErrorStream(), result), monitor);
+ if (console != null) {
+ final ConsoleOutputStream cis = console.getInfoStream();
+ try {
+ cis.write(String.format(Messages.CompilerBuiltinsDetector_msg_detection_finished,
+ System.currentTimeMillis() - start).getBytes());
+ cis.write("\n".getBytes()); //$NON-NLS-1$
+ } catch (IOException ignore) {
+ }
+ }
if (state != ICommandLauncher.COMMAND_CANCELED) {
// check exit status
final int exitValue = proc.exitValue();
if (exitValue != 0 && !builtinsDetectionBehavior.suppressErrormessage()) {
// compiler had errors...
- String errMsg = String.format("%1$s exited with status %2$d.", command, exitValue);
+ String errMsg = String.format(Messages.CompilerBuiltinsDetector_errmsg_command_failed, command,
+ exitValue);
createMarker(errMsg);
}
}
@@ -161,17 +155,16 @@ public class CompilerBuiltinsDetector {
// process start failed
createMarker(launcher.getErrorMessage());
}
- return entries.getSettingEntries();
+ return result;
}
/**
- * Gets the compiler-arguments corresponding to the specified language ID and
- * the builtinDetection.
+ * Gets the compiler-arguments corresponding to the builtinDetection.
*/
- private List<String> getCompilerArguments(String languageId) {
+ private List<String> getCompilerArguments() {
List<String> args = new ArrayList<>();
args.addAll(builtinsDetectionBehavior.getBuiltinsOutputEnablingArgs());
- String inputFile = getInputFile(languageId);
+ String inputFile = getInputFile();
if (inputFile != null) {
args.add(inputFile);
}
@@ -179,136 +172,97 @@ public class CompilerBuiltinsDetector {
}
/**
- * Get array of environment variables in format "var=value".
- */
- @SuppressWarnings("nls")
- private String[] getEnvp() {
- if (envp == null) {
- // On POSIX (Linux, UNIX) systems reset language variables to default
- // (English)
- // with UTF-8 encoding since GNU compilers can handle only UTF-8
- // characters.
- // Include paths with locale characters will be handled properly
- // regardless
- // of the language as long as the encoding is set to UTF-8.
- // English language is set for parser because it relies on English
- // messages
- // in the output of the 'gcc -v' builtinsDetectionArgs.
-
- List<String> env = new ArrayList<>(Arrays.asList(getEnvp(cfgDescription)));
- for (Iterator<String> iterator = env.iterator(); iterator.hasNext();) {
- String var = iterator.next();
- if (var.startsWith("LANGUAGE" + '=') || var.startsWith("LC_ALL" + '=')) {
- iterator.remove();
- }
- }
- env.add("LANGUAGE" + "=en"); // override for GNU gettext //$NON-NLS-1$
- env.add("LC_ALL" + "=C.UTF-8"); // for other parts of the //$NON-NLS-1$
- // system libraries
- envp = env.toArray(new String[env.size()]);
- }
- return envp;
- }
-
- /**
* Get environment variables from configuration as array of "var=value" suitable
* for using as "envp" with Runtime.exec(String[] cmdarray, String[] envp, File
* dir)
*
- * @param cfgDescription configuration description.
* @return String array of environment variables in format "var=value". Does not
* return {@code null}.
*/
- @SuppressWarnings("nls")
- private static String[] getEnvp(ICConfigurationDescription cfgDescription) {
+ private String[] getEnvp() {
IEnvironmentVariableManager mngr = CCorePlugin.getDefault().getBuildEnvironmentManager();
- IEnvironmentVariable[] vars = mngr.getVariables(cfgDescription, true);
+ IEnvironmentVariable[] vars = mngr.getVariables(buildConfiguration, true);
// Convert into envp strings
Set<String> strings = new HashSet<>(vars.length);
for (IEnvironmentVariable var : vars) {
+ if (var.getName().startsWith("LANGUAGE" + '=') || var.getName().startsWith("LC_ALL" + '=')) //$NON-NLS-1$ //$NON-NLS-2$
+ continue;
strings.add(var.getName() + '=' + var.getValue());
}
- // On POSIX (Linux, UNIX) systems reset language variables to default
- // (English)
+ // On POSIX (Linux, UNIX) systems reset language variables to default (English)
// with UTF-8 encoding since GNU compilers can handle only UTF-8 characters.
// Include paths with locale characters will be handled properly regardless
// of the language as long as the encoding is set to UTF-8.
// English language is set for parser because it relies on English messages
// in the output of the 'gcc -v' builtinsDetectionArgs.
- strings.add("LANGUAGE" + "=en"); // override for GNU gettext
- strings.add("LC_ALL" + "=C.UTF-8"); // for other parts of the system
- // libraries
+ strings.add("LANGUAGE" + "=en"); // override for GNU gettext //$NON-NLS-1$ //$NON-NLS-2$
+ strings.add("LC_ALL" + "=C.UTF-8"); // for other parts of the system libraries //$NON-NLS-1$ //$NON-NLS-2$
return strings.toArray(new String[strings.size()]);
}
/**
- * Get path to source file which is the input for the compiler.
+ * Gets a path to the source file which is the input for the compiler. The file
+ * will be created with no content in the build directory.
*
- * @param languageId the language ID.
- * @return full path to the source file.
+ * @return the full file system path of the source file
*/
- private String getInputFile(String languageId) {
- String specExt = builtinsDetectionBehavior.getInputFileExtension(languageId);
- if (specExt != null) {
- String specFileName = "detect_compiler_builtins" + '.' + specExt; //$NON-NLS-1$
-
- final IPath builderCWD = cfgDescription.getBuildSetting().getBuilderCWD();
- IPath fileLocation = ResourcesPlugin.getWorkspace().getRoot().getFolder(builderCWD).getLocation()
- .append(specFileName);
-
- File specFile = new java.io.File(fileLocation.toOSString());
- if (!specFile.exists()) {
- try {
- // In the typical case it is sufficient to have an empty file.
- specFile.getParentFile().mkdirs(); // no build ran yet, must create dirs
- specFile.createNewFile();
- } catch (IOException e) {
- Plugin.getDefault().getLog().log(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, "getInputFile()", e));
- }
+ private String getInputFile() {
+ String specFileName = "detect_compiler_builtins" + '.' + sourceFileExtension; //$NON-NLS-1$
+ java.nio.file.Path specFile = buildDirectory.resolve(specFileName);
+ if (!Files.exists(specFile)) {
+ try {
+ // In the typical case it is sufficient to have an empty file.
+ Files.createDirectories(specFile.getParent()); // no build ran yet, must create dirs
+ Files.createFile(specFile);
+ } catch (IOException e) {
+ Plugin.getDefault().getLog().log(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, "getInputFile()", e)); //$NON-NLS-1$
}
-
- return fileLocation.toString();
}
- return null;
+
+ return specFile.toString();
}
private void createMarker(String message) throws CoreException {
- IMarker marker = cfgDescription.getProjectDescription().getProject().createMarker(MARKER_ID);
+ IMarker marker = buildConfiguration.getProject().createMarker(MARKER_ID);
marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO);
marker.setAttribute(IMarker.MESSAGE, message);
}
/**
- * Creates and starts the provider console.
+ * Creates and starts the output console.
*
* @return CDT console or <code>null</code>
*
* @throws CoreException
*/
- private IConsole startOutputConsole() throws CoreException {
- IConsole console = null;
+ private IConsole startOutputConsole(IConsole console) throws CoreException {
+ IParserPreferences prefs = EclipseContextFactory
+ .getServiceContext(FrameworkUtil.getBundle(getClass()).getBundleContext())
+ .get(IParserPreferencesAccess.class).getWorkspacePreferences();
+ if (!prefs.getAllocateConsole()) {
+ return null; // no console to allocate
+ } else {
+ IProject project = buildConfiguration.getProject();
+ if (console == null) {
+ // need to allocate console, but none is given
+ String consoleId = CONSOLE_ID + "." + project.getName(); //$NON-NLS-1$
+ console = CCorePlugin.getDefault().getConsole(CONSOLE_ID, consoleId, null, null);
+ }
- ILanguage ld = LanguageManager.getInstance().getLanguage(languageId);
- if (ld != null) {
- String consoleId = CONSOLE_ID + '.' + languageId;
- console = CCorePlugin.getDefault().getConsole(CONSOLE_ID, consoleId, null, null);
- final IProject project = cfgDescription.getProjectDescription().getProject();
console.start(project);
try {
final ConsoleOutputStream cis = console.getInfoStream();
- cis.write(SimpleDateFormat.getTimeInstance().format(new Date()).getBytes());
- cis.write(" Detecting compiler built-ins: ".getBytes());
- cis.write(project.getName().getBytes());
- cis.write("::".getBytes());
- cis.write(cfgDescription.getConfiguration().getName().getBytes());
- cis.write(" for ".getBytes());
- cis.write(ld.getName().getBytes());
- cis.write("\n".getBytes());
+ String msg;
+ msg = String.format(Messages.CompilerBuiltinsDetector_msg_detection_start,
+ SimpleDateFormat.getTimeInstance().format(new Date()), project.getName(),
+ buildConfiguration.getName().isEmpty() ? "?" : buildConfiguration.getName(), //$NON-NLS-1$
+ String.join(" ", builtinsDetectionArgs)); //$NON-NLS-1$
+ cis.write(msg.getBytes());
+ cis.write("\n".getBytes()); //$NON-NLS-1$
} catch (IOException ignore) {
}
}
-
return console;
}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/DetectorConsole.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/DetectorConsole.java
index 286d0b84252..2f7d86d3583 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/DetectorConsole.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/DetectorConsole.java
@@ -22,8 +22,7 @@ public class DetectorConsole extends AbstractConsole {
@Override
protected IBuildConsoleManager getConsoleManager() {
- return CUIPlugin.getDefault().getConsoleManager("Compiler Built-ins Detection Console",
- CONSOLE_CONTEXT_MENU_ID);
+ return CUIPlugin.getDefault().getConsoleManager(Messages.DetectorConsole_title, CONSOLE_CONTEXT_MENU_ID);
}
}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/MaybeGccBuiltinDetectionBehavior.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/MaybeGccBuiltinDetectionBehavior.java
index 05631664c08..6f2e6100c75 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/MaybeGccBuiltinDetectionBehavior.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/MaybeGccBuiltinDetectionBehavior.java
@@ -12,9 +12,9 @@ package org.eclipse.cdt.cmake.is.core.internal.builtins;
import java.util.Arrays;
import java.util.List;
-import org.eclipse.cdt.cmake.is.core.builtins.GccOutputProcessor;
-import org.eclipse.cdt.cmake.is.core.builtins.IBuiltinsDetectionBehavior;
-import org.eclipse.cdt.cmake.is.core.builtins.IBuiltinsOutputProcessor;
+import org.eclipse.cdt.cmake.is.core.participant.builtins.GccOutputProcessor;
+import org.eclipse.cdt.cmake.is.core.participant.builtins.IBuiltinsDetectionBehavior;
+import org.eclipse.cdt.cmake.is.core.participant.builtins.IBuiltinsOutputProcessor;
/**
* The {link IBuiltinsDetectionBehavior} for the GNU C and GNU C++ compiler
@@ -46,16 +46,4 @@ public class MaybeGccBuiltinDetectionBehavior implements IBuiltinsDetectionBehav
// detection
return true;
}
-
- @SuppressWarnings("nls")
- @Override
- public String getInputFileExtension(String languageId) {
- if (languageId.equals("org.eclipse.cdt.core.gcc")) {
- return "c";
- }
- if (languageId.equals("org.eclipse.cdt.core.g++")) {
- return "cpp";
- }
- return null; // no input file required for built-in detection
- }
}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/Messages.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/Messages.java
new file mode 100644
index 00000000000..15987bc3994
--- /dev/null
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/Messages.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Martin Weber.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+
+package org.eclipse.cdt.cmake.is.core.internal.builtins;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author weber
+ *
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.cdt.cmake.is.core.internal.builtins.messages"; //$NON-NLS-1$
+ public static String CompilerBuiltinsDetector_errmsg_command_failed;
+ public static String CompilerBuiltinsDetector_msg_detection_finished;
+ public static String CompilerBuiltinsDetector_msg_detection_start;
+ public static String DetectorConsole_title;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/ProcessingContext.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/ProcessingContext.java
deleted file mode 100644
index c9b161c4d42..00000000000
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/ProcessingContext.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2019-2020 Martin Weber.
- *
- * Content is provided to you under the terms and conditions of the Eclipse Public License Version 2.0 "EPL".
- * A copy of the EPL is available at http://www.eclipse.org/legal/epl-2.0.
- *
- * SPDX-License-Identifier: EPL-2.0
- *******************************************************************************/
-
-package org.eclipse.cdt.cmake.is.core.internal.builtins;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.cdt.cmake.is.core.builtins.IBuiltinsOutputProcessor;
-import org.eclipse.cdt.cmake.is.core.internal.Plugin;
-import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
-import org.eclipse.core.runtime.Platform;
-
-/**
- * Default implementation of IProcessingContext.
- *
- * @author Martin Weber
- */
-class ProcessingContext implements IBuiltinsOutputProcessor.IProcessingContext, IBuiltinsOutputProcessor.IResult {
- @SuppressWarnings("nls")
- private static final boolean DEBUG = Boolean
- .parseBoolean(Platform.getDebugOption(Plugin.PLUGIN_ID + "/CECC/builtins/entries"));
-
- private final List<ICLanguageSettingEntry> entries = Collections
- .synchronizedList(new ArrayList<ICLanguageSettingEntry>());
-
- public ProcessingContext() {
- }
-
- @Override
- public void addSettingEntry(ICLanguageSettingEntry entry) {
- if (DEBUG)
- System.out.printf("Added builtin entry: %s%n", entry); //$NON-NLS-1$
- entries.add(entry);
- }
-
- @Override
- public List<ICLanguageSettingEntry> getSettingEntries() {
- return entries;
- }
-
-}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/RawIndexerInfo.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/RawIndexerInfo.java
new file mode 100644
index 00000000000..029e1bae87c
--- /dev/null
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/RawIndexerInfo.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Martin Weber.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+
+package org.eclipse.cdt.cmake.is.core.internal.builtins;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Objects;
+
+import org.eclipse.cdt.cmake.is.core.internal.Plugin;
+import org.eclipse.cdt.cmake.is.core.participant.IRawIndexerInfo;
+import org.eclipse.cdt.cmake.is.core.participant.IRawIndexerInfoCollector;
+import org.eclipse.core.runtime.Platform;
+
+/**
+ * Default implementation of IRawIndexerInfo.
+ *
+ * @author weber
+ */
+public class RawIndexerInfo implements IRawIndexerInfo, IRawIndexerInfoCollector {
+
+ @SuppressWarnings("nls")
+ private static final boolean DEBUG = Boolean
+ .parseBoolean(Platform.getDebugOption(Plugin.PLUGIN_ID + "/debug/detected.entries"));
+
+ private final Map<String, String> defines = new HashMap<>();
+ private final List<String> undefines = new ArrayList<>();
+ private final List<String> includePaths = new ArrayList<>();
+ private final List<String> systemIncludePaths = new ArrayList<>();
+
+ @Override
+ public void addDefine(String name, String value) {
+ Objects.requireNonNull(name);
+ value = Objects.toString(value, ""); //$NON-NLS-1$
+ if (DEBUG)
+ System.out.printf(" Added define: %s=%s%n", name, value); //$NON-NLS-1$
+ defines.put(name, value);
+ }
+
+ @Override
+ public void addUndefine(String name) {
+ Objects.requireNonNull(name);
+ if (DEBUG)
+ System.out.printf(" Added undefine: %s%n", name); //$NON-NLS-1$
+ undefines.add(name);
+ // - The GCC man page states:
+ // '-U name Cancel any previous definition of name, either built in or provided
+ // with a -D option.'
+ // - The POSIX c99 man page states:
+ // '-U name Remove any initial definition of name.'
+ for (Iterator<Map.Entry<String, String>> iter = defines.entrySet().iterator(); iter.hasNext();) {
+ Entry<String, String> define = iter.next();
+ if (define.getKey().equals(name)) {
+ if (DEBUG)
+ System.out.printf(" Removed define: %s=%s%n", define.getKey(), define.getValue()); //$NON-NLS-1$
+ iter.remove();
+ }
+ }
+ }
+
+ @Override
+ public void addIncludePath(String path) {
+ Objects.requireNonNull(path);
+ if (DEBUG)
+ System.out.printf(" Added incl path: %s%n", path); //$NON-NLS-1$
+ includePaths.add(path);
+ }
+
+ @Override
+ public void addSystemIncludePath(String path) {
+ Objects.requireNonNull(path);
+ if (DEBUG)
+ System.out.printf(" Added sys incl path: %s%n", path); //$NON-NLS-1$
+ systemIncludePaths.add(path);
+ }
+
+ @Override
+ public Map<String, String> getDefines() {
+ return Collections.unmodifiableMap(defines);
+ }
+
+ @Override
+ public List<String> getUndefines() {
+ return Collections.unmodifiableList(undefines);
+ }
+
+ @Override
+ public List<String> getIncludePaths() {
+ return Collections.unmodifiableList(includePaths);
+ }
+
+ @Override
+ public List<String> getSystemIncludePaths() {
+ return Collections.unmodifiableList(systemIncludePaths);
+ }
+}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/messages.properties b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/messages.properties
new file mode 100644
index 00000000000..72bdef23577
--- /dev/null
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/builtins/messages.properties
@@ -0,0 +1,17 @@
+###############################################################################
+# Copyright (c) 2020 Martin Weber and others.
+#
+# This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Martin Weber - initial API and implementation
+###############################################################################
+CompilerBuiltinsDetector_errmsg_command_failed=%1$s exited with status %2$d.
+CompilerBuiltinsDetector_msg_detection_finished=Detecting compiler built-ins took %d ms.
+CompilerBuiltinsDetector_msg_detection_start=%1$s Detecting compiler built-ins: %2$s::%3$s for '%4$s'
+DetectorConsole_title=Compiler Built-ins Detection Console
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/messages.properties b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/messages.properties
new file mode 100644
index 00000000000..e19e075194c
--- /dev/null
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/internal/messages.properties
@@ -0,0 +1,19 @@
+###############################################################################
+# Copyright (c) 2020 Martin Weber and others.
+#
+# This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Martin Weber - initial API and implementation
+###############################################################################
+ParserPreferencesAccess_e_get_preferences=Unable to get preferences for node: {0}.{1}
+ParserPreferencesMetadata_label_console=&Show output of compiler built-in detection in a console in the Console View
+ParserPreferencesMetadata_label_suffix=&Suffix pattern:
+ParserPreferencesMetadata_label_try_suffix=&Also try with version suffix
+ParserPreferencesMetadata_ttip_suffix=Specify a Java regular expression pattern here
+ParserPreferencesMetadata_ttip_try_suffix=Can recognize gcc-12.9.2, clang++-7.5.4, ...
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/language/settings/providers/BuiltinsCompileCommandsJsonParser.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/language/settings/providers/BuiltinsCompileCommandsJsonParser.java
deleted file mode 100644
index 0a6b116ac5c..00000000000
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/language/settings/providers/BuiltinsCompileCommandsJsonParser.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2018 Martin Weber.
- *
- * Content is provided to you under the terms and conditions of the Eclipse Public License Version 2.0 "EPL".
- * A copy of the EPL is available at http://www.eclipse.org/legal/epl-2.0.
- *
- * SPDX-License-Identifier: EPL-2.0
- *******************************************************************************/
-package org.eclipse.cdt.cmake.is.core.language.settings.providers;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Optional;
-import java.util.Set;
-
-import org.eclipse.cdt.build.core.scannerconfig.ScannerConfigNature;
-import org.eclipse.cdt.cmake.is.core.internal.ParserDetection;
-import org.eclipse.cdt.cmake.is.core.internal.Plugin;
-import org.eclipse.cdt.cmake.is.core.internal.builtins.CompilerBuiltinsDetector;
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.language.settings.providers.ICBuildOutputParser;
-import org.eclipse.cdt.core.language.settings.providers.ICListenerAgent;
-import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsEditableProvider;
-import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvider;
-import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvidersKeeper;
-import org.eclipse.cdt.core.language.settings.providers.IWorkingDirectoryTracker;
-import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsManager;
-import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsSerializableProvider;
-import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
-import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
-import org.eclipse.cdt.core.settings.model.ICProjectDescription;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.ILog;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.swt.widgets.Display;
-import org.w3c.dom.Element;
-
-/**
- * A ILanguageSettingsProvider that detects the include paths and symbols
- * built-in to the compilers found in the file 'compile_commands.json' produced
- * by cmake.<br>
- * NOTE: This class misuses interface ICBuildOutputParser to detect when a build
- * did finish.<br>
- * NOTE: This class misuses interface ICListenerAgent to populate the
- * {@link #getSettingEntries setting entries} on workbench startup.
- *
- * @author Martin Weber
- */
-/*
- * TODO delete this after integration into core build
- */
-public class BuiltinsCompileCommandsJsonParser extends LanguageSettingsSerializableProvider
- implements ILanguageSettingsEditableProvider, ICListenerAgent, ICBuildOutputParser, Cloneable {
-
- public static final String PROVIDER_ID = "org.eclipse.cdt.cmake.is.core.language.settings.providers.BuiltinsCompileCommandsJsonParser";
- private static final ILog log = Plugin.getDefault().getLog();
-
- /** storage key for with console */
- @SuppressWarnings("nls")
- private static final String ATTR_WITH_CONSOLE = "console";
-
- private ICConfigurationDescription currentCfgDescription;
-
- @Override
- public void configureProvider(String id, String name, List<String> languages, List<ICLanguageSettingEntry> entries,
- Map<String, String> properties) {
- ArrayList<String> scope = new ArrayList<>();
- scope.add("org.eclipse.cdt.core.gcc"); //$NON-NLS-1$
- scope.add("org.eclipse.cdt.core.g++"); //$NON-NLS-1$
- scope.addAll(ParserDetection.getCustomLanguages());
- super.configureProvider(id, name, scope, entries, properties);
- }
-
- /**
- * Detects the compiler built-in include paths and symbols. Uses
- * {@link CompileCommandsJsonParser} for parsing of the json file and caching.
- *
- * @param initializingWorkbench {@code true} if the workbench is starting up. If
- * {@code true}, this method will not trigger UI
- * update to show newly detected include paths nor
- * will it complain if a "compile_commands.json"
- * file does not exist.
- * @throws CoreException
- */
- private void detectBuiltins(boolean initializingWorkbench) throws CoreException {
- if (currentCfgDescription instanceof ILanguageSettingsProvidersKeeper) {
- Iterable<CompilerBuiltinsDetector> detectors;
-
- final List<ILanguageSettingsProvider> lsps = ((ILanguageSettingsProvidersKeeper) currentCfgDescription)
- .getLanguageSettingProviders();
- // get the CompileCommandsJsonParser object, if the settings provider is enabled
- // on the configuration
- final CompileCommandsJsonParser lsp;
- Optional<ILanguageSettingsProvider> lspO = lsps.stream()
- .filter(p -> CompileCommandsJsonParser.PROVIDER_ID.equals(p.getId())).findAny();
- if (lspO.isPresent()) {
- // CompileCommandsJsonParser is there, trigger it, regardless of provider order
- lsp = (CompileCommandsJsonParser) LanguageSettingsManager.getRawProvider(lspO.get());
- detectors = lsp.determineBuiltinDetectors(currentCfgDescription, true, initializingWorkbench);
- } else {
- // get a CompileCommandsJsonParser configured with the workspace default
- // settings
- lsp = (CompileCommandsJsonParser) LanguageSettingsManager
- .getExtensionProviderCopy(CompileCommandsJsonParser.PROVIDER_ID, false);
- detectors = lsp.determineBuiltinDetectors(currentCfgDescription, false, initializingWorkbench);
- }
-
- if (initializingWorkbench && detectors == null) {
- // if initializing, always get the detectors
- detectors = lsp.getBuiltinDetectors(currentCfgDescription);
- }
- if (detectors != null) {
- // run each detector and gather the entries per language
- HashMap<String, Set<ICLanguageSettingEntry>> langMap = new HashMap<>(2, 1.0f);
- for (CompilerBuiltinsDetector detector : detectors) {
- final String languageId = detector.getLanguageId();
- // entries per language
- List<ICLanguageSettingEntry> entries = detector.run(isWithConsole());
- // use a Set here to avoid duplicates by name and kind ..
- Set<ICLanguageSettingEntry> allEntries = langMap.get(languageId);
- if (allEntries == null) {
- allEntries = new HashSet<>();
- langMap.put(languageId, allEntries);
- }
- allEntries.addAll(entries);
- }
- // store the entries per language
- for (Entry<String, Set<ICLanguageSettingEntry>> entry : langMap.entrySet()) {
- super.setSettingEntries(currentCfgDescription, null, entry.getKey(), Arrays
- .asList(entry.getValue().toArray(new ICLanguageSettingEntry[entry.getValue().size()])));
- }
- }
- }
- }
-
- /*-
- * interface ICBuildOutputParser
- */
- @Override
- public void startup(ICConfigurationDescription cfgDescription, IWorkingDirectoryTracker cwdTracker)
- throws CoreException {
- currentCfgDescription = cfgDescription;
- }
-
- /**
- * Invoked for each line in the build output.
- */
- // interface ICBuildOutputParser
- @Override
- public boolean processLine(String line) {
- // nothing to do
- return false;
- }
-
- /*-
- * interface ICBuildOutputParser
- */
- @Override
- public void shutdown() {
- try {
- detectBuiltins(false);
- } catch (CoreException ex) {
- log.log(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, "shutdown()", ex));
- }
- // release resources for garbage collector
- currentCfgDescription = null;
- }
-
- @Override
- public BuiltinsCompileCommandsJsonParser clone() throws CloneNotSupportedException {
- return (BuiltinsCompileCommandsJsonParser) super.clone();
- }
-
- @Override
- public BuiltinsCompileCommandsJsonParser cloneShallow() throws CloneNotSupportedException {
- return (BuiltinsCompileCommandsJsonParser) super.cloneShallow();
- }
-
- /**
- * Overridden to misuse this to populate the {@link #getSettingEntries setting
- * entries} on startup.<br>
- * {@inheritDoc}
- */
- @Override
- public void registerListener(ICConfigurationDescription cfgDescription) {
- if (cfgDescription != null) {
- // per-project or null if the user just added this provider on the provider tab
- currentCfgDescription = cfgDescription;
- try {
- detectBuiltins(true);
- } catch (CoreException ex) {
- log.log(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, "registerListener()", ex));
- }
- } else {
- // per workspace (to populate on startup)
- Display.getDefault().asyncExec(() -> {
- IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
- IProject[] projects = workspaceRoot.getProjects();
- CCorePlugin ccp = CCorePlugin.getDefault();
- // detect built-ins for any opened project that has a ScannerConfigNature...
- for (IProject project : projects) {
- try {
- if (project.isOpen() && project.hasNature(ScannerConfigNature.NATURE_ID)) {
- ICProjectDescription projectDescription = ccp.getProjectDescription(project, false);
- if (projectDescription != null) {
- ICConfigurationDescription activeConfiguration = projectDescription
- .getActiveConfiguration();
- if (activeConfiguration instanceof ILanguageSettingsProvidersKeeper) {
- final List<ILanguageSettingsProvider> lsps = ((ILanguageSettingsProvidersKeeper) activeConfiguration)
- .getLanguageSettingProviders();
- for (ILanguageSettingsProvider lsp : lsps) {
- if (PROVIDER_ID.equals(lsp.getId())) {
- currentCfgDescription = activeConfiguration;
- detectBuiltins(true);
- break;
- }
- }
- }
- }
- }
- } catch (CoreException ex) {
- log.log(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, "registerListener()", ex));
- }
- }
- });
- }
- // release resources for garbage collector
- currentCfgDescription = null;
- }
-
- /*-
- * @see org.eclipse.cdt.core.language.settings.providers.ICListenerAgent#unregisterListener()
- */
- @Override
- public void unregisterListener() {
- }
-
- /**
- * Gets whether a console in the console view should be allocated during
- * detection.
- */
- public boolean isWithConsole() {
- return getPropertyBool(ATTR_WITH_CONSOLE);
- }
-
- /**
- * Sets whether a console in the console view should be allocated during
- * detection.
- */
- public void setWithConsole(boolean enabled) {
- if (enabled) {
- setPropertyBool(ATTR_WITH_CONSOLE, enabled);
- } else {
- properties.remove(ATTR_WITH_CONSOLE);
- }
- }
-
- @Override
- public void serializeEntries(Element elementProvider) {
- // no language setting entries to serialize, since entries come from the
- // compile_commands.json file
- }
-
-}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/language/settings/providers/CompileCommandsJsonParser.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/language/settings/providers/CompileCommandsJsonParser.java
deleted file mode 100644
index aeed21bebf6..00000000000
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/language/settings/providers/CompileCommandsJsonParser.java
+++ /dev/null
@@ -1,867 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2016-2020 Martin Weber.
- *
- * Content is provided to you under the terms and conditions of the Eclipse Public License Version 2.0 "EPL".
- * A copy of the EPL is available at http://www.eclipse.org/legal/epl-2.0.
- *
- * SPDX-License-Identifier: EPL-2.0
- *******************************************************************************/
-package org.eclipse.cdt.cmake.is.core.language.settings.providers;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.Reader;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.Set;
-import java.util.WeakHashMap;
-import java.util.function.Predicate;
-import java.util.stream.Collectors;
-
-import org.eclipse.cdt.build.core.scannerconfig.ScannerConfigNature;
-import org.eclipse.cdt.cmake.is.core.DefaultToolDetectionParticipant;
-import org.eclipse.cdt.cmake.is.core.IToolCommandlineParser;
-import org.eclipse.cdt.cmake.is.core.IToolCommandlineParser.IResult;
-import org.eclipse.cdt.cmake.is.core.IToolDetectionParticipant;
-import org.eclipse.cdt.cmake.is.core.builtins.IBuiltinsDetectionBehavior;
-import org.eclipse.cdt.cmake.is.core.internal.ParserDetection;
-import org.eclipse.cdt.cmake.is.core.internal.ParserDetection.DetectorWithMethod;
-import org.eclipse.cdt.cmake.is.core.internal.ParserDetection.ParserDetectionResult;
-import org.eclipse.cdt.cmake.is.core.internal.Plugin;
-import org.eclipse.cdt.cmake.is.core.internal.StringUtil;
-import org.eclipse.cdt.cmake.is.core.internal.builtins.CompilerBuiltinsDetector;
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.index.IIndexManager;
-import org.eclipse.cdt.core.language.settings.providers.ICBuildOutputParser;
-import org.eclipse.cdt.core.language.settings.providers.ICListenerAgent;
-import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsEditableProvider;
-import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvider;
-import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvidersKeeper;
-import org.eclipse.cdt.core.language.settings.providers.IWorkingDirectoryTracker;
-import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsSerializableProvider;
-import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsStorage;
-import org.eclipse.cdt.core.model.CoreModel;
-import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
-import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
-import org.eclipse.cdt.core.settings.model.ICProjectDescription;
-import org.eclipse.cdt.core.settings.model.ICSettingEntry;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.ILog;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.swt.widgets.Display;
-import org.w3c.dom.Element;
-
-/**
- * A ILanguageSettingsProvider that parses the file 'compile_commands.json'
- * produced by cmake when option {@code -DCMAKE_EXPORT_COMPILE_COMMANDS=ON} is
- * given.<br>
- * NOTE: This class misuses interface ICBuildOutputParser to detect when a build
- * did finish.<br>
- * NOTE: This class misuses interface ICListenerAgent to populate the
- * {@link #getSettingEntries setting entries} on workbench startup.
- *
- * @author Martin Weber
- */
-/*
- * TODO delete this after integration into core build
- */
-public class CompileCommandsJsonParser extends LanguageSettingsSerializableProvider
- implements ILanguageSettingsEditableProvider, ICListenerAgent, ICBuildOutputParser, Cloneable {
- /**
- *
- */
- static final String PROVIDER_ID = "org.eclipse.cdt.cmake.is.core.language.settings.providers.CompileCommandsJsonParser";
-
- private static final ILog log = Plugin.getDefault().getLog();
-
- /**
- * default regex string used for version pattern matching.
- *
- * @see #isVersionPatternEnabled()
- */
- private static final String DEFALT_VERSION_PATTERN = "-?\\d+(\\.\\d+)*";
- /** storage key for version pattern */
- private static final String ATTR_PATTERN = "vPattern";
- /** storage key for version pattern enabled */
- private static final String ATTR_PATTERN_ENABLED = "vPatternEnabled";
-
- private static final String WORKBENCH_WILL_NOT_KNOW_ALL_MSG = "Your workbench will not know all include paths and preprocessor defines.";
-
- private static final String MARKER_ID = Plugin.PLUGIN_ID + ".CompileCommandsJsonParserMarker";
-
- /**
- * Storage to keep settings entries
- */
- private PerConfigLanguageSettingsStorage storage = new PerConfigLanguageSettingsStorage();
-
- private ICConfigurationDescription currentCfgDescription;
-
- /**
- * last known working tool detector and its tool option parsers or {@code null},
- * if unknown (to speed up parsing)
- */
- private DetectorWithMethod lastDetector;
-
- public CompileCommandsJsonParser() {
- }
-
- @Override
- public void configureProvider(String id, String name, List<String> languages, List<ICLanguageSettingEntry> entries,
- Map<String, String> properties) {
- ArrayList<String> scope = new ArrayList<>();
- scope.add("org.eclipse.cdt.core.gcc");
- scope.add("org.eclipse.cdt.core.g++");
- scope.addAll(ParserDetection.getCustomLanguages());
- super.configureProvider(id, name, scope, entries, properties);
- }
-
- /**
- * Gets whether the parser will also try to detect compiler command that have a
- * trailing version-string in their name. If enabled, this parser will also try
- * to match for example {@code gcc-4.6} or {@code gcc-4.6.exe} if none of the
- * other patterns matched.
- *
- * @return {@code true} version pattern matching in command names is enabled,
- * otherwise {@code false}
- */
- public boolean isVersionPatternEnabled() {
- return getPropertyBool(ATTR_PATTERN_ENABLED);
- }
-
- /**
- * Sets whether version pattern matching is performed.
- *
- * @see #isVersionPatternEnabled()
- */
- public void setVersionPatternEnabled(boolean enabled) {
- setPropertyBool(ATTR_PATTERN_ENABLED, enabled);
- }
-
- /**
- * Gets the regex pattern string used for version pattern matching.
- *
- * @see #isVersionPatternEnabled()
- */
- public String getVersionPattern() {
- String val = properties.get(ATTR_PATTERN);
- if (val == null || val.isEmpty()) {
- // provide a default pattern
- val = DEFALT_VERSION_PATTERN;
- }
- return val;
- }
-
- /**
- * Sets the regex pattern string used for version pattern matching.
- *
- * @see #isVersionPatternEnabled()
- */
- public void setVersionPattern(String versionPattern) {
- if (versionPattern == null || versionPattern.isEmpty() || versionPattern.equals(DEFALT_VERSION_PATTERN)) {
- // do not store default pattern
- properties.remove(ATTR_PATTERN);
- } else {
- setProperty(ATTR_PATTERN, versionPattern);
- }
- }
-
- @Override
- public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc,
- String languageId) {
- if (cfgDescription == null || rc == null) {
- // speed up, we do not provide global (workspace) lang settings..
- return null;
- }
- TimestampedLanguageSettingsStorage store = storage.getSettingsStoreForConfig(cfgDescription);
- String rcPath = null;
- if (rc.getType() == IResource.FILE) {
- rcPath = rc.getProjectRelativePath().toString();
- }
- return store.getSettingEntries(rcPath, languageId);
- }
-
- /**
- * Parses the content of the 'compile_commands.json' file corresponding to the
- * specified configuration, if timestamps differ.
- *
- * @param enabled {@code true} if this provider is present in the
- * project's list of settings providers, otherwise
- * false. If {@code false}, this method will just
- * determine the compiler-built-in processors and
- * not perform any command line parsing
- * @param initializingWorkbench {@code true} if the workbench is starting up. If
- * {@code true}, this method will not trigger UI
- * update to show newly detected include paths nor
- * will it complain if a "compile_commands.json"
- * file does not exist.
- *
- * @return {@code true} if the json file did change since the last invocation of
- * this method (new setting entires were discoverd), ohterwise
- * {@code false}
- * @throws CoreException
- */
- private boolean tryParseJson(boolean enabled, boolean initializingWorkbench) throws CoreException {
-
- // If getBuilderCWD() returns a workspace relative path, it is garbled.
- // It returns '${workspace_loc:/my-project-name}'. Additionally, it returns
- // null on a project with makeNature.
- // In contrast, getResolvedOutputDirectories() does it mostly right, it
- // returns '/my-project-name', but also stale data
- // when a user changed the build-root
- final IPath buildRoot = currentCfgDescription.getBuildSetting().getBuilderCWD();
- final IPath jsonPath = buildRoot.append("compile_commands.json");
- final IFile jsonFileRc = ResourcesPlugin.getWorkspace().getRoot().getFile(jsonPath);
-
- final IPath location = jsonFileRc.getLocation();
- if (location != null) {
- final File jsonFile = location.toFile();
- if (!jsonFile.exists()) {
- // no json file was produced in the build
- final String msg = "File '" + jsonPath + "' was not created in the build. "
- + WORKBENCH_WILL_NOT_KNOW_ALL_MSG;
- createMarker(jsonFileRc, msg);
- return false;
- }
- // file exists on disk...
- final long tsJsonModified = jsonFile.lastModified();
-
- final IProject project = currentCfgDescription.getProjectDescription().getProject();
- final TimestampedLanguageSettingsStorage store = storage.getSettingsStoreForConfig(currentCfgDescription);
-
- if (store.lastModified < tsJsonModified) {
- // must parse json file...
- store.clear();
- // store time-stamp
- store.lastModified = tsJsonModified;
-
- if (!initializingWorkbench) {
- project.deleteMarkers(MARKER_ID, false, IResource.DEPTH_INFINITE);
- }
- Reader in = null;
- try {
- // parse file...
- in = new FileReader(jsonFile);
- // TODO replace with Gson.fromJson() in the final version
- // Object parsed = new JSON().parse(new JSON.ReaderSource(in), false);
- Object parsed = new Object();
- if (parsed instanceof Object[]) {
- for (Object o : (Object[]) parsed) {
- if (o instanceof Map) {
- processJsonEntry(store, enabled, (Map<?, ?>) o, jsonFileRc);
- } else {
- // expected Map object, skipping entry.toString()
- final String msg = "File format error: unexpected entry '" + o + "'. "
- + WORKBENCH_WILL_NOT_KNOW_ALL_MSG;
- createMarker(jsonFileRc, msg);
- }
- }
- //languageScope.addAll(c)
- // re-index to reflect new paths and macros in editor views
- // serializeLanguageSettings(currentCfgDescription);
- if (!initializingWorkbench) {
- final ICElement[] tuSelection = { CoreModel.getDefault().create(project) };
- CCorePlugin.getIndexManager().update(tuSelection, IIndexManager.UPDATE_ALL);
- }
- // triggering UI update to show newly detected include paths in
- // Includes folder is USELESS. It looks like ICProject#getIncludeReferences() is
- // only
- // updated when the project is opened or the user clicks 'Apply' in the
- // Preprocessor Include Paths page.
- } else {
- // file format error
- final String msg = "File does not seem to be in JSON format. "
- + WORKBENCH_WILL_NOT_KNOW_ALL_MSG;
- createMarker(jsonFileRc, msg);
- }
- } catch (IOException ex) {
- final String msg = "Failed to read file " + jsonFile + ". " + WORKBENCH_WILL_NOT_KNOW_ALL_MSG;
- createMarker(jsonFileRc, msg);
- } finally {
- if (in != null)
- try {
- in.close();
- } catch (IOException ignore) {
- }
- }
- return true;
- }
- }
- return false;
- }
-
- /**
- * Processes an entry from a {@code compile_commands.json} file and stores a
- * {@link ICLanguageSettingEntry} for the file given the specified map.
- *
- * @param storage where to store language settings
- * @param enabled {@code true} if this provider is present in the
- * project's list of settings providers, otherwise false.
- * If {@code false}, this method will just determine the
- * compiler-built-in processors and and options but not
- * add any language settings
- * @param sourceFileInfo a Map of type Map<String,String>
- * @param jsonFile the JSON file being parsed (for marker creation only)
- * @throws CoreException if marker creation failed
- */
- private void processJsonEntry(TimestampedLanguageSettingsStorage storage, boolean enabled, Map<?, ?> sourceFileInfo,
- IFile jsonFile) throws CoreException {
-
- if (sourceFileInfo.containsKey("file") && sourceFileInfo.containsKey("command")
- && sourceFileInfo.containsKey("directory")) {
- final String file = sourceFileInfo.get("file").toString();
- if (file != null && !file.isEmpty()) {
- final String cmdLine = sourceFileInfo.get("command").toString();
- if (cmdLine != null && !cmdLine.isEmpty()) {
- final IFile[] files = ResourcesPlugin.getWorkspace().getRoot()
- .findFilesForLocationURI(new File(file).toURI());
- if (files.length > 0) {
- ParserDetection.ParserDetectionResult pdr = fastDetermineDetector(cmdLine);
- if (pdr != null) {
- // found a matching command-line parser
- final IToolCommandlineParser parser = pdr.getDetectorWithMethod()
- .getToolDetectionParticipant().getParser();
- // cwdStr is the absolute working directory of the compiler in
- // CMake-notation (fileSep are forward slashes)
- final String cwdStr = sourceFileInfo.get("directory").toString();
- IPath cwd = cwdStr != null ? Path.fromOSString(cwdStr) : new Path("");
- IResult result = processCommandLine(storage, enabled, parser, files[0], cwd,
- pdr.getReducedCommandLine());
-
- final Optional<IBuiltinsDetectionBehavior> builtinDetection = parser
- .getIBuiltinsDetectionBehavior();
- if (builtinDetection.isPresent()) {
- String languageId = parser.getLanguageId(files[0].getFileExtension());
- if (languageId != null) {
- storage.addBuiltinsDetector(currentCfgDescription, languageId,
- builtinDetection.get(), pdr.getCommandLine().getCommand(),
- result.getBuiltinDetectionArgs());
- }
- }
- } else {
- // no matching parser found
- if (!isKnownLanguage(files[0])) {
- // do not complain if source file is a fortran, assembler or other one we do not
- // care for
- return;
- }
- String message = "No parser for command '" + cmdLine + "'. "
- + WORKBENCH_WILL_NOT_KNOW_ALL_MSG;
- createMarker(jsonFile, message);
- }
- }
- return;
- }
- }
- }
- // unrecognized entry, skipping
- final String msg = "File format error: " + "'file', 'command' or 'directory' missing in JSON object. "
- + WORKBENCH_WILL_NOT_KNOW_ALL_MSG;
- createMarker(jsonFile, msg);
- }
-
- /**
- * Gets whether the specified source file name extension is one of our supported
- * languages.
- *
- * @param file The file name extension to examine
- * @return {@code false} if the language is unknown and not supported.
- */
- private static boolean isKnownLanguage(IFile file) {
- final String fileExtension = file.getFileExtension();
- if (fileExtension == null) {
- return false;
- }
- switch (fileExtension) {
- case "c":
- case "C":
- case "cc":
- case "cpp":
- case "CPP":
- case "cp":
- case "cxx":
- case "c++":
- case "cu":
- return true;
- default:
- return false;
- }
- }
-
- /**
- * Determines the detectors for compiler built-in include paths and symbols.
- * Parses the json file, if necessary and caches the findings.
- *
- * @param cfgDescription configuration description
- * @param enabled {@code true} if this provider is present in the
- * project's list of settings providers, otherwise
- * false. If {@code false}, this method will just
- * determine the compiler-built-in processors and
- * not perform any command line parsing
- * @param initializingWorkbench {@code true} if the workbench is starting up. If
- * {@code true}, this method will not trigger UI
- * update to show newly detected include paths nor
- * will it complain if a "compile_commands.json"
- * file does not exist.
- * @return the detectors to run or {@code null} if the json file did not change
- * since the last invocation of this method
- * @throws CoreException
- */
- /* package */ Iterable<CompilerBuiltinsDetector> determineBuiltinDetectors(
- ICConfigurationDescription cfgDescription, boolean enabled, boolean initializingWorkbench)
- throws CoreException {
- currentCfgDescription = Objects.requireNonNull(cfgDescription, "cfgDescription");
- if (tryParseJson(enabled, initializingWorkbench))
- return storage.getSettingsStoreForConfig(cfgDescription).getBuiltinsDetectors();
- return null;
- }
-
- /**
- * Unconditionally gets the Determined detectors for compiler built-in include
- * paths and symbols.
- *
- * @param cfgDescription configuration description
- * @return the detectors to run or {@code null} if
- * {@link #determineBuiltinDetectors} has not been invoked prior
- */
- /* package */ Iterable<CompilerBuiltinsDetector> getBuiltinDetectors(ICConfigurationDescription cfgDescription) {
- return storage.getSettingsStoreForConfig(cfgDescription).getBuiltinsDetectors();
- }
-
- private static void createMarker(IFile file, String message) throws CoreException {
- IMarker marker;
- try {
- marker = file.createMarker(MARKER_ID);
- } catch (CoreException ex) {
- // resource is not (yet) known by the workbench
- try {
- file.refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor());
- marker = file.createMarker(MARKER_ID);
- } catch (CoreException ex2) {
- // resource is not known by the workbench, use project instead of file
- marker = file.getProject().createMarker(MARKER_ID);
- }
- }
- marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO);
- marker.setAttribute(IMarker.MESSAGE, message);
- marker.setAttribute(IMarker.LOCATION, CompileCommandsJsonParser.class.getName());
- }
-
- /**
- * Determines the parser detector that can parse the specified command-line.<br>
- * Tries to be fast: That is, it tries the last known working detector first and
- * will perform expensive detection required under windows only if needed.
- *
- * @param line the command line to process
- *
- * @return {@code null} if none of the detectors matched the tool name in the
- * specified command-line string. Otherwise, if the tool name matches, a
- * {@code ParserDetectionResult} holding the de-composed command-line is
- * returned.
- */
- private ParserDetectionResult fastDetermineDetector(String line) {
- // try last known matching detector first...
- if (lastDetector != null) {
- Optional<DefaultToolDetectionParticipant.MatchResult> matchResult = Optional.empty();
- final IToolDetectionParticipant detector = lastDetector.getToolDetectionParticipant();
- switch (lastDetector.getHow()) {
- case BASENAME:
- matchResult = detector.basenameMatches(line, lastDetector.isMatchBackslash());
- break;
- case WITH_EXTENSION:
- matchResult = detector.basenameWithExtensionMatches(line, lastDetector.isMatchBackslash());
- break;
- case WITH_VERSION:
- if (isVersionPatternEnabled()) {
- matchResult = detector.basenameWithVersionMatches(line, lastDetector.isMatchBackslash(),
- getVersionPattern());
- }
- break;
- case WITH_VERSION_EXTENSION:
- if (isVersionPatternEnabled()) {
- matchResult = detector.basenameWithVersionAndExtensionMatches(line, lastDetector.isMatchBackslash(),
- getVersionPattern());
- }
- break;
- default:
- break;
- }
- if (matchResult.isPresent()) {
- return new ParserDetection.ParserDetectionResult(lastDetector, matchResult.get());
- } else {
- lastDetector = null; // invalidate last working detector
- }
- }
-
- // no working detector found, determine a new one...
- String versionPattern = isVersionPatternEnabled() ? getVersionPattern() : null;
- ParserDetection.ParserDetectionResult result = ParserDetection.determineDetector(line, versionPattern,
- File.separatorChar == '\\');
- if (result != null) {
- // cache last working detector
- lastDetector = result.getDetectorWithMethod();
- }
- return result;
- }
-
- /**
- * Processes the command-line of an entry from a {@code compile_commands.json}
- * file by trying the specified detector and stores a
- * {@link ICLanguageSettingEntry} for the file found in the specified map.
- *
- * @param storage where to store language settings
- * @param enabled {@code true} if this provider is present in the
- * project's list of settings providers, otherwise false.
- * If {@code false}, this method will just determine the
- * compiler-built-in processors and and options but not add
- * any language settings
- * @param cmdlineParser the tool detector and its tool option parsers
- * @param sourceFile the source file resource corresponding to the source
- * file being processed by the tool
- * @param cwd the current working directory of the compiler at its
- * invocation
- * @param line the command line to process
- * @return the result of command-line parsing
- */
- private IResult processCommandLine(TimestampedLanguageSettingsStorage storage, boolean enabled,
- IToolCommandlineParser cmdlineParser, IFile sourceFile, IPath cwd, String line) {
- line = StringUtil.trimLeadingWS(line);
- final IResult result = cmdlineParser.processArgs(cwd, line);
- if (enabled) {
- final List<ICLanguageSettingEntry> entries = result.getSettingEntries();
- if (entries.size() > 0) {
- String languageId = cmdlineParser.getLanguageId(sourceFile.getFileExtension());
- if (languageId != null) {
- handleIncludePathEntries(storage, entries, languageId);
- // attach settings to sourceFile resource...
- storage.addSettingEntries(sourceFile, languageId, entries);
- }
- }
- }
- return result;
- }
-
- /**
- * Handles {@code ICSettingEntry.INCLUDE_PATH} entries. These are added to the
- * project resource to make them show up in the UI in the includes folder and
- * the CommandLauncherManager is told to respect them, when the build took place
- * in a docker container.
- *
- * @param storage
- * @param entries
- * @param languageId
- */
- private void handleIncludePathEntries(TimestampedLanguageSettingsStorage storage,
- final List<ICLanguageSettingEntry> entries, final String languageId) {
- /*
- * compile_commands.json holds entries per-file only and does not contain
- * per-project or per-folder entries. For include dirs, ALSO add these entries
- * to the project resource to make them show up in the UI in the includes
- * folder...
- */
- Predicate<ICLanguageSettingEntry> isInclDir = e -> e.getKind() == ICSettingEntry.INCLUDE_PATH;
- List<ICLanguageSettingEntry> newEntries = entries.stream().filter(isInclDir).collect(Collectors.toList());
-
- List<ICLanguageSettingEntry> oldEntries = storage.getSettingEntries(null, languageId);
- // add new items only, maintain list order
- if (oldEntries != null) {
- // filter duplicates by using a Set...
- Set<ICLanguageSettingEntry> oldSet = new HashSet<>(oldEntries);
- newEntries = newEntries.stream().filter(e -> !oldSet.contains(e)).collect(Collectors.toList());
- }
- storage.addSettingEntries(null, languageId, newEntries);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.cdt.core.language.settings.providers.
- * LanguageSettingsSerializableProvider#serializeEntries(org.w3c.dom. Element)
- */
- @Override
- public void serializeEntries(Element elementProvider) {
- // no language setting entries to serialize, since entries come from the
- // compile_commands.json file
- }
-
- /*-
- * interface ICBuildOutputParser
- */
- @Override
- public void startup(ICConfigurationDescription cfgDescription, IWorkingDirectoryTracker cwdTracker)
- throws CoreException {
- currentCfgDescription = cfgDescription;
- }
-
- /**
- * Invoked for each line in the build output.
- */
- // interface ICBuildOutputParser
- @Override
- public boolean processLine(String line) {
- // nothing to do, we parse on shutdown...
- return false;
- }
-
- /*-
- * interface ICBuildOutputParser
- */
- @Override
- public void shutdown() {
- try {
- tryParseJson(true, false);
- } catch (CoreException ex) {
- log.log(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, "shutdown()", ex));
- }
- // release resources for garbage collector
- currentCfgDescription = null;
- }
-
- @Override
- public CompileCommandsJsonParser clone() throws CloneNotSupportedException {
- return (CompileCommandsJsonParser) super.clone();
- }
-
- @Override
- public CompileCommandsJsonParser cloneShallow() throws CloneNotSupportedException {
- return (CompileCommandsJsonParser) super.cloneShallow();
- }
-
- @Override
- public LanguageSettingsStorage copyStorage() {
- if (currentCfgDescription == null)
- return null;
- TimestampedLanguageSettingsStorage st = storage.getSettingsStoreForConfig(currentCfgDescription);
- return st.clone();
- }
-
- /**
- * Overridden to misuse this to populate the {@link #getSettingEntries setting
- * entries} on startup.<br>
- * {@inheritDoc}
- */
- @Override
- public void registerListener(ICConfigurationDescription cfgDescription) {
- if (cfgDescription != null) {
- // per-project or when the user just added this provider on the provider tab
- currentCfgDescription = cfgDescription;
- try {
- tryParseJson(true, true);
- } catch (CoreException ex) {
- log.log(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, "registerListener()", ex));
- }
- } else {
- // per workspace (to populate on startup)
- Display.getDefault().asyncExec(() -> {
- IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
- IProject[] projects = workspaceRoot.getProjects();
- CCorePlugin ccp = CCorePlugin.getDefault();
- // parse JSOn file for any opened project that has a ScannerConfigNature...
- for (IProject project : projects) {
- try {
- if (project.isOpen() && project.hasNature(ScannerConfigNature.NATURE_ID)) {
- ICProjectDescription projectDescription = ccp.getProjectDescription(project, false);
- if (projectDescription != null) {
- ICConfigurationDescription activeConfiguration = projectDescription
- .getActiveConfiguration();
- if (activeConfiguration instanceof ILanguageSettingsProvidersKeeper) {
- final List<ILanguageSettingsProvider> lsps = ((ILanguageSettingsProvidersKeeper) activeConfiguration)
- .getLanguageSettingProviders();
- for (ILanguageSettingsProvider lsp : lsps) {
- if (CompileCommandsJsonParser.PROVIDER_ID.equals(lsp.getId())) {
- currentCfgDescription = activeConfiguration;
- tryParseJson(true, true);
- break;
- }
- }
- }
- }
- }
- } catch (CoreException ex) {
- log.log(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, "registerListener()", ex));
- }
- }
- });
- }
- // release resources for garbage collector
- currentCfgDescription = null;
- }
-
- /*-
- * @see org.eclipse.cdt.core.language.settings.providers.ICListenerAgent#unregisterListener()
- */
- @Override
- public void unregisterListener() {
- }
-
- ////////////////////////////////////////////////////////////////////
- // inner classes
- ////////////////////////////////////////////////////////////////////
- private static class TimestampedLanguageSettingsStorage extends LanguageSettingsStorage {
- private static final boolean DEBUG = Boolean
- .parseBoolean(Platform.getDebugOption(Plugin.PLUGIN_ID + "/CECC/indexer-entries"));
- /** cached file modification time-stamp of last parse */
- long lastModified = 0;
-
- /** one CompilerBuiltinsDetector for each source file language */
- private Map<String, CompilerBuiltinsDetector> builtinDetectors;
- /** the owning project, for reporting purpose only */
- private IProject project;
-
- TimestampedLanguageSettingsStorage(IProject project) {
- this.project = project;
- }
-
- /**
- * Adds the specified language settings entries for this storages.
- *
- * @param rc resource such as file or folder or project. If {@code null}
- * the entries are considered to be being defined as
- * project-level entries for child resources.
- * @param languageId language id. Must not be {@code null}
- * @param entries language settings entries to set.
- */
- private void addSettingEntries(IResource rc, String languageId, List<ICLanguageSettingEntry> entries) {
- if (entries.size() == 0)
- return;
- if (DEBUG) {
- System.out.printf("ADDING %d entries for language %s, resource %s, ...%n", entries.size(), languageId,
- rc != null ? rc : project);
- entries.stream().sorted((o1, o2) -> o1.getName().compareTo(o2.getName()))
- .forEach(e -> System.out.printf(" %s%n", e));
- }
- // setLanguageScope(languageScope); TODO
- /*
- * compile_commands.json holds entries per-file only and does not contain
- * per-project or per-folder entries. So we map the latter as project entries
- * (=> null) to make the UI show the include directories we detected.
- */
- String rcPath = null;
- if (rc != null && rc.getType() == IResource.FILE) {
- rcPath = rc.getProjectRelativePath().toString();
- }
- List<ICLanguageSettingEntry> sentries = super.getSettingEntries(rcPath, languageId);
- if (sentries != null) {
- // make list mutable
- List<ICLanguageSettingEntry> tmp = new ArrayList<>(sentries);
- tmp.addAll(entries);
- entries = tmp;
- }
- // also tells the CommandLauncherManager (since CDT 9.4) so it can translate
- // paths from docker container
- super.setSettingEntries(rcPath, languageId, entries);
- }
-
- /**
- * @param builtinDetctionArgs the compiler arguments from the command-line that
- * affect built-in detection. For the GNU compilers,
- * these are options like {@code --sysroot} and
- * options that specify the language's standard
- * ({@code -std=c++17}.
- */
- private void addBuiltinsDetector(ICConfigurationDescription cfgDescription, String languageId,
- IBuiltinsDetectionBehavior builtinDetection, String compilerCommand, List<String> builtinDetctionArgs) {
- if (builtinDetectors == null)
- builtinDetectors = new HashMap<>(3, 1.0f);
- if (!builtinDetectors.containsKey(languageId)) {
- CompilerBuiltinsDetector detector = new CompilerBuiltinsDetector(cfgDescription, languageId,
- builtinDetection, compilerCommand, builtinDetctionArgs);
- builtinDetectors.put(languageId, detector);
- }
- }
-
- /**
- * Gets the compiler built-ins detectors.
- *
- * @return the detectors, one for each source file language
- */
- private Iterable<CompilerBuiltinsDetector> getBuiltinsDetectors() {
- return builtinDetectors == null ? Collections.emptySet()
- : Collections.unmodifiableCollection(builtinDetectors.values());
- }
-
- @Override
- public TimestampedLanguageSettingsStorage clone() {
- TimestampedLanguageSettingsStorage cloned = new TimestampedLanguageSettingsStorage(this.project);
- cloned.lastModified = this.lastModified;
- cloned.fStorage.putAll(super.fStorage);
- return cloned;
- }
-
- @Override
- public void clear() {
- synchronized (fStorage) {
- super.clear();
- lastModified = 0;
- }
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + (int) (lastModified ^ (lastModified >>> 32));
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (!super.equals(obj))
- return false;
- if (getClass() != obj.getClass())
- return false;
- TimestampedLanguageSettingsStorage other = (TimestampedLanguageSettingsStorage) obj;
- if (lastModified != other.lastModified)
- return false;
- return true;
- }
-
- } // TimestampedLanguageSettingsStorage
-
- private static class PerConfigLanguageSettingsStorage implements Cloneable {
-
- /**
- * Storage to keep settings entries. Key is
- * {@link ICConfigurationDescription#getId()}
- */
- private Map<String, TimestampedLanguageSettingsStorage> storages = new WeakHashMap<>();
-
- /**
- * Gets the settings storage for the specified configuration. Creates a new
- * settings storage, if none exists.
- *
- * @return the storage, never {@code null}
- */
- private TimestampedLanguageSettingsStorage getSettingsStoreForConfig(
- ICConfigurationDescription cfgDescription) {
- TimestampedLanguageSettingsStorage store = storages.get(cfgDescription.getId());
- if (store == null) {
- store = new TimestampedLanguageSettingsStorage(cfgDescription.getProjectDescription().getProject());
- storages.put(cfgDescription.getId(), store);
- }
- return store;
- }
-
- } // PerConfigLanguageSettingsStorage
-
-}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/messages.properties b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/messages.properties
new file mode 100644
index 00000000000..77e951652f7
--- /dev/null
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/messages.properties
@@ -0,0 +1,21 @@
+###############################################################################
+# Copyright (c) 2020 Martin Weber and others.
+#
+# This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Martin Weber - initial API and implementation
+###############################################################################
+CompileCommandsJsonParser_errmsg_file_not_found=File '%1$s' was not created in the build. %2$s
+CompileCommandsJsonParser_errmsg_no_parser_for_commandline=No parser for command '%1$s'. %2$s
+CompileCommandsJsonParser_errmsg_not_json=File '%1$s' does not seem to be in JSON format. %2$s
+CompileCommandsJsonParser_errmsg_read_error=Failed to read file '%1$s'. %2$s
+CompileCommandsJsonParser_errmsg_unexpected_json=Format error in file %1$s: 'file', 'command' or 'directory' missing in JSON object. %2$s
+CompileCommandsJsonParser_msg_detecting_builtins=Detecting compiler built-ins
+CompileCommandsJsonParser_msg_processing=Processing compile_commands.json
+CompileCommandsJsonParser_MSG_WORKBENCH_WILL_NOT_KNOW=Your workbench will not know all include paths and preprocessor defines.
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/package-info.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/package-info.java
index 9cd8170744a..305c5abd56d 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/package-info.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/package-info.java
@@ -8,7 +8,10 @@
*******************************************************************************/
/**
- * Language Setting Providers
+ * Classes and interfaces to parse a file 'compile_commands.json' produced by
+ * cmake and to generate information about preprocessor symbols and include
+ * paths of the files being compiled in order to support the CDT indexer/ syntax
+ * highlighting.
*
* @author Martin Weber
*/
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/Arglets.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/Arglets.java
index 269e76ad939..ad7fbd655b7 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/Arglets.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/Arglets.java
@@ -6,12 +6,12 @@
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
-package org.eclipse.cdt.cmake.is.core;
+package org.eclipse.cdt.cmake.is.core.participant;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.eclipse.cdt.cmake.is.core.IArglet.IArgumentCollector;
+import org.eclipse.cdt.cmake.is.core.participant.IArglet.IArgumentCollector;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
@@ -179,7 +179,7 @@ public final class Arglets {
/**
* @param isSystemIncludePath <code>true</code> if the include path is a system include path otherwise <code>false</code>
* @param cwd the current working directory of the compiler at its invocation
- * @see org.eclipse.cdt.cmake.is.core.IArglet#processArgument(IArgumentCollector,
+ * @see org.eclipse.cdt.cmake.is.core.participant.IArglet#processArgument(IArgumentCollector,
* IPath, String)
*/
protected final int processArgument(boolean isSystemIncludePath, IArgumentCollector resultCollector, IPath cwd,
@@ -351,7 +351,7 @@ public final class Arglets {
*/
public static abstract class BuiltinDetctionArgsGeneric {
/**
- * @see org.eclipse.cdt.cmake.is.core.IArglet#processArgument(IArgumentCollector,
+ * @see org.eclipse.cdt.cmake.is.core.participant.IArglet#processArgument(IArgumentCollector,
* IPath, String)
*/
protected final int processArgument(IArgumentCollector resultCollector, String argsLine,
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/DefaultToolCommandlineParser.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/DefaultToolCommandlineParser.java
index 141670d036c..d94da445a77 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/DefaultToolCommandlineParser.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/DefaultToolCommandlineParser.java
@@ -6,16 +6,16 @@
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
-package org.eclipse.cdt.cmake.is.core;
+package org.eclipse.cdt.cmake.is.core.participant;
import java.util.Arrays;
import java.util.Objects;
import java.util.Optional;
-import org.eclipse.cdt.cmake.is.core.builtins.IBuiltinsDetectionBehavior;
import org.eclipse.cdt.cmake.is.core.internal.ParseContext;
import org.eclipse.cdt.cmake.is.core.internal.Plugin;
import org.eclipse.cdt.cmake.is.core.internal.StringUtil;
+import org.eclipse.cdt.cmake.is.core.participant.builtins.IBuiltinsDetectionBehavior;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
@@ -35,13 +35,6 @@ public class DefaultToolCommandlineParser implements IToolCommandlineParser {
/**
* Constructs a new object with the given values.
- * <p>
- * NOTE: Concerning the {@code languageID} argument, please note that CDT
- * expects "org.eclipse.cdt.core.gcc" for the C language and
- * "org.eclipse.cdt.core.g++" for the C++ language. Some extension to CDT may
- * recognize different language IDs, such as
- * "com.nvidia.cuda.toolchain.language.cuda.cu"
- * </p>
*
* @param responseFileArglet the parsers for the response-file
* command-line argument for the tool or
@@ -112,12 +105,13 @@ public class DefaultToolCommandlineParser implements IToolCommandlineParser {
private class ParserHandler implements IParserHandler {
private final IPath cwd;
+ private final ParseContext result = new ParseContext();
/**
- * @param cwd the current working directory of the compiler at the time of its
- * invocation
- *
- * @throws NullPointerException if any of the arguments is {@code null}
+ * @param cwd the current working directory of the compiler at the time of its
+ * invocation
+ *
+ * @throws NullPointerException if any of the arguments is {@code null}
*/
public ParserHandler(IPath cwd) {
this.cwd = Objects.requireNonNull(cwd, "cwd"); //$NON-NLS-1$
@@ -129,7 +123,6 @@ public class DefaultToolCommandlineParser implements IToolCommandlineParser {
*/
@SuppressWarnings("nls")
private IResult parseArguments(IResponseFileArglet responseFileArglet, String args) {
- ParseContext result = new ParseContext();
// eat buildOutput string argument by argument..
while (!(args = StringUtil.trimLeadingWS(args)).isEmpty()) {
boolean argParsed = false;
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/DefaultToolDetectionParticipant.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/DefaultToolDetectionParticipant.java
index 04737187603..5e5f7f3b70a 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/DefaultToolDetectionParticipant.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/DefaultToolDetectionParticipant.java
@@ -7,7 +7,7 @@
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
-package org.eclipse.cdt.cmake.is.core;
+package org.eclipse.cdt.cmake.is.core.participant;
import java.util.Locale;
import java.util.Optional;
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IArglet.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/IArglet.java
index 02b72097d48..10a5bba8ce9 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IArglet.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/IArglet.java
@@ -6,7 +6,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
-package org.eclipse.cdt.cmake.is.core;
+package org.eclipse.cdt.cmake.is.core.participant;
import org.eclipse.core.runtime.IPath;
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IParserHandler.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/IParserHandler.java
index ac628b25e87..0a15b70d847 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IParserHandler.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/IParserHandler.java
@@ -7,7 +7,7 @@
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
-package org.eclipse.cdt.cmake.is.core;
+package org.eclipse.cdt.cmake.is.core.participant;
import org.eclipse.core.runtime.IPath;
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IRawIndexerInfo.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/IRawIndexerInfo.java
index 641d72ef8e0..c5c2d3ec516 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IRawIndexerInfo.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/IRawIndexerInfo.java
@@ -9,7 +9,7 @@
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
-package org.eclipse.cdt.cmake.is.core;
+package org.eclipse.cdt.cmake.is.core.participant;
import java.util.List;
import java.util.Map;
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IRawIndexerInfoCollector.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/IRawIndexerInfoCollector.java
index c7dae77314b..55e5e596f07 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IRawIndexerInfoCollector.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/IRawIndexerInfoCollector.java
@@ -9,7 +9,7 @@
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
-package org.eclipse.cdt.cmake.is.core;
+package org.eclipse.cdt.cmake.is.core.participant;
/**
* Gathers information about C preprocessor symbols and include paths collected
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IResponseFileArglet.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/IResponseFileArglet.java
index 6e140d25fe9..631dae76569 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IResponseFileArglet.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/IResponseFileArglet.java
@@ -7,7 +7,7 @@
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
-package org.eclipse.cdt.cmake.is.core;
+package org.eclipse.cdt.cmake.is.core.participant;
/**
* Parses a 'response file' tool argument and its content.
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IToolCommandlineParser.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/IToolCommandlineParser.java
index 32d3646e6be..6b275b1cef1 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IToolCommandlineParser.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/IToolCommandlineParser.java
@@ -6,12 +6,12 @@
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
-package org.eclipse.cdt.cmake.is.core;
+package org.eclipse.cdt.cmake.is.core.participant;
import java.util.List;
import java.util.Optional;
-import org.eclipse.cdt.cmake.is.core.builtins.IBuiltinsDetectionBehavior;
+import org.eclipse.cdt.cmake.is.core.participant.builtins.IBuiltinsDetectionBehavior;
import org.eclipse.core.runtime.IPath;
/**
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IToolDetectionParticipant.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/IToolDetectionParticipant.java
index 0779aea6c94..1a3578f9272 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/IToolDetectionParticipant.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/IToolDetectionParticipant.java
@@ -7,20 +7,27 @@
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
-package org.eclipse.cdt.cmake.is.core;
+package org.eclipse.cdt.cmake.is.core.participant;
import java.util.Optional;
/**
- * Responsible to match the first argument (the tool command) of a command-line
- * and to provide a parser for the tool-specific command-line arguments.
+ * Participates in generating {@link org.eclipse.cdt.core.parser.IScannerInfo}
+ * objects for the files being compiled in order to support the CDT indexer/
+ * syntax highlighting.<br>
+ * Generation of the {@code IScannerInfo} objects is done by analyzing a
+ * {@code compile_commands.json} file produced by cmake.
+ * <p>
+ * This interface is the expected interface for extensions provided for the
+ * {@code org.eclipse.cdt.cmake.is.core.detectionParticipant} extension point.
+ * </p>
*
* @author Martin Weber
*/
public interface IToolDetectionParticipant {
/**
- * Gets the for the parser for the tool-specific command-line arguments.
+ * Gets the parser for the tool-specific command-line arguments.
*
* @return the parser, never {@code null}
*/
@@ -37,14 +44,14 @@ public interface IToolDetectionParticipant {
/**
* Gets, whether the parser for the tool arguments can properly parse the
- * specified command-line string. If so, the remaining arguments of the
- * command-line are returned.
+ * specified command-line string.
*
* @param commandLine the command line to match
* @param matchBackslash whether to match on file system paths with backslashes
* in the compiler argument or to match an paths with
* forward slashes
- * @return An empty {@code Optional} if the matcher did not match the tool name in the
+ * @return An empty {@code Optional} if the tool/compiler handled by this object
+ * does not match the first argument (the tool name) from the
* command-line string. Otherwise, if the tool name matches, a
* MatchResult holding the de-composed command-line is returned.
*/
@@ -52,9 +59,8 @@ public interface IToolDetectionParticipant {
/**
* Gets, whether the parser for the tool arguments can properly parse the
- * specified command-line string. If so, the remaining arguments of the
- * command-line are returned. This is time-consuming, since it creates a Matcher
- * object on each invocation.
+ * specified command-line string. This may be time-consuming, since it creates a
+ * Matcher object on each invocation.
*
* @param commandLine the command-line to match
* @param matchBackslash whether to match on file system paths with backslashes
@@ -62,7 +68,8 @@ public interface IToolDetectionParticipant {
* forward slashes
* @param versionRegex a regular expression that matches the version string in
* the name of the tool to detect.
- * @return An empty {@code Optional} if the matcher did not match the tool name in the
+ * @return An empty {@code Optional} if the tool/compiler handled by this object
+ * does not match the first argument (the tool name) from the
* command-line string. Otherwise, if the tool name matches, a
* MatchResult holding the de-composed command-line is returned.
*/
@@ -70,14 +77,14 @@ public interface IToolDetectionParticipant {
/**
* Gets, whether the parser for the tool arguments can properly parse the
- * specified command-line string. If so, the remaining arguments of the
- * command-line are returned.
+ * specified command-line string.
*
* @param commandLine the command-line to match
* @param matchBackslash whether to match on file system paths with backslashes
* in the compiler argument or to match an paths with
* forward slashes
- * @return An empty {@code Optional} if the matcher did not match the tool name in the
+ * @return An empty {@code Optional} if the tool/compiler handled by this object
+ * does not match the first argument (the tool name) from the
* command-line string. Otherwise, if the tool name matches, a
* MatchResult holding the de-composed command-line is returned.
*/
@@ -85,9 +92,8 @@ public interface IToolDetectionParticipant {
/**
* Gets, whether the parser for the tool arguments can properly parse the
- * specified command-line string. If so, the remaining arguments of the
- * command-line are returned. This is time-consuming, since it creates a Matcher
- * object on each invocation.
+ * specified command-line string. This may be time-consuming, since it creates a
+ * Matcher object on each invocation.
*
* @param commandLine the command-line to match
* @param matchBackslash whether to match on file system paths with backslashes
@@ -95,7 +101,8 @@ public interface IToolDetectionParticipant {
* forward slashes
* @param versionRegex a regular expression that matches the version string in
* the name of the tool to detect.
- * @return An empty {@code Optional} if the matcher did not match the tool name in the
+ * @return An empty {@code Optional} if the tool/compiler handled by this object
+ * does not match the first argument (the tool name) from the
* command-line string. Otherwise, if the tool name matches, a
* MatchResult holding the de-composed command-line is returned.
*/
@@ -111,7 +118,7 @@ public interface IToolDetectionParticipant {
/**
* @param command the command from the command-line, without the argument
- * string. . If the command contains space characters, the
+ * string. If the command contains space characters, the
* surrounding quotes must have been removed,
* @param arguments the remaining arguments from the command-line, without the
* command
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/ParticipantTestUtil.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/ParticipantTestUtil.java
index e4b698df456..4435a549673 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/ParticipantTestUtil.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/ParticipantTestUtil.java
@@ -7,7 +7,7 @@
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
-package org.eclipse.cdt.cmake.is.core;
+package org.eclipse.cdt.cmake.is.core.participant;
import org.eclipse.cdt.cmake.is.core.internal.ParserDetection;
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/ResponseFileArglets.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/ResponseFileArglets.java
index 522eb456c3b..e71354cf0a2 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/ResponseFileArglets.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/ResponseFileArglets.java
@@ -7,14 +7,14 @@
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
-package org.eclipse.cdt.cmake.is.core;
+package org.eclipse.cdt.cmake.is.core.participant;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.regex.Matcher;
-import org.eclipse.cdt.cmake.is.core.Arglets.NameOptionMatcher;
+import org.eclipse.cdt.cmake.is.core.participant.Arglets.NameOptionMatcher;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/builtins/GccOutputProcessor.java b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/builtins/GccOutputProcessor.java
index a912187b464..d8ab0feb916 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/builtins/GccOutputProcessor.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/main/java/org/eclipse/cdt/cmake/is/core/participant/builtins/GccOutputProcessor.java
@@ -7,22 +7,23 @@
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
-package org.eclipse.cdt.cmake.is.core.builtins;
+package org.eclipse.cdt.cmake.is.core.participant.builtins;
import java.util.Optional;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.eclipse.cdt.cmake.is.core.participant.IRawIndexerInfoCollector;
import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
import org.eclipse.cdt.core.settings.model.ICSettingEntry;
import org.eclipse.cdt.core.settings.model.util.CDataUtil;
/**
- * A {link IBuiltinsOutputProcessor} for the GNU C and GNU C++ compiler.
+ * A {link IBuiltinsOutputProcessor} for the GNU C and GNU C++ compiler and derivatives.
*
* @author Martin Weber
*/
-public class GccOutputProcessor implements IBuiltinsOutputProcessor {
+public final class GccOutputProcessor implements IBuiltinsOutputProcessor {
@SuppressWarnings("nls")
private static final OutputLineProcessor[] macros = {
new OutputLineProcessor("#define\\s+(\\S+)\\s*(.*)", 1, 2, false, 0),
@@ -37,7 +38,7 @@ public class GccOutputProcessor implements IBuiltinsOutputProcessor {
new OutputLineProcessor(" *(\\S.*)", 1, -1, true, 0) };
@SuppressWarnings("nls")
- private static final OutputLineProcessor[] framewotks = {
+ private static final OutputLineProcessor[] frameworks = {
new OutputLineProcessor(" *(\\S.*)", 1, -1, true, ICSettingEntry.FRAMEWORKS_MAC) };
private State state = State.NONE;
@@ -49,7 +50,7 @@ public class GccOutputProcessor implements IBuiltinsOutputProcessor {
@SuppressWarnings("nls")
@Over