forked from openMF/kmp-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Refactored customizer script for improved KMP project customiza…
…tion (openMF#32) This commit refactors the `customizer.sh` script, enhancing its functionality for customizing Kotlin Multiplatform (KMP) projects. Key improvements include: - **Enhanced UI and Feedback:** Added colors, emojis, and formatting for a better user experience, making the script more visually appealing and informative. - **Modular Processing:** Refactored the script into modular functions, improving organization and maintainability. - **Improved Logic:** Streamlined the script's logic for more accurate and reliable project customization. - **New Features:** - Added functions to update package namespace and root project name. - Implemented `print_success`, `print_warning`, `print_info`, and `print_processing` to provide clear feedback. - Introduced a `print_welcome_banner` for a more engaging start. - **Robust Error Handling:** Improved error handling and backup/restore mechanisms, enhancing the script's robustness. - **Module and File Renaming:** Added a function to rename files more accurately. - **Final Summary:** Improved the final summary, providing clearer information on changes made. - Refactor `sync-cmp-dir.sh`, `sync-cmp-dirs.sh` and `sync-dir.sh` scripts for improved KMP project syncs. - Added `ComposeApp` navigation component. - Removed old code and improved documentation. - Updated `cmp-shared/build.gradle.kts` dependencies. - Removed `cmp-shared/src/commonMain/kotlin/cmp/shared/SharedApp.kt` content and update navigation. - Removed `cmp-desktop/src/jvmMain/kotlin/main.kt` content and updated app title. - Updated `.run/cmp-android.run.xml` module name. - **Backup Management:** Added improved file backup and restore functionality, increasing data safety. ```
- Loading branch information
Showing
7 changed files
with
437 additions
and
517 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
482 changes: 241 additions & 241 deletions
482
cmp-android/dependencies/prodReleaseRuntimeClasspath.tree.txt
Large diffs are not rendered by default.
Oops, something went wrong.
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
35 changes: 35 additions & 0 deletions
35
cmp-navigation/src/commonMain/kotlin/cmp/navigation/ComposeApp.kt
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright 2025 Mifos Initiative | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
* | ||
* See See https://github.com/openMF/kmp-project-template/blob/main/LICENSE | ||
*/ | ||
package cmp.navigation | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.navigation.compose.rememberNavController | ||
import cmp.navigation.navigation.RootNavGraph | ||
import org.koin.compose.koinInject | ||
import org.mifos.core.data.utils.NetworkMonitor | ||
import org.mifos.core.data.utils.TimeZoneMonitor | ||
import org.mifos.core.designsystem.theme.MifosTheme | ||
|
||
@Composable | ||
fun ComposeApp( | ||
modifier: Modifier = Modifier, | ||
networkMonitor: NetworkMonitor = koinInject(), | ||
timeZoneMonitor: TimeZoneMonitor = koinInject(), | ||
) { | ||
MifosTheme { | ||
RootNavGraph( | ||
networkMonitor = networkMonitor, | ||
timeZoneMonitor = timeZoneMonitor, | ||
navHostController = rememberNavController(), | ||
modifier = modifier, | ||
) | ||
} | ||
} |
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
Oops, something went wrong.