107 lines
3.9 KiB
Kotlin
107 lines
3.9 KiB
Kotlin
import org.gradle.kotlin.dsl.implementation
|
|
|
|
val kotlin_version: String by project
|
|
val logback_version: String by project
|
|
val kotlinx_html_version: String by project
|
|
val ktor_version: String by project
|
|
val exposed_version: String by project
|
|
val h2_version: String by project
|
|
val postgres_version: String by project
|
|
|
|
plugins {
|
|
kotlin("jvm") version "2.1.0"
|
|
id("io.ktor.plugin") version "3.1.3"
|
|
id("org.jetbrains.kotlin.plugin.serialization") version "2.0.20"
|
|
}
|
|
|
|
group = "ink.snowflake"
|
|
version = "0.0.1"
|
|
|
|
application {
|
|
mainClass.set("io.ktor.server.tomcat.jakarta.EngineMain")
|
|
|
|
val isDevelopment: Boolean = project.ext.has("development")
|
|
applicationDefaultJvmArgs = listOf("-Dio.ktor.development=$isDevelopment")
|
|
}
|
|
|
|
repositories {
|
|
google()
|
|
mavenCentral()
|
|
maven { url = uri("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-js-wrappers") }
|
|
}
|
|
ktor {
|
|
docker {
|
|
// ...
|
|
jreVersion.set(JavaVersion.VERSION_21)
|
|
localImageName.set("IVA-Ktor")
|
|
imageTag.set("0.0.1-preview")
|
|
portMappings.set(listOf(
|
|
io.ktor.plugin.features.DockerPortMapping(
|
|
8089,
|
|
8089,
|
|
io.ktor.plugin.features.DockerPortMappingProtocol.TCP
|
|
)
|
|
))
|
|
}
|
|
}
|
|
dependencies {
|
|
// 大文件传输
|
|
implementation("io.ktor:ktor-server-partial-content-jvm")
|
|
implementation("io.ktor:ktor-server-auto-head-response-jvm")
|
|
// security
|
|
implementation("io.ktor:ktor-server-auth-jvm")
|
|
implementation("io.ktor:ktor-server-auth-jwt-jvm")
|
|
// 后端核心
|
|
implementation("io.ktor:ktor-server-core-jvm")
|
|
implementation("io.ktor:ktor-server-tomcat-jakarta-jvm")
|
|
implementation("io.ktor:ktor-server-host-common-jvm")
|
|
implementation("io.ktor:ktor-server-cors:$ktor_version")
|
|
// WebSocket
|
|
implementation("io.ktor:ktor-server-websockets")
|
|
// 配置页
|
|
implementation("io.ktor:ktor-server-config-yaml")
|
|
// 序列化
|
|
implementation("io.ktor:ktor-serialization-gson-jvm")
|
|
implementation("io.ktor:ktor-serialization-kotlinx-json-jvm")
|
|
// web
|
|
implementation("io.ktor:ktor-server-thymeleaf-jvm")
|
|
implementation("io.ktor:ktor-server-html-builder-jvm")
|
|
// implementation("org.jetbrains:kotlin-css-jvm:1.0.0-pre.129-kotlin-1.4.20")
|
|
implementation("org.jetbrains.kotlinx:kotlinx-html-jvm:$kotlinx_html_version")
|
|
// 测试
|
|
testImplementation("io.ktor:ktor-server-test-host-jvm")
|
|
testImplementation("org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version")
|
|
// 表头自适应
|
|
implementation("io.ktor:ktor-server-content-negotiation-jvm")
|
|
// 状态页
|
|
implementation("io.ktor:ktor-server-status-pages:$ktor_version")
|
|
// 数据库
|
|
implementation("org.jetbrains.exposed:exposed-core:$exposed_version")
|
|
implementation("org.jetbrains.exposed:exposed-dao:$exposed_version")
|
|
implementation("org.jetbrains.exposed:exposed-jdbc:$exposed_version")
|
|
implementation("org.jetbrains.exposed:exposed-json:$exposed_version")
|
|
implementation ("org.jetbrains.exposed:exposed-kotlin-datetime:${exposed_version}")
|
|
// MySQL JDBC
|
|
// implementation("mysql:mysql-connector-java:8.0.33")
|
|
// PostgreSQL JDBC
|
|
implementation("org.postgresql:postgresql:$postgres_version")
|
|
|
|
implementation("ch.qos.logback:logback-classic:$logback_version")
|
|
// Radis
|
|
implementation("org.redisson:redisson:3.38.1")
|
|
|
|
// 用于邮件发送
|
|
implementation("javax.mail:javax.mail-api:1.6.2")
|
|
// 邮件协议实现
|
|
implementation("com.sun.mail:javax.mail:1.6.2")
|
|
|
|
// Ktor Client
|
|
implementation("io.ktor:ktor-client-core:$ktor_version")
|
|
implementation("io.ktor:ktor-client-cio:$ktor_version")
|
|
implementation("io.ktor:ktor-server-auth-jvm")
|
|
implementation("io.ktor:ktor-client-auth:$ktor_version")
|
|
implementation("io.ktor:ktor-client-serialization:$ktor_version")
|
|
// 数据库迁移
|
|
// implementation("org.flywaydb:flyway-core:10.13.0")
|
|
}
|