mirror of https://github.com/sbt/sbt.git
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:
parent
9e7cc6dec4
commit
208f18f518
16
build.sbt
16
build.sbt
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue