-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
199 lines (176 loc) · 6.61 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
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 {
silentMojangMappingsLicense()
forge {
mixinConfig(
"${mod_id}.mixins.json",
)
dataGen{
mod(mod_id)
}
}
runConfigs.named("data").configure {
programArg("--existing=" + file("src/main/resources").absolutePath)
programArgs("--client", "--server")
}
}
// missing access transformers?
// don't worry, you can still use them!
// note that your AT *MUST* be located at
// src/main/resources/META-INF/accesstransformer.cfg
// to work as there is currently no config option to change this.
// also, any names used in your access transformer will need to be
// in SRG mapped ("func_" / "field_" with MCP class names) to work!
// (both of these things may be subject to change in the future)
repositories {
mavenLocal()
flatDir {
dir 'libs'
}
mavenCentral()
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 {
url "https://www.cursemaven.com"
content {
includeGroup "curse.maven"
}
}
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"
}
}
}
dependencies {
minecraft "com.mojang:minecraft:$project.minecraft_version"
forge "net.minecraftforge: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 }
}
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 }
modImplementation "curse.maven:jade-324717:5672013"
// 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_authors" : mod_authors,
"forge_version" : forge_version.split("\\.")[0], // only specify major version of forge
"minecraft_version": minecraft_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_authors,
"Specification-Version" : "1",
"Implementation-Title" : project.name,
"Implementation-Version" : version,
"Implementation-Vendor" : mod_authors,
"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.
}
}