ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anton_Gr...@mn.man.de
Subject howto: generating buildfile from template
Date Mon, 22 Jul 2002 09:39:32 GMT

Hi all,

I would like to know what is the best way to generate
buildfiles using a template ...

In detail ...

I have a template buildfile for web-applications which
includes all the steps from exporting an app-version from
a cvs-repository to deploying it to my appserver.

Now I like to have a task in another buildfile which takes this
template an exchanges some values for my webapp,
for example

      <project name=3D"<ant.project.name>" default=3D"package" basedir=3D=
".">

   should become ...

      <project name=3D"MyWebApp" default=3D"package" basedir=3D".">

      (the string "MyWebApp" comes from a property-file)
and

  <mail
    ...
    subject=3D"${ant.mail.subject} ${ant.project.name}
${ant.project.version} ${ant.build.success}" (no change needed)
    message=3D"http://${deployment.server}:8080/<app.context>"
    ...
  />

  should become ...

  <mail
    ...
    subject=3D"${ant.mail.subject} ${ant.project.name}
${ant.project.version} ${ant.build.success}"
    message=3D"http://${deployment.server}:8080/mywebapp"
    ...
  />

  (the string <app.context> comes from  new String("MyWeb=App").toLowerCase
())


I also don't want to loose the formatting of my buildfile and keep all =
the
comments
in the resulting document.

I tried this using the style-task but had problems getting my comments
into the resulting document and further don't know how to convert a str=
ing
toLowerCase() in xslt.

Should I use another task or write my own one using jdom?

Any ideas, hints, tips to achieve this are
very much appreciated.

thanks

Toni

****************************************************
MAN Nutzfahrzeuge AG
Anton Grimm
Abt. IDP (SoftwareProduktionsumgebungen)
Dachauerstr.667
80995 M√ľnchen

Tel.:      089/1580-1054
Fax:      089/1580-911054
E-Mail: Anton_Grimm@mn.man.de
****************************************************


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message