Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Gate Flutter bridge behind feature

Manav Rathiff2e7e5bf9d5
diff --git a/.github/workflows/rust-cache.yml b/.github/workflows/rust-cache.yml
index 959d149f2a..3de5a5823c 100644
--- a/.github/workflows/rust-cache.yml
+++ b/.github/workflows/rust-cache.yml
@@ -39,7 +39,7 @@ jobs:
run: rustup target add wasm32-unknown-unknown
- name: Build Rust workspace
- run: cargo build --workspace --exclude ensu-tauri --all-targets --all-features --locked
+ run: cargo build --workspace --exclude ensu-tauri --all-targets --locked
working-directory: rust
- name: Build WASM Rust target
@@ -50,10 +50,6 @@ jobs:
run: cargo codegen native
working-directory: rust
- - name: Generate Flutter bindings
- run: cargo codegen frb
- working-directory: rust
-
- name: Build Ensu Android Rust libraries
run: ./gradlew :rust:buildRustJniDebug
working-directory: mobile/native/android/apps/ensu
@@ -95,7 +91,7 @@ jobs:
run: mkdir -p web/apps/ensu/out
- name: Build Rust workspace
- run: cargo build --workspace --all-targets --all-features --locked
+ run: cargo build --workspace --all-targets --locked
working-directory: rust
- name: Save Rust cache
diff --git a/.github/workflows/rust-lint.yml b/.github/workflows/rust-lint.yml
index 5fb87047cd..14a0b437ec 100644
--- a/.github/workflows/rust-lint.yml
+++ b/.github/workflows/rust-lint.yml
@@ -43,10 +43,8 @@ jobs:
- name: Prepare Ensu desktop distDir
run: mkdir -p ../web/apps/ensu/out
- - run: cargo codegen frb
-
- run: cargo fmt --all --check
- - run: cargo clippy --workspace --all-targets --all-features --locked
+ - run: cargo clippy --workspace --all-targets --locked
- run: cargo test --workspace --locked
diff --git a/rust/bindings/frb/ente-rust/Cargo.toml b/rust/bindings/frb/ente-rust/Cargo.toml
index 1291f34283..27a0be4895 100644
--- a/rust/bindings/frb/ente-rust/Cargo.toml
+++ b/rust/bindings/frb/ente-rust/Cargo.toml
@@ -11,6 +11,10 @@ flutter_rust_bridge = "=2.12.0"
ente-core = { path = "../../../crates/core" }
ente-contacts = { path = "../../../crates/contacts" }
+[features]
+default = []
+flutter = []
+
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(frb_expand)'] }
missing_docs = "warn"
diff --git a/rust/bindings/frb/ente-rust/cargokit.yaml b/rust/bindings/frb/ente-rust/cargokit.yaml
new file mode 100644
index 0000000000..56a90aa824
--- /dev/null
+++ b/rust/bindings/frb/ente-rust/cargokit.yaml
@@ -0,0 +1,7 @@
+cargo:
+ debug:
+ extra_flags: ["--features", "flutter"]
+ profile:
+ extra_flags: ["--features", "flutter"]
+ release:
+ extra_flags: ["--features", "flutter"]
diff --git a/rust/bindings/frb/ente-rust/src/lib.rs b/rust/bindings/frb/ente-rust/src/lib.rs
index fe77e8251d..4667607e90 100644
--- a/rust/bindings/frb/ente-rust/src/lib.rs
+++ b/rust/bindings/frb/ente-rust/src/lib.rs
@@ -1,4 +1,6 @@
//! Flutter Rust Bridge bindings for Ente mobile apps.
pub mod api;
+
+#[cfg(feature = "flutter")]
mod frb_generated;
diff --git a/rust/bindings/frb/photos/Cargo.toml b/rust/bindings/frb/photos/Cargo.toml
index 6fac7d5433..2c2131fbdb 100644
--- a/rust/bindings/frb/photos/Cargo.toml
+++ b/rust/bindings/frb/photos/Cargo.toml
@@ -16,3 +16,4 @@ unexpected_cfgs = { level = "warn", check-cfg = ['cfg(frb_expand)'] }
[features]
default = []
+flutter = []
diff --git a/rust/bindings/frb/photos/cargokit.yaml b/rust/bindings/frb/photos/cargokit.yaml
new file mode 100644
index 0000000000..56a90aa824
--- /dev/null
+++ b/rust/bindings/frb/photos/cargokit.yaml
@@ -0,0 +1,7 @@
+cargo:
+ debug:
+ extra_flags: ["--features", "flutter"]
+ profile:
+ extra_flags: ["--features", "flutter"]
+ release:
+ extra_flags: ["--features", "flutter"]
diff --git a/rust/bindings/frb/photos/src/lib.rs b/rust/bindings/frb/photos/src/lib.rs
index cbb071f8bf..e5d8b844dd 100644
--- a/rust/bindings/frb/photos/src/lib.rs
+++ b/rust/bindings/frb/photos/src/lib.rs
@@ -1,2 +1,4 @@
pub mod api;
+
+#[cfg(feature = "flutter")]
mod frb_generated;