Skip to content

Commit

Permalink
Update packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
katyo committed Jan 27, 2024
1 parent eef6e57 commit 6344c18
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 50 deletions.
67 changes: 46 additions & 21 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,38 +1,66 @@
[workspace]
members = ["sys", "demo"]
resolver = "2"

[workspace.package]
version = "0.6.0"
keywords = ["oboe", "android", "audio", "aaudio", "opensles"]
authors = ["K. <[email protected]>"]
license = "Apache-2.0"
repository = "https://github.com/katyo/oboe-rs"
homepage = "https://github.com/katyo/oboe-rs"
edition = "2021"

[workspace.dependencies]
num-traits = "0.2"
num-derive = "0.4"
atomic_float = "0.1"
ndk-context = "0.1"
ndk-glue = "0.7"
jni = "0.21"
cc = "1"
bindgen = "0.69"
fetch_unroll = "0.3"
glutin = "0.31"
log = "0.4"
android_logger = "0.13"
oboe-sys.path = "sys"
oboe.path = ""

[workspace.dependencies.ndk]
version = "0.8"
default-features = false

[package]
name = "oboe"
version = "0.5.0"
version.workspace = true
description = "Safe interface for oboe an android library for low latency audio IO"
categories = ["api-bindings", "multimedia::audio"]
keywords = ["oboe", "android", "audio", "aaudio", "opensles"]
authors = ["K. <[email protected]>"]
license = "Apache-2.0"
keywords.workspace = true
authors.workspace = true
license.workspace = true
readme = "README.md"
repository = "https://github.com/katyo/oboe-rs"
edition = "2018"
repository.workspace = true
homepage.workspace = true
edition.workspace = true
include = ["/src/**/*.rs", "/README.md"]

[badges]
maintenance = { status = "experimental" }

[dependencies]
num-traits = "0.2"
num-derive = "0.4.0"

[dependencies.oboe-sys]
version = "0.5.0"
path = "sys"
num-traits.workspace = true
num-derive.workspace = true
oboe-sys.workspace = true

[dependencies.ndk]
version = "0.8"
workspace = true
optional = true
default-features = false

[dependencies.ndk-context]
version = "0.1"
workspace = true
optional = true

[dependencies.jni]
version = "0.20"
workspace = true
optional = true

[features]
Expand All @@ -52,9 +80,6 @@ targets = [
"x86_64-linux-android",
]

[workspace]
members = ["sys", "demo"]

[profile.release]
opt-level = 3
debug = false
Expand Down
21 changes: 11 additions & 10 deletions demo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
[package]
name = "oboe-demo"
description = "Simple sine-wave playing demo"
version = "0.4.5"
authors = ["K. <[email protected]>"]
edition = "2018"
version.workspace = true
authors.workspace = true
edition.workspace = true
repository.workspace = true
homepage.workspace = true
publish = false

[lib]
crate-type = ["cdylib"]

[dependencies.oboe]
path = ".."
version = "0.5.0"
workspace = true
#features = ["generate-bindings"]
features = ["java-interface"]
#features = ["generate-bindings", "java-interface"]
#features = ["java-interface"]
optional = true

[dependencies.atomic_float]
version = "0.1.0"
workspace = true

[dependencies.ndk-glue]
version = "0.7.0"
workspace = true
features = ["logger"]

[dependencies.android_logger]
version = "0.10"
workspace = true

[dependencies.log]
version = "0.4"
workspace = true

[dependencies.glutin]
version = "0.29"
workspace = true

[features]
default = ["audio"]
Expand Down
14 changes: 7 additions & 7 deletions src/java_interface/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ pub fn call_method_no_args_ret_char_sequence(
.map(String::from)
}

pub fn call_method_string_arg_ret_bool<S: AsRef<str>>(
pub fn call_method_string_arg_ret_bool(
env: &JNIEnv<'_>,
subject: JObject,
name: &str,
arg: S,
arg: impl AsRef<str>,
) -> JResult<bool> {
env.call_method(
subject,
Expand All @@ -107,12 +107,12 @@ pub fn call_method_string_arg_ret_bool<S: AsRef<str>>(
.z()
}

pub fn call_method_string_arg_ret_string<'a: 'b, 'b, S: AsRef<str>>(
env: &'b JNIEnv<'a>,
pub fn call_method_string_arg_ret_string<'a: 'b, 'b>(
env: &JNIEnv<'a>,
subject: JObject<'a>,
name: &str,
arg: S,
) -> JResult<JavaStr<'a, 'b>> {
arg: impl AsRef<str>,
) -> JResult<JavaStr<'a, 'b, 'a>> {
env.get_string(
env.call_method(
subject,
Expand Down Expand Up @@ -166,7 +166,7 @@ pub fn get_property<'a: 'b, 'b>(
env: &'b JNIEnv<'a>,
subject: JObject<'a>,
name: &str,
) -> JResult<JavaStr<'a, 'b>> {
) -> JResult<JavaStr<'a, 'b, 'a>> {
call_method_string_arg_ret_string(env, subject, "getProperty", name)
}

Expand Down
22 changes: 10 additions & 12 deletions sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
[package]
name = "oboe-sys"
version = "0.5.0"
version.workspace = true
description = "Unsafe bindings for oboe an android library for low latency audio IO"
categories = ["external-ffi-bindings", "multimedia::audio"]
keywords = ["oboe", "android", "audio", "aaudio", "opensles"]
authors = ["K. <[email protected]>"]
license = "Apache-2.0"
keywords.workspace = true
authors.workspace = true
license.workspace = true
readme = "README.md"
repository = "https://github.com/katyo/oboe-rs"
edition = "2018"
repository.workspace = true
homepage.workspace = true
edition.workspace = true
include = ["/build.rs", "/src/*.rs", "/oboe/include", "/oboe/src", "/oboe-ext/include", "/oboe-ext/src", "/README.md"]

[badges]
maintenance = { status = "experimental" }

[build-dependencies.fetch_unroll]
version = "0.3"
workspace = true
optional = true

[build-dependencies.cc]
version = "1.0"
workspace = true
features = ["parallel"]

[build-dependencies.bindgen]
version = "0.63"
workspace = true
optional = true

[features]
Expand Down

0 comments on commit 6344c18

Please sign in to comment.