-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.gradle.kts
80 lines (67 loc) · 2.29 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.9.23"
application
idea
id("com.google.protobuf") version "0.9.4"
id("org.jlleitschuh.gradle.ktlint") version "12.1.0"
}
group = "com.fengsheng"
version = "1.0-SNAPSHOT"
repositories {
maven("https://mirrors.cloud.tencent.com/nexus/repository/maven-public/")
mavenCentral()
}
dependencies {
testImplementation("junit:junit:4.9")
implementation("com.typesafe.akka:akka-actor_2.13:2.8.5")
implementation("io.netty:netty-all:4.1.108.Final")
implementation("io.ktor:ktor-server-netty:2.3.10")
implementation("io.ktor:ktor-server-core:2.3.10")
implementation("com.google.protobuf:protobuf-java-util:4.26.0")
implementation("com.google.protobuf:protobuf-kotlin:4.26.0")
implementation("org.apache.logging.log4j:log4j-api:2.23.1")
implementation("org.apache.logging.log4j:log4j-api-kotlin:1.4.0")
implementation("org.apache.logging.log4j:log4j-core:2.23.1")
implementation("org.jetbrains.kotlin:kotlin-reflect:1.9.23")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0")
implementation("com.google.code.gson:gson:2.10.1")
implementation("com.squareup.okhttp3:okhttp:4.12.0")
implementation("org.apache.commons:commons-text:1.11.0")
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:4.26.0"
}
generateProtoTasks {
all().configureEach {
builtins {
create("kotlin")
}
}
}
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "17"
}
application {
mainClass.set("com.fengsheng.Game")
}
tasks.withType<Jar> {
// Otherwise you'll get a "No main manifest attribute" error
manifest {
attributes["Main-Class"] = "com.fengsheng.Game"
}
// To avoid the duplicate handling strategy error
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
// To add all of the dependencies otherwise a "NoClassDefFoundError" error
from(sourceSets.main.get().output)
dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
})
}
ktlint {
version.set("1.2.1")
}