-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
77 lines (69 loc) · 2.02 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
plugins {
java
id("fabric-loom")
}
val minecraftVersion: String by project
val yarnMappings: String by project
val loaderVersion: String by project
val projectVersion: String by project
val isRelease = System.getenv("BUILD_RELEASE").toBoolean()
val isActions = System.getenv("GITHUB_ACTIONS").toBoolean()
group = "gay.ampflower"
version = when {
isRelease -> projectVersion
isActions -> "$projectVersion-build.${System.getenv("GITHUB_RUN_NUMBER")}-commit.${System.getenv("GITHUB_SHA").substring(0, 7)}-branch.${System.getenv("GITHUB_REF")?.substring(11)?.replace('/', '.') ?: "unknown"}"
else -> "$projectVersion-build.local"
}
repositories {
mavenCentral()
maven {
name = "Fabric"
url = uri("https://maven.fabricmc.net/")
}
maven {
name = "Minecraft"
url = uri("https://libraries.minecraft.net/")
}
maven {
name = "JitPack"
url = uri("https://jitpack.io")
}
}
dependencies {
minecraft("com.mojang", "minecraft", minecraftVersion)
mappings("net.fabricmc", "yarn", yarnMappings, classifier = "v2")
modImplementation("net.fabricmc", "fabric-loader", loaderVersion)
// I'm sorry...
include(modImplementation("com.github.Modflower", "bytecode-junkie", "v0.3.3"))
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withSourcesJar()
withJavadocJar()
}
tasks {
withType<JavaCompile> {
options.encoding = "UTF-8"
options.isDeprecation = true
options.isWarnings = true
}
processResources {
val map = mapOf(
"version" to project.version,
"project_version" to projectVersion
)
inputs.properties(map)
filesMatching("fabric.mod.json") {
expand(map)
}
}
withType<Jar> {
from("LICENSE")
}
test {
useJUnitPlatform()
}
}