forked from Benimatic/twilightforest
-
Notifications
You must be signed in to change notification settings - Fork 198
/
build.gradle
248 lines (209 loc) · 6.23 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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
import net.neoforged.moddevgradle.internal.RunGameTask
plugins {
id 'java-library'
id 'eclipse'
id 'idea'
id 'maven-publish'
// Version List: https://projects.neoforged.net/neoforged/ModDevGradle
id 'net.neoforged.moddev' version "${mdg_version}"
id "com.dorongold.task-tree" version "4.0.0"
}
def secrets = new Properties()
def secretsFile = file('secrets.properties')
if (secretsFile.exists()) {
secretsFile.withInputStream {
stream -> secrets.load(stream)
}
fileTree("secrets").matching {
include "**/*.properties"
}.each {
File file ->
file.withInputStream {
stream -> secrets.load(stream)
}
}
}
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
version = (hasProperty("CIRevision") ? CIRevision : project.mod_version)
group = group_name
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}
compileJava.options.compilerArgs << "-Xlint:all,-classfile,-processing,-deprecation,-this-escape" << "-Werror"
base {
archivesName = "${project.mod_id}-${project.minecraft_version}"
}
subprojects {
version = project(":").version
}
neoForge {
evaluationDependsOnChildren() // we need the subprojects to evaluate first so that the sourceSets are properly constructed
version = project.neo_version
validateAccessTransformers = true
mods {
twilightforest {
sourceSet this.sourceSets.main
}
'tf-asm' {
sourceSet project(":tf-asm").sourceSets.main
}
}
unitTest {
enable()
testedMod = mods.twilightforest
}
runs {
configureEach {
gameDirectory = project.file('run')
systemProperty 'forge.logging.console.level', 'debug'
logLevel = org.slf4j.event.Level.DEBUG
}
client {
client()
systemProperty 'forge.enabledGameTestNamespaces', mod_id
programArguments.addAll '--username', secrets.getProperty("username") ?: 'Dev', secrets.getProperty("uuid") ? '--uuid' : '', secrets.getProperty("uuid") ?: ''
}
server {
server()
systemProperty 'forge.enabledGameTestNamespaces', mod_id
programArgument '--nogui'
}
data {
data()
gameDirectory = project.file('run-data')
programArguments.addAll '--mod', mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
}
}
afterEvaluate { // DO NOT ASK... it fixes the runClient and family tasks :harold:
tasks.withType(RunGameTask).configureEach {
classpathProvider.setFrom(classpathProvider.files.stream().filter(f -> !f.toString().contains('tf-asm')).toList())
}
}
jar {
exclude 'data/twilightforest/function/**'
if (hasProperty("CIRevision"))
exclude 'data/twilightforest/structure/lich_tower'
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
repositories {
mavenLocal()
maven {
name 'Jared\'s Maven' // JEI
url 'https://maven.blamejared.com/'
}
maven {
name = "OctoStudios" //Curios
url = uri("https://maven.octo-studios.com/releases")
}
maven {
name 'Shedaniel\'s Maven' //REI
url "https://maven.shedaniel.me"
}
maven {
name = "TerraformersMC" //EMI
url = "https://maven.terraformersmc.com/"
}
maven { // TOP
url "https://maven.k-4u.nl"
}
maven { //CS
url "https://nexus.resourcefulbees.com/repository/maven-public/"
}
maven {
name 'Curseforge Maven' // Jade
url "https://www.cursemaven.com"
content {
includeGroup "curse.maven"
}
}
}
dependencies {
// Purely so we can see MDG sources for debugging purposes
compileOnly "net.neoforged.moddev:net.neoforged.moddev.gradle.plugin:${project.mdg_version}"
jarJar implementation(project(":tf-asm"))
//make sure to only pick one of these when testing (switch others to compileOnly)
// implementation "mezz.jei:jei-${project.base_minecraft_version}-neoforge:${project.jei_version}"
// compileOnly "me.shedaniel:RoughlyEnoughItems-neoforge:${project.rei_version}"
// compileOnly "dev.emi:emi-neoforge:${project.emi_version}+${project.base_minecraft_version}"
// theillusivec4
// implementation "top.theillusivec4.curios:curios-neoforge:${project.curios_version}+${project.base_minecraft_version}"
//curse maven
// implementation "curse.maven:jade-324717:5529595"
// implementation "curse.maven:cosmetic-armor-reworked-237307:5427303"
// implementation "curse.maven:world-edit-225608:5613180"
// runtimeOnly "curse.maven:jeed-532286:5483315"
// runtimeOnly "curse.maven:museum-curator-859070:4629894"
// compileOnly "mcjty.theoneprobe:theoneprobe:${project.top_version}"
//mods we dont have compat with but are nice to have
// runtimeOnly "com.telepathicgrunt:CommandStructures-Neoforge:4.3.2+1.20.6"
testImplementation group: 'net.neoforged', name: 'testframework', version: project.neo_version
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: '5.10.3'
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.10.3'
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '5.12.0'
}
configurations.testImplementation {
exclude module: 'tf-asm'
}
test {
useJUnitPlatform()
testLogging {
events "failed"
showExceptions true
exceptionFormat "full"
showCauses true
showStackTraces true
showStandardStreams = false
}
}
jar {
manifest {
archiveClassifier = 'universal'
attributes([
'Specification-Title' : mod_id,
'Specification-Vendor' : "TeamTwilight",
'Specification-Version' : "1",
'Implementation-Title' : this.project.name,
'Implementation-Version' : this.project.jar.archiveVersion,
'Implementation-Vendor' : "TeamTwilight",
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
publishing {
publications {
create('mavenJava', MavenPublication) {
afterEvaluate {
artifact this.project.jar
artifact this.project.sourceJar
}
groupId 'team-twilight'
artifactId this.project.mod_id
}
}
repositories {
maven {
//url "file:///${project.projectDir}/mcmodsrepo"
url "https://maven.tamaized.com/releases"
credentials {
username System.getenv('ARTIFACTORY_USER')
password System.getenv('ARTIFACTORY_PASS')
}
}
}
}
tasks.register('sourceJar', Jar) {
dependsOn 'classes'
from sourceSets.main.allSource
archiveClassifier = 'sources'
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}