ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "North Alex" <Alex.No...@tapiola.fi>
Subject RE: question regarding WSAD specific ant tasks
Date Wed, 04 Jun 2003 07:34:55 GMT
>My question is regarding behavior of the <projectBuild> task 
>when there is at least one compile error present.  The 
><projectBuild> task is not failing or terminating when there 
>is a compile error present regardless of the value of the 
>"failonerror" attribute.  I get a "BUILD SUCCESSFUL" message 
>after the task even though compile problems are noted in the 
>trace.  Is this the expected behavior or am I somehow missing 
>something?

I came across the same problem (running inside WSAD 5) ... here is my
solution:

<target name="do.compile" depends="clean">
    <projectBuild ProjectName="${component.name}" failonerror="true"
		DebugCompilation="true" BuildType="full"/>
        
    <getJavacErrorCount ProjectName="${component.name}"  
        PropertyName="compile.error.count" />
    <condition property="build.ok">
        <equals arg1="${compile.error.count}" arg2="0"/>
    </condition>
</target>

<target name="fail.build.check" unless="build.ok">
  <fail>Failed while compiling ${component.name}</fail>
</target>

<target name="Compile" depends="do.compile, fail.build.check">
</target>	


If there is a nicer way to do this, I'd like to know.  

<= Alex =>

Mime
View raw message