|
|
@ -22,6 +22,7 @@ import java.util.TreeMap |
|
|
|
import java.util.jar.JarEntry |
|
|
|
import java.util.jar.JarEntry |
|
|
|
import java.util.jar.JarInputStream |
|
|
|
import java.util.jar.JarInputStream |
|
|
|
import java.util.jar.JarOutputStream |
|
|
|
import java.util.jar.JarOutputStream |
|
|
|
|
|
|
|
import java.util.jar.Manifest |
|
|
|
import java.util.zip.GZIPInputStream |
|
|
|
import java.util.zip.GZIPInputStream |
|
|
|
import java.util.zip.GZIPOutputStream |
|
|
|
import java.util.zip.GZIPOutputStream |
|
|
|
|
|
|
|
|
|
|
@ -79,14 +80,16 @@ class Library constructor() : Iterable<ClassNode> { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun writeJar(path: Path) { |
|
|
|
fun writeJar(path: Path, manifest: Manifest? = null) { |
|
|
|
logger.info { "Writing jar $path" } |
|
|
|
logger.info { "Writing jar $path" } |
|
|
|
|
|
|
|
|
|
|
|
Files.newOutputStream(path).use(::writeJar) |
|
|
|
Files.newOutputStream(path).use { |
|
|
|
|
|
|
|
writeJar(it, manifest) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun writeJar(out: OutputStream) { |
|
|
|
fun writeJar(out: OutputStream, manifest: Manifest? = null) { |
|
|
|
DeterministicJarOutputStream(out).use { jar -> |
|
|
|
DeterministicJarOutputStream.create(out, manifest).use { jar -> |
|
|
|
for (clazz in classes.values) { |
|
|
|
for (clazz in classes.values) { |
|
|
|
val writer = ClassWriter(0) |
|
|
|
val writer = ClassWriter(0) |
|
|
|
|
|
|
|
|
|
|
|