Skip to content

Commit

Permalink
Java tools: flip incompatible flags for using remote java tools.
Browse files Browse the repository at this point in the history
Fixes #7196 #7197

Closes #7423.

PiperOrigin-RevId: 234469160
  • Loading branch information
iirina authored and copybara-github committed Feb 18, 2019
1 parent 4eea5c6 commit 4d935d5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ public ImportDepsCheckingLevelConverter() {

@Option(
name = "incompatible_use_remote_java_toolchain",
defaultValue = "false",
defaultValue = "true",
documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
effectTags = {OptionEffectTag.UNKNOWN},
metadataTags = {
Expand All @@ -600,7 +600,7 @@ public ImportDepsCheckingLevelConverter() {

@Option(
name = "incompatible_use_remote_host_java_toolchain",
defaultValue = "false",
defaultValue = "true",
documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
effectTags = {OptionEffectTag.UNKNOWN},
metadataTags = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,19 @@ public void setupMockClient(MockToolsConfig config, List<String> workspaceConten
" genclass = ['GenClass_deploy.jar'],",
" ijar = ['ijar'],",
")",
"java_toolchain(",
" name = 'remote_toolchain',",
" source_version = '8',",
" target_version = '8',",
" bootclasspath = [':bootclasspath'],",
" extclasspath = [':extclasspath'],",
" javac = [':langtools'],",
" javabuilder = ['JavaBuilder_deploy.jar'],",
" header_compiler = ['turbine_deploy.jar'],",
" singlejar = ['SingleJar_deploy.jar'],",
" genclass = ['GenClass_deploy.jar'],",
" ijar = ['ijar'],",
")",
"java_runtime(name = 'jdk', srcs = [])",
"java_runtime(name = 'host_jdk', srcs = [])",
"java_runtime(name = 'remote_jdk', srcs = [])",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1899,7 +1899,10 @@ public void javaToolchainFlag_default() throws Exception {
configuredTarget.get(
new SkylarkKey(Label.parseAbsolute("//foo:rule.bzl", ImmutableMap.of()), "result"));
Label javaToolchainLabel = ((Label) info.getValue("java_toolchain_label"));
assertThat(javaToolchainLabel.toString()).endsWith("jdk:toolchain");
assertThat(
javaToolchainLabel.toString().endsWith("jdk:remote_toolchain")
|| javaToolchainLabel.toString().endsWith("jdk:toolchain"))
.isTrue();
}

@Test
Expand Down

0 comments on commit 4d935d5

Please sign in to comment.