-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
211 lines (185 loc) · 6.94 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
plugins {
id "dev.architectury.loom" version "1.3-SNAPSHOT"
id "maven-publish"
}
base {
archivesName = project.archives_base_name
}
version = project.mod_version
group = project.maven_group
java {
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
}
loom {
// use this if you are using the official mojang mappings
// and want loom to stop warning you about their license
silentMojangMappingsLicense()
// since loom 0.10, you are **required** to use the
// "forge" block to configure forge-specific features,
// such as the mixinConfigs array or datagen
forge {
// specify the mixin configs used in this mod
// this will be added to the jar manifest as well!
mixinConfigs = [
"mixins.mae2.json"
]
dataGen{
mod(mod_id)
}
}
runConfigs.named("data").configure {
programArg("--existing=" + file("src/main/resources").absolutePath)
}
}
repositories {
mavenLocal()
flatDir {
dir 'libs'
}
mavenCentral()
maven { url "https://maven.neoforged.net/releases/" }
maven {
name 'FirstDarkDev'
url "https://maven.firstdarkdev.xyz/snapshots/"
}
maven {
name 'Quilt'
url 'https://maven.quiltmc.org/repository/release/'
}
maven {
name = 'ParchmentMC'
url = 'https://maven.parchmentmc.org'
}
maven {
url "https://maven.saps.dev/releases/"
content {
includeGroup "dev.latvian.mods"
}
}
maven { // Registrate
url = "https://maven.tterrag.com/"
content {
// need to be specific here due to version overlaps
includeGroup("com.jozufozu.flywheel")
includeGroup("com.tterrag.registrate")
includeGroup("com.simibubi.create")
}
}
maven {
// Patchouli, JEI
name = "BlameJared"
url = "https://maven.blamejared.com/"
}
maven {
url = "https://maven.theillusivec4.top/"
}
maven {
// Curse Forge File
url "https://cursemaven.com/"
content {
includeGroup "curse.maven"
}
}
maven {// emi
name = "TerraformersMC"
url = "https://maven.terraformersmc.com/"
}
maven {
name "Modmaven"
url "https://modmaven.dev/"
// For Gradle 5.1 and above, limit it to just AE2
content {
includeGroup 'appeng'
}
}
}
dependencies {
minecraft "com.mojang:minecraft:$project.minecraft_version"
forge "net.neoforged:forge:$project.minecraft_version-$project.forge_version"
// layered mappings - Mojmap names, parchment and QM docs and parameters
mappings loom.layered {
it.mappings("org.quiltmc:quilt-mappings:$project.minecraft_version+build.$project.quilt_mappings:intermediary-v2")
it.parchment("org.parchmentmc.data:parchment-$project.minecraft_version:$project.parchment_mappings@zip")
it.officialMojangMappings { nameSyntheticMembers = false }
}
modImplementation("appeng:appliedenergistics2-forge:$project.ae2_version")
modRuntimeOnly("com.jozufozu.flywheel:flywheel-forge-$project.minecraft_version:0.6.9-5")
modCompileOnly("mezz.jei:jei-$project.minecraft_version-forge-api:$project.jei_version") { transitive = false }
modCompileOnly("mezz.jei:jei-$project.minecraft_version-common-api:$project.jei_version") { transitive = false }
modImplementation("com.gregtechceu.gtceu:gtceu-$project.minecraft_version:$project.gtceu_version") { transitive = false }
modImplementation("com.lowdragmc.ldlib:ldlib-forge-$project.minecraft_version:$project.ldlib_version") { transitive = false }
modImplementation("com.tterrag.registrate:Registrate:$project.registrate_version")
//modImplementation("dev.latvian.mods:kubejs-forge:$project.kubejs_version")
modRuntimeOnly("dev.toma.configuration:configuration-forge-$project.minecraft_version:$project.configuration_version")
modRuntimeOnly("mezz.jei:jei-$project.minecraft_version-forge:$project.jei_version") { transitive = false }
modRuntimeOnly("curse.maven:jade-324717:5339264")
modRuntimeOnly "dev.emi:emi-forge:$project.emi_version+$project.minecraft_version"
// Mixin Extras
implementation(annotationProcessor("io.github.llamalad7:mixinextras-common:$project.mixinextras_version"))
implementation(include("io.github.llamalad7:mixinextras-forge:$project.mixinextras_version"))
// lombok
//compileOnly 'org.projectlombok:lombok:1.18.24'
//annotationProcessor 'org.projectlombok:lombok:1.18.24'
}
processResources {
// set up properties for filling into metadata
var properties = [
"mod_license": mod_license,
"mod_id": mod_id,
"version": version,
"mod_name": mod_name,
"mod_url": mod_url,
"mod_author": mod_author,
"forge_version": forge_version.split("\\.")[0], // only specify major version of forge
"minecraft_version": minecraft_version,
"ae2_version": ae2_version,
"gtceu_version": gtceu_version
]
inputs.properties(properties)
filesMatching("META-INF/mods.toml") {
expand properties
}
}
tasks.withType(JavaCompile).configureEach {
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
// If Javadoc is generated, this must be specified in that task too.
options.encoding = "UTF-8"
options.release.set(17)
}
java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
}
jar {
// add some additional metadata to the jar manifest
manifest {
attributes([
"Specification-Title" : mod_id,
"Specification-Vendor" : mod_author,
"Specification-Version" : "1",
"Implementation-Title" : project.name,
"Implementation-Version" : version,
"Implementation-Vendor" : mod_author,
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}