-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
164 lines (134 loc) · 5.02 KB
/
build.gradle.kts
File metadata and controls
164 lines (134 loc) · 5.02 KB
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
@file:Suppress("UnstableApiUsage")
plugins {
java
idea
id("quiet-fabric-loom") version ("1.13-SNAPSHOT")
id("org.jetbrains.kotlin.jvm").version("2.3.0")
`maven-publish`
}
val modId = project.properties["mod_id"].toString()
version = project.properties["mod_version"].toString()
group = project.properties["mod_group"].toString()
val modName = project.properties["mod_name"].toString()
base.archivesName.set(modName)
val minecraftVersion = project.properties["minecraft_version"].toString()
loom {
mixin.useLegacyMixinAp.set(false)
interfaceInjection.enableDependencyInterfaceInjection.set(true)
splitEnvironmentSourceSets()
mods {
create(modId) {
sourceSet(sourceSets.main.get())
}
}
if (file("src/main/resources/$modId.accesswidener").exists()) {
accessWidenerPath.set(file("src/main/resources/$modId.accesswidener"))
}
}
val modImplementationInclude by configurations.register("modImplementationInclude")
configurations {
modImplementationInclude
}
repositories {
mavenCentral()
maven( "https://jitpack.io")
maven("https://maven.parchmentmc.org")
maven {
name = "Modrinth"
url = uri("https://api.modrinth.com/maven")
content {
includeGroup("maven.modrinth")
}
}
maven("https://maven.nucleoid.xyz/") { name = "Nucleoid" }
maven(url = "https://s01.oss.sonatype.org/content/repositories/snapshots/") {
name = "sonatype-oss-snapshots1"
mavenContent { snapshotsOnly() }
}
maven("https://oss.sonatype.org/content/repositories/snapshots")
maven("https://maven.impactdev.net/repository/development/")
maven("https://repo.lucko.me")
maven("https://repo.phoenix616.dev/")
}
dependencies {
minecraft("com.mojang:minecraft:$minecraftVersion")
mappings(loom.layered {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-$minecraftVersion:${project.properties["parchment_version"]}")
})
modImplementation("net.fabricmc:fabric-loader:${project.properties["loader_version"].toString()}")
modImplementation("net.fabricmc.fabric-api:fabric-api:${project.properties["fabric_version"].toString()}")
modImplementation("net.fabricmc:fabric-language-kotlin:${project.properties["fabric_kotlin_version"].toString()}")
// Adventure Text!
modImplementation(include("net.kyori:adventure-platform-fabric:5.14.2") {
exclude("com.google.code.gson")
exclude("ca.stellardrift", "colonel")
exclude("net.fabricmc")
})
// PermissionsAPI
modImplementation(include("me.lucko:fabric-permissions-api:0.3.1")!!)
// Placeholder Mods
modImplementation("io.github.miniplaceholders:miniplaceholders-api:2.2.3")
modImplementation("io.github.miniplaceholders:miniplaceholders-kotlin-ext:2.2.3")
modImplementation("eu.pb4:placeholder-api:2.4.1+1.21")
// Impactor Libraries
modImplementation("net.impactdev.impactor:common:5.3.0+1.21.1-SNAPSHOT")
modImplementation("net.impactdev.impactor.api:economy:5.3.0-SNAPSHOT")
modImplementation("net.impactdev.impactor.api:text:5.3.0-SNAPSHOT")
// Cobblemon
modImplementation("com.cobblemon:fabric:1.6.1+1.21.1")
// Database Storage
implementation(include("org.mongodb:mongodb-driver-sync:4.11.0")!!)
implementation(include("org.mongodb:mongodb-driver-core:4.11.0")!!)
implementation(include("org.mongodb:bson:4.11.0")!!)
// SQL Storage
implementation(include("org.mariadb.jdbc:mariadb-java-client:3.1.0")!!)
implementation(include("com.zaxxer:HikariCP:5.1.0")!!)
implementation(include("org.xerial:sqlite-jdbc:3.43.2.2")!!)
implementation(include("com.h2database:h2:2.2.224")!!)
implementation(include("com.mysql:mysql-connector-j:8.2.0")!!)
implementation(include("com.github.ben-manes.caffeine:caffeine:3.2.0")!!)
modCompileOnly(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
}
tasks.processResources {
inputs.property("version", version)
filesMatching("fabric.mod.json") {
expand("version" to version)
}
}
publishing {
publications.create<MavenPublication>("maven") {
artifactId = base.archivesName.get()
from(components["java"])
}
repositories {
mavenLocal()
}
}
tasks.processResources {
inputs.property("mod_version", version)
filesMatching("fabric.mod.json") {
expand("id" to modId, "version" to version, "name" to modName)
}
filesMatching("**/lang/*.json") {
expand("id" to modId, "version" to version, "name" to modName)
}
}
tasks.remapJar {
archiveFileName.set("${project.name}-fabric-$minecraftVersion-${project.version}.jar")
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.release.set(21)
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
withSourcesJar()
}
tasks.withType<AbstractArchiveTask> {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from("LICENSE") {
rename { "${it}_${modId}" }
}
}