diff options
author | Jakob Odersky <jodersky@gmail.com> | 2016-01-17 17:18:13 -0800 |
---|---|---|
committer | Jakob Odersky <jodersky@gmail.com> | 2016-01-17 17:18:13 -0800 |
commit | 2b343f73fc5b7605b22af41c675c2afc86d2a447 (patch) | |
tree | 51087a72109c927c7be245367458bffb3ec48ae7 /samples/basic/basic-core | |
parent | 1cdbc2d2e04c7ab34d2e5af07567b37c60be571f (diff) | |
download | sbt-jni-2b343f73fc5b7605b22af41c675c2afc86d2a447.tar.gz sbt-jni-2b343f73fc5b7605b22af41c675c2afc86d2a447.tar.bz2 sbt-jni-2b343f73fc5b7605b22af41c675c2afc86d2a447.zip |
Refactor to multi-plugin build
Diffstat (limited to 'samples/basic/basic-core')
3 files changed, 22 insertions, 0 deletions
diff --git a/samples/basic/basic-core/build.sbt b/samples/basic/basic-core/build.sbt new file mode 100644 index 0000000..cd51bb3 --- /dev/null +++ b/samples/basic/basic-core/build.sbt @@ -0,0 +1 @@ +//enablePlugins(JniLoader) diff --git a/samples/basic/basic-core/src/main/scala/ch/jodersky/jni/basic/Library.scala b/samples/basic/basic-core/src/main/scala/ch/jodersky/jni/basic/Library.scala new file mode 100644 index 0000000..efe3018 --- /dev/null +++ b/samples/basic/basic-core/src/main/scala/ch/jodersky/jni/basic/Library.scala @@ -0,0 +1,8 @@ +package ch.jodersky.jni.basic + +/** A demo object, mapping to a native library. */ +object Library { + + @native def print(message: String): Int + +} diff --git a/samples/basic/basic-core/src/main/scala/ch/jodersky/jni/basic/Main.scala b/samples/basic/basic-core/src/main/scala/ch/jodersky/jni/basic/Main.scala new file mode 100644 index 0000000..2aab1ed --- /dev/null +++ b/samples/basic/basic-core/src/main/scala/ch/jodersky/jni/basic/Main.scala @@ -0,0 +1,13 @@ +package ch.jodersky.jni.basic + +import ch.jodersky.jni.NativeLoader + +object Main { + + def main(args: Array[String]): Unit = { + NativeLoader.load("/ch/jodersky/jni/basic/native", "demo1") + val result: Int = Library.print("Hello world!\n") + println("Returned: " + result) + } + +} |