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-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") // kotlin 反射 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") implementation("org.postgresql:postgresql") // Kafka implementation("org.springframework.kafka:spring-kafka") // redis implementation("org.springframework.boot:spring-boot-starter-data-redis") // 腾讯云COS implementation("com.qcloud:cos_api:5.6.133") // configuration processor annotationProcessor("org.springframework.boot:spring-boot-configuration-processor") // test testImplementation("org.springframework.boot:spring-boot-starter-test") } tasks.withType { @Suppress("SAFE_CALL_WILL_CHANGE_NULLABILITY", "UNNECESSARY_SAFE_CALL") jvmArgs = jvmArgs?.toMutableList()?.plus("-Dlog4j.skipJansi=false") } tasks.withType { imageName.set("auto/aics_main") } tasks.withType { kotlinOptions { freeCompilerArgs += "-Xjsr305=strict" jvmTarget = "17" } } tasks.withType { useJUnitPlatform() }