Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTorbjörn SVENSSON2021-02-26 14:22:50 -0500
committerTorbjörn Svensson2021-03-01 02:40:52 -0500
commit1404e46d70b1f8603bc46586ea5f9950d17b41bc (patch)
treebc4af99493b0938153e3c587f1cbc621ebf5f3e4 /build/org.eclipse.cdt.managedbuilder.core
parent61510747dc2f8a3efe131c48948e40d23539025a (diff)
downloadorg.eclipse.cdt-1404e46d70b1f8603bc46586ea5f9950d17b41bc.tar.gz
org.eclipse.cdt-1404e46d70b1f8603bc46586ea5f9950d17b41bc.tar.xz
org.eclipse.cdt-1404e46d70b1f8603bc46586ea5f9950d17b41bc.zip
Bug 571566: Document how to choose workspace for headless build
Moved handling of "-help" to a new plugin using the same approach as was used for the JavaCodeFormatter in bug 543363. This mainly allows to get the help text even if the workspace is missing. Contributed by STMicroelectronics Change-Id: I4ee2e93f0e8fed13ddebd70c3bce58f047aa1d12 Also-by: Jonah Graham <jonah@kichwacoders.com> Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@st.com>
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.core')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/plugin.properties1
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/plugin.xml13
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuildMessages.java20
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuildMessages.properties20
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilder.java25
6 files changed, 4 insertions, 77 deletions
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 08430a8e1ab..e9161200b95 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF
+++ b/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF
@@ -14,7 +14,7 @@ Export-Package: org.eclipse.cdt.build.core.scannerconfig,
org.eclipse.cdt.managedbuilder.core,
org.eclipse.cdt.managedbuilder.envvar,
org.eclipse.cdt.managedbuilder.internal.buildmodel;x-friends:="org.eclipse.cdt.managedbuilder.ui",
- org.eclipse.cdt.managedbuilder.internal.core;x-friends:="org.eclipse.cdt.managedbuilder.ui",
+ org.eclipse.cdt.managedbuilder.internal.core;x-friends:="org.eclipse.cdt.managedbuilder.ui,org.eclipse.cdt.managedbuilder.headlessbuilderapp",
org.eclipse.cdt.managedbuilder.internal.dataprovider;x-internal:=true,
org.eclipse.cdt.managedbuilder.internal.envvar;x-internal:=true,
org.eclipse.cdt.managedbuilder.internal.language.settings.providers;x-friends:="org.eclipse.cdt.managedbuilder.ui",
diff --git a/build/org.eclipse.cdt.managedbuilder.core/plugin.properties b/build/org.eclipse.cdt.managedbuilder.core/plugin.properties
index 4c0da312928..05c1695ec50 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/plugin.properties
+++ b/build/org.eclipse.cdt.managedbuilder.core/plugin.properties
@@ -73,7 +73,6 @@ option.name.5 = Undefined Include Paths
option.name.6 = Undefined Symbols
option.name.7 = Undefined Symbol Files
option.name.8 = Undefined Include Files
-extension.name.7 = CDT Headless Build
extension-point.name = Managed Build Tools 2.0 (Deprecated)
extension-point.name.0 = Managed Build Definitions
extension-point.name.1 = Managed Build Project Converter
diff --git a/build/org.eclipse.cdt.managedbuilder.core/plugin.xml b/build/org.eclipse.cdt.managedbuilder.core/plugin.xml
index a9ebd32a791..2d94d704647 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/plugin.xml
+++ b/build/org.eclipse.cdt.managedbuilder.core/plugin.xml
@@ -592,19 +592,6 @@
</processType>
</extension>
<extension
- id="headlessbuild"
- name="%extension.name.7"
- point="org.eclipse.core.runtime.applications">
- <application
- cardinality="singleton-global"
- thread="main"
- visible="true">
- <run
- class="org.eclipse.cdt.managedbuilder.internal.core.HeadlessBuilder">
- </run>
- </application>
- </extension>
- <extension
point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider
class="org.eclipse.cdt.managedbuilder.internal.language.settings.providers.MBSLanguageSettingsProvider"
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuildMessages.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuildMessages.java
index a1e9bfecd75..d3a634dda7a 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuildMessages.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuildMessages.java
@@ -28,15 +28,8 @@ public class HeadlessBuildMessages extends NLS {
public static String HeadlessBuilder_CouldntLockWorkspace;
public static String HeadlessBuilder_Directory;
public static String HeadlessBuilder_encountered_errors;
- public static String HeadlessBuilder_EnvVar_Append;
- public static String HeadlessBuilder_EnvVar_Prepend;
- public static String HeadlessBuilder_EnvVar_Remove;
- public static String HeadlessBuilder_EnvVar_Replace;
public static String HeadlessBuilder_Error;
public static String HeadlessBuilder_help_requested;
- public static String HeadlessBuilder_importAll;
- public static String HeadlessBuilder_IncludeFile;
- public static String HeadlessBuilder_InlucdePath;
public static String HeadlessBuilder_invalid_argument;
public static String HeadlessBuilder_is_not_accessible;
public static String HeadlessBuilder_is_not_valid_in_workspace;
@@ -50,22 +43,9 @@ public class HeadlessBuildMessages extends NLS {
public static String HeadlessBuilder_RegExSyntaxError;
public static String HeadlessBuilder_Skipping;
public static String HeadlessBuilder_Skipping2;
- public static String HeadlessBuilder_ToolOption_Replace;
- public static String HeadlessBuilder_ToolOption_Append;
- public static String HeadlessBuilder_ToolOption_Prepend;
- public static String HeadlessBuilder_ToolOption_Remove;
- public static String HeadlessBuilder_ToolOption_Types;
public static String HeadlessBuilder_unknown_argument;
public static String HeadlessBuilder_URI;
- public static String HeadlessBuilder_usage;
- public static String HeadlessBuilder_usage_build;
- public static String HeadlessBuilder_usage_clean_build;
public static String HeadlessBuilder_invalid_uri;
- public static String HeadlessBuilder_PreprocessorDefine;
- public static String HeadlessBuilder_usage_import;
- public static String HeadlessBuilder_usage_marker_type;
- public static String HeadlessBuilder_usage_no_indexer;
- public static String HeadlessBuilder_usage_print_all_error_markers;
public static String HeadlessBuilder_Workspace;
public static String HeadlessBuilder_WorkspaceInUse;
static {
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuildMessages.properties b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuildMessages.properties
index a37862a7581..a883c3c089f 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuildMessages.properties
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuildMessages.properties
@@ -23,10 +23,6 @@ HeadlessBuilder_completed_successfully=Headless build completed successfully
HeadlessBuilder_CouldntLockWorkspace=Could not obtain lock for workspace location
HeadlessBuilder_Directory=Directory:\u0020
HeadlessBuilder_encountered_errors=Headless build encountered errors
-HeadlessBuilder_EnvVar_Append=\ \ \ -Ea {var=value} append value to environment variable when running all tools
-HeadlessBuilder_EnvVar_Prepend=\ \ \ -Ep {var=value} prepend value to environment variable when running all tools
-HeadlessBuilder_EnvVar_Remove=\ \ \ -Er {var} remove/unset the given environment variable
-HeadlessBuilder_EnvVar_Replace=\ \ \ -E {var=value} replace/add value to environment variable when running all tools
HeadlessBuilder_Error=Error:\u0020
HeadlessBuilder_help_requested=Help Requested
HeadlessBuilder_invalid_argument=Invalid Arguments:\u0020
@@ -43,23 +39,7 @@ HeadlessBuilder_Skipping=Skipping "
HeadlessBuilder_Skipping2=". Skipping...
HeadlessBuilder_unknown_argument=Unknown argument:\u0020
HeadlessBuilder_URI=URI:\u0020
-HeadlessBuilder_usage=Usage:\u0020
-HeadlessBuilder_usage_build=\ \ \ -build {project_name_reg_ex{/config_reg_ex} | all}
-HeadlessBuilder_usage_clean_build=\ \ \ -cleanBuild {project_name_reg_ex{/config_reg_ex} | all}
-HeadlessBuilder_usage_import=\ \ \ -import {[uri:/]/path/to/project}
-HeadlessBuilder_usage_marker_type=\ \ \ -markerType Marker types to fail build on {all | cdt | marker_id}
-HeadlessBuilder_usage_no_indexer=\ \ \ -no-indexer Disable indexer
-HeadlessBuilder_usage_print_all_error_markers=\ \ \ -printErrorMarkers Print all error markers
-HeadlessBuilder_importAll=\ \ \ -importAll {[uri:/]/path/to/projectTreeURI} Import all projects under URI
-HeadlessBuilder_IncludeFile=\ \ \ -include {include_file} additional include_file to pass to tools
-HeadlessBuilder_InlucdePath=\ \ \ -I {include_path} additional include_path to add to tools
HeadlessBuilder_invalid_uri=Invalid project URI:
HeadlessBuilder_MustSpecifyWorkspace=Must specify a location for the workspace. Restart with the '-data' switch.
-HeadlessBuilder_PreprocessorDefine=\ \ \ -D {prepoc_define} addition preprocessor defines to pass to the tools
-HeadlessBuilder_ToolOption_Replace=\ \ \ -T {toolid} {optionid=value} replace a tool option value in each configuration built
-HeadlessBuilder_ToolOption_Append=\ \ \ -Ta {toolid} {optionid=value} append to a tool option value in each configuration built
-HeadlessBuilder_ToolOption_Prepend=\ \ \ -Tp {toolid} {optionid=value} prepend to a tool option value in each configuration built
-HeadlessBuilder_ToolOption_Remove=\ \ \ -Tr {toolid} {optionid=value} remove a tool option value in each configuration built
-HeadlessBuilder_ToolOption_Types=\ \ \ Tool option values are parsed as a string, comma separated list of strings or a boolean based on the option's type\u0020
HeadlessBuilder_Workspace=Workspace\u0020
HeadlessBuilder_WorkspaceInUse=Workspace already in use\!
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilder.java
index 894480437dc..143b0e6a1d1 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/HeadlessBuilder.java
@@ -174,6 +174,8 @@ public class HeadlessBuilder implements IApplication {
public static final Integer ERROR = 1;
/** OK return status */
public static final Integer OK = IApplication.EXIT_OK;
+ /** Show usage return status */
+ public static final Integer SHOW_USAGE = 2;
/** Set of project URIs / paths to import */
protected final Set<String> projectsToImport = new HashSet<>();
@@ -452,7 +454,7 @@ public class HeadlessBuilder implements IApplication {
// Handle user provided arguments
if (!getArguments((String[]) context.getArguments().get(IApplicationContext.APPLICATION_ARGS)))
- return ERROR;
+ return SHOW_USAGE;
if (markerTypesDefault || markerTypesAll) {
markerTypes.clear();
@@ -731,29 +733,8 @@ public class HeadlessBuilder implements IApplication {
}
}
} catch (Exception e) {
- // Print usage
System.err.println(HeadlessBuildMessages.HeadlessBuilder_invalid_argument + Arrays.toString(args));
System.err.println(HeadlessBuildMessages.HeadlessBuilder_Error + e.getMessage());
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_usage);
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_usage_import);
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_importAll);
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_usage_build);
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_usage_clean_build);
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_usage_no_indexer);
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_usage_marker_type);
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_usage_print_all_error_markers);
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_InlucdePath);
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_IncludeFile);
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_PreprocessorDefine);
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_EnvVar_Replace);
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_EnvVar_Append);
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_EnvVar_Prepend);
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_EnvVar_Remove);
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_ToolOption_Replace);
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_ToolOption_Append);
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_ToolOption_Prepend);
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_ToolOption_Remove);
- System.err.println(HeadlessBuildMessages.HeadlessBuilder_ToolOption_Types);
return false;
}

Back to the top