Skip to content

Commit

Permalink
Add jni feature
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyasm-dev committed Jul 25, 2023
1 parent 49618bf commit f85ed91
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
[package]
name = "jnat"
version = "0.2.2"
version = "0.2.3"
edition = "2021"
license = "MIT"
description = "A wrapper around the jni crate"
repository = "https://github.com/shreyasm-dev/jnat/"
readme = "README.md"
categories = ["api-bindings"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
jni = "0.21.1"

Expand All @@ -22,3 +20,7 @@ harness = false
inventory = "0.3.11"
log = "0.4.19"
pretty_env_logger = "0.5.0"

[features]
default = ["jni"]
jni = []
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,7 @@ public class HelloWorld {
```

Compile the java file with `javac -h . HelloWorld.java`. Then, run `java -Djava.library.path=path/to/target/debug HelloWorld`. You should see `Hello, world!` printed to the console.

## Notes

- Jnat re-exports jni by default. If you want to use a different version of jni, you can disable either the default features or the `jni` feature.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pub mod env;
pub mod signature;

#[cfg(feature = "jni")]
pub use jni;

0 comments on commit f85ed91

Please sign in to comment.