-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbuild.gradle
104 lines (86 loc) · 2.95 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
plugins {
id 'fabric-loom' version '1.9-SNAPSHOT'
id 'maven-publish'
}
def run = System.env.GITHUB_RUN_NUMBER
def isDev = System.env.DEV_BUILD == "true"
version project.mod_version + (isDev ? "-dev.$run" : "") + "+mc.$minecraft_version"
group project.maven_group
base.archivesName = project.archives_base_name
repositories {
maven { url "https://maven.kneelawk.com/releases/" }
maven { url "https://maven.alexiil.uk/" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url "https://maven.blamejared.com" }
maven { url "https://maven.isxander.dev/releases" }
maven { url "https://maven.terraformersmc.com" }
maven { url 'https://maven.quiltmc.org/repository/release/' }
maven { url 'https://maven.cafeteria.dev/releases/' }
maven { url "https://jitpack.io" }
}
// Has to run before dependencies so that we get access to proper dependency configurations
loom.splitEnvironmentSourceSets()
dependencies {
// Fabric
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"
// Dependencies
include modImplementation("com.kneelawk.graphlib:graphlib-core-fabric:$graphlib_version")
//modLocalRuntime("com.kneelawk.graphlib:graphlib-debugrender-fabric:$graphlib_version")
//modImplementation "vazkii.patchouli:Patchouli:$patchouli_version"
modImplementation annotationProcessor(include("com.github.mattidragon:ConfigToolkit:$configtoolkit_version"))
modImplementation include("dev.isxander:yet-another-config-lib:$yacl_version-fabric")
modImplementation "com.terraformersmc:modmenu:$modmenu_version"
// Add generated data to runtime classpath (slightly hacky)
runtimeOnly files("src/main/generated")
}
fabricApi.configureDataGeneration {
client = true
createSourceSet = true
addToResources = false
}
loom {
// Apply datagen at runtime
mods.register("extended_drawers") {
sourceSet sourceSets.main
sourceSet sourceSets.client
modFiles.from file("src/main/generated")
}
runs.datagen {
ideConfigGenerated = true
}
}
// Delete datagen on clean
clean.delete("src/main/generated")
processResources {
inputs.property "version", version
filteringCharset "UTF-8"
filesMatching("fabric.mod.json") {
expand "version": version
}
filesMatching("**/assets/*/lang/*.json") {
expand "version": project.mod_version
}
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }
}
// Copy datagen to jar
dependsOn tasks.runDatagen
from("src/main/generated") {
exclude "README.md"
exclude ".cache"
}
}
java {
withSourcesJar()
}
publishing {
publications.create("mavenJava", MavenPublication) {
from components.java
}
repositories {}
}