-
-
Notifications
You must be signed in to change notification settings - Fork 102
Expand file tree
/
Copy pathbuild.gradle
More file actions
218 lines (188 loc) · 8.13 KB
/
build.gradle
File metadata and controls
218 lines (188 loc) · 8.13 KB
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 'maven-publish'
id 'idea'
id 'net.neoforged.moddev' version '2.0.140'
}
version = project.mod_version
group = project.maven_group
repositories {
maven { url = "https://maven.is-immensely.gay/releases" } // Revelationary, Fractal, AEA, Arrowhead, ...
maven { url = "https://maven.shedaniel.me/" } // REI
maven { url = "https://maven.terraformersmc.com/" } // Modmenu, EMI
maven { url = "https://maven.nucleoid.xyz/" } // Common Protection API
maven { url = "https://maven.blamejared.com" } // JEI
maven { url = "https://maven.ladysnake.org/releases" } // Cardinal Components API
maven { url = "https://maven.jamieswhiteshirt.com/libs-release/" } // Entity Reach Attribute
maven { url = "https://api.modrinth.com/maven" }
maven { url = "https://cfa2.cursemaven.com" }
maven { url = "https://mvn.devos.one/releases/" } // Porting Lib
maven { url = "https://repo.unascribed.com" } // Ears API
maven { url = "https://dl.cloudsmith.io/public/klikli-dev/mods/maven/" } // Modonomicon
maven { url = "https://maven.wispforest.io/releases" }
maven { url = "https://maven.theillusivec4.top/" } // curios
maven {
name = 'ParchmentMC'
url = 'https://maven.parchmentmc.org'
}
// maven { url = "https://maven.kyrptonaught.dev" } // CustomPortalAPI as requirement for Starry Skies
mavenCentral()
}
base {
archivesName = mod_id
}
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
neoForge {
version = project.neoforge_version
parchment {
minecraftVersion = project.parchment_minecraft_version
mappingsVersion = project.parchment_mappings_version
}
validateAccessTransformers = true
interfaceInjectionData {
from file("src/main/resources/spectrum-injected-interfaces.json")
publish file("src/main/resources/spectrum-injected-interfaces.json")
}
runs {
client {
client()
}
client_dafuqs {
client()
programArgument '--username=DaFuqs'
programArgument '--uuid=5010ad09-0229-4d70-8a2c-bc254821dcb3'
}
server {
server()
programArgument '--nogui'
}
configureEach {
systemProperty 'forge.logging.markers', 'REGISTRIES'
systemProperty 'forge.logging.console.level', 'debug'
}
}
mods {
"${mod_id}" {
sourceSet(sourceSets.main)
}
}
}
// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }
// Sets up a dependency configuration called 'localRuntime'.
// This configuration should be used instead of 'runtimeOnly' to declare
// a dependency that will be present for runtime testing but that is
// "optional", meaning it will not be pulled by dependents of this mod.
configurations {
runtimeClasspath.extendsFrom localRuntime
}
dependencies {
// TODO: remove additionalRuntimeClasspath for MC 1.21.9+
// see https://github.com/neoforged/ModDevGradle?tab=readme-ov-file#external-dependencies-runs
// jgrapht (the graph lib we use) and its dependencies
implementation jarJar("org.jgrapht:jgrapht-core:1.5.2")
implementation jarJar("org.apfloat:apfloat:1.14.0")
implementation jarJar("org.jheaps:jheaps:0.14")
additionalRuntimeClasspath "org.jgrapht:jgrapht-core:1.5.2"
additionalRuntimeClasspath "org.apfloat:apfloat:1.14.0"
additionalRuntimeClasspath "org.jheaps:jheaps:0.14"
// ours
implementation("de.dafuqs:revelationary-neoforge:${project.revelationary_version}")
implementation jarJar("maven.modrinth:additionalentityattributes:${project.additional_entity_attributes_version}")
implementation jarJar("de.dafuqs:arrowhead:${project.arrowhead_version}")
implementation jarJar("de.dafuqs:Fractal:${project.fractal_version}")
// external and compat
// compileOnly("de.dafuqs.starryskies:StarrySkies:${project.starry_skies_version}") // not on Neo 1.21.1
compileOnly("me.shedaniel:RoughlyEnoughItems-neoforge:${project.rei_version}") // https://github.com/shedaniel/RoughlyEnoughItems
compileOnly("dev.emi:emi-neoforge:${emi_version}") // https://github.com/emilyploszaj/emi
implementation("com.klikli_dev:modonomicon-${project.minecraft_version}-neoforge:${project.modonomicon_version}") {
exclude(group: "com.klikli_dev")
exclude(group: "mezz.jei")
} // https://github.com/klikli-dev/modonomicon
implementation("maven.modrinth:exclusions-lib:${project.exclusionslib_version}")
compileOnly "top.theillusivec4.curios:curios-neoforge:${project.curios_version}:api"
runtimeOnly "top.theillusivec4.curios:curios-neoforge:${project.curios_version}"
switch (recipe_viewer.toLowerCase(Locale.ROOT)) {
case "rei": implementation("me.shedaniel:RoughlyEnoughItems-neoforge:$rei_version"); break
case "emi": implementation("dev.emi:emi-neoforge:${emi_version}"); break
case "disabled": break
default: println("Unknown recipe viewer specified: $recipe_viewer. Must be EMI, REI or disabled.")
}
// Mod Compat
// KNOWN INCOMPAT: Colorful Hearts completely overrides neos heart rendering, making hearts unable to be modified by divinity / deadly poison
// implementation("maven.modrinth:colorful-hearts:${project.colorful_hearts_version}") { transitive = false }
/*implementation*/ /*runtimeOnly*/ compileOnly("maven.modrinth:sodium:${project.sodium_version}") { transitive = false }
/*implementation*/ /*runtimeOnly*/ compileOnly("com.unascribed:ears-api:${project.ears_version}") { transitive = false }
/*implementation*/ /*runtimeOnly*/ compileOnly("maven.modrinth:create:${project.create_version}") { transitive = false }
/*implementation*/ /*runtimeOnly*/ compileOnly("maven.modrinth:lodestonelib:${project.lodestone_version}") { transitive = false }
/*implementation*/ /*runtimeOnly*/ compileOnly("maven.modrinth:malum:${project.malum_version}") { transitive = false }
/*implementation*/ /*runtimeOnly*/ compileOnly("maven.modrinth:travelersbackpack:${project.travelers_backpack_version}") { transitive = false }
// implementation("maven.modrinth:botania:${project.botania_version}") // still on MC 1.20.1
// implementation("maven.modrinth:vanity:${project.vanityslots_version}")
// Datagen dependencies
compileOnly("curse.maven:gobber-427177:${project.gobber_version}")
compileOnly("maven.modrinth:ae2:${project.ae2_version}")
compileOnly("maven.modrinth:create:${project.create_version}")
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }
}
}
// This block of code expands all declared replace properties in the specified resource targets.
// A missing property will result in an error. Properties are expanded using ${} Groovy notation.
var generateModMetadata = tasks.register("generateModMetadata", ProcessResources) {
var replaceProperties = [
version: version,
minecraft_version: minecraft_version,
neoforge_version_range: neoforge_version_range,
curios_version_range: curios_version_range,
modonomicon_version_range: modonomicon_version_range,
revelationary_version_range: revelationary_version_range,
]
inputs.properties replaceProperties
expand replaceProperties
from "src/main/templates"
into "build/generated/sources/modMetadata"
}
// Include the output of "generateModMetadata" as an input directory for the build
// this works with both building through Gradle and the IDE.
sourceSets.main.resources.srcDir generateModMetadata
// To avoid having to run "generateModMetadata" manually, make it run on every project reload
neoForge.ideSyncTask generateModMetadata
// TODO: fix duplicates
tasks.withType(Jar).configureEach {
duplicatesStrategy = DuplicatesStrategy.WARN
}
tasks.withType(Zip).configureEach {
duplicatesStrategy = DuplicatesStrategy.WARN
}
tasks.withType(Copy).configureEach {
duplicatesStrategy = DuplicatesStrategy.WARN
}
// configure the maven publication
publishing {
publications {
create("mavenJava", MavenPublication) {
artifactId = project.archives_base_name
from components.java
}
}
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
maven {
name = "sapphoCompany"
url = "https://maven.is-immensely.gay/releases"
credentials {
username = "dafuqs"
password = System.getenv("MAVEN_PASS")
}
}
}
}
// IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior.
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}