ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Koegel, Michael" <Michael.Koe...@partner.commerzbank.com>
Subject AW: Antwort: AW: howto: generating buildfile from template
Date Mon, 22 Jul 2002 14:24:14 GMT
You may either use a small <script> or LoadProperties with a custom
FilterReader. ReplaceRegExp unfortunately only works on Files not
Properties. MK


-----Ursprüngliche Nachricht-----
Von: Anton_Grimm@mn.man.de [mailto:Anton_Grimm@mn.man.de]
Gesendet am: Montag, 22. Juli 2002 15:50
An: Ant Users List
Betreff: Antwort: AW: howto: generating buildfile from template


...

I am already using a properties file with lots of
entries, but I still want to change the property

      ${ant.project.name}

hmmm, seems you are right, I could switch all
dependent properties on ${ant.project.name}
to for example ${project.name}
and put this in a property file as well.

But how can I switch my project-name to lower case
characters (without asking the developer to edit the
name twice) using the property file?

regards,

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
****************************************************


 

                      "Koegel, Michael"

                      <Michael.Koegel@partner.comme        An:       Ant
Users List <ant-user@jakarta.apache.org>                            
                      rzbank.com>                          Kopie:

                                                           Thema:    AW:
howto: generating buildfile from template                           
                      22.07.2002 13:16

                      Bitte antworten an "Ant Users

                      List"

 

 





Do you really need to create a new build file or would providing a
property-file together with the generic build-file be sufficient?

Regards,
 Michael

-----Ursprüngliche Nachricht-----
Von: Anton_Grimm@mn.man.de [mailto:Anton_Grimm@mn.man.de]
Gesendet am: Montag, 22. Juli 2002 11:40
An: Ant Users List
Betreff: howto: generating buildfile from template


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>

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






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

--
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