Skip to content

Commit

Permalink
describe compiler configuration on run
Browse files Browse the repository at this point in the history
  • Loading branch information
hboutemy committed Dec 15, 2022
1 parent 4385845 commit a086aef
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ protected AbstractCompiler( CompilerOutputStyle compilerOutputStyle, String inpu
//
// ----------------------------------------------------------------------

public abstract String getCompilerId();

public CompilerResult performCompile(CompilerConfiguration configuration)
throws CompilerException
{
Expand Down Expand Up @@ -308,7 +310,8 @@ protected void logCompiling( String[] sourceFiles, CompilerConfiguration config
config.getWorkingDirectory().toPath().relativize( new File( config.getOutputLocation() ).toPath() ).toString();
getLogger().info( "Compiling " +
( sourceFiles == null ? "" : ( sourceFiles.length + " source file" + ( sourceFiles.length == 1 ? " " : "s " ) ) ) +
"to " + to );
"with " + config.describe( getCompilerId() ) +
" to " + to );
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,12 @@ public AspectJCompiler()
super( CompilerOutputStyle.ONE_OUTPUT_FILE_PER_INPUT_FILE, "", ".class", null );
}

@Override
public String getCompilerId()
{
return "aspectj";
}

public CompilerResult performCompile( CompilerConfiguration config )
throws CompilerException
{
Expand All @@ -320,14 +326,7 @@ public CompilerResult performCompile( CompilerConfiguration config )
return new CompilerResult();
}

<<<<<<< Upstream, based on plexus/master
logCompiling( sourceFiles, config );
=======
System.out.println(
"Compiling " + sourceFiles.length + " source file" + ( sourceFiles.length == 1 ? "" : "s" ) +
" with " + config.describe( "aspectj" ) +
" to " + destinationDir.getAbsolutePath() );
>>>>>>> 97348ff describe compiler configuration on run

// String[] args = buildCompilerArguments( config, sourceFiles );
AjBuildConfig buildConfig = buildCompilerConfig( config );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ public CSharpCompiler()
// Compiler Implementation
// ----------------------------------------------------------------------

@Override
public String getCompilerId()
{
return "csharp";
}

public boolean canUpdateTarget( CompilerConfiguration configuration )
throws CompilerException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ public EclipseJavaCompiler()
// ----------------------------------------------------------------------
boolean errorsAsWarnings = false;

@Override
public String getCompilerId()
{
return "eclipse";
}

@Override
public CompilerResult performCompile( CompilerConfiguration config )
throws CompilerException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
* Ma&icirc;tre</a>
*
*/
@Component( role = Compiler.class, hint = "j2objc ")
@Component( role = Compiler.class, hint = "j2objc")
public class J2ObjCCompiler
extends AbstractCompiler
{
Expand Down Expand Up @@ -98,6 +98,12 @@ public J2ObjCCompiler()
// Compiler Implementation
// ----------------------------------------------------------------------

@Override
public String getCompilerId()
{
return "j2objc";
}

public boolean canUpdateTarget( CompilerConfiguration configuration )
throws CompilerException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@
public class JavacCompilerWithErrorProne
extends JavacCompiler
{
@Override
public String getCompilerId()
{
return "javac-with-errorprone";
}

private static class NonDelegatingClassLoader
extends URLClassLoader
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ public JavacCompiler()
// Compiler Implementation
// ----------------------------------------------------------------------

@Override
public String getCompilerId()
{
return "javac";
}

@Override
public CompilerResult performCompile( CompilerConfiguration config )
throws CompilerException
Expand All @@ -141,17 +147,7 @@ public CompilerResult performCompile( CompilerConfiguration config )
return new CompilerResult();
}

<<<<<<< Upstream, based on plexus/master
logCompiling( sourceFiles, config );
=======
if ( ( getLogger() != null ) && getLogger().isInfoEnabled() )
{
getLogger().info( "Compiling " + sourceFiles.length +
" source file" + ( sourceFiles.length == 1 ? "" : "s" ) +
" with " + config.describe( "javac" ) +
" to " + destinationDir.getAbsolutePath() );
}
>>>>>>> 97348ff describe compiler configuration on run

String[] args = buildCompilerArguments( config, sourceFiles );

Expand Down

0 comments on commit a086aef

Please sign in to comment.