-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathbuild.gradle.kts
79 lines (66 loc) · 2.11 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
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
kotlin("jvm") version "2.1.0"
application
idea
id("com.google.protobuf") version "0.9.4"
id("org.jlleitschuh.gradle.ktlint") version "12.1.2"
}
group = "com.fengsheng"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
testImplementation("junit:junit:4.13.2")
implementation("com.typesafe.akka:akka-actor_2.13:2.8.5")
implementation("io.netty:netty-all:4.1.117.Final")
implementation("com.google.protobuf:protobuf-java-util:4.29.3")
implementation("com.google.protobuf:protobuf-kotlin:4.29.3")
implementation("org.apache.logging.log4j:log4j-api:2.24.3")
implementation("org.apache.logging.log4j:log4j-api-kotlin:1.5.0")
implementation("org.apache.logging.log4j:log4j-core:2.24.3")
implementation("org.jetbrains.kotlin:kotlin-reflect:2.1.0")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.1")
implementation("com.google.code.gson:gson:2.11.0")
implementation("com.squareup.okhttp3:okhttp:4.12.0")
implementation("org.apache.commons:commons-text:1.13.0")
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:4.29.3"
}
generateProtoTasks {
all().configureEach {
builtins {
create("kotlin")
}
}
}
}
kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_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")
}