diff options
author | 2016-03-18 22:04:29 +0000 | |
---|---|---|
committer | 2016-03-21 09:36:13 +0000 | |
commit | 73ddd4d3bee1e8d2ac6f76bd25c2aa712852c708 (patch) | |
tree | 1e8bdbb8ec6b5aff897e4ee91e438bd0d9ded196 /src/main | |
parent | da9410cff80eeeaf080fa0149c6fe4d583124987 (diff) |
Rollback of commit aac3b7ee0f1889c6afe4c0b4432d9f1597230dfb.
*** Reason for rollback ***
Breaks the query command
*** Original change description ***
Update the java_langtools flag to default to @bazel_tools//tools/jdk:langtools.
--
MOS_MIGRATED_REVID=117588472
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/java/JavaOptions.java | 90 |
1 files changed, 73 insertions, 17 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaOptions.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaOptions.java index 07b84c13a8..d73f5c049d 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaOptions.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaOptions.java @@ -18,6 +18,7 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Multimap; import com.google.devtools.build.lib.Constants; import com.google.devtools.build.lib.analysis.config.BuildConfiguration; +import com.google.devtools.build.lib.analysis.config.BuildConfiguration.DefaultLabelConverter; import com.google.devtools.build.lib.analysis.config.BuildConfiguration.LabelConverter; import com.google.devtools.build.lib.analysis.config.BuildConfiguration.StrictDepsConverter; import com.google.devtools.build.lib.analysis.config.BuildConfiguration.StrictDepsMode; @@ -59,6 +60,62 @@ public class JavaOptions extends FragmentOptions { } } + /** Converter for --java_langtools. */ + public static class LangtoolsConverter extends DefaultLabelConverter { + public LangtoolsConverter() { + super(Constants.TOOLS_REPOSITORY + DEFAULT_LANGTOOLS); + } + } + + /** Converter for --javac_bootclasspath. */ + public static class BootclasspathConverter extends DefaultLabelConverter { + public BootclasspathConverter() { + super(Constants.TOOLS_REPOSITORY + "//tools/jdk:bootclasspath"); + } + } + + /** Converter for --javac_extdir. */ + public static class ExtdirConverter extends DefaultLabelConverter { + public ExtdirConverter() { + super(Constants.TOOLS_REPOSITORY + "//tools/jdk:extdir"); + } + } + + /** Converter for --javabuilder_top. */ + public static class JavaBuilderConverter extends DefaultLabelConverter { + public JavaBuilderConverter() { + super(Constants.TOOLS_REPOSITORY + "//tools/jdk:JavaBuilder_deploy.jar"); + } + } + + /** Converter for --singlejar_top. */ + public static class SingleJarConverter extends DefaultLabelConverter { + public SingleJarConverter() { + super(Constants.TOOLS_REPOSITORY + "//tools/jdk:SingleJar_deploy.jar"); + } + } + + /** Converter for --genclass_top. */ + public static class GenClassConverter extends DefaultLabelConverter { + public GenClassConverter() { + super(Constants.TOOLS_REPOSITORY + "//tools/jdk:GenClass_deploy.jar"); + } + } + + /** Converter for --ijar_top. */ + public static class IjarConverter extends DefaultLabelConverter { + public IjarConverter() { + super(Constants.TOOLS_REPOSITORY + "//tools/jdk:ijar"); + } + } + + /** Converter for --java_toolchain. */ + public static class JavaToolchainConverter extends DefaultLabelConverter { + public JavaToolchainConverter() { + super(Constants.TOOLS_REPOSITORY + "//tools/jdk:toolchain"); + } + } + /** * Converter for the --javawarn option. */ @@ -124,9 +181,9 @@ public class JavaOptions extends FragmentOptions { public String javaBase; @Option(name = "java_toolchain", - defaultValue = "@bazel_tools//tools/jdk:toolchain", + defaultValue = "", category = "version", - converter = LabelConverter.class, + converter = JavaToolchainConverter.class, help = "The name of the toolchain rule for Java.") public Label javaToolchain; @@ -233,51 +290,51 @@ public class JavaOptions extends FragmentOptions { public StrictDepsMode strictJavaDeps; @Option(name = "javabuilder_top", - defaultValue = "@bazel_tools//tools/jdk:JavaBuilder_deploy.jar", + defaultValue = "", category = "version", - converter = LabelConverter.class, + converter = JavaBuilderConverter.class, help = "Label of the filegroup that contains the JavaBuilder jar.") public Label javaBuilderTop; @Option(name = "singlejar_top", - defaultValue = "@bazel_tools//tools/jdk:SingleJar_deploy.jar", + defaultValue = "", category = "version", - converter = LabelConverter.class, + converter = SingleJarConverter.class, help = "Label of the filegroup that contains the SingleJar jar.") public Label singleJarTop; @Option(name = "genclass_top", - defaultValue = "@bazel_tools//tools/jdk:GenClass_deploy.jar", + defaultValue = "", category = "version", - converter = LabelConverter.class, + converter = GenClassConverter.class, help = "Label of the filegroup that contains the GenClass jar.") public Label genClassTop; @Option(name = "ijar_top", - defaultValue = "@bazel_tools//tools/jdk:ijar", + defaultValue = "", category = "version", - converter = LabelConverter.class, + converter = IjarConverter.class, help = "Label of the filegroup that contains the ijar binary.") public Label iJarTop; @Option(name = "java_langtools", - defaultValue = "@bazel_tools" + DEFAULT_LANGTOOLS, + defaultValue = "", category = "version", - converter = LabelConverter.class, + converter = LangtoolsConverter.class, help = "Label of the rule that produces the Java langtools jar.") public Label javaLangtoolsJar; @Option(name = "javac_bootclasspath", - defaultValue = "@bazel_tools//tools/jdk:bootclasspath", + defaultValue = "", category = "version", - converter = LabelConverter.class, + converter = BootclasspathConverter.class, help = "Label of the rule that produces the bootclasspath jars for javac to use.") public Label javacBootclasspath; @Option(name = "javac_extdir", - defaultValue = "@bazel_tools//tools/jdk:extdir", + defaultValue = "", category = "version", - converter = LabelConverter.class, + converter = ExtdirConverter.class, help = "Label of the rule that produces the extdir for javac to use.") public Label javacExtdir; @@ -362,7 +419,6 @@ public class JavaOptions extends FragmentOptions { host.singleJarTop = singleJarTop; host.genClassTop = genClassTop; host.iJarTop = iJarTop; - host.javacBootclasspath = javacBootclasspath; // Java builds often contain complicated code generators for which // incremental build performance is important. |