Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 79137 invoked from network); 23 Feb 2004 14:50:40 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 23 Feb 2004 14:50:40 -0000 Received: (qmail 86227 invoked by uid 500); 23 Feb 2004 14:50:28 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 85865 invoked by uid 500); 23 Feb 2004 14:50:25 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 85852 invoked from network); 23 Feb 2004 14:50:25 -0000 Received: from unknown (HELO omta08.mta.everyone.net) (216.200.145.37) by daedalus.apache.org with SMTP; 23 Feb 2004 14:50:25 -0000 Received: from sitemail.everyone.net (bigip1-snat [216.200.145.29]) by omta08.mta.everyone.net (Postfix) with ESMTP id 440884100A for ; Mon, 23 Feb 2004 06:50:27 -0800 (PST) Received: by sitemail.everyone.net (Postfix, from userid 99) id 2C8EF396C; Mon, 23 Feb 2004 06:50:27 -0800 (PST) Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 X-Mailer: MIME-tools 5.41 (Entity 5.404) Date: Mon, 23 Feb 2004 06:50:26 -0800 (PST) From: Pritesh saharey To: "Ant Users List" Subject: Re: Creating a java file Reply-To: pritesh@sqatester.com X-Originating-Ip: [61.11.98.89] X-Eon-Sig: AQFb+btAOhMzAAF/egEAAAAB,7becce41dbdcaca3d1cdd92f2f2ecd37 Message-Id: <20040223145027.2C8EF396C@sitemail.everyone.net> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Thank you everyone i had doen it like this =09 Pritesh Saharey BE(Mech) Software Engineer Apsora(Ind.)Pvt. Ltd., Pune http://www.apsora.com http://in.geocities.com/priteshsaharey/ --- RADEMAKERS Tanguy wrote: Tstamp Description Sets the |DSTAMP|, |TSTAMP|, and |TODAY| properties in the current=20 project. By default, the |DSTAMP| property is in the format "yyyyMMdd",=20 |TSTAMP| is in the format "hhmm", and |TODAY| is in the format "MMMM dd=20 yyyy". Use the nested element to specify a different format. These properties can be used in the build-file, for instance, to create=20 time-stamped filenames, or used to replace placeholder tags inside=20 documents to indicate, for example, the release date. The best place for=20 this task is probably in an initialization target. Parameters *Attribute* *Description* *Required* prefix Prefix used for all properties set. The default is no prefix. No Nested Elements The Tstamp task supports a || nested element that allows a=20 property to be set to the current date and time in a given format. The=20 date/time patterns are as defined in the Java SimpleDateFormat=20 = =20 class. The format element also allows offsets to be applied to the time=20 to generate different time values. *Attribute* *Description* *Required* property The property to receive the date/time string in the given=20 pattern. Yes pattern The date/time pattern to be used. The values are as defined by=20 the Java SimpleDateFormat class. Yes timezone The timezone to use for displaying time. The values are as=20 defined by the Java TimeZone=20 =20 class. No offset The numeric offset to the current time No unit The unit of the offset to be applied to the current time. Valid=20 Values are * millisecond * second * minute * hour * day * week * month * year No locale The locale used to create date/time string. The general form is=20 "language, country, variant" but either variant or variant and country=20 may be omitted. For more information please refer to documentation for=20 the Locale =20 class. No Examples sets the standard |DSTAMP|, |TSTAMP|, and |TODAY| properties according=20 to the default formats. sets the standard properties as well as the property |TODAY_UK| with the=20 date/time pattern "d-MMMM-yyyy" using English locale (eg. 21-May-2001). Creates a timestamp, in the property touch.time, 5 hours before the=20 current time. The format in this example is suitable for use with the=20 task. The standard properties are set also. Sets three properties with the standard formats, prefixed with "start.":=20 |start.DSTAMP|, |start.TSTAMP|, and |start.TODAY|. ------------------------------------------------------------------------ Copyright =C2=A9 2000-2004 The Apache Software Foundation. All rights Reser= ved. Pritesh saharey wrote: > > >Sorry to trouble all you but i am unable to print the Todays date what sho= uld i do? > > >Pritesh Saharey >BE(Mech) >Software Engineer >Apsora(Ind.)Pvt. Ltd., Pune >http://www.apsora.com >http://in.geocities.com/priteshsaharey/ > > > >--- "Craig Berry" wrote: >Just create a template VersionDate.java containing code like=20 >=20 >public class VersionDate { public static String VersionDate =3D "@date@";} > >Then run that through a filtered copy. Or, almost equivalently, use an to generate the file, as others have suggested. I'd favor the filtere= d-copy method as it avoids having source code living in your build.xml. > > > -----Original Message-----=20 > From: Pritesh saharey [mailto:pritesh@sqatester.com]=20 > Sent: Mon 2/23/2004 5:54 AM=20 > To: Ant Users List=20 > Cc:=20 > Subject: Re: Creating a java file >=09 >=09 > > OK let us go like this, i want to create a java file VersionDate.java usi= ng ant, thsi VersionDate.java file should contain code > public class VersionDate { public static String VersionDate =3D " Mon Dec= 15 17:16:45 IST 2003 ";} >=09 > and whenever ant command is run there this VersionDate.java file should b= e created with that date on which the build is beign run for example if ant= is run on Feb 23, 2004 than this date along with code should get written i= n VersionDate.java file. >=09 > are you clear or still need explanation if yes please please ask me >=09 >=09 >=09 > Pritesh Saharey > BE(Mech) > Software Engineer > Apsora(Ind.)Pvt. Ltd., Pune > http://www.apsora.com > http://in.geocities.com/priteshsaharey/ >=09 >=09 >=09 > --- RADEMAKERS Tanguy wrote: > Then see the task. >=09 > /t >=09 > Pritesh saharey wrote: >=09 > >Thanx but i wanted to create the whole VersionDate.java file and not onl= y the date to be displayed. > > > > > >Pritesh Saharey > >BE(Mech) > >Software Engineer > >Apsora(Ind.)Pvt. Ltd., Pune > >http://www.apsora.com > >http://in.geocities.com/priteshsaharey/ > > > > > > > >--- RADEMAKERS Tanguy wrote: > >Pritesh, > > > >Take a look at FilterSets in the manual, under "Concepts and Types". > > > >/t > > > > > >Pritesh saharey wrote: > > > >=20 > > > >>Hello All, > >> A very simple problem for you, i would like to create a java fil= e using ant in which i want to a code something like this > >>//---------------- > >>public class VersionDate { public static String VersionDate =3D " Mon D= ec 15 17:16:45 IST 2003 ";} > >>//---------------- > >>In this java code VersionDate=3D"" should be the date of running the bu= ild script. > >> > >>can anybody help me out. > >> > >> > >>Pritesh Saharey > >>BE(Mech) > >>Software Engineer > >>Apsora(Ind.)Pvt. Ltd., Pune > >>http://www.apsora.com > >>http://in.geocities.com/priteshsaharey/ > >> > >> > >>_____________________________________________________________ > >>Join SQAtester.com Community ---> http://www.sqatester.com/testersarea= /joinus.htm > >> > >>--------------------------------------------------------------------- > >>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > >>For additional commands, e-mail: user-help@ant.apache.org > >> > >> > >> > >> > >>=20=20=20 > >> > > > >--------------------------------------------------------------------- > >To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > >For additional commands, e-mail: user-help@ant.apache.org > > > > > > > >_____________________________________________________________ > >Join SQAtester.com Community ---> http://www.sqatester.com/testersarea/= joinus.htm > > > >--------------------------------------------------------------------- > >To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > >For additional commands, e-mail: user-help@ant.apache.org > > > > > > > >=20 > > >=09 > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org >=09 >=09 >=09 > _____________________________________________________________ > Join SQAtester.com Community ---> http://www.sqatester.com/testersarea/j= oinus.htm >=09 > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org >=09 >=09 > > > >_____________________________________________________________ >Join SQAtester.com Community ---> http://www.sqatester.com/testersarea/jo= inus.htm > >--------------------------------------------------------------------- >To unsubscribe, e-mail: user-unsubscribe@ant.apache.org >For additional commands, e-mail: user-help@ant.apache.org > > > >=20=20 > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org _____________________________________________________________ Join SQAtester.com Community ---> http://www.sqatester.com/testersarea/joi= nus.htm --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org