-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
197 lines (172 loc) · 5.01 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
plugins {
id 'fabric-loom' version '1.7-SNAPSHOT'
id 'maven-publish'
}
version = project.mod_version + "+mc." + project.minecraft_version
group = project.maven_group
base.archivesName = project.archives_base_name
loom.splitEnvironmentSourceSets()
repositories {
mavenLocal()
maven {
url "https://kneelawk.com/maven/"
content {
includeGroupByRegex "com\\.kneelawk.*"
}
}
maven {
url "https://maven.alexiil.uk/"
content {
includeGroup "alexiil.mc.lib"
}
}
maven {
url 'https://jitpack.io'
content {
includeGroup "com.github.mattidragon"
includeGroup "com.github.llamalad7.mixinextras"
}
}
maven {
url "https://maven.isxander.dev/releases"
content {
includeGroup "dev.isxander"
}
}
maven {
url "https://api.modrinth.com/maven"
content {
includeGroup "maven.modrinth"
}
}
maven {
url 'https://maven.cafeteria.dev/releases/'
content {
includeGroup "me.luligabi"
}
}
maven {
url "https://maven.terraformersmc.com"
content {
includeGroup "com.terraformersmc"
}
}
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
content {
includeGroup "com.twelvemonkeys.common"
includeGroup "com.twelvemonkeys.imageio"
includeGroup "com.twelvemonkeys"
}
}
maven {
url 'https://maven.quiltmc.org/repository/release/'
content {
includeGroup "org.quiltmc.parsers"
}
}
mavenCentral()
}
dependencies {
minecraft "com.mojang:minecraft:$minecraft_version"
mappings "net.fabricmc:yarn:$yarn_mappings:v2"
modImplementation "net.fabricmc:fabric-loader:$loader_version"
modImplementation "net.fabricmc.fabric-api:fabric-api:$fabric_version"
// Core apis
modImplementation include("com.github.mattidragon:nodeflow:$nodeflow_version")
include modImplementation("com.kneelawk.graphlib:graphlib-core-fabric:$graphlib_version")
modLocalRuntime("com.kneelawk.graphlib:graphlib-debugrender-fabric:$graphlib_version")
include modApi("teamreborn:energy:$energy_version") {
exclude(group: "net.fabricmc.fabric-api")
}
// Config
modImplementation "com.terraformersmc:modmenu:$modmenu_version"
modImplementation include("dev.isxander:yet-another-config-lib:$yacl_version-fabric")
modImplementation annotationProcessor(include("com.github.mattidragon:configtoolkit:$configtoolkit_version"))
// modImplementation include("me.luligabi:NoIndium:$noindium_version")
// Add generated data to runtime classpath (slightly hacky)
runtimeOnly files("src/main/generated")
}
sourceSets {
testmod {
compileClasspath += client.compileClasspath
compileClasspath += client.output
runtimeClasspath += client.runtimeClasspath
runtimeClasspath += client.output
}
}
loom {
runs {
testmodClient {
client()
name "Testmod Client"
source sourceSets.testmod
runDir "run/test"
}
testmodServer {
server()
name "Testmod Server"
source sourceSets.testmod
runDir "run/test_server"
}
gametest {
server()
name "Gametest"
source sourceSets.testmod
vmArg "-Dfabric-api.gametest"
vmArg "-Dfabric-api.gametest.report-file=${project.layout.buildDirectory}/junit.xml"
runDir "build/gametest_server"
}
datagen {
inherit server
name "Data Generation"
vmArg "-Dfabric-api.datagen"
vmArg "-Dfabric-api.datagen.output-dir=${file("src/main/generated")}"
vmArg "-Dfabric-api.datagen.strict-validation"
ideConfigGenerated = true
runDir "build/datagen/"
}
}
// Apply datagen at runtime
mods {
extended_drawers {
sourceSet sourceSets.main
modFiles.from file("src/main/generated")
}
}
accessWidenerPath = file("src/main/resources/advanced_networking.accesswidener")
}
test.dependsOn(tasks.runGametest)
// Delete datagen on clean
clean.delete("src/main/generated")
processResources {
inputs.property "version", project.version
filteringCharset "UTF-8"
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
}
java {
withSourcesJar()
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }
}
// Copy datagen to jar
dependsOn tasks.runDatagen
from("src/main/generated") {
exclude "README.md"
exclude ".cache"
}
}
publishing {
publications.register("mavenJava", MavenPublication) {
from components.java
}
repositories {
}
}