aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/platform
diff options
context:
space:
mode:
authorGravatar John Cater <jcater@google.com>2017-07-05 14:30:32 -0400
committerGravatar John Cater <jcater@google.com>2017-07-06 07:13:34 -0400
commit948e519093eb82c217e842eec61a88725689d9dc (patch)
treeb948f94c8f3b1a4c90528dc2b6957a7227a1f9bf /src/main/java/com/google/devtools/build/lib/rules/platform
parenta15d648410000cedbde9578c9ee22a023f1b96df (diff)
Improve the ToolchainInfo provider and add more data.
Part of #2219. Change-Id: Ie235d0a75fc50746331b20a7f2060e6d49ae48cb PiperOrigin-RevId: 160982987
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/platform')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/platform/PlatformCommon.java8
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/platform/SkylarkToolchainConstructor.java15
2 files changed, 9 insertions, 14 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/platform/PlatformCommon.java b/src/main/java/com/google/devtools/build/lib/rules/platform/PlatformCommon.java
index 5a4bfb82dc..1504253f54 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/platform/PlatformCommon.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/platform/PlatformCommon.java
@@ -70,7 +70,13 @@ public class PlatformCommon {
return ConstraintValueInfo.SKYLARK_CONSTRUCTOR;
}
- @SkylarkCallable(name = ToolchainInfo.SKYLARK_NAME, documented = false, structField = true)
+ @SkylarkCallable(
+ name = ToolchainInfo.SKYLARK_NAME,
+ doc =
+ "The provider constructor for ToolchainInfo. The constructor takes the type of the "
+ + "toolchain, and a map of the toolchain's data.",
+ structField = true
+ )
public ClassObjectConstructor getToolchainInfoConstructor() {
return ToolchainInfo.SKYLARK_CONSTRUCTOR;
}
diff --git a/src/main/java/com/google/devtools/build/lib/rules/platform/SkylarkToolchainConstructor.java b/src/main/java/com/google/devtools/build/lib/rules/platform/SkylarkToolchainConstructor.java
index 47b2d8c427..b8d27ebdaf 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/platform/SkylarkToolchainConstructor.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/platform/SkylarkToolchainConstructor.java
@@ -15,9 +15,6 @@ package com.google.devtools.build.lib.rules.platform;
import com.google.common.collect.ImmutableList;
import com.google.devtools.build.lib.analysis.TransitiveInfoCollection;
-import com.google.devtools.build.lib.analysis.platform.ConstraintValueInfo;
-import com.google.devtools.build.lib.analysis.platform.PlatformProviderUtils;
-import com.google.devtools.build.lib.analysis.platform.ToolchainInfo;
import com.google.devtools.build.lib.events.Location;
import com.google.devtools.build.lib.packages.SkylarkClassObjectConstructor;
import com.google.devtools.build.lib.packages.ToolchainConstructor;
@@ -25,12 +22,12 @@ import com.google.devtools.build.lib.syntax.Environment;
import com.google.devtools.build.lib.syntax.EvalException;
import com.google.devtools.build.lib.syntax.FuncallExpression;
import com.google.devtools.build.lib.syntax.FunctionSignature;
-import com.google.devtools.build.lib.syntax.SkylarkDict;
import com.google.devtools.build.lib.syntax.SkylarkList;
import com.google.devtools.build.lib.syntax.SkylarkType;
import javax.annotation.Nullable;
/** Skylark value that can be used to create toolchains. */
+// TODO(katre): Remove this entirely.
public class SkylarkToolchainConstructor extends SkylarkClassObjectConstructor
implements ToolchainConstructor {
@@ -70,14 +67,6 @@ public class SkylarkToolchainConstructor extends SkylarkClassObjectConstructor
protected Object call(Object[] args, @Nullable FuncallExpression ast, @Nullable Environment env)
throws EvalException, InterruptedException {
- // Based on SIGNATURE above, the args are exec (list), target (list), data (map).
- Iterable<ConstraintValueInfo> execConstraints =
- PlatformProviderUtils.constraintValues((SkylarkList<TransitiveInfoCollection>) args[0]);
- Iterable<ConstraintValueInfo> targetConstraints =
- PlatformProviderUtils.constraintValues((SkylarkList<TransitiveInfoCollection>) args[1]);
- SkylarkDict<String, Object> toolchainData = (SkylarkDict<String, Object>) args[2];
- Location loc = ast != null ? ast.getLocation() : Location.BUILTIN;
-
- return new ToolchainInfo(getKey(), execConstraints, targetConstraints, toolchainData, loc);
+ return null;
}
}