命令说明:
eclipsec.exe -data <workspace> -application org.eclipse.cdt.managedbuilder.core.headlessbuild [ OPTIONS ]
-data {/path/to/workspace}
-remove {[uri:/]/path/to/project}
-removeAll {[uri:/]/path/to/projectTreeURI} Remove all projects under URI
-import {[uri:/]/path/to/project}
-importAll {[uri:/]/path/to/projectTreeURI} Import all projects under URI
-build {project_name_reg_ex{/config_reg_ex} | all}
-cleanBuild {project_name_reg_ex{/config_reg_ex} | all}
-markerType Marker types to fail build on {all | cdt | marker_id}
-no-indexer Disable indexer
-verbose Verbose progress monitor updates
-printErrorMarkers Print all error markers
-I {include_path} additional include_path to add to tools
-include {include_file} additional include_file to pass to tools
-D {prepoc_define} addition preprocessor defines to pass to the tools
-E {var=value} replace/add value to environment variable when running all tools
-Ea {var=value} append value to environment variable when running all tools
-Ep {var=value} prepend value to environment variable when running all tools
-Er {var} remove/unset the given environment variable
-T {toolid} {optionid=value} replace a tool option value in each configuration built
-Ta {toolid} {optionid=value} append to a tool option value in each configuration built
-Tp {toolid} {optionid=value} prepend to a tool option value in each configuration built
-Tr {toolid} {optionid=value} remove a tool option value in each configuration built
Tool option values are parsed as a string, comma separated list of strings or a boolean based on the options type
示例:
eclipsec.exe --launcher.suppressErrors -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data eclipse的工作空间(打开eclipse时候提示的或者自己指定的包含工程的工作空间) -build 工程名/工程配置(不加默认所有配置均构建)
- 通过jenkins的话 自动拉取到工作空间 可以把-data改为 ./ 后加-import 项目名 避免重复引入项目
eclipsec.exe --launcher.suppressErrors -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data ./ -import 工程名 -build 工程名/工程配置(不加默认所有配置均构建)
其他:
- 开始执行会报
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder"
可以忽略。
cleanBuild
会同时执行clean和build操作,需要避免重复build过程耗时。
评论区