I have the following code which executes a build file:
Project project = new Project(); project.init();
project.setUserProperty( "base.dir", new File( rootDir ).getAbsolutePath() );
project.setUserProperty( "ant.file", new File( new File( rootDir ), buildFile ).getAbsolutePath() );
project.setProperty( "build.properties", propertyFile );
ProjectHelper helper = ProjectHelper.getProjectHelper();
helper.parse( project, new File( new File( rootDir), buildFile ));
project.executeTarget( "build" );
The build file uses the 'ant' task to execute a sub-project build, which simply compiles some code. The 'ouput' option is used to write the output of the sub-project build to a file. When the above code executes, I get the following in the output file:
prepare:
compile:
[javac] Compiling 611 source files to /usr/local/builder/work/core/modules/work/core/classes
The problem with this is there is no indication of a compiler error which is occurring. Now, if I execute the exact same build file from the command line (with no api), this is what ends up in the output file:
prepare:
compile:
[javac] Compiling 611 source files to /usr/local/builder/work/core/modules/work/core/classes
[javac] /usr/local/builder/work/core/modules/core/src/java/com/pensare/sys/KCSystem.java:45: repeated modifier
[javac] public static final String SYSTEM_PROPERTIES = "system.props";
[javac] ^
[javac] 1 error
[javac] 6 warnings
Why am I not getting the compile error in the output file when I run the build script using the API?
Thanks, Kelly
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]