logo       

Build scripts with Groovy and Ant : file dependencies: msg#00170

lang.groovy.user

Subject: Build scripts with Groovy and Ant : file dependencies

Hiall,

I'd like to add a new twist to latest discussion.

I think Groovy could substantially enhance ANT
scripting by supplying a more decent way to
"include" files.

Problem: when trying to remove duplication from
ANT builds, it is tricky to move the duplicated
code into an external file and to do "literal"
inclusions where it is used (even in ANT 1.6).
Until now the only solution that I know is to
use external xml enties. But those are rather
awkward to use. One gets no Error in case of
missing or misspelled references.

Proposal:
Groovy could have something like the
Ruby Kernel method "load" (or "require").

Usage (adapted from the unit tests):
----
ant = new AntBuilder()
load 'xdoc_path.groovy'
...
---
where xdoc_path.groovy is
---
value = ant.path {
fileset(dir:"xdocs") {
include(name:"*.wiki")
}
}
---

This would help very much with keeping the
Ant Scripts managable.

cheers
Mittie






<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise