-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle.kts
88 lines (69 loc) · 2.52 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
81
82
83
84
85
86
87
88
import java.text.SimpleDateFormat
import java.util.*
plugins {
kotlin("jvm")
kotlin("plugin.serialization") version "2.1.10"
id("com.github.johnrengelman.shadow") version "8.+"
id ("com.gorylenko.gradle-git-properties") version "2.4.1"
id("com.google.protobuf") version "0.9.4"
}
group = "org.cubewhy.celestial"
version = "3.0.4-SNAPSHOT"
println("Java: " + System.getProperty("java.version") + " JVM: " + System.getProperty("java.vm.version") + "(" + System.getProperty("java.vendor") + ") Arch: " + System.getProperty("os.arch"))
println("Celestial Launcher -> https://lunarclient.top/")
val isGitHubActions = System.getenv("GITHUB_ACTIONS") == "true"
if (isGitHubActions) {
val timeStamp = SimpleDateFormat("yyyyMMdd-HHmm").format(Date())
version = "nightly-$timeStamp"
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
java.sourceCompatibility = JavaVersion.VERSION_17
java.targetCompatibility = JavaVersion.VERSION_17
}
repositories {
maven("https://oss.sonatype.org/content/repositories/snapshots/")
maven("https://repo.typesafe.com/typesafe/maven-releases/")
mavenCentral()
}
dependencies {
implementation("org.slf4j:slf4j-api:2.0.16")
implementation("org.slf4j:slf4j-log4j12:2.0.16")
implementation("org.apache.logging.log4j:log4j-api:2.24.3")
implementation("org.apache.logging.log4j:log4j-core:2.24.3")
implementation("com.squareup.okhttp3:okhttp:4.12.0")
implementation("com.squareup.okhttp3:okhttp-dnsoverhttps:4.12.0")
implementation("com.google.code.gson:gson:2.12.1")
implementation("com.formdev:flatlaf:3.5.4")
implementation("commons-io:commons-io:2.18.0")
implementation("cn.hutool:hutool-crypto:5.8.35")
implementation("org.java-websocket:Java-WebSocket:1.6.0")
implementation("com.google.protobuf:protobuf-kotlin:4.29.3")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.0")
}
tasks.shadowJar {
archiveClassifier.set("fatjar")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
exclude("native-binaries/**")
exclude("LICENSE.txt")
exclude("META-INF/maven/**")
exclude("META-INF/versions/**")
exclude("org/junit/**")
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:4.29.3"
}
}
tasks.jar {
dependsOn("shadowJar")
manifest {
attributes(
"Main-Class" to "org.cubewhy.celestial.CelestialKt",
)
attributes(
"Charset" to "UTF-8"
)
}
}