Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#29] 2/2 - Reuse the "android" module from android-templates #32

Merged

Conversation

luongvo
Copy link
Member

@luongvo luongvo commented Aug 17, 2023

What happened 👀

  • Add a Install Kscript step to execute the script from Android Templates.
  • Remove the android module folder and replace it with a submodule of the Android app from Android Templates.
  • Add missing dependencies and plugins to build the new Android module.
  • Update script to build the Android module from Android Templates's script

Insight 📝

  • To skip unnecessary cleaning up & project building when initializing the Android module, remove cleanNewProjectFolder() and buildProjectAndRunTests() callers in scripts/new_project.kts.
  • The KMM has only 1 SHARED module 👉 updated to link the app module with the SHARED, instead of DATA and DOMAIN.
  • The initKoin from KMM is at co.nimblehq.kmm.template.di.initKoin.
  • The KMM's ApiException has no JSON:API integrated yet 👉 updated message getting logic.
  • The KMM has no BASE_API_URL definition 👉 removed.

Proof Of Work 📹

image

@luongvo luongvo self-assigned this Aug 17, 2023
@luongvo luongvo force-pushed the feature/29-reuse-android-module-from-android-templates branch from a1a9584 to aa195d0 Compare August 17, 2023 10:47
@luongvo luongvo force-pushed the feature/29-reuse-android-module-from-android-templates branch 4 times, most recently from d83565e to 0a659b5 Compare August 23, 2023 10:01
@luongvo luongvo force-pushed the feature/29-reuse-android-module-from-android-templates branch from db33787 to bf9aa12 Compare August 25, 2023 07:10
@luongvo luongvo changed the base branch from develop to chore/optimize-test-workflow-to-execute-on-the-sample-project August 25, 2023 14:38
@luongvo luongvo force-pushed the chore/optimize-test-workflow-to-execute-on-the-sample-project branch from 0845d42 to b08ebe6 Compare August 25, 2023 15:09
@luongvo luongvo force-pushed the feature/29-reuse-android-module-from-android-templates branch 3 times, most recently from 66f7ebc to 6f18640 Compare August 25, 2023 15:56
@luongvo luongvo force-pushed the chore/optimize-test-workflow-to-execute-on-the-sample-project branch 8 times, most recently from 87e9ce7 to 6e29f3b Compare August 28, 2023 10:30
@luongvo luongvo force-pushed the feature/29-reuse-android-module-from-android-templates branch 4 times, most recently from 84fa825 to 78b6978 Compare August 28, 2023 16:38
@luongvo luongvo changed the title [#29] Reuse the "android" module from android-templates [#29] 2/2 - Reuse the "android" module from android-templates Aug 29, 2023
@luongvo luongvo changed the base branch from chore/optimize-test-workflow-to-execute-on-the-sample-project to feature/29-prepare-before-applying-android-submodule August 29, 2023 02:49
@luongvo luongvo force-pushed the feature/29-reuse-android-module-from-android-templates branch 2 times, most recently from 3c56d25 to d232c8b Compare August 29, 2023 03:45
@luongvo luongvo force-pushed the feature/29-reuse-android-module-from-android-templates branch from 04bc936 to 7e06831 Compare August 29, 2023 15:16
@github-actions
Copy link

github-actions bot commented Aug 29, 2023

17 Warnings
⚠️ Big PR
⚠️ Uh oh! AppDestination.kt is under 95% coverage!
⚠️ Uh oh! AppNavigation.kt is under 95% coverage!
⚠️ Uh oh! BaseViewModel.kt is under 95% coverage!
⚠️ Uh oh! ErrorMapping.kt is under 95% coverage!
⚠️ Uh oh! FlowExt.kt is under 95% coverage!
⚠️ Uh oh! HomeScreen.kt is under 95% coverage!
⚠️ Uh oh! Theme.kt is under 95% coverage!
⚠️ Uh oh! UiModel.kt is under 95% coverage!
⚠️ Uh oh! Your project is under 80% coverage!
⚠️ android/src/main/java/co/nimblehq/kmm/template/ui/screens/home/HomeScreen.kt#L66 - This expression contains a magic number. Consider defining it to a well named constant.
⚠️ shared/src/androidMain/kotlin/co/nimblehq/kmm/template/Platform.android.kt#L3 - The file name 'Platform.android' does not match the name of the single top-level declaration 'AndroidPlatform'.
⚠️ shared/src/androidUnitTest/kotlin/co/nimblehq/kmm/template/androidTest.kt#L6 - The file name 'androidTest' does not match the name of the single top-level declaration 'AndroidGreetingTest'.
⚠️ shared/src/commonTest/kotlin/co/nimblehq/kmm/template/commonTest.kt#L6 - The file name 'commonTest' does not match the name of the single top-level declaration 'CommonGreetingTest'.
⚠️ shared/src/commonTest/kotlin/co/nimblehq/kmm/template/extensions/ResponseMappingTest.kt#L18 - Exception is a too generic Exception. Prefer throwing specific exceptions that indicate a specific error case.
⚠️ shared/src/iosMain/kotlin/co/nimblehq/kmm/template/Platform.ios.kt#L5 - The file name 'Platform.ios' does not match the name of the single top-level declaration 'IOSPlatform'.
⚠️ shared/src/iosTest/kotlin/co/nimblehq/kmm/template/iosTest.kt#L6 - The file name 'iosTest' does not match the name of the single top-level declaration 'IosGreetingTest'.

Kover report:

🧛 Unit Tests Code Coverage: 59.92%

Coverage of Modified Files:

File Coverage
AppColors.kt 98.11%
AppDestination.kt 83.87%
AppDimensions.kt 100.00%
AppNavigation.kt 52.63%
AppShapes.kt 100.00%
AppTypography.kt 100.00%
BaseViewModel.kt 73.91%
ContextExt.kt 100.00%
ErrorMapping.kt 88.00%
FlowExt.kt 76.19%
HomeScreen.kt 64.16%
HomeViewModel.kt 100.00%
MainActivity.kt 100.00%
MainApplication.kt 100.00%
Theme.kt 46.09%
UiModel.kt 84.21%

Modified Files Not Found In Coverage Report:

.gitignore
.gitmodules
AndroidManifest.xml
AndroidManifest.xml
AppModule.kt
BaseScreenTest.kt
CoroutineTestRule.kt
Dependencies.kt
Dependencies.kt
DispatchersProvider.kt
DispatchersProvider.kt
HomeScreenTest.kt
HomeViewModelTest.kt
MockUtil.kt
Plugins.kt
Plugins.kt
Versions.kt
Versions.kt
ViewModelModule.kt
android
backup_rules.xml
build.gradle.kts
data_extraction_rules.xml
ic_launcher.webp
ic_launcher.webp
ic_launcher.webp
ic_launcher.webp
ic_launcher.webp
ic_launcher.xml
ic_launcher_background.xml
ic_launcher_foreground.xml
ic_launcher_round.webp
ic_launcher_round.webp
ic_launcher_round.webp
ic_launcher_round.webp
ic_launcher_round.webp
ic_launcher_round.xml
make.sh
make_android.sh
network_security_config.xml
network_security_config.xml
proguard-rules.pro
project.pbxproj
robolectric.properties
settings.gradle.kts
settings.gradle.kts
strings.xml
strings.xml
test.yml
test.yml
themes.xml

Codebase cunningly covered by count Shroud 🧛

Generated by 🚫 Danger

@luongvo luongvo added this to the 0.2.0 milestone Aug 29, 2023
@nimblehq nimblehq deleted a comment from bot-nimble Aug 29, 2023
@nimblehq nimblehq deleted a comment from github-actions bot Aug 29, 2023
@github-actions
Copy link

1 Warning
⚠️ This pull request is quite big (1980 lines changed), please consider splitting it into multiple pull requests.

Current coverage for sample is 18.25%

No files affecting coverage found


Powered by xcov

Generated by 🚫 Danger

@@ -0,0 +1,86 @@
#!/bin/sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@luongvo What do you think about using kscript? Under the hood, this templates is more related to kotlin

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@suho This is the first step of reusing the script from android-templates to build the Android app module only. The next step could be building the main script with Kscript by this task #30.

Copy link
Contributor

@kaungkhantsoe kaungkhantsoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest LGTM

@luongvo
Copy link
Member Author

luongvo commented Sep 12, 2023

@kaungkhantsoe @phongvhd93 Can I have your reviews here?

Base automatically changed from feature/29-prepare-before-applying-android-submodule to develop September 12, 2023 07:21
@lydiasama
Copy link
Contributor

It isn't a big deal. Just only optional things. So approve.

@luongvo
Copy link
Member Author

luongvo commented Sep 29, 2023

@phongvhd93 your turn 💁‍♂️

@phongvhd93 phongvhd93 merged commit b8b14cd into develop Oct 2, 2023
@phongvhd93 phongvhd93 deleted the feature/29-reuse-android-module-from-android-templates branch October 2, 2023 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reuse the "android" module from android-templates
6 participants