From e3b54ca80af921ede76e3a37d3ef302b8a69861c Mon Sep 17 00:00:00 2001 From: stefankoppier Date: Sun, 25 Aug 2024 12:35:57 +0200 Subject: [PATCH 1/4] Prepare release 0.7.0 --- .github/workflows/compatibility-test.yml | 2 +- gradle.properties | 2 +- gradle/libs.versions.toml | 2 +- .../src/main/kotlin/EnumMapping.kt | 11 ------ .../src/main/kotlin/GeneratedEnumMapper.kt | 15 -------- .../src/main/kotlin/ObjectMapper.kt | 36 ------------------ .../src/test/kotlin/EnumMapperTest.kt | 21 ---------- .../kotlin/NestedGeneratedEnumMapperTest.kt | 22 ----------- .../src/test/kotlin/ObjectMapperTest.kt | 13 ------- .../.gitignore | 0 .../build.gradle.kts | 2 +- .../gradle/gradle-daemon-jvm.properties | 0 .../gradle/wrapper/gradle-wrapper.jar | Bin .../gradle/wrapper/gradle-wrapper.properties | 0 .../gradlew | 0 .../gradlew.bat | 0 .../settings.gradle.kts | 2 +- website/src/changelog.md | 3 +- 18 files changed, 7 insertions(+), 124 deletions(-) delete mode 100644 test/kotlin-2.0.20-RC/src/main/kotlin/EnumMapping.kt delete mode 100644 test/kotlin-2.0.20-RC/src/main/kotlin/GeneratedEnumMapper.kt delete mode 100644 test/kotlin-2.0.20-RC/src/main/kotlin/ObjectMapper.kt delete mode 100644 test/kotlin-2.0.20-RC/src/test/kotlin/EnumMapperTest.kt delete mode 100644 test/kotlin-2.0.20-RC/src/test/kotlin/NestedGeneratedEnumMapperTest.kt delete mode 100644 test/kotlin-2.0.20-RC/src/test/kotlin/ObjectMapperTest.kt rename test/{kotlin-2.0.20-RC => kotlin-2.0.20}/.gitignore (100%) rename test/{kotlin-2.0.20-RC => kotlin-2.0.20}/build.gradle.kts (86%) rename test/{kotlin-2.0.20-RC => kotlin-2.0.20}/gradle/gradle-daemon-jvm.properties (100%) rename test/{kotlin-2.0.20-RC => kotlin-2.0.20}/gradle/wrapper/gradle-wrapper.jar (100%) rename test/{kotlin-2.0.20-RC => kotlin-2.0.20}/gradle/wrapper/gradle-wrapper.properties (100%) rename test/{kotlin-2.0.20-RC => kotlin-2.0.20}/gradlew (100%) mode change 100755 => 100644 rename test/{kotlin-2.0.20-RC => kotlin-2.0.20}/gradlew.bat (100%) rename test/{kotlin-2.0.20-RC => kotlin-2.0.20}/settings.gradle.kts (80%) diff --git a/.github/workflows/compatibility-test.yml b/.github/workflows/compatibility-test.yml index afe5fed3..6f76f86d 100644 --- a/.github/workflows/compatibility-test.yml +++ b/.github/workflows/compatibility-test.yml @@ -16,7 +16,7 @@ jobs: compatibility: strategy: matrix: - version: ['kotlin-1.9.24', 'kotlin-2.0.0', 'kotlin-2.0.20-RC', 'java'] + version: ['kotlin-1.9.24', 'kotlin-2.0.0', 'kotlin-2.0.20', 'java'] name: Compatibility permissions: pull-requests: read diff --git a/gradle.properties b/gradle.properties index e60a9386..484c64fb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=0.7.0-SNAPSHOT \ No newline at end of file +version=0.7.0 \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 564e9144..7da2fdf1 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -kotlin = "2.0.10" +kotlin = "2.0.20" [libraries] kotlin-compiler-embeddable = { module = "org.jetbrains.kotlin:kotlin-compiler-embeddable", version.ref = "kotlin" } diff --git a/test/kotlin-2.0.20-RC/src/main/kotlin/EnumMapping.kt b/test/kotlin-2.0.20-RC/src/main/kotlin/EnumMapping.kt deleted file mode 100644 index 69903de9..00000000 --- a/test/kotlin-2.0.20-RC/src/main/kotlin/EnumMapping.kt +++ /dev/null @@ -1,11 +0,0 @@ -import tech.mappie.api.EnumMappie - -enum class InputEnum { - A, B, C, D; -} - -enum class OutputEnum { - A, B, C, D, E; -} - -object EnumMapper : EnumMappie() \ No newline at end of file diff --git a/test/kotlin-2.0.20-RC/src/main/kotlin/GeneratedEnumMapper.kt b/test/kotlin-2.0.20-RC/src/main/kotlin/GeneratedEnumMapper.kt deleted file mode 100644 index 98f428ab..00000000 --- a/test/kotlin-2.0.20-RC/src/main/kotlin/GeneratedEnumMapper.kt +++ /dev/null @@ -1,15 +0,0 @@ -import tech.mappie.api.ObjectMappie - -data class NestedGeneratedInputObject(val enum: InputEnumTwo) - -enum class InputEnumTwo { - A, B, C, D; -} - -data class NestedGeneratedOutputObject(val enum: OutputEnumTwo) - -enum class OutputEnumTwo { - A, B, C, D, E; -} - -object NestedGeneratedInputToOutputMapper : ObjectMappie() \ No newline at end of file diff --git a/test/kotlin-2.0.20-RC/src/main/kotlin/ObjectMapper.kt b/test/kotlin-2.0.20-RC/src/main/kotlin/ObjectMapper.kt deleted file mode 100644 index 01d865c0..00000000 --- a/test/kotlin-2.0.20-RC/src/main/kotlin/ObjectMapper.kt +++ /dev/null @@ -1,36 +0,0 @@ -import tech.mappie.api.ObjectMappie - -data class InputObject( - val name: String, - val age: Int, - val nested: NestedInput, -) - -data class NestedInput(val boolean: BooleanEnum) { - enum class BooleanEnum { TRUE, FALSE } -} - -data class OutputObject( - val name: String, - val age: Int, - val boolean: Boolean, -) - -object ObjectMapperWithoutVia : ObjectMappie() { - override fun map(from: InputObject) = mapping { - to::boolean fromProperty from.nested::boolean - } -} - -object ObjectMapper : ObjectMappie() { - override fun map(from: InputObject) = mapping { - to::boolean fromProperty from.nested::boolean via BooleanEnumToBooleanMapper - } -} - -object BooleanEnumToBooleanMapper : ObjectMappie() { - override fun map(from: NestedInput.BooleanEnum) = when (from) { - NestedInput.BooleanEnum.TRUE -> !false - NestedInput.BooleanEnum.FALSE -> !true - } -} diff --git a/test/kotlin-2.0.20-RC/src/test/kotlin/EnumMapperTest.kt b/test/kotlin-2.0.20-RC/src/test/kotlin/EnumMapperTest.kt deleted file mode 100644 index b368d6b7..00000000 --- a/test/kotlin-2.0.20-RC/src/test/kotlin/EnumMapperTest.kt +++ /dev/null @@ -1,21 +0,0 @@ -import kotlin.test.Test -import kotlin.test.assertEquals - -class EnumMapperTest { - - private val mappings = listOf( - InputEnum.A to OutputEnum.A, - InputEnum.B to OutputEnum.B, - InputEnum.C to OutputEnum.C, - InputEnum.D to OutputEnum.D, - ) - - @Test - fun `map InputEnum to OutputEnum`() { - mappings.forEach { (input, expected) -> - assertEquals( - EnumMapper.map(input), expected - ) - } - } -} \ No newline at end of file diff --git a/test/kotlin-2.0.20-RC/src/test/kotlin/NestedGeneratedEnumMapperTest.kt b/test/kotlin-2.0.20-RC/src/test/kotlin/NestedGeneratedEnumMapperTest.kt deleted file mode 100644 index a0b8d9be..00000000 --- a/test/kotlin-2.0.20-RC/src/test/kotlin/NestedGeneratedEnumMapperTest.kt +++ /dev/null @@ -1,22 +0,0 @@ -import kotlin.test.Test -import kotlin.test.assertEquals - -class NestedGeneratedEnumMapperTest { - - private val mappings = listOf( - InputEnumTwo.A to OutputEnumTwo.A, - InputEnumTwo.B to OutputEnumTwo.B, - InputEnumTwo.C to OutputEnumTwo.C, - InputEnumTwo.D to OutputEnumTwo.D, - ) - - @Test - fun `map NestedGeneratedInputObject to NestedGeneratedOutputObject`() { - mappings.forEach { (input, expected) -> - assertEquals( - NestedGeneratedInputToOutputMapper.map(NestedGeneratedInputObject(input)), - NestedGeneratedOutputObject(expected) - ) - } - } -} diff --git a/test/kotlin-2.0.20-RC/src/test/kotlin/ObjectMapperTest.kt b/test/kotlin-2.0.20-RC/src/test/kotlin/ObjectMapperTest.kt deleted file mode 100644 index 38c9dcb4..00000000 --- a/test/kotlin-2.0.20-RC/src/test/kotlin/ObjectMapperTest.kt +++ /dev/null @@ -1,13 +0,0 @@ -import org.junit.jupiter.api.Test -import kotlin.test.assertEquals - -class ObjectMapperTest { - - @Test - fun `map using ObjectMapper`() { - assertEquals( - OutputObject("name", 22, true), - ObjectMapper.map(InputObject("name", 22, NestedInput(NestedInput.BooleanEnum.TRUE))) - ) - } -} \ No newline at end of file diff --git a/test/kotlin-2.0.20-RC/.gitignore b/test/kotlin-2.0.20/.gitignore similarity index 100% rename from test/kotlin-2.0.20-RC/.gitignore rename to test/kotlin-2.0.20/.gitignore diff --git a/test/kotlin-2.0.20-RC/build.gradle.kts b/test/kotlin-2.0.20/build.gradle.kts similarity index 86% rename from test/kotlin-2.0.20-RC/build.gradle.kts rename to test/kotlin-2.0.20/build.gradle.kts index 195cb99d..94caec5b 100644 --- a/test/kotlin-2.0.20-RC/build.gradle.kts +++ b/test/kotlin-2.0.20/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("org.jetbrains.kotlin.jvm") version "2.0.20-RC" + id("org.jetbrains.kotlin.jvm") version "2.0.20" id("tech.mappie.plugin") version "+" } diff --git a/test/kotlin-2.0.20-RC/gradle/gradle-daemon-jvm.properties b/test/kotlin-2.0.20/gradle/gradle-daemon-jvm.properties similarity index 100% rename from test/kotlin-2.0.20-RC/gradle/gradle-daemon-jvm.properties rename to test/kotlin-2.0.20/gradle/gradle-daemon-jvm.properties diff --git a/test/kotlin-2.0.20-RC/gradle/wrapper/gradle-wrapper.jar b/test/kotlin-2.0.20/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from test/kotlin-2.0.20-RC/gradle/wrapper/gradle-wrapper.jar rename to test/kotlin-2.0.20/gradle/wrapper/gradle-wrapper.jar diff --git a/test/kotlin-2.0.20-RC/gradle/wrapper/gradle-wrapper.properties b/test/kotlin-2.0.20/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from test/kotlin-2.0.20-RC/gradle/wrapper/gradle-wrapper.properties rename to test/kotlin-2.0.20/gradle/wrapper/gradle-wrapper.properties diff --git a/test/kotlin-2.0.20-RC/gradlew b/test/kotlin-2.0.20/gradlew old mode 100755 new mode 100644 similarity index 100% rename from test/kotlin-2.0.20-RC/gradlew rename to test/kotlin-2.0.20/gradlew diff --git a/test/kotlin-2.0.20-RC/gradlew.bat b/test/kotlin-2.0.20/gradlew.bat similarity index 100% rename from test/kotlin-2.0.20-RC/gradlew.bat rename to test/kotlin-2.0.20/gradlew.bat diff --git a/test/kotlin-2.0.20-RC/settings.gradle.kts b/test/kotlin-2.0.20/settings.gradle.kts similarity index 80% rename from test/kotlin-2.0.20-RC/settings.gradle.kts rename to test/kotlin-2.0.20/settings.gradle.kts index 846d7d07..4f2b5fff 100644 --- a/test/kotlin-2.0.20-RC/settings.gradle.kts +++ b/test/kotlin-2.0.20/settings.gradle.kts @@ -1,4 +1,4 @@ -rootProject.name = "mappie-test-kotlin-2.0.20-RC" +rootProject.name = "mappie-test-kotlin-2.0.20" pluginManagement { repositories { diff --git a/website/src/changelog.md b/website/src/changelog.md index 8b5aea46..6a71dde4 100644 --- a/website/src/changelog.md +++ b/website/src/changelog.md @@ -2,11 +2,12 @@ title: "Changelog" layout: "layouts/changelog.html" changelog: - - date: "tbd" + - date: "2024-08-25" title: "v0.7.0" items: - "Added more built-in mappers." - "Fixed a bug where mappers nested inside classes which are not a mapper are not generated." + - "Fixed warnings for newest Kotlin versions." - date: "2024-08-31" title: "v0.6.0" items: From 494d2014ffe8c5843447bc0f4c3d51b5e8870559 Mon Sep 17 00:00:00 2001 From: stefankoppier Date: Sun, 25 Aug 2024 12:43:16 +0200 Subject: [PATCH 2/4] Updated gradlew --- test/kotlin-2.0.20/gradlew | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/kotlin-2.0.20/gradlew b/test/kotlin-2.0.20/gradlew index 1aa94a42..b740cf13 100644 --- a/test/kotlin-2.0.20/gradlew +++ b/test/kotlin-2.0.20/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. From 83b4e2910cec3e2d5647f7648482f317a4ee986b Mon Sep 17 00:00:00 2001 From: stefankoppier Date: Sun, 25 Aug 2024 12:48:15 +0200 Subject: [PATCH 3/4] Updated gradlew --- test/kotlin-2.0.20/gradlew | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/kotlin-2.0.20/gradlew b/test/kotlin-2.0.20/gradlew index b740cf13..1aa94a42 100644 --- a/test/kotlin-2.0.20/gradlew +++ b/test/kotlin-2.0.20/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. From d97c40576ceb5caddaac664b57a8a2c8bc6cb44e Mon Sep 17 00:00:00 2001 From: stefankoppier Date: Sun, 25 Aug 2024 12:52:45 +0200 Subject: [PATCH 4/4] Updated gradlew --- test/kotlin-2.0.20/gradlew | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 test/kotlin-2.0.20/gradlew diff --git a/test/kotlin-2.0.20/gradlew b/test/kotlin-2.0.20/gradlew old mode 100644 new mode 100755