Skip to content

Commit

Permalink
Cleanup build.rs
Browse files Browse the repository at this point in the history
Fix compilation issues on windows
  • Loading branch information
yukibtc committed Dec 23, 2024
1 parent 7cd2084 commit bfd3894
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,12 @@
// Copyright (c) 2023-2024 Rust Nostr Developers
// Distributed under the MIT software license

use std::process::{Command, Stdio};

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

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

if !is_dart_installed() {
panic!("Warning: dart not installed.");
}

if !is_flutter_installed() {
panic!("Warning: flutter not installed.");
}

// Execute code generator with auto-detected config
codegen::generate(
Config::from_config_file("../flutter_rust_bridge.yaml")
Expand All @@ -27,21 +17,3 @@ fn main() {
)
.unwrap();
}

fn is_dart_installed() -> bool {
let output = Command::new("dart")
.arg("--version")
.stdout(Stdio::null())
.stderr(Stdio::null())
.status();
matches!(output, Ok(status) if status.success())
}

fn is_flutter_installed() -> bool {
let output = Command::new("flutter")
.arg("--version")
.stdout(Stdio::null())
.stderr(Stdio::null())
.status();
matches!(output, Ok(status) if status.success())
}

0 comments on commit bfd3894

Please sign in to comment.