Skip to content

Commit

Permalink
flutter: use build.rs
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Kishimoto <[email protected]>
  • Loading branch information
yukibtc committed Nov 5, 2024
1 parent da97244 commit 60327e9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
8 changes: 1 addition & 7 deletions bindings/nostr-sdk-flutter/justfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
#!/usr/bin/env just --justfile

init:
cargo install flutter_rust_bridge_codegen
set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]

build:
cd rust && cargo build

generate:
flutter_rust_bridge_codegen generate
19 changes: 19 additions & 0 deletions bindings/nostr-sdk-flutter/rust/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) 2022-2023 Yuki Kishimoto
// Copyright (c) 2023-2024 Rust Nostr Developers
// Distributed under the MIT software license

use lib_flutter_rust_bridge_codegen::codegen;
use lib_flutter_rust_bridge_codegen::codegen::Config;

fn main() {
println!("cargo:rerun-if-changed=src/api");

// Execute code generator with auto-detected config
codegen::generate(
Config::from_config_file("../flutter_rust_bridge.yaml")
.unwrap()
.unwrap(),
Default::default(),
)
.unwrap();
}

0 comments on commit 60327e9

Please sign in to comment.