diff --git a/build.gradle.kts b/build.gradle.kts index 8cc4ad0e..8b799706 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,5 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile val ktor_version: String by project val kotlin_version: String by project @@ -13,13 +14,19 @@ plugins { id("org.graalvm.buildtools.native") version "0.9.21" id("io.gitlab.arturbosch.detekt") version "1.22.0" id("com.google.devtools.ksp") version "1.8.21-1.0.11" + id("org.springframework.boot") version "3.1.2" + kotlin("plugin.spring") version "1.8.21" // id("org.jetbrains.kotlin.plugin.serialization") version "1.8.10" } +apply { + plugin("io.spring.dependency-management") +} + group = "dev.usbharu" version = "0.0.1" application { - mainClass.set("io.ktor.server.cio.EngineMain") + mainClass.set("dev.usbharu.hideout.SpringApplicationKt") val isDevelopment: Boolean = project.ext.has("development") applicationDefaultJvmArgs = listOf("-Dio.ktor.development=$isDevelopment") @@ -34,6 +41,12 @@ tasks.withType>().con compilerOptions.apiVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_8) } +tasks.withType { + kotlinOptions { + freeCompilerArgs += "-Xjsr305=strict" + } +} + tasks.withType { manifest { attributes( @@ -53,7 +66,7 @@ repositories { kotlin { target { compilations.all { - kotlinOptions.jvmTarget = JavaVersion.VERSION_11.toString() + kotlinOptions.jvmTarget = JavaVersion.VERSION_17.toString() } } } @@ -90,6 +103,9 @@ dependencies { implementation("io.ktor:ktor-server-compression-jvm:2.3.0") ksp("io.insert-koin:koin-ksp-compiler:1.2.0") + implementation("org.springframework.boot:spring-boot-starter-web") + + implementation("io.ktor:ktor-client-logging-jvm:$ktor_version") implementation("io.ktor:ktor-server-host-common-jvm:$ktor_version") diff --git a/gradle.properties b/gradle.properties index 9ee92fa5..31697ea3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ logback_version=1.4.6 kotlin.code.style=official exposed_version=0.41.1 h2_version=2.1.214 -koin_version=3.3.1 +koin_version=3.4.3 org.gradle.parallel=true org.gradle.configureondemand=true org.gradle.caching=true diff --git a/src/main/kotlin/dev/usbharu/hideout/SpringApplication.kt b/src/main/kotlin/dev/usbharu/hideout/SpringApplication.kt new file mode 100644 index 00000000..5d30de45 --- /dev/null +++ b/src/main/kotlin/dev/usbharu/hideout/SpringApplication.kt @@ -0,0 +1,12 @@ +package dev.usbharu.hideout + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.boot.runApplication + + +@SpringBootApplication +class SpringApplication + +fun main(args: Array) { + runApplication(*args) +} diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml index ad457f2b..9129b1b2 100644 --- a/src/main/resources/logback.xml +++ b/src/main/resources/logback.xml @@ -4,7 +4,7 @@ %d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - +