Skip to content

Commit 7476614

Browse files
committed
#154 Introduce Compiler.supportsIncrementalCompilation
1 parent c94b4b2 commit 7476614

File tree

2 files changed

+16
-0
lines changed
  • plexus-compiler-api/src/main/java/org/codehaus/plexus/compiler
  • plexus-compilers/plexus-compiler-eclipse/src/main/java/org/codehaus/plexus/compiler/eclipse

2 files changed

+16
-0
lines changed

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

+11
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,15 @@ List<CompilerError> compile( CompilerConfiguration configuration )
8989
*/
9090
String[] createCommandLine( CompilerConfiguration config )
9191
throws CompilerException;
92+
93+
94+
/**
95+
* Based on this flag the caller can decide the strategy how to compile. E.g. is incrementCompilation is not supported,
96+
* it could decide to clear to outputDirectory to enforce a complete recompilation.
97+
*
98+
* @return {@code true} if incrementalCompilation is supported, otherwise {@code false}
99+
*/
100+
default boolean supportsIncrementalCompilation() {
101+
return false;
102+
}
92103
}

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

+5
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,11 @@ public String[] createCommandLine( CompilerConfiguration config )
684684
return null;
685685
}
686686

687+
@Override
688+
public boolean supportsIncrementalCompilation()
689+
{
690+
return true;
691+
}
687692

688693
/**
689694
* Change any Maven Java version number to ECJ's version number. Do not check the validity

0 commit comments

Comments
 (0)