Regards,
Alex----- Original Message -----
From: "Robert Gruendler" <
robert@xxxxxxxxxxx>
To: "DLTK Developer Discussions" <
dltk-dev@xxxxxxxxxxx>
Sent: Monday, March 1, 2010 4:50:14 PM GMT +06:00 Almaty, Novosibirsk
Subject: [Dltk-dev] Adding org.eclipse.core.resources.builders to a ScriptNature
Hi all,
my Project uses the org.eclipse.dltk.core.buildParticipant extensionpoint to
hook into the build process of php files (i'm extending PDT). This works
already fine for php resources.
However, i'd need a org.eclipse.core.resources.builders extension point too,
to parse resources other than php files.
The problem is, that the regular builder can't be found in the project properties
"Builders" page. The additional builder shows up on the "Builders" page, but
it says "Missing builder: (com.dubture.symfony2.internal.core.builder.SymfonyYamlBuilder)".
This is my plugin.xml:
<plugin>
<extension
id="com.dubture.symfony2.core.nature"
point="org.eclipse.core.resources.natures">
<runtime>
<run
class="com.dubture.symfony2.core.SymfonyNature">
</run>
</runtime>
</extension>
<extension
point="org.eclipse.dltk.core.buildParticipant">
<buildParticipant
class="com.dubture.symfony2.internal.core.builder.SymfonyBuildParticipantFactory"
id="com.dubture.symfony2.core.buildParticipant.parser"
name="Symfony 2 Parser"
nature="org.eclipse.php.core.PHPNature">
</buildParticipant>
</extension>
<extension
id="SymfonBuilder"
name="Symfony Yaml Builder"
point="org.eclipse.core.resources.builders">
<builder
callOnEmptyDelta="true"
hasNature="true">
<run
class="com.dubture.symfony2.internal.core.builder.SymfonyYamlBuilder">
</run>
</builder>
</extension>
</plugin>
The Nature extends ScriptNature, and adds the builder in the configure() method like this:
IProjectDescription desc = project.getDescription();
ICommand[] commands = desc.getBuildSpec();
for (int i = 0; i < commands.length; ++i) {
if (commands[i].getBuilderName().equals(SymfonyYamlBuilder.BUILDER_ID)) {
return;
}
}
ICommand[] newCommands = new ICommand[commands.length + 1];
System.arraycopy(commands, 0, newCommands, 0, commands.length);
ICommand command = desc.newCommand();
command.setBuilderName(SymfonyYamlBuilder.BUILDER_ID);
newCommands[newCommands.length - 1] = command;
desc.setBuildSpec(newCommands);
project.setDescription(desc, null);
Has anyone a hint why the builder can't be loaded?
thanks!
-robert
_______________________________________________ dltk-dev mailing list
dltk-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/dltk-dev