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/packages/InfoInterface.java b/src/main/java/com/google/devtools/build/lib/packages/InfoInterface.java
new file mode 100644
index 0000000..b2a24e0
--- /dev/null
+++ b/src/main/java/com/google/devtools/build/lib/packages/InfoInterface.java
@@ -0,0 +1,38 @@
+// Copyright 2018 The Bazel Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+package com.google.devtools.build.lib.packages;
+
+import com.google.devtools.build.lib.events.Location;
+
+/**
+ * An instance (in the Skylark sense, not Java) of a {@link Provider}.
+ *
+ * <p>Info objects are specially handled in skylark, serving as units of information passed
+ * between targets. Each Info object must be associated with a Provider key, defined by the
+ * Provider which constructs Info objects of its type.
+ */
+public interface InfoInterface {
+
+ /**
+ * Returns the Skylark location where this instance was created.
+ *
+ * <p>Builtin provider instances may return {@link Location#BUILTIN}.
+ */
+ Location getCreationLoc();
+
+ /**
+ * Returns the provider instance that constructs instances of this info.
+ */
+ Provider getProvider();
+}
\ No newline at end of file