2023-06-28 02:38:33 +08:00
|
|
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
2023-07-03 18:42:09 +08:00
|
|
|
|
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage
|
2023-06-28 02:38:33 +08:00
|
|
|
|
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-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"
|
2023-07-03 18:42:09 +08:00
|
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:$kotlinxCoroutinesVersion")
|
2023-06-28 02:38:33 +08:00
|
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-jdk9:$kotlinxCoroutinesVersion")
|
|
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor:$kotlinxCoroutinesVersion")
|
2023-07-05 22:47:14 +08:00
|
|
|
|
// kotlin 反射
|
2023-06-28 02:38:33 +08:00
|
|
|
|
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")
|
2023-07-03 18:42:09 +08:00
|
|
|
|
implementation("org.postgresql:postgresql")
|
|
|
|
|
// Kafka
|
|
|
|
|
implementation("org.springframework.kafka:spring-kafka")
|
2023-07-05 22:47:14 +08:00
|
|
|
|
// redis
|
|
|
|
|
implementation("org.springframework.boot:spring-boot-starter-data-redis")
|
|
|
|
|
// 腾讯云COS
|
|
|
|
|
implementation("com.qcloud:cos_api:5.6.133")
|
|
|
|
|
// configuration processor
|
2023-06-28 02:38:33 +08:00
|
|
|
|
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
|
2023-07-05 22:47:14 +08:00
|
|
|
|
// test
|
2023-06-28 02:38:33 +08:00
|
|
|
|
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")
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-03 18:42:09 +08:00
|
|
|
|
tasks.withType<BootBuildImage> {
|
|
|
|
|
imageName.set("auto/aics_main")
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-28 02:38:33 +08:00
|
|
|
|
tasks.withType<KotlinCompile> {
|
|
|
|
|
kotlinOptions {
|
|
|
|
|
freeCompilerArgs += "-Xjsr305=strict"
|
|
|
|
|
jvmTarget = "17"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tasks.withType<Test> {
|
|
|
|
|
useJUnitPlatform()
|
|
|
|
|
}
|