aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main
diff options
context:
space:
mode:
authorGravatar Luis Fernando Pino Duque <lpino@google.com>2016-03-31 17:20:42 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2016-03-31 20:27:03 +0000
commit2eaff2e6c44d0b6a7017e6cb45334eac82dee7fb (patch)
tree3802242e5a3c80c437f8e48c2b816610c347c037 /src/main
parent91980e46699d41216302aa500fc8cdf3149d3d3b (diff)
Update the java flags to default as follows:
--java_langtools=@bazel_tools//tools/jdk:langtools --javabuilder_top=@bazel_tools//tools/jdk:JavaBuilder_deploy.jar --singlejar_top=@bazel_tools//tools/jdk:SingleJar_deploy.jar --genclass_top=@bazel_tools//tools/jdk:GenClass_deploy.jar --ijar_top=@bazel_tools//tools/jdk:ijar --javac_bootclasspath=@bazel_tools//tools/jdk:bootclasspath --javac_extdir=@bazel_tools//tools/jdk:extdir --java_toolchain=@bazel_tools//tools/jdk:toolchain --host_javabase=@bazel_tools//tools/jdk:jdk --javabase=@bazel_tools//tools/jdk:jdk -- MOS_MIGRATED_REVID=118692509
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/java/JavaOptions.java112
1 files changed, 19 insertions, 93 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 d73f5c049d..e7e5fef15a 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
@@ -16,9 +16,7 @@ package com.google.devtools.build.lib.rules.java;
import com.google.common.collect.ImmutableList;
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;
@@ -28,11 +26,9 @@ import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.cmdline.LabelSyntaxException;
import com.google.devtools.build.lib.rules.java.JavaConfiguration.JavaClasspathMode;
import com.google.devtools.build.lib.rules.java.JavaConfiguration.JavaOptimizationMode;
-import com.google.devtools.common.options.Converter;
import com.google.devtools.common.options.Converters.StringSetConverter;
import com.google.devtools.common.options.EnumConverter;
import com.google.devtools.common.options.Option;
-import com.google.devtools.common.options.OptionsParsingException;
import com.google.devtools.common.options.TriState;
import java.util.HashMap;
@@ -47,75 +43,6 @@ import java.util.Set;
public class JavaOptions extends FragmentOptions {
public static final String DEFAULT_LANGTOOLS = "//tools/jdk:langtools";
- /** Converter for --javabase and --host_javabase. */
- public static class JavabaseConverter implements Converter<String> {
- @Override
- public String convert(String input) throws OptionsParsingException {
- return input.isEmpty() ? Constants.TOOLS_REPOSITORY + "//tools/jdk:jdk" : input;
- }
-
- @Override
- public String getTypeDescription() {
- return "a string";
- }
- }
-
- /** 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.
*/
@@ -172,8 +99,7 @@ public class JavaOptions extends FragmentOptions {
}
@Option(name = "javabase",
- defaultValue = "",
- converter = JavabaseConverter.class,
+ defaultValue = "@bazel_tools//tools/jdk:jdk",
category = "version",
help = "JAVABASE used for the JDK invoked by Blaze. This is the "
+ "JAVABASE which will be used to execute external Java "
@@ -181,15 +107,14 @@ public class JavaOptions extends FragmentOptions {
public String javaBase;
@Option(name = "java_toolchain",
- defaultValue = "",
+ defaultValue = "@bazel_tools//tools/jdk:toolchain",
category = "version",
- converter = JavaToolchainConverter.class,
+ converter = LabelConverter.class,
help = "The name of the toolchain rule for Java.")
public Label javaToolchain;
@Option(name = "host_javabase",
- defaultValue = "",
- converter = JavabaseConverter.class,
+ defaultValue = "@bazel_tools//tools/jdk:jdk",
category = "version",
help = "JAVABASE used for the host JDK. This is the JAVABASE which is used to execute "
+ " tools during a build.")
@@ -290,51 +215,51 @@ public class JavaOptions extends FragmentOptions {
public StrictDepsMode strictJavaDeps;
@Option(name = "javabuilder_top",
- defaultValue = "",
+ defaultValue = "@bazel_tools//tools/jdk:JavaBuilder_deploy.jar",
category = "version",
- converter = JavaBuilderConverter.class,
+ converter = LabelConverter.class,
help = "Label of the filegroup that contains the JavaBuilder jar.")
public Label javaBuilderTop;
@Option(name = "singlejar_top",
- defaultValue = "",
+ defaultValue = "@bazel_tools//tools/jdk:SingleJar_deploy.jar",
category = "version",
- converter = SingleJarConverter.class,
+ converter = LabelConverter.class,
help = "Label of the filegroup that contains the SingleJar jar.")
public Label singleJarTop;
@Option(name = "genclass_top",
- defaultValue = "",
+ defaultValue = "@bazel_tools//tools/jdk:GenClass_deploy.jar",
category = "version",
- converter = GenClassConverter.class,
+ converter = LabelConverter.class,
help = "Label of the filegroup that contains the GenClass jar.")
public Label genClassTop;
@Option(name = "ijar_top",
- defaultValue = "",
+ defaultValue = "@bazel_tools//tools/jdk:ijar",
category = "version",
- converter = IjarConverter.class,
+ converter = LabelConverter.class,
help = "Label of the filegroup that contains the ijar binary.")
public Label iJarTop;
@Option(name = "java_langtools",
- defaultValue = "",
+ defaultValue = "@bazel_tools" + DEFAULT_LANGTOOLS,
category = "version",
- converter = LangtoolsConverter.class,
+ converter = LabelConverter.class,
help = "Label of the rule that produces the Java langtools jar.")
public Label javaLangtoolsJar;
@Option(name = "javac_bootclasspath",
- defaultValue = "",
+ defaultValue = "@bazel_tools//tools/jdk:bootclasspath",
category = "version",
- converter = BootclasspathConverter.class,
+ converter = LabelConverter.class,
help = "Label of the rule that produces the bootclasspath jars for javac to use.")
public Label javacBootclasspath;
@Option(name = "javac_extdir",
- defaultValue = "",
+ defaultValue = "@bazel_tools//tools/jdk:extdir",
category = "version",
- converter = ExtdirConverter.class,
+ converter = LabelConverter.class,
help = "Label of the rule that produces the extdir for javac to use.")
public Label javacExtdir;
@@ -419,6 +344,7 @@ 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.