# ant-user mailing list archives

##### Site index · List index
Message view
Top
From "Lopez, William" <william.lo...@eds.com>
Subject RE: ant-contrib-trycatch
Date Tue, 05 Aug 2003 18:59:56 GMT
```...saw this example in "Java Development with Ant"...don't quote me...not
sure if it captures the output to a file...not sure if this works
:-)...maybe some Ant guru will correct what I miss.

<property name="error.file" location="\${somewhere}\error.file.txt"/>
...
<catch>
<echo message="build error" file="\${error.file}"/>
</catch>

...do an <available> on the file if you need to do something in case of
error

-----Original Message-----
From: Vikas Phonsa [mailto:VPhonsa@suz.com]
Sent: Tuesday, August 05, 2003 1:00 PM
To: 'Ant Users List'
Subject: RE: ant-contrib-trycatch

David,
I tried to do what u suggested, it aborts the build but also gives out
hundreds of line of error code. My whole purpose is to avoid that stack
trace. Vikas

-----Original Message-----
From: Harkness, David [mailto:DHarkness@sonypictures.com]
Sent: Tuesday, August 05, 2003 10:30 AM
To: Ant Users List
Subject: RE: ant-contrib-trycatch

Set a property in the <catch> block and then after </try> do a <fail
if="property.name" message="CVS failed"/>.

David Harkness
Sony Pictures Digital Networks
(310) 482-4756

-----Original Message-----
From: Vikas Phonsa [mailto:VPhonsa@suz.com]
Sent: Tuesday, August 05, 2003 10:21 AM
To: 'Ant Users List'
Subject: ant-contrib-trycatch

Hi,
How do u abort a build. I am using ant-contrib try catch and if the task in
the try fails then the next task in the target should not be executed.

<trycatch property="foo" reference="bar">
<try>
<fail>The CVS Import Failed</fail>
<cvs cvsroot="\${cvsRoot}" passfile="\${pass.file}" failonerror="true">
<commandline>
<argument value="import"/>
<argument value="-m"/>
<argument value="\${Manifest-Version}"/>
</commandline>
</cvs>
</try>

<catch>
<echo>\${foo}</echo>
</catch>
</trycatch>

<manifest file="\${manifest.file}">
<attribute name="Built-By" value="\${user.name}"/>
</manifest>

The manifest task should not be execute if the cvs task fails in the above
target.

Vikas

-----Original Message-----
From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de]
Sent: Tuesday, August 05, 2003 9:54 AM
To: user@ant.apache.org
Subject: RE: ant-contrib

You can get the binaries there, too.
And its readme sais nothing about compiling that (ok: its compiled with Ant
1.5.2)

Jan

> -----Original Message-----
> From: Vikas Phonsa [mailto:VPhonsa@suz.com]
> Sent: Tuesday, August 05, 2003 6:52 PM
> To: 'Ant Users List'
> Subject: RE: ant-contrib
>
>
> I got it from
> http://sourceforge.net/project/showfiles.php?group_id=36177
>
> Vikas
>
> -----Original Message-----
> From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de]
> Sent: Tuesday, August 05, 2003 9:49 AM
> To: user@ant.apache.org
> Subject: RE: ant-contrib
>
> Where have you downloaded ant-contrib? If you have the source distro
> you have to
> build that.
>
> Ant-Contrib:
>   Homepage:   http://sourceforge.net/projects/ant-contrib/
>   CVS-Source:
> http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ant-contrib/ant
> -contrib/src/n
> et/sf/antcontrib/
>   CVS-Manual:
> http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ant-contrib/ant
> -contrib/manua
> l/index.html
>
> http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/ant-
> contrib/ant-co
>   Binary:     http://gump.covalent.net/jars/latest/ant-contrib/
>
>
>
> Jan
>
> > -----Original Message-----
> > From: Vikas Phonsa [mailto:VPhonsa@suz.com]
> > Sent: Tuesday, August 05, 2003 6:46 PM
> > To: 'Ant Users List'
> > Subject: RE: ant-contrib
> >
> >
> > Hey Jan,
> > I just downloaded the ant-contib 0.4 and in the installation
> > instructions that come with it,I found the following lines:
> >
> > /***
> > Then you need the Ant-Contrib tasks themselves. As there is no
> > release of these tasks yet, you have to build them from sources.
> > Fortunately this is
> > easy, check out the sources (grab the ant-contrib module from
> > CVS), change
> > into the source directory of ant-contrib and type ant. After Ant has
> > completed, you'll find ant-contrib-0.1.jar in the lib subdirectory.
> > **/
> >
> > I get an antcontib.jar with the download, would simply copying that
> > to my classpath and using
> > not sufficient.
> >
> > What is the meaning of the above lines ?
> >
> > Thanks
> >
> > Vikas
> >
> >
> > -----Original Message-----
> > From: Jan.Materne@rzf.fin-nrw.de
> [mailto:Jan.Materne@rzf.fin-nrw.de]
> > Sent: Tuesday, August 05, 2003 9:37 AM
> > To: user@ant.apache.org
> > Subject: RE: ant-contrib
> >
> > You should keep the files as they are.
> > So you can change them independently.
> >
> > But you can write an "installer" for that.
> > - copy the jar to \${env.ANT_HOME}/lib
> > - modify the IDE files (e.g. with xmltask by oopsconsult)
> >
> >
> > Jan
> >
> > > -----Original Message-----
> > > From: Vikas Phonsa [mailto:VPhonsa@suz.com]
> > > Sent: Tuesday, August 05, 2003 6:34 PM
> > > To: 'Ant Users List'
> > > Subject: RE: ant-contrib
> > >
> > >
> > > Well I was thinking of doing so I have already told other
> > > programmers to upgrade to Ant 1.5.3 and then copy cvs.exe and
> > > modify path
> > environment
> > > variables and several other steps too. I was wondering if I could
> > > package the new task in original ant jars in order to avoid
> > > telling them to do an
> > > extra step of updating the IDE classpath. Some people start
> > > rolling their
> > > eyes you know :-)
> > >
> > > But whatever,they gotta do what's necessary.
> > >
> > > Thanks for your help though.
> > >
> > > Vikas
> > >
> > > -----Original Message-----
> > > From: Jan.Materne@rzf.fin-nrw.de
> > [mailto:Jan.Materne@rzf.fin-nrw.de]
> > > Sent: Tuesday, August 05, 2003 9:26 AM
> > > To: user@ant.apache.org
> > > Subject: RE: ant-contrib
> > >
> > > You CAN recreate the archive. For use (without <taskdef>ing
> > > that) you have
> > > to
> > > edit the .../taskdefs/default.properties in ant.jar.
> > >
> > > But WHY you do you want that?
> > >
> > >
> > > Jan
> > >
> > > > -----Original Message-----
> > > > From: Vikas Phonsa [mailto:VPhonsa@suz.com]
> > > > Sent: Tuesday, August 05, 2003 6:22 PM
> > > > To: 'Ant Users List'
> > > > Subject: ant-contrib
> > > >
> > > >
> > > > Can I select classes for one particular task from ant-contrib
> > > > jar and add those to ant.jar to be able to use that particular
> > > > task. Aim is not  having
> > > > to add an additional jar to the IDE classpath.I need to
> > just use the
> > > > try/catch task from ant-contrib.
> > > >
> > > > This might be a silly idea. But any thoughts abt it??
> > > >
> > > > Vikas
> > > >
> > > > -----Original Message-----
> > > > From: Tim Davidson [mailto:tim.davidson@greenhatconsulting.com]
> > > > Sent: Tuesday, August 05, 2003 7:18 AM
> > > > To: Ant Users List
> > > > Subject: RE: Versioning / Manifest
> > > >
> > > > yeah, thanks, I got this working:
> > > >
> > > > 		<!-- Create the JAR file -->
> > > > 		<jar destfile="\${temp.lib}\\${project.jarFile}"
> > > > 		     basedir="\${temp.build}">
> > > > 		    <manifest>
> > > > 		    	<attribute name="Built-By"
value="\${company.name}"/>
> > > > 		    	<attribute name="Version"
> > > > value="\${FILE_TSTAMP}"/>
> > > > 		    </manifest>
> > > > 		</jar>
> > > >
> > > > -----Original Message-----
> > > > From: Claudio Corsi [mailto:ccorsi@progress.com]
> > > > Sent: Tuesday, August 05, 2003 3:17 PM
> > > > To: Ant Users List
> > > > Subject: Re: Versioning / Manifest
> > > >
> > > >
> > > > Tim Davidson wrote:
> > > > > I have a related question.
> > > > > Its it possible to create the manifest for a jar on the
> > > fly somehow?
> > > > > The reason is to add a timestamp inside the JAR for
> versioning?
> > > > > something like:
> > > > > 		<jar destfile="foo.jar"
> > > > > 		     basedir="bar">
> > > > > 			<manifest version="\${TIMESTAMP}"/>
> > > > > 		</jar>
> > > >
> > > > Use the manifest task to create your manifest on the fly.
> > > >
> > > > You will need to create an attribute that will contain the
> > > > timstamp, for instance you can call this attribute "TimeStamp".
> > > >
> > > > To get this information from a running java application you
> > > > would need to use the Manifest class returned from the JarFile
> > > > class. This is all
> > > > part of the java.util.jar package.
> > > >
> > > > >
> > > > > -----Original Message-----
> > > > > From: Rebhan, Gilbert [mailto:Gilbert.Rebhan@huk-coburg.de]
> > > > > Sent: Tuesday, August 05, 2003 11:21 AM
> > > > > To: ant_user (E-Mail)
> > > > > Subject: Versioning / Manifest
> > > > >
> > > > >
> > > > >
> > > > > Hi,
> > > > >
> > > > > Scenario :
> > > > >
> > > > > A Client/Server Application is distributed as a bunch
> of Jar's.
> > > > > Client and Server have an XML-File that contains the
> > > > versioninfo for these
> > > > Jar's.
> > > > > The Jar's of a new release are transfered to the server,
> > > > the xml-File is
> > > > > manually created.
> > > > >
> > > > > Question 1 : How to automate the creation of that xml-File ?
> > > > >
> > > > > After starting the client, the client-xml is compared to
> > > > the server-xml.
> > > > > The new Jar's are then transfered to the client.
> > > > >
> > > > > Question 2 : Is there a chance to transfer only the
> > > > class-Files
> > > > > 	       instead of the whole Jar as bandwidth is
> > limited ?
> > > > >
> > > > > I guess there's a way via the Manifest. If versioning is
> > > > possible with the
> > > >
> > > > > Manifest itself maybe we don't need that xml-file anymore ?
> > > > >
> > > > > Best practices ?
> > > > >
> > > > > thx for any advice !!
> > > > >
> > > > > bye4now,
> > > > >         Gilbert
> > > > >
> > > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For
> > > > > additional commands, e-mail: user-help@ant.apache.org
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For
> > > > > additional commands, e-mail: user-help@ant.apache.org
> > > > >
> > > >
> > > >
> > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For
> > > > additional commands, e-mail: user-help@ant.apache.org
> > > >
> > > >
> > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For
> > > > additional commands, e-mail: user-help@ant.apache.org
> > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For
> > > > additional commands, e-mail: user-help@ant.apache.org
> > > >
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For
> > > additional commands, e-mail: user-help@ant.apache.org
> > >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org