-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
120 lines (95 loc) · 3.08 KB
/
build.gradle
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
plugins {
id "fabric-loom" version "1.5.7"
id "org.ajoberstar.grgit" version "5.2.0"
id "com.modrinth.minotaur" version "2.+"
id "maven-publish"
}
version = "${project.mod_version}${getVersionMetadata()}"
group = project.maven_group
repositories {
maven { url "https://masa.dy.fi/maven" }
maven { url "https://maven.terraformersmc.com/releases/" }
maven { url "https://maven.gegy.dev/" }
maven { url "https://maven.svc.adryd.com/releases/" }
maven { url "https://notnite.github.io/blockbuild/mvn/" }
mavenCentral()
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
implementation "com.github.bbottema:jetbrains-runtime-annotations:1.0.1"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modCompileOnly "com.terraformersmc:modmenu:${project.modmenu_version}"
//modApi include("com.adryd:cauldron:${project.cauldron_version}")
modApi files("./libs/cauldron-mc1.20.4-0.1.9+5e30141a.jar")
modApi include("fi.dy.masa.malilib:malilib-fabric-1.20.4:${project.malilib_version}")
}
remapJar {
nestedJars.from(file("./libs/cauldron-mc1.20.4-0.1.9+5e30141a.jar"))
}
loom {
accessWidenerPath = file("src/main/resources/parachute.accesswidener")
}
processResources {
inputs.property "version", version
filesMatching("fabric.mod.json") {
expand project.properties
}
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
it.options.release = 17
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withSourcesJar()
}
base {
archivesName = "${project.archives_base_name}-mc${project.minecraft_version}"
}
jar {
from("LICENSE") {
rename { "${it}_${archivesBaseName}" }
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
modrinth {
syncBodyFrom = rootProject.file("README.md").text
changelog = rootProject.file("CHANGELOG.md").text
token = System.getenv("MODRINTH_TOKEN")
projectId = "parachute"
versionType = (System.getenv("BUILD_RELEASE") == "true") ? "release" : "beta"
uploadFile = remapJar
gameVersions = ["1.20.4"]
loaders = ["fabric"]
dependencies {
required.project "fabric-api"
optional.project "modmenu"
}
}
tasks.modrinth.dependsOn(tasks.modrinthSyncBody)
def getVersionMetadata() {
def release = System.getenv("BUILD_RELEASE") == "true"
def build_ci_branch = System.getenv("CI_COMMIT_BRANCH")
if (release) {
return ""
}
if (grgit != null && grgit.status().clean) {
// 8 chars long to match GitLab's commit IDs
def id = grgit.head().id[[0..7]]
def branch = grgit.branch.current().name
if (branch == "main" || build_ci_branch == "main") {
return "+" + id
}
return "+" + branch + "." + id
}
return "+SNAPSHOT"
}