views:

419

answers:

2

Hi, I am currently using PDE build in headless mode to build my OSGI Bundle project. The PDE Antrunner task uses an Eclipse installation and I am just pointing it to my local Eclipse installation.

unfortunatelly my eclipse installation is about 260MB big, but I assume that a PDE build does NOT require all of those plugins in a standard eclipse installation.

Does anyone now what is the minimum list of plugins I need for doing a headless PDE build? All of my dependencies I actually have in a custom target platform folder, so I guess the only thing I need from my eclipse installation are the dependencies which PDE build actually needs. But what are those? Can I shrink my installation to a very minimum?

My goal is to also check-in this "build-eclipse" folder into my project's SVN so that when you check it out, you have everything you need to start a full build, without touching any build.properties. But I don't want to commit 266MB of eclipse if I maybe need only 20MB of it.

Thanks Christoph

+1  A: 

I can't directly answer your question, but I can wave my hands around a little bit, some of which might help you find a real answer.

In my PDE experience I have found it very useful to distinguish:

  • The Eclipse IDE I was using for interactive editing
  • The "Eclipse" installation I was using for headless PDE builds
  • The "target platform" (set of plug-ins/features/etc. the thing I'm building depends on)

It sounds like these are clear, separate concepts in your head as well: you have already isolated the "target platform" and are looking to isolate your interactive Eclipse from your PDE builder.

You could try creating a new (blank) workspace in your interactive Eclipse (just to be sure you're looking at it, not at your target platform), opening the "Plug-ins" view, right-clicking a promising-looking plug-in like org.eclipse.pde.build, and choosing "Open Dependencies". The "Flat Layout" might be a more useful way to view the results than the hierarchical, though in my Eclipse I don't seem to be able to copy and paste this list.

In my case this didn't mention anything in the JDT which makes me think that actually trying to build a Java-based plug-in would fail, but hopefully that would provide another lead (e.g. "can't find org.eclipse.jdt", or something).

It seems like there "ought" to be a way to use the Software Updates mechanism, Target Platform, or Buckminster to just name one plug-in and have all the others fall into place. Maybe you could use the Target Platform, select the plug-in you need, hit the button to select required ones, then somehow export a "build" that would effectively just collect all those plug-ins?

I confess that we just checked in an interactive Eclipse some time ago and use it as our PDE builder. We don't use it interactively, and we do maintain a separate target platform as well. Our PDE builder is clearly not minimal, but could also perhaps stand to be, so I hope you'll update this space with your discoveries.

Woody Zenfell III
Hi Woody, thanks for your answer. You are absolutly right about the three concepts...thats exactly what I was talking about too. I basically want to get rid of the "interactive Eclipse related plugins". Your ideas sound good and I will give it a try tomorrow. I will post my findings here. I wonder if we are the only ones thinking about this problem?Thanks Christoph
Christoph
Ok here are my first findings: org.eclipse.pde.build and dependencies are not enough to make a build. The build process somehow stops without debugging output, so I first have to find out what actually happens under the hood. Do you know of any command line argument so that I can get more debugging output about the internals of the build process? (e.g. -verbose or something)If I find out what is missing I try to find the needed plugins step by step and will post it here.ThanksChristoph
Christoph
Christoph, I'm not sure . . . but when you run a command-line PDE build, somewhere along the way you are firing up an OSGi runtime, which as I understand it has something akin to an Eclipse "Workspace" where it can cache dependency information etc. and also - relevant here - place log files. Maybe you can figure out where that "workspace" is and read its log?
Woody Zenfell III
+1  A: 

I finally needed to do this myself today (to address a problem I was having where directories with spaces in their names weren't being included in the bundle PDE Build produced). I eventually got something that could build my collection of (Java-based) plug-ins. I don't know whether it's "minimal", but it's Java PDE Build-focused and much smaller than a full Eclipse IDE install.

I took rough notes; there could be a few omissions or superfluous steps here, but in the main it should guide.

I:

  1. Fired up a recent Eclipse IDE (in my case, the 3.5 instance I use at the moment).
  2. Used a scratch workspace, so changes to the target platform wouldn’t mess up my “real” projects.
  3. Made sure the target platform was set to the place I wanted to draw my PDE builder's plug-ins from (in my case, just my running Eclipse). (Window | Preferences... | Plug-in Development | Target Platform)
  4. Created a new empty project.
  5. Created a new Product Configuration within that project (using the "basic settings").
  6. On the new product configuration's "Overview" page, unchecked “The product includes native launcher artifacts.”
  7. On Dependencies, specified the following plug-ins as constituting the product:
    • org.eclipse.pde.build
    • org.apache.ant
    • org.eclipse.jdt.core
  8. Checked “Include optional dependencies . . .”
  9. Clicked “Add Required Plug-ins”.
  10. Right-clicked product definition in Package Explorer and picked “Export… | Eclipse product”.
  11. Told it where I wanted my PDE builder instance to go.
  12. Unchecked “Synchronize before exporting”.
  13. Unchecked “Generate metadata repository”.
  14. Clicked "Finish".

Now I can (continue to) launch a PDE Build from my normal Ant build by invoking a macro like the following (is there a better way?):

<macrodef name="build-a-product">
    <attribute name="config-dir"/>
    <sequential>
        <property name="product-build-file" value="${pde-builder-path}\plugins\org.eclipse.pde.build_3.5.2.R35x_20100114\scripts\productBuild\productBuild.xml" />
        <java jar="${pde-builder-path}\plugins\org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar" fork="yes" failonerror="yes" >
            <arg value="-application" />
            <arg value="org.eclipse.ant.core.antRunner" />

            <arg value="-buildfile" />
            <arg value="${product-build-file}" />

            <arg value="-Dbuilder=@{config-dir}" />

            <arg value="-Dbasedir=${basedir}" />
        </java>
    </sequential>
</macrodef>
Woody Zenfell III
Hi Woody, that is great news. I didn't have enough time recently to continue to digg into this issue. But mayby I'll find some time, so that I can verify your findings. What is the actual size in MB to which you could decrease your build eclipse installation?
Christoph
In my case, the result was a little less than 20 MB. That still seems kind of large for what it is -- maybe I shouldn't have included those optional dependencies -- but this works for me.
Woody Zenfell III