aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorJakob Odersky <jodersky@gmail.com>2016-01-17 18:24:11 -0800
committerJakob Odersky <jodersky@gmail.com>2016-01-17 18:24:11 -0800
commite9df09bb0e2324ad40199e7db1f3b5687eae7362 (patch)
treefb4d93909ad4557a00cd401d349b28b41f53ff12 /README.md
parent9194209277f5a58bc74f49157bdaacba473951c4 (diff)
downloadsbt-jni-e9df09bb0e2324ad40199e7db1f3b5687eae7362.tar.gz
sbt-jni-e9df09bb0e2324ad40199e7db1f3b5687eae7362.tar.bz2
sbt-jni-e9df09bb0e2324ad40199e7db1f3b5687eae7362.zip
update readme
Diffstat (limited to 'README.md')
-rw-r--r--README.md43
1 files changed, 24 insertions, 19 deletions
diff --git a/README.md b/README.md
index 502dfa7..4d9d930 100644
--- a/README.md
+++ b/README.md
@@ -16,10 +16,8 @@ Using native code can be beneficial in some situations, it can for example provi
The second point, portability, is inherent to JNI and thus unavoidable. However the first and last points can be greatly simplified with the help of build tools.
## Plugin Overview
-This project consists of 4 autoplugins that aim to solve the difficulties in compiling and distributing JNI programs. These plugins provide two functionalities (compiling and distributing) for two parts of a project (JVM and native):
+This project consists of four autoplugins that aim to solve the difficulties in compiling and distributing JNI programs. These plugins provide two functionalities (compiling and distributing) for two parts of a project (JVM and native). The plugins are listed in the following table:
-Plugins
---------------|-----------------|-------------
Functionality | JVM part | Native part
--------------|-----------------|-------------
Compiling | JniJavah | JniNative
@@ -58,30 +56,26 @@ Select plugins to enable on sub-projects:
//enablePlugin(JniPackaging) // this plugin is added to all projects using JniNative by default
```
-Note that some plugins are added by default. To disable their functionality (for example if you don't wish to package native libraries), add `disablePlugin(<plugin>)` to the corresponding build definition.
+See an example [build.sbt](samples/basic/build.sbt).
+Note that some plugins are added by default. To disable their functionality (for example if you don't wish to package native libraries), add `disablePlugin(<plugin>)` to the corresponding build definition.
## Plugin Details
-The following gives a detailed description about the various JNI plugins and the ways to customize their behaviour.
+The following gives a detailed description about the various JNI plugins and the ways to customize their behaviour. More details can be found in their [implementations](jni-plugin/src/main/scala/ch/jodersky/sbt/jni/plugins).
-### Javah
-*JVM sub-projects*
+### JniJavah
+*Add to sub-projects: JVM*
-#### Functionality
-Adds a `javah` task to generate header files for classes containing `@native` methods.
-
-#### Customization
-Change target to point to `include` directory of native sources: `target in javah := file("myproject-native") / "src" / "include"`
+Adds `javah` task to generate header files for classes containing `@native` methods.
+Customization: `target in javah := file("myproject-native") / "src" / "include"`, to point to `include` directory of native sources.
### JniNative
-*Native sub-projects*
+*Add to sub-projects: native*
-#### Functionality
-Provides sbt tasks to call into a native build system such as Automake or CMake. Run `sbt nativeCompile` to compile native sources.
+Provides sbt tasks to call into a native build system such as Automake or CMake. Run `nativeCompile` to compile native sources.
-#### Customization
-Change source directory to point to a directory containing the native build definition. Supported build tools are:
+Customization: `sourceDirectory in nativeCompile := file("src")`, to point to a directory containing the native build definition. Supported build tools are:
- Automake
- CMake
@@ -89,9 +83,20 @@ Change source directory to point to a directory containing the native build defi
*Make sure the native build configurations respect the arguments and output directories as specified in the [native build templates](templates)*
### JniLoading
-*JVM sub-projects*
+*Add to sub-projects: JVM*
+
+Enables loading of libraries packaged with `JniPackaging` plugin.
### JniPackaging
-*Native sub-projects*
+*Add to sub-projects: native*
+
+Packages native libraries in main jar, thus enabling easy publshing and distribution.
## Examples
+
+See projects in the `samples` directory for some simple use-case examples. Note that in order to run these, sbt-jni will have to published locally first.
+
+Another, more involved example is a [serial communication library](https://jodersky.github.io/flow).
+
+## Copying
+This project is released under the terms of the 3-clause BSD license. See LICENSE for details.