-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
186 lines (156 loc) · 6.17 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
import java.util.function.Consumer
buildscript {
repositories {
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
}
}
plugins {
id "java"
id "maven-publish"
id 'net.neoforged.gradle' version '[6.0.18,6.2)'
id 'org.spongepowered.mixin' version '0.7.+'
id "org.jetbrains.kotlin.jvm" version "1.6.10"
id 'org.parchmentmc.librarian.forgegradle' version '1.+'
}
version = "${mc_version}-${mod_version}"
archivesBaseName = 'thoriumreactors'
group = 'unhappycodings'
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
minecraft {
mappings channel: "${mappings_channel}", version: "${mappings_version}"
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
runs {
client {
workingDirectory project.file('run')
arg "-mixin.config=thoriumreactors.mixins.json"
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
property 'forge.enabledGameTestNamespaces', 'thoriumreactors'
mods {
thoriumreactors {
source sourceSets.main
}
}
}
server {
workingDirectory project.file('run')
arg "-mixin.config=thoriumreactors.mixins.json"
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
property 'forge.enabledGameTestNamespaces', 'thoriumreactors'
mods {
thoriumreactors {
source sourceSets.main
}
}
}
gameTestServer {
workingDirectory project.file('run')
arg "-mixin.config=thoriumreactors.mixins.json"
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
property 'forge.enabledGameTestNamespaces', 'thoriumreactors'
mods {
thoriumreactors {
source sourceSets.main
}
}
}
data {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
args '--mod', 'thoriumreactors', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
mods {
thoriumreactors {
source sourceSets.main
}
}
}
}
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
void exclusiveRepo(RepositoryHandler handler, String url, String... groups) {
exclusiveRepo(handler, url, filter -> {
for (def group : groups) {
filter.includeGroup(group)
}
})
}
//Note: This cannot be static so that fg.repository can be properly accessed
@SuppressWarnings('GrMethodMayBeStatic')
void exclusiveRepo(RepositoryHandler handler, String url, Consumer<InclusiveRepositoryContentDescriptor> filterSetup) {
handler.exclusiveContent {
it.forRepositories(handler.maven {
setUrl(url)
}, fg.repository)//Add FG's repo so we make sure we are able to then find the mapped deps
it.filter { f -> filterSetup.accept(f) }
}
}
repositories { RepositoryHandler handler ->
maven {
name = "Intelligence Minecraft repository"
url = "https://mvn.intelligence-modding.de/Minecraft"
}
maven {
url "https://squiddev.cc/maven/"
content {
includeGroup("cc.tweaked")
includeModule("org.squiddev", "Cobalt")
}
}
maven {
name = 'GeckoLib'
url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/'
content {
includeGroupByRegex("software\\.bernie.*")
includeGroup("com.eliotlash.mclib")
}
}
exclusiveRepo(handler, 'https://jitpack.io', 'com.github.llamalad7.mixinextras')
exclusiveRepo(handler, 'https://www.cursemaven.com', 'curse.maven')
exclusiveRepo(handler, 'https://maven.parchmentmc.org/', 'org.parchmentmc.data')
}
dependencies {
minecraft "net.neoforged:forge:${mc_version}-${neoforge_version}"
// Apply Mixin API
implementation(annotationProcessor("com.github.llamalad7.mixinextras:mixinextras-common:${mixin_extras_version}"))
implementation(jarJar("com.github.llamalad7.mixinextras:mixinextras-forge:${mixin_extras_version}")) {
jarJar.ranged(it, "[${mixin_extras_version},)")
}
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
// Implementation for API usage
implementation fg.deobf("curse.maven:jei-${jei_version}")
implementation fg.deobf("curse.maven:top-${top_version}")
implementation fg.deobf("curse.maven:fusion-${fusion_version}")
implementation fg.deobf("curse.maven:jade-${jade_version}")
implementation fg.deobf("cc.tweaked:cc-tweaked-1.20.1-forge:${cc_version}")
implementation fg.deobf('software.bernie.geckolib:geckolib-forge-1.20.1:4.4.2')
// Runtime only
runtimeOnly fg.deobf("curse.maven:mek-${mek_version}")
runtimeOnly fg.deobf("curse.maven:mekgen-${mekgen_version}")
runtimeOnly fg.deobf("curse.maven:we-${we_version}")
}
mixin {
add sourceSets.main, "thoriumreactors.refmap.json"
}
// Example for how to get properties into the manifest for reading at runtime.
tasks.named('jar', Jar).configure {
manifest {
attributes([
"Specification-Title" : "thoriumreactors",
"Specification-Vendor" : "UnhappyWithoutU",
"Specification-Version" : "${mod_version}",
"Implementation-Title" : project.name,
"Implementation-Version" : "${mod_version}",
"Implementation-Vendor" : "UnhappyWithoutU",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"MixinConfigs" : "thoriumreactors.mixins.json"
])
}
// This is the preferred method to reobfuscate your jar file
finalizedBy 'reobfJar'
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}