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
io.mockk:mockk:1.12.7 requires Java 11 all of a sudden #898
Comments
v. quick note to say this suggestion won't work (but it should be added for consistency)
because of this
It mockk/buildSrc/src/main/kotlin/buildsrc/convention/kotlin-multiplatform.gradle.kts Lines 15 to 22 in 0e9e346
|
Can you checkout the branch in #900, deploy it to Maven Local |
first experience...
but it's my bad, I have diff --git a/gradle.properties b/gradle.properties
index ffe3f2b7..c519a31f 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -5,7 +5,8 @@ org.gradle.configureondemand=false
org.gradle.parallel=true
# disable annoying Gradle Welcome in CI/CD
org.gradle.welcome=never
-org.gradle.jvmargs=-XX:MaxMetaspaceSize=768m
+org.gradle.jvmargs=-XX:MaxMetaspaceSize=768m -Xmx1G
+kotlin.daemon.jvmargs=-Xmx512M
kotlin.mpp.stability.nowarn=true re changes: no dice, local 1.12.8-SNAPSHOT from #900 also fails.
I tried this and it worked: diff --git a/modules/mockk-agent/build.gradle.kts b/modules/mockk-agent/build.gradle.kts
index a660bc60..f61c460e 100644
--- a/modules/mockk-agent/build.gradle.kts
+++ b/modules/mockk-agent/build.gradle.kts
@@ -18,7 +18,9 @@ kotlin {
jvm {
withJava()
}
-
+ jvmToolchain {
+ languageVersion.set(JavaLanguageVersion.of("8"))
+ }
sourceSets {
val commonMain by getting {
dependencies { |
Hmm strange. MockK has set up JVM Toolchains in a buildSrc convention plugin, though it's using JVM 11. You can change this in the root Lines 13 to 16 in fe36b92
|
JavaCompile.targetCompatibility |
This still seems to be a problem with version |
Related #1168? Very likely caused by #1056. @Raibaz you could add CI to check Java 8 compatibility, even if it's just a sample project with hardcoded Java 8 that uses the library as an included build. I have done it recently for mockito-kotlin, see https://github.com/mockito/mockito-kotlin/tree/main/tests for the approach. |
It seems like it was fixed in this PR: #1161 |
To be more specific
|
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Expected Behavior
Just works.
Current Behavior
Fails because of incorrect class files. Note this also breaks old Android versions, because API 21-24 are essentially JDK 8.
Failure Information (for bugs)
Potential fixes:
or add
jvmTarget = "1.8"
tomockk/buildSrc/src/main/kotlin/buildsrc/convention/kotlin-jvm.gradle.kts
Lines 25 to 31 in 0e9e346
Steps to Reproduce
on a serious note: just run any mockk test on Java 1.8. Up until 1.12.5 it was working, this is a major breaking change, not a patch.
Context
Related: #893
Stack trace
The text was updated successfully, but these errors were encountered: