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

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

问题描述

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

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.

我查看了 Buckminster 和 Monkey Project,但我不确定两者是否会做我想做的事.任何人都在这方面有任何经验并知道什么是好的解决方案?

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?

谢谢,

内森

推荐答案

您使用的是什么版本的 CDT?

What version of CDT are you using?

如果您安装了最新的 CDT 6+,您可以从命令行执行项目导入(以及构建).为此:

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}

导入开关可以自己使用.您需要像 Eclipse 一样使用 -data 指定要导入的工作区.上面说明的开关由 CDT 托管构建插件提供,但应该适用于非 CDT 项目(如果没有,请告诉我 - 我编写了该功能;)).

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天全站免登陆