diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/genrule/BazelGenRuleRule.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/genrule/BazelGenRuleRule.java index 1d843da2cde635..ccc2c6c0427955 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/genrule/BazelGenRuleRule.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/genrule/BazelGenRuleRule.java @@ -24,6 +24,7 @@ import com.google.devtools.build.lib.rules.cpp.CppConfiguration; import com.google.devtools.build.lib.rules.genrule.GenRuleBaseRule; import com.google.devtools.build.lib.rules.java.JavaConfiguration; +import com.google.devtools.build.lib.rules.java.JavaSemantics; /** * Rule definition for genrule for Bazel. @@ -51,7 +52,7 @@ public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment env) .add(attr("stamp", BOOLEAN).value(false)) .add(attr(":cc_toolchain", LABEL).value(GenRuleBaseRule.CC_TOOLCHAIN)) - .add(attr(":host_jdk", LABEL).cfg(HOST).value(GenRuleBaseRule.HOST_JDK)) + .add(attr(":host_jdk", LABEL).cfg(HOST).value(JavaSemantics.HOST_JDK)) .build(); } diff --git a/src/main/java/com/google/devtools/build/lib/rules/genrule/BUILD b/src/main/java/com/google/devtools/build/lib/rules/genrule/BUILD index 81ab46717af36b..5c97ae19887de0 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/genrule/BUILD +++ b/src/main/java/com/google/devtools/build/lib/rules/genrule/BUILD @@ -12,7 +12,6 @@ java_library( "//src/main/java/com/google/devtools/build/lib:build-base", "//src/main/java/com/google/devtools/build/lib:events", "//src/main/java/com/google/devtools/build/lib:java-compilation", - "//src/main/java/com/google/devtools/build/lib:java-implicit-attributes", "//src/main/java/com/google/devtools/build/lib:packages", "//src/main/java/com/google/devtools/build/lib:vfs", "//src/main/java/com/google/devtools/build/lib/actions", diff --git a/src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleBase.java b/src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleBase.java index 1aab9b16480cba..407a45cb3debab 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleBase.java +++ b/src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleBase.java @@ -64,7 +64,7 @@ protected static boolean requiresCrosstool(String command) { return CROSSTOOL_MAKE_VARIABLE.matcher(command).find(); } - protected static boolean requiresJdk(String command) { + protected boolean requiresJdk(String command) { return JDK_MAKE_VARIABLE.matcher(command).find(); } diff --git a/src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleBaseRule.java b/src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleBaseRule.java index d4cb75844fb11a..544a03df21b230 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleBaseRule.java +++ b/src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleBaseRule.java @@ -37,9 +37,6 @@ import com.google.devtools.build.lib.rules.MakeVariableProvider; import com.google.devtools.build.lib.rules.cpp.CppConfiguration; import com.google.devtools.build.lib.rules.cpp.CppRuleClasses; -import com.google.devtools.build.lib.rules.java.JavaImplicitAttributes; -import com.google.devtools.build.lib.rules.java.JavaSemantics; -import com.google.devtools.build.lib.rules.java.Jvm; import com.google.devtools.build.lib.syntax.Type; import com.google.devtools.build.lib.util.FileTypeSet; @@ -66,22 +63,6 @@ public Label resolve(Rule rule, AttributeMap attributes, BuildConfiguration conf } }; - /** - * Late-bound dependency on the host JDK iff the genrule has make variables that need - * that rule. - */ - public static final Attribute.LateBoundLabel HOST_JDK = - new Attribute.LateBoundLabel( - JavaImplicitAttributes.JDK_LABEL, Jvm.class) { - @Override - public Label resolve(Rule rule, AttributeMap attributes, BuildConfiguration configuration) { - return attributes != null - && GenRuleBase.requiresJdk(attributes.get("cmd", Type.STRING)) - ? JavaSemantics.HOST_JDK.resolve(rule, attributes, configuration) - : null; - } - }; - @Override public RuleClass build( RuleClass.Builder builder, RuleDefinitionEnvironment env) {