views:

64

answers:

1

Hello,

I'm building my Eclipse plugin by means of Eclipse PDE build, i e I've defined all the required targets in "custom.xml"

But I do not want to fetch my plugins from a repository, so I'm skipping this step. However, all plugins have to be located under plugins directory, and all the features have to be located under features folder accordingly. This is actually done with map files but I've skipped the step. So, I'm copying my elements as follows:

<target name="init">

     <mkdir dir="${buildDirectory}" />
     <mkdir dir="${buildDirectory}/plugins" />
     <mkdir dir="${buildDirectory}/features" />

     <copy todir="${buildDirectory}/${type}s">
         <fileset dir="${buildDirectory}/../">
         <include name="${id}/**" />
         </fileset>
     </copy>
</target>

<target name="preGenerate">
     <antcall target="allElements">
        <param name="genericTargets" value="${builder}/customTargets.xml"/>
        <param name="target" value="init"/>
     </antcall>
</target>

That works perfect! The only thing I do not like is that in "allElements" target I have to specify the set of all plugins and features I have. And I do this only for the goal of copying. Specifying in the elements only one 'main' feature is enough for the rest of the build process.

So, my question is: how to specify only one 'main' feature without need of specifying the rest set of plugins (which are already listed within this feature) to prepare the Eclipse build process? Or, it is possible to start the build without that copying? Probably, specify map files somehow?

Thanks in advance!

A: 

Why you have allElements.xml? PDE itself creates a dummy feature project to build the stuff you ask it to. Is it an RCP app that you wish to build? If yes, you can use a product configuration to invoke the build. If not, you can create a dummy root level feature project and add everything to it, generate its build.xml and headlessly build it.

You may want to have a look at this post series (apologies for shamelessly forwarding you to my blog) .

Ankur
No, it's not RCP. allElement is a target within customTargets.xml:
Daria
<target name="allElements"> <ant antfile="${genericTargets}" target="${target}"> <property name="type" value="feature" /> <property name="id" value="SubProject-feature" /> </ant> <ant antfile="${genericTargets}" target="${target}"> <property name="type" value="feature" /> <property name="id" value="com.example_feature" /> </ant><ant antfile="${genericTargets}" target="${target}"> <property name="type" value="plugin" /> <property name="id" value="SubProject" /> </ant>... </target>
Daria
"Dummy" feature project does not help. It works for the whole build process except for the initial steps: all plugins have to be located in "plugins" folder under the build directory, all features have to be located in "features" folder. And during the development it is, of course, not so. When fetching required plugins from CVS, in map file you also have to specify all the pplugins instead of the one, "main", or "dummy" as you called it feature, which is not good.
Daria
I will have to try this out. I am bit surprised that you have to edit the allElements target. I don't think that shall be required.
Ankur