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

FR: Suggest converting an android project to a JVM-only project if possible #1163

Open
ZacSweers opened this issue Apr 11, 2024 · 1 comment
Labels
enhancement New feature or request toolchain:android

Comments

@ZacSweers
Copy link
Sponsor Contributor

Is your feature request related to a problem? Please describe.
In some cases, android projects may use no android APIs/features. In these cases, these projects could be converted wholly to JVM projects and offload the work that the comparatively-expensive AGP plugin does.

I think the logic could be:

  • No android.* APIs used from the Android SDK.
  • No android dependencies used.
  • No android build features used (buildconfig, viewbinding, compose).
  • No android resources defined.

Describe the solution you'd like
Advice produced in this case!

Describe alternatives you've considered

Additional context

@autonomousapps
Copy link
Owner

autonomousapps commented Apr 11, 2024

This feature already exists, partially. See here. It uses a heuristic to determine if an Android module "could" or "should" be a JVM module. If you run ./gradlew lib:projectHealth on an Android module that uses limited or no Android features, you should see "module advice" telling you you could turn it into a JVM module. The reason task also supports providing more information about why this advice is emitted (or not).

As far as I know, we have no real users of this "module advice" feature yet, so we don't know how useful it is, if at all. Feedback is very welcome!

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

No branches or pull requests

2 participants