Home » Eclipse Projects » Eclipse Platform » Integrating build.xml ant-script with eclipse's build-process?
|
Re: Integrating build.xml ant-script with eclipse's build-process? [message #330609 is a reply to message #330605] |
Tue, 05 August 2008 13:26 |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
Michael Moser wrote:
> Now that I have finished my ant file to build my project, automatically
> jar it up and then sign the .jar file the last thing that remains would
> be to integrate it with eclipse such, that if I modify and save any of
> the source files that ant is automatically started to execute the script
> and to rebuild everything automagically (as eclipse's default build
> process does).
>
> Since the script also contains a clean-target, it could even support the
> Project => Clean... command.
>
> Can one somehow integrate one's user-specific build.xml files in such a
> fashion into eclipse's project (re-)build process?
See my response to your earlier question, "How to add additional steps
to a projects build?"
Generally it is easier/better to let Eclipse do its thing and then
augment that with whatever extra steps you need, rather than replacing
its entire build with your own custom script. That is because the
incremental compiler is very good, very fast, and enables a lot of the
extra Java editing and navigation features.
When I use custom Ant scripts, I just let them operate on the same build
output location that the Eclipse project is configured with, and they
assume the .class files are already built. I even have clean targets
sometimes (but I seldom invoke them); if they clean the .class files,
Eclipse will automatically re-generate them the next time a build is
invoked.
I really don't recommend you replace the Java builder entirely, but if
you want to do so, you can do it on the same Builders property page
described in my response to your earlier question:
http://bewarethepenguin.blogspot.com/2008/08/customizing-bui lds-for-your-eclipse.html
(you'd disable the Java Builder and add your own).
Hope this helps,
Eric
|
|
|
Re: Integrating build.xml ant-script with eclipse's build-process? [message #330612 is a reply to message #330609] |
Tue, 05 August 2008 15:35 |
Michael Moser Messages: 914 Registered: July 2009 |
Senior Member |
|
|
Eric Rizzo wrote:
> Michael Moser wrote:
> ...
> See my response to your earlier question, "How to add additional steps
> to a projects build?"
> Generally it is easier/better to let Eclipse do its thing and then
> augment that with whatever extra steps you need, rather than replacing
> its entire build with your own custom script. That is because the
> incremental compiler is very good, very fast, and enables a lot of the
> extra Java editing and navigation features.
>
> When I use custom Ant scripts, I just let them operate on the same
> build output location that the Eclipse project is configured with,
> and they assume the .class files are already built. I even have clean
> targets sometimes (but I seldom invoke them); if they clean the
> .class files, Eclipse will automatically re-generate them the next
> time a build is invoked.
>
> I really don't recommend you replace the Java builder entirely, but if
> you want to do so, you can do it on the same Builders property page
> described in my response to your earlier question:
> http://bewarethepenguin.blogspot.com/2008/08/customizing-bui lds-for-your-eclipse.html
> (you'd disable the Java Builder and add your own).
>
> Hope this helps,
> Eric
Yep, that's exactly what I am trying right now. Since I had already
written that build.xml in the meantime I left it as is, but am now
trying to integrate it into the build but just call the jar-generation
and the jar-signing targets, not the recompile target (i.e. I want to
leave that to the default builder).
However, I ran into this odd "Console View" problem - see my other
append.
Michael
|
|
| | |
Re: Integrating build.xml ant-script with eclipse's build-process? [message #330624 is a reply to message #330621] |
Tue, 05 August 2008 23:22 |
Eclipse User |
|
|
|
Originally posted by: zx.code9.com
Michael Moser wrote:
> I finally managed to get this going as an additional eclipse builder -
> i.e. the build.xml file target "eclipse-build" is now executed during
> manual as well as during automatic builds.
>
> However, there still is a major problem:
> I added my Ant builder as second builder (after the Java Builder). The
> target "eclipse-build" assumes, that the first builder has executed
> prior to it and has compiled all .java file to .class files. The Ant
> builder then is supposed to jar up all files and sign the jar file.
>
> But now it seems that the second builder is NOT awaiting the first
> builder's completion but tries to jar things up immediately when I
> select "Build Project" and since by then the files aren't yet compiled
> it only jars up the MANIFEST file. How is something like this supposed
> to ever work correctly?
Is there a reason you aren't using PDE Build? Are you building plug-ins
or something else?
Cheers,
~ Chris
|
|
| | |
Re: Integrating build.xml ant-script with eclipse's build-process? [message #330631 is a reply to message #330629] |
Wed, 06 August 2008 12:20 |
Ed Merks Messages: 33264 Registered: July 2009 |
Senior Member |
|
|
Michael,
I'm sure a blog about the sorry state of builds, and the underlying
causes, will be forthcoming one day. In my opinion, a good build
environment along associated good build processes are the most
fundamental thing to get right in a project, yet the folks who work on
it are all too often seen and treated as if they were second class
citizens and as if their work were less important than the "real
development work." Hence the whole task tends to repel good people
resulting in high turnover, poor quality, and an endless source of
problems. As usual, bad attitudes produce bad results. Thank goodness
for the release engineering experts we have at Eclipse. I have the good
fortune of having someone highly talented like Nick Boldt rescue me from
being personally responsible for builds, like I was in the early days of
Eclipse.
Michael Moser wrote:
> Ed Merks wrote:
>>> ...
>>> PS.: Sigh - why is everything surrounding this eclipse build process
>>> so complicated and un-intuitive (and sometimes buggy)?
>> Because builds are typically considered menial work best left to those
>> without skills to do anything better, which is of course a totally
>> stupid attitude given that builds are in fact the most important thing
>> of all because without them we'd have thing but CVS repositories with
>> bits in them.
>>> A very frustrating experience...
>> It's almost like not enough resource is being invested in making the
>> build experience a good one... :-P
>
> Ed, I can feel some frustrating experiences on your side, too, here.
> Or did I get that wrong? :-)
>
> Cheers,
> Michael
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Integrating build.xml ant-script with eclipse's build-process? [message #330632 is a reply to message #330628] |
Wed, 06 August 2008 12:25 |
Ed Merks Messages: 33264 Registered: July 2009 |
Senior Member |
|
|
Michael,
Take my comments below with a grain of salt...
Michael Moser wrote:
> Chris Aniszczyk wrote:
>>> ...
>> Is there a reason you aren't using PDE Build? Are you building
>> plug-ins or something else?
>
> I thought, PDE builds are for eclipse plugins only. I have done a
> couple of PDE projectd in the past, but that always automatically
> added tons of eclipse references, a plugin.xml etc. etc. to it.
I don't think there is much difference between a plain project and a
plugin project. The typical jarred plugin result that's produced for a
plugin project works very nicely as a jar on a normal classpath. You
don't need a plugin.xml for example.
>
> The project at hand is a Swing applet to be embedded in a webpage, so
> I don't need (and don't want!) all that plugin stuff in my current
> project.
All you need is a MANIFEST.MF and while that would include a few Eclipse
things, that's irrelevant to your non-Eclipse application.
> The only thing I need beyond a plain vanilla Java build is to pack
> things up as a .jar file at the end of the build and sign that .jar
> file (or else the browser won't execute it).
That's usually done as part of a formal build process (e.g., a full PDE
build) rather than as part of the developer's local builds.
>
> Pardon my ignorance, but can one tweak PDE builder to do just that
> (and not more)?
Even if I was developing plain old jars, I'd personally still set them
up as plugins so that I get all the nice classpath management you get
with plugins.
>
> Michael
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Integrating build.xml ant-script with eclipse's build-process? [message #330636 is a reply to message #330621] |
Wed, 06 August 2008 15:01 |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
Michael Moser wrote:
> I finally managed to get this going as an additional eclipse builder -
> i.e. the build.xml file target "eclipse-build" is now executed during
> manual as well as during automatic builds.
>
> However, there still is a major problem:
> I added my Ant builder as second builder (after the Java Builder). The
> target "eclipse-build" assumes, that the first builder has executed
> prior to it and has compiled all .java file to .class files. The Ant
> builder then is supposed to jar up all files and sign the jar file.
>
> But now it seems that the second builder is NOT awaiting the first
> builder's completion but tries to jar things up immediately when I
> select "Build Project" and since by then the files aren't yet compiled
> it only jars up the MANIFEST file. How is something like this supposed
> to ever work correctly?
That sounds like a bug. What version of Eclipse are you using?
If you can put together a simple little project with a simple little Ant
script that demonstrates this problem, you should enter a bug and attach
that project.
If you do that (please do, to help th community and improve the
product), please post the bug number/link here so the rest of us can
follow it.
Eric
> Michael
>
> PS.: Sigh - why is everything surrounding this eclipse build process so
> complicated and un-intuitive (and sometimes buggy)? A very frustrating
> experience...
Be careful with the word non-intuituve (or un-inuituve), because it is
very subjective. What is intuitive to one person is often quite the
opposite to someone else. Heck, even things that I once thought were
intuitive or non-intuitive have changed places in my own mind as time
and my experience progress.
Anyway, if you have specific suggestions for how things can be improved,
by all means enter feature requests into bugzilla and/or bring them up
here for discussion. This is open-source, and that is not limited to the
source code; ideas are open-source too :-)
Eric
|
|
|
Goto Forum:
Current Time: Fri Dec 27 13:26:27 GMT 2024
Powered by FUDForum. Page generated in 0.04419 seconds
|