forked from LLytho/CrittersAndCompanions-Fabric
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
114 lines (97 loc) · 2.85 KB
/
build.gradle.kts
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
@file:Suppress("UnstableApiUsage")
plugins {
java
idea
`maven-publish`
id("fabric-loom") version "1.0-SNAPSHOT"
id("io.github.juuxel.loom-quiltflower") version("1.7.4")
}
val license: String by project
val minecraftVersion: String by project
val modId: String by project
val modVersion: String by project
val modName: String by project
val modAuthor: String by project
val modDescription: String by project
val fabricVersion: String by project
val fabricLoaderVersion: String by project
val mappingsChannel: String by project
val mappingsVersion: String by project
val githubUser: String by project
val githubRepo: String by project
base.archivesName.set("$modId-fabric")
version = "$minecraftVersion-$modVersion"
extensions.configure<JavaPluginExtension> {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
withSourcesJar()
}
repositories {
maven("https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/")
mavenCentral()
}
loom {
runs {
onEach {
it.configName = "Fabric ${it.environment.capitalize()}"
it.ideConfigGenerated(true)
it.runDir("run")
it.vmArgs("-XX:+IgnoreUnrecognizedVMOptions", "-XX:+AllowEnhancedClassRedefinition")
}
}
mixin {
defaultRefmapName.set("${modId}.refmap.json")
}
}
dependencies {
/**
* Core Mod Loader dependencies
*/
minecraft("com.mojang:minecraft:$minecraftVersion")
modImplementation("net.fabricmc:fabric-loader:$fabricLoaderVersion")
modApi("net.fabricmc.fabric-api:fabric-api:$fabricVersion")
mappings(loom.layered {
officialMojangMappings()
})
/**
* Mod dependencies
*/
modImplementation("software.bernie.geckolib:geckolib-fabric-1.19:3.1.37") { isTransitive = false }
}
tasks {
withType<GenerateModuleMetadata> {
enabled = false
}
withType<JavaCompile> {
options.encoding = "UTF-8"
options.release.set(17)
}
processResources {
val resourceTargets = listOf("pack.mcmeta", "fabric.mod.json")
val replaceProperties = mapOf(
"version" to project.version as String,
"license" to license,
"modId" to modId,
"modName" to modName,
"minecraftVersion" to minecraftVersion,
"modAuthor" to modAuthor,
"modDescription" to modDescription,
"githubUser" to githubUser,
"githubRepo" to githubRepo
)
inputs.properties(replaceProperties)
filesMatching(resourceTargets) {
expand(replaceProperties)
}
}
}
publishing {
publications {
register("mavenJava", MavenPublication::class) {
artifactId = base.archivesName.get()
from(components["java"])
}
}
repositories {
maven("file://${System.getenv("local_maven")}")
}
}