From: Furingstad <kl...@fu...> - 2009-02-11 08:32:23
|
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: <?xml version="1.0" encoding="UTF-8"?> <project name="Copille-dbDef" default="cmp-def" xmlns:ac="antlib:net.sf.antcontrib"> <path id="build.class.path"> <fileset dir="${proj.externals.dir}/FND"> <include name="**/*.jar"/> </fileset> <pathelement path="${proj.bin.dir}/${be.component}/bindbg"/> <pathelement path="${base.root}"/> </path> <target name="cmp-def" description="Compilling DB Def"> <pathconvert property="build.classpath.prop" refid="build.class.path" targetos="windows" /> <echo message="Current classpath: ${build.classpath.prop}"/> <ac:for param="obj"> <path> <fileset dir="${proj.src.dir}/${be.component}/src/mvx/db/def"> <include name="**/*.java"/> </fileset> </path> <sequential> <ac:propertyregex override="yes" property="obj" input="@{obj}" regexp="(.+\\)(.+\.java)" replace="\2" casesensitive="false" /> <ac:trycatch property="exception.message" reference="exception.ref"> <ac:try> <javac taskname="compile.def" sourcepath="" srcdir="${proj.src.dir}/${be.component}/src/mvx/db/def" destdir="${proj.bin.dir}/${be.component}/bindbg" includes="${obj}" classpathref="build.class.path" compiler="org.eclipse.jdt.core.JDTCompilerAdapter" target="1.6" source="1.6" debug="on" failonerror="false" fork="no" /> </ac:try> <ac:catch> <echo message="Compile error on: ${obj} Error message: ${exception.message}${line.separator}" file="${ProjBaseDir}\Compille.error" append="true" level="warning" /> </ac:catch> </ac:trycatch> </sequential> </ac:for> </target> </project> -- 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. |
From: Peter R. <pet...@gm...> - 2009-02-16 18:12:05
|
Use failonerror="true" and failonerror="false" Peter On Wed, Feb 11, 2009 at 8:32 AM, Furingstad <kl...@fu...> wrote: > 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: > > > > <?xml version="1.0" encoding="UTF-8"?> > <project name="Copille-dbDef" default="cmp-def" > xmlns:ac="antlib:net.sf.antcontrib"> > > <path id="build.class.path"> > <fileset dir="${proj.externals.dir}/FND"> > <include name="**/*.jar"/> > </fileset> > <pathelement path="${proj.bin.dir}/${be.component}/bindbg"/> > <pathelement path="${base.root}"/> > </path> > <target name="cmp-def" description="Compilling DB Def"> > <pathconvert property="build.classpath.prop" > refid="build.class.path" targetos="windows" /> > <echo message="Current classpath: ${build.classpath.prop}"/> > > <ac:for param="obj"> > <path> > <fileset > dir="${proj.src.dir}/${be.component}/src/mvx/db/def"> > <include name="**/*.java"/> > </fileset> > </path> > > <sequential> > <ac:propertyregex override="yes" > property="obj" input="@{obj}" > regexp="(.+\\)(.+\.java)" > replace="\2" > casesensitive="false" /> > > <ac:trycatch property="exception.message" > reference="exception.ref"> > <ac:try> > <javac taskname="compile.def" > sourcepath="" > > srcdir="${proj.src.dir}/${be.component}/src/mvx/db/def" > destdir="${proj.bin.dir}/${be.component}/bindbg" > includes="${obj}" > classpathref="build.class.path" > compiler="org.eclipse.jdt.core.JDTCompilerAdapter" > target="1.6" > source="1.6" > debug="on" > failonerror="false" > fork="no" > /> > </ac:try> > <ac:catch> > <echo message="Compile error on: ${obj} Error > message: > > ${exception.message}${line.separator}" > file="${ProjBaseDir}\Compille.error" > append="true" level="warning" > /> > </ac:catch> > </ac:trycatch> > </sequential> > </ac:for> > </target> > </project> > ________________________________ > View this message in context: Catch compile errors > Sent from the Ant Contrib mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > 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 > _______________________________________________ > Ant-contrib-developers mailing list > Ant...@li... > https://lists.sourceforge.net/lists/listinfo/ant-contrib-developers > > |
From: Peter R. <pet...@gm...> - 2009-02-16 18:18:41
|
I mean not ! Peter On Mon, Feb 16, 2009 at 6:12 PM, Peter Reilly <pet...@gm...> wrote: > Use failonerror="true" and failonerror="false" > > Peter > > On Wed, Feb 11, 2009 at 8:32 AM, Furingstad <kl...@fu...> wrote: >> 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: >> >> >> >> <?xml version="1.0" encoding="UTF-8"?> >> <project name="Copille-dbDef" default="cmp-def" >> xmlns:ac="antlib:net.sf.antcontrib"> >> >> <path id="build.class.path"> >> <fileset dir="${proj.externals.dir}/FND"> >> <include name="**/*.jar"/> >> </fileset> >> <pathelement path="${proj.bin.dir}/${be.component}/bindbg"/> >> <pathelement path="${base.root}"/> >> </path> >> <target name="cmp-def" description="Compilling DB Def"> >> <pathconvert property="build.classpath.prop" >> refid="build.class.path" targetos="windows" /> >> <echo message="Current classpath: ${build.classpath.prop}"/> >> >> <ac:for param="obj"> >> <path> >> <fileset >> dir="${proj.src.dir}/${be.component}/src/mvx/db/def"> >> <include name="**/*.java"/> >> </fileset> >> </path> >> >> <sequential> >> <ac:propertyregex override="yes" >> property="obj" input="@{obj}" >> regexp="(.+\\)(.+\.java)" >> replace="\2" >> casesensitive="false" /> >> >> <ac:trycatch property="exception.message" >> reference="exception.ref"> >> <ac:try> >> <javac taskname="compile.def" >> sourcepath="" >> >> srcdir="${proj.src.dir}/${be.component}/src/mvx/db/def" >> destdir="${proj.bin.dir}/${be.component}/bindbg" >> includes="${obj}" >> classpathref="build.class.path" >> compiler="org.eclipse.jdt.core.JDTCompilerAdapter" >> target="1.6" >> source="1.6" >> debug="on" >> failonerror="false" >> fork="no" >> /> >> </ac:try> >> <ac:catch> >> <echo message="Compile error on: ${obj} Error >> message: >> >> ${exception.message}${line.separator}" >> file="${ProjBaseDir}\Compille.error" >> append="true" level="warning" >> /> >> </ac:catch> >> </ac:trycatch> >> </sequential> >> </ac:for> >> </target> >> </project> >> ________________________________ >> View this message in context: Catch compile errors >> Sent from the Ant Contrib mailing list archive at Nabble.com. >> >> ------------------------------------------------------------------------------ >> 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 >> _______________________________________________ >> Ant-contrib-developers mailing list >> Ant...@li... >> https://lists.sourceforge.net/lists/listinfo/ant-contrib-developers >> >> > |