-
Notifications
You must be signed in to change notification settings - Fork 108
/
Copy pathbuild.gradle
218 lines (186 loc) · 6.3 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
plugins {
id 'java-library'
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.neoforged.gradle.userdev' version '7.0.+'
id 'io.github.goooler.shadow' version '8.1.7'
}
version = mod_version
if (System.getenv('BUILD_NUMBER') != null) {
version += "." + System.getenv('BUILD_NUMBER')
}
group = 'com.hollingsworth.ars_nouveau' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
base {
archivesName = mod_id + '-' + minecraft_version
}
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
java.withSourcesJar()
subsystems {
parchment {
minecraftVersion = "1.21"
mappingsVersion = project.parchment_version
}
}
configurations {
libraries
// This will make sure that all dependencies that you add to the libraries configuration will also be added to the implementation configuration
// This way, you only need one dependency declaration for both runtime and compile dependencies
shade
implementation.extendsFrom libraries
runtimeClasspath.extendsFrom localRuntime
shade
implementation.extendsFrom shade
}
runs {
configureEach {
systemProperty 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
systemProperty 'forge.logging.console.level', 'debug'
modSource sourceSets.main
dependencies {
runtime project.configurations.libraries
runtime project.configurations.shade
}
}
clientAlt {
run 'client'
arguments '--username', 'Dev2'
}
server {
programArgument '--nogui'
workingDirectory 'server'
}
data {
getArguments().addAll '--mod', mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
minecraft.accessTransformers.files(
file('src/main/resources/META-INF/accesstransformer.cfg')
)
repositories {
mavenLocal()
maven {
name = 'GeckoLib'
url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/'
content {
includeGroup("software.bernie.geckolib")
}
}
exclusiveContent {
forRepository {
maven {
url "https://cursemaven.com"
}
}
filter {
includeGroup "curse.maven"
}
}
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
filter {
includeGroup "maven.modrinth"
}
}
maven {
name = "Illusive Soulworks maven"
url = "https://maven.theillusivec4.top/"
}
maven {
name = "Jared's maven"
url = "https://maven.blamejared.com/"
}
maven {
name = 'Forge'
url = "https://maven.minecraftforge.net"
}
maven {
name = "OctoStudios"
url = uri("https://maven.octo-studios.com/releases")
}
}
jarJar.enable()
tasks.named('jarJar') {}
dependencies {
implementation "net.neoforged:neoforge:${neo_version}"
implementation "software.bernie.geckolib:geckolib-neoforge-1.21.1:${geckolib_version}"
implementation(jarJar(group: 'vazkii.patchouli', name: 'Patchouli', version: '[1.21,)') {
jarJar.pin(it, patchouli_version)
})
localRuntime "com.illusivesoulworks.caelus:caelus-neoforge:${caelus_version}"
compileOnly "com.illusivesoulworks.caelus:caelus-neoforge:${caelus_version}:api"
compileOnly "mezz.jei:jei-1.21.1-neoforge-api:${jei_version}"
implementation "mezz.jei:jei-1.21.1-neoforge:${jei_version}"
implementation 'com.github.glitchfiend:TerraBlender-neoforge:1.21-4.0.0.0'
implementation "curse.maven:jade-324717:5444008"
implementation "top.theillusivec4.curios:curios-neoforge:${curios_version}+1.21"
localRuntime 'curse.maven:ftb-teams-forge-404468:5631446'
localRuntime 'curse.maven:ftb-chunks-forge-314906:5710609'
localRuntime 'curse.maven:ftb-library-forge-404465:5754910'
localRuntime 'curse.maven:architectury-api-419699:5553800'
implementation(jarJar(group: 'com.hollingsworth.nuggets', name: 'nuggets-neoforge-1.21', version:'[1.0.4,)'){
jarJar.pin(it, '1.0.4')
})
localRuntime "maven.modrinth:cloth-config:15.0.140+neoforge"
localRuntime "curse.maven:immersive-portals-for-forge-355440:6013197"
//implementation "curse.maven:ars-elemental-561470:6086122"
shade 'org.apache.lucene:lucene-core:10.1.0'
shade 'org.apache.lucene:lucene-analysis-common:10.1.0'
shade 'org.apache.lucene:lucene-queryparser:10.1.0'
// implementation 'com.hollingsworth.nuggets:nuggets-neoforge-1.21:1.0.4'
}
jar {
manifest {
attributes([
"Specification-Title": "ArsNouveau",
"Specification-Vendor": "baileyh",
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": project.name,
"Implementation-Version": mod_version,
"Implementation-Vendor" :"baileyh",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"MixinConfigs": "ars_nouveau.mixins.json"
])
}
finalizedBy shadowJar
}
shadowJar {
from sourceSets.main.output.classesDirs
from sourceSets.main.output.resourcesDir
configurations = [project.configurations.shade] // <- Tell shadowJar to shade dependencies from 'shade'
relocate 'org.apache.lucene', 'org.apache.lucene.ars_nouveau'
finalizedBy('jarJar')
archiveClassifier = null
mergeServiceFiles()
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId project.group
artifactId project.archivesBaseName
version project.version
from components.java
}
}
repositories {
maven {
url "file://" + System.getenv("local_maven")
}
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}
// IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior.
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}