Skip to content

Commit

Permalink
Allow user to specify legacy or new build system. (BrainiumLLC#50)
Browse files Browse the repository at this point in the history
* Add `use_lagacy_build_system` variable to apple::config::Raw, use it to configure xcode build system

* Disable deprecation diagnostic when using legacy build system

* Properly set deprecation settings

* wrap use_legacy_build_system in an Option

* Update mod.rs
  • Loading branch information
ArthurKValladares committed Nov 15, 2021
1 parent 7d93364 commit 37e6072
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/apple/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ pub struct Config {
app: App,
development_team: String,
project_dir: String,
use_legacy_build_system: bool,
}

impl Config {
Expand Down Expand Up @@ -193,11 +194,11 @@ impl Config {
);
Ok(DEFAULT_PROJECT_DIR.to_owned())
})?;

Ok(Self {
app,
development_team: raw.development_team,
project_dir,
use_legacy_build_system: raw.use_legacy_build_system.unwrap_or(true),
})
}

Expand Down
3 changes: 3 additions & 0 deletions src/apple/config/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ pub struct Raw {
pub ios_features: Option<Vec<String>>,
pub macos_no_default_features: Option<bool>,
pub macos_features: Option<Vec<String>>,
pub use_legacy_build_system: Option<bool>,
}

impl Raw {
Expand All @@ -67,6 +68,7 @@ impl Raw {
ios_features: None,
macos_no_default_features: None,
macos_features: None,
use_legacy_build_system: None,
})
}

Expand Down Expand Up @@ -142,6 +144,7 @@ impl Raw {
ios_features: None,
macos_no_default_features: None,
macos_features: None,
use_legacy_build_system: None,
})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http:https://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
{{#if apple.use-legacy-build-system}}
<key>BuildSystemType</key>
<string>Original</string>
<key>DisableBuildSystemDeprecationDiagnostic</key>
<true/>
{{/if}}
</dict>
</plist>

0 comments on commit 37e6072

Please sign in to comment.