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

Support Gradle 7.0's type-safe project accessors in auto-correct #52

Open
RBusarow opened this issue Mar 23, 2021 · 2 comments
Open

Support Gradle 7.0's type-safe project accessors in auto-correct #52

RBusarow opened this issue Mar 23, 2021 · 2 comments
Labels
feature New feature or request

Comments

@RBusarow
Copy link
Member

https://docs.gradle.org/7.0-rc-1/userguide/declaring_dependencies.html#sec:type-safe-project-accessors

dependencies {
  // type-safe alternative to project(":commons:utils:numbers")
  implementation(projects.commons.utils.numbers)
}
@RBusarow RBusarow added the feature New feature or request label Mar 23, 2021
@RBusarow RBusarow changed the title Support Gradle 7.0's type-safe project accessors in auto-correct Support Gradle 7.0's type-safe project accessors in auto-correct and sorting Mar 23, 2021
@RBusarow RBusarow changed the title Support Gradle 7.0's type-safe project accessors in auto-correct and sorting Support Gradle 7.0's type-safe project accessors in auto-correct Oct 26, 2021
@RBusarow
Copy link
Member Author

This is currently partially working.

ModuleCheck always knows the traditional, non-type-safe path. From here, it's easy to determine what the string value for the type-safe accessor would be.

  • :core becomes core
  • :core:jvm becomes core.jvm
  • :core-testing becomes coreTesting
  • :base:ui:navigation becomes base.ui.navigation

Because we can figure out the type-safe version, we're able to look for type-safe versions inside the dependency blocks. So, removing or modifying an existing type-safe reference works.

Adding type-safe accessors is not working.

@tasomaniac
Copy link
Contributor

This was surprisingly working well for me when I tried. The main benefit of this tool is to find what can be removed so it is ok if adding part does not work :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants