Delved a little deeper (my knowledge of makefiles is almost non-existent!).
Appears that if I call Ant from within a makefile using a batchfile, I don't get
any return code back ie I would have to basically copy all of the ant batchfile
into the makefile to be able to check the return code.

Is this true?  Does anyone have any kind of workaround, apart from the build
listener?

Many thanks,

David





"David_Hay/Lex/Lexmark.LEXMARK"@sweeper.lex.lexmark.com on 03/14/2002 12:06:59
PM

Please respond to "Ant Users List"
      <[EMAIL PROTECTED]>

To:   "Ant Users List" <[EMAIL PROTECTED]>
cc:    (bcc: David Hay/Lex/Lexmark)
Subject:  RE: Return code from Ant





I kind of picked up a project from someone else, and they'd set up the following
for the makefile, saying that there is no way to check if Ant failed or not.
Can I change the makefile so a return code is picked up *without* having to use
the listener?

------------------- makefile.mak -----------------------

ANT=ant -listener ErrorCodeGenerator

# run ant
# if ant.err exists after run, build failed.
# force error by dir command of file that doesn't exist
all:
   $(ANT)
   if exist ant.err dir ThisFileDoesNotExist 2>nul 1>nul


Many thanks,

David





"Conor MacNeill" <[EMAIL PROTECTED]> on
03/13/2002 06:24:45 PM

Please respond to "Ant Users List"
      <[EMAIL PROTECTED]>

To:   "Ant Users List" <[EMAIL PROTECTED]>
cc:    (bcc: David Hay/Lex/Lexmark)
Subject:  RE: Return code from Ant



> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>
> Hi.  I am a little perplexed how to call Ant from a makefile (we
> have to in our
> build process) and to check whether the build failed or not.
>
> Do I HAVE to create a BuildListener?  What doesn't Ant simply
> return an error
> code set to 0 or 1 when it's done?!!
>

It should do. What problem are you having?

Conor


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>








--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>








--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to