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

Renamed to kobalt-core-plugin.xml to avoid shadowing.

This commit is contained in:
Cedric Beust 2015-12-18 05:01:22 +04:00
parent 77c3e130e8
commit bf33262486
2 changed files with 8 additions and 1 deletions

View file

@ -78,7 +78,12 @@ class PluginInfo(val xml: KobaltPluginXml, val classLoader: ClassLoader?) {
val mavenIdInterceptors = arrayListOf<IMavenIdInterceptor>()
companion object {
val PLUGIN_XML = "META-INF/kobalt-plugin.xml" // Plugins.PLUGIN_XML)
/**
* The name needs to be different from kobalt-plugin.xml because classloaders
* can put a plug-in's jar file in front of Kobalt's, which means we'll read
* that one instead of the core one.
*/
val PLUGIN_XML = "META-INF/kobalt-core-plugin.xml" // Plugins.PLUGIN_XML)
/**
* Read Kobalt's own kobalt-plugin.xml.
@ -86,6 +91,7 @@ class PluginInfo(val xml: KobaltPluginXml, val classLoader: ClassLoader?) {
fun readKobaltPluginXml(): PluginInfo {
// Note: use forward slash here since we're looking up this file in a .jar file
val url = Kobalt::class.java.classLoader.getResource(PLUGIN_XML)
log(2, "URL for core kobalt-plugin.xml: $url")
if (url != null) {
return readPluginXml(url.openConnection().inputStream)
} else {
@ -100,6 +106,7 @@ class PluginInfo(val xml: KobaltPluginXml, val classLoader: ClassLoader?) {
val jaxbContext = JAXBContext.newInstance(KobaltPluginXml::class.java)
val kotlinPlugin: KobaltPluginXml = jaxbContext.createUnmarshaller().unmarshal(ins)
as KobaltPluginXml
log(2, "Parsed plugin-info.xml, found: " + kotlinPlugin.name)
return PluginInfo(kotlinPlugin, classLoader)
}