-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathbuild.gradle
More file actions
196 lines (176 loc) · 6.39 KB
/
build.gradle
File metadata and controls
196 lines (176 loc) · 6.39 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
buildscript {
repositories {
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
mavenCentral()
}
dependencies {
classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
}
}
plugins {
id "idea"
id "eclipse"
id "maven-publish"
id 'net.neoforged.moddev.legacyforge' version '2.0.91'
id 'com.diffplug.spotless' version '7.0.2'
}
sourceSets {
main.resources {
srcDir 'src/generated/resources'
}
}
repositories {
mavenLocal()
mavenCentral()
maven {
name = 'GTCEu Maven'
url = 'https://maven.gtceu.com'
content {
includeGroup 'com.gregtechceu.gtceu'
}
}
maven {
name 'FirstDarkDev'
url "https://maven.firstdark.dev/snapshots/"
}
maven { // Registrate
url = "https://maven.tterrag.com/"
content {
// need to be specific here due to version overlaps
includeGroup("com.tterrag.registrate")
}
}
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 {
url = "https://thedarkcolour.github.io/KotlinForForge/"
}
}
version = mod_version
group = maven_group
base { archivesName = archives_base_name }
java { sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17 }
legacyForge {
version = project.minecraft_version + '-' + project.forge_version
parchment {
mappingsVersion = project.mapping_version
minecraftVersion = project.minecraft_version
}
runs {
configureEach {
// Recommended logging data for a userdev environment
// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
systemProperty 'forge.logging.markers', 'REGISTRIES'
// Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
logLevel = org.slf4j.event.Level.DEBUG
}
client {
client()
sourceSet = sourceSets.main
programArguments.addAll('--refresh-dependencies')
systemProperty('forge.enabledGameTestNamespaces', project.mod_id)
}
server {
server()
sourceSet = sourceSets.main
systemProperty('forge.enabledGameTestNamespaces', project.mod_id)
programArguments.addAll('--nogui', '--world', 'world-extra')
}
data {
data()
sourceSet = sourceSets.main
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
programArguments.addAll('--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath())
programArguments.addAll('--existing-mod', 'gtceu')
}
}
mods {
// define mod <-> source bindings
// these are used to tell the game which sources are for which mod
// mostly optional in a single mod project
// but multi mod projects should define one per mod
"${mod_id}" {
sourceSet(sourceSets.main)
}
}
}
jar {
manifest.attributes([
"MixinConfigs": "examplemod.mixins.json"
])
}
apply from: "$rootDir/gradle/scripts/spotless.gradle"
dependencies {
compileOnly("org.jetbrains:annotations:26.0.1")
// Mixin
annotationProcessor('org.spongepowered:mixin:0.8.5:processor')
// JEI, EMI, Jade
modCompileOnly("mezz.jei:jei-${minecraft_version}-forge-api:${jei_version}")
modCompileOnly("mezz.jei:jei-${minecraft_version}-common-api:${jei_version}")
modRuntimeOnly("mezz.jei:jei-${minecraft_version}-forge:${jei_version}")
modRuntimeOnly("dev.emi:emi-forge:${emi_version}+${minecraft_version}")
modRuntimeOnly("curse.maven:jade-324717:5390389")
// GregTech and dependencies
modImplementation("com.gregtechceu.gtceu:gtceu-${minecraft_version}:${gtceu_version}:slim") { transitive = false }
modImplementation("com.lowdragmc.ldlib:ldlib-forge-${minecraft_version}:${ldlib_version}") { transitive = false }
modImplementation("com.tterrag.registrate:Registrate:${registrate_version}")
modImplementation("dev.toma.configuration:configuration-forge-${minecraft_version}:${configuration_version}")
// lombok
compileOnly 'org.projectlombok:lombok:1.18.24'
annotationProcessor 'org.projectlombok:lombok:1.18.24'
}
// See com.example.examplemod.mixin.DummyMixin for information about mixins
mixin {
add sourceSets.main, "mixins.${mod_id}.refmap.json"
config "${mod_id}.mixins.json"
}
tasks.named('processResources', ProcessResources).configure {
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,
"gtceu_version": gtceu_version,
]
inputs.properties(properties)
filesMatching("META-INF/mods.toml") {
expand properties + [project: project]
}
}
tasks.named('jar', Jar).configure { finalizedBy 'reobfJar' }
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)
options.compilerArgs << "-Aquiet=true" // Suppress mixin notes
}