Skip to content

Commit

Permalink
Feature/explicit jni target (#89)
Browse files Browse the repository at this point in the history
* fix lints. make the jni target explicit

* bump to 0.3.0

* remove old dependency ci step

* fix lint
  • Loading branch information
jadamcrain authored Aug 16, 2022
1 parent 9acd745 commit 23d39d6
Show file tree
Hide file tree
Showing 19 changed files with 75 additions and 115 deletions.
47 changes: 2 additions & 45 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,6 @@ on:
- main
pull_request:
jobs:
# Check dependencies
dependencies:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: oo-bindgen
- name: Checkout complicense
uses: actions/checkout@v2
with:
repository: stepfunc/complicense
path: complicense
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Caching
uses: Swatinem/rust-cache@v1
- name: Install cargo-license
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-license
- name: Generate dependencies.json
working-directory: oo-bindgen/oo-bindgen
run: cargo-license --avoid-dev-deps --avoid-build-deps -j > ../dependencies.json
- name: Generate dependencies.txt
working-directory: complicense
run: cargo run -- --import ../oo-bindgen/dependencies.json --config ../oo-bindgen/deps-config.json --token ${{ github.token }} > ../oo-bindgen/dependencies.txt
- name: Upload dependencies info
uses: actions/upload-artifact@v2
with:
name: dependencies
path: |
oo-bindgen/dependencies.json
oo-bindgen/dependencies.txt
# Run the unit tests on Windows, Linux, and MacOS
test:
strategy:
Expand Down Expand Up @@ -321,7 +282,7 @@ jobs:
path: tests/bindings/c/generated
# Package all the generated bindings
packaging:
needs: [dependencies, documentation, bindings-windows, bindings-macos, cross]
needs: [documentation, bindings-windows, bindings-macos, cross]
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -334,10 +295,6 @@ jobs:
override: true
- name: Caching
uses: Swatinem/rust-cache@v1
- name: Download dependencies
uses: actions/download-artifact@v2
with:
name: dependencies
- name: Download compiled FFI
uses: actions/download-artifact@v2
with:
Expand All @@ -347,7 +304,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: run
args: --bin foo-bindings -- --package ./ffi-modules -f dependencies.txt
args: --bin foo-bindings -- --package ./ffi-modules
- name: Upload .NET bindings
uses: actions/upload-artifact@v2
with:
Expand Down
93 changes: 47 additions & 46 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ci-script/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ci-script"
version = "0.2.1"
version = "0.3.0"
authors = ["Émile Grégoire <emile@stepfunc.io>"]
edition = "2021"

Expand Down
6 changes: 3 additions & 3 deletions ci-script/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ fn ffi_path() -> PathBuf {
pub struct BindingBuilderSettings {
/// FFI target name (as specified in with `cargo build -p <...>`)
pub ffi_target_name: &'static str,
/// JNI target name (as specified in with `cargo build -p <...>`)
pub jni_target_name: &'static str,
/// Compiled FFI name (usually the same as `ffi_target_name`, but with hyphens replaced by underscores)
pub ffi_name: &'static str,
/// Path to the FFI target
Expand Down Expand Up @@ -421,9 +423,7 @@ impl BindingBuilder for JavaBindingBuilder {
if !is_packaging {
let mut cmd = Command::new("cargo");

let java_target = format!("{}_java", self.settings.ffi_name);

cmd.args(&["build", "-p", &java_target]);
cmd.args(&["build", "-p", self.settings.jni_target_name]);

if env!("PROFILE") == "release" {
cmd.arg("--release");
Expand Down
2 changes: 1 addition & 1 deletion generators/c-oo-bindgen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "c-oo-bindgen"
version = "0.2.1"
version = "0.3.0"
authors = ["Émile Grégoire <emile@stepfunc.io>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion generators/dotnet-oo-bindgen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dotnet-oo-bindgen"
version = "0.2.1"
version = "0.3.0"
authors = ["Émile Grégoire <emile@stepfunc.io>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion generators/java-oo-bindgen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "java-oo-bindgen"
version = "0.2.1"
version = "0.3.0"
authors = ["Émile Grégoire <emile@stepfunc.io>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion generators/rust-oo-bindgen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rust-oo-bindgen"
version = "0.2.1"
version = "0.3.0"
authors = ["Émile Grégoire <emile@stepfunc.io>"]
edition = "2021"

Expand Down
Loading

0 comments on commit 23d39d6

Please sign in to comment.