Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/cli/src/build/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3405,6 +3405,13 @@ impl BuildRequest {
),
)?;

// Write file_paths.xml, if specificed
if let Some(file_paths) = self.config.application.android_file_paths.as_deref() {
let file_path = std::fs::read_to_string(self.package_manifest_dir().join(file_paths))
.context("Failed to locate requested file_paths.xml")?;
write(res.join("xml").join("file_paths.xml"), file_path)?;
};

create_dir_all(res.join("drawable"))?;
write(
res.join("drawable").join("ic_launcher_background.xml"),
Expand Down
5 changes: 5 additions & 0 deletions packages/cli/src/config/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ pub(crate) struct ApplicationConfig {
#[serde(default)]
pub(crate) android_main_activity: Option<PathBuf>,

/// Use this file for the file_paths.xml associated with the Android app.
/// `dx` will merge any required settings into this file required to build the app
#[serde(default)]
pub(crate) android_file_paths: Option<PathBuf>,

/// Specified minimum sdk version for gradle to build the app with.
#[serde(default)]
pub(crate) android_min_sdk_version: Option<u32>,
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/config/dioxus_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ impl Default for DioxusConfig {
ios_info_plist: None,
android_manifest: None,
android_main_activity: None,
android_file_paths: None,
android_min_sdk_version: None,
macos_info_plist: None,
ios_entitlements: None,
Expand Down
4 changes: 3 additions & 1 deletion packages/desktop/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ fn check_gnu() {
&& std::env::var("CARGO_CFG_TARGET_ENV").unwrap() == "gnu"
&& !cfg!(feature = "gnu")
{
println!("cargo:warning=GNU windows targets have some limitations within Wry. Using the MSVC windows toolchain is recommended. If you would like to use continue using GNU, you can read https://github.com/wravery/webview2-rs#cross-compilation and disable this warning by adding the gnu feature to dioxus-desktop in your Cargo.toml")
println!(
"cargo:warning=GNU windows targets have some limitations within Wry. Using the MSVC windows toolchain is recommended. If you would like to use continue using GNU, you can read https://github.com/wravery/webview2-rs#cross-compilation and disable this warning by adding the gnu feature to dioxus-desktop in your Cargo.toml"
)
}

// To prepare for a release, we add extra examples to desktop for doc scraping and copy assets from the workspace to make those examples compile
Expand Down