Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-fix for android buildFeatures rules may add code to the wrong android { ... } block #460

Open
RBusarow opened this issue Mar 18, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@RBusarow
Copy link
Member

If the target module has a convention plugin, that convention plugin may have its own non-Google android { ... } configuration block.

example:

plugins {
  id `company-convention-plugin`
}

ourCompany {
  android {
    someSetting true
  }
}

...

In this case, the android block isn't a configuration for BaseExtension/LibraryExtension/etc. It's something else entirely.

But the existing Android parser will see this block and assume that it's Google's. It will add any auto-fixes there.

There's no perfect solution to this. A couple options:

  • Do nothing. In a case like this, the company should either disable the rule, or if they want auto-correct, add a property of the same name to their DSL.
  • Ignore any android blocks which aren't top-level. If it's top-level and an actual Android module, it'll work.
@RBusarow RBusarow added the bug Something isn't working label Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant