This repository was archived by the owner on Mar 5, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
110 lines (91 loc) · 2.76 KB
/
build.gradle
File metadata and controls
110 lines (91 loc) · 2.76 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
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
plugins {
id 'java'
id 'fabric-loom' version '1.10.1'
id 'com.gradleup.shadow' version '9.0.0-beta4'
id 'io.freefair.lombok' version '8.11'
id 'com.github.gmazzo.buildconfig' version '5.5.1'
}
version = project.mod_version
group = project.maven_group
base {
archivesName = project.archives_base_name
}
repositories {
maven {
name = "meteor-maven"
url = "https://maven.meteordev.org/releases"
}
maven {
name = "meteor-maven"
url = "https://maven.meteordev.org"
}
mavenCentral()
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
implementation(shadow("org.luaj:luaj-jse:3.0.1"))
implementation(shadow("org.reflections:reflections:0.10.2"))
implementation(shadow("meteordevelopment:discord-ipc:1.1"))
implementation(shadow("org.bouncycastle:bcprov-jdk18on:1.78.1"))
implementation(shadow("org.bouncycastle:bcpkix-jdk18on:1.78.1"))
}
def getCommitHash = { ->
def gitProcess = 'git rev-parse HEAD'.execute()
gitProcess.waitFor()
return gitProcess.text.trim().take(10)
}
def getRevisionCount = { ->
def gitProcess = 'git rev-list --all --count'.execute()
gitProcess.waitFor()
return gitProcess.text.trim()
}
buildConfig {
className("BuildConstants")
packageName(group)
buildConfigField(String, 'MOD_VERSION', project.mod_version)
buildConfigField(String, 'MINECRAFT_VERSION', project.minecraft_version)
buildConfigField(String, 'GIT_HASH', getCommitHash())
buildConfigField(String, 'GIT_REVISION', getRevisionCount())
}
processResources {
inputs.properties([
"version": version,
"minecraft_version": minecraft_version,
"loader_version": loader_version
])
filteringCharset = "UTF-8"
filesMatching("fabric.mod.json") {
expand([
"version": version,
"minecraft_version": minecraft_version,
"loader_version": loader_version
])
}
}
tasks.withType(JavaCompile).configureEach {
it.options.release = 21
}
loom {
accessWidenerPath = file("src/main/resources/melbourne.accesswidener")
}
java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
jar {
from("LICENSE") {
rename { "${it}_${project.base.archivesName.get()}"}
}
}
shadowJar {
configurations = [project.configurations.shadow]
archiveClassifier.set("dev")
}
remapJar {
dependsOn(shadowJar)
inputFile = tasks.shadowJar.archiveFile
}