在命令行上创建Eclipse项目? [英] Create an Eclipse project on the command line?

查看:148
本文介绍了在命令行上创建Eclipse项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个shell脚本在命令行上创建一个完整的CDT项目,并将其添加到工作区。我愿意自己生成.project和.cproject文件,但是我想要一些实际上将工程添加到工作区的东西,因为这是一个不透明的二进制文件,我宁愿不要乱与



我看过Buckminster和Monkey Project,但我不知道是否会做我想要的。任何人都有这方面的经验,知道一个好的解决方案是什么?



谢谢,



Nathan <



如果你有最近安装了CDT 6+,您可以从命令行执行项目导入(以及构建)。要执行此操作:

  eclipse -nosplash 
-application org.eclipse.cdt.managedbuilder.core.headlessbuild
-import {[uri:/] / path / to / project}
-build {project_name | all}
-cleanBuild {projec_name |全部}

导入开关本身可以使用。您需要像Eclipse一样,使用 -data 指定要导入的工作区。以上所示的交换机由CDT managedbuild插件提供,但应该与非CDT项目配合使用(如果没有,请告诉我,我写了该功能))。



有关更多信息,请参见关于无头构建的此问题其他开关的细节。


I would like to have a shell script create an entire CDT project on the command line and add it to a workspace. I'm willing to generate the .project and .cproject files myself, but I'd like something that would actually do the adding of the project to the workspace, because that is an opaque binary file that I'd rather not have to mess with.

I looked at both Buckminster and the Monkey Project, but I wasn't sure if either would do what I wanted. Anyone have any experience on this front and know what a good solution is?

Thanks,

Nathan

解决方案

What version of CDT are you using?

If you have the recent CDT 6+ installed, you can perform a project import (as well as build), from the command line. To do this:

eclipse -nosplash 
    -application org.eclipse.cdt.managedbuilder.core.headlessbuild 
    -import {[uri:/]/path/to/project} 
    -build {project_name | all} 
    -cleanBuild {projec_name | all}

The import switch can be used by itself. You'll need to specify the workspace you wish to import into with -data as normal to Eclipse. The switches illustrated above are provided by the CDT managedbuild plugin, but should work with non-CDT projects (if not, let me know -- I wrote the feature ;) ).

See this question on headless build for more details on the other switches.

这篇关于在命令行上创建Eclipse项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆