build automation - Avoiding re-building prerequisites in Ant -


I have an existing ant project and want to speed up the build process by rescinding the building components that already date.

The ant allows you to specify that one goal depends on another, but by default, each predefined item is always recreated, even if it is already up-to-date. (This is an important difference between ant and make. By default, if necessary, only create one goal again - that is, if some is prerequisite.)

  & lt; Uptodate property = "mytarget.uptodate" & gt; // set.mytarget.uptodate in action ... & lt; / Uptodate & gt; & Lt ;! - Anything else is checked before "unless" is checked. - & gt; & Lt; Goal name = "mytarget" depends = "set.mytarget.uptodate" until no = "mytarget.uptodate" & gt; ... & lt; / Target & gt;  

To make the need for the re-creation of the ant, there are two general perspectives within the ant.

The first method is to set up a property by uptodate after that, your work can test the property and can only be established when the property ) Be set.

  & lt; Uptodate property = "mytarget.uptodate" & gt; // set.mytarget.uptodate in action ... & lt; / Uptodate & gt; & Lt ;! - Anything else is checked before "unless" is checked. - & gt; & Lt; Goal name = "mytarget" depends = "set.mytarget.uptodate" until no = "mytarget.uptodate" & gt; ... & lt; / Target & gt;  

An alternate first method is to use the outfodet work from Ent Broadcast. It is good that this is being set to target only without a separate asset; On the contrary, different goals are required to set up the output and to test the asset.

The other way & lt; Fileset & gt; and lt; Modified & gt; / Code> Selector calculates MD5 hashes for this files and selects those files whose MD5 is different from the first stored values. It is optional to set

  & paramount = "cache.cachefile" value = "cache.properties" /> Inside the selector  

; This is the default for "cache.properties." Here's an example that changes all the files from the source, whose content has changed:

  & lt; Copy todir = "dest" & gt; & Lt; Fileset dir = "src" & gt; & Lt; Modified /> & Lt; / Fileset & gt; & Lt; / Copy & gt; None of these is very satisfying, because it requires me to write an entry code for a process (to avoid rebuilding) that should be automatically.  

Ivy is also there, but I can not tell from its documentation whether this facility has been provided. In case of main use in the Ivy documentation, stopping parts of the same project and downloading subprofed from the internet instead of avoiding wasteful work. Maven provides similar functionality, in its documentation highlighting it in its documentation. (Maven is known as a nightmare to the existing non-trienna project, on the contrary, starting greenfield development with Maven is more tasty.)

Is there a better way?

This feature is a feature of of a large build that I Initally aNT . Instead of using target dependence, I suggest splitting your large project into smaller modules, each publication in a shared shared stock.

Ivy can be used to control component versions, which is the main module project.

  & lt; IV-Module Version = "2.0" & gt; & Lt; Info organization = "com.myspotontheweb" module = "multidimensional_product" /> & Lt; Publications & gt; & Lt; Artificact name = "main" type = "jar" /> & Lt; / Publication & gt; & Lt; Dependency & gt; & Lt; Dependency org = "com.myspotontheweb" name = "component1" rev = "latest.integration" /> & Lt; Dependency org = "com.myspotontheweb" name = "component 2" rev = "latest.integration" /> & Lt; Dependency org = "com.myspotontheweb" name = "component 3" rev = "latest.integration" /> & Lt; Dependency org = "com.myspotontheweb" name = "component 4" rev = "latest.integration" /> & Lt; / Dependencies & gt; & Lt; / Module from Vertical & gt;  

IV: Retrieve will only download / copy a sub-module if they have changed (published from their build files)

All this seems to be more complicated, but perhaps you are already subdividing the project into your creation file .... For example, if your ANt uptodate works a Construction is dependent on artifacts.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -