ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <>
Subject Re: Parameterized "task-function"
Date Thu, 11 Jan 2001 15:24:03 GMT
At 10:13  11/1/01 -0500, David Corbin wrote:
>I do try to limit my re-invention.  But, when the architecture is
>fatally flawed, it can't just be re-written.  Maybe my understanding of
>XSLT is the thing that's fatally flawed.  Let's return to the original
>issue.  I asked about writing parameterized tasks (with a small
>reference to includes).  You said, XSLT will handle that.  Can you show
>me how?  Does it require a second file, or is it integral to the
>build.xml file?

Usually a second file thou we could make it internal aswell I believe
without too much trouble. A possible example would be (remembering that I
also hate XSLT so may have munged the syntax):

<xsl:template match="build-jar">
  <javac srcdir="src/java/{@name}" destdir="build/{@name}"/>
  <jar jarfile="{@name}.jar" basedir="build/{@name}"/>
  <signjar jarfile="{@name}.jar" />
  <cab cabfile="{@name}.cab" basedir="build/{@name}"/>
  <signcab cabfile="{@name}.cab" />

now somewherer in your build file you would have

<target name="foo">
  <build-jar name="bean1" />
  <build-jar name="bean2" />
  <build-jar name="bean3" />

This would compile, jar, cab and sign the three beans so that they are
ready for distribution via web-browser. This is just a simple example but
it could get much more complex allowing you to do virtually everything.
Kinda like some of those make builders ;) It is complex but it brings power.



| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |

View raw message