Skip to content

Commit c95da61

Browse files
committed
Issue #165: Place script/argument files in target
With this the arguments and `java.[sh|bat` files will be created in the build directory (usually `target`), rather than in the output directory (usually `target/classes`). Fixes #165
1 parent 5a40182 commit c95da61

File tree

1 file changed

+4
-4
lines changed
  • plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac

1 file changed

+4
-4
lines changed

plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ protected CompilerResult compileOutOfProcess( CompilerConfiguration config, Stri
559559

560560
try
561561
{
562-
File argumentsFile = createFileWithArguments( args, config.getOutputLocation() );
562+
File argumentsFile = createFileWithArguments( args, config.getBuildDirectory() );
563563
cli.addArguments(
564564
new String[]{ "@" + argumentsFile.getCanonicalPath().replace( File.separatorChar, '/' ) } );
565565

@@ -595,7 +595,7 @@ protected CompilerResult compileOutOfProcess( CompilerConfiguration config, Stri
595595
if ( ( getLogger() != null ) && getLogger().isDebugEnabled() )
596596
{
597597
File commandLineFile =
598-
new File( config.getOutputLocation(), "javac." + ( Os.isFamily( Os.FAMILY_WINDOWS ) ? "bat" : "sh" ) );
598+
new File( config.getBuildDirectory(), "javac." + ( Os.isFamily( Os.FAMILY_WINDOWS ) ? "bat" : "sh" ) );
599599
try
600600
{
601601
FileUtils.fileWrite( commandLineFile.getAbsolutePath(), cli.toString().replaceAll( "'", "" ) );
@@ -979,7 +979,7 @@ private static String getWarnPrefix( String msg )
979979
* @return the temporary file wth the arguments
980980
* @throws IOException
981981
*/
982-
private File createFileWithArguments( String[] args, String outputDirectory )
982+
private File createFileWithArguments( String[] args, File outputDirectory )
983983
throws IOException
984984
{
985985
PrintWriter writer = null;
@@ -989,7 +989,7 @@ private File createFileWithArguments( String[] args, String outputDirectory )
989989
if ( ( getLogger() != null ) && getLogger().isDebugEnabled() )
990990
{
991991
tempFile =
992-
File.createTempFile( JavacCompiler.class.getName(), "arguments", new File( outputDirectory ) );
992+
File.createTempFile( JavacCompiler.class.getName(), "arguments", outputDirectory );
993993
}
994994
else
995995
{

0 commit comments

Comments
 (0)