This commit is contained in:
Evan Almloff committed 2022-06-16 13:20:41 -05:00
commit 11d045deeb
11 files changed
+361 -18

No files matched your search

+24
View File
@@ -115,6 +115,9 @@ pub struct CrateConfig {
pub dioxus_config: DioxusConfig,
pub release: bool,
pub hot_reload: bool,
pub verbose: bool,
pub custom_profile: Option<String>,
pub features: Option<Vec<String>>,
}
#[derive(Debug, Clone)]
@@ -164,6 +167,9 @@ impl CrateConfig {
let release = false;
let hot_reload = false;
let verbose = false;
let custom_profile = None;
let features = None;
Ok(Self {
out_dir,
@@ -176,6 +182,9 @@ impl CrateConfig {
release,
dioxus_config,
hot_reload,
custom_profile,
features,
verbose,
})
}
@@ -194,6 +203,21 @@ impl CrateConfig {
self
}
pub fn with_verbose(&mut self, verbose: bool) -> &mut Self {
self.verbose = verbose;
self
}
pub fn set_profile(&mut self, profile: String) -> &mut Self {
self.custom_profile = Some(profile);
self
}
pub fn set_features(&mut self, features: Vec<String>) -> &mut Self {
self.features = Some(features);
self
}
// pub fn with_build_options(&mut self, options: &BuildOptions) {
// if let Some(name) = &options.example {
// self.as_example(name.clone());