aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Using Automated Builds with Aspects Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Using Automated Builds with Aspects" Watch "Using Automated Builds with Aspects" New topic
Author

Using Automated Builds with Aspects

Geoff Dinsdale
Greenhorn

Joined: Jun 29, 2004
Posts: 4
By using Aspect compilers, such as AspectJ, how would they impact on the automated build systems such as CruiseControl?
Mike Clark
author
Ranch Hand

Joined: Aug 15, 2003
Posts: 83
If by "impact" you mean how would CruiseControl handle a project that uses an aspect compiler such as AspectJ, then I think it's a matter of pointing the CC configuration file at an Ant target (or Maven goal) that directly or indirectly uses the aspect compiler. (I'm assuming the aspect compiler has an associated Ant task.)

In other words, CruiseControl merely delegates the build process to Ant or Maven. You can put arbitrarily complex build steps into the Ant build file, for example.

Please ping again if you meant to ask something else.

Mike


Mike Clark<br />Author of <a href="http://www.amazon.com/exec/obidos/ASIN/0974514039/ref=jranch-20" target="_blank" rel="nofollow">Pragmatic Project Automation</a>
Geoff Dinsdale
Greenhorn

Joined: Jun 29, 2004
Posts: 4
I should have read all the previous posts . So CruiseControl merely schedules when the Ant tasks are to run.

My main reason for the original question is we are adding logging information for every method in every class so as to give us a very standardised log. We don't want this to intrude on the developers so it does want to be in the main build. Therefore am I right in assuming that we get Ant to do the Aspects compilation as you suggested or should we be doing it as a prior job, i.e. not automating it?
Mike Clark
author
Ranch Hand

Joined: Aug 15, 2003
Posts: 83
If all the developers want those logging statements in their development builds, then I'd make sure that the default Ant task for building the project includes (indirectly) the build step that invokes the aspect compiler, if that's possible. For example, the default 'build' target could depend on the target that runs the aspect compiler, and then CruiseControl would simply call the 'build' target.

If the logging statements are only used in production and developers don't want their local builds burdened by an aspect compilation step, then I'd add a separate, non-default Ant target (e.g., build-production). CruiseControl would then call that target so that the continuous builds test a production-ready build.

Make sense?

Mike
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Mike Clark:
CruiseControl would then call that target so that the continuous builds test a production-ready build.


Keep in mind, though, that the purpose of a continuous build process is to give rapid feedback on wether something broke.

So, if weaving aspects into the code is something that significantly increases build time, but doesn't typically break, it might be better to *not* incorporate it into the continuous build - it would only delay feedback without adding value.

Instead, you should configure an additional nightly production build (CC can do that).


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Mike Clark
author
Ranch Hand

Joined: Aug 15, 2003
Posts: 83
Originally posted by Ilja Preuss:


Keep in mind, though, that the purpose of a continuous build process is to give rapid feedback on wether something broke.

So, if weaving aspects into the code is something that significantly increases build time, but doesn't typically break, it might be better to *not* incorporate it into the continuous build - it would only delay feedback without adding value.

Instead, you should configure an additional nightly production build (CC can do that).


Thanks for clarifying that. I failed to mention that the build that also weaved in aspects would be on a different build frequency.

Mike
Geoff Dinsdale
Greenhorn

Joined: Jun 29, 2004
Posts: 4
Thanks for the info and yes it makes perfect sense, all I need now is the book so I can put the automated build together

Funnily enough we don't need separate tasks as we all build from within eclipse, but once code is checked in we want a full build once a day in order to regression test. But the tip about different tasks was still cool.
 
 
subject: Using Automated Builds with Aspects