generated from Rabbitminers/Create-Mod-Addon-Template
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathbuild.gradle
134 lines (117 loc) · 4.69 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
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.5.+" apply false
id "me.modmuss50.mod-publish-plugin" version "0.3.4" apply false // https://github.com/modmuss50/mod-publish-plugin
}
architectury {
minecraft = rootProject.minecraft_version
}
subprojects {
apply plugin: "dev.architectury.loom"
loom {
silentMojangMappingsLicense()
runs.configureEach {
vmArg("-Dmixin.debug.export=true")
vmArg("-Dmixin.env.remapRefMap=true")
vmArg("-Dmixin.env.refMapRemappingFile=${projectDir}/build/createSrgToMcp/output.srg")
}
}
repositories {
mavenCentral()
maven { url = "https://maven.shedaniel.me/" } // Cloth Config, REI
maven { // JEI
url = "https://maven.blamejared.com/"
content {
includeGroup("mezz.jei")
}
}
maven { url = "https://maven.parchmentmc.org" } // Parchment mappings
maven { url = "https://maven.quiltmc.org/repository/release" } // Quilt Mappings
maven { // Flywheel
url = "https://maven.tterrag.com/"
content {
// need to be specific here due to version overlaps
includeGroup("com.jozufozu.flywheel")
}
}
maven { url = "https://mvn.devos.one/releases" } // Porting Lib Releases
maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" } // Forge Config Api Port
}
dependencies {
minecraft "com.mojang:minecraft:${minecraft_version}"
// layered mappings - Mojmap names, parchment and QM docs and parameters
mappings(loom.layered {
it.mappings("org.quiltmc:quilt-mappings:${minecraft_version}+build.${qm_version}:intermediary-v2")
it.parchment("org.parchmentmc.data:parchment-${minecraft_version}:${parchment_version}@zip")
it.officialMojangMappings { nameSyntheticMembers = false }
})
// see each subproject for dependencies.
}
tasks.register("moveBuiltJars", Copy) {
if (project.path != ":common") {
def remapJar = project.tasks.named('remapJar')
dependsOn remapJar
from remapJar
}
into(rootProject.file("jars"))
}
}
allprojects {
apply plugin: "java"
apply plugin: "architectury-plugin"
apply plugin: "maven-publish"
archivesBaseName = rootProject.archives_base_name
group = rootProject.maven_group
// Mod version - Minecraft Version - Create Version - Loader
// e.g 2.1.0-1.18.2-0.5.1-fabric
String buildNumber = System.getenv("GITHUB_RUN_NUMBER")
version = "${mod_version}-${minecraft_version}-${raw_create_version}-${project.name}" + (buildNumber != null ? "-${buildNumber}" : "")
repositories {
//
}
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
}
java {
withSourcesJar()
}
configurations.configureEach {
resolutionStrategy.eachDependency {
if (requested.module.name == "fabric-loader") {
useVersion(fabric_loader_version)
}
}
}
}
// https://github.com/Layers-of-Railways/Railway/blob/1.19/dev/build.gradle
String getChangelogText(String loader, boolean recent) {
def changelogFile = file(recent ? 'recent_changelog.txt' : 'changelog.txt')
String str = ''
int lineCount = 0
boolean done = false
changelogFile.eachLine {
if (done || it == null) {
return
}
if (it.size() > 1) {
def temp = it
if (lineCount == 0) {
temp = "<span style=\"font-size: 18px; color: #333399;\">Extended Cogwheels v${mod_version}</span> <em>for Minecraft $loader ${minecraft_version}</em><br/>"
} else if (it.startsWith('-')) {
temp = " $temp<br/>"
temp = temp.replaceAll("(\\S+\\/\\S+)#([0-9]+)\\b", "<a href=\"https://github.com/\$1/issues/\$2\">\$0</a>");
temp = temp.replaceAll("#([0-9]+)\\b(?!</a>)", "<a href=\"https://github.com/Rabbitminers/Extended-Cogwheels/issues/\$1\">\$0</a>");
} else {
temp = "<h4>$temp</h4>"
}
str += temp
lineCount++
} else {
str += "<p>Please submit any Issues you come across on the <a href=\"https://github.com/Rabbitminers/Extended-Cogwheels/issues\" rel=\"nofollow\">Issue Tracker</a>.</p>"
done = true
}
}
return str
}
new File("changelog.html").write getChangelogText("Fabric", false)
new File("recent_changelog.html").write getChangelogText("Fabric", true)