Java: Stops adding CcLinkParamsInfo twice in JavaImport.
This provider already gets added through semantics.addProviders().
RELNOTES:none
@@ -31,12 +31,7 @@ import com.google.devtools.build.lib.analysis.TransitiveInfoCollection;
import com.google.devtools.build.lib.analysis.configuredtargets.RuleConfiguredTarget.Mode;
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.CcLinkParams;
-import com.google.devtools.build.lib.rules.cpp.CcLinkParamsInfo;
-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.cpp.LinkerInput;
-import com.google.devtools.build.lib.rules.java.JavaCompilationArgs.ClasspathType;
import java.util.LinkedHashSet;
import java.util.Set;
@@ -113,14 +108,6 @@ public class JavaImport implements RuleConfiguredTargetFactory {
.add(ruleContext, JavaRunfilesProvider.TO_RUNFILES)
.build();
- CcLinkParamsStore ccLinkParamsStore = new CcLinkParamsStore() {
- @Override
- protected void collect(CcLinkParams.Builder builder, boolean linkingStatically,
- boolean linkShared) {
- builder.addTransitiveTargets(common.targetsTreatedAsDeps(ClasspathType.BOTH),
- JavaCcLinkParamsProvider.TO_LINK_PARAMS, CcLinkParamsInfo.TO_LINK_PARAMS);
- }
- };
RuleConfiguredTargetBuilder ruleBuilder =
new RuleConfiguredTargetBuilder(ruleContext);
NestedSetBuilder<Artifact> filesBuilder = NestedSetBuilder.stableOrder();
@@ -163,16 +150,12 @@ public class JavaImport implements RuleConfiguredTargetFactory {
.setNeverlink(neverLink)
.build();
- CcLinkingInfo.Builder ccLinkingInfoBuilder = CcLinkingInfo.Builder.create();
- ccLinkingInfoBuilder.setCcLinkParamsInfo(new CcLinkParamsInfo(ccLinkParamsStore));
-
return ruleBuilder
.setFilesToBuild(filesToBuild)
.addSkylarkTransitiveInfo(
JavaSkylarkApiProvider.NAME, JavaSkylarkApiProvider.fromRuleContext())
.addNativeDeclaredProvider(javaInfo)
.add(RunfilesProvider.class, RunfilesProvider.simple(runfiles))
- .addNativeDeclaredProvider(ccLinkingInfoBuilder.build())
.add(
JavaNativeLibraryProvider.class,
new JavaNativeLibraryProvider(transitiveJavaNativeLibraries))
