aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/nativedeps
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2016-07-01 05:00:14 +0000
committerGravatar Lukacs Berki <lberki@google.com>2016-07-01 07:12:56 +0000
commit38ad0bfb006188c874c28e804419aa2fa8cd8376 (patch)
treea2f49b3a5f3fa46434dfa9008ffd4cc48237f4f8 /src/main/java/com/google/devtools/build/lib/rules/nativedeps
parentf3cf015a2a926d93240ffe1af38035a0682c3628 (diff)
RELNOTES: Use the correct build configuration for shared native deps during Android split transitions.
-- MOS_MIGRATED_REVID=126378169
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/nativedeps')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/nativedeps/NativeDepsHelper.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/nativedeps/NativeDepsHelper.java b/src/main/java/com/google/devtools/build/lib/rules/nativedeps/NativeDepsHelper.java
index ed1bdbbfb8..0b36ed61aa 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/nativedeps/NativeDepsHelper.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/nativedeps/NativeDepsHelper.java
@@ -35,6 +35,7 @@ import com.google.devtools.build.lib.rules.cpp.LinkerInputs.LibraryToLink;
import com.google.devtools.build.lib.util.Fingerprint;
import com.google.devtools.build.lib.util.Preconditions;
import com.google.devtools.build.lib.vfs.PathFragment;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
@@ -61,9 +62,10 @@ public abstract class NativeDepsHelper {
private static final CppLinkAction.LinkArtifactFactory SHAREABLE_LINK_ARTIFACT_FACTORY =
new CppLinkAction.LinkArtifactFactory() {
@Override
- public Artifact create(RuleContext ruleContext, PathFragment rootRelativePath) {
+ public Artifact create(RuleContext ruleContext, BuildConfiguration configuration,
+ PathFragment rootRelativePath) {
return ruleContext.getShareableArtifact(rootRelativePath,
- ruleContext.getConfiguration().getBinDirectory());
+ configuration.getBinDirectory());
}
};
@@ -169,7 +171,8 @@ public abstract class NativeDepsHelper {
CppHelper.resolveLinkstamps(ruleContext, linkParams);
List<Artifact> buildInfoArtifacts = linkstamps.isEmpty()
? ImmutableList.<Artifact>of()
- : ruleContext.getBuildInfo(CppBuildInfo.KEY);
+ : ruleContext.getAnalysisEnvironment().getBuildInfo(
+ ruleContext, CppBuildInfo.KEY, configuration);
boolean shareNativeDeps = configuration.getFragment(CppConfiguration.class).shareNativeDeps();
NestedSet<LibraryToLink> linkerInputs = linkParams.getLibraries();
@@ -178,7 +181,7 @@ public abstract class NativeDepsHelper {
LinkerInputs.toLibraryArtifacts(linkerInputs),
linkopts, linkstamps.keySet(), buildInfoArtifacts,
ruleContext.getFeatures()),
- ruleContext.getConfiguration().getBinDirectory())
+ configuration.getBinDirectory())
: nativeDeps;
CppLinkAction.Builder builder = new CppLinkAction.Builder(
ruleContext, sharedLibrary, configuration, toolchain);
@@ -285,7 +288,6 @@ public abstract class NativeDepsHelper {
for (String feature : features) {
fp.addStrings(feature);
}
- return new PathFragment(
- "_nativedeps/" + fp.hexDigestAndReset() + ".so");
+ return new PathFragment("_nativedeps/" + fp.hexDigestAndReset() + ".so");
}
}