Skip to content

Commit

Permalink
#57 replace fat jar packaging with proguard generated fat jar - means…
Browse files Browse the repository at this point in the history
… we have around a 10MB jar being built in the debian package rather than a 40MB 💥
  • Loading branch information
tobyweston committed Apr 15, 2018
1 parent 26c7d3a commit 10afbb3
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions package.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,14 @@ mappings in (Compile, packageSrc) := Seq()
// }
//}

// remove all jar mappings in universal and append the "fat" jar
mappings in Universal := {
val universalMappings = (mappings in Universal).value
val fatJar = (assembly in Compile).value
val filtered = universalMappings filter {
// filter out jar files from the list of generated files
mappings in Universal := (mappings in Universal).value.
filter {
case (_, name) => ! name.endsWith(".jar")
}
filtered :+ (fatJar -> ("lib/" + fatJar.getName))
}

// the bash scripts classpath only needs the fat jar
scriptClasspath := Seq((assemblyJarName in assembly).value)
// append the proguard jar file
mappings in Universal ++= (proguard in Proguard).value.map(jar => jar -> ("lib/" + jar.getName))

// point the classpath to the output from the proguard task
scriptClasspath := (proguard in Proguard).value.map(jar => jar.getName)

0 comments on commit 10afbb3

Please sign in to comment.