aboutsummaryrefslogtreecommitdiff
path: root/project/nativeFat.scala
diff options
context:
space:
mode:
authorJakob Odersky <jodersky@gmail.com>2014-04-18 19:36:21 +0200
committerJakob Odersky <jodersky@gmail.com>2014-04-18 19:36:21 +0200
commit2b8d4feff9a342910192218a33fc9880abc1f33d (patch)
treeeb1f0484ccf44572ec5a2394a00bf299f46396bf /project/nativeFat.scala
parent6f24c31168b2700504dd81bcd5aff278e3353fef (diff)
downloadakka-serial-2b8d4feff9a342910192218a33fc9880abc1f33d.tar.gz
akka-serial-2b8d4feff9a342910192218a33fc9880abc1f33d.tar.bz2
akka-serial-2b8d4feff9a342910192218a33fc9880abc1f33d.zip
reinstore native jars
Diffstat (limited to 'project/nativeFat.scala')
-rw-r--r--project/nativeFat.scala69
1 files changed, 0 insertions, 69 deletions
diff --git a/project/nativeFat.scala b/project/nativeFat.scala
deleted file mode 100644
index 55df06d..0000000
--- a/project/nativeFat.scala
+++ /dev/null
@@ -1,69 +0,0 @@
-import sbt._
-import Keys._
-import java.io.File
-
-object NativeKeys {
-
- val nativeBuildDirectory = settingKey[File]("Directory containing native build scripts.")
- val nativeTarget = settingKey[File]("Target directory to store native artifacts.")
-
- val nativeBuild = taskKey[File]("Invoke native build.")
-
- val nativePackUnmanaged = settingKey[File]("")
-}
-
-object NativeDefaults {
- import NativeKeys._
-
- val nativeBuildImpl = Def.task {
- val log = streams.value.log
- val build = nativeBuildDirectory.value
- val target = nativeTarget.value
-
- val configure = Process(
- "./configure " +
- "--prefix=" + target.getAbsolutePath + " " +
- "--libdir=" + target.getAbsolutePath,
- Some(build))
-
- val make = Process("make", build)
-
- val makeInstall = Process("make install", build)
-
- val ev = configure #&& make #&& makeInstall ! log
- if (ev != 0)
- throw new RuntimeException(s"Building native library failed.")
-
- (target ** ("*.la")).get.foreach(_.delete())
-
- target
- }
-
-
- val mappingsImpl = Def.task {
- val files = (nativeBuild.value ** "*").get
- val unamanagedDir = nativePackUnmanaged.value
-
- val managed: Seq[(File, String)] = for (file <- files; if file.isFile) yield {
- file -> ("native/" + (file relativeTo nativeTarget.value).get.getPath)
- }
-
- val unmanaged: Seq[(File, String)] = for (file <- (unamanagedDir ** "*").get; if file.isFile) yield {
- file -> ("native/" + (file relativeTo unamanagedDir).get.getPath)
- }
-
- managed ++ unmanaged
- }
-
- def os = System.getProperty("os.name").toLowerCase.filter(_ != ' ')
- def arch = System.getProperty("os.arch").toLowerCase
-
- val settings: Seq[Setting[_]] = Seq(
- nativeTarget := target.value / "native" / (os + "-" + arch),
- nativeBuild := nativeBuildImpl.value,
- nativePackUnmanaged := baseDirectory.value / "lib_native",
- mappings in (Compile, packageBin) ++= mappingsImpl.value
- )
-
-}
-