diff options
author | 2016-09-13 09:29:39 +0000 | |
---|---|---|
committer | 2016-09-13 12:32:08 +0000 | |
commit | 4381a1d6e8f711957f430aac0c301acec6dfa0eb (patch) | |
tree | bd0fd6b070704fa253c930b4c631451e0a8dbe8a /src | |
parent | d6252e5824f9067f07b41fbe078420d1c43a1e3d (diff) |
Global cleanup change.
--
MOS_MIGRATED_REVID=132976702
Diffstat (limited to 'src')
7 files changed, 7 insertions, 46 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/packages/Attribute.java b/src/main/java/com/google/devtools/build/lib/packages/Attribute.java index 593254acaa..0e1a8455f9 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/Attribute.java +++ b/src/main/java/com/google/devtools/build/lib/packages/Attribute.java @@ -28,8 +28,6 @@ import com.google.devtools.build.lib.analysis.TransitiveInfoProvider; import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.events.EventHandler; import com.google.devtools.build.lib.events.Location; -import com.google.devtools.build.lib.skylarkinterface.SkylarkModule; -import com.google.devtools.build.lib.skylarkinterface.SkylarkModuleCategory; import com.google.devtools.build.lib.syntax.ClassObject; import com.google.devtools.build.lib.syntax.EvalException; import com.google.devtools.build.lib.syntax.EvalUtils; @@ -170,13 +168,6 @@ public final class Attribute implements Comparable<Attribute> { /** * Declaration how the configuration should change when following a label or label list attribute. */ - @SkylarkModule(name = "ConfigurationTransition", - category = SkylarkModuleCategory.NONE, - doc = - "Declares how the configuration should change when following a dependency. " - + "It can be either <a href=\"globals.html#DATA_CFG\">DATA_CFG</a> or " - + "<a href=\"globals.html#HOST_CFG\">HOST_CFG</a>. " - + "This type is deprecated, use string \"host\" or \"data\" instead.") public enum ConfigurationTransition implements Transition { /** No transition, i.e., the same configuration as the current. */ NONE, diff --git a/src/main/java/com/google/devtools/build/lib/rules/SkylarkAttr.java b/src/main/java/com/google/devtools/build/lib/rules/SkylarkAttr.java index 2e4bbb6ea7..078ab2da0e 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/SkylarkAttr.java +++ b/src/main/java/com/google/devtools/build/lib/rules/SkylarkAttr.java @@ -259,10 +259,7 @@ public final class SkylarkAttr { if (containsNonNoneKey(arguments, CONFIGURATION_ARG)) { Object trans = arguments.get(CONFIGURATION_ARG); - if (trans instanceof ConfigurationTransition) { - // TODO(laurentlb): Deprecated, to be removed in August 2016. - builder.cfg((ConfigurationTransition) trans); - } else if (trans.equals("data")) { + if (trans.equals("data")) { builder.cfg(ConfigurationTransition.DATA); } else if (trans.equals("host")) { builder.cfg(ConfigurationTransition.HOST); diff --git a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleClassFunctions.java b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleClassFunctions.java index a88e096667..0b667f7e8c 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleClassFunctions.java +++ b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleClassFunctions.java @@ -46,7 +46,6 @@ import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder; import com.google.devtools.build.lib.collect.nestedset.Order; import com.google.devtools.build.lib.events.Location; import com.google.devtools.build.lib.packages.Attribute; -import com.google.devtools.build.lib.packages.Attribute.ConfigurationTransition; import com.google.devtools.build.lib.packages.AttributeMap; import com.google.devtools.build.lib.packages.AttributeValueSource; import com.google.devtools.build.lib.packages.ImplicitOutputsFunction.SkylarkImplicitOutputsFunctionWithCallback; @@ -99,24 +98,6 @@ import java.util.concurrent.ExecutionException; */ public class SkylarkRuleClassFunctions { - @SkylarkSignature( - name = "DATA_CFG", - returnType = ConfigurationTransition.class, - doc = - "Deprecated. Use string \"data\" instead. " - + "Specifies a transition to the data configuration." - ) - private static final Object dataTransition = ConfigurationTransition.DATA; - - @SkylarkSignature( - name = "HOST_CFG", - returnType = ConfigurationTransition.class, - doc = - "Deprecated. Use string \"host\" instead. " - + "Specifies a transition to the host configuration." - ) - private static final Object hostTransition = ConfigurationTransition.HOST; - // TODO(bazel-team): Copied from ConfiguredRuleClassProvider for the transition from built-in // rules to skylark extensions. Using the same instance would require a large refactoring. // If we don't want to support old built-in rules and Skylark simultaneously diff --git a/src/test/java/com/google/devtools/build/lib/analysis/AspectDefinitionTest.java b/src/test/java/com/google/devtools/build/lib/analysis/AspectDefinitionTest.java index 4bf2c55102..aeb989f086 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/AspectDefinitionTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/AspectDefinitionTest.java @@ -31,7 +31,6 @@ import com.google.devtools.build.lib.packages.NativeAspectClass; import com.google.devtools.build.lib.packages.Rule; import com.google.devtools.build.lib.skylarkinterface.SkylarkModule; import com.google.devtools.build.lib.util.FileTypeSet; - import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; diff --git a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkIntegrationTest.java b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkIntegrationTest.java index a140187290..fa8beb1508 100644 --- a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkIntegrationTest.java +++ b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkIntegrationTest.java @@ -417,7 +417,7 @@ public class SkylarkIntegrationTest extends BuildViewTestCase { " return struct(runfiles = rf)", "", "custom_rule = rule(implementation = custom_rule_impl, executable = True,", - " attrs = {'data': attr.label_list(cfg=DATA_CFG, allow_files=True)})"); + " attrs = {'data': attr.label_list(cfg='data', allow_files=True)})"); scratch.file( "test/skylark/BUILD", diff --git a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleClassFunctionsTest.java b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleClassFunctionsTest.java index 3e677be5b9..78e4b4e51d 100644 --- a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleClassFunctionsTest.java +++ b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleClassFunctionsTest.java @@ -409,13 +409,6 @@ public class SkylarkRuleClassFunctionsTest extends SkylarkTestCase { } @Test - public void testAttrCfg_deprecated() throws Exception { - Attribute attr = evalAttributeDefinition("attr.label(cfg = HOST_CFG, allow_files = True)") - .build("a1"); - assertEquals(ConfigurationTransition.HOST, attr.getConfigurationTransition()); - } - - @Test public void testAttrCfg() throws Exception { Attribute attr = evalAttributeDefinition("attr.label(cfg = 'host', allow_files = True)") .build("a1"); @@ -664,8 +657,8 @@ public class SkylarkRuleClassFunctionsTest extends SkylarkTestCase { public void testTextMessageInvalidStructure() throws Exception { checkErrorContains( "Invalid text format, expected a struct, a string, a bool, or an int " - + "but got a ConfigurationTransition for struct field 'a'", - "struct(a=DATA_CFG).to_proto()"); + + "but got a function for struct field 'a'", + "struct(a=rule).to_proto()"); } private void checkJson(String from, String expected) throws Exception { @@ -711,8 +704,8 @@ public class SkylarkRuleClassFunctionsTest extends SkylarkTestCase { public void testJsonInvalidStructure() throws Exception { checkErrorContains( "Invalid text format, expected a struct, a string, a bool, or an int but got a " - + "ConfigurationTransition for struct field 'a'", - "struct(a=DATA_CFG).to_json()"); + + "function for struct field 'a'", + "struct(a=rule).to_json()"); } @Test diff --git a/src/test/shell/bazel/bazel_worker_test.sh b/src/test/shell/bazel/bazel_worker_test.sh index 6fecea28c4..defc9ff52b 100755 --- a/src/test/shell/bazel/bazel_worker_test.sh +++ b/src/test/shell/bazel/bazel_worker_test.sh @@ -106,7 +106,7 @@ def _impl(ctx): work = rule( implementation=_impl, attrs={ - "worker": attr.label(cfg=HOST_CFG, mandatory=True, allow_files=True, executable=True), + "worker": attr.label(cfg="host", mandatory=True, allow_files=True, executable=True), "worker_args": attr.string_list(), "args": attr.string_list(), "srcs": attr.label_list(allow_files=True), |