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

Exclude MANIFESTS from other jar files.

This commit is contained in:
Cedric Beust 2018-02-03 11:17:44 -08:00
parent c1364c82a0
commit 7d27cd144d
2 changed files with 5 additions and 2 deletions

View file

@ -90,7 +90,10 @@ class OsgiPlugin @Inject constructor(val configActor: ConfigActor<OsgiConfig>, v
val fileSystem = FileSystems.newFileSystem(toFile, null)
fileSystem.use { fs ->
JarFile(jarFile).use { jf ->
val mf = jf.getEntry(MetaArchive.MANIFEST_MF) ?: Files.createDirectories(fs.getPath("META-INF/"))
val mf = jf.getEntry(MetaArchive.MANIFEST_MF)
if (mf == null) {
Files.createDirectories(fs.getPath("META-INF/"))
}
val jarManifest = fs.getPath(MetaArchive.MANIFEST_MF)
Files.write(jarManifest, listOf(lines2),
if (mf != null) StandardOpenOption.APPEND else StandardOpenOption.CREATE)