forked from Layers-of-Railways/Railway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
123 lines (104 loc) · 4.31 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
import dev.ithundxr.silk.ChangelogText
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.3.+" apply false
id "io.github.juuxel.loom-vineflower" version "1.+" apply false // Vineflower, a better decompiler
id "me.modmuss50.mod-publish-plugin" version "0.3.4" apply false // https://github.com/modmuss50/mod-publish-plugin
id "dev.ithundxr.silk" version "0.11.15" // https://github.com/IThundxr/silk
}
architectury {
minecraft = minecraft_version
}
subprojects {
apply plugin: "dev.architectury.loom"
apply plugin: "io.github.juuxel.loom-vineflower"
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 { url = "https://maven.blamejared.com/" } // JEI, Hex Casting
maven { url = "https://maven.parchmentmc.org" } // Parchment mappings
maven { url = "https://maven.quiltmc.org/repository/release" } // Quilt Mappings
maven { url = "https://jm.gserv.me/repository/maven-public/" } // JourneyMap API
maven { url = "https://api.modrinth.com/maven" } // LazyDFU, JourneyMap
maven { // Flywheel
url = "https://maven.tterrag.com/"
content {
// need to be specific here due to version overlaps
includeGroup("com.jozufozu.flywheel")
}
}
maven { // Extended Bogeys
url = "https://maven.ithundxr.dev/private"
content { includeGroup("com.rabbitminers") }
credentials {
if (System.getenv("GITHUB_RUN_NUMBER")) {
username = "railways-github"
password = System.getenv("MAVEN_TOKEN")
} else {
username = findProperty("IThundxrMavenUsername")
password = findProperty("IThundxrMavenPassword")
}
}
}
maven { url = 'https://maven.maxhenkel.de/repository/public' } // Simple Voice Chat
}
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 = archives_base_name
group = maven_group
if (System.getenv("RELEASE_BUILD")) {
version = "${mod_version}+${project.name}-mc${minecraft_version}"
} else {
// Formats the mod version to include the loader, Minecraft version, and build number (if present)
// example: 1.0.0+fabric-1.18.2-100
String buildNumber = System.getenv("GITHUB_RUN_NUMBER")
version = "${mod_version}+${project.name}-mc${minecraft_version}" + (buildNumber != null ? "-build.${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)
}
}
}
}
String getChangelogText() {
return ChangelogText.getChangelogText(project)
}