mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-28 00:58:12 -07:00
Exclude MANIFESTS from other jar files.
This commit is contained in:
parent
c1364c82a0
commit
7d27cd144d
2 changed files with 5 additions and 2 deletions
|
@ -64,7 +64,7 @@ class MetaArchive(private val outputFile: File, val manifest: Manifest?) : Close
|
||||||
}
|
}
|
||||||
|
|
||||||
private val DEFAULT_JAR_EXCLUDES =
|
private val DEFAULT_JAR_EXCLUDES =
|
||||||
Glob("META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA")
|
Glob("META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA", "META-INF/MANIFEST.MF")
|
||||||
|
|
||||||
private val seen = hashSetOf<String>()
|
private val seen = hashSetOf<String>()
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,10 @@ class OsgiPlugin @Inject constructor(val configActor: ConfigActor<OsgiConfig>, v
|
||||||
val fileSystem = FileSystems.newFileSystem(toFile, null)
|
val fileSystem = FileSystems.newFileSystem(toFile, null)
|
||||||
fileSystem.use { fs ->
|
fileSystem.use { fs ->
|
||||||
JarFile(jarFile).use { jf ->
|
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)
|
val jarManifest = fs.getPath(MetaArchive.MANIFEST_MF)
|
||||||
Files.write(jarManifest, listOf(lines2),
|
Files.write(jarManifest, listOf(lines2),
|
||||||
if (mf != null) StandardOpenOption.APPEND else StandardOpenOption.CREATE)
|
if (mf != null) StandardOpenOption.APPEND else StandardOpenOption.CREATE)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue