Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [egit-dev] How to build [EJ]Git?



Shawn O. Pearce wrote:
Jason van Zyl <jason@xxxxxxxxx> wrote:
Though I think creating a BND file which represents the final
manifest would be better because then you don't have the to the
JAR scanning in order to create the manifest.

I don't know.  You can pick up the MANIFEST files with

  mvn process-classes

Which yea, does require building the class files first, but that's
still pretty fast.  No JAR'ing required.

A BND file is honestly nicer to look at then
manifest.

Hmm.  They look the same to me [1].  I'm not sure there is much
benefit to the BND file, vs. just adding the instructions to the
maven-bundle-plugin like we've already done in the pom [2].

[1] http://blog.springsource.com/2008/02/18/creating-osgi-bundles/
[2] http://egit.eclipse.org/w/?p=jgit.git;a=blob;f=org.eclipse.jgit/pom.xml;h=9b1c59f2cda9035732bbdd9cf6a6ee245eab0a4d;hb=8067494103b4dc8c2136a4fa30ffb2991e72e8ed

What this will allow us to do is create a non-expensive
way to have JGit and EGit in the Eclipse workspace without having to
constantly generate the manifest in the pom-first JGit project.

Building the class files is expensive?

Eclipse does that as soon as I import the code into the workbench.

If I'm developing this project, dammit, I need the code compiled
into bytecode so I can execute its tests.

I guess I can call it expensive to run both the Maven compiler *and*
the JDT compiler on the same project during import.  But only one
is really necessary.

We
just have to settle on the approach as the JGit build the way it
is does not make it work well with PDE or Tycho. Pick your poison
we'll adjust Maven and Tycho.

In my dream world, the m2eclipse plugin would have configured the
project builder to run process-classes plugins in Maven after the
Eclipse JDT ran on that project, so post-processing can be done
correctly, no matter what the plugin was doing.

E.g. AspectJ plugins must also register on process-classes phase
in order to do their code stitching.  Under m2eclipse you might
be able to enable the Eclipse AspectJ builders... but if you don't
know about them you'd still want to fire the standard Maven plugin
so the project at least works correctly when executed.  No?

So I guess my question here is, why isn't the maven-bundle-plugin
being fired by m2eclipse?  Or is it being fired, its just firing
too late to matter to the PDE?


Unless I am mistaken, maven-build-plugin needs to scan all project
classes and dependencies to generate manifest.mf, and unlike JDT builder
it is not optimized to handle small incremental changes. But you can tell m2e to run maven-bundle-plugin after each change, if you don't mind
waiting few seconds each time you press Ctrl-S.

I think one of the reason Jason mentioned BND file, is because it can be
setup such that scanning of classes and jars is not necessary. In this
case we can have very efficient incremental build behaviour in m2e, so
manifest will always be up-to-date.

Another possibility is to teach maven-bundle-plugin/bnd to work
efficiently during incremental build, but this would be a much larger
undertaking.

--
Regards,
Igor




Back to the top