标签搜索

目 录CONTENT

文章目录

通过命令行方式调用eclipse进行程序构建

沙漠渔
2022-09-15 01:00:59 / 0 评论 / 3 点赞 / 808 阅读 / 2,389 字 / 正在检测是否收录...
温馨提示:
本文最后更新于 2022-11-07,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

命令说明:

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

示例:

  • 通过人工操作的话可以直接指定workspace
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过程耗时。
3
广告 广告

评论区