aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools
diff options
context:
space:
mode:
authorGravatar ruperts <ruperts@google.com>2018-07-30 14:03:05 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-07-30 14:05:26 -0700
commitc80185c1b6ea5d746b4a38b8b5b8b5ad4682bc89 (patch)
tree25ad6516286c5f2d89fbc431d27aff830ce86230 /src/main/java/com/google/devtools
parent60c288a5fb06f13d47de066c1e252339bd181e20 (diff)
Internal change
PiperOrigin-RevId: 206642715
Diffstat (limited to 'src/main/java/com/google/devtools')
-rw-r--r--src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaSemantics.java33
-rw-r--r--src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java27
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java51
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/android/AndroidLibrary.java9
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/android/NativeLibs.java4
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingInfo.java78
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/java/proto/JplCcLinkParams.java29
7 files changed, 94 insertions, 137 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaSemantics.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaSemantics.java
index f6573077c7..6f2fbff664 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaSemantics.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaSemantics.java
@@ -21,9 +21,7 @@ import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
-import com.google.common.collect.Streams;
import com.google.devtools.build.lib.actions.Artifact;
-import com.google.devtools.build.lib.analysis.AnalysisUtils;
import com.google.devtools.build.lib.analysis.RuleConfiguredTargetBuilder;
import com.google.devtools.build.lib.analysis.RuleContext;
import com.google.devtools.build.lib.analysis.Runfiles;
@@ -44,6 +42,9 @@ import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
import com.google.devtools.build.lib.collect.nestedset.Order;
import com.google.devtools.build.lib.packages.BuildType;
import com.google.devtools.build.lib.packages.TargetUtils;
+import com.google.devtools.build.lib.rules.cpp.AbstractCcLinkParamsStore;
+import com.google.devtools.build.lib.rules.cpp.CcLinkParams;
+import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore;
import com.google.devtools.build.lib.rules.cpp.CcLinkingInfo;
import com.google.devtools.build.lib.rules.java.DeployArchiveBuilder;
import com.google.devtools.build.lib.rules.java.DeployArchiveBuilder.Compression;
@@ -561,20 +562,20 @@ public class BazelJavaSemantics implements JavaSemantics {
Artifact gensrcJar,
RuleConfiguredTargetBuilder ruleBuilder) {
// TODO(plf): Figure out whether we can remove support for C++ dependencies in Bazel.
- ImmutableList<? extends TransitiveInfoCollection> deps =
- javaCommon.targetsTreatedAsDeps(ClasspathType.BOTH);
- ImmutableList<CcLinkingInfo> ccLinkingInfos =
- ImmutableList.<CcLinkingInfo>builder()
- .addAll(AnalysisUtils.getProviders(deps, CcLinkingInfo.PROVIDER))
- .addAll(
- Streams.stream(AnalysisUtils.getProviders(deps, JavaCcLinkParamsProvider.class))
- .map(JavaCcLinkParamsProvider::getCcLinkingInfo)
- .collect(ImmutableList.toImmutableList()))
- .build();
-
- // TODO(plf): return empty CcLinkingInfo because deps= in Java targets should not contain C++
- // targets. We need to make sure that no one uses this functionality, though.
- ruleBuilder.addNativeDeclaredProvider(CcLinkingInfo.merge(ccLinkingInfos));
+ CcLinkingInfo.Builder ccLinkingInfoBuilder = CcLinkingInfo.Builder.create();
+ ccLinkingInfoBuilder.setCcLinkParamsStore(
+ new CcLinkParamsStore(
+ new AbstractCcLinkParamsStore() {
+ @Override
+ protected void collect(
+ CcLinkParams.Builder builder, boolean linkingStatically, boolean linkShared) {
+ builder.addTransitiveTargets(
+ javaCommon.targetsTreatedAsDeps(ClasspathType.BOTH),
+ JavaCcLinkParamsProvider.TO_LINK_PARAMS,
+ CcLinkParamsStore.TO_LINK_PARAMS);
+ }
+ }));
+ ruleBuilder.addNativeDeclaredProvider(ccLinkingInfoBuilder.build());
}
// TODO(dmarting): simplify that logic when we remove the legacy Bazel java_test behavior.
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
index 9a71ae9f55..51fe643793 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
@@ -18,11 +18,9 @@ import static java.nio.charset.StandardCharsets.ISO_8859_1;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Streams;
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.actions.ParamFileInfo;
import com.google.devtools.build.lib.actions.ParameterFile;
-import com.google.devtools.build.lib.analysis.AnalysisUtils;
import com.google.devtools.build.lib.analysis.FilesToRunProvider;
import com.google.devtools.build.lib.analysis.RuleContext;
import com.google.devtools.build.lib.analysis.Runfiles;
@@ -42,6 +40,9 @@ import com.google.devtools.build.lib.analysis.test.InstrumentedFilesCollector.In
import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.collect.nestedset.NestedSet;
import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
+import com.google.devtools.build.lib.rules.cpp.AbstractCcLinkParamsStore;
+import com.google.devtools.build.lib.rules.cpp.CcLinkParams;
+import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore;
import com.google.devtools.build.lib.rules.cpp.CcLinkingInfo;
import com.google.devtools.build.lib.rules.python.PyCcLinkParamsProvider;
import com.google.devtools.build.lib.rules.python.PyCommon;
@@ -364,16 +365,18 @@ public class BazelPythonSemantics implements PythonSemantics {
@Override
public CcLinkingInfo buildCcLinkingInfoProvider(
Iterable<? extends TransitiveInfoCollection> deps) {
- ImmutableList<CcLinkingInfo> ccLinkingInfos =
- ImmutableList.<CcLinkingInfo>builder()
- .addAll(AnalysisUtils.getProviders(deps, CcLinkingInfo.PROVIDER))
- .addAll(
- Streams.stream(AnalysisUtils.getProviders(deps, PyCcLinkParamsProvider.PROVIDER))
- .map(PyCcLinkParamsProvider::getCcLinkingInfo)
- .collect(ImmutableList.toImmutableList()))
- .build();
-
+ CcLinkingInfo.Builder ccLinkingInfoBuilder = CcLinkingInfo.Builder.create();
+ AbstractCcLinkParamsStore ccLinkParamsStore =
+ new AbstractCcLinkParamsStore() {
+ @Override
+ protected void collect(
+ CcLinkParams.Builder builder, boolean linkingStatically, boolean linkShared) {
+ builder.addTransitiveTargets(
+ deps, CcLinkParamsStore.TO_LINK_PARAMS, PyCcLinkParamsProvider.TO_LINK_PARAMS);
+ }
+ };
// TODO(plf): return empty CcLinkingInfo.
- return CcLinkingInfo.merge(ccLinkingInfos);
+ ccLinkingInfoBuilder.setCcLinkParamsStore(new CcLinkParamsStore(ccLinkParamsStore));
+ return ccLinkingInfoBuilder.build();
}
}
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java
index b8cbcda8d2..7feb1d2bcb 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java
@@ -16,7 +16,6 @@ package com.google.devtools.build.lib.rules.android;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Streams;
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.actions.ResourceSet;
import com.google.devtools.build.lib.analysis.AnalysisUtils;
@@ -46,8 +45,9 @@ import com.google.devtools.build.lib.packages.Rule;
import com.google.devtools.build.lib.packages.RuleClass.ConfiguredTargetFactory.RuleErrorException;
import com.google.devtools.build.lib.packages.TriState;
import com.google.devtools.build.lib.rules.android.ZipFilterBuilder.CheckHashMismatchMode;
+import com.google.devtools.build.lib.rules.cpp.AbstractCcLinkParamsStore;
import com.google.devtools.build.lib.rules.cpp.CcLinkParams;
-import com.google.devtools.build.lib.rules.cpp.CcLinkingInfo;
+import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore;
import com.google.devtools.build.lib.rules.java.ClasspathConfiguredFragment;
import com.google.devtools.build.lib.rules.java.JavaCcLinkParamsProvider;
import com.google.devtools.build.lib.rules.java.JavaCommon;
@@ -798,39 +798,28 @@ public class AndroidCommon {
return asNeverLink;
}
- public CcLinkingInfo getCcLinkingInfo() {
- return getCcLinkingInfo(
+ public AbstractCcLinkParamsStore getCcLinkParamsStore() {
+ return getCcLinkParamsStore(
javaCommon.targetsTreatedAsDeps(ClasspathType.BOTH), ImmutableList.<String>of());
}
- public static CcLinkingInfo getCcLinkingInfo(
+ public static AbstractCcLinkParamsStore getCcLinkParamsStore(
final Iterable<? extends TransitiveInfoCollection> deps, final Collection<String> linkOpts) {
-
- CcLinkParams linkOptsParams = CcLinkParams.builder().addLinkOpts(linkOpts).build();
- CcLinkingInfo linkOptsProvider =
- CcLinkingInfo.Builder.create()
- .setStaticModeParamsForDynamicLibrary(linkOptsParams)
- .setStaticModeParamsForExecutable(linkOptsParams)
- .setDynamicModeParamsForDynamicLibrary(linkOptsParams)
- .setDynamicModeParamsForExecutable(linkOptsParams)
- .build();
-
- ImmutableList<CcLinkingInfo> ccLinkingInfos =
- ImmutableList.<CcLinkingInfo>builder()
- .add(linkOptsProvider)
- .addAll(
- Streams.stream(AnalysisUtils.getProviders(deps, JavaCcLinkParamsProvider.class))
- .map(JavaCcLinkParamsProvider::getCcLinkingInfo)
- .collect(ImmutableList.toImmutableList()))
- .addAll(
- Streams.stream(
- AnalysisUtils.getProviders(deps, AndroidCcLinkParamsProvider.PROVIDER))
- .map(AndroidCcLinkParamsProvider::getLinkParams)
- .collect(ImmutableList.toImmutableList()))
- .addAll(AnalysisUtils.getProviders(deps, CcLinkingInfo.PROVIDER))
- .build();
-
- return CcLinkingInfo.merge(ccLinkingInfos);
+ return new AbstractCcLinkParamsStore() {
+ @Override
+ protected void collect(
+ CcLinkParams.Builder builder, boolean linkingStatically, boolean linkShared) {
+ builder.addTransitiveTargets(
+ deps,
+ // Link in Java-specific C++ code in the transitive closure
+ JavaCcLinkParamsProvider.TO_LINK_PARAMS,
+ // Link in Android-specific C++ code (e.g., android_libraries) in the transitive closure
+ AndroidCcLinkParamsProvider.TO_LINK_PARAMS,
+ // Link in non-language-specific C++ code in the transitive closure
+ CcLinkParamsStore.TO_LINK_PARAMS);
+ builder.addLinkOpts(linkOpts);
+ }
+ };
}
/** Returns {@link AndroidConfiguration} in given context. */
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidLibrary.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidLibrary.java
index bd59fbd0f5..1a7e53b9ae 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidLibrary.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidLibrary.java
@@ -30,6 +30,8 @@ import com.google.devtools.build.lib.packages.BuildType;
import com.google.devtools.build.lib.packages.TriState;
import com.google.devtools.build.lib.rules.android.AndroidConfiguration.AndroidAaptVersion;
import com.google.devtools.build.lib.rules.android.AndroidLibraryAarInfo.Aar;
+import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore;
+import com.google.devtools.build.lib.rules.cpp.CcLinkingInfo;
import com.google.devtools.build.lib.rules.java.JavaCommon;
import com.google.devtools.build.lib.rules.java.JavaSemantics;
import com.google.devtools.build.lib.rules.java.JavaSourceInfoProvider;
@@ -264,10 +266,15 @@ public abstract class AndroidLibrary implements RuleConfiguredTargetFactory {
.addNativeDeclaredProvider(
new AndroidNativeLibsInfo(
AndroidCommon.collectTransitiveNativeLibs(ruleContext).build()))
- .addNativeDeclaredProvider(androidCommon.getCcLinkingInfo())
.add(
JavaSourceInfoProvider.class,
JavaSourceInfoProvider.fromJavaTargetAttributes(javaTargetAttributes, javaSemantics))
+ .addNativeDeclaredProvider(
+ new AndroidCcLinkParamsProvider(
+ CcLinkingInfo.Builder.create()
+ .setCcLinkParamsStore(
+ new CcLinkParamsStore(androidCommon.getCcLinkParamsStore()))
+ .build()))
.addNativeDeclaredProvider(new ProguardSpecProvider(transitiveProguardConfigs))
.addNativeDeclaredProvider(
new AndroidProguardInfo(proguardLibrary.collectLocalProguardSpecs()))
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/NativeLibs.java b/src/main/java/com/google/devtools/build/lib/rules/android/NativeLibs.java
index 0df0d333b2..6bea350871 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/android/NativeLibs.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/android/NativeLibs.java
@@ -68,10 +68,10 @@ public final class NativeLibs {
for (Map.Entry<String, Collection<TransitiveInfoCollection>> entry :
getSplitDepsByArchitecture(ruleContext, depsAttributes).asMap().entrySet()) {
CcLinkParams linkParams =
- AndroidCommon.getCcLinkingInfo(
+ AndroidCommon.getCcLinkParamsStore(
entry.getValue(),
ImmutableList.of("-Wl,-soname=lib" + ruleContext.getLabel().getName()))
- .getStaticModeParamsForDynamicLibrary();
+ .get(/* linkingStatically */ true, /* linkShared */ true);
Artifact nativeDepsLibrary =
NativeDepsHelper.linkAndroidNativeDepsIfPresent(
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingInfo.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingInfo.java
index 483575accf..a8a27515af 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingInfo.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingInfo.java
@@ -86,19 +86,22 @@ public final class CcLinkingInfo extends NativeInfo implements CcLinkingInfoApi
CcLinkParams dynamicModeParamsForExecutable = (CcLinkParams) nullIfNone(args[i++]);
CcRunfiles ccRunfiles = (CcRunfiles) nullIfNone(args[i++]);
CcLinkingInfo.Builder ccLinkingInfoBuilder = CcLinkingInfo.Builder.create();
- if (staticModeParamsForDynamicLibrary == null
- || staticModeParamsForExecutable == null
- || dynamicModeParamsForDynamicLibrary == null
- || dynamicModeParamsForExecutable == null) {
- throw new EvalException(
- loc, "Every CcLinkParams parameter must be passed to CcLinkingInfo.");
+ if (staticModeParamsForDynamicLibrary != null) {
+ if (staticModeParamsForExecutable == null
+ || dynamicModeParamsForDynamicLibrary == null
+ || dynamicModeParamsForExecutable == null) {
+ throw new EvalException(
+ loc,
+ "Every CcLinkParams parameter must be passed to CcLinkingInfo "
+ + "if one of them is passed.");
+ }
+ ccLinkingInfoBuilder.setCcLinkParamsStore(
+ new CcLinkParamsStore(
+ staticModeParamsForDynamicLibrary,
+ staticModeParamsForExecutable,
+ dynamicModeParamsForDynamicLibrary,
+ dynamicModeParamsForExecutable));
}
- ccLinkingInfoBuilder.setCcLinkParamsStore(
- new CcLinkParamsStore(
- staticModeParamsForDynamicLibrary,
- staticModeParamsForExecutable,
- dynamicModeParamsForDynamicLibrary,
- dynamicModeParamsForExecutable));
// TODO(plf): The CcDynamicLibrariesForRuntime provider can be removed perhaps. Do not
// add to the API until we know for sure. The CcRunfiles provider is already in the API
// at the time of this comment (cl/200184914). Perhaps it can be removed but Skylark rules
@@ -184,10 +187,6 @@ public final class CcLinkingInfo extends NativeInfo implements CcLinkingInfoApi
/** A Builder for {@link CcLinkingInfo}. */
public static class Builder {
CcLinkParamsStore ccLinkParamsStore;
- CcLinkParams staticModeParamsForDynamicLibrary;
- CcLinkParams staticModeParamsForExecutable;
- CcLinkParams dynamicModeParamsForDynamicLibrary;
- CcLinkParams dynamicModeParamsForExecutable;
CcRunfiles ccRunfiles;
CcDynamicLibrariesForRuntime ccDynamicLibrariesForRuntime;
@@ -195,15 +194,8 @@ public final class CcLinkingInfo extends NativeInfo implements CcLinkingInfoApi
return new CcLinkingInfo.Builder();
}
- @Deprecated
- // TODO(b/111781390): Use individual setters for each flavor of CcLinkParams. Not all call sites
- // are being refactored at once. Work in progress.
public Builder setCcLinkParamsStore(CcLinkParamsStore ccLinkParamsStore) {
Preconditions.checkState(this.ccLinkParamsStore == null);
- Preconditions.checkState(this.staticModeParamsForDynamicLibrary == null);
- Preconditions.checkState(this.staticModeParamsForExecutable == null);
- Preconditions.checkState(this.dynamicModeParamsForDynamicLibrary == null);
- Preconditions.checkState(this.dynamicModeParamsForExecutable == null);
this.ccLinkParamsStore = ccLinkParamsStore;
return this;
}
@@ -221,47 +213,7 @@ public final class CcLinkingInfo extends NativeInfo implements CcLinkingInfoApi
return this;
}
- public Builder setStaticModeParamsForDynamicLibrary(CcLinkParams ccLinkParams) {
- Preconditions.checkState(
- this.staticModeParamsForDynamicLibrary == null && ccLinkParamsStore == null);
- this.staticModeParamsForDynamicLibrary = ccLinkParams;
- return this;
- }
-
- public Builder setStaticModeParamsForExecutable(CcLinkParams ccLinkParams) {
- Preconditions.checkState(
- this.staticModeParamsForExecutable == null && ccLinkParamsStore == null);
- this.staticModeParamsForExecutable = ccLinkParams;
- return this;
- }
-
- public Builder setDynamicModeParamsForDynamicLibrary(CcLinkParams ccLinkParams) {
- Preconditions.checkState(
- this.dynamicModeParamsForDynamicLibrary == null && ccLinkParamsStore == null);
- this.dynamicModeParamsForDynamicLibrary = ccLinkParams;
- return this;
- }
-
- public Builder setDynamicModeParamsForExecutable(CcLinkParams ccLinkParams) {
- Preconditions.checkState(
- this.dynamicModeParamsForExecutable == null && ccLinkParamsStore == null);
- this.dynamicModeParamsForExecutable = ccLinkParams;
- return this;
- }
-
public CcLinkingInfo build() {
- if (ccLinkParamsStore == null) {
- Preconditions.checkNotNull(staticModeParamsForDynamicLibrary);
- Preconditions.checkNotNull(staticModeParamsForExecutable);
- Preconditions.checkNotNull(dynamicModeParamsForDynamicLibrary);
- Preconditions.checkNotNull(dynamicModeParamsForExecutable);
- ccLinkParamsStore =
- new CcLinkParamsStore(
- staticModeParamsForDynamicLibrary,
- staticModeParamsForExecutable,
- dynamicModeParamsForDynamicLibrary,
- dynamicModeParamsForExecutable);
- }
return new CcLinkingInfo(ccLinkParamsStore, ccRunfiles, ccDynamicLibrariesForRuntime);
}
}
diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/proto/JplCcLinkParams.java b/src/main/java/com/google/devtools/build/lib/rules/java/proto/JplCcLinkParams.java
index 09aeecc79c..68f7222d46 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/java/proto/JplCcLinkParams.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/java/proto/JplCcLinkParams.java
@@ -15,10 +15,12 @@
package com.google.devtools.build.lib.rules.java.proto;
import com.google.common.collect.ImmutableList;
-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;
+import com.google.devtools.build.lib.rules.cpp.AbstractCcLinkParamsStore;
+import com.google.devtools.build.lib.rules.cpp.CcLinkParams;
+import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore;
import com.google.devtools.build.lib.rules.cpp.CcLinkingInfo;
import com.google.devtools.build.lib.rules.java.JavaCcLinkParamsProvider;
import java.util.ArrayList;
@@ -49,16 +51,19 @@ public class JplCcLinkParams {
.getTransitiveInfoProviderMap()
.getProvider(JavaCcLinkParamsProvider.class));
}
- ImmutableList<CcLinkingInfo> ccLinkingInfos =
- ImmutableList.<CcLinkingInfo>builder()
- .addAll(
- providers
- .stream()
- .map(JavaCcLinkParamsProvider::getCcLinkingInfo)
- .collect(ImmutableList.toImmutableList()))
- .addAll(AnalysisUtils.getProviders(protoRuntimes, CcLinkingInfo.PROVIDER))
- .build();
-
- return new JavaCcLinkParamsProvider(CcLinkingInfo.merge(ccLinkingInfos));
+ CcLinkingInfo.Builder builder = CcLinkingInfo.Builder.create();
+ builder.setCcLinkParamsStore(
+ new CcLinkParamsStore(
+ new AbstractCcLinkParamsStore() {
+ @Override
+ protected void collect(
+ CcLinkParams.Builder builder, boolean linkingStatically, boolean linkShared) {
+ for (JavaCcLinkParamsProvider provider : providers) {
+ builder.add(provider.getCcLinkingInfo().getCcLinkParamsStore());
+ }
+ builder.addTransitiveTargets(protoRuntimes);
+ }
+ }));
+ return new JavaCcLinkParamsProvider(builder.build());
}
}