diff options
author | Jakob Odersky <jodersky@gmail.com> | 2014-04-18 19:36:21 +0200 |
---|---|---|
committer | Jakob Odersky <jodersky@gmail.com> | 2014-04-18 19:36:21 +0200 |
commit | 2b8d4feff9a342910192218a33fc9880abc1f33d (patch) | |
tree | eb1f0484ccf44572ec5a2394a00bf299f46396bf /project/nativeFat.scala | |
parent | 6f24c31168b2700504dd81bcd5aff278e3353fef (diff) | |
download | akka-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.scala | 69 |
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 - ) - -} - |