Skip to content

javac dump debug file should not be written in classes directory as it will be included in jar. change directory and make name configurable #184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;

// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
Expand Down Expand Up @@ -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).
*/
Expand Down
2 changes: 1 addition & 1 deletion plexus-compilers/plexus-compiler-j2objc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ J2ObjC Plexus compiler
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-j2objc</artifactId>
<version>2.8.1-SNAPSHOT</version>
<version>2.9.1-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, '/' ) } );

Expand Down Expand Up @@ -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( "'", "" ) );
Expand Down