关于eclipse的问题扩展了工具构建器编程 [英] A question about eclipse extend tool builder programming
问题描述
我想实现一个eclipse插件来添加一个shell脚本作为项目的外部工具构建器。按下插件菜单后,eclipse配置文件.project将添加如下。而另一个配置文件.externalToolBuilders / lstest [Builder]将会生成.lawn将生成。
I'd like to implement an eclipse plugin to add an shell script as an external tool builder to a project. After the plugin menu is pressed, the eclipse configuration file .project would add as following. And another configuration file .externalToolBuilders/lstest [Builder].launch would be generated.
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value><project>/.externalToolBuilders/lstest [Builder].launch</value>
</dictionary>
</arguments>
</buildCommand>
目前,我可以使用以下代码添加到.project。但是如何生成.externalToolBuilders / lstest [Builder]?启动?非常感谢。
Currently, I could add to .project using the following code. But How could I generate .externalToolBuilders/lstest [Builder].launch ? Thank you very much.
org.eclipse.core.resources.ICommand command = pDesc.newCommand();
command.setBuilderName("org.eclipse.ui.externaltools.ExternalToolBuilder");
Map args = command.getArguments();
args.put("LaunchConfigHandle", "<project>;/.externalToolBuilders/lstest [Builder].launch");
args = conf.getAttributes();
command.setArguments(args);
org.eclipse.core.resources.ICommand command = BuilderUtils.commandFromLaunchConfig(projects[i],conf);
org.eclipse.core.resources.ICommand[] commands = pDesc.getBuildSpec();
org.eclipse.core.resources.ICommand[] nc = new ICommand[commands.length + 1];
System.arraycopy(commands, 0, nc, 1, commands.length);
nc[0] = command;
pDesc.setBuildSpec(nc);
projects[i].setDescription(pDesc, null);
推荐答案
从菜单中选择运行/外部工具/外部工具配置...,您可以定义蚂蚁赛跑者,程序跑步者。另一方面,我不知道你可以直接附加一个shell脚本,但是可以从ant调用它。
From menu press on "Run/External tools/External tools configurations..." there you can define ant runners, program runners. On the other hand I am not sure you can attach a shell script directly but to call it from ant.
这篇关于关于eclipse的问题扩展了工具构建器编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!