Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [pde-build-dev] Update on Mavenizing Eclipse Builds


Wendell,
The batch compiler itself takes the access rules embedded in the classpath.  Something like the following:
-cp A.jar[rule1;rule2;...];B.jar[rule]

A rule is an Ant pattern to specify a type, prefixed with one of: + (allowed), - (forbidden), ~ (discouraged), ? (forbidden, keep looking)

PDE.Build uses the compiler through Ant by setting the build.compiler property to org.eclipse.jdt.core.JDTCompilerAdapter and calling javac.  PDE.Build creates an argument file containing the access rules and the JDTCompilerAdapter reads this file and inserts the access rules into the classpath before invoking the compiler.

The org.eclipse.pde.maven bundle that I previously posted to this list contains a MavenGenerator.writeJDTCompilerAdapterArgFile method to create this file.  Its unclear to me whether or not the maven compiler plugin will use the adapter in the same way, if it does, then all you have to do is pass the argument file on the command line using @<file>.  Otherwise you'll need to insert the rules into the classpath yourself.

-Andrew
pde-build-dev-bounces@xxxxxxxxxxx wrote on 08/18/2006 05:46:25 PM:

> I looked at the compiler plugin and once I learned that I had to add
> the eclipse compiler as a dependency of the maven-compiler-plugin I
> got it working.  What I haven done is figure out the correct syntax
> for getting the eclipse compiler to use the access rules.  Of course
> I have only started looking at this issue.  I would prefer to reuse
> the compiler plugin if it is relatively simpler to do than code a
> new integration.  Anyone with pointers on how access rules are
> passed to the eclipse batch compiler?
>
> Wb
>

> On 8/17/06, Trygve Laugstøl <trygvis@xxxxxxxxxx> wrote:
> Wendell Beckwith wrote:
> > I have made good progress on using maven to build eclipse plugins and
> > features.  Part of the success comes from using the Apache Geronimo
> > maven-geronimodevtools-plugin that they built to build the geronimo WTP
> > server connector.  Their solution works on only part of the case but I
> > believe it can be extended to work for more general cases.  Mainly it
> > creates a target platform in the maven 2 repo to which plugins can be
> > resolved against.  Eclipse plugin dependencies are dynamincally added to
> > the maven 2 classpath to allow the normal maven-compiler-plugin to
> > compile the code.  next it is a simply matter to use the jar plugin to
> > wrap everything up in a neat little jar for deployment.
> >
> > Now this isn't the perfect solution I'm shooting for since the compile
> > stap does not enforce the access rules that the eclipse compiler would
> > use.  There is a way to configure the normal mavan-compiler-plugin to
> > use the eclipse compiler but I need to see what interface it exposes
> > that would allow me to pass the access rules to it.  If there isn't away
> > then we will need to look at either replacing the maven-compiler-plugin
> > in the default maven lifecycle or create a cloned lifecycle that
> > includes the eclipse compiler in place of the maven compiler plugin.
>
> As part-author of the Maven Compiler Plugin and the Plexus Compiler API
> I wouldn't mind adding a "osgi-complicancy" flag to the API that the
> compiler plugin can pass to the implementation. It is already possible
> to use the Eclipse compiler as the plugin's compiler implementation (but
> then as a plain javac).
>
> --
> Trygve
> _______________________________________________
> pde-build-dev mailing list
> pde-build-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/pde-build-dev

> _______________________________________________
> pde-build-dev mailing list
> pde-build-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/pde-build-dev

Back to the top