forked from MehVahdJukaar/FarmersDelightRefabricated
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
275 lines (228 loc) · 8.87 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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
plugins {
id 'fabric-loom' version '1.5-SNAPSHOT'
id 'maven-publish'
id "com.matthewprenger.cursegradle" version "1.4.0"
id "com.modrinth.minotaur" version "2.8.4"
}
version = mod_version + "+refabricated"
group = mod_group_id
base {
archivesName = "FarmersDelight"
}
loom {
accessWidenerPath = file("src/main/resources/farmersdelight.accesswidener")
}
sourceSets.main.resources {
srcDirs += 'src/generated/resources'
}
repositories {
flatDir {
dirs 'mods'
}
mavenLocal()
maven { url "https://maven.parchmentmc.org" }
maven {
url = "https://www.cursemaven.com"
allowInsecureProtocol = true
}
maven {
url "https://maven.firstdarkdev.xyz/snapshots"
}
maven {
name = 'Ladysnake Mods'
url = 'https://maven.ladysnake.org/releases'
}
maven {
url = "https://api.modrinth.com/maven"
}
maven {
// CraftTweaker, JEI
name = "BlameJared"
url = "https://maven.blamejared.com/"
}
maven { url "https://maven.ryanliptak.com/" } // AppleSkin
maven { url = "https://maven.parchmentmc.org" } // Parchment
maven { url = "https://maven.fabricmc.net/" } // FAPI, Loader
maven { url = "https://mvn.devos.one/snapshots/" } // Registrate, Porting Lib, Forge Tags, Milk Lib
maven { url = "https://mvn.devos.one/releases/" }
maven { // for Porting Lib: Fabric ASM
url = "https://jitpack.io/"
}
maven { url = "https://maven.shedaniel.me/" } // REI and deps
maven { url = "https://maven.terraformersmc.com/" } // Mod Menu, EMI
maven { // Reach Entity Attributes
url = "https://maven.jamieswhiteshirt.com/libs-release"
content { includeGroup("com.jamieswhiteshirt") }
}
maven { url 'https://maven.draylar.dev/releases/' }
mavenCentral() // Mixin Extras
}
dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.layered() {
it.parchment("org.parchmentmc.data:parchment-${rootProject.parchment_version}")
it.officialMojangMappings {
setNameSyntheticMembers(false)
}
}
modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_api_version}"
include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:${mixin_extras_version}")))
annotationProcessor 'net.fabricmc:sponge-mixin:0.12.5+mixin.0.8.5'
include(modImplementation("com.github.Chocohead:Fabric-ASM:${fabric_asm_version}")) {
exclude (group: "net.fabricmc.fabric-api")
}
for (String module in port_lib_modules.split(",")) {
include(modApi("io.github.fabricators_of_create.Porting-Lib:$module:$port_lib_version"))
}
modLocalRuntime("com.terraformersmc:modmenu:${project.modmenu_version}")
modCompileOnly("com.blamejared.crafttweaker:CraftTweaker-fabric-1.20.1:${crafttweaker_version}")
// Uncomment the below to test CraftTweaker.
// modLocalRuntime("com.blamejared.crafttweaker:CraftTweaker-fabric-1.20.1:${crafttweaker_version}")
modCompileOnly("mezz.jei:jei-${minecraft_version}-common-api:${jei_version}")
modCompileOnly("mezz.jei:jei-${minecraft_version}-fabric-api:${jei_version}")
// Uncomment the below to test JEI.
modLocalRuntime("mezz.jei:jei-${minecraft_version}-fabric:${jei_version}")
modCompileOnly "me.shedaniel:RoughlyEnoughItems-api-fabric:${rei_version}"
modCompileOnly "me.shedaniel:RoughlyEnoughItems-default-plugin-fabric:${rei_version}"
// Uncomment the below to test REI.
// modRuntimeOnly "me.shedaniel:RoughlyEnoughItems-fabric:${rei_version}"
modCompileOnly("dev.emi:emi-fabric:${emi_version}:api") {
exclude(group: "net.fabricmc.fabric-api")
}
// Uncomment the below to test EMI.
/*
modLocalRuntime("dev.emi:emi-fabric:${emi_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
// This is also required for EMI as it uses an out of date FAPI.
modLocalRuntime "net.fabricmc.fabric-api:fabric-api-deprecated:${fabric_api_version}"
*/
// test addons
//modImplementation("curse.maven:farmers-respite-fabric-811003:4754429")
//modImplementation("curse.maven:forge-config-api-port-fabric-547434:4583000")
//modImplementation("curse.maven:farmers-knives-628972:5178087")
//modImplementation("curse.maven:oceans-delight-841262:4652063")
//modImplementation("curse.maven:fabric-seasons-delight-compat-859370:4533190")
//modImplementation("curse.maven:chefs-delight-fabric-736986:4751399")
//modImplementation("curse.maven:fabric-seasons-413523:4699698")
//modImplementation("curse.maven:expanded-delight-620770:5177998")
//modImplementation("curse.maven:ends-delight-662675:4678087")
//modImplementation("curse.maven:slice-and-dice-659674:5184596")
//modImplementation("draylar.omegaconfig:omega-config-base-1.2.3-1.18.1")
//modImplementation("dev.draylar.omega-config:omega-config-base:${project.omega_version}")
//modImplementation("curse.maven:frights-delight-927591:4857179")
//modImplementation("curse.maven:nethers-delight-fabric-701831:4778206")
}
var env = System.getenv()
var modLoader = name
var changelogFile = rootProject.file("changelog.md")
var changelogText = changelogFile.exists() ? changelogFile.text : ""
if (env.MODRINTH_TOKEN) {
modrinth {
projectId = modrinth_project_id
versionName = "Farmer's Delight Refabricated ${mod_version.split("-")[1]} - ${minecraft_version}"
uploadFile = tasks.remapJar
gameVersions = [minecraft_version]
loaders = ["fabric", "quilt"]
changelog = changelogText
versionNumber = mod_version
versionType = "release"
dependencies {
required.project "fabric-api"
embedded.project "porting_lib"
optional.project "crafttweaker"
optional.project "jei"
optional.project "rei"
optional.project "emi"
}
}
}
if (env.CURSEFORGE_TOKEN) {
curseforge {
apiKey = env.CURSEFORGE_TOKEN
project {
id = project_id
changelog = changelogText
changelogType = 'markdown'
releaseType = 'release'
addGameVersion minecraft_version
addGameVersion "Fabric"
addGameVersion "Quilt"
mainArtifact(tasks.remapJar) {
displayName = "Farmer's Delight Refabricated ${mod_version.split("-")[1]} - ${minecraft_version}"
}
relations {
requiredDependency "fabric-api"
embeddedLibrary "porting-lib"
optionalDependency "crafttweaker"
optionalDependency "jei"
optionalDependency "roughly-enough-items"
optionalDependency "emi"
}
}
}
}
processResources {
var replaceProperties = [
minecraft_version : minecraft_version,
minecraft_min_version: minecraft_min_version,
minecraft_max_version: minecraft_max_version,
mod_id : mod_id,
mod_name : mod_name,
mod_version : version,
mod_license : mod_license,
mod_authors : mod_authors,
mod_description : mod_description,
mod_credits : mod_credits,
mod_homepage : mod_homepage,
mod_github : mod_github,
port_lib_version : port_lib_version
]
// setting them as input
inputs.properties replaceProperties
filesMatching("fabric.mod.json") {
expand replaceProperties + [project: project]
}
}
tasks.withType(JavaCompile).configureEach {
it.options.release = 17
}
java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
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) {
groupId project.group
artifactId project.archivesBaseName
version project.version
from components.java
}
}
repositories {
maven {
name "greenhouse"
url "https://maven.greenhouseteam.dev/releases"
credentials {
username System.getenv('MAVEN_USERNAME')
password System.getenv('MAVEN_PASSWORD')
}
authentication {
create("basic", BasicAuthentication)
}
}
}
}