From 89ec15da25c7dc15886d35ce0c6d572f32095036 Mon Sep 17 00:00:00 2001 From: Kengo TODA Date: Thu, 28 Mar 2024 05:19:54 +0800 Subject: [PATCH 1/5] build: bump up Java to the latest release Signed-off-by: Kengo TODA --- .java-version | 2 +- ...jp.skypencil.kosmo.kotlin-common-conventions.gradle.kts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.java-version b/.java-version index 98d9bcb..2bd5a0a 100644 --- a/.java-version +++ b/.java-version @@ -1 +1 @@ -17 +22 diff --git a/buildSrc/src/main/kotlin/jp.skypencil.kosmo.kotlin-common-conventions.gradle.kts b/buildSrc/src/main/kotlin/jp.skypencil.kosmo.kotlin-common-conventions.gradle.kts index ba5c9ae..b72847b 100644 --- a/buildSrc/src/main/kotlin/jp.skypencil.kosmo.kotlin-common-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/jp.skypencil.kosmo.kotlin-common-conventions.gradle.kts @@ -1,3 +1,5 @@ +import java.util.Scanner + plugins { id("org.jetbrains.kotlin.jvm") id("com.diffplug.spotless") @@ -16,7 +18,10 @@ repositories { java { toolchain { - languageVersion.set(JavaLanguageVersion.of(17)) + Scanner(file("$rootDir/.java-version")).use { scanner -> + val version = scanner.nextInt() + languageVersion.set(JavaLanguageVersion.of(version)) + } } } From 0f243ffef78c802ae569fff59c3e0593c13f4abc Mon Sep 17 00:00:00 2001 From: Kengo TODA Date: Thu, 28 Mar 2024 05:33:45 +0800 Subject: [PATCH 2/5] build: use version catalog to maintain dependencies Signed-off-by: Kengo TODA --- ....kosmo.kotlin-common-conventions.gradle.kts | 18 +++++++++--------- gradle/libs.versions.toml | 9 ++++++++- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/buildSrc/src/main/kotlin/jp.skypencil.kosmo.kotlin-common-conventions.gradle.kts b/buildSrc/src/main/kotlin/jp.skypencil.kosmo.kotlin-common-conventions.gradle.kts index b72847b..3aacac9 100644 --- a/buildSrc/src/main/kotlin/jp.skypencil.kosmo.kotlin-common-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/jp.skypencil.kosmo.kotlin-common-conventions.gradle.kts @@ -7,6 +7,9 @@ plugins { id("test-report-aggregation") } +fun libs(lib: String) = + project.extensions.getByType().named("libs").findLibrary(lib).get() + sourceSets.main { // KSP - To use generated sources java.srcDirs("build/generated/ksp/main/kotlin") @@ -25,16 +28,13 @@ java { } } -val kotest = "5.8.1" -val koin = "3.5.3" -val koinKsp = "1.3.1" dependencies { - implementation("io.insert-koin:koin-core:$koin") - compileOnly("io.insert-koin:koin-annotations:$koinKsp") - ksp("io.insert-koin:koin-ksp-compiler:$koinKsp") - testImplementation("io.kotest:kotest-assertions-core:$kotest") - testImplementation("io.kotest:kotest-property:$kotest") - testImplementation("io.kotest:kotest-runner-junit5:$kotest") + implementation(libs("koin-core")) + compileOnly(libs("koin-annotations")) + ksp(libs("koin-ksp-compiler")) + testImplementation(libs("kotest-assertions-core")) + testImplementation(libs("kotest-property")) + testImplementation(libs("kotest-runner-junit5")) } tasks.withType().configureEach { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index cdd5d2d..7a09ea5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,10 +1,17 @@ [versions] +koin = "3.5.3" +koinKsp = "1.3.1" kotest = "5.8.1" log4j = "2.23.1" slf4j = "2.0.12" [libraries] -kotest-runner-juni5 = { module = "io.kotest:kotest-runner-junit5", version.ref = "kotest" } +koin-annotations = { module = "io.insert-koin:koin-annotations", version.ref = "koinKsp" } +koin-ksp-compiler = { module = "io.insert-koin:koin-ksp-compiler", version.ref = "koinKsp" } +koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" } +kotest-assertions-core = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" } +kotest-property = { module = "io.kotest:kotest-property", version.ref = "kotest" } +kotest-runner-junit5 = { module = "io.kotest:kotest-runner-junit5", version.ref = "kotest" } kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.7.3" } log4j-slf4j2-impl = { module = "org.apache.logging.log4j:log4j-slf4j2-impl", version.ref = "log4j" } slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" } From d7b9e66a0c821082f0f2faacf71da18b6510ce7b Mon Sep 17 00:00:00 2001 From: Kengo TODA Date: Thu, 28 Mar 2024 05:34:54 +0800 Subject: [PATCH 3/5] build: update metadata for IDEA Signed-off-by: Kengo TODA --- .idea/compiler.xml | 2 +- .idea/kotlinc.xml | 2 +- .idea/misc.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index b589d56..6030a3d 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml index e805548..fe63bb6 100644 --- a/.idea/kotlinc.xml +++ b/.idea/kotlinc.xml @@ -1,6 +1,6 @@ - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 49504ef..82c19e5 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file From 1ae6633eddc08d0b3e38bde48e1b66e5d0d9ab3e Mon Sep 17 00:00:00 2001 From: Kengo TODA Date: Thu, 28 Mar 2024 05:38:15 +0800 Subject: [PATCH 4/5] ci: update GitHub Actions Signed-off-by: Kengo TODA --- .github/workflows/ci.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0533c13..6f56b8d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,18 +12,18 @@ jobs: contents: write # to submit the dependency graph steps: - uses: actions/checkout@v4 - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: distribution: temurin java-version-file: .java-version - name: Build with Gradle - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 with: arguments: build testAggregateTestReport --scan --continue dependency-graph: generate-and-submit - name: Upload build reports if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: build-reports path: backend/build/reports From 24e8b9e1cb220480afbc928893dbf99b41e6694d Mon Sep 17 00:00:00 2001 From: Kengo TODA Date: Thu, 28 Mar 2024 05:40:31 +0800 Subject: [PATCH 5/5] build: use Java 21 Signed-off-by: Kengo TODA --- .idea/compiler.xml | 2 +- .idea/misc.xml | 2 +- .java-version | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 6030a3d..b86273d 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 82c19e5..ed6ca53 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/.java-version b/.java-version index 2bd5a0a..aabe6ec 100644 --- a/.java-version +++ b/.java-version @@ -1 +1 @@ -22 +21