Skip to content

Commit 23d39d6

Browse files
authored
Feature/explicit jni target (#89)
* fix lints. make the jni target explicit * bump to 0.3.0 * remove old dependency ci step * fix lint
1 parent 9acd745 commit 23d39d6

File tree

19 files changed

+75
-115
lines changed

19 files changed

+75
-115
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,6 @@ on:
55
- main
66
pull_request:
77
jobs:
8-
# Check dependencies
9-
dependencies:
10-
runs-on: ubuntu-latest
11-
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v2
14-
with:
15-
path: oo-bindgen
16-
- name: Checkout complicense
17-
uses: actions/checkout@v2
18-
with:
19-
repository: stepfunc/complicense
20-
path: complicense
21-
- name: Install Rust
22-
uses: actions-rs/toolchain@v1
23-
with:
24-
profile: minimal
25-
toolchain: stable
26-
override: true
27-
- name: Caching
28-
uses: Swatinem/rust-cache@v1
29-
- name: Install cargo-license
30-
uses: actions-rs/cargo@v1
31-
with:
32-
command: install
33-
args: cargo-license
34-
- name: Generate dependencies.json
35-
working-directory: oo-bindgen/oo-bindgen
36-
run: cargo-license --avoid-dev-deps --avoid-build-deps -j > ../dependencies.json
37-
- name: Generate dependencies.txt
38-
working-directory: complicense
39-
run: cargo run -- --import ../oo-bindgen/dependencies.json --config ../oo-bindgen/deps-config.json --token ${{ github.token }} > ../oo-bindgen/dependencies.txt
40-
- name: Upload dependencies info
41-
uses: actions/upload-artifact@v2
42-
with:
43-
name: dependencies
44-
path: |
45-
oo-bindgen/dependencies.json
46-
oo-bindgen/dependencies.txt
478
# Run the unit tests on Windows, Linux, and MacOS
489
test:
4910
strategy:
@@ -321,7 +282,7 @@ jobs:
321282
path: tests/bindings/c/generated
322283
# Package all the generated bindings
323284
packaging:
324-
needs: [dependencies, documentation, bindings-windows, bindings-macos, cross]
285+
needs: [documentation, bindings-windows, bindings-macos, cross]
325286
runs-on: ubuntu-latest
326287
steps:
327288
- name: Checkout
@@ -334,10 +295,6 @@ jobs:
334295
override: true
335296
- name: Caching
336297
uses: Swatinem/rust-cache@v1
337-
- name: Download dependencies
338-
uses: actions/download-artifact@v2
339-
with:
340-
name: dependencies
341298
- name: Download compiled FFI
342299
uses: actions/download-artifact@v2
343300
with:
@@ -347,7 +304,7 @@ jobs:
347304
uses: actions-rs/cargo@v1
348305
with:
349306
command: run
350-
args: --bin foo-bindings -- --package ./ffi-modules -f dependencies.txt
307+
args: --bin foo-bindings -- --package ./ffi-modules
351308
- name: Upload .NET bindings
352309
uses: actions/upload-artifact@v2
353310
with:

Cargo.lock

Lines changed: 47 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ci-script/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ci-script"
3-
version = "0.2.1"
3+
version = "0.3.0"
44
authors = ["Émile Grégoire <[email protected]>"]
55
edition = "2021"
66

ci-script/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ fn ffi_path() -> PathBuf {
140140
pub struct BindingBuilderSettings {
141141
/// FFI target name (as specified in with `cargo build -p <...>`)
142142
pub ffi_target_name: &'static str,
143+
/// JNI target name (as specified in with `cargo build -p <...>`)
144+
pub jni_target_name: &'static str,
143145
/// Compiled FFI name (usually the same as `ffi_target_name`, but with hyphens replaced by underscores)
144146
pub ffi_name: &'static str,
145147
/// Path to the FFI target
@@ -421,9 +423,7 @@ impl BindingBuilder for JavaBindingBuilder {
421423
if !is_packaging {
422424
let mut cmd = Command::new("cargo");
423425

424-
let java_target = format!("{}_java", self.settings.ffi_name);
425-
426-
cmd.args(&["build", "-p", &java_target]);
426+
cmd.args(&["build", "-p", self.settings.jni_target_name]);
427427

428428
if env!("PROFILE") == "release" {
429429
cmd.arg("--release");

generators/c-oo-bindgen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "c-oo-bindgen"
3-
version = "0.2.1"
3+
version = "0.3.0"
44
authors = ["Émile Grégoire <[email protected]>"]
55
edition = "2021"
66

generators/dotnet-oo-bindgen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dotnet-oo-bindgen"
3-
version = "0.2.1"
3+
version = "0.3.0"
44
authors = ["Émile Grégoire <[email protected]>"]
55
edition = "2021"
66

generators/java-oo-bindgen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "java-oo-bindgen"
3-
version = "0.2.1"
3+
version = "0.3.0"
44
authors = ["Émile Grégoire <[email protected]>"]
55
edition = "2021"
66

generators/rust-oo-bindgen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rust-oo-bindgen"
3-
version = "0.2.1"
3+
version = "0.3.0"
44
authors = ["Émile Grégoire <[email protected]>"]
55
edition = "2021"
66

0 commit comments

Comments
 (0)