-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c62ed8
commit dd1d07f
Showing
9 changed files
with
70 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,20 @@ | ||
use anyhow::Result; | ||
use crux_core::{bridge::Request, typegen::TypeGen}; | ||
use crux_http::protocol::{HttpRequest, HttpResponse}; | ||
use shared::{EffectFfi, Event, Payment, PaymentStatus, Receipt, ReceiptStatus, ViewModel}; | ||
use crux_core::typegen::TypeGen; | ||
use shared::{App, PaymentStatus, ReceiptStatus}; | ||
use std::path::PathBuf; | ||
|
||
fn main() { | ||
fn main() -> anyhow::Result<()> { | ||
println!("cargo:rerun-if-changed=../shared"); | ||
|
||
let mut gen = TypeGen::new(); | ||
|
||
register_types(&mut gen).expect("type registration failed"); | ||
gen.register_app::<App>()?; | ||
|
||
let output_root = PathBuf::from("./generated"); | ||
|
||
gen.swift("SharedTypes", output_root.join("swift")) | ||
.expect("swift type gen failed"); | ||
} | ||
|
||
fn register_types(gen: &mut TypeGen) -> Result<()> { | ||
gen.register_type::<Request<EffectFfi>>()?; | ||
|
||
gen.register_type::<EffectFfi>()?; | ||
gen.register_type::<HttpRequest>()?; | ||
|
||
gen.register_type::<Event>()?; | ||
gen.register_type::<HttpResponse>()?; | ||
|
||
gen.register_type::<ViewModel>()?; | ||
gen.register_type::<Payment>()?; | ||
gen.register_type::<PaymentStatus>()?; | ||
gen.register_type::<Receipt>()?; | ||
gen.register_type::<ReceiptStatus>()?; | ||
|
||
let output_root = PathBuf::from("./generated"); | ||
|
||
gen.swift("SharedTypes", output_root.join("swift"))?; | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters