brandjon | 60be531 | 2017-10-04 23:06:41 +0200 | [diff] [blame] | 1 | // Copyright 2017 The Bazel Authors. All rights reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | package com.google.devtools.build.lib.syntax; |
| 16 | |
| 17 | import com.google.auto.value.AutoValue; |
laurentlb | e5894f0 | 2018-10-25 13:02:00 -0700 | [diff] [blame] | 18 | import com.google.common.base.Ascii; |
cparsons | 507b00f | 2018-09-12 11:59:07 -0700 | [diff] [blame] | 19 | import com.google.common.base.Preconditions; |
plf | 7e41f9b | 2018-08-03 01:47:22 -0700 | [diff] [blame] | 20 | import com.google.common.collect.ImmutableList; |
| 21 | import java.util.List; |
cparsons | 507b00f | 2018-09-12 11:59:07 -0700 | [diff] [blame] | 22 | import java.util.function.Function; |
brandjon | 60be531 | 2017-10-04 23:06:41 +0200 | [diff] [blame] | 23 | |
| 24 | /** |
laurentlb | 6659b4c | 2019-02-18 07:23:36 -0800 | [diff] [blame] | 25 | * Options that affect Starlark semantics. |
brandjon | 60be531 | 2017-10-04 23:06:41 +0200 | [diff] [blame] | 26 | * |
laurentlb | 92c43cd | 2019-02-18 08:27:55 -0800 | [diff] [blame] | 27 | * <p>For descriptions of what these options do, see {@link StarlarkSemanticsOptions}. |
brandjon | 60be531 | 2017-10-04 23:06:41 +0200 | [diff] [blame] | 28 | */ |
| 29 | // TODO(brandjon): User error messages that reference options should maybe be substituted with the |
laurentlb | 6659b4c | 2019-02-18 07:23:36 -0800 | [diff] [blame] | 30 | // option name outside of the core Starlark interpreter? |
laurentlb | 92c43cd | 2019-02-18 08:27:55 -0800 | [diff] [blame] | 31 | // TODO(brandjon): Eventually these should be documented in full here, and StarlarkSemanticsOptions |
brandjon | 60be531 | 2017-10-04 23:06:41 +0200 | [diff] [blame] | 32 | // should refer to this class for documentation. But this doesn't play nice with the options |
| 33 | // parser's annotation mechanism. |
| 34 | @AutoValue |
laurentlb | 6659b4c | 2019-02-18 07:23:36 -0800 | [diff] [blame] | 35 | public abstract class StarlarkSemantics { |
brandjon | 60be531 | 2017-10-04 23:06:41 +0200 | [diff] [blame] | 36 | |
cparsons | 6622e6f | 2018-10-17 15:00:09 -0700 | [diff] [blame] | 37 | /** |
laurentlb | 6659b4c | 2019-02-18 07:23:36 -0800 | [diff] [blame] | 38 | * Enum where each element represents a starlark semantics flag. The name of each value should be |
| 39 | * the exact name of the flag transformed to upper case (for error representation). |
cparsons | 6622e6f | 2018-10-17 15:00:09 -0700 | [diff] [blame] | 40 | */ |
cparsons | 507b00f | 2018-09-12 11:59:07 -0700 | [diff] [blame] | 41 | public enum FlagIdentifier { |
Googler | 137019f | 2019-04-23 02:23:37 -0700 | [diff] [blame] | 42 | EXPERIMENTAL_ALLOW_INCREMENTAL_REPOSITORY_UPDATES( |
| 43 | StarlarkSemantics::experimentalAllowIncrementalRepositoryUpdates), |
Googler | 91eb3d2 | 2018-10-18 00:05:29 -0700 | [diff] [blame] | 44 | EXPERIMENTAL_ENABLE_ANDROID_MIGRATION_APIS( |
laurentlb | 6659b4c | 2019-02-18 07:23:36 -0800 | [diff] [blame] | 45 | StarlarkSemantics::experimentalEnableAndroidMigrationApis), |
| 46 | EXPERIMENTAL_BUILD_SETTING_API(StarlarkSemantics::experimentalBuildSettingApi), |
| 47 | EXPERIMENTAL_PLATFORM_API(StarlarkSemantics::experimentalPlatformsApi), |
juliexxia | deb028e | 2019-01-05 17:19:21 -0800 | [diff] [blame] | 48 | EXPERIMENTAL_STARLARK_CONFIG_TRANSITION( |
laurentlb | 6659b4c | 2019-02-18 07:23:36 -0800 | [diff] [blame] | 49 | StarlarkSemantics::experimentalStarlarkConfigTransitions), |
cparsons | 507b00f | 2018-09-12 11:59:07 -0700 | [diff] [blame] | 50 | INCOMPATIBLE_DISABLE_OBJC_PROVIDER_RESOURCES( |
laurentlb | 6659b4c | 2019-02-18 07:23:36 -0800 | [diff] [blame] | 51 | StarlarkSemantics::incompatibleDisableObjcProviderResources), |
| 52 | INCOMPATIBLE_NO_OUTPUT_ATTR_DEFAULT(StarlarkSemantics::incompatibleNoOutputAttrDefault), |
| 53 | INCOMPATIBLE_NO_TARGET_OUTPUT_GROUP(StarlarkSemantics::incompatibleNoTargetOutputGroup), |
| 54 | INCOMPATIBLE_NO_ATTR_LICENSE(StarlarkSemantics::incompatibleNoAttrLicense), |
Googler | f8e87fb | 2019-04-12 19:13:28 -0700 | [diff] [blame] | 55 | INCOMPATIBLE_OBJC_FRAMEWORK_CLEANUP(StarlarkSemantics::incompatibleObjcFrameworkCleanup), |
John Cater | 5688793 | 2019-04-26 05:27:07 -0700 | [diff] [blame] | 56 | INCOMPATIBLE_DISALLOW_RULE_EXECUTION_PLATFORM_CONSTRAINTS_ALLOWED( |
| 57 | StarlarkSemantics::incompatibleDisallowRuleExecutionPlatformConstraintsAllowed), |
cparsons | 507b00f | 2018-09-12 11:59:07 -0700 | [diff] [blame] | 58 | NONE(null); |
| 59 | |
| 60 | // Using a Function here makes the enum definitions far cleaner, and, since this is |
| 61 | // a private field, and we can ensure no callers treat this field as mutable. |
| 62 | @SuppressWarnings("ImmutableEnumChecker") |
laurentlb | 6659b4c | 2019-02-18 07:23:36 -0800 | [diff] [blame] | 63 | private final Function<StarlarkSemantics, Boolean> semanticsFunction; |
cparsons | 507b00f | 2018-09-12 11:59:07 -0700 | [diff] [blame] | 64 | |
laurentlb | 6659b4c | 2019-02-18 07:23:36 -0800 | [diff] [blame] | 65 | FlagIdentifier(Function<StarlarkSemantics, Boolean> semanticsFunction) { |
cparsons | 507b00f | 2018-09-12 11:59:07 -0700 | [diff] [blame] | 66 | this.semanticsFunction = semanticsFunction; |
| 67 | } |
cparsons | 6622e6f | 2018-10-17 15:00:09 -0700 | [diff] [blame] | 68 | |
| 69 | /** |
| 70 | * Returns the name of the flag that this identifier controls. For example, EXPERIMENTAL_FOO |
| 71 | * would return 'experimental_foo'. |
| 72 | */ |
| 73 | public String getFlagName() { |
laurentlb | e5894f0 | 2018-10-25 13:02:00 -0700 | [diff] [blame] | 74 | return Ascii.toLowerCase(this.name()); |
cparsons | 6622e6f | 2018-10-17 15:00:09 -0700 | [diff] [blame] | 75 | } |
cparsons | 507b00f | 2018-09-12 11:59:07 -0700 | [diff] [blame] | 76 | } |
| 77 | |
| 78 | /** |
| 79 | * Returns true if a feature attached to the given toggling flags should be enabled. |
| 80 | * |
| 81 | * <ul> |
plf | c25c054 | 2019-03-07 07:35:38 -0800 | [diff] [blame] | 82 | * <li>If both parameters are {@code NONE}, this indicates the feature is not controlled by |
| 83 | * flags, and should thus be enabled. |
| 84 | * <li>If the {@code enablingFlag} parameter is non-{@code NONE}, this returns true if and only |
| 85 | * if that flag is true. (This represents a feature that is only on if a given flag is |
| 86 | * *on*). |
| 87 | * <li>If the {@code disablingFlag} parameter is non-{@code NONE}, this returns true if and only |
| 88 | * if that flag is false. (This represents a feature that is only on if a given flag is |
| 89 | * *off*). |
| 90 | * <li>It is illegal to pass both parameters as non-{@code NONE}. |
cparsons | 507b00f | 2018-09-12 11:59:07 -0700 | [diff] [blame] | 91 | * </ul> |
| 92 | */ |
| 93 | public boolean isFeatureEnabledBasedOnTogglingFlags( |
plf | c25c054 | 2019-03-07 07:35:38 -0800 | [diff] [blame] | 94 | FlagIdentifier enablingFlag, FlagIdentifier disablingFlag) { |
| 95 | Preconditions.checkArgument( |
| 96 | enablingFlag == FlagIdentifier.NONE || disablingFlag == FlagIdentifier.NONE, |
cparsons | 507b00f | 2018-09-12 11:59:07 -0700 | [diff] [blame] | 97 | "at least one of 'enablingFlag' or 'disablingFlag' must be NONE"); |
| 98 | if (enablingFlag != FlagIdentifier.NONE) { |
| 99 | return enablingFlag.semanticsFunction.apply(this); |
| 100 | } else { |
| 101 | return disablingFlag == FlagIdentifier.NONE || !disablingFlag.semanticsFunction.apply(this); |
| 102 | } |
| 103 | } |
| 104 | |
cparsons | 1832ed3 | 2018-11-13 14:15:32 -0800 | [diff] [blame] | 105 | /** Returns the value of the given flag. */ |
| 106 | public boolean flagValue(FlagIdentifier flagIdentifier) { |
| 107 | return flagIdentifier.semanticsFunction.apply(this); |
| 108 | } |
| 109 | |
brandjon | 617f8ff | 2017-10-06 06:07:13 +0200 | [diff] [blame] | 110 | /** |
| 111 | * The AutoValue-generated concrete class implementing this one. |
| 112 | * |
| 113 | * <p>AutoValue implementation classes are usually package-private. We expose it here for the |
| 114 | * benefit of code that relies on reflection. |
| 115 | */ |
laurentlb | 6659b4c | 2019-02-18 07:23:36 -0800 | [diff] [blame] | 116 | public static final Class<? extends StarlarkSemantics> IMPL_CLASS = |
| 117 | AutoValue_StarlarkSemantics.class; |
brandjon | 617f8ff | 2017-10-06 06:07:13 +0200 | [diff] [blame] | 118 | |
brandjon | 60be531 | 2017-10-04 23:06:41 +0200 | [diff] [blame] | 119 | // <== Add new options here in alphabetic order ==> |
Googler | 137019f | 2019-04-23 02:23:37 -0700 | [diff] [blame] | 120 | public abstract boolean experimentalAllowIncrementalRepositoryUpdates(); |
| 121 | |
juliexxia | 1f332e0 | 2018-10-31 14:20:55 -0700 | [diff] [blame] | 122 | public abstract boolean experimentalBuildSettingApi(); |
| 123 | |
cushon | 1e86d35 | 2019-01-11 16:48:10 -0800 | [diff] [blame] | 124 | public abstract ImmutableList<String> experimentalCcSkylarkApiEnabledPackages(); |
plf | 7e41f9b | 2018-08-03 01:47:22 -0700 | [diff] [blame] | 125 | |
Googler | c2cd957 | 2018-10-02 14:38:15 -0700 | [diff] [blame] | 126 | public abstract boolean experimentalEnableAndroidMigrationApis(); |
| 127 | |
cparsons | ed6bfbe | 2019-04-19 10:17:03 -0700 | [diff] [blame] | 128 | public abstract boolean experimentalGoogleLegacyApi(); |
| 129 | |
elenairina | e679d02 | 2019-01-07 07:49:27 -0800 | [diff] [blame] | 130 | public abstract ImmutableList<String> experimentalJavaCommonCreateProviderEnabledPackages(); |
| 131 | |
cparsons | 140c076 | 2018-10-05 14:07:19 -0700 | [diff] [blame] | 132 | public abstract boolean experimentalPlatformsApi(); |
| 133 | |
cparsons | e0efc14 | 2018-10-17 09:39:10 -0700 | [diff] [blame] | 134 | public abstract boolean experimentalStarlarkConfigTransitions(); |
| 135 | |
brandjon | 60be531 | 2017-10-04 23:06:41 +0200 | [diff] [blame] | 136 | public abstract boolean incompatibleBzlDisallowLoadAfterStatement(); |
laurentlb | 1cbce0f | 2018-03-27 12:43:22 -0700 | [diff] [blame] | 137 | |
brandjon | 60be531 | 2017-10-04 23:06:41 +0200 | [diff] [blame] | 138 | public abstract boolean incompatibleDepsetIsNotIterable(); |
laurentlb | 1cbce0f | 2018-03-27 12:43:22 -0700 | [diff] [blame] | 139 | |
laurentlb | 2bbda4a | 2017-12-07 10:38:46 -0800 | [diff] [blame] | 140 | public abstract boolean incompatibleDepsetUnion(); |
laurentlb | 1cbce0f | 2018-03-27 12:43:22 -0700 | [diff] [blame] | 141 | |
gregce | 4aa059a | 2019-02-26 13:20:47 -0800 | [diff] [blame] | 142 | public abstract boolean incompatibleDisableThirdPartyLicenseChecking(); |
| 143 | |
cparsons | e506858 | 2018-07-16 13:33:33 -0700 | [diff] [blame] | 144 | public abstract boolean incompatibleDisableDeprecatedAttrParams(); |
| 145 | |
cparsons | 99be8b4 | 2018-03-01 15:16:46 -0800 | [diff] [blame] | 146 | public abstract boolean incompatibleDisableObjcProviderResources(); |
laurentlb | 1cbce0f | 2018-03-27 12:43:22 -0700 | [diff] [blame] | 147 | |
brandjon | 60be531 | 2017-10-04 23:06:41 +0200 | [diff] [blame] | 148 | public abstract boolean incompatibleDisallowDictPlus(); |
laurentlb | 1cbce0f | 2018-03-27 12:43:22 -0700 | [diff] [blame] | 149 | |
laurentlb | 707acfe | 2018-04-13 06:09:30 -0700 | [diff] [blame] | 150 | public abstract boolean incompatibleDisallowFileType(); |
| 151 | |
elenairina | 2fe38c1 | 2019-01-10 00:49:13 -0800 | [diff] [blame] | 152 | public abstract boolean incompatibleDisallowLegacyJavaProvider(); |
| 153 | |
tomlu | e374970 | 2018-05-02 09:38:00 -0700 | [diff] [blame] | 154 | public abstract boolean incompatibleDisallowLegacyJavaInfo(); |
| 155 | |
nharmata | d86b509 | 2018-10-16 15:50:21 -0700 | [diff] [blame] | 156 | public abstract boolean incompatibleDisallowLoadLabelsToCrossPackageBoundaries(); |
| 157 | |
laurentlb | 64e833c | 2019-02-22 09:50:34 -0800 | [diff] [blame] | 158 | public abstract boolean incompatibleDisallowNativeInBuildFile(); |
| 159 | |
tomlu | beafd7e | 2018-04-05 15:03:19 -0700 | [diff] [blame] | 160 | public abstract boolean incompatibleDisallowOldStyleArgsAdd(); |
| 161 | |
John Cater | 5688793 | 2019-04-26 05:27:07 -0700 | [diff] [blame] | 162 | public abstract boolean incompatibleDisallowRuleExecutionPlatformConstraintsAllowed(); |
| 163 | |
cparsons | 5d53171 | 2019-02-05 13:31:03 -0800 | [diff] [blame] | 164 | public abstract boolean incompatibleDisallowStructProviderSyntax(); |
| 165 | |
tomlu | 774bfe0 | 2018-08-24 14:15:44 -0700 | [diff] [blame] | 166 | public abstract boolean incompatibleExpandDirectories(); |
| 167 | |
brandjon | 60be531 | 2017-10-04 23:06:41 +0200 | [diff] [blame] | 168 | public abstract boolean incompatibleNewActionsApi(); |
laurentlb | 1cbce0f | 2018-03-27 12:43:22 -0700 | [diff] [blame] | 169 | |
laurentlb | d8d3776 | 2018-10-26 14:08:33 -0700 | [diff] [blame] | 170 | public abstract boolean incompatibleNoAttrLicense(); |
| 171 | |
laurentlb | de41cf8 | 2019-04-12 13:47:58 -0700 | [diff] [blame] | 172 | public abstract boolean incompatibleNoKwargsInBuildFiles(); |
| 173 | |
cparsons | fbc828b | 2018-10-04 14:38:50 -0700 | [diff] [blame] | 174 | public abstract boolean incompatibleNoOutputAttrDefault(); |
| 175 | |
tomlu | aaf11e9 | 2018-06-02 10:20:16 -0700 | [diff] [blame] | 176 | public abstract boolean incompatibleNoSupportToolsInActionInputs(); |
| 177 | |
cparsons | 3cb3a5d | 2018-10-01 10:36:08 -0700 | [diff] [blame] | 178 | public abstract boolean incompatibleNoTargetOutputGroup(); |
| 179 | |
laurentlb | 9d179e1 | 2018-09-27 08:15:42 -0700 | [diff] [blame] | 180 | public abstract boolean incompatibleNoTransitiveLoads(); |
| 181 | |
Googler | f8e87fb | 2019-04-12 19:13:28 -0700 | [diff] [blame] | 182 | public abstract boolean incompatibleObjcFrameworkCleanup(); |
| 183 | |
dannark | ed87463 | 2019-01-17 14:01:15 -0800 | [diff] [blame] | 184 | public abstract boolean incompatibleRemapMainRepo(); |
| 185 | |
Danna Kelmer | 21f4bd3 | 2018-11-29 11:04:48 -0800 | [diff] [blame] | 186 | public abstract boolean incompatibleRemoveNativeMavenJar(); |
| 187 | |
cparsons | 6b3724f | 2019-04-26 08:53:32 -0700 | [diff] [blame] | 188 | public abstract boolean incompatibleRestrictNamedParams(); |
| 189 | |
laurentlb | 18ef7a5 | 2019-03-28 08:07:25 -0700 | [diff] [blame] | 190 | public abstract boolean incompatibleStringJoinRequiresStrings(); |
| 191 | |
laurentlb | ed63333 | 2019-04-12 16:34:08 -0700 | [diff] [blame] | 192 | public abstract boolean incompatibleStaticNameResolutionInBuildFiles(); |
| 193 | |
brandjon | 60be531 | 2017-10-04 23:06:41 +0200 | [diff] [blame] | 194 | public abstract boolean internalSkylarkFlagTestCanary(); |
| 195 | |
plf | 3010e57 | 2019-03-11 07:02:28 -0700 | [diff] [blame] | 196 | public abstract boolean incompatibleDoNotSplitLinkingCmdline(); |
| 197 | |
plf | 0d40b7f | 2019-04-29 08:09:11 -0700 | [diff] [blame] | 198 | public abstract boolean incompatibleDepsetForLibrariesToLinkGetter(); |
| 199 | |
brandjon | 6ac92f9 | 2017-12-06 13:57:15 -0800 | [diff] [blame] | 200 | /** Returns a {@link Builder} initialized with the values of this instance. */ |
| 201 | public abstract Builder toBuilder(); |
| 202 | |
brandjon | 60be531 | 2017-10-04 23:06:41 +0200 | [diff] [blame] | 203 | public static Builder builder() { |
laurentlb | 6659b4c | 2019-02-18 07:23:36 -0800 | [diff] [blame] | 204 | return new AutoValue_StarlarkSemantics.Builder(); |
brandjon | 60be531 | 2017-10-04 23:06:41 +0200 | [diff] [blame] | 205 | } |
| 206 | |
brandjon | 6ac92f9 | 2017-12-06 13:57:15 -0800 | [diff] [blame] | 207 | /** Returns a {@link Builder} initialized with default values for all options. */ |
| 208 | public static Builder builderWithDefaults() { |
| 209 | return DEFAULT_SEMANTICS.toBuilder(); |
| 210 | } |
| 211 | |
laurentlb | 6659b4c | 2019-02-18 07:23:36 -0800 | [diff] [blame] | 212 | public static final StarlarkSemantics DEFAULT_SEMANTICS = |
vladmos | 1df4635 | 2017-11-30 03:02:36 -0800 | [diff] [blame] | 213 | builder() |
| 214 | // <== Add new options here in alphabetic order ==> |
juliexxia | 1f332e0 | 2018-10-31 14:20:55 -0700 | [diff] [blame] | 215 | .experimentalBuildSettingApi(false) |
plf | 7e41f9b | 2018-08-03 01:47:22 -0700 | [diff] [blame] | 216 | .experimentalCcSkylarkApiEnabledPackages(ImmutableList.of()) |
Googler | 137019f | 2019-04-23 02:23:37 -0700 | [diff] [blame] | 217 | .experimentalAllowIncrementalRepositoryUpdates(false) |
Googler | c2cd957 | 2018-10-02 14:38:15 -0700 | [diff] [blame] | 218 | .experimentalEnableAndroidMigrationApis(false) |
cparsons | ed6bfbe | 2019-04-19 10:17:03 -0700 | [diff] [blame] | 219 | .experimentalGoogleLegacyApi(false) |
elenairina | e679d02 | 2019-01-07 07:49:27 -0800 | [diff] [blame] | 220 | .experimentalJavaCommonCreateProviderEnabledPackages(ImmutableList.of()) |
cparsons | 140c076 | 2018-10-05 14:07:19 -0700 | [diff] [blame] | 221 | .experimentalPlatformsApi(false) |
cparsons | e0efc14 | 2018-10-17 09:39:10 -0700 | [diff] [blame] | 222 | .experimentalStarlarkConfigTransitions(false) |
laurentlb | 3992d29 | 2019-03-22 13:35:12 -0700 | [diff] [blame] | 223 | .incompatibleBzlDisallowLoadAfterStatement(true) |
vladmos | 1df4635 | 2017-11-30 03:02:36 -0800 | [diff] [blame] | 224 | .incompatibleDepsetIsNotIterable(false) |
laurentlb | 2cfa019 | 2019-04-26 06:34:47 -0700 | [diff] [blame] | 225 | .incompatibleDepsetUnion(true) |
gregce | c4333f4 | 2019-03-28 14:39:20 -0700 | [diff] [blame] | 226 | .incompatibleDisableThirdPartyLicenseChecking(true) |
cparsons | e506858 | 2018-07-16 13:33:33 -0700 | [diff] [blame] | 227 | .incompatibleDisableDeprecatedAttrParams(false) |
kaipi | 6cb90b8 | 2019-05-01 09:16:31 -0700 | [diff] [blame] | 228 | .incompatibleDisableObjcProviderResources(true) |
laurentlb | b642228 | 2019-02-20 11:03:01 -0800 | [diff] [blame] | 229 | .incompatibleDisallowDictPlus(true) |
laurentlb | ce1a64e | 2019-02-13 12:36:06 -0800 | [diff] [blame] | 230 | .incompatibleDisallowFileType(true) |
elenairina | 2fe38c1 | 2019-01-10 00:49:13 -0800 | [diff] [blame] | 231 | .incompatibleDisallowLegacyJavaProvider(false) |
tomlu | e374970 | 2018-05-02 09:38:00 -0700 | [diff] [blame] | 232 | .incompatibleDisallowLegacyJavaInfo(false) |
laurentlb | 3f791e76 | 2019-03-26 08:01:28 -0700 | [diff] [blame] | 233 | .incompatibleDisallowLoadLabelsToCrossPackageBoundaries(true) |
schmitt | d1c1794 | 2019-05-23 07:34:28 -0700 | [diff] [blame^] | 234 | .incompatibleDisallowNativeInBuildFile(false) |
laurentlb | d4e13ea | 2019-02-21 13:07:26 -0800 | [diff] [blame] | 235 | .incompatibleDisallowOldStyleArgsAdd(true) |
John Cater | 5688793 | 2019-04-26 05:27:07 -0700 | [diff] [blame] | 236 | .incompatibleDisallowRuleExecutionPlatformConstraintsAllowed(false) |
cparsons | 5d53171 | 2019-02-05 13:31:03 -0800 | [diff] [blame] | 237 | .incompatibleDisallowStructProviderSyntax(false) |
laurentlb | cc7a4da | 2019-01-22 14:38:27 -0800 | [diff] [blame] | 238 | .incompatibleExpandDirectories(true) |
vladmos | 1df4635 | 2017-11-30 03:02:36 -0800 | [diff] [blame] | 239 | .incompatibleNewActionsApi(false) |
laurentlb | ce4b73e | 2019-03-27 12:32:34 -0700 | [diff] [blame] | 240 | .incompatibleNoAttrLicense(true) |
laurentlb | de41cf8 | 2019-04-12 13:47:58 -0700 | [diff] [blame] | 241 | .incompatibleNoKwargsInBuildFiles(false) |
laurentlb | 774cf20 | 2019-04-12 17:23:58 -0700 | [diff] [blame] | 242 | .incompatibleNoOutputAttrDefault(true) |
tomlu | aaf11e9 | 2018-06-02 10:20:16 -0700 | [diff] [blame] | 243 | .incompatibleNoSupportToolsInActionInputs(false) |
cparsons | 3cb3a5d | 2018-10-01 10:36:08 -0700 | [diff] [blame] | 244 | .incompatibleNoTargetOutputGroup(false) |
laurentlb | 684646e | 2019-03-22 08:24:33 -0700 | [diff] [blame] | 245 | .incompatibleNoTransitiveLoads(true) |
Googler | f8e87fb | 2019-04-12 19:13:28 -0700 | [diff] [blame] | 246 | .incompatibleObjcFrameworkCleanup(false) |
pcloudy | 70981cd | 2019-02-28 02:32:15 -0800 | [diff] [blame] | 247 | .incompatibleRemapMainRepo(false) |
Danna Kelmer | 21f4bd3 | 2018-11-29 11:04:48 -0800 | [diff] [blame] | 248 | .incompatibleRemoveNativeMavenJar(false) |
cparsons | 6b3724f | 2019-04-26 08:53:32 -0700 | [diff] [blame] | 249 | .incompatibleRestrictNamedParams(false) |
laurentlb | cc7a6e0 | 2019-05-22 14:30:47 -0700 | [diff] [blame] | 250 | .incompatibleStaticNameResolutionInBuildFiles(true) |
laurentlb | 18ef7a5 | 2019-03-28 08:07:25 -0700 | [diff] [blame] | 251 | .incompatibleStringJoinRequiresStrings(false) |
Klaus Aehlig | a7b34a1 | 2018-02-20 09:31:37 -0800 | [diff] [blame] | 252 | .internalSkylarkFlagTestCanary(false) |
plf | 3010e57 | 2019-03-11 07:02:28 -0700 | [diff] [blame] | 253 | .incompatibleDoNotSplitLinkingCmdline(false) |
plf | 0d40b7f | 2019-04-29 08:09:11 -0700 | [diff] [blame] | 254 | .incompatibleDepsetForLibrariesToLinkGetter(false) |
Klaus Aehlig | a7b34a1 | 2018-02-20 09:31:37 -0800 | [diff] [blame] | 255 | .build(); |
brandjon | 60be531 | 2017-10-04 23:06:41 +0200 | [diff] [blame] | 256 | |
laurentlb | 6659b4c | 2019-02-18 07:23:36 -0800 | [diff] [blame] | 257 | /** Builder for {@link StarlarkSemantics}. All fields are mandatory. */ |
brandjon | 60be531 | 2017-10-04 23:06:41 +0200 | [diff] [blame] | 258 | @AutoValue.Builder |
| 259 | public abstract static class Builder { |
| 260 | |
| 261 | // <== Add new options here in alphabetic order ==> |
Googler | 137019f | 2019-04-23 02:23:37 -0700 | [diff] [blame] | 262 | public abstract Builder experimentalAllowIncrementalRepositoryUpdates(boolean value); |
| 263 | |
juliexxia | 1f332e0 | 2018-10-31 14:20:55 -0700 | [diff] [blame] | 264 | public abstract Builder experimentalBuildSettingApi(boolean value); |
| 265 | |
plf | 7e41f9b | 2018-08-03 01:47:22 -0700 | [diff] [blame] | 266 | public abstract Builder experimentalCcSkylarkApiEnabledPackages(List<String> value); |
| 267 | |
Googler | c2cd957 | 2018-10-02 14:38:15 -0700 | [diff] [blame] | 268 | public abstract Builder experimentalEnableAndroidMigrationApis(boolean value); |
| 269 | |
cparsons | ed6bfbe | 2019-04-19 10:17:03 -0700 | [diff] [blame] | 270 | public abstract Builder experimentalGoogleLegacyApi(boolean value); |
| 271 | |
elenairina | e679d02 | 2019-01-07 07:49:27 -0800 | [diff] [blame] | 272 | public abstract Builder experimentalJavaCommonCreateProviderEnabledPackages(List<String> value); |
| 273 | |
cparsons | 140c076 | 2018-10-05 14:07:19 -0700 | [diff] [blame] | 274 | public abstract Builder experimentalPlatformsApi(boolean value); |
| 275 | |
cparsons | e0efc14 | 2018-10-17 09:39:10 -0700 | [diff] [blame] | 276 | public abstract Builder experimentalStarlarkConfigTransitions(boolean value); |
| 277 | |
brandjon | 60be531 | 2017-10-04 23:06:41 +0200 | [diff] [blame] | 278 | public abstract Builder incompatibleBzlDisallowLoadAfterStatement(boolean value); |
laurentlb | 1cbce0f | 2018-03-27 12:43:22 -0700 | [diff] [blame] | 279 | |
brandjon | 60be531 | 2017-10-04 23:06:41 +0200 | [diff] [blame] | 280 | public abstract Builder incompatibleDepsetIsNotIterable(boolean value); |
laurentlb | 1cbce0f | 2018-03-27 12:43:22 -0700 | [diff] [blame] | 281 | |
laurentlb | 2bbda4a | 2017-12-07 10:38:46 -0800 | [diff] [blame] | 282 | public abstract Builder incompatibleDepsetUnion(boolean value); |
laurentlb | 1cbce0f | 2018-03-27 12:43:22 -0700 | [diff] [blame] | 283 | |
gregce | 4aa059a | 2019-02-26 13:20:47 -0800 | [diff] [blame] | 284 | public abstract Builder incompatibleDisableThirdPartyLicenseChecking(boolean value); |
| 285 | |
cparsons | e506858 | 2018-07-16 13:33:33 -0700 | [diff] [blame] | 286 | public abstract Builder incompatibleDisableDeprecatedAttrParams(boolean value); |
| 287 | |
cparsons | 99be8b4 | 2018-03-01 15:16:46 -0800 | [diff] [blame] | 288 | public abstract Builder incompatibleDisableObjcProviderResources(boolean value); |
laurentlb | 1cbce0f | 2018-03-27 12:43:22 -0700 | [diff] [blame] | 289 | |
brandjon | 60be531 | 2017-10-04 23:06:41 +0200 | [diff] [blame] | 290 | public abstract Builder incompatibleDisallowDictPlus(boolean value); |
laurentlb | 1cbce0f | 2018-03-27 12:43:22 -0700 | [diff] [blame] | 291 | |
laurentlb | 707acfe | 2018-04-13 06:09:30 -0700 | [diff] [blame] | 292 | public abstract Builder incompatibleDisallowFileType(boolean value); |
| 293 | |
elenairina | 2fe38c1 | 2019-01-10 00:49:13 -0800 | [diff] [blame] | 294 | public abstract Builder incompatibleDisallowLegacyJavaProvider(boolean value); |
| 295 | |
tomlu | e374970 | 2018-05-02 09:38:00 -0700 | [diff] [blame] | 296 | public abstract Builder incompatibleDisallowLegacyJavaInfo(boolean value); |
| 297 | |
nharmata | d86b509 | 2018-10-16 15:50:21 -0700 | [diff] [blame] | 298 | public abstract Builder incompatibleDisallowLoadLabelsToCrossPackageBoundaries(boolean value); |
| 299 | |
tomlu | beafd7e | 2018-04-05 15:03:19 -0700 | [diff] [blame] | 300 | public abstract Builder incompatibleDisallowOldStyleArgsAdd(boolean value); |
| 301 | |
laurentlb | 64e833c | 2019-02-22 09:50:34 -0800 | [diff] [blame] | 302 | public abstract Builder incompatibleDisallowNativeInBuildFile(boolean value); |
| 303 | |
John Cater | 5688793 | 2019-04-26 05:27:07 -0700 | [diff] [blame] | 304 | public abstract Builder incompatibleDisallowRuleExecutionPlatformConstraintsAllowed( |
| 305 | boolean value); |
| 306 | |
cparsons | 5d53171 | 2019-02-05 13:31:03 -0800 | [diff] [blame] | 307 | public abstract Builder incompatibleDisallowStructProviderSyntax(boolean value); |
| 308 | |
tomlu | 774bfe0 | 2018-08-24 14:15:44 -0700 | [diff] [blame] | 309 | public abstract Builder incompatibleExpandDirectories(boolean value); |
| 310 | |
brandjon | 60be531 | 2017-10-04 23:06:41 +0200 | [diff] [blame] | 311 | public abstract Builder incompatibleNewActionsApi(boolean value); |
laurentlb | 1cbce0f | 2018-03-27 12:43:22 -0700 | [diff] [blame] | 312 | |
laurentlb | de41cf8 | 2019-04-12 13:47:58 -0700 | [diff] [blame] | 313 | public abstract Builder incompatibleNoKwargsInBuildFiles(boolean value); |
| 314 | |
laurentlb | d8d3776 | 2018-10-26 14:08:33 -0700 | [diff] [blame] | 315 | public abstract Builder incompatibleNoAttrLicense(boolean value); |
| 316 | |
cparsons | fbc828b | 2018-10-04 14:38:50 -0700 | [diff] [blame] | 317 | public abstract Builder incompatibleNoOutputAttrDefault(boolean value); |
| 318 | |
tomlu | aaf11e9 | 2018-06-02 10:20:16 -0700 | [diff] [blame] | 319 | public abstract Builder incompatibleNoSupportToolsInActionInputs(boolean value); |
| 320 | |
cparsons | 3cb3a5d | 2018-10-01 10:36:08 -0700 | [diff] [blame] | 321 | public abstract Builder incompatibleNoTargetOutputGroup(boolean value); |
| 322 | |
laurentlb | 9d179e1 | 2018-09-27 08:15:42 -0700 | [diff] [blame] | 323 | public abstract Builder incompatibleNoTransitiveLoads(boolean value); |
| 324 | |
Googler | f8e87fb | 2019-04-12 19:13:28 -0700 | [diff] [blame] | 325 | public abstract Builder incompatibleObjcFrameworkCleanup(boolean value); |
| 326 | |
dannark | ed87463 | 2019-01-17 14:01:15 -0800 | [diff] [blame] | 327 | public abstract Builder incompatibleRemapMainRepo(boolean value); |
| 328 | |
Danna Kelmer | 21f4bd3 | 2018-11-29 11:04:48 -0800 | [diff] [blame] | 329 | public abstract Builder incompatibleRemoveNativeMavenJar(boolean value); |
| 330 | |
cparsons | 6b3724f | 2019-04-26 08:53:32 -0700 | [diff] [blame] | 331 | public abstract Builder incompatibleRestrictNamedParams(boolean value); |
| 332 | |
laurentlb | 18ef7a5 | 2019-03-28 08:07:25 -0700 | [diff] [blame] | 333 | public abstract Builder incompatibleStringJoinRequiresStrings(boolean value); |
| 334 | |
laurentlb | ed63333 | 2019-04-12 16:34:08 -0700 | [diff] [blame] | 335 | public abstract Builder incompatibleStaticNameResolutionInBuildFiles(boolean value); |
cushon | 4a6f708 | 2019-01-28 00:31:29 -0800 | [diff] [blame] | 336 | |
brandjon | 60be531 | 2017-10-04 23:06:41 +0200 | [diff] [blame] | 337 | public abstract Builder internalSkylarkFlagTestCanary(boolean value); |
| 338 | |
plf | 3010e57 | 2019-03-11 07:02:28 -0700 | [diff] [blame] | 339 | public abstract Builder incompatibleDoNotSplitLinkingCmdline(boolean value); |
| 340 | |
plf | 0d40b7f | 2019-04-29 08:09:11 -0700 | [diff] [blame] | 341 | public abstract Builder incompatibleDepsetForLibrariesToLinkGetter(boolean value); |
| 342 | |
laurentlb | 6659b4c | 2019-02-18 07:23:36 -0800 | [diff] [blame] | 343 | public abstract StarlarkSemantics build(); |
brandjon | 60be531 | 2017-10-04 23:06:41 +0200 | [diff] [blame] | 344 | } |
| 345 | } |