Skip to main content



      Home
Home » Newcomers » Newcomers » ANT build does not fail on errors
ANT build does not fail on errors [message #235550] Mon, 01 October 2007 06:51 Go to next message
Eclipse UserFriend
Originally posted by: hburde.merentis.com

Hi;

I joined a project recently which uses Eclispe for Java development.
Working on that project i found a strange problem running the build files
- it allways completes _succesfull_ regardless of compilation errors. The
build.xml contains NO failonerror="false" anywere. I run the scripts with
the runs_as (ant build) Option.

I never saw such a strange behaviour using ant directly - and indeed
running the build with a external ant (1.7.0) results in the correct
behaviour (fails if javac encounters errors). Any idea whats wrong or how
to get it to behave the right way

PS This issue was found in 3.2 and 3.3 running on xpee

thx in advance;

hb
Re: ANT build does not fail on errors [message #235662 is a reply to message #235550] Mon, 01 October 2007 15:46 Go to previous messageGo to next message
Eclipse UserFriend
Seems strange to me as well.
The Ant bundled within Eclipse is an unmodified distribution of the Apache
Ant release 1.7.0... we just launch differently.
Can you boil this down to a self contained example that you could open a bug
report with for further investigation?

Thanks
Darins

"javad0de" <hburde@merentis.com> wrote in message
news:6da6c7ca01070779ea8037679ae8109a$1@www.eclipse.org...
> Hi;
>
> I joined a project recently which uses Eclispe for Java development.
> Working on that project i found a strange problem running the build
> files - it allways completes _succesfull_ regardless of compilation
> errors. The build.xml contains NO failonerror="false" anywere. I run the
> scripts with the runs_as (ant build) Option.
> I never saw such a strange behaviour using ant directly - and indeed
> running the build with a external ant (1.7.0) results in the correct
> behaviour (fails if javac encounters errors). Any idea whats wrong or how
> to get it to behave the right way
> PS This issue was found in 3.2 and 3.3 running on xpee
>
> thx in advance;
>
> hb
Re: ANT build does not fail on errors [message #235852 is a reply to message #235662] Tue, 02 October 2007 11:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hburde.merentis.com

Hi;

I tried to reproduce that error but with no success yet. I have no idea
what in the structire of that files triggers that error. If i get any
further with that i send a bug report.

hb
Re: ANT build does not fail on errors [message #236241 is a reply to message #235852] Thu, 04 October 2007 10:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hburde.merentis.com

Hi;

I could reproduce the error with destdir="bin" in a javac task. For what
ever
reason those jerks didnt follow the usual convention (="classes") - but to
be honest i really dont know why the name matters.

The isolated example :

<?xml version="1.0" encoding="UTF-8"?>
<project name="Test" default="dist">
<property name="Appname" value="crap" />
<property file="build.properties"/>
<tstamp>
<format property="TODAY_VERSION" pattern="yyyy/MM/dd hh:mm"
locale="de,DE" />
</tstamp>

<!-- comment a .xml -->
<path id="compile.classpath">
<fileset dir="lib" />
<fileset dir="props" />
</path>

<!-- comment b -->
<target name="copy" >
<echo> copy target (dummy) </echo>
<copy file="c:/temp/testa.txt" todir="c:/temp/testa" overwrite="true" />
</target>

<!-- comment c -->
<target name="compile" depends="copy" >
<echo> Compile target </echo>
<javac srcdir="src" destdir="bin" failonerror="true" >

</javac>
</target>

<!-- comment d -->
<target name="compress" depends="compile" >
<echo> JAR target </echo>
<jar destfile="Project.jar">
<fileset dir="classes" includes="**/*.class"/>
<manifest>
<attribute name="Main-Class" value="Testcase"/>
</manifest>
</jar>
</target>

<target name="dist" depends="compile" >
<echo>
Building the .jar file.
</echo>
<echo> Dist target </echo>
</target>
</project>

In this case even ant from commandline builds sucessfull - in a case with
a broken java source file. changing destdir to classes and it works like
expected.

hb
Re: ANT build does not fail on errors [message #236254 is a reply to message #236241] Thu, 04 October 2007 11:39 Go to previous message
Eclipse UserFriend
Thanks.
But I am not sure there is as bug here.

the javac tasks does a simple time stamp comparison of the src and binaries.
If the src timestame is not newer than the binaries no compilation
occurs...you are up to date.
If eclipse is compiling the src to the bin directory (which it does by
default) your javac will be a no-op.
Are you sure you are actually compiling anything when things are
"successful". I would crank up your verbosity and ensure that something
really is being compiled.

HTH
Darins

"javad0de" <hburde@merentis.com> wrote in message
news:5d37b2e78c10a232b920c6a9713141c9$1@www.eclipse.org...
> Hi;
>
> I could reproduce the error with destdir="bin" in a javac task. For what
> ever
> reason those jerks didnt follow the usual convention (="classes") - but to
> be honest i really dont know why the name matters.
>
> The isolated example :
> <?xml version="1.0" encoding="UTF-8"?>
> <project name="Test" default="dist">
> <property name="Appname" value="crap" />
> <property file="build.properties"/>
> <tstamp>
> <format property="TODAY_VERSION" pattern="yyyy/MM/dd hh:mm" locale="de,DE"
> />
> </tstamp>
> <!-- comment a .xml -->
> <path id="compile.classpath">
> <fileset dir="lib" />
> <fileset dir="props" />
> </path>
>
> <!-- comment b -->
> <target name="copy" >
> <echo> copy target (dummy) </echo>
> <copy file="c:/temp/testa.txt" todir="c:/temp/testa" overwrite="true" />
> </target>
>
> <!-- comment c -->
> <target name="compile" depends="copy" >
> <echo> Compile target </echo>
> <javac srcdir="src" destdir="bin" failonerror="true" >
> </javac>
> </target>
> <!-- comment d -->
> <target name="compress" depends="compile" >
> <echo> JAR target </echo>
> <jar destfile="Project.jar">
> <fileset dir="classes" includes="**/*.class"/>
> <manifest>
> <attribute name="Main-Class" value="Testcase"/>
> </manifest>
> </jar>
> </target>
> <target name="dist" depends="compile" >
> <echo>
> Building the .jar file.
> </echo>
> <echo> Dist target </echo>
> </target> </project>
>
> In this case even ant from commandline builds sucessfull - in a case with
> a broken java source file. changing destdir to classes and it works like
> expected.
>
> hb
>
>
>
>
Previous Topic:Can't get VE to work on Eclipse 3.3
Next Topic:ColdFusion8
Goto Forum:
  


Current Time: Sat Sep 06 15:54:40 EDT 2025

Powered by FUDForum. Page generated in 0.08723 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top