Skip to content

Commit

Permalink
Remove obsolete --incompatible_ flags
Browse files Browse the repository at this point in the history
#6661
#7196
#7197

PiperOrigin-RevId: 241334080
  • Loading branch information
cushon authored and copybara-github committed Apr 1, 2019
1 parent 716e19c commit 998b410
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 232 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public boolean alwaysGenerateOutputMapping() {
this.proguardBinary = javaOptions.proguard;
this.extraProguardSpecs = ImmutableList.copyOf(javaOptions.extraProguardSpecs);
this.bundleTranslations = javaOptions.bundleTranslations;
this.toolchainLabel = javaOptions.getJavaToolchain();
this.toolchainLabel = javaOptions.javaToolchain;
this.runtimeLabel = javaOptions.javaBase;
this.javaOptimizationMode = javaOptions.javaOptimizationMode;
this.useLegacyBazelJavaTest = javaOptions.legacyBazelJavaTest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public ImportDepsCheckingLevelConverter() {

@Option(
name = "java_toolchain",
defaultValue = "null",
defaultValue = "@bazel_tools//tools/jdk:remote_toolchain",
converter = LabelConverter.class,
documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
effectTags = {OptionEffectTag.UNKNOWN},
Expand All @@ -91,7 +91,7 @@ public ImportDepsCheckingLevelConverter() {

@Option(
name = "host_java_toolchain",
defaultValue = "null",
defaultValue = "@bazel_tools//tools/jdk:remote_toolchain",
converter = LabelConverter.class,
documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
effectTags = {OptionEffectTag.UNKNOWN},
Expand All @@ -109,18 +109,6 @@ public ImportDepsCheckingLevelConverter() {
+ "tools during a build.")
public Label hostJavaBase;

@Option(
name = "incompatible_use_jdk10_as_host_javabase",
defaultValue = "true",
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
effectTags = {OptionEffectTag.UNKNOWN},
metadataTags = {
OptionMetadataTag.INCOMPATIBLE_CHANGE,
OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES
},
help = "If enabled, the default --host_javabase is JDK 10.")
public boolean useJDK10AsHostJavaBase;

@Option(
name = "incompatible_use_jdk11_as_host_javabase",
defaultValue = "true",
Expand Down Expand Up @@ -597,34 +585,6 @@ public ImportDepsCheckingLevelConverter() {
+ "--java_header_compilation is enabled.")
public boolean requireJavaToolchainHeaderCompilerDirect;

@Option(
name = "incompatible_use_remote_java_toolchain",
defaultValue = "true",
documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
effectTags = {OptionEffectTag.UNKNOWN},
metadataTags = {
OptionMetadataTag.INCOMPATIBLE_CHANGE,
OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES
},
help =
"If enabled, uses the remote Java tools for the default --java_toolchain. "
+ "See #7196.")
public boolean useRemoteJavaToolchain;

@Option(
name = "incompatible_use_remote_host_java_toolchain",
defaultValue = "true",
documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
effectTags = {OptionEffectTag.UNKNOWN},
metadataTags = {
OptionMetadataTag.INCOMPATIBLE_CHANGE,
OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES
},
help =
"If enabled, uses the remote Java tools for the default --host_java_toolchain. "
+ "See #7197.")
public boolean useRemoteHostJavaToolchain;

@Option(
name = "incompatible_disallow_resource_jars",
defaultValue = "false",
Expand Down Expand Up @@ -664,36 +624,11 @@ private Label getHostJavaBase() {
if (useJDK11AsHostJavaBase) {
return Label.parseAbsoluteUnchecked("@bazel_tools//tools/jdk:remote_jdk11");
}
if (useJDK10AsHostJavaBase) {
return Label.parseAbsoluteUnchecked("@bazel_tools//tools/jdk:remote_jdk10");
}
return Label.parseAbsoluteUnchecked("@bazel_tools//tools/jdk:host_jdk");
return Label.parseAbsoluteUnchecked("@bazel_tools//tools/jdk:remote_jdk10");
}
return hostJavaBase;
}

private Label getHostJavaToolchain() {
if (hostJavaToolchain == null) {
if (useRemoteHostJavaToolchain) {
return Label.parseAbsoluteUnchecked("@bazel_tools//tools/jdk:remote_toolchain");
} else {
return Label.parseAbsoluteUnchecked("@bazel_tools//tools/jdk:toolchain");
}
}
return hostJavaToolchain;
}

Label getJavaToolchain() {
if (javaToolchain == null) {
if (useRemoteJavaToolchain) {
return Label.parseAbsoluteUnchecked("@bazel_tools//tools/jdk:remote_toolchain");
} else {
return Label.parseAbsoluteUnchecked("@bazel_tools//tools/jdk:toolchain");
}
}
return javaToolchain;
}

@Override
public FragmentOptions getHost() {
JavaOptions host = (JavaOptions) getDefault();
Expand All @@ -702,7 +637,7 @@ public FragmentOptions getHost() {
host.jvmOpts = ImmutableList.of("-XX:ErrorFile=/dev/stderr");

host.javacOpts = hostJavacOpts;
host.javaToolchain = getHostJavaToolchain();
host.javaToolchain = hostJavaToolchain;

host.javaLauncher = hostJavaLauncher;

Expand Down
Loading

0 comments on commit 998b410

Please sign in to comment.