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>
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);
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.