86 lines
2.9 KiB
Kotlin
86 lines
2.9 KiB
Kotlin
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage
|
||
import org.springframework.boot.gradle.tasks.run.BootRun
|
||
|
||
plugins {
|
||
id("org.springframework.boot") version "3.1.0"
|
||
id("io.spring.dependency-management") version "1.1.0"
|
||
kotlin("jvm") version "1.8.21"
|
||
kotlin("plugin.spring") version "1.8.21"
|
||
id("com.google.devtools.ksp") version "1.8.21-1.0.11"
|
||
}
|
||
|
||
group = "cn.edu.hfut.auto"
|
||
version = "1.0.0"
|
||
|
||
java {
|
||
sourceCompatibility = JavaVersion.VERSION_17
|
||
}
|
||
|
||
kotlin {
|
||
sourceSets.main {
|
||
kotlin.srcDir("build/generated/ksp/main")
|
||
}
|
||
}
|
||
|
||
configurations {
|
||
compileOnly {
|
||
extendsFrom(configurations.annotationProcessor.get())
|
||
}
|
||
implementation {
|
||
exclude(group = "org.springframework.boot", module = "spring-boot-starter-logging")
|
||
}
|
||
}
|
||
|
||
repositories {
|
||
mavenCentral()
|
||
}
|
||
|
||
dependencies {
|
||
implementation("org.springframework.boot:spring-boot-starter-data-elasticsearch")
|
||
implementation("org.springframework.boot:spring-boot-starter-data-redis")
|
||
implementation("org.springframework.boot:spring-boot-starter-validation")
|
||
implementation("org.springframework.boot:spring-boot-starter-web")
|
||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
|
||
// 日志
|
||
implementation("org.springframework.boot:spring-boot-starter-log4j2")
|
||
implementation("com.lmax:disruptor:3.4.4")
|
||
// kotlin 协程(spring 异步接口)
|
||
val kotlinxCoroutinesVersion = "1.7.1"
|
||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:$kotlinxCoroutinesVersion")
|
||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-jdk9:$kotlinxCoroutinesVersion")
|
||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor:$kotlinxCoroutinesVersion")
|
||
implementation("org.jetbrains.kotlin:kotlin-reflect")
|
||
// sa-token 安全认证框架
|
||
implementation("cn.dev33:sa-token-spring-boot3-starter:1.35.0.RC")
|
||
// jimmer 持久层框架
|
||
implementation("org.babyfish.jimmer:jimmer-spring-boot-starter:0.7.104")
|
||
ksp("org.babyfish.jimmer:jimmer-ksp:0.7.104")
|
||
// developmentOnly("org.springframework.boot:spring-boot-docker-compose")
|
||
implementation("org.postgresql:postgresql")
|
||
// Kafka
|
||
implementation("org.springframework.kafka:spring-kafka")
|
||
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
|
||
testImplementation("org.springframework.boot:spring-boot-starter-test")
|
||
}
|
||
|
||
tasks.withType<BootRun> {
|
||
@Suppress("SAFE_CALL_WILL_CHANGE_NULLABILITY", "UNNECESSARY_SAFE_CALL")
|
||
jvmArgs = jvmArgs?.toMutableList()?.plus("-Dlog4j.skipJansi=false")
|
||
}
|
||
|
||
tasks.withType<BootBuildImage> {
|
||
imageName.set("auto/aics_main")
|
||
}
|
||
|
||
tasks.withType<KotlinCompile> {
|
||
kotlinOptions {
|
||
freeCompilerArgs += "-Xjsr305=strict"
|
||
jvmTarget = "17"
|
||
}
|
||
}
|
||
|
||
tasks.withType<Test> {
|
||
useJUnitPlatform()
|
||
}
|