diff --git a/plexus-compiler-api/src/main/java/org/codehaus/plexus/compiler/CompilerConfiguration.java b/plexus-compiler-api/src/main/java/org/codehaus/plexus/compiler/CompilerConfiguration.java index aad05bea..9edf10ea 100644 --- a/plexus-compiler-api/src/main/java/org/codehaus/plexus/compiler/CompilerConfiguration.java +++ b/plexus-compiler-api/src/main/java/org/codehaus/plexus/compiler/CompilerConfiguration.java @@ -172,6 +172,12 @@ public class CompilerConfiguration */ private boolean forceJavacCompilerUse=false; + /** + * force a different of the debug file containing the forked command run (such javac.sh) + * @since 2.9.1 + */ + private String debugFileName; + // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- @@ -720,6 +726,16 @@ public void setCompilerReuseStrategy( CompilerReuseStrategy compilerReuseStrateg this.compilerReuseStrategy = compilerReuseStrategy; } + public String getDebugFileName() + { + return debugFileName; + } + + public void setDebugFileName(String debugFileName) + { + this.debugFileName = debugFileName; + } + /** * Re-use strategy of the compiler (implement for java only). */ diff --git a/plexus-compilers/plexus-compiler-j2objc/README.md b/plexus-compilers/plexus-compiler-j2objc/README.md index 823e9549..56af165d 100644 --- a/plexus-compilers/plexus-compiler-j2objc/README.md +++ b/plexus-compilers/plexus-compiler-j2objc/README.md @@ -23,7 +23,7 @@ J2ObjC Plexus compiler org.codehaus.plexus plexus-compiler-j2objc - 2.8.1-SNAPSHOT + 2.9.1-SNAPSHOT diff --git a/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java b/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java index 5f38977a..f685c24d 100644 --- a/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java +++ b/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java @@ -559,7 +559,7 @@ protected CompilerResult compileOutOfProcess( CompilerConfiguration config, Stri try { - File argumentsFile = createFileWithArguments( args, config.getOutputLocation() ); + File argumentsFile = createFileWithArguments( args, config.getBuildDirectory().getAbsolutePath() ); cli.addArguments( new String[]{ "@" + argumentsFile.getCanonicalPath().replace( File.separatorChar, '/' ) } ); @@ -594,8 +594,10 @@ protected CompilerResult compileOutOfProcess( CompilerConfiguration config, Stri if ( ( getLogger() != null ) && getLogger().isDebugEnabled() ) { + String debugFileName = StringUtils.isEmpty(config.getDebugFileName()) ? "javac" : config.getDebugFileName(); + File commandLineFile = - new File( config.getOutputLocation(), "javac." + ( Os.isFamily( Os.FAMILY_WINDOWS ) ? "bat" : "sh" ) ); + new File( config.getBuildDirectory(), StringUtils.trim(debugFileName) + "." + ( Os.isFamily( Os.FAMILY_WINDOWS ) ? "bat" : "sh" ) ); try { FileUtils.fileWrite( commandLineFile.getAbsolutePath(), cli.toString().replaceAll( "'", "" ) );