-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathbuild.gradle.kts
58 lines (51 loc) · 1.77 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
import java.io.ByteArrayOutputStream
plugins {
id("java")
id("com.gradleup.shadow") version "8.3.3" apply false
id("fabric-loom") version "1.8-SNAPSHOT" apply false
}
val fullVersion = "1.3.5"
val snapshot = true
val githubRepo = System.getenv("GITHUB_REPOSITORY") ?: project.findProperty("githubRepo").toString()
allprojects {
fun getVersionMeta(includeHash: Boolean): String {
if (!snapshot) {
return ""
}
var commitHash = ""
if (includeHash && file(".git").isDirectory) {
val stdout = ByteArrayOutputStream()
exec {
commandLine("git", "rev-parse", "--short", "HEAD")
standardOutput = stdout
}
commitHash = "+${stdout.toString().trim()}"
}
return "$commitHash-SNAPSHOT"
}
group = "me.caseload.knockbacksync"
version = "$fullVersion${getVersionMeta(true)}"
ext["versionNoHash"] = "$fullVersion${getVersionMeta(false)}"
ext["githubRepo"] = githubRepo
repositories {
mavenLocal()
mavenCentral()
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
maven("https://repo.codemc.io/repository/maven-releases/")
maven("https://repo.opencollab.dev/maven-snapshots/")
maven("https://repo.papermc.io/repository/maven-public/")
maven(url = "https://maven.fabricmc.net/") {
name = "Fabric"
}
maven("https://libraries.minecraft.net/")
maven("https://maven.neoforged.net/releases")
maven("https://repo.codemc.io/repository/maven-snapshots/")
}
}
subprojects {
apply(plugin = "java")
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}