forked from TeamTwilight/twilightforest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
208 lines (177 loc) · 4.95 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
plugins {
id 'java-library'
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.neoforged.gradle.userdev' version '7.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 {
// Tell IDEA to always download sources/javadoc artifacts from maven.
module {
downloadJavadoc = true
downloadSources = true
}
}
jarJar.enable()
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
group = project(":").group
}
minecraft.accessTransformers.file rootProject.file('src/main/resources/META-INF/accesstransformer.cfg')
runs {
configureEach {
workingDirectory project.file('run')
systemProperty 'forge.logging.console.level', 'debug'
systemProperty 'fml.earlyprogresswindow', 'false'
systemProperty 'mixin.env.disableRefMap', 'true'
modSource project.sourceSets.main
dependencies {
runtime project(":tf-asm")
}
}
client {
systemProperty 'forge.enabledGameTestNamespaces', mod_id
programArguments.addAll '--username', secrets.getProperty("username") ?: 'Dev', secrets.getProperty("uuid") ? '--uuid' : '', secrets.getProperty("uuid") ?: ''
}
server {
systemProperty 'forge.enabledGameTestNamespaces', mod_id
programArgument '--nogui'
}
gameTestServer {
systemProperty 'forge.enabledGameTestNamespaces', mod_id
}
data {
workingDirectory project.file('run-data')
programArguments.addAll '--mod', mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
}
jar {
exclude 'data/twilightforest/functions/**'
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
repositories {
mavenLocal()
maven {
name 'Jared\'s Maven' // JEI
url 'https://maven.blamejared.com/'
}
maven {
name 'tterrag\'s Maven' // CTM
url 'https://maven.tterrag.com/'
}
maven {
name 'theillusivec4\'s Maven' // Curios
url 'https://maven.theillusivec4.top/'
}
maven {
name 'Tama\'s Maven' // Cross-Dim Commands
url "https://maven.tamaized.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 {
name 'Curseforge Maven' // Jade
url "https://www.cursemaven.com"
content {
includeGroup "curse.maven"
}
}
}
dependencies {
//minecraft
implementation "net.neoforged:neoforge:${project.neo_version}"
jarJar project(":tf-asm")
//make sure to only pick one of these when testing (switch others to compileOnly)
implementation "mezz.jei:jei-${project.minecraft_version}-neoforge:${project.jei_version}"
// compileOnly "me.shedaniel:RoughlyEnoughItems-neoforge:${project.rei_version}"
// compileOnly "dev.emi:emi-neoforge:${project.emi_version}+${project.minecraft_version}"
// theillusivec4
// implementation "top.theillusivec4.curios:curios-neoforge:${project.curios_version}+${project.minecraft_version}"
//curse maven
implementation "curse.maven:jade-324717:5444008"
// runtimeOnly "curse.maven:jeed-532286:4599236"
// runtimeOnly "curse.maven:museum-curator-859070:4629894"
// implementation "mcjty.theoneprobe:theoneprobe:${project.top_version}"
}
tasks.named('jar', Jar).configure {
manifest {
archiveClassifier = 'slim'
attributes([
'Specification-Title' : mod_id,
'Specification-Vendor' : "TeamTwilight",
'Specification-Version' : "1",
'Implementation-Title' : project.name,
'Implementation-Version' : project.jar.archiveVersion,
'Implementation-Vendor' : "TeamTwilight",
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
tasks.named('jarJar') {
archiveClassifier = 'universal'
}
publishing {
publications {
mavenJava(MavenPublication) {
afterEvaluate {
artifact source: project.tasks.jarJar.outputs.getFiles().getSingleFile(), classifier: 'universal'
artifact project.sourceJar
}
setGroupId 'team-twilight'
setArtifactId 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'
}