diff options
author | 2018-07-16 13:33:33 -0700 | |
---|---|---|
committer | 2018-07-16 13:35:11 -0700 | |
commit | e506858c14d9ffceedbb22988f7c65fe70df5536 (patch) | |
tree | f482330e0d82fee8646b6e6c7b86848e4a7320cd /src/main/java/com/google/devtools/build/lib/analysis | |
parent | de3d8bf821dba97471ab4ccfc1f1b1559f0a1cac (diff) |
Add --incompatible_disable_deprecated_attr_params to disable some deprecated parameters of the skylark attr module.
RELNOTES: None.
PiperOrigin-RevId: 204797954
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkAttr.java | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkAttr.java b/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkAttr.java index 0d1a1aa6c8..a0cf36dab9 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkAttr.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkAttr.java @@ -147,8 +147,15 @@ public final class SkylarkAttr implements SkylarkAttrApi { builder.setPropertyFlag("MANDATORY"); } - // TODO(laurentlb): Deprecated, remove in August 2016 (use allow_empty instead). - if (containsNonNoneKey(arguments, NON_EMPTY_ARG) && (Boolean) arguments.get(NON_EMPTY_ARG)) { + if (containsNonNoneKey(arguments, NON_EMPTY_ARG) + && (Boolean) arguments.get(NON_EMPTY_ARG)) { + if (env.getSemantics().incompatibleDisableDeprecatedAttrParams()) { + throw new EvalException(ast.getLocation(), + "'non_empty' is no longer supported. use allow_empty instead. You can use " + + "--incompatible_disable_deprecated_attr_params to temporarily disable this " + + "check."); + } + builder.setPropertyFlag("NON_EMPTY"); } @@ -168,14 +175,21 @@ public final class SkylarkAttr implements SkylarkAttrApi { } } - // TODO(laurentlb): Deprecated, remove in August 2016 (use allow_single_file). if (containsNonNoneKey(arguments, SINGLE_FILE_ARG) && (Boolean) arguments.get(SINGLE_FILE_ARG)) { + if (env.getSemantics().incompatibleDisableDeprecatedAttrParams()) { + throw new EvalException( + ast.getLocation(), + "'single_file' is no longer supported. use allow_single_file instead. You can use " + + "--incompatible_disable_deprecated_attr_params to temporarily disable this " + + "check."); + } if (containsNonNoneKey(arguments, ALLOW_SINGLE_FILE_ARG)) { throw new EvalException( ast.getLocation(), "Cannot specify both single_file (deprecated) and allow_single_file"); } + builder.setPropertyFlag("SINGLE_ARTIFACT"); } |