-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
208 lines (172 loc) · 5.22 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "https://maven.minecraftforge.net"
}
maven {
name = "parchment"
url = "https://maven.parchmentmc.org"
}
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
classpath group: "org.parchmentmc", name: "librarian", version: "1.+"
}
}
plugins {
id 'com.github.johnrengelman.shadow' version '7.1.2'
}
apply plugin: "net.minecraftforge.gradle"
apply plugin: 'org.parchmentmc.librarian.forgegradle'
apply plugin: 'maven-publish'
apply plugin: "java"
apply plugin: "idea"
version = "${minecraft_version}-" + getVersion()
group = "${group}"
archivesBaseName = "${mod_name}"
repositories {
mavenCentral()
mavenLocal()
maven {
name = "forge"
url = "https://maven.minecraftforge.net"
}
maven {
name = "Registrate"
url = "https://maven.tterrag.com/"
}
maven {
name = "CC:Tweaked"
url = "https://squiddev.cc/maven/"
}
maven {
name = "JEI"
url = "https://dvs1.progwml6.com/files/maven"
}
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
minecraft {
mappings channel: 'parchment', version: '2022.03.13-1.18.2'
runs {
client {
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
workingDirectory project.file("run")
source sourceSets.main
}
server {
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
workingDirectory project.file("run")
source sourceSets.main
}
data {
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
workingDirectory project.file("run")
environment 'target', 'fmluserdevdata'
properties 'fml.earlyprogresswindow': 'false'
args '--all', '--output', file('src/generated/resources/'),
'--mod', 'transfiguration', '--reports',
'--existing', sourceSets.main.resources.srcDirs[0]
}
}
}
sourceSets {
main {
resources {
srcDirs = [
"$rootDir/src/main/resources",
"$rootDir/src/generated/resources"
]
}
}
}
configurations {
shade
}
shadowJar {
configurations = [project.configurations.shade]
relocate 'com.tterrag.registrate', 'com.minerarcana.transfiguration.repack.registrate'
classifier ''
}
reobf {
shadowJar {}
}
build.dependsOn shadowJar
build.dependsOn reobfShadowJar
dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
implementation fg.deobf("org.squiddev:cc-tweaked-1.18.2:${cctweaked_version}")
def registrate = "com.tterrag.registrate:Registrate:MC1.18.2-${registrate_version}"
implementation fg.deobf(registrate)
shade registrate
compileOnly fg.deobf("mezz.jei:jei-1.18.2:${jei_version}:api")
runtimeOnly fg.deobf("mezz.jei:jei-1.18.2:${jei_version}")
}
task srcJar(type: Jar) {
from sourceSets.main.allSource
classifier = "sources"
}
jar {
manifest {
classifier = "nodep"
attributes([
"Specification-Title" : "${title}",
"Specification-Vendor" : "${team}",
"Specification-Version" : "1",
"Implementation-Title" : project.name,
"Implementation-Version" : "${version}",
"Implementation-Vendor" : "${team}",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
artifacts {
archives srcJar
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
}
}
repositories {
maven {
url "file://" + (System.getenv("local_maven") != null ? System.getenv("local_maven") : System.getenv("bamboo_local_maven"))
}
}
}
// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
String getVersion() {
String version = "${mod_version}"
String branch = project.hasProperty("branch") ? project.branch : ""
if (branch != "") {
version += "-" + branch
String buildNumber = getBuildNumber()
if (buildNumber != "") {
version += "." + buildNumber
}
}
return version
}
static String getBuildNumber() {
String buildNumber = System.getenv("BUILD_NUMBER") != null ? System.getenv("BUILD_NUMBER") : ""
if (buildNumber == "") {
buildNumber = System.getenv("bamboo_buildNumber") != null ? System.getenv("bamboo_buildNumber") : ""
}
return buildNumber
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xmaxerrs" << "10000"
}
}