-
Notifications
You must be signed in to change notification settings - Fork 0
/
assembly.sbt
41 lines (31 loc) · 990 Bytes
/
assembly.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// sbt-assembly configuration
//
val buildOutputPath = file("./_build")
mainClass in assembly := Some("org.newtonpolyhedron.NewtonEntry")
assemblyJarName in assembly := name.value + "-" + version.value + "b" + buildInfoBuildNumber.value + ".jar"
assemblyOutputPath in assembly := file("./_build") / (assemblyJarName in assembly).value
//
// copyLibs task
//
import J3dDependencies._
val libOutputDir = buildOutputPath
val copyLibs = taskKey[Unit](s"Copies all OS-specific libraries to ${libOutputDir}")
copyLibs := {
val toCopy = new collection.mutable.HashSet[(File, File)]
val paths = j3dCurrOsLibPaths map (unmanagedBase.value / _)
paths.foreach { p =>
p.listFiles().filter(!_.isDirectory).foreach { f =>
toCopy += (f -> (buildOutputPath / f.getName))
}
}
IO.copy(toCopy)
}
//
// buildDistr task
//
val buildDistr = taskKey[Unit](s"Complete build: assemble a runnable .jar, copy libs")
buildDistr := {
assembly.value
copyLibs.value
}