ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "S I" <>
Subject RE: AINASL! Help with Parsing Files with Ant
Date Thu, 21 Apr 2005 00:46:35 GMT
Sorry, got pulled away all the day on a broken build.

Thank you for your help. That worked. :)

I have one more question please.  I got all the parts to work, however 
crued! Now I'm working on the date piece

I now modified my file as follows:

<?xml version="1.0"?>

<project name="NextBuldNum" default="buildnum" basedir=".">

<property name="" value="date" />
<property name="sys.time" value="time" />

I AM LOST HERE NOW: The exec line by itself works but how do I get the 
result of the date.exe back into here? With Args?

<target name="timedate">
<exec executable="C:/cygwin/bin/date.exe `+%a %D %r`" />
<arg line="/c dir"/>


<target name="buildnum">

<buildnumber file="mybuild.number"/>


<echo file="verstamp1.txt" append="false">[Version]</echo>
<echo file="verstamp1.txt" append="true">${line.separator}</echo>

<echo file="verstamp1.txt" append="true">Version=5.0</echo>
<echo file="verstamp1.txt" append="true">${line.separator}</echo>

<echo file="verstamp1.txt" append="true">Build=${build.number}</echo>
<echo file="verstamp1.txt" append="true">${line.separator}</echo>

<echo file="verstamp1.txt" append="true">Date=${date}</echo>


-----------expected output---------
<!-- [Version] -->
<!-- Version=n.nn -->  Dictated by marketing; a constant for now
<!-- Build=nnn -->
<!-- Date=Wed 04/13/05 05:08:30 PM -->

----Original Message Follows----
From: "Dominique Devienne" <>
Reply-To: "Ant Users List" <>
To: "Ant Users List" <>
Subject: RE: AINASL! Help with Parsing Files with Ant
Date: Wed, 20 Apr 2005 13:08:13 -0500
MIME-Version: 1.0
Received: from ([]) by 
with Microsoft SMTPSVC(6.0.3790.211); Wed, 20 Apr 2005 11:08:39 -0700
Received: (qmail 58830 invoked by uid 500); 20 Apr 2005 18:08:35 -0000
Received: (qmail 58397 invoked by uid 99); 20 Apr 2005 18:08:33 -0000
Received: pass ( local policy)
Received: from (HELO (  by (qpsmtpd/0.28) with ESMTP; Wed, 20 Apr 2005 11:08:32 -0700
Received: from ( 
[])by (8.11.7/8.11.3) with SMTP id 
j3KI8Qu20166for <>; Wed, 20 Apr 2005 13:08:26 -0500 (CDT)
Received: from by (InterScan E-Mail 
VirusWall NT); Wed, 20 Apr 2005 13:08:19 -0500
Received: from (houexch903 [])by (8.11.7/8.11.3) with ESMTP id j3KI8LN20152for 
<>; Wed, 20 Apr 2005 13:08:21 -0500 (CDT)
Received: from ([]) by with Microsoft SMTPSVC(6.0.3790.211); Wed, 20 
Apr 2005 13:08:14 -0500
X-Message-Info: JGTYoYF78jHBtJd27ft/tzMmo9mYeb8JdSZo9zWlKF4=
Mailing-List: contact; run by ezmlm
Precedence: bulk
List-Unsubscribe: <>
List-Subscribe: <>
List-Help: <>
List-Post: <>
List-Id: "Ant Users List" <>
Delivered-To: mailing list
X-ASF-Spam-Status: No, hits=0.0 required=10.0tests=
X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0
Content-class: urn:content-classes:message
Thread-Topic: AINASL! Help with Parsing Files with Ant
Thread-Index: AcVF0e6MBN2rEjHOT7G1nFYix5tUlAAASDYQ
X-OriginalArrivalTime: 20 Apr 2005 18:08:14.0991 (UTC) 
X-Virus-Checked: Checked

 > This is how my file should look like at anytime or rather build+1
 > ---------- content of target file [version.txt] --------------
 > [Version]
 > Version=5.0
 > Build=555
 > Date=Wed 04/13/05 05:08:30 PM
 > -------------------------------------------------------

Your problem is that this is not a .properties file, which have
a very specific format and semantic. If you maintained 2 files,
one a real property file with the same info, and another in your
desired format, you should be able to do what you want.

- CVS update both files, and version.txt
- Manipulate with <propertyfile>.
- Load the properties (with <property file="">) from the
- Simply <echo> your update version.txt file

   <echo file="version.txt">

You may have to prefix properties when re-loading them,
since Ant properties are immutable.

There are other ways to do this with regular expressions
and the tasks that use them, but I think the dual file
approach above is the simplest, and closest to what you tried.


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message