Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] Adding org.eclipse.core.resources.builders to a ScriptNature

Hi Robert,
 
PDT provides other useful extension points for extenders:
http://wiki.eclipse.org/Extending_PDT_2.2
 
Best regards,
Michael
On Mon, Mar 1, 2010 at 12:50 PM, Robert Gruendler <robert@xxxxxxxxxxx> wrote:
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



Back to the top