Awoocord/canary/SlashCommandsFix/build.gradle.kts

53 lines
1.3 KiB
Text
Raw Normal View History

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
version = "8.18.0"
description = "Beta backport of SlashCommandsFix"
aliucord {
changelog.set("""
# 8.18.0
* Don't use custom props anymore (core has them)
# 7.16.2
* Use new props
# 7.16.1
* Prompt restarts
# 7.16.0
* Initial port >w< thanks @jedenastka
""".trimIndent())
2025-12-06 17:55:32 +11:00
deploy.set(true)
}
2025-12-06 17:55:32 +11:00
apply {
plugin(libs.plugins.shadow.get().pluginId)
}
val shadowDir = File(buildDir, "intermediates/shadowed")
tasks.register<ShadowJar>("relocateJar") {
val javaTask = tasks.findByName("compileDebugJavaWithJavac")!!
val kotlinTask = tasks.findByName("compileDebugKotlin")!!
from(javaTask.outputs, kotlinTask.outputs)
relocate("com.aliucord.coreplugins.slashcommandsfix", "moe.lava.corenary.slashcommandsfix")
archiveClassifier.set("shadowed")
destinationDirectory.set(File(buildDir, "intermediates"))
}
tasks.register<Sync>("copyShadowed") {
val reloc = tasks.findByName("relocateJar")!! as ShadowJar
dependsOn(reloc)
from(zipTree(reloc.archiveFile))
into(shadowDir)
}
project.afterEvaluate {
tasks.compileDex {
val copyShadowed = tasks.findByName("copyShadowed")!! as Sync
dependsOn(copyShadowed)
input.setFrom(shadowDir)
}
}