Skip to content

Commit 82ff10c

Browse files
authored
add paremeter to configure javac feature --enable-preview (#199)
Signed-off-by: Olivier Lamy <[email protected]>
1 parent 4c656c3 commit 82ff10c

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

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

+15
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ public class CompilerConfiguration
178178
*/
179179
private String debugFileName;
180180

181+
/**
182+
* configure <code>--enable-preview</code> of java compiler
183+
*/
184+
private boolean enablePreview;
185+
181186
// ----------------------------------------------------------------------
182187
//
183188
// ----------------------------------------------------------------------
@@ -632,6 +637,16 @@ public void setParameters(boolean parameters)
632637
this.parameters = parameters;
633638
}
634639

640+
public boolean isEnablePreview()
641+
{
642+
return enablePreview;
643+
}
644+
645+
public void setEnablePreview(boolean enablePreview)
646+
{
647+
this.enablePreview = enablePreview;
648+
}
649+
635650
public void setProc(String proc )
636651
{
637652
this.proc = proc;

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

+5
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,11 @@ public static String[] buildCompilerArguments( CompilerConfiguration config, Str
332332
args.add( "-parameters" );
333333
}
334334

335+
if ( config.isEnablePreview() )
336+
{
337+
args.add( "--enable-preview" );
338+
}
339+
335340
if ( config.isShowDeprecation() )
336341
{
337342
args.add( "-deprecation" );

0 commit comments

Comments
 (0)