1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

Comments.

This commit is contained in:
Cedric Beust 2016-06-01 21:07:44 -08:00
parent e8f5ca1684
commit 0dd42bf3d4

View file

@ -161,10 +161,13 @@ class Plugins @Inject constructor (val taskManagerProvider : Provider<TaskManage
// //
// Open the jar, parse its kobalt-plugin.xml and add the resulting PluginInfo to pluginInfo // Open the jar, parse its kobalt-plugin.xml and add the resulting PluginInfo to pluginInfo
// //
val file = it.jarFile.get(); val file = it.jarFile.get()
val pluginXml = if (file.isDirectory()) { val pluginXml = if (file.isDirectory) {
// The plug-in can point to a directory (e.g. plugin("classes")), in which case we just
// read kobalt-plugin.xml directly
File(file, PluginInfo.PLUGIN_XML).readText() File(file, PluginInfo.PLUGIN_XML).readText()
} else { } else {
// The plug-in is pointing to a jar file, read kobalt-plugin.xml from it
JarUtils.extractTextFile(JarFile(file), PluginInfo.PLUGIN_XML) JarUtils.extractTextFile(JarFile(file), PluginInfo.PLUGIN_XML)
} }
if (pluginXml != null) { if (pluginXml != null) {