ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject RE: how to cause Ant BuildException in a JACL script inside an An t build.xml ?
Date Wed, 19 May 2004 05:46:47 GMT
I donĀ“t know JACL, but with JavaScript that works:
 
<project>
    <script language="javascript"> <![CDATA[
        importClass(Packages.org.apache.tools.ant.BuildException);
        throw new BuildException("my error");
    ]]></script>
</project>
 
 
C:\TEMP\xxx>ant
Buildfile: build.xml
 
BUILD FAILED
C:\TEMP\xxx\build.xml:2: my error
 
Total time: 0 seconds
 
 
Jan
 

-----Original Message-----
From: Barry Searle [mailto:searle@ca.ibm.com]
Sent: Tuesday, May 18, 2004 7:39 PM
To: user@ant.apache.org
Subject: how to cause Ant BuildException in a JACL script inside an Ant
build.xml ?



I have a JACL script inside an Ant build.xml, and under certain 
conditions I want it to cause a standard Ant BuildException. 

What I tried was: 
                      set buildExc [java::new  BuildException  "failOnError
errorCount=$errorCount"] 
                      java::throw $buildExc 

What I got was (tcl.lang.ReflectException): 
      [script] BUILD FAILED:
file:G:/workspace_v511/AdderEAR/prodBuild.xml:33: tcl.lang.ReflectException

How can I make this a clean (normal) Ant BuildException ? 


Barry Searle,    searle@ca.ibm.com, 




Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message