forked from sleepy-project/Sleepy-GUI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
82 lines (64 loc) · 1.92 KB
/
build.gradle.kts
File metadata and controls
82 lines (64 loc) · 1.92 KB
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
plugins {
application
java
id("org.openjfx.javafxplugin") version "0.0.14"
}
group = "com.lokins.sleepy.gui"
version = "1.0.0"
repositories {
mavenCentral()
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}
dependencies {
implementation("com.squareup.okhttp3:okhttp:4.12.0")
// JSON 处理
implementation("com.fasterxml.jackson.core:jackson-databind:2.17.2")
// 配置文件
implementation("org.ini4j:ini4j:0.5.4")
// Windows 原生 API
implementation("net.java.dev.jna:jna:5.14.0")
implementation("net.java.dev.jna:jna-platform:5.14.0")
// 日志
implementation("ch.qos.logback:logback-classic:1.5.8")
implementation("org.slf4j:slf4j-api:2.0.16")
testImplementation(platform("org.junit:junit-bom:5.10.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
javafx {
version = "21"
modules("javafx.controls", "javafx.fxml", "javafx.graphics")
}
tasks.test {
useJUnitPlatform()
}
application {
mainClass.set("com.lokins.sleepy.gui.Launcher")
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
tasks.register<Jar>("fatJar") {
group = "build"
description = "创建轻量级引导 JAR (不含 JavaFX)"
outputs.upToDateWhen { false }
destinationDirectory.set(layout.buildDirectory.dir("libs"))
archiveBaseName.set("sleepy-gui")
archiveVersion.set(project.version.toString())
manifest {
attributes["Main-Class"] = "com.lokins.sleepy.gui.launch.Launcher"
}
from(sourceSets.main.get().output)
from({
configurations.runtimeClasspath.get()
.filter { it.name.endsWith("jar") }
.filter { !it.name.contains("javafx") }
.map { zipTree(it) }
})
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
exclude("META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA")
}