mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-13 16:40:01 +00:00
55 lines
1.2 KiB
Kotlin
55 lines
1.2 KiB
Kotlin
val pluginDir: File by rootProject.extra
|
|
|
|
plugins {
|
|
kotlin("jvm")
|
|
}
|
|
|
|
subprojects {
|
|
apply(plugin = "org.jetbrains.kotlin.jvm")
|
|
|
|
dependencies {
|
|
implementation(project(":plugin-api"))
|
|
}
|
|
|
|
tasks.register<Jar>("plugin") {
|
|
archiveBaseName.set("plugin-${project.name}")
|
|
|
|
// first taking the classes generated by the jar task
|
|
into("classes") {
|
|
with(tasks.named<Jar>("jar").get())
|
|
}
|
|
// and then we also need to include any libraries that are needed by the plugin
|
|
dependsOn(configurations.runtimeClasspath)
|
|
into("lib") {
|
|
from({
|
|
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }
|
|
})
|
|
}
|
|
archiveExtension.set("jar")
|
|
}
|
|
|
|
tasks.register<Copy>("assemblePlugin") {
|
|
from(project.tasks.named("plugin"))
|
|
into(pluginDir)
|
|
}
|
|
|
|
tasks.jar {
|
|
manifest {
|
|
from("./src/main/resources/MANIFEST.MF")
|
|
}
|
|
}
|
|
|
|
tasks.named("build") {
|
|
dependsOn(tasks.named("plugin"))
|
|
}
|
|
}
|
|
|
|
tasks.register<Copy>("assemblePlugins") {
|
|
dependsOn(subprojects.map { it.tasks.named("assemblePlugin") })
|
|
}
|
|
|
|
tasks {
|
|
"build" {
|
|
dependsOn(named("assemblePlugins"))
|
|
}
|
|
} |