简体   繁体   中英

Ant build files and targets

Reading up on ant but can't seem to find much info out there on "rules of thumb" for how to decompose your build out into multiple XML files, as opposed to one monolithic build.xml .

What should a single build file strive to accomplish? I think if I understand that it will be easier to decide how many files I need, and how to group targets inside of each.

Thanks in advance!

+1 for Ant in Action 2nd edition (covers Ant 1.7.x, Ant 1.8.2 is the present stable version)
as Ray already mentioned in his comment
See this pdf for a good presentation about ant techniques/patterns/antipatterns
Some best practices , a bit outdated, but most tips are still helpful.

Beside that check the ant manual especially for import , macrodef, presetdef , scriptdef , ant and subant task
After all avoid antcall , use macrodef instead !!

The "rule of thumb" I use is to use one file to begin with and then split when the need arises. Anything else becomes a form of big upfront design .

The main reason for splitting is when you want to share targets between projects. Just be aware that creating such splits has overheads (eg, how to make the targets available in each project, how to version the shared file, etc), which needs to be outweighed by the benefits (eg reducing the duplicate targets between projects)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM