-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.gradle
135 lines (115 loc) · 3.62 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
import groovy.json.JsonBuilder
import groovy.json.JsonSlurper
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "com.github.johnrengelman.shadow" version "8.1.1" apply false
id "dev.architectury.loom" version "1.4-SNAPSHOT" apply false
id "io.github.CDAGaming.cursegradle" version "1.6.1" apply false
id "com.modrinth.minotaur" version "2.+" apply false
}
architectury {
minecraft = project.mc_version
}
subprojects {
apply plugin: "dev.architectury.loom"
apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "com.matthewprenger.cursegradle"
apply plugin: "com.modrinth.minotaur"
loom {
silentMojangMappingsLicense()
decompilers {
vineflower {
options.put("pll", "32767")
options.put("ind", " ")
}
}
}
repositories {
maven {
name "ParchmentMC"
url "https://maven.parchmentmc.org"
content {
includeGroup "org.parchmentmc.data"
}
}
}
dependencies {
minecraft "com.mojang:minecraft:${mc_version}"
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${parchmentmc_version}@zip")
}
}
}
allprojects {
apply plugin: "java"
apply plugin: "architectury-plugin"
version = project.mod_version
group = project.maven_group
base {
archivesName = project.archives_base_name
}
repositories {
maven {
name "Modrinth Maven"
url "https://api.modrinth.com/maven"
content {
includeGroup "maven.modrinth"
}
}
maven {
name "DevAuth"
url "https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1"
}
maven {
url "https://jitpack.io"
}
}
tasks.withType(JavaCompile).tap {
configureEach {
options.encoding = "UTF-8"
options.release = 17
}
}
java {
withSourcesJar()
}
}
tasks.register("curseforgeModrinthFabric") {
group "publishing"
dependsOn ":fabric:modrinth"
dependsOn ":fabric:curseforge"
}
tasks.register("curseforgeModrinthForge") {
group "publishing"
dependsOn ":forge:modrinth"
dependsOn ":forge:curseforge"
}
tasks.register("curseforgeModrinthNeoForge") {
group "publishing"
dependsOn ":neoforge:modrinth"
dependsOn ":neoforge:curseforge"
}
if (project.hasProperty("version_lib_dir")) {
tasks.register("updateVersionLib") {
group "publishing"
def versionFile = file("${version_lib_dir}/indicatia_version.json")
def jsonBuilder = new JsonBuilder(new JsonSlurper().parseText(versionFile.text))
def jsonElement = jsonBuilder.content
def formattedList = []
jsonElement.promos."${mc_version}-latest" = project.mod_version
jsonElement.promos."${mc_version}-recommended" = project.mod_version
def reader = new BufferedReader(new FileReader(rootProject.file("CHANGE_LOG.md")))
def currentLine
for (int lineIndex = 0; (currentLine = reader.readLine()) != null; lineIndex++) {
if (lineIndex >= 2) {
formattedList.add(currentLine)
}
}
if (jsonElement."${mc_version}" == null) {
jsonElement."${mc_version}" = new JsonSlurper().parseText("{ \"${mod_version}\": \"\"}")
}
jsonElement."${mc_version}"."${mod_version}" = formattedList.join("\n")
versionFile.text = jsonBuilder.toPrettyString()
}
}