What is the best solution to build several CDT C++ projects from the command line? The projects have references and so it is not possible to just build single projects.
从命令行构建多个CDT C ++项目的最佳解决方案是什么?项目有参考,因此不可能只建立单个项目。
5 个解决方案
#1
61
This feature has been added in CDT 6 (Final build due June 15th 2009). You can download the final release candidate from builds page: download.eclipse.org/tools/cdt/builds/6.0.0/.
此功能已添加到CDT 6(2009年6月15日到期的最终版本)中。您可以从构建页面下载最终候选版本:download.eclipse.org/tools/cdt/builds/6.0.0/。
Using a release of Eclipse 3.5 + CDT 6, you can import, build and clean-build projects and the workspace using the following options sent to Eclipse at the command line:
使用Eclipse 3.5 + CDT 6的发行版,您可以使用在命令行发送到Eclipse的以下选项导入,构建和清理构建项目和工作空间:
eclipse -nosplash
-application org.eclipse.cdt.managedbuilder.core.headlessbuild
-import {[uri:/]/path/to/project}
-build {project_name | all}
-cleanBuild {projec_name | all}
On Windows, use eclipsec.exe
instead of eclipse.exe
to have build output written to stdout/stderr and so that the call blocks until completion.
在Windows上,使用eclipsec.exe而不是eclipse.exe将构建输出写入stdout / stderr,以便调用阻塞直到完成。
The '-application' switch instructs Eclipse to run the CDT headless builder rather than starting the workbench. The other switches can be used individually or together. This means you can checkout a project using a shell script of your own, '-import' it into a workspace, and '-build' it using the Managedbuilder's headless builder.
'-application'开关指示Eclipse运行CDT无头构建器而不是启动工作台。其他开关可以单独使用或一起使用。这意味着您可以使用自己的shell脚本签出项目,将“-import”签入工作区,然后使用Managedbuilder的无头构建器“构建”它。
Use the '-data' switch to specify the workspace to use, which can be an empty temporary directory, see the runtime documentation for other switches supported by the platform runtime: help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html
使用'-data'开关指定要使用的工作空间,可以是空的临时目录,请参阅平台运行时支持的其他开关的运行时文档:help.eclipse.org/galileo/index.jsp?topic=/ org.eclipse.platform.doc.isv /参考/杂项/运行时间options.html
See bug 186847 comment 24 and onwards for more detail on the committed functionality.
有关已提交功能的更多详细信息,请参阅错误186847注释24及更高版本。
#2
1
Pre CDT 6 you could use the JDT's AptBuilder (included with classic Eclipse, for example).
在CDT 6之前,您可以使用JDT的AptBuilder(例如,包含在经典Eclipse中)。
This lets you build an already configured workspace. So you: checkout your source, configure a workspace which points to the checked-out projects. Your automated build scripts can then update the checkouts and run the AptBuilder without needing to start the GUI.
这使您可以构建已配置的工作区。所以你:检查你的源代码,配置一个指向签出项目的工作区。然后,您的自动构建脚本可以更新签出并运行AptBuilder,而无需启动GUI。
#3
0
If you created a Make project under CDT you can just use your favorite shell and execute make in all the projects dirs.
如果您在CDT下创建了一个Make项目,您可以使用您喜欢的shell并在所有项目目录中执行make。
#4
0
Headless build with the manage builder is currently not supported, see bug 186847 - CDT internal builder does not support automated command line builds.
目前不支持使用manage builder进行无头构建,请参阅错误186847 - CDT内部构建器不支持自动命令行构建。
If you use the unmanaged (make) builder, then you already have Makefiles that you can use from the command line.
如果您使用非托管(make)构建器,那么您已经可以从命令行使用Makefile。
#5
-1
We do this in our existing build.
我们在现有版本中执行此操作。
Put a makefile in all your external references and your toplevel project. In your "all" rule, have it run: make -C ./externalref1 make -C ./externalref2 etc
在所有外部引用和*项目中放置一个makefile。在你的“所有”规则中,让它运行:make -C ./externalref1 make -C ./externalref2等
we actually define the external dependencies in a variable: EXT_DEP = externalref1 externalref2 then use the subst (substitute) command to kick off all the sub-makes using the correct call.
我们实际上在变量中定义外部依赖项:EXT_DEP = externalref1 externalref2然后使用subst(substitute)命令使用正确的调用启动所有子项。
#1
61
This feature has been added in CDT 6 (Final build due June 15th 2009). You can download the final release candidate from builds page: download.eclipse.org/tools/cdt/builds/6.0.0/.
此功能已添加到CDT 6(2009年6月15日到期的最终版本)中。您可以从构建页面下载最终候选版本:download.eclipse.org/tools/cdt/builds/6.0.0/。
Using a release of Eclipse 3.5 + CDT 6, you can import, build and clean-build projects and the workspace using the following options sent to Eclipse at the command line:
使用Eclipse 3.5 + CDT 6的发行版,您可以使用在命令行发送到Eclipse的以下选项导入,构建和清理构建项目和工作空间:
eclipse -nosplash
-application org.eclipse.cdt.managedbuilder.core.headlessbuild
-import {[uri:/]/path/to/project}
-build {project_name | all}
-cleanBuild {projec_name | all}
On Windows, use eclipsec.exe
instead of eclipse.exe
to have build output written to stdout/stderr and so that the call blocks until completion.
在Windows上,使用eclipsec.exe而不是eclipse.exe将构建输出写入stdout / stderr,以便调用阻塞直到完成。
The '-application' switch instructs Eclipse to run the CDT headless builder rather than starting the workbench. The other switches can be used individually or together. This means you can checkout a project using a shell script of your own, '-import' it into a workspace, and '-build' it using the Managedbuilder's headless builder.
'-application'开关指示Eclipse运行CDT无头构建器而不是启动工作台。其他开关可以单独使用或一起使用。这意味着您可以使用自己的shell脚本签出项目,将“-import”签入工作区,然后使用Managedbuilder的无头构建器“构建”它。
Use the '-data' switch to specify the workspace to use, which can be an empty temporary directory, see the runtime documentation for other switches supported by the platform runtime: help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html
使用'-data'开关指定要使用的工作空间,可以是空的临时目录,请参阅平台运行时支持的其他开关的运行时文档:help.eclipse.org/galileo/index.jsp?topic=/ org.eclipse.platform.doc.isv /参考/杂项/运行时间options.html
See bug 186847 comment 24 and onwards for more detail on the committed functionality.
有关已提交功能的更多详细信息,请参阅错误186847注释24及更高版本。
#2
1
Pre CDT 6 you could use the JDT's AptBuilder (included with classic Eclipse, for example).
在CDT 6之前,您可以使用JDT的AptBuilder(例如,包含在经典Eclipse中)。
This lets you build an already configured workspace. So you: checkout your source, configure a workspace which points to the checked-out projects. Your automated build scripts can then update the checkouts and run the AptBuilder without needing to start the GUI.
这使您可以构建已配置的工作区。所以你:检查你的源代码,配置一个指向签出项目的工作区。然后,您的自动构建脚本可以更新签出并运行AptBuilder,而无需启动GUI。
#3
0
If you created a Make project under CDT you can just use your favorite shell and execute make in all the projects dirs.
如果您在CDT下创建了一个Make项目,您可以使用您喜欢的shell并在所有项目目录中执行make。
#4
0
Headless build with the manage builder is currently not supported, see bug 186847 - CDT internal builder does not support automated command line builds.
目前不支持使用manage builder进行无头构建,请参阅错误186847 - CDT内部构建器不支持自动命令行构建。
If you use the unmanaged (make) builder, then you already have Makefiles that you can use from the command line.
如果您使用非托管(make)构建器,那么您已经可以从命令行使用Makefile。
#5
-1
We do this in our existing build.
我们在现有版本中执行此操作。
Put a makefile in all your external references and your toplevel project. In your "all" rule, have it run: make -C ./externalref1 make -C ./externalref2 etc
在所有外部引用和*项目中放置一个makefile。在你的“所有”规则中,让它运行:make -C ./externalref1 make -C ./externalref2等
we actually define the external dependencies in a variable: EXT_DEP = externalref1 externalref2 then use the subst (substitute) command to kick off all the sub-makes using the correct call.
我们实际上在变量中定义外部依赖项:EXT_DEP = externalref1 externalref2然后使用subst(substitute)命令使用正确的调用启动所有子项。