Batch Compiler Fail On Warnings [message #242821] |
Thu, 12 April 2007 20:00 |
Eclipse User |
|
|
|
Originally posted by: bbrady.broad.mit.edu
Hi,
It is desired for our nightly builds to fail on warnings. Can anyone
recommend a way to get the batch compiler (ant javac adapter) to do
this? There is no option like -failOnWarning or -warn:!unusedLocal
(where "!" enables the unused local variable warning to act as an error).
Does anybody have a workaround for this?
I also tried using the apt ant task for building, with certain warnings
set to be errors in the org.eclipse.jdt.core.prefs file like below:
....
org.eclipse.jdt.core.compiler.problem.unusedLocal=error
....
Running the apt ant task finds the unused local variable warning and
acknowledges it as an error (see output below), but still follows
through and successfully builds instead of stopping compilation. Would
anyone know how to stop compilation in this case, from the ant run?
In apt_build.xml:
....
<taskdef name="apt"
classname="org.eclipse.jdt.apt.core.build.JdtApt"/>
<target name="compile" depends="init">
<apt workspace="${workspace}"
eclipseHome="${eclipseHome}"
</target>
....
Output from ant -buildfile=apt_build.xml:
....
compile:
[apt] Building workspace
[apt] Building: /TestAntBuild
[apt] Invoking Java Builder on /TestAntBuild.
[apt] Cleaning output folder for TestAntBuild
[apt] Build done
[apt] Building workspace
[apt] Building: /TestAntBuild
[apt] Invoking Java Builder on /TestAntBuild.
[apt] Preparing to build TestAntBuild
[apt] Cleaning output folder for TestAntBuild
[apt] Analyzing sources
[apt] Compiling TestAntBuild
[apt] (Found 1 error) Compiling TestAntBuild
[apt] (Found 1 error) Build done
[javac] Compiling 1 source file to
C:\Local\Java\workspace_test\TestAntBuild\build
BUILD SUCCESSFUL
Thanks,
Bob
|
|
|
Powered by
FUDForum. Page generated in 0.02724 seconds