@@ -290,12 +290,21 @@ public static String[] buildCompilerArguments( CompilerConfiguration config, Str
290
290
args .add ( buffer .toString () );
291
291
}
292
292
if ( config .getProcessorPathEntries () != null && !config .getProcessorPathEntries ().isEmpty () ) {
293
- args .add ( "-processorpath" );
294
293
294
+ if (!isPreJava9 (config ) && Arrays .asList (sourceFiles ).contains ("module-info.java" )){
295
+ args .add ( "--processor-module-path" );
296
+
297
+ } else {
298
+ args .add ( "-processorpath" );
299
+
300
+ }
295
301
args .add ( getPathString ( config .getProcessorPathEntries () ) );
296
302
}
303
+
297
304
}
298
305
306
+
307
+
299
308
if ( config .isOptimize () )
300
309
{
301
310
args .add ( "-O" );
@@ -439,29 +448,59 @@ private static boolean isPreJava14( CompilerConfiguration config )
439
448
*/
440
449
private static boolean isPreJava16 ( CompilerConfiguration config )
441
450
{
442
- String v = config .getCompilerVersion ();
451
+ String v = config .getReleaseVersion ();
443
452
444
453
if ( v == null )
445
454
{
446
- //mkleint: i haven't completely understood the reason for the
447
- //compiler version parameter, checking source as well, as most projects will have this one set, not the compiler
448
- String s = config .getSourceVersion ();
449
- if ( s == null )
450
- {
451
- //now return true, as the 1.6 version is not the default - 1.4 is.
452
- return true ;
453
- }
454
- return s .startsWith ( "1.5" ) || s .startsWith ( "1.4" ) || s .startsWith ( "1.3" ) || s .startsWith ( "1.2" )
455
- || s .startsWith ( "1.1" ) || s .startsWith ( "1.0" );
455
+ v = config .getCompilerVersion ();
456
456
}
457
457
458
- return v .startsWith ( "1.5" ) || v .startsWith ( "1.4" ) || v .startsWith ( "1.3" ) || v .startsWith ( "1.2" )
458
+ if ( v == null )
459
+ {
460
+ v = config .getSourceVersion ();
461
+ }
462
+
463
+ if ( v == null )
464
+ {
465
+ return true ;
466
+ }
467
+
468
+ return v .startsWith ( "5" ) || v .startsWith ( "1.5" ) || v .startsWith ( "1.4" ) || v .startsWith ( "1.3" ) || v .startsWith ( "1.2" )
459
469
|| v .startsWith ( "1.1" ) || v .startsWith ( "1.0" );
460
470
}
461
471
462
472
private static boolean isPreJava18 ( CompilerConfiguration config )
463
473
{
464
- String v = config .getCompilerVersion ();
474
+ String v = config .getReleaseVersion ();
475
+
476
+ if ( v == null )
477
+ {
478
+ v = config .getCompilerVersion ();
479
+ }
480
+
481
+ if ( v == null )
482
+ {
483
+ v = config .getSourceVersion ();
484
+ }
485
+
486
+ if ( v == null )
487
+ {
488
+ return true ;
489
+ }
490
+
491
+ return v .startsWith ( "7" ) || v .startsWith ( "1.7" ) || v .startsWith ( "6" ) ||v .startsWith ( "1.6" ) || v .startsWith ( "1.5" ) || v .startsWith ( "1.4" )
492
+ || v .startsWith ( "1.3" ) || v .startsWith ( "1.2" ) || v .startsWith ( "1.1" ) || v .startsWith ( "1.0" );
493
+ }
494
+
495
+ private static boolean isPreJava9 ( CompilerConfiguration config )
496
+ {
497
+
498
+ String v = config .getReleaseVersion ();
499
+
500
+ if ( v == null )
501
+ {
502
+ v = config .getCompilerVersion ();
503
+ }
465
504
466
505
if ( v == null )
467
506
{
@@ -473,7 +512,7 @@ private static boolean isPreJava18( CompilerConfiguration config )
473
512
return true ;
474
513
}
475
514
476
- return v .startsWith ( "1.7" ) || v .startsWith ( "1.6" ) || v .startsWith ( "1.5" ) || v .startsWith ( "1.4" )
515
+ return v .startsWith ( "8" ) || v . startsWith ( "1.8" ) || v . startsWith ( "7" ) || v . startsWith ( " 1.7" ) || v .startsWith ( "1.6" ) || v .startsWith ( "1.5" ) || v .startsWith ( "1.4" )
477
516
|| v .startsWith ( "1.3" ) || v .startsWith ( "1.2" ) || v .startsWith ( "1.1" ) || v .startsWith ( "1.0" );
478
517
}
479
518
0 commit comments