Skip to content

Commit

Permalink
[ML-5603] remove tests resources from release jar (#172)
Browse files Browse the repository at this point in the history
Currently the release jar contains test resources and scala library, which makes the release jar very large and error-prone. This PR removes test resources and scala from the release jar.

It reduces the release jar from 7MB to 230KB.
  • Loading branch information
mengxr authored and jkbradley committed Nov 21, 2018
1 parent d55ea9e commit c958928
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ unmanagedResources in Compile += baseDirectory.value / "LICENSE"
unmanagedResourceDirectories in Compile += baseDirectory.value / "python"

includeFilter in unmanagedResources := "requirements.txt" ||
new SimpleFileFilter(_.relativeTo(baseDirectory.value / "python")
.exists(_.getPath.matches("sparkdl/.*\\.py"))) || "*.png" || "*.jpg" || "*.pb"
new SimpleFileFilter(
_.relativeTo(baseDirectory.value / "python")
.forall(_.getPath.matches("^sparkdl/.*\\.py$")))

// Reset mappings in spPackage to avoid including duplicate files.
mappings in (Compile, spPackage) := (mappings in (Compile, packageBin)).value
Expand All @@ -110,3 +111,5 @@ releaseProcess := Seq[ReleaseStep](

// Skip tests during assembly
test in assembly := {}

assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = false)

0 comments on commit c958928

Please sign in to comment.