Skip to content

Commit a019ece

Browse files
committed
android: add support for file_paths.xml
1 parent 5291859 commit a019ece

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

packages/cli/src/build/request.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3405,6 +3405,13 @@ impl BuildRequest {
34053405
),
34063406
)?;
34073407

3408+
// Write file_paths.xml, if specificed
3409+
if let Some(file_paths) = self.config.application.android_file_paths.as_deref() {
3410+
let file_path = std::fs::read_to_string(self.package_manifest_dir().join(file_paths))
3411+
.context("Failed to locate requested file_paths.xml")?;
3412+
write(res.join("xml").join("file_paths.xml"), file_path)?;
3413+
};
3414+
34083415
create_dir_all(res.join("drawable"))?;
34093416
write(
34103417
res.join("drawable").join("ic_launcher_background.xml"),

packages/cli/src/config/app.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ pub(crate) struct ApplicationConfig {
4747
#[serde(default)]
4848
pub(crate) android_main_activity: Option<PathBuf>,
4949

50+
/// Use this file for the file_paths.xml associated with the Android app.
51+
/// `dx` will merge any required settings into this file required to build the app
52+
#[serde(default)]
53+
pub(crate) android_file_paths: Option<PathBuf>,
54+
5055
/// Specified minimum sdk version for gradle to build the app with.
5156
#[serde(default)]
5257
pub(crate) android_min_sdk_version: Option<u32>,

packages/cli/src/config/dioxus_config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ impl Default for DioxusConfig {
2929
ios_info_plist: None,
3030
android_manifest: None,
3131
android_main_activity: None,
32+
android_file_paths: None,
3233
android_min_sdk_version: None,
3334
macos_info_plist: None,
3435
ios_entitlements: None,

0 commit comments

Comments
 (0)