Skip to content

Commit 13161ad

Browse files
authored
[MCOMPILER-402] Add implicitOption to CompilerConfiguration (#202)
Co-authored-by: Piotrek Żygieło <[email protected]>
1 parent f1a5a2b commit 13161ad

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

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

+13
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ public class CompilerConfiguration
183183
*/
184184
private boolean enablePreview;
185185

186+
/** value of <code>-implicit:</code> of java compiler */
187+
private String implicitOption;
188+
186189
// ----------------------------------------------------------------------
187190
//
188191
// ----------------------------------------------------------------------
@@ -799,4 +802,14 @@ public void setForceJavacCompilerUse( boolean forceJavacCompilerUse )
799802
{
800803
this.forceJavacCompilerUse = forceJavacCompilerUse;
801804
}
805+
806+
public String getImplicitOption()
807+
{
808+
return implicitOption;
809+
}
810+
811+
public void setImplicitOption( String implicitOption )
812+
{
813+
this.implicitOption = implicitOption;
814+
}
802815
}

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

+5
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,11 @@ public static String[] buildCompilerArguments( CompilerConfiguration config, Str
337337
args.add( "--enable-preview" );
338338
}
339339

340+
if ( config.getImplicitOption() != null )
341+
{
342+
args.add( "-implicit:" + config.getImplicitOption() );
343+
}
344+
340345
if ( config.isShowDeprecation() )
341346
{
342347
args.add( "-deprecation" );

0 commit comments

Comments
 (0)