mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-16 16:20:04 +00:00
Added support for 3rd party dependencies in plugins (#434)
This commit is contained in:
+12
-38
@@ -1,5 +1,3 @@
|
||||
val pluginDir: File by rootProject.extra
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
}
|
||||
@@ -8,48 +6,24 @@ 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)
|
||||
compileOnly(project(":plugin-api"))
|
||||
}
|
||||
|
||||
tasks.jar {
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
isZip64 = true
|
||||
archiveBaseName.set("plugin-${project.name}")
|
||||
|
||||
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"))
|
||||
from(configurations.runtimeClasspath.get().map { project.zipTree(it) }) {
|
||||
exclude("META-INF/*.SF")
|
||||
exclude("META-INF/*.DSA")
|
||||
exclude("META-INF/*.RSA")
|
||||
}
|
||||
from(sourceSets["main"].output.classesDirs)
|
||||
from(sourceSets["main"].resources)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user