diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a48526c..31532cc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,7 +47,7 @@ jobs: run: rm -rf sample - name: Generate the new sample project - run: ./make.sh --bundle-id co.nimblehq.kmm.template --bundle-id-staging co.nimblehq.kmm.template.staging --project-name sample --ios-version 14.0 + run: ./make.sh --bundle-id co.nimblehq.kmm.sample --bundle-id-staging co.nimblehq.kmm.sample.staging --project-name sample --ios-version 14.0 - name: Restore the previous ArkanaKeys's keys run: | diff --git a/make_android.sh b/make_android.sh index e809a07..2516e35 100644 --- a/make_android.sh +++ b/make_android.sh @@ -33,25 +33,28 @@ sed -i '' "/ buildProjectAndRunTests()*/d" scripts/new_project.kts kscript scripts/new_project.kts package-name=${bundle_id} app-name=${project_name} template=compose +# Convert bundle_id with dot to packake folder path, e.g., co.nimblehq.kmm.template -> co/nimblehq/kmm/template +package_path="${bundle_id//.//}" + # Correct dependencies sed -i '' 's/Modules.DATA/Modules.SHARED/' sample/app/build.gradle.kts sed -i '' "/implementation(project(Modules.DOMAIN))*/d" sample/app/build.gradle.kts sed -i '' "/kover(project(Modules.DOMAIN))*/d" sample/app/build.gradle.kts # Correct imports -sed -i '' 's/import co.nimblehq.kmm.template.data.di.initKoin/import co.nimblehq.kmm.template.di.initKoin/' sample/app/src/main/java/co/nimblehq/kmm/template/MainApplication.kt +sed -i '' 's/import '$bundle_id'.data.di.initKoin/import '$bundle_id'.di.initKoin/' sample/app/src/main/java/$package_path/MainApplication.kt # Correct error mapping -sed -i '' 's/is ApiException -> error?.message/is ApiException -> message/' sample/app/src/main/java/co/nimblehq/kmm/template/ui/ErrorMapping.kt +sed -i '' 's/is ApiException -> error?.message/is ApiException -> message/' sample/app/src/main/java/$package_path/ui/ErrorMapping.kt # Remove unnecessary definition of BASE_API_URL sed -i '' "/buildConfigField(\"String\", \"BASE_API_URL\"*/d" sample/app/build.gradle.kts -sed -i '' "/import co.nimblehq.kmm.template.BuildConfig*/d" sample/app/src/main/java/co/nimblehq/kmm/template/di/modules/AppModule.kt -sed -i '' "/import co.nimblehq.kmm.template.data.di.modules.BASE_API_URL*/d" sample/app/src/main/java/co/nimblehq/kmm/template/di/modules/AppModule.kt -sed -i '' "/import org.koin.core.qualifier.named*/d" sample/app/src/main/java/co/nimblehq/kmm/template/di/modules/AppModule.kt -sed -i '' "/ single(named(BASE_API_URL)) {\n*/d" sample/app/src/main/java/co/nimblehq/kmm/template/di/modules/AppModule.kt -sed -i '' "/ BuildConfig.BASE_API_URL\n*/d" sample/app/src/main/java/co/nimblehq/kmm/template/di/modules/AppModule.kt -sed -i '' "/ }\n*/d" sample/app/src/main/java/co/nimblehq/kmm/template/di/modules/AppModule.kt +sed -i '' "/import $bundle_id.BuildConfig*/d" sample/app/src/main/java/$package_path/di/modules/AppModule.kt +sed -i '' "/import $bundle_id.data.di.modules.BASE_API_URL*/d" sample/app/src/main/java/$package_path/di/modules/AppModule.kt +sed -i '' "/import org.koin.core.qualifier.named*/d" sample/app/src/main/java/$package_path/di/modules/AppModule.kt +sed -i '' "/ single(named(BASE_API_URL)) {\n*/d" sample/app/src/main/java/$package_path/di/modules/AppModule.kt +sed -i '' "/ BuildConfig.BASE_API_URL\n*/d" sample/app/src/main/java/$package_path/di/modules/AppModule.kt +sed -i '' "/ }\n*/d" sample/app/src/main/java/$package_path/di/modules/AppModule.kt # Overwrite custom files rsync -av ../custom/android/ sample/app/