Skip to content

Commit a086aef

Browse files
committed
describe compiler configuration on run
1 parent 4385845 commit a086aef

File tree

7 files changed

+41
-19
lines changed

7 files changed

+41
-19
lines changed

plexus-compiler-api/src/main/java/org/codehaus/plexus/compiler/AbstractCompiler.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ protected AbstractCompiler( CompilerOutputStyle compilerOutputStyle, String inpu
7474
//
7575
// ----------------------------------------------------------------------
7676

77+
public abstract String getCompilerId();
78+
7779
public CompilerResult performCompile(CompilerConfiguration configuration)
7880
throws CompilerException
7981
{
@@ -308,7 +310,8 @@ protected void logCompiling( String[] sourceFiles, CompilerConfiguration config
308310
config.getWorkingDirectory().toPath().relativize( new File( config.getOutputLocation() ).toPath() ).toString();
309311
getLogger().info( "Compiling " +
310312
( sourceFiles == null ? "" : ( sourceFiles.length + " source file" + ( sourceFiles.length == 1 ? " " : "s " ) ) ) +
311-
"to " + to );
313+
"with " + config.describe( getCompilerId() ) +
314+
" to " + to );
312315
}
313316
}
314317
}

plexus-compilers/plexus-compiler-aspectj/src/main/java/org/codehaus/plexus/compiler/ajc/AspectJCompiler.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,12 @@ public AspectJCompiler()
303303
super( CompilerOutputStyle.ONE_OUTPUT_FILE_PER_INPUT_FILE, "", ".class", null );
304304
}
305305

306+
@Override
307+
public String getCompilerId()
308+
{
309+
return "aspectj";
310+
}
311+
306312
public CompilerResult performCompile( CompilerConfiguration config )
307313
throws CompilerException
308314
{
@@ -320,14 +326,7 @@ public CompilerResult performCompile( CompilerConfiguration config )
320326
return new CompilerResult();
321327
}
322328

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

332331
// String[] args = buildCompilerArguments( config, sourceFiles );
333332
AjBuildConfig buildConfig = buildCompilerConfig( config );

plexus-compilers/plexus-compiler-csharp/src/main/java/org/codehaus/plexus/compiler/csharp/CSharpCompiler.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ public CSharpCompiler()
8484
// Compiler Implementation
8585
// ----------------------------------------------------------------------
8686

87+
@Override
88+
public String getCompilerId()
89+
{
90+
return "csharp";
91+
}
92+
8793
public boolean canUpdateTarget( CompilerConfiguration configuration )
8894
throws CompilerException
8995
{

plexus-compilers/plexus-compiler-eclipse/src/main/java/org/codehaus/plexus/compiler/eclipse/EclipseJavaCompiler.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ public EclipseJavaCompiler()
7272
// ----------------------------------------------------------------------
7373
boolean errorsAsWarnings = false;
7474

75+
@Override
76+
public String getCompilerId()
77+
{
78+
return "eclipse";
79+
}
80+
7581
@Override
7682
public CompilerResult performCompile( CompilerConfiguration config )
7783
throws CompilerException

plexus-compilers/plexus-compiler-j2objc/src/main/java/org/codehaus/plexus/compiler/j2objc/J2ObjCCompiler.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
* Ma&icirc;tre</a>
5252
*
5353
*/
54-
@Component( role = Compiler.class, hint = "j2objc ")
54+
@Component( role = Compiler.class, hint = "j2objc")
5555
public class J2ObjCCompiler
5656
extends AbstractCompiler
5757
{
@@ -98,6 +98,12 @@ public J2ObjCCompiler()
9898
// Compiler Implementation
9999
// ----------------------------------------------------------------------
100100

101+
@Override
102+
public String getCompilerId()
103+
{
104+
return "j2objc";
105+
}
106+
101107
public boolean canUpdateTarget( CompilerConfiguration configuration )
102108
throws CompilerException
103109
{

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@
4444
public class JavacCompilerWithErrorProne
4545
extends JavacCompiler
4646
{
47+
@Override
48+
public String getCompilerId()
49+
{
50+
return "javac-with-errorprone";
51+
}
52+
4753
private static class NonDelegatingClassLoader
4854
extends URLClassLoader
4955
{

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

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ public JavacCompiler()
123123
// Compiler Implementation
124124
// ----------------------------------------------------------------------
125125

126+
@Override
127+
public String getCompilerId()
128+
{
129+
return "javac";
130+
}
131+
126132
@Override
127133
public CompilerResult performCompile( CompilerConfiguration config )
128134
throws CompilerException
@@ -141,17 +147,7 @@ public CompilerResult performCompile( CompilerConfiguration config )
141147
return new CompilerResult();
142148
}
143149

144-
<<<<<<< Upstream, based on plexus/master
145150
logCompiling( sourceFiles, config );
146-
=======
147-
if ( ( getLogger() != null ) && getLogger().isInfoEnabled() )
148-
{
149-
getLogger().info( "Compiling " + sourceFiles.length +
150-
" source file" + ( sourceFiles.length == 1 ? "" : "s" ) +
151-
" with " + config.describe( "javac" ) +
152-
" to " + destinationDir.getAbsolutePath() );
153-
}
154-
>>>>>>> 97348ff describe compiler configuration on run
155151

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

0 commit comments

Comments
 (0)