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

After adding mocKMP am forced to upgrade to jvm 17 #64

Open
kmadsen opened this issue Aug 8, 2023 · 1 comment
Open

After adding mocKMP am forced to upgrade to jvm 17 #64

kmadsen opened this issue Aug 8, 2023 · 1 comment

Comments

@kmadsen
Copy link

kmadsen commented Aug 8, 2023

I'm not certain if this is a real issue for mocKMP but am seeing if some of the devs know if they added something that would cause this to force upgrade.

Essentially we added mocKMP to a kotlin multiplatform project in hopes to have mocking in the project. But we are building a SDK and are concerned that if we include it would force developers using our SDK to upgrade to jvm17 as well.

Can someone here provide some insight for what is causing this? Below is a shrunken version of a build.gradle.kts that shows the changes we are forced to make when adding the mockmp plugin.

plugins {
    kotlin("multiplatform")
    id("com.android.library")
    id("kotlin-parcelize")
    id("com.rickclephas.kmp.nativecoroutines")
    id("com.google.devtools.ksp")
+   id("org.kodein.mock.mockmp") version "1.14.0"
}
kotlin {
    android {
        compilations.all {
            kotlinOptions {
-                jvmTarget = "1.8"
+                jvmTarget = "17"
            }
        }
    }
android {
    buildToolsVersion = "33.0.2"
    compileSdk = 33
    defaultConfig {
        minSdk = 21
    }
+    compileOptions {
+        sourceCompatibility = JavaVersion.VERSION_17
+        targetCompatibility = JavaVersion.VERSION_17
+    }
}

+ mockmp {
+    usesHelper = true
+ }
@SalomonBrys
Copy link
Member

That is very weird as MocKMP is indeed compiled with JDK 17 but targets JDK 1.8.

% javap -verbose org.kodein.mock.gradle.MocKMPGradlePlugin | grep major
  major version: 52

% javap -verbose org.kodein.mock.tests.TestsWithMocks | grep major 
  major version: 52

% javap -verbose org.kodein.mock.Mocker | grep major
  major version: 52

you should not have to target 17.
Whats is the error ?

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

No branches or pull requests

2 participants