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

[#30] Complete the script to generate the whole KMM project #47

Merged

Conversation

luongvo
Copy link
Member

@luongvo luongvo commented Nov 1, 2023

What happened 👀

  • Switch the android submodule to the develop-koin branch.
  • Fix: generate the Android app module with the entered bundle id, not always to co.nimblehq.kmm.template.
  • Create a script to generate the shared module.
  • Move make_android and make_ios scripts to the scripts folder.
  • Customize the output folder to the project_name.
  • Update README instructions.

Insight 📝

  • To generate the shared module with the coresponding package name & project name, clone & adjust the Android Templates's kscript to generate only the shared module.
  • To customize the output folder, replace all sample folder name with $project_name.

Proof Of Work 📹

I temporarily switched to generate the sample project with a custom package name as co.nimblehq.kmm.sample to demonstrate that the script can now generate the whole KMM project with entered inputs ✅

  • Please verify through this commit 16a34a6.

We will switch it back to co.nimblehq.kmm.template after having enough approvals.

  • The script now is able to generated the new project to a custom folder as project_name, not always to the sample folder 🎉 For example, running ./make.sh --bundle-id co.nimblehq.kmm.sample --bundle-id-staging co.nimblehq.kmm.sample.staging --project-name sample2 --ios-version 14.0 will generate a new project at sample2 folder.
Pasted_Image_02_11_2023__00_42

@luongvo luongvo added this to the 0.3.0 milestone Nov 1, 2023
@luongvo luongvo self-assigned this Nov 1, 2023
@luongvo luongvo force-pushed the feature/30-complete-the-script-to-generate-new-kmm-project branch from 824a7f3 to d66d1dd Compare November 1, 2023 09:40
@luongvo luongvo force-pushed the feature/30-complete-the-script-to-generate-new-kmm-project branch from d66d1dd to 4d1848f Compare November 1, 2023 09:41
Copy link

github-actions bot commented Nov 1, 2023

23 Warnings
⚠️ Big PR
⚠️ Uh oh! ApiClient.kt is under 95% coverage!
⚠️ Uh oh! ApiException.kt is under 95% coverage!
⚠️ Uh oh! AppDestination.kt is under 95% coverage!
⚠️ Uh oh! AppNavigation.kt is under 95% coverage!
⚠️ Uh oh! AppStyles.kt is under 95% coverage!
⚠️ Uh oh! BaseViewModel.kt is under 95% coverage!
⚠️ Uh oh! DispatchersProviderImpl.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! HttpRequestBuilderExtension.kt is under 95% coverage!
⚠️ Uh oh! RemoteDataSource.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/sample/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/sample/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/sample/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/sample/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/sample/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/sample/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/sample/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
ApiClient.kt 0.00%
ApiException.kt 0.00%
AppColors.kt 98.11%
AppDestination.kt 83.87%
AppDimensions.kt 100.00%
AppNavigation.kt 52.63%
AppShapes.kt 100.00%
AppStyles.kt 0.00%
AppTypography.kt 100.00%
BaseViewModel.kt 73.91%
ContextExt.kt 100.00%
DispatchersProviderImpl.kt 0.00%
ErrorMapping.kt 88.00%
FlowExt.kt 76.19%
Greeting.kt 100.00%
HomeScreen.kt 64.16%
HomeViewModel.kt 100.00%
HttpRequestBuilderExtension.kt 0.00%
MainActivity.kt 100.00%
MainApplication.kt 100.00%
Model.kt 100.00%
Platform.android.kt 100.00%
RemoteDataSource.kt 0.00%
RepositoryImpl.kt 100.00%
Response.kt 100.00%
ResponseMapping.kt 100.00%
Theme.kt 46.09%
UiModel.kt 84.21%
UseCase.kt 100.00%

Modified Files Not Found In Coverage Report:

.gitmodules
AppModule.kt
BaseScreenTest.kt
Constant.swift
CoroutineTestRule.kt
DebugProduction.xcconfig
DebugStaging.xcconfig
DispatchersProvider.kt
Fake.kt
Gemfile.lock
HomeScreenTest.kt
HomeViewModelTest.kt
Koin.kt
MockUtil.kt
Platform.ios.kt
Platform.kt
PlatformModule.kt
PlatformModule.kt
PlatformModule.kt
Podfile.lock
README.md
README.md
ReleaseProduction.xcconfig
ReleaseStaging.xcconfig
RemoteModule.kt
Repository.kt
RepositoryModule.kt
RepositoryTest.kt
ResponseMappingTest.kt
TypeAlias.kt
UseCaseModule.kt
UseCaseTest.kt
ViewModelModule.kt
android
androidTest.kt
build.gradle.kts
build.gradle.kts
buildKonfig.properties
buildKonfig.properties.sample
commonTest.kt
iosTest.kt
make.sh
make_android.sh
make_ios.sh
make_shared.kts
project.pbxproj
settings.gradle.kts
test.yml
test.yml

Codebase cunningly covered by count Shroud 🧛

Generated by 🚫 Danger

Copy link

github-actions bot commented Nov 1, 2023

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

SwiftFormat found issues:

File Rules
fastlane/Constants/Constant.swift:122:1 warning: (trailingSpace) Remove trailing space at end of a line.
fastlane/Constants/Constant.swift:129:1 warning: (trailingSpace) Remove trailing space at end of a line.
fastlane/Constants/Constant.swift:145:1 warning: (trailingSpace) Remove trailing space at end of a line.
fastlane/Constants/Constant.swift:153:1 warning: (trailingSpace) Remove trailing space at end of a line.
fastlane/Constants/Constant.swift:160:1 warning: (trailingSpace) Remove trailing space at end of a line.
fastlane/Constants/Constant.swift:164:1 warning: (spaceAroundOperators) Add or remove space around operators or delimiters.
fastlane/Constants/Constant.swift:167:1 warning: (trailingSpace) Remove trailing space at end of a line.

Current coverage for sample is 18.25%

No files affecting coverage found


Powered by xcov

Generated by 🚫 Danger

@luongvo luongvo force-pushed the feature/30-complete-the-script-to-generate-new-kmm-project branch 2 times, most recently from 0d7b0ea to 4d1848f Compare November 1, 2023 16:59
@luongvo luongvo marked this pull request as ready for review November 2, 2023 02:12
Copy link
Contributor

@markgravity markgravity 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 Nov 7, 2023

@luongvo luongvo force-pushed the feature/30-complete-the-script-to-generate-new-kmm-project branch from f6cfc5d to f1191bf Compare November 7, 2023 15:51
@luongvo
Copy link
Member Author

luongvo commented Nov 8, 2023

TODO: missing buildKonfig.properties feature/30-complete-the-script-to-generate-new-kmm-project/sample

Fixed in f1191bf

@luongvo luongvo force-pushed the feature/30-complete-the-script-to-generate-new-kmm-project branch from ee74de3 to 3beea1e Compare November 8, 2023 07:51
@phongvhd93 phongvhd93 merged commit 71cbe98 into develop Nov 14, 2023
2 checks passed
@phongvhd93 phongvhd93 deleted the feature/30-complete-the-script-to-generate-new-kmm-project branch November 14, 2023 07:43
luongvo added a commit that referenced this pull request Nov 30, 2023
@luongvo luongvo mentioned this pull request Nov 30, 2023
2 tasks
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.

Build the script to generate the whole KMM project
5 participants