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

Make build fail if using Android-incompatible JVM APIs/deps #49

Open
joffrey-bion opened this issue Apr 19, 2020 · 3 comments
Open

Make build fail if using Android-incompatible JVM APIs/deps #49

joffrey-bion opened this issue Apr 19, 2020 · 3 comments
Labels
internal Issues that should not appear in the changelog

Comments

@joffrey-bion
Copy link
Owner

joffrey-bion commented Apr 19, 2020

Based on this slack conversation, there should be a way to define an Android target (making use of the Android toolchain) in the build, so that using incompatible JVM dependencies or APIs fails the build.

An attempt lives here: 5f27a77

But it requires actually installing the android toolchain locally and in the CI, and may not be worth it for now until people upvote this issue.

@joffrey-bion joffrey-bion added the enhancement New feature or request label Apr 19, 2020
@joffrey-bion joffrey-bion changed the title Android target support Make build fail is using JVM stuff that's not compatible with Android target May 6, 2020
@joffrey-bion joffrey-bion changed the title Make build fail is using JVM stuff that's not compatible with Android target Make build fail is using Android-incompatible JVM APIs/deps May 6, 2020
@joffrey-bion joffrey-bion changed the title Make build fail is using Android-incompatible JVM APIs/deps Make build fail if using Android-incompatible JVM APIs/deps May 6, 2020
@joffrey-bion joffrey-bion added internal Issues that should not appear in the changelog and removed enhancement New feature or request labels May 6, 2020
@joffrey-bion
Copy link
Owner Author

@joffrey-bion
Copy link
Owner Author

Gradle setup is kinda described here:
https://kotlinlang.org/docs/kmm-understand-project-structure.html#android-library

@joffrey-bion
Copy link
Owner Author

joffrey-bion commented Jan 17, 2023

Creating an Android target might actually not be necessary nor desirable if we're not building an actual Android library (with manifest, potential R resources, etc.).

Another option could be to use AnimalSniffer to check for old Android API usages ru.vyarus.animalsniffer.

EDIT: animal sniffer with Android signatures might be only useful for detecting usages of Android-specific APIs, but might not detect the use of unsupported Java features. To be double checked. Not that Java 9+ APIs would be detected via toolchains anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Issues that should not appear in the changelog
Projects
None yet
Development

No branches or pull requests

1 participant