Jason van Zyl wrote:

On Wed, 2003-06-04 at 05:47, Aslak Hellesøy wrote:


Sorry if this has been brought up before, but I have an idea about how to make the reactor smarter/quicker.

I have a project with lots of subprojects that are built with reactor. I want to reduce the build time by making the reactor smarter.

Imagine I have 3 sub projects a,b and c with the following dependencies: a<-b<-c.

The 1st time I run reactor everything is built. Then I modify b and run reactor again. a doesn't depend on b and therefore shouldn't be rebuilt. The reactor should now only build b and c.

I think this can be implemented quite simply by doing some date comparisons between java sources and classes in each project.

I'm planning to implement this feature, but before I do, I'd like to hear some opinions.



Aslak,


Did you ever make any progress on this because I was going to add some
stuff to JIRA about uptodate checks in general for docs. There are some
checking utilities in CruiseControl and there is some stuff in DVSL
itself so I'm going to steal something and make a general tool.


Yes I've made some progress on this. It's a little different than my initial proposal though. It uses Ant's checksum task(+) to update version numbers (!) Here is how it works:

All versions, i.e. /project/currentVersion and /project/dependencies/dependency/version are MD5 checksums. And they are automaitcally calculated and updated by a "preprocessor" to the smart reactor, using speciaal PomTransformers. There are three steps involved in the whole process:

1) For each subproject sp, compute a checksum c for all files under ${basedir}/src. Set sp's /project/currentVersion = the value of c. (*)
2) For each subproject sp, update the /project/dependencies/dependency/version values to use the ones computed under 1) (*)
3) Run the smart reactor. It will only build projects that have a project.xml that's newer than the corresponding jar file in the local repository. Or if the jar doesn't exist.


(*) The project.xml files are only re-written if there was a change in either /project/currentVersion or /project/dependencies/dependency/version
(+) Relies on a recent Ant patch that is applied in Ant's CVS, and not yet released (will be in Ant 1.6). http://issues.apache.org/bugzilla/show_bug.cgi?id=20767


This seems to work very well and captures my requirements. We have close to 100 subprojects and we're reducing build time A LOT with this. Let me know if this sounds like a generally useful thing, and I'll wrap it up, document it and give it back to Maven.

Cheers,
Aslak



Cheers,
Aslak


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to