diff options
author | 2017-12-07 08:10:03 -0800 | |
---|---|---|
committer | 2017-12-07 08:12:04 -0800 | |
commit | 8e3ef748768cb81c53680e1a8093f6249b00a096 (patch) | |
tree | 86c63efc60dd0b68e807b0698d9bdb8a46b8edcb /src/main/java/com/google/devtools/build/lib/rules/java/JavaHelper.java | |
parent | 45db110383c8dccb03979ea1745cd087c344a5a9 (diff) |
Move the javabase middleman to within JavaRuntimeInfo.
This is necessary bacause //tools/jdk:current_host_java_runtime is implemented in Skylark, and we don't (and shouldn't) have a way to create MiddlemanProvider from there.
However, we are planning to move to the the java_runtime_alias/java_host_runtime_alias rules as the exclusive representation of the javabase, so we need to be able to make one from Skylark.
Previously, this wasn't a problem, because if the javabase was a filegroup (like //tools/defaults:jdk), the path to the Java binary was taken from the configuration and the middleman from the filegroup, but since we are removing that information from the configuration, we can't do that anymore.
RELNOTES: None.
PiperOrigin-RevId: 178242307
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/java/JavaHelper.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/java/JavaHelper.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaHelper.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaHelper.java index d9a2bc456e..86908110de 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaHelper.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaHelper.java @@ -16,7 +16,6 @@ package com.google.devtools.build.lib.rules.java; import static com.google.devtools.build.lib.packages.BuildType.NODEP_LABEL_LIST; import com.google.devtools.build.lib.actions.Artifact; -import com.google.devtools.build.lib.analysis.AnalysisUtils; import com.google.devtools.build.lib.analysis.RuleContext; import com.google.devtools.build.lib.analysis.TransitiveInfoCollection; import com.google.devtools.build.lib.analysis.configuredtargets.RuleConfiguredTarget.Mode; @@ -159,8 +158,8 @@ public abstract class JavaHelper { /** Returns the artifacts required to invoke {@code javahome} relative binary in the action. */ public static NestedSet<Artifact> getHostJavabaseInputs( RuleContext ruleContext, String implicitAttributesSuffix) { - return AnalysisUtils.getMiddlemanFor( - ruleContext, ":host_jdk" + implicitAttributesSuffix, Mode.HOST); + return JavaLibraryHelper.getJavaBaseMiddleman(ruleContext.getPrerequisite( + ":host_jdk" + implicitAttributesSuffix, Mode.HOST)); } public static JavaRuntimeInfo getJavaRuntime(RuleContext ruleContext) { |