Skip to content

Commit

Permalink
Remove unused LEGACY_SKYLARK_NAME from ProtoInfo
Browse files Browse the repository at this point in the history
    The legacy `.proto` provider has been removed in bazelbuild/bazel#7152.

    Closes #10591.

    PiperOrigin-RevId: 293101268
  • Loading branch information
Luca Di Grazia committed Sep 4, 2022
1 parent 1d4f626 commit 64db262
Showing 1 changed file with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@

import com.google.common.collect.ImmutableList;
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.collect.nestedset.Depset;
import com.google.devtools.build.lib.collect.nestedset.NestedSet;
import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable;
import com.google.devtools.build.lib.events.Location;
import com.google.devtools.build.lib.packages.BuiltinProvider;
import com.google.devtools.build.lib.packages.NativeInfo;
import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec;
import com.google.devtools.build.lib.starlarkbuildapi.ProtoInfoApi;
import com.google.devtools.build.lib.starlarkbuildapi.proto.ProtoBootstrap;
import com.google.devtools.build.lib.skylarkbuildapi.ProtoInfoApi;
import com.google.devtools.build.lib.skylarkbuildapi.proto.ProtoBootstrap;
import com.google.devtools.build.lib.syntax.Depset;
import com.google.devtools.build.lib.syntax.SkylarkType;
import com.google.devtools.build.lib.util.Pair;
import javax.annotation.Nullable;

Expand All @@ -35,14 +37,13 @@
@AutoCodec
public final class ProtoInfo extends NativeInfo implements ProtoInfoApi<Artifact> {
/** Provider class for {@link ProtoInfo} objects. */
public static class ProtoInfoProvider extends BuiltinProvider<ProtoInfo>
implements ProtoInfoProviderApi {
public ProtoInfoProvider() {
public static class Provider extends BuiltinProvider<ProtoInfo> implements ProtoInfoApi.Provider {
public Provider() {
super(ProtoBootstrap.PROTO_INFO_STARLARK_NAME, ProtoInfo.class);
}
}

public static final ProtoInfoProvider PROVIDER = new ProtoInfoProvider();
public static final Provider PROVIDER = new Provider();

private final ImmutableList<Artifact> directProtoSources;
private final ImmutableList<Artifact> originalDirectProtoSources;
Expand Down Expand Up @@ -75,7 +76,9 @@ public ProtoInfo(
NestedSet<Pair<Artifact, String>> exportedProtoSourcesImportPaths,
NestedSet<String> exportedProtoSourceRoots,
Artifact directDescriptorSet,
NestedSet<Artifact> transitiveDescriptorSets) {
NestedSet<Artifact> transitiveDescriptorSets,
Location location) {
super(PROVIDER, location);
this.directProtoSources = directProtoSources;
this.originalDirectProtoSources = originalDirectProtoSources;
this.directProtoSourceRoot = directProtoSourceRoot;
Expand All @@ -93,11 +96,6 @@ public ProtoInfo(
this.transitiveDescriptorSets = transitiveDescriptorSets;
}

@Override
public BuiltinProvider<ProtoInfo> getProvider() {
return PROVIDER;
}

/**
* The proto source files that are used in compiling this {@code proto_library}.
*/
Expand Down Expand Up @@ -148,7 +146,7 @@ public NestedSet<Artifact> getOriginalTransitiveProtoSources() {
*/
@Override
public Depset /*<String>*/ getTransitiveProtoSourceRootsForStarlark() {
return Depset.of(Depset.ElementType.STRING, transitiveProtoSourceRoots);
return Depset.of(SkylarkType.STRING, transitiveProtoSourceRoots);
}

public NestedSet<String> getTransitiveProtoSourceRoots() {
Expand Down

0 comments on commit 64db262

Please sign in to comment.