diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb611e2..4149a08 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,11 +28,11 @@ jobs: - name: Validate Gradle Wrapper uses: gradle/wrapper-validation-action@v3 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v4 with: distribution: 'zulu' - java-version: 17 + java-version: 21 - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 @@ -64,24 +64,24 @@ jobs: if: steps.avd-cache.outputs.cache-hit != 'true' uses: reactivecircus/android-emulator-runner@v2 with: - api-level: 34 + api-level: 35 target: google_apis arch: x86_64 profile: pixel_6 - emulator-build: 12265550 + emulator-build: 12694320 force-avd-creation: false emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true script: echo "Generated AVD snapshot for caching." - - name: Run Android 14 Instrumented Tests + - name: Run Android 15 Instrumented Tests uses: reactivecircus/android-emulator-runner@v2 with: - api-level: 34 + api-level: 35 target: google_apis arch: x86_64 profile: pixel_6 - emulator-build: 12265550 + emulator-build: 12694320 force-avd-creation: false emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b080783..17c15b1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -23,11 +23,11 @@ jobs: - name: Validate Gradle Wrapper uses: gradle/wrapper-validation-action@v3 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v4 with: distribution: 'zulu' - java-version: 17 + java-version: 21 - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 7aa9835..82c0d9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ - Date format: YYYY-MM-dd +## v1.2.14/ 2024-12-06 + +* Based on `Kotlin 2.1.0`, `MMKV 2.0.0` + ## v1.2.14/ 2024-08-31 * Fixed the function `MMKV_KMP.withOpen` diff --git a/README.md b/README.md index d637458..6148858 100644 --- a/README.md +++ b/README.md @@ -12,17 +12,17 @@ Kotlin Multiplatform Common (kts): ```kotlin dependencies { - implementation("com.ctrip.flight.mmkv:mmkv-kotlin:1.2.14") + implementation("com.ctrip.flight.mmkv:mmkv-kotlin:1.2.15") } ``` -Current version is based on `Kotlin 2.0.20` and `MMKV 1.3.9`. +Current version is based on `Kotlin 2.1.0` and `MMKV 2.0.0`. Pure Android platform (kts): ```kotlin dependencies { - implementation("com.ctrip.flight.mmkv:mmkv-kotlin-android:1.2.14") + implementation("com.ctrip.flight.mmkv:mmkv-kotlin-android:1.2.15") } ``` @@ -31,10 +31,10 @@ Kotlin/Native on macOS: ```kotlin dependencies { // Intel Chip - implementation("com.ctrip.flight.mmkv:mmkv-kotlin-macosx64:1.2.14") + implementation("com.ctrip.flight.mmkv:mmkv-kotlin-macosx64:1.2.15") // M1&M2 Chip - implementation("com.ctrip.flight.mmkv:mmkv-kotlin-macosarm64:1.2.14") + implementation("com.ctrip.flight.mmkv:mmkv-kotlin-macosarm64:1.2.15") } ``` Note, if your project is a Kotlin/Native executable program project of macOS, or it supplies a framework to an iOS application project directly, then you need to manually add the dependency of MMKV, and may need to add `linkerOpts` for MMKV and MMKVCore: @@ -62,7 +62,7 @@ kotlin { cocoapods { // ...... pod(name = "MMKV") { - version = "1.3.9" + version = "2.0.1" moduleName = "MMKV" } } diff --git a/README_CN.md b/README_CN.md index a561673..3c0638d 100644 --- a/README_CN.md +++ b/README_CN.md @@ -10,17 +10,17 @@ Kotlin Multiplatform Common (kts): ```kotlin dependencies { - implementation("com.ctrip.flight.mmkv:mmkv-kotlin:1.2.14") + implementation("com.ctrip.flight.mmkv:mmkv-kotlin:1.2.15") } ``` -当前版本依赖于 `Kotlin 2.0.20` 以及 `MMKV 1.3.9`。 +当前版本依赖于 `Kotlin 2.1.0` 以及 `MMKV 2.0.0`。 纯 Android 平台(kts): ```kotlin dependencies { - implementation("com.ctrip.flight.mmkv:mmkv-kotlin-android:1.2.14") + implementation("com.ctrip.flight.mmkv:mmkv-kotlin-android:1.2.15") } ``` @@ -29,10 +29,10 @@ Kotlin/Native on macOS: ```kotlin dependencies { // Intel 芯片 - implementation("com.ctrip.flight.mmkv:mmkv-kotlin-macosx64:1.2.14") + implementation("com.ctrip.flight.mmkv:mmkv-kotlin-macosx64:1.2.15") // M1&M2 芯片 - implementation("com.ctrip.flight.mmkv:mmkv-kotlin-macosarm64:1.2.14") + implementation("com.ctrip.flight.mmkv:mmkv-kotlin-macosarm64:1.2.15") } ``` 注意,如果你的工程为 macOS 的 Kotlin/Native 可执行程序工程,或者它直接向一个 iOS 应用程序工程提供 framework,那么您需要手动在工程中添加对 MMKV 的依赖,并可能需要添加对 MMKV 及 MMKVCore 的 `linkerOpts`: @@ -60,7 +60,7 @@ kotlin { cocoapods { // ...... pod(name = "MMKV") { - version = "1.3.9" + version = "2.0.0" moduleName = "MMKV" } } diff --git a/gradle.properties b/gradle.properties index 1fdc972..43f1ec5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,3 +14,4 @@ android.enableJetifier=true kotlin.code.style=official kotlin.mpp.stability.nowarn=true kotlin.mpp.enableCInteropCommonization=true +kotlin.natvie.increment=true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9c47d22..caa004e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,8 +1,8 @@ [versions] -kotlin = "2.0.20" -agp = "8.6.0" -mmkv = "1.3.9" +kotlin = "2.1.0" +agp = "8.7.3" +mmkv = "2.0.0" junit = "4.13.2" androidx-test = "1.6.1" androidx-test-runner = "1.6.2" diff --git a/mmkv-kotlin/MMKV_Kotlin.podspec b/mmkv-kotlin/MMKV_Kotlin.podspec index 89d5802..a1eabc0 100644 --- a/mmkv-kotlin/MMKV_Kotlin.podspec +++ b/mmkv-kotlin/MMKV_Kotlin.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = 'mmkv_kotlin' - spec.version = '1.2.14' + spec.version = '1.2.15' spec.homepage = 'Link to the Shared Module homepage' spec.source = { :http=> ''} spec.authors = '' @@ -8,9 +8,9 @@ Pod::Spec.new do |spec| spec.summary = 'Some description for the Shared Module' spec.vendored_frameworks = 'build/cocoapods/framework/MMKV_Kotlin.framework' spec.libraries = 'c++' - spec.ios.deployment_target = '17.5.1' - spec.osx.deployment_target = '14.4.1' - spec.dependency 'MMKV', '1.3.9' + spec.ios.deployment_target = '18.1.1' + spec.osx.deployment_target = '15.1.1' + spec.dependency 'MMKV', '2.0.0' if !Dir.exist?('build/cocoapods/framework/MMKV_Kotlin.framework') || Dir.empty?('build/cocoapods/framework/MMKV_Kotlin.framework') raise " diff --git a/mmkv-kotlin/build.gradle.kts b/mmkv-kotlin/build.gradle.kts index 4b2eb91..a8fbaf0 100644 --- a/mmkv-kotlin/build.gradle.kts +++ b/mmkv-kotlin/build.gradle.kts @@ -10,7 +10,7 @@ plugins { signing } -version = "1.2.14" +version = "1.2.15" group = "com.ctrip.flight.mmkv" @OptIn(ExperimentalKotlinGradlePluginApi::class) @@ -32,8 +32,8 @@ kotlin { cocoapods { summary = "Some description for the Shared Module" homepage = "Link to the Shared Module homepage" - ios.deploymentTarget = "17.5.1" - osx.deploymentTarget = "14.4.1" + ios.deploymentTarget = "18.1.1" + osx.deploymentTarget = "15.1.1" framework { baseName = "MMKV-Kotlin" isStatic = true @@ -48,38 +48,32 @@ kotlin { all { languageSettings.optIn("kotlin.RequiresOptIn") } - val commonTest by getting { - dependencies { - implementation(kotlin("test")) - } + commonTest.dependencies { + implementation(kotlin("test")) } - val androidMain by getting { - dependencies { - api(libs.mmkv) - } + androidMain.dependencies { + api(libs.mmkv) } - val androidInstrumentedTest by getting { - dependencies { - implementation(kotlin("test-junit")) - implementation(libs.junit) - implementation(libs.androidx.test.core) - implementation(libs.androidx.test.runner) - implementation(libs.androidx.test.rules) - } + androidInstrumentedTest.dependencies { + implementation(kotlin("test-junit")) + implementation(libs.junit) + implementation(libs.androidx.test.core) + implementation(libs.androidx.test.runner) + implementation(libs.androidx.test.rules) } } } android { namespace = "com.ctrip.flight.mmkv" - compileSdk = 34 + compileSdk = 35 defaultConfig { minSdk = 23 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } compileOptions { sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_21 } } diff --git a/mmkv-kotlin/src/androidMain/AndroidManifest.xml b/mmkv-kotlin/src/androidMain/AndroidManifest.xml deleted file mode 100644 index 3576753..0000000 --- a/mmkv-kotlin/src/androidMain/AndroidManifest.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file