-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
82 lines (71 loc) · 2.78 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
plugins {
// Required for NeoGradle
id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7"
}
subprojects {
apply plugin: 'java'
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
java.withSourcesJar()
java.withJavadocJar()
repositories {
repositories {
maven {
name = 'Fabric'
url = uri("https://maven.fabricmc.net")
}
maven {
name = 'Sponge / Mixin'
url = 'https://repo.spongepowered.org/repository/maven-public/'
}
maven { url "https://maven.terraformersmc.com/releases/" }
maven {
name 'Xander Maven'
url 'https://maven.isxander.dev/releases'
}
maven {
name "Nucleoid"
url "https://maven.nucleoid.xyz/"
}
maven {
url "https://maven.frohnmeyer-wds.de/artifacts"
name = "Entry Widgets"
content {
includeGroup("io.gitlab.jfronny.libjf")
}
}
}
}
def getGitHash = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
}
processResources {
var git_hash = getGitHash()
def expandProps = [
"version" : version + ((is_dev.toLowerCase() == "true" || is_dev == "1") ? "-DEV-" + git_hash : ""),
"git_head" : git_hash,
"group" : project.group, //Else we target the task's group.
"minecraft_version" : minecraft_version,
"minecraft_version_range" : minecraft_version_range,
"fabric_version" : fabric_version,
"fabric_loader_version" : fabric_loader_version,
"mod_name" : mod_name,
"mod_author" : mod_author,
"mod_id" : mod_id,
"license" : license,
"description" : project.description,
"neoforge_version" : neoforge_version,
"neoforge_loader_version_range": neoforge_loader_version_range,
"credits" : credits,
"fabric_minecraft_version" : fabric_minecraft_version
]
filesMatching(['pack.mcmeta', 'fabric.mod.json', 'META-INF/mods.toml', '*.mixins.json']) {
expand expandProps
}
inputs.properties(expandProps)
}
}