Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into jni_from_rust_thread
Browse files Browse the repository at this point in the history
  • Loading branch information
EliseChouleur committed Sep 29, 2023
2 parents 233e3a2 + c49ef97 commit 421e771
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 51 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: cargo
directory: /
pull-request-branch-name:
separator: "-"
schedule:
interval: weekly
commit-message:
prefix: ''
labels: []
17 changes: 17 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Dependabot auto-merge
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
20 changes: 3 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,15 @@ env:
CARGO_TERM_COLOR: always

jobs:
build-and-test:
uses: ./.github/workflows/setup_and_test.yml
publish:
name: Publish
runs-on: ubuntu-latest

steps:
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- name: Add $JAVA_HOME to library path
run: |
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JAVA_HOME/lib/server" >> "$GITHUB_ENV"
- name: Checkout sources
uses: actions/checkout@v2

- name: Build
run: cargo build --verbose

- name: Run tests
run: cargo test --verbose
uses: actions/checkout@v4

- name: Publish release
run: cargo publish --token ${CRATES_TOKEN}
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/setup_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Java setup, build and test

on:
workflow_call:

jobs:
tests:
runs-on: ubuntu-latest

steps:
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- name: Add $JAVA_HOME to library path
run: |
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JAVA_HOME/lib/server" >> "$GITHUB_ENV"
- name: Checkout sources
uses: actions/checkout@v4

- name: Build
run: cargo build --verbose

- name: Run tests
run: cargo test --verbose
24 changes: 2 additions & 22 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,8 @@
on: [push, pull_request]
on: push

env:
CARGO_TERM_COLOR: always

jobs:
tests:
name: Run tests
runs-on: ubuntu-latest

steps:
- name: Install JDK
run: |
TEMP_DIR=$(mktemp -d)
wget https://raw.githubusercontent.com/travis-ci/travis-cookbooks/master/cookbooks/travis_jdk/files/install-jdk.sh -P $TEMP_DIR
chmod +x $TEMP_DIR/install-jdk.sh
export JAVA_HOME=$HOME/openjdk11
echo "JAVA_HOME=$HOME/openjdk11" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JAVA_HOME/lib/server" >> "$GITHUB_ENV"
$TEMP_DIR/install-jdk.sh -F 17 --target $JAVA_HOME
- name: Checkout sources
uses: actions/checkout@v2

- name: Build
run: cargo build --verbose

- name: Run tests
run: cargo test --verbose
uses: ./.github/workflows/setup_and_test.yml
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ documentation = "https://docs.rs/robusta/"
[dependencies]
robusta-codegen = { version = "0.2", path = "./robusta-codegen" }
jni = "0.19.0"
paste = "1.0.0"
static_assertions = "1.1.0"
paste = "^1"
static_assertions = "^1"

[dev-dependencies]
native = { path = "./tests/driver/native" }
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ $ cargo build && javac com/example/robusta/HelloWorld.java && RUST_BACKTRACE=ful
You can find an example of Robusta used for Android in `./robusta-android-example`.
To run it, open the project robustaAndroidExample with Android Studio.

Cargo build is automatically run by grable.
Cargo build is automatically run by gradle.

The rust lib.rs is the image of the Java class RobustaAndroidExample.

Expand Down
6 changes: 3 additions & 3 deletions robusta-android-example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name = "robustaandroidexample"
crate-type = ["cdylib"]

[dependencies]
robusta_jni = { path = "../" }
robusta_jni = { path = "../." }
jni = "0.19.0"
android_logger = "0.9"
log = "0.4.8"
android_logger = "^0"
log = "^0"
8 changes: 4 additions & 4 deletions robusta-codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ repository = "https://github.com/giovanniberti/robusta/robusta-codegen"
proc-macro = true

[dependencies]
quote = "1"
quote = "^1"
proc-macro2 = { version = "1.0.21", features = ["span-locations"]}
syn = { version = "1.0", features = ["visit", "fold", "derive"] }
syn = { version = "^1", features = ["visit", "fold", "derive"] }
proc-macro-error = { version = "1", default-features = false }
rand = "0.7.3"
darling = "0.10.2"
rand = "^0"
darling = "^0.14"
Inflector = "0.11.4"
2 changes: 1 addition & 1 deletion robusta-example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ edition = "2018"
crate-type = ["cdylib"]

[dependencies]
robusta_jni = { path = "../" }
robusta_jni = { path = "../." }
2 changes: 1 addition & 1 deletion tests/driver/native/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ crate-type = ["lib", "cdylib"]

[dependencies]
robusta_jni = { path = "../../../", version = "0.2" }
env_logger = "0.8.2"
env_logger = "0.10.0"

0 comments on commit 421e771

Please sign in to comment.