Skip to content

Commit

Permalink
remove all default members from workspace
Browse files Browse the repository at this point in the history
commands like `cargo test`, `cargo clippy` or `cargo check` now require
the `--all` or `--package` flags to choose which workspace members they
should run for.
this prevents the mobile apps from building node-mimimi
  • Loading branch information
ganthern committed Jan 30, 2025
1 parent 5abab26 commit 926eb4f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
types: [ opened, synchronize, edited ]
paths:
- 'tuta-sdk/**'
- '.github/workflows/tuta-sdk-test.yml'
- 'packages/node-mimimi/**'
- '.github/workflows/rust-test.yml'
push:
branches:
- dev-*
Expand Down Expand Up @@ -35,9 +36,9 @@ jobs:
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
- uses: ./.github/shared/setup-rust
- name: sdk format
- name: rust format
run: cargo fmt --check
- name: sdk warning check with clippy
run: cargo clippy --no-deps -- -Dwarnings # -Dwarnings changes warnings to errors so that the check fails
- name: sdk tests
run: cargo test
- name: rust warning check with clippy
run: cargo clippy --all --no-deps -- -Dwarnings # -Dwarnings changes warnings to errors so that the check fails
- name: rust tests
run: cargo test --all
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ members = [
"tuta-sdk/rust/uniffi-bindgen",
]

# in most cases, we don't want to build everything.
# this requires passing --all or --package <package-name> to
# cargo for almost anything
default-members = []

[workspace.dependencies]
thiserror = { version = "2.0" }
base64 = { version = "0.22.1" }
Expand Down
16 changes: 15 additions & 1 deletion tuta-sdk/android/sdk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ dependencies {
}

cargo {
extraCargoBuildArguments = listOf("--package", "tuta-sdk")
module = "../../rust"
libname = "tutasdk"
prebuiltToolchains = true
Expand All @@ -114,7 +115,20 @@ tasks.register("generateBinding") {
exec {
this.workingDir("../../rust")
this.executable("cargo")
this.args("run", "--bin", "uniffi-bindgen", "generate", "--library", "${layout.buildDirectory.asFile.get()}/rustJniLibs/android/${dir}/libtutasdk.so", "--language", "kotlin", "--out-dir", "${layout.buildDirectory.asFile.get()}/generated-sources/tuta-sdk")
this.args(
"run",
"--package",
"uniffi-bindgen",
"--bin",
"uniffi-bindgen",
"generate",
"--library",
"${layout.buildDirectory.asFile.get()}/rustJniLibs/android/${dir}/libtutasdk.so",
"--language",
"kotlin",
"--out-dir",
"${layout.buildDirectory.asFile.get()}/generated-sources/tuta-sdk"
)
}
}
}
Expand Down

0 comments on commit 926eb4f

Please sign in to comment.