Got 3rd party dependencies working in development mode

This commit is contained in:
grimsi
2024-10-30 14:10:51 +01:00
parent 0563f2b366
commit 1bb46e3a71
15 changed files with 104 additions and 71 deletions
-26
View File
@@ -1,5 +1,4 @@
group = "de.grimsi"
val pluginDir: File by rootProject.extra
val appMainClass = "de.grimsi.gameyfin.GameyfinApplication"
plugins {
@@ -86,31 +85,6 @@ dependencyManagement {
}
}
tasks.named<JavaExec>("run") {
systemProperty("pf4j.pluginsDir", pluginDir.absolutePath)
}
tasks.register<Jar>("uberJar") {
dependsOn(tasks.named("compileKotlin"))
archiveClassifier.set("uber")
from(sourceSets.main.get().output)
dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
})
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
isZip64 = true
manifest {
attributes["Main-Class"] = appMainClass
}
archiveBaseName.set(project.name)
}
tasks.withType<Test> {
useJUnitPlatform()
}
@@ -10,10 +10,10 @@ import java.nio.file.Path
@Configuration
class PluginManagerConfig {
private val log = KotlinLogging.logger {}
private val pluginPath = Path.of("plugins")
private val pluginPath = System.getProperty("pf4j.pluginsDir", "plugins")
@Bean
fun pluginManager() = SpringDevtoolsPluginManager(pluginPath)
fun pluginManager() = SpringDevtoolsPluginManager(Path.of(pluginPath))
@EventListener(ApplicationReadyEvent::class)
fun loadedPlugins() {
@@ -48,7 +48,7 @@ class AsyncFileTailer(
tailer.run()
}
log.info { "Started tailing the file: ${file.name}" }
log.debug { "Started tailing the file: ${file.name}" }
} else {
log.error { "File tailing for file ${file.name} is already running!" }
}
@@ -58,7 +58,7 @@ class AsyncFileTailer(
tailerJob?.let {
it.cancel()
tailerJob = null
log.info { "Stopped tailing the file: ${file.name}" }
log.debug { "Stopped tailing the file: ${file.name}" }
}
}
}