diff options
author | Jakob Odersky <jodersky@gmail.com> | 2013-05-21 19:30:04 +0200 |
---|---|---|
committer | Jakob Odersky <jodersky@gmail.com> | 2013-05-21 19:30:04 +0200 |
commit | 15b42451d124564b9ccf4a6365d2f50f7f3896c9 (patch) | |
tree | 48025113c45e4b54b2c1911203530cabef088990 /project | |
parent | 60cac1f48d76329fa94034cea84499fb93337953 (diff) | |
download | akka-serial-15b42451d124564b9ccf4a6365d2f50f7f3896c9.tar.gz akka-serial-15b42451d124564b9ccf4a6365d2f50f7f3896c9.tar.bz2 akka-serial-15b42451d124564b9ccf4a6365d2f50f7f3896c9.zip |
extract native libraries
Diffstat (limited to 'project')
-rw-r--r-- | project/Build.scala | 18 | ||||
-rw-r--r-- | project/JNIBuild.scala | 5 |
2 files changed, 14 insertions, 9 deletions
diff --git a/project/Build.scala b/project/Build.scala index 714c9d0..9efb049 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -11,7 +11,7 @@ object FlowBuild extends Build { lazy val root = Project( id = "flow", base = file("."), - settings = buildSettings ++ jniSettings ++ runSettings) + settings = buildSettings ++ jniSettings ++ runSettings ++ Seq(libraryDependencies ++= Dependencies.all)) lazy val buildSettings = Defaults.defaultSettings ++ Seq( organization := Organization, @@ -19,8 +19,8 @@ object FlowBuild extends Build { scalaVersion := ScalaVersion, resolvers += "Typesafe Repo" at "http://repo.typesafe.com/typesafe/releases/", scalacOptions ++= Seq("-deprecation", "-unchecked", "-feature"), - compileOrder in Compile := CompileOrder.JavaThenScala) - + compileOrder in Compile := CompileOrder.Mixed) + lazy val jniSettings = JNIBuild.defaults ++ Seq( jdkHome := file(System.getProperty("java.home")) / "..", javaClass := "com.github.jodersky.flow.NativeSerial", @@ -29,9 +29,13 @@ object FlowBuild extends Build { NativeBuild.includeDirectories <<= jdkHome apply (jdk => Seq(jdk / "include", jdk / "include" / "linux")), linker := "gcc", linkerOptions := Seq("-shared", "-Wl,-soname,libflow.so.1"), - linkerOutput <<= NativeBuild.outputDirectory(_ / "libflow.so") + linkerOutput <<= NativeBuild.outputDirectory(_ / "libflow.so"), + mappings in (Compile, packageBin) <+= linkerOutput map { out => + out -> ("native/" + System.getProperty("os.name").toLowerCase + "/" + System.getProperty("os.arch").toLowerCase + "/libflow.so") + }, + Keys.`package` in (Compile, packageBin) <<= (Keys.`package` in (Compile, packageBin)).dependsOn(NativeBuild.link) ) - + lazy val runSettings = Seq( fork := true, connectInput in run := true, @@ -41,7 +45,7 @@ object FlowBuild extends Build { object Dependencies { lazy val all = Seq() - //lazy val io = "com.github.scala-incubator.io" %% "scala-io-core" % "0.4.2" - //lazy val file = "com.github.scala-incubator.io" %% "scala-io-file" % "0.4.2" + lazy val io = "com.github.scala-incubator.io" %% "scala-io-core" % "0.4.2" + lazy val file = "com.github.scala-incubator.io" %% "scala-io-file" % "0.4.2" } diff --git a/project/JNIBuild.scala b/project/JNIBuild.scala index 95509fb..ed0d05e 100644 --- a/project/JNIBuild.scala +++ b/project/JNIBuild.scala @@ -13,9 +13,10 @@ object JNIBuild { {} } dependsOn (Keys.compile in Compile) - val defaults = NativeBuild.defaults ++ Seq( + val defaults: Seq[Setting[_]] = NativeBuild.defaults ++ Seq( javahTask, - NativeBuild.compile <<= NativeBuild.compile.dependsOn(javah)) + NativeBuild.compile <<= NativeBuild.compile.dependsOn(javah) + ) } |