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 diff --git a/.idea/compiler.xml b/.idea/compiler.xml index b589d56..b86273d 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..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 98d9bcb..aabe6ec 100644 --- a/.java-version +++ b/.java-version @@ -1 +1 @@ -17 +21 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..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 @@ -1,3 +1,5 @@ +import java.util.Scanner + plugins { id("org.jetbrains.kotlin.jvm") id("com.diffplug.spotless") @@ -5,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") @@ -16,20 +21,20 @@ repositories { java { toolchain { - languageVersion.set(JavaLanguageVersion.of(17)) + Scanner(file("$rootDir/.java-version")).use { scanner -> + val version = scanner.nextInt() + languageVersion.set(JavaLanguageVersion.of(version)) + } } } -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" }