Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [pde-dev] avoiding javac call during pde build


I think the cleanest way to do this would be to implement org.apache.tools.ant.taskdefs.compilers.CompilerAdapter
This is what the jdt does so that we end up using their compiler when we call javac.  (See org.eclipse.jdt.core.JDTCompilerAdapter)

We would then just need pde/build to add a "compiler" attribute to the javac call and let you select it on a per-bundle basis.  Today we just set "build.compiler" on a global level.

(Ant javac docs: http://ant.apache.org/manual/CoreTasks/javac.html)

This way, you don't need to play any tricks with callbacks.

-Andrew




From: Andrew Eisenberg <andrew@xxxxxxxxxxxx>
To: pde-dev@xxxxxxxxxxx
Date: 02/24/2010 04:38 PM
Subject: [pde-dev] avoiding javac call during pde build
Sent by: pde-dev-bounces@xxxxxxxxxxx





Hi all,

I already posted this on the pde forum, but I didn't receive a reply,
so I am reposting here.  Apologies if this is not an appropriate place
for this question.

I am trying to work on the pde export facilities of AJDT (aspectj tool
support for Eclipse).  Currently, AJDT provides custom wizards for
exporting plugins, features, and products, as well as headless build
support.  The problem is that these wizards are essentially a copy of
pde export wizards.  And this is difficult to maintain for each new
release.

For the Helios release, I am considering a different approach for
aspectj aware pde export and pde builds.

Essentially, the requirement is that the pde build happens as normal,
except that the javac call should be replaced with a call to iajc
(with a few extra options).  I've been playing around a bit and I am
able to get this mostly working through a customBuildCallBack.xml
script and adding some ant commands to the @dot.post.compile task.  In
this task, I first delete the class files created by the javac call,
and then I call the iajc task.  There are some problems, however:

1. This feels hacky.  The code is compiled twice and the results of
the first compile is deleted.
2. The javac call will likely have some compile errors (expected
because javac cannot compile the aspects).  These errors will be
logged and can be confusing to users.
3. Source bundles will not include the *.aj files unless there is
something added to the customBuildCallBack.xml script (I think...I
haven't actually tried to fix this yet).

Note that I am having this problem with AspectJ-aware bundles, but I
know this is also a problem for Groovy-aware bundles.  And I expect
that scala-aware modules and any other Java-like language will have
the same problem.

Any ideas on a more graceful solution to the porblem?  I see:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=105631 but I don't know
how relevant that is.

thanks for your help.

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



Back to the top