diff --git a/build.gradle.kts b/build.gradle.kts index 52aabab..819b813 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,6 +10,7 @@ plugins { alias(libs.plugins.kotlin) alias(libs.plugins.quilt.loom) alias(libs.plugins.kotlinx.serialization) + alias(libs.plugins.shadow) } val archives_base_name: String by project @@ -25,11 +26,26 @@ repositories { // for more information about repositories. } -fun DependencyHandlerScope.includeApi(dependency: Any) { - api(dependency) - include(dependency) -} +tasks { + remapJar { + dependsOn(shadowJar) + input.set(shadowJar.get().archiveFile) + } + + shadowJar { + from("LICENSE") + configurations = listOf( + project.configurations.shadow.get() + ) + archiveClassifier.set("dev-all") + + exclude("kotlin/**", "kotlinx/**", "javax/**", "META-INF") + exclude("org/intellij/**", "org/jetbrains/annotations/**") + exclude("com/google/gson/**") + exclude("org/slf4j/**") + } +} // All the dependencies are declared at gradle/libs.version.toml and referenced with "libs." // See https://docs.gradle.org/current/userguide/platforms.html for information on how version catalogs work. dependencies { @@ -60,12 +76,12 @@ dependencies { modImplementation(libs.qkl) - includeApi(libs.kotlinx.serialization) + shadow(libs.kotlinx.serialization) - includeApi(libs.ktor.core) - includeApi(libs.ktor.cio) - includeApi(libs.ktor.contentnegotiation) - includeApi(libs.ktor.json) + shadow(libs.ktor.core) + shadow(libs.ktor.cio) + shadow(libs.ktor.contentnegotiation) + shadow(libs.ktor.json) } tasks { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0e6cc9d..1707da0 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -9,6 +9,7 @@ mappings = "1.20.1+build.23" loom = "1.+" ktx-ser = "1.6.0" ktor = "2.3.6" +shadow = "8.1.1" [libraries] minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" } @@ -33,3 +34,4 @@ quilted_fabric_api = ["qfapi", "qfapi_deprecated"] kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } quilt_loom = { id = "org.quiltmc.loom", version.ref = "loom" } kotlinx_serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } +shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }