-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
110 lines (88 loc) · 3.39 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
plugins {
id 'fabric-loom' version '1.4-SNAPSHOT'
id 'maven-publish'
}
version project.mod_version + "+mc.$minecraft_version"
group project.maven_group
base.archivesName = project.archives_base_name
repositories {
maven { url "https://maven.nucleoid.xyz" }
maven { url "https://kneelawk.com/maven/" }
maven { url "https://maven.alexiil.uk/" }
maven { url "https://maven.isxander.dev/releases" }
maven { url "https://maven.terraformersmc.com" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url 'https://maven.quiltmc.org/repository/release/' }
mavenLocal()
maven { url "https://jitpack.io" }
}
loom.splitEnvironmentSourceSets()
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_api_version"
// Core apis for the mod
modImplementation include("eu.pb4:polymer-core:$polymer_version")
modImplementation include("eu.pb4:polymer-virtual-entity:$polymer_version")
modImplementation include("eu.pb4:polymer-networking:$polymer_version")
modImplementation include("xyz.nucleoid:server-translations-api:$server_translation_api_version")
modImplementation include("teamreborn:energy:$energy_version")
modImplementation include("com.kneelawk:graphlib:$graphlib_version")
// Config
modImplementation include("com.github.mattidragon:ConfigToolkit:$configtoolkit_version")
annotationProcessor clientAnnotationProcessor("com.github.mattidragon:ConfigToolkit:$configtoolkit_version")
modImplementation include("dev.isxander.yacl:yet-another-config-lib-fabric:$yacl_version")
modImplementation "com.terraformersmc:modmenu:$modmenu_version"
// Tech reborn for testing
/* modRuntimeOnly("TechReborn:TechReborn-1.20:5.8.1") {
exclude group: "me.shedaniel", module: "RoughlyEnoughItems-fabric" // Skip transitive runtime dependency on REI
}*/
// Add generated data to runtime classpath (slightly hacky)
runtimeOnly files("src/main/generated")
}
loom {
getAccessWidenerPath().set file("src/main/resources/power_networks.accesswidener")
mods.register("power_networks") {
sourceSet sourceSets.main
sourceSet sourceSets.client
modFiles.from file("src/main/generated")
}
runs.register("datagen") {
inherit runs.server
name "Data Generation"
vmArg "-Dfabric-api.datagen"
vmArg "-Dfabric-api.datagen.modid=power_networks"
vmArg "-Dfabric-api.datagen.output-dir=${file("src/main/generated")}"
vmArg "-Dfabric-api.datagen.strict-validation"
ideConfigGenerated true
runDir "build/datagen"
}
}
// Delete datagen on clean
clean.delete("src/main/generated")
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
tasks.withType(JavaCompile).configureEach {
it.options.release.set 17
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
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"
}
}