Separate Info object semantics from Struct object semantics.
Info objects are objects that are created by Provider instances, and Struct objects are created by calls to struct(). There's no real reason these two sets of semantics must be bound together.
This change demonstrates separated semantics by migrating ObjcProvider to be no longer a struct. This means that ObjcProvider no longer has methods to_json() and to_proto(); this should not be considered a breaking change, however, because prior to this change, calling those methods on an ObjcProvider would always result in a thrown error.
RELNOTES: None.
PiperOrigin-RevId: 209210876
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/ActionsProvider.java b/src/main/java/com/google/devtools/build/lib/analysis/ActionsProvider.java
index 4e887e4..0e32ea5 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/ActionsProvider.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/ActionsProvider.java
@@ -18,8 +18,8 @@
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.events.Location;
import com.google.devtools.build.lib.packages.BuiltinProvider;
-import com.google.devtools.build.lib.packages.Info;
import com.google.devtools.build.lib.packages.SkylarkInfo;
+import com.google.devtools.build.lib.packages.StructImpl;
import com.google.devtools.build.lib.skylarkbuildapi.ActionsInfoProviderApi;
import java.util.HashMap;
import java.util.Map;
@@ -28,17 +28,18 @@
* This provides a view over the actions that were created during the analysis of a rule
* (not including actions for its transitive dependencies).
*/
-public final class ActionsProvider extends BuiltinProvider<Info> implements ActionsInfoProviderApi {
+public final class ActionsProvider extends BuiltinProvider<StructImpl>
+ implements ActionsInfoProviderApi {
/** The ActionsProvider singleton instance. */
public static final ActionsProvider INSTANCE = new ActionsProvider();
public ActionsProvider() {
- super("Actions", Info.class);
+ super("Actions", StructImpl.class);
}
/** Factory method for creating instances of the Actions provider. */
- public static Info create(Iterable<ActionAnalysisMetadata> actions) {
+ public static StructImpl create(Iterable<ActionAnalysisMetadata> actions) {
Map<Artifact, ActionAnalysisMetadata> map = new HashMap<>();
for (ActionAnalysisMetadata action : actions) {
for (Artifact artifact : action.getOutputs()) {