Skip to content

Instantly share code, notes, and snippets.

@adamw
Created May 17, 2019 13:11
Show Gist options
  • Save adamw/20fd70e5e696857391eab1e662361955 to your computer and use it in GitHub Desktop.
Save adamw/20fd70e5e696857391eab1e662361955 to your computer and use it in GitHub Desktop.
val stageDir = target.value / "native-docker" / "stage"
stageDir.mkdirs()
// copy all jars to the staging directory
val cpDir = stageDir / "cp"
cpDir.mkdirs()
val classpathJars = Seq((packageBin in Compile).value) ++
(dependencyClasspath in Compile).value.map(_.data)
classpathJars.foreach(cpJar => Files.copy(
cpJar.toPath,
(cpDir / cpJar.name).toPath,
StandardCopyOption.REPLACE_EXISTING))
val resultDir = stageDir / "result"
resultDir.mkdirs()
val resultName = "out"
val className = (mainClass in Compile).value
.getOrElse(sys.error("Could not find a main class."))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment