Bug #4264
closedant task fails if there are java compilation errors
0%
Description
If "ant tasks" is run and there are compilation errors in the
build-area/src code, then "ant tasks" will fail to run again
because target/kepler-tasks.jar does not exist.
In the example below, I have some compilation errors and
then ant task fails to run
bash-3.00$ ant task
At revision 20113.
Buildfile: build.xml
task:
clean:
[delete] Deleting directory /export/home1/cxh/src/kepler/build-area/target/classes
[delete] Deleting: /export/home1/cxh/src/kepler/build-area/target/kepler-tasks.jar
compile:
[mkdir] Created dir: /export/home1/cxh/src/kepler/build-area/target/classes
[javac] Compiling 90 source files to /export/home1/cxh/src/kepler/build-area/target/classes
[javac] /export/home1/cxh/src/kepler/build-area/src/org/kepler/build/CreateJavadoc.java:137: cannot find symbol
[javac] symbol : class StreamExec
[javac] location: class org.kepler.build.CreateJavadoc
[javac] final StreamExec exec = new StreamExec();
[javac] ^
[javac] /export/home1/cxh/src/kepler/build-area/src/org/kepler/build/CreateJavadoc.java:137: cannot find symbol
[javac] symbol : class StreamExec
[javac] location: class org.kepler.build.CreateJavadoc
[javac] final StreamExec exec = new StreamExec();
[javac] ^
[javac] /export/home1/cxh/src/kepler/build-area/src/org/kepler/build/util/StreamSingleCommandExec.java:308: cannot find symbol
[javac] symbol : variable commandTokens
[javac] location: class org.kepler.build.util.StreamSingleCommandExec
[javac] for (int i = 0; i < commandTokens.length; i++) {
[javac] ^
[javac] /export/home1/cxh/src/kepler/build-area/src/org/kepler/build/util/StreamSingleCommandExec.java:312: array required, but java.util.List found
[javac] commandBuffer.append(_commands[i]);
[javac] ^
[javac] /export/home1/cxh/src/kepler/build-area/src/org/kepler/build/util/StreamSingleCommandExec.java:321: cannot find symbol
[javac] symbol : variable commandTokens
[javac] location: class org.kepler.build.util.StreamSingleCommandExec
[javac] statusCommand.append(commandTokens[i]);
[javac] ^
[javac] /export/home1/cxh/src/kepler/build-area/src/org/kepler/build/util/StreamSingleCommandExec.java:333: cannot find symbol
[javac] symbol : method exec(java.util.List,java.lang.String[],java.io.File)
[javac] location: class java.lang.Runtime
[javac] _process = runtime.exec(_commands, _envp,
[javac] ^
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 6 errors
BUILD FAILED
/export/home1/cxh/src/kepler/build-area/build.xml:197: The following error occurred while executing this line:
/export/home1/cxh/src/kepler/build-area/kepler-tasks.xml:13: Compile failed; see the compiler error output for details.
Total time: 6 seconds
bash-3.00$ ant task
Buildfile: build.xml
BUILD FAILED
/export/home1/cxh/src/kepler/build-area/build.xml:4: The following error occurred while executing this line:
/export/home1/cxh/src/kepler/build-area/settings/taskdefs.xml:5: typedef class org.kepler.build.Get cannot be found
Total time: 0 seconds
The workaround is to run
svn update target/; ant task
The fix is to temporarily move targets/kepler-tasks.jar and if
javac fails, then move it back.