hey folks, I can’t figure out how to set compatibility in
jvm
(not android) target to not allow APIs from java 8, is it possible? There’s
jvmTarget
configuration but it relates only to bytecode as far as I see.
Context: the jvm artifact is consumed by an Android app and we’d like to avoid desugaring, so we want to forbid using Java 8 APIs (like
java.time
) in the
jvmMain
source set.
e
ephemient
03/15/2022, 4:14 PM
Android Gradle Plugin overrides the bootstrap classpath, so not easily
ephemient
03/15/2022, 4:20 PM
also even if you override Android there, that won't stop you from being able to pull in dependencies that use Java 8 APIs
w
wasyl
03/15/2022, 4:43 PM
to clarify, I want to only allow java 6 APIs in the multiplatform project, which doesn’t build an android target — only jvm.
To simply, let’s take Android out of equation. Can I configure a multiplatform build such that its JVM target artifact runs on JDK 6 (so, without Java 8 apis)
Yeah I thought so too, but the app stil compiles without issues when using Java 8 APIs. Additionally, there’s a warning that .16 target is deprecated and will go away soon