forked from BalloonUpdate/McPatchClient
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
48 lines (39 loc) · 1.58 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
48 lines (39 loc) · 1.58 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
fun getVersionName(tagName: String) = if(tagName.startsWith("v")) tagName.substring(1) else tagName
val gitTagName: String? get() = Regex("(?<=refs/tags/).*").find(System.getenv("GITHUB_REF") ?: "")?.value
val gitCommitSha: String? get() = System.getenv("GITHUB_SHA") ?: null
val debugVersion: String get() = System.getenv("DBG_VERSION") ?: "2.0.0"
group = "com.github.balloonupdate"
version = gitTagName?.run { getVersionName(this) } ?: debugVersion
plugins {
java
id("com.github.johnrengelman.shadow") version "7.1.2"
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
repositories {
mavenCentral()
}
dependencies {
implementation(files("libs/apache-ant-1.10.12.jar"))
implementation("com.github.lookfirst:sardine:5.10")
implementation("com.hierynomus:sshj:0.34.0")
implementation("org.json:json:20220924")
implementation("org.yaml:snakeyaml:1.33")
implementation("com.squareup.okhttp3:okhttp:3.14.7")
implementation("com.formdev:flatlaf:2.6")
implementation("com.formdev:flatlaf-intellij-themes:2.6")
implementation("org.apache.commons:commons-compress:1.23.0")
}
tasks.withType<ShadowJar> {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
manifest {
attributes("Version" to archiveVersion.get())
attributes("Git-Commit" to (gitCommitSha ?: ""))
attributes("Main-Class" to "mcpatch.McPatchClient")
attributes("Premain-Class" to "mcpatch.McPatchClient")
}
archiveClassifier.set("")
}