Skip to content

Commit

Permalink
Add --incompatible_disable_native_android_rules flag.
Browse files Browse the repository at this point in the history
RELNOTES: Introduce --incompatible_disable_native_android_rules flag
PiperOrigin-RevId: 249348930
  • Loading branch information
Googler authored and copybara-github committed May 21, 2019
1 parent 32282e5 commit 6fe6e98
Showing 1 changed file with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -854,9 +854,26 @@ public static class Options extends FragmentOptions {
OptionEffectTag.EAGERNESS_TO_EXIT,
},
help =
"If enabled, strict usage of the Starlark migration tag is enabled for android rules.")
"If enabled, strict usage of the Starlark migration tag is enabled for android rules. "
+ "Prefer using --incompatible_disable_native_android_rules.")
public boolean checkForMigrationTag;

@Option(
name = "incompatible_disable_native_android_rules",
defaultValue = "false",
documentationCategory = OptionDocumentationCategory.INPUT_STRICTNESS,
effectTags = {
OptionEffectTag.EAGERNESS_TO_EXIT,
},
metadataTags = {
OptionMetadataTag.INCOMPATIBLE_CHANGE,
OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES
},
help =
"If enabled, direct usage of the native Android rules is disabled. Please use the"
+ " Starlark Android rules from https://github.com/bazelbuild/rules_android")
public boolean disableNativeAndroidRules;

@Option(
name = "experimental_filter_r_jars_from_android_test",
defaultValue = "false",
Expand Down Expand Up @@ -1106,7 +1123,9 @@ private AndroidConfiguration(Options options) throws InvalidConfigurationExcepti
this.skipParsingAction = options.skipParsingAction;
this.fixedResourceNeverlinking = options.fixedResourceNeverlinking;
this.robolectricTestDeprecationLevel = options.robolectricTestDeprecationLevel;
this.checkForMigrationTag = options.checkForMigrationTag;
// use --incompatible_disable_native_android_rules, and also the old flag for backwards
// compatibility
this.checkForMigrationTag = options.checkForMigrationTag || options.disableNativeAndroidRules;
this.oneVersionEnforcementUseTransitiveJarsForBinaryUnderTest =
options.oneVersionEnforcementUseTransitiveJarsForBinaryUnderTest;
this.dataBindingV2 = options.dataBindingV2;
Expand Down

0 comments on commit 6fe6e98

Please sign in to comment.