mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-15 16:44:36 +02:00
8022744: javac -Xpkginfo command's documentation is sparse
Reviewed-by: darcy
This commit is contained in:
parent
50d89c0ca7
commit
9ffac2cf47
1 changed files with 23 additions and 1 deletions
|
@ -389,6 +389,7 @@ public enum Option {
|
||||||
|
|
||||||
XPREFER("-Xprefer:", "opt.prefer", EXTENDED, BASIC, ONEOF, "source", "newer"),
|
XPREFER("-Xprefer:", "opt.prefer", EXTENDED, BASIC, ONEOF, "source", "newer"),
|
||||||
|
|
||||||
|
// see enum PkgInfo
|
||||||
XPKGINFO("-Xpkginfo:", "opt.pkginfo", EXTENDED, BASIC, ONEOF, "always", "legacy", "nonempty"),
|
XPKGINFO("-Xpkginfo:", "opt.pkginfo", EXTENDED, BASIC, ONEOF, "always", "legacy", "nonempty"),
|
||||||
|
|
||||||
/* -O is a no-op, accepted for backward compatibility. */
|
/* -O is a no-op, accepted for backward compatibility. */
|
||||||
|
@ -686,7 +687,28 @@ public enum Option {
|
||||||
|
|
||||||
// For -XpkgInfo:value
|
// For -XpkgInfo:value
|
||||||
public enum PkgInfo {
|
public enum PkgInfo {
|
||||||
ALWAYS, LEGACY, NONEMPTY;
|
/**
|
||||||
|
* Always generate package-info.class for every package-info.java file.
|
||||||
|
* The file may be empty if there annotations with a RetentionPolicy
|
||||||
|
* of CLASS or RUNTIME. This option may be useful in conjunction with
|
||||||
|
* build systems (such as Ant) that expect javac to generate at least
|
||||||
|
* one .class file for every .java file.
|
||||||
|
*/
|
||||||
|
ALWAYS,
|
||||||
|
/**
|
||||||
|
* Generate a package-info.class file if package-info.java contains
|
||||||
|
* annotations. The file may be empty if all the annotations have
|
||||||
|
* a RetentionPolicy of SOURCE.
|
||||||
|
* This value is just for backwards compatibility with earlier behavior.
|
||||||
|
* Either of the other two values are to be preferred to using this one.
|
||||||
|
*/
|
||||||
|
LEGACY,
|
||||||
|
/**
|
||||||
|
* Generate a package-info.class file if and only if there are annotations
|
||||||
|
* in package-info.java to be written into it.
|
||||||
|
*/
|
||||||
|
NONEMPTY;
|
||||||
|
|
||||||
public static PkgInfo get(Options options) {
|
public static PkgInfo get(Options options) {
|
||||||
String v = options.get(XPKGINFO);
|
String v = options.get(XPKGINFO);
|
||||||
return (v == null
|
return (v == null
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue