Project

General

Profile

Bug #4264

ant task fails if there are java compilation errors

Added by Christopher Brooks over 10 years ago. Updated almost 10 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
build system
Target version:
Start date:
07/25/2009
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
4264

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.

History

#1 Updated by David Welker almost 10 years ago

"ant task" is a convenience method. It never needs to be invoked.

If "ant task" fails, the solution is to type:

ant -f kepler-tasks.xml

I do not think that we should make "ant task" more robust, since it is meant to be a short-cut to avoid to avoid typing the above. If kepler-tasks.jar is missing, then ant task doesn't work, but the command above does. I am closing this bug.

#2 Updated by Redmine Admin over 6 years ago

Original Bugzilla ID was 4264

Also available in: Atom PDF