More careful handling of the bootstrap.jar resource

It seems that blindly putting it in resourceGenerators makes proguard...
proguard it.
This commit is contained in:
Alexandre Archambault 2017-06-12 01:54:24 +02:00
parent 9e7cc6dec4
commit 208f18f518
1 changed files with 15 additions and 1 deletions

View File

@ -356,7 +356,21 @@ lazy val coursier = project
lazy val addBootstrapJarAsResource = {
resourceGenerators.in(Compile) += packageBin.in(bootstrap).in(Compile).map(Seq(_)).taskValue
import java.nio.file.Files
packageBin.in(Compile) := {
val bootstrapJar = packageBin.in(bootstrap).in(Compile).value
val source = packageBin.in(Compile).value
val dest = source.getParentFile / (source.getName.stripSuffix(".jar") + "-with-bootstrap.jar")
ZipUtil.addToZip(source, dest, Seq(
"bootstrap.jar" -> Files.readAllBytes(bootstrapJar.toPath)
))
dest
}
}
lazy val addBootstrapInProguardedJar = {