generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
180 lines (135 loc) · 5.22 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
//file:noinspection GroovyAssignabilityCheck
//file:noinspection GroovyAccessibility
//file:noinspection GradlePackageVersionRange
plugins {
id 'fabric-loom' version '1.6.+'
id 'maven-publish'
id "com.modrinth.minotaur" version "2.+"
}
version = project.minecraft_version + "+" + project.mod_version
group = project.maven_group
base {
archivesName = project.archives_base_name
}
repositories {
maven { url = "https://maven.shedaniel.me/" } // Cloth Config, REI
maven { url = "https://maven.terraformersmc.com/releases/" } // Modmenu
maven { url = "https://pluto-mod-maven.web.app/maven" } // PDAPI
maven { url = "https://maven.parchmentmc.org" } // Parchment
maven { url = "https://maven.quiltmc.org/repository/release" } // Quilt Mappings
maven { url = "https://repo.greenhouse.house/releases/" } // Farmer's Delight
// Optional mod addons
maven { url = "https://mvn.devos.one/releases/" }
maven { url = "https://mvn.devos.one/snapshots/" } // Create & Dep
maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" } // FCAPI ( Create )
maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes
maven { url = "https://jitpack.io/" } // MixinExtras, ASM
maven { url = "https://maven.tterrag.com/" } // Flywheel
maven { url = "https://api.modrinth.com/maven" } // Fruitful fun, Lychee
}
sourceSets {
main {
resources {
srcDir("src/generated/resources")
exclude(".cache")
}
}
}
loom {
accessWidenerPath = file("src/main/resources/bartending.accesswidener")
runs {
configureEach {
vmArg "-XX:+AllowEnhancedClassRedefinition"
vmArg "-XX:+IgnoreUnrecognizedVMOptions"
}
datagen {
client()
name "Minecraft Datagen"
vmArg "-Dfabric-api.datagen"
vmArg "-Dfabric-api.datagen.output-dir=${file("src/generated/resources")}"
vmArg "-Dfabric-api.datagen.modid=bartending"
vmArg "-Dporting_lib.datagen.existing_resources=${file("src/main/resources")}"
}
server {
runDir "run/server"
}
}
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings(loom.layered {
it.mappings "org.quiltmc:quilt-mappings:${minecraft_version}+build.${project.quilt_mappings}:intermediary-v2"
//it.parchment "org.parchmentmc.data:parchment-${minecraft_version}:${parchment_version}@zip"
it.officialMojangMappings { nameSyntheticMembers = false }
})
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modImplementation "ml.pluto7073:pdapi:${project.minecraft_version}+${project.pdapi_version}"
// Optional Addons
modCompileOnly "com.simibubi.create:create-fabric-${minecraft_version}:${create_version}"
modCompileOnly "vectorwing:FarmersDelight:${minecraft_version}-${farmersdelight_version}+refabricated"
modCompileOnly "me.shedaniel:RoughlyEnoughItems-api-fabric:${project.rei_version}"
modCompileOnly "maven.modrinth:lychee:$lychee_version"
modCompileOnly "maven.modrinth:fruitful-fun:$fruitful_fun_version"
modCompileOnly "com.terraformersmc:modmenu:${project.modmenu_version}"
modCompileOnly "me.shedaniel.cloth:cloth-config-fabric:${project.cloth_version}"
modCompileOnly "maven.modrinth:kiwi:$kiwi_version"
// Optional Integration Testing Toggles (these can be safely commented out... except when stated)
modRuntimeOnly "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}"
modRuntimeOnly "com.simibubi.create:create-fabric-${minecraft_version}:${create_version}" // Required for Datagen
modRuntimeOnly "vectorwing:FarmersDelight:${minecraft_version}-${farmersdelight_version}+refabricated"
modRuntimeOnly "maven.modrinth:kiwi:$kiwi_version" // Required for Lychee
modRuntimeOnly "maven.modrinth:lychee:$lychee_version" // Required for FFF
modRuntimeOnly "maven.modrinth:fruitful-fun:$fruitful_fun_version"
modRuntimeOnly "com.terraformersmc:modmenu:${project.modmenu_version}"
modRuntimeOnly "me.shedaniel.cloth:cloth-config-fabric:${project.cloth_version}" // Required for ModMenu
}
tasks.register("buildOrPublish") {
group = "build"
String mavenUser = System.getenv("MAVEN_USER")
if (mavenUser != null && !mavenUser.isEmpty()) {
dependsOn(tasks.named("publish"))
println("Prepared to publish")
} else {
dependsOn(tasks.named("build"))
println("Prepared to build")
}
}
processResources {
Map<String, Object> properties = [
"version": mod_version,
"minecraft_version": minecraft_version,
"loader_version": loader_version,
"fabric_version": fabric_version,
"pdapi_version": pdapi_version
]
properties.forEach((k, v) -> inputs.property(k, v))
filesMatching("fabric.mod.json") {
expand properties
}
}
tasks.withType(JavaCompile).configureEach {
it.options.release = 17
}
java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
jar {
from("LICENSE") {
rename { "${it}_${project.base.archivesName.get()}"}
}
}
// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
}
}
apply from: 'gradle/publishing/publishing.gradle'