You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Joe St. Germain" <js...@metrocast.net> on 2001/09/25 00:06:21 UTC

stopping an

Does anyone know how to stop the processing of an <exec>.
My <exec> kicks off a <javac> in another build.xml file.  If
<javac> reports errors, I'd like the calling exec to stop execution
and anything passed that exec to also stop.  If you haven't already
guest, I've got a build.xml that controls the execution of other
XML files via the <exec> task.  I tried the failonerror flag on both
tasks, but it dosen't work.  I don't believe that javac returns
anything, and that may be the reason.
 
 
-Joe

Re: stopping an

Posted by "Joe St. Germain" <js...@metrocast.net>.
Ok,

I'll give it a try.  I didn't know I could do this.
I now see that the ANT task says you can do
this( "used to build subprojects" ).

So I'll try the following in my main XML file:
<target name="A">
    <ant antfile="${buildfile.dir}/${mybuildfile}" target="build">
</target>
<target name="B" depends="A">
    <ant antfile="${buildfile.dir}/${mybuildfile}" target="build">
</target>
<target name="C" depends="B">
    <ant antfile="${buildfile.dir}/${mybuildfile}" target="build">
</target>

or maybe

<target>
    <ant antfile="${buildfile.dir}/${mybuildfile}" target="build">
    <ant antfile="${buildfile.dir}/${mybuildfile}" target="build">
    <ant antfile="${buildfile.dir}/${mybuildfile}" target="build">
</target>


Thanks again T Master,
-Joe


----- Original Message -----
From: "T Master" <tm...@iknowledgeinc.com>
To: <an...@jakarta.apache.org>
Sent: Monday, September 24, 2001 7:38 PM
Subject: Re: stopping an <exec>


> Joe,
>
> I do the same interface, having a main build file to kick off the
individual
> build files.
>
> Use the code I sent you before in each target.
>
> Don't use exec!!!!
>
> Look in the manual too.
>
>
> ----- Original Message -----
> From: "Joe St. Germain" <js...@metrocast.net>
> To: <an...@jakarta.apache.org>
> Sent: Monday, September 24, 2001 5:30 PM
> Subject: Re: stopping an <exec>
>
>
> > Hi T Master,
> >
> > I'm new to "ANT".  I've only been using it for about 3 days.
> > I've got all of my individual XML files done, but was thinking
> > I could create a main XML file to kicj off all of the other XML
> > files.  A sort of controller XML file.  I thought I'd use the <exec>
> > task within a <target> task for each XML file I wanted to run,
> > and that worls fine.  The probelm is thast if 1 of the <exec>'d XML
> > files has a compile( javac ) error, I'd like processing of the main
> > XMLfile to stop.  I can't find a way to make the stop happen.
> > I haven't tried using <ant> tasks within a <target> task, but will
> > give it a try.  I'll let you know what happens, unless you can tell
> > me that provessing will not stop this way either.
> >
> >
> > Thanks for answering my post T Master,
> > -Joe
> >
> >
> >
> > ----- Original Message -----
> > From: "T Master" <tm...@iknowledgeinc.com>
> > To: <an...@jakarta.apache.org>
> > Sent: Monday, September 24, 2001 6:19 PM
> > Subject: Re: stopping an <exec>
> >
> >
> > > Why are you using <exec> to call other buildfiles?
> > > use <ant>:
> > >         <ant antfile="${buildfile.dir}/${mybuildfile}" target="build">
> > >
> > > Unless of course, this is the way you want....
> > >
> > >
> > >
> > > ----- Original Message -----
> > > From: "Joe St. Germain" <js...@metrocast.net>
> > > To: <an...@jakarta.apache.org>
> > > Sent: Monday, September 24, 2001 4:06 PM
> > > Subject: stopping an <exec>
> > >
> > >
> > > Does anyone know how to stop the processing of an <exec>.
> > > My <exec> kicks off a <javac> in another build.xml file.  If
> > > <javac> reports errors, I'd like the calling exec to stop execution
> > > and anything passed that exec to also stop.  If you haven't already
> > > guest, I've got a build.xml that controls the execution of other
> > > XML files via the <exec> task.  I tried the failonerror flag on both
> > > tasks, but it dosen't work.  I don't believe that javac returns
> > > anything, and that may be the reason.
> > >
> > >
> > > -Joe
> > >
> > >
> > >
> >
>
>


Re: stopping an

Posted by T Master <tm...@iknowledgeinc.com>.
Joe,

I do the same interface, having a main build file to kick off the individual
build files.

Use the code I sent you before in each target.

Don't use exec!!!!

Look in the manual too.


----- Original Message -----
From: "Joe St. Germain" <js...@metrocast.net>
To: <an...@jakarta.apache.org>
Sent: Monday, September 24, 2001 5:30 PM
Subject: Re: stopping an <exec>


> Hi T Master,
>
> I'm new to "ANT".  I've only been using it for about 3 days.
> I've got all of my individual XML files done, but was thinking
> I could create a main XML file to kicj off all of the other XML
> files.  A sort of controller XML file.  I thought I'd use the <exec>
> task within a <target> task for each XML file I wanted to run,
> and that worls fine.  The probelm is thast if 1 of the <exec>'d XML
> files has a compile( javac ) error, I'd like processing of the main
> XMLfile to stop.  I can't find a way to make the stop happen.
> I haven't tried using <ant> tasks within a <target> task, but will
> give it a try.  I'll let you know what happens, unless you can tell
> me that provessing will not stop this way either.
>
>
> Thanks for answering my post T Master,
> -Joe
>
>
>
> ----- Original Message -----
> From: "T Master" <tm...@iknowledgeinc.com>
> To: <an...@jakarta.apache.org>
> Sent: Monday, September 24, 2001 6:19 PM
> Subject: Re: stopping an <exec>
>
>
> > Why are you using <exec> to call other buildfiles?
> > use <ant>:
> >         <ant antfile="${buildfile.dir}/${mybuildfile}" target="build">
> >
> > Unless of course, this is the way you want....
> >
> >
> >
> > ----- Original Message -----
> > From: "Joe St. Germain" <js...@metrocast.net>
> > To: <an...@jakarta.apache.org>
> > Sent: Monday, September 24, 2001 4:06 PM
> > Subject: stopping an <exec>
> >
> >
> > Does anyone know how to stop the processing of an <exec>.
> > My <exec> kicks off a <javac> in another build.xml file.  If
> > <javac> reports errors, I'd like the calling exec to stop execution
> > and anything passed that exec to also stop.  If you haven't already
> > guest, I've got a build.xml that controls the execution of other
> > XML files via the <exec> task.  I tried the failonerror flag on both
> > tasks, but it dosen't work.  I don't believe that javac returns
> > anything, and that may be the reason.
> >
> >
> > -Joe
> >
> >
> >
>


Re: stopping an

Posted by "Joe St. Germain" <js...@metrocast.net>.
Ah yes.  I'm new to ANT and didn't know I could do this until
yesterday.  I totally missed that in the documetation.  I'll give
that a try today.

Thanks Hakan,
-Joe


----- Original Message -----
From: "Hakan Koseoglu" <ha...@datafit.co.uk>
To: <an...@jakarta.apache.org>
Sent: Tuesday, September 25, 2001 4:54 AM
Subject: Re: stopping an <exec>


> On Tuesday 25 September 2001 12:30 am, you wrote:
> > I'm new to "ANT".  I've only been using it for about 3 days.
> > I've got all of my individual XML files done, but was thinking
> > I could create a main XML file to kicj off all of the other XML
> > files.  A sort of controller XML file.  I thought I'd use the <exec>
>
> I use the (default) build.xml for this purpose.
> The way you call other xml files is like this:
>
>   <target name="javadoc">
>     <ant antfile="make/thisone.xml" target="javadoc"/>
>   </target>
>
> So this will call ant to build the thisone.xml, with the specific target
of
> javadoc. If this fails, the whole build will fail. So I believe what you
want
> is this.
>
> --
> Hakan Koseoglu
>
> PCMS Datafit Ltd.
> 3 Avro Court
> Ermine Business Park
> Huntingdon
> Cambs PE29 6XS
>
> Tel: +44-1480-435456
> Fax: +44-1480-434012
> ________________________________________________
>
> The information contained in this e-mail is intended only for the person
> or entity to which it is addressed and may contain confidential and/or
> privileged material. If you are not the intended recipient of this
> e-mail, the use of this information or any disclosure, copying or
> distribution is prohibited and may be unlawful.
>
> If you received this in error, please contact the sender and delete the
> material from any computer.
>
> The views expressed in this e-mail may not necessarily be the views of
> The PCMS Group plc and should not be taken as authority to carry out any
> instruction contained.
>
>
>


Re: stopping an

Posted by Hakan Koseoglu <ha...@datafit.co.uk>.
On Tuesday 25 September 2001 12:30 am, you wrote:
> I'm new to "ANT".  I've only been using it for about 3 days.
> I've got all of my individual XML files done, but was thinking
> I could create a main XML file to kicj off all of the other XML
> files.  A sort of controller XML file.  I thought I'd use the <exec>

I use the (default) build.xml for this purpose. 
The way you call other xml files is like this:

  <target name="javadoc">
    <ant antfile="make/thisone.xml" target="javadoc"/>
  </target>

So this will call ant to build the thisone.xml, with the specific target of 
javadoc. If this fails, the whole build will fail. So I believe what you want 
is this.

-- 
Hakan Koseoglu

PCMS Datafit Ltd.
3 Avro Court
Ermine Business Park
Huntingdon
Cambs PE29 6XS

Tel: +44-1480-435456
Fax: +44-1480-434012
________________________________________________

The information contained in this e-mail is intended only for the person
or entity to which it is addressed and may contain confidential and/or
privileged material. If you are not the intended recipient of this
e-mail, the use of this information or any disclosure, copying or
distribution is prohibited and may be unlawful.

If you received this in error, please contact the sender and delete the
material from any computer.

The views expressed in this e-mail may not necessarily be the views of
The PCMS Group plc and should not be taken as authority to carry out any
instruction contained.



Re: stopping an

Posted by "Joe St. Germain" <js...@metrocast.net>.
Hi T Master,

I'm new to "ANT".  I've only been using it for about 3 days.
I've got all of my individual XML files done, but was thinking
I could create a main XML file to kicj off all of the other XML
files.  A sort of controller XML file.  I thought I'd use the <exec>
task within a <target> task for each XML file I wanted to run,
and that worls fine.  The probelm is thast if 1 of the <exec>'d XML
files has a compile( javac ) error, I'd like processing of the main
XMLfile to stop.  I can't find a way to make the stop happen.
I haven't tried using <ant> tasks within a <target> task, but will
give it a try.  I'll let you know what happens, unless you can tell
me that provessing will not stop this way either.


Thanks for answering my post T Master,
-Joe



----- Original Message ----- 
From: "T Master" <tm...@iknowledgeinc.com>
To: <an...@jakarta.apache.org>
Sent: Monday, September 24, 2001 6:19 PM
Subject: Re: stopping an <exec>


> Why are you using <exec> to call other buildfiles?
> use <ant>:
>         <ant antfile="${buildfile.dir}/${mybuildfile}" target="build">
> 
> Unless of course, this is the way you want....
> 
> 
> 
> ----- Original Message ----- 
> From: "Joe St. Germain" <js...@metrocast.net>
> To: <an...@jakarta.apache.org>
> Sent: Monday, September 24, 2001 4:06 PM
> Subject: stopping an <exec>
> 
> 
> Does anyone know how to stop the processing of an <exec>.
> My <exec> kicks off a <javac> in another build.xml file.  If
> <javac> reports errors, I'd like the calling exec to stop execution
> and anything passed that exec to also stop.  If you haven't already
> guest, I've got a build.xml that controls the execution of other
> XML files via the <exec> task.  I tried the failonerror flag on both
> tasks, but it dosen't work.  I don't believe that javac returns
> anything, and that may be the reason.
>  
>  
> -Joe
> 
> 
> 


RE: stopping an - vs.

Posted by Magnús Þór Torfason <ma...@handtolvur.is>.
I think I must add to this an important note regarding the <ant> task.  It
does not seem to handle directories correctly.  Consider the following
build.xml file

<project name="call-bin-build" default="exec-bin-build" basedir=".">
	<target name="exec-bin-build">
		<exec executable="ant.bat" dir="bin"/>
	</target>
	<target name="ant-bin-build">
		<ant antfile="build.xml" dir="bin"/>
	</target>
</project>

and the output when calling these two targets, first with exec

C:\project>ant exec-bin-build
Buildfile: build.xml
exec-bin-build:
     [exec] Buildfile: build.xml
     [exec]
     [exec] init:
     ...
     [exec]     [junit] Running com.handpoint.util.registry.test.JRegTest
     [exec]     [junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed:
0,03 sec
     [exec] BUILD SUCCESSFUL
     [exec]
     [exec] Total time: 5 seconds
BUILD SUCCESSFUL

and then with the ant task

C:\project>ant ant-bin-build
Buildfile: build.xml
ant-bin-build:
init:
...
    [junit] Running com.handpoint.util.registry.test.RegTest
    [junit] Tests run: 2, Failures: 1, Errors: 0, Time elapsed: 0,03 sec
BUILD FAILED

Note that the bin-build fails when using the ant call, but it is successful
when using an exec call !

Regards, Magnus

> -----Original Message-----
> From: T Master [mailto:tmaster@iknowledgeinc.com]
> Sent: 24. september 2001 22:19
> To: ant-user@jakarta.apache.org
> Subject: Re: stopping an <exec>
>
>
> Why are you using <exec> to call other buildfiles?
> use <ant>:
>         <ant antfile="${buildfile.dir}/${mybuildfile}" target="build">
>
> Unless of course, this is the way you want....
>
>
>
> ----- Original Message -----
> From: "Joe St. Germain" <js...@metrocast.net>
> To: <an...@jakarta.apache.org>
> Sent: Monday, September 24, 2001 4:06 PM
> Subject: stopping an <exec>
>
>
> Does anyone know how to stop the processing of an <exec>.
> My <exec> kicks off a <javac> in another build.xml file.  If
> <javac> reports errors, I'd like the calling exec to stop execution
> and anything passed that exec to also stop.  If you haven't already
> guest, I've got a build.xml that controls the execution of other
> XML files via the <exec> task.  I tried the failonerror flag on both
> tasks, but it dosen't work.  I don't believe that javac returns
> anything, and that may be the reason.
>
>
> -Joe
>
>


Re: stopping an

Posted by T Master <tm...@iknowledgeinc.com>.
Why are you using <exec> to call other buildfiles?
use <ant>:
        <ant antfile="${buildfile.dir}/${mybuildfile}" target="build">

Unless of course, this is the way you want....



----- Original Message ----- 
From: "Joe St. Germain" <js...@metrocast.net>
To: <an...@jakarta.apache.org>
Sent: Monday, September 24, 2001 4:06 PM
Subject: stopping an <exec>


Does anyone know how to stop the processing of an <exec>.
My <exec> kicks off a <javac> in another build.xml file.  If
<javac> reports errors, I'd like the calling exec to stop execution
and anything passed that exec to also stop.  If you haven't already
guest, I've got a build.xml that controls the execution of other
XML files via the <exec> task.  I tried the failonerror flag on both
tasks, but it dosen't work.  I don't believe that javac returns
anything, and that may be the reason.
 
 
-Joe