Catch compile errors

Furingstad <[email protected]> Wed, 11 Feb 2009 00:32:19 -0800 (PST)
Newsgroups gmane.comp.java.ant-contrib.devel
Message-ID <[email protected]>
--===============6653423290140072759==
Content-Type: multipart/alternative; 
	boundary="----=_Part_28930_8215893.1234341139737"

------=_Part_28930_8215893.1234341139737
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


We are implementing the Ant Contrib trycatch task to catch compile errors in
our build script but for some reason we cant get it to catch our errors.

Any ideas what we are doing wrong?

Our test script:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;project name=&quot;Copille-dbDef&quot; default=&quot;cmp-def&quot;
xmlns:ac=&quot;antlib:net.sf.antcontrib&quot;&gt;
&nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &lt;path id=&quot;build.class.path&quot;&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &lt;fileset
dir=&quot;${proj.externals.dir}/FND&quot;&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;include
name=&quot;**/*.jar&quot;/&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/fileset&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &lt;pathelement
path=&quot;${proj.bin.dir}/${be.component}/bindbg&quot;/&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &lt;pathelement
path=&quot;${base.root}&quot;/&gt;
&nbsp; &lt;/path&gt;
&nbsp; &lt;target name=&quot;cmp-def&quot; description=&quot;Compilling DB
Def&quot;&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &lt;pathconvert
property=&quot;build.classpath.prop&quot; refid=&quot;build.class.path&quot;
targetos=&quot;windows&quot; /&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &lt;echo message=&quot;Current classpath:
${build.classpath.prop}&quot;/&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &lt;ac:for param=&quot;obj&quot;&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;path&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;fileset
dir=&quot;${proj.src.dir}/${be.component}/src/mvx/db/def&quot;&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &lt;include name=&quot;**/*.java&quot;/&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/fileset&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/path&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;sequential&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;ac:propertyregex
override=&quot;yes&quot; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
property=&quot;obj&quot; input=&quot;@{obj}&quot;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;regexp=&quot;(.+\\)(.+\.java)&quot;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;replace=&quot;\2&quot;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; casesensitive=&quot;false&quot; /&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;ac:trycatch
property=&quot;exception.message&quot;
reference=&quot;exception.ref&quot;&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;ac:try&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;&lt;javac taskname=&quot;compile.def&quot;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; sourcepath=&quot;&quot;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; srcdir=&quot;${proj.src.dir}/${be.component}/src/mvx/db/def&quot; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; destdir=&quot;${proj.bin.dir}/${be.component}/bindbg&quot;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; includes=&quot;${obj}&quot;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; classpathref=&quot;build.class.path&quot;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; compiler=&quot;org.eclipse.jdt.core.JDTCompilerAdapter&quot; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; target=&quot;1.6&quot;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; source=&quot;1.6&quot;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; debug=&quot;on&quot;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; failonerror=&quot;false&quot;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; fork=&quot;no&quot;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;/&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/ac:try&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;ac:catch&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &lt;echo message=&quot;Compile error on: ${obj} &nbsp;Error message:
&nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
${exception.message}${line.separator}&quot; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; file=&quot;${ProjBaseDir}\Compille.error&quot; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; append=&quot;true&quot; level=&quot;warning&quot;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/ac:catch&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/ac:trycatch&gt;
&nbsp; &nbsp; &lt;/sequential&gt;
&nbsp; &lt;/ac:for&gt;
&lt;/target&gt;
&lt;/project&gt;

-- 
View this message in context: http://www.nabble.com/Catch-compile-errors-tp21950334p21950334.html
Sent from the Ant Contrib mailing list archive at Nabble.com.

------=_Part_28930_8215893.1234341139737
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit


We are implementing the Ant Contrib trycatch task to catch compile errors in our build script but for some reason we cant get it to catch our errors.
<br><br>
Any ideas what we are doing wrong?
<br><br>
<b>Our test script:</b>
<br><br>
<br><br>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
<br>&lt;project name=&quot;Copille-dbDef&quot; default=&quot;cmp-def&quot; xmlns:ac=&quot;antlib:net.sf.antcontrib&quot;&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; 
<br>&nbsp; &lt;path id=&quot;build.class.path&quot;&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;fileset dir=&quot;${proj.externals.dir}/FND&quot;&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;include name=&quot;**/*.jar&quot;/&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/fileset&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;pathelement path=&quot;${proj.bin.dir}/${be.component}/bindbg&quot;/&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;pathelement path=&quot;${base.root}&quot;/&gt;
<br>&nbsp; &lt;/path&gt;
<br>&nbsp; &lt;target name=&quot;cmp-def&quot; description=&quot;Compilling DB Def&quot;&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;pathconvert property=&quot;build.classpath.prop&quot; refid=&quot;build.class.path&quot; targetos=&quot;windows&quot; /&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;echo message=&quot;Current classpath: ${build.classpath.prop}&quot;/&gt;
<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;ac:for param=&quot;obj&quot;&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;path&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;fileset dir=&quot;${proj.src.dir}/${be.component}/src/mvx/db/def&quot;&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;include name=&quot;**/*.java&quot;/&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/fileset&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/path&gt;
<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;sequential&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;ac:propertyregex override=&quot;yes&quot; 
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; property=&quot;obj&quot; input=&quot;@{obj}&quot;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;regexp=&quot;(.+\\)(.+\.java)&quot;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;replace=&quot;\2&quot;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; casesensitive=&quot;false&quot; /&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;ac:trycatch property=&quot;exception.message&quot; reference=&quot;exception.ref&quot;&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;ac:try&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;javac taskname=&quot;compile.def&quot;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sourcepath=&quot;&quot;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; srcdir=&quot;${proj.src.dir}/${be.component}/src/mvx/db/def&quot; 
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; destdir=&quot;${proj.bin.dir}/${be.component}/bindbg&quot;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; includes=&quot;${obj}&quot;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; classpathref=&quot;build.class.path&quot;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; compiler=&quot;org.eclipse.jdt.core.JDTCompilerAdapter&quot; 
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; target=&quot;1.6&quot;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; source=&quot;1.6&quot;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debug=&quot;on&quot;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; failonerror=&quot;false&quot;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fork=&quot;no&quot;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/ac:try&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;ac:catch&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;echo message=&quot;Compile error on: ${obj} &nbsp;Error message: &nbsp; &nbsp; &nbsp; 
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ${exception.message}${line.separator}&quot; 
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; file=&quot;${ProjBaseDir}\Compille.error&quot; 
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; append=&quot;true&quot; level=&quot;warning&quot;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/ac:catch&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/ac:trycatch&gt;
<br>&nbsp; &nbsp; &lt;/sequential&gt;
<br>&nbsp; &lt;/ac:for&gt;
<br>&lt;/target&gt;
<br>&lt;/project&gt;</div>
<br><hr align="left" width="300">
View this message in context: <a href="http://www.nabble.com/Catch-compile-errors-tp21950334p21950334.html">Catch compile errors</a><br>
Sent from the <a href="http://www.nabble.com/Ant-Contrib-f2364.html">Ant Contrib mailing list archive</a> at Nabble.com.<br>

------=_Part_28930_8215893.1234341139737--



--===============6653423290140072759==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
--===============6653423290140072759==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Ant-contrib-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ant-contrib-developers

--===============6653423290140072759==--