@@ -389,6 +389,7 @@ public boolean process(OptionHelper helper, String option, String arg) {
389
389
390
390
XPREFER ("-Xprefer:" , "opt.prefer" , EXTENDED , BASIC , ONEOF , "source" , "newer" ),
391
391
392
+ // see enum PkgInfo
392
393
XPKGINFO ("-Xpkginfo:" , "opt.pkginfo" , EXTENDED , BASIC , ONEOF , "always" , "legacy" , "nonempty" ),
393
394
394
395
/* -O is a no-op, accepted for backward compatibility. */
@@ -686,7 +687,28 @@ private String helpSynopsis(Log log) {
686
687
687
688
// For -XpkgInfo:value
688
689
public enum PkgInfo {
689
- ALWAYS , LEGACY , NONEMPTY ;
690
+ /**
691
+ * Always generate package-info.class for every package-info.java file.
692
+ * The file may be empty if there annotations with a RetentionPolicy
693
+ * of CLASS or RUNTIME. This option may be useful in conjunction with
694
+ * build systems (such as Ant) that expect javac to generate at least
695
+ * one .class file for every .java file.
696
+ */
697
+ ALWAYS ,
698
+ /**
699
+ * Generate a package-info.class file if package-info.java contains
700
+ * annotations. The file may be empty if all the annotations have
701
+ * a RetentionPolicy of SOURCE.
702
+ * This value is just for backwards compatibility with earlier behavior.
703
+ * Either of the other two values are to be preferred to using this one.
704
+ */
705
+ LEGACY ,
706
+ /**
707
+ * Generate a package-info.class file if and only if there are annotations
708
+ * in package-info.java to be written into it.
709
+ */
710
+ NONEMPTY ;
711
+
690
712
public static PkgInfo get (Options options ) {
691
713
String v = options .get (XPKGINFO );
692
714
return (v == null
0 commit comments