-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
43 lines (34 loc) · 1.33 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
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") ?: "0.0.0"
group = "com.github.balloonupdate"
version = gitTagName?.run { getVersionName(this) } ?: debugVersion
plugins {
kotlin("jvm") version "1.7.20"
id("com.github.johnrengelman.shadow") version "7.1.2"
}
repositories {
mavenCentral()
}
dependencies {
implementation(files("libs/apache-ant-1.10.12.jar"))
implementation("com.hrakaroo:glob:0.9.0")
implementation("org.json:json:20220924")
implementation(kotlin("stdlib-jdk8"))
implementation("org.apache.commons:commons-compress:1.23.0")
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
tasks.withType<ShadowJar> {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
manifest {
attributes("Version" to archiveVersion.get())
attributes("Git-Commit" to (gitCommitSha ?: ""))
attributes("Main-Class" to "mcpatch.McPatchManage")
}
archiveClassifier.set("")
}