ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kelly Davis <>
Subject ant task output file differs in API from command line usage
Date Thu, 14 Oct 2004 21:26:16 GMT
I have the following code which executes a build file:

Project project = new Project();   
project.setUserProperty( "base.dir", new File( rootDir 
).getAbsolutePath() );
project.setUserProperty( "ant.file", new File( new File( rootDir ), 
buildFile ).getAbsolutePath() );
project.setProperty( "", 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:


    [javac] Compiling 611 source files to 

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:


    [javac] Compiling 611 source files to 
repeated modifier
    [javac]       public static final String SYSTEM_PROPERTIES = 
    [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:
For additional commands, e-mail:

View raw message