diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..d53121a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,2 @@ +[*.{kt,kts}] +twitter_compose_allowed_composition_locals = LocalPraxisCloneColor diff --git a/.github/workflows/androidworkflow.yaml b/.github/workflows/androidworkflow.yaml new file mode 100644 index 0000000..126a59b --- /dev/null +++ b/.github/workflows/androidworkflow.yaml @@ -0,0 +1,90 @@ +name: Build and Deploy +on: + push: + branches: + - master + +jobs: + build_and_deploy_release: + runs-on: ubuntu-latest + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + + steps: + - name: Send CI/CD start message on slack + uses: act10ns/slack@v1 + id: slack_message_start + with: + status: starting + message: Starting to generate Release build for `build number {{ env.GITHUB_RUN_NUMBER }}` on branch `{{env.GITHUB_HEAD_REF}}` + if: always() + + - name: Checkout code + id: checkout_code + uses: actions/checkout@v2 + + - name: Setup JDK 11 + id: setup_jdk + uses: actions/setup-java@v2 + with: + distribution: "zulu" + java-version: 11 + + - name: Decode Keystore + id: decode_keystore + env: + APP_CENTER_SECRET_DEVELOPMENT: ${{ secrets.APP_CENTER_SECRET_DEVELOPMENT }} + run: | + touch ./local.properties + echo APP_CENTER_SECRET_DEVELOPMENT=\"$APP_CENTER_SECRET_DEVELOPMENT\" >> ./local.properties + cat ./local.properties + + - uses: actions/cache@v3 + name: Cache Gradle for quicker builds + id: caching_gradle + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Generate Build + id: generate_build + if: always() + run: ./gradlew assembleRelease --stacktrace --info + + - name: Sign APK + id: sign_app + if: always() + uses: r0adkll/sign-android-release@v1 + with: + releaseDirectory: app/build/outputs/apk/release/ + signingKeyBase64: ${{ secrets.RELEASE_KEYSTORE_BASE64 }} + alias: ${{ secrets.RELEASE_KEY_ALIAS }} + keyStorePassword: ${{ secrets.RELEASE_STORE_PASSWORD }} + keyPassword: ${{ secrets.RELEASE_KEY_PASSWORD }} + + - name: Upload to App Center and distribute + id: upload_to_app_center_and_distribute + if: always() + uses: wzieba/AppCenter-Github-Action@v1 + with: + appName: Mutual-Mobile-Organization/MM-Praxis + token: ${{ secrets.APP_CENTER_TOKEN_SECRET }} + group: Internal + file: ${{ steps.sign_app.outputs.signedReleaseFile }} + notifyTesters: true + debug: true + + - name: Send CI/CD end message on slack + uses: act10ns/slack@v1 + id: slack_message_end + with: + status: ${{ job.status }} + steps: ${{ toJson(steps) }} + if: always() \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index e395799..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Minimal Android CI Workflow - -on: - push: - branches: - - master - -jobs: - test: - name: Run Unit Tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: set up JDK 11 - uses: actions/setup-java@v1 - with: - java-version: 11 - - name: Unit tests - run: bash ./gradlew test --stacktrace - build_apk: - name: Generate APK - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v1 - - name: Setup JDK - uses: actions/setup-java@v1 - with: - java-version: 11 - - name: Build APK - run: bash ./gradlew assembleRelease --stacktrace - - name: Upload APK - uses: actions/upload-artifact@v2 - with: - name: build_release_apk - path: app/build/outputs/apk/release/app-release.apk - retention-days: 2 diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 5f8997f..0553456 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -7,6 +7,7 @@ plugins { id(BuildPlugins.KOTLIN_KAPT) id(BuildPlugins.DAGGER_HILT) id(BuildPlugins.ktLint) + id(BuildPlugins.SECRETS_GRADLE_PLUGIN) } // def preDexEnabled = "true" == System.getProperty("pre-dex", "true") @@ -34,23 +35,6 @@ android { } } - signingConfigs { - - getByName("debug") { - keyAlias = "praxis-debug" - keyPassword = "utherNiC" - storeFile = file("keystore/praxis-debug.jks") - storePassword = "uRgeSCIt" - } - - create("release") { - keyAlias = "praxis-release" - keyPassword = "ITHOmptI" - storeFile = file("keystore/praxis-release.jks") - storePassword = "PoTHatHR" - } - - } buildTypes { getByName("release") { isDebuggable = false @@ -63,7 +47,7 @@ android { getDefaultProguardFile("proguard-android.txt"), "proguard-common.txt", "proguard-specific.txt" ) - signingConfig = signingConfigs.getByName("release") + //signingConfig = signingConfigs.getByName("release") } getByName("debug") { isDebuggable = true @@ -71,6 +55,12 @@ android { applicationIdSuffix = ".debug" signingConfig = signingConfigs.getByName("debug") } + create("benchmark") { + initWith(getByName("release")) + signingConfig = signingConfigs.getByName("debug") + matchingFallbacks += listOf("release") + isDebuggable = false + } } buildFeatures { @@ -131,18 +121,17 @@ dependencies { Lib.Google.list.forEach(::api) Lib.Kotlin.list.forEach(::api) - api(project(":ui-onboarding")) - api(project(":ui-authentication")) - api(project(":navigator")) - api(project(":data")) - api(project(":domain")) - api(project(":common")) - api(project(":commonui")) + api(project(":feature:ui-onboarding")) + api(project(":feature:ui-authentication")) + api(project(":core:navigator")) + api(project(":core:data")) + api(project(":core:domain")) + api(project(":core:common")) + api(project(":feature:commonui")) /*DI*/ api(Lib.Di.hilt) api(Lib.Di.hiltNavigationCompose) - api(Lib.Di.viewmodel) kapt(Lib.Di.hiltCompiler) kapt(Lib.Di.hiltAndroidCompiler) @@ -152,7 +141,12 @@ dependencies { add("kapt", Lib.Room.roomCompiler) testApi(Lib.Room.testing) + //App center analytics + api(Lib.Crash.APP_CENTER_CRASHES) + api(Lib.Crash.APP_CENTER_ANALYSIS) + UnitTesting.list.forEach(::testApi) DevDependencies.debugList.forEach(::debugApi) DevDependencies.list.forEach(::api) + implementation(UnitTesting.PROFILE_INSTALLER) } diff --git a/app/keystore/praxis-debug.jks b/app/keystore/praxis-debug.jks deleted file mode 100644 index fb3c172..0000000 Binary files a/app/keystore/praxis-debug.jks and /dev/null differ diff --git a/app/keystore/praxis-release.jks b/app/keystore/praxis-release.jks deleted file mode 100644 index 043c7fa..0000000 Binary files a/app/keystore/praxis-release.jks and /dev/null differ diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 8aae06c..8261ed8 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -6,14 +6,18 @@ + + - - \ No newline at end of file diff --git a/app/src/main/java/com/mutualmobile/praxis/root/OnboardingActivity.kt b/app/src/main/java/com/mutualmobile/praxis/root/OnboardingActivity.kt index 243107a..f4f8988 100644 --- a/app/src/main/java/com/mutualmobile/praxis/root/OnboardingActivity.kt +++ b/app/src/main/java/com/mutualmobile/praxis/root/OnboardingActivity.kt @@ -9,12 +9,16 @@ import androidx.core.view.WindowCompat import androidx.navigation.compose.NavHost import androidx.navigation.compose.rememberNavController import com.google.accompanist.insets.ProvideWindowInsets -import dagger.hilt.android.AndroidEntryPoint import com.mutualmobile.praxis.navigator.ComposeNavigator import com.mutualmobile.praxis.navigator.PraxisRoute import com.mutualmobile.praxis.uionboarding.nav.onboardingNavigation import com.praxis.feat.authentication.nav.authNavGraph +import dagger.hilt.android.AndroidEntryPoint import javax.inject.Inject +import com.microsoft.appcenter.AppCenter; +import com.microsoft.appcenter.analytics.Analytics; +import com.microsoft.appcenter.crashes.Crashes; +import com.mutualmobile.praxis.BuildConfig @AndroidEntryPoint class OnboardingActivity : AppCompatActivity() { @@ -26,6 +30,11 @@ class OnboardingActivity : AppCompatActivity() { super.onCreate(savedInstanceState) WindowCompat.setDecorFitsSystemWindows(window, false) + AppCenter.start( + application, BuildConfig.APP_CENTER_SECRET_DEVELOPMENT, + Analytics::class.java, Crashes::class.java + ) + installSplashScreen() setContent { val navController = rememberNavController() diff --git a/build.gradle.kts b/build.gradle.kts index 7dd80b6..45c00c7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,8 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + id(BuildPlugins.KOTLINTER) version BuildPlugins.KOTLINTER_PLUGIN_VERSION apply true + id(BuildPlugins.JETBRAINS_KOTLIN_ANDROID) version Lib.Kotlin.KOTLIN_VERSION apply false +} buildscript { repositories { @@ -12,12 +16,17 @@ buildscript { classpath(BuildPlugins.KOTLIN_GRADLE_PLUGIN) classpath(kotlin("serialization", version = Lib.Kotlin.KOTLIN_VERSION)) classpath(BuildPlugins.KTLINT_GRADLE_PLUGIN) - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10") - // NOTE: Do not place your application dependencies here; they belong + classpath(BuildPlugins.TWITTER_COMPOSE_RULES) + classpath(Lib.ThirdParty.SECRETS_GRADLE) + // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } +subprojects { + apply(plugin = BuildPlugins.KOTLINTER) +} + allprojects { repositories { google() @@ -35,4 +44,15 @@ apply(from = teamPropsFile("git-hooks.gradle.kts")) fun teamPropsFile(propsFile: String): File { val teamPropsDir = file("team-props") return File(teamPropsDir, propsFile) +} + +tasks.register("check").configure { + dependsOn("installKotlinterPrePushHook") +} + +kotlinter { + ignoreFailures = false + reporters = arrayOf("checkstyle", "html", "plain") + experimentalRules = true + disabledRules = emptyArray() } \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/AppVersions.kt b/buildSrc/src/main/kotlin/AppVersions.kt index 60b5dae..d38b93b 100644 --- a/buildSrc/src/main/kotlin/AppVersions.kt +++ b/buildSrc/src/main/kotlin/AppVersions.kt @@ -6,8 +6,8 @@ object AppVersions { const val versionCode = versionMajor * 10000 + versionMinor * 100 + versionPatch const val versionName = "$versionMajor.$versionMinor.$versionPatch" - const val COMPILE_SDK = 31 + const val COMPILE_SDK = 33 const val MIN_SDK = 21 - const val TARGET_SDK = 31 + const val TARGET_SDK = 33 const val APPLICATION_ID = "com.mutualmobile.praxis" } \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index 81a3a66..995f4fe 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -1,16 +1,18 @@ /** This file contains versions of all the dependencies used in the module */ object BuildPlugins { - private const val TOOLS_BUILD = "7.1.1" - private const val KT_LINT = "9.2.1" + private const val TOOLS_BUILD = "7.3.1" private const val SAFE_ARGS = "2.3.5" + private const val KT_LINT = "11.0.0" + private const val TWITTER_COMPOSE_RULES_VER = "0.0.22" + const val KOTLINTER_PLUGIN_VERSION = "3.12.0" const val TOOLS_BUILD_GRADLE = "com.android.tools.build:gradle:${TOOLS_BUILD}" const val KTLINT_GRADLE_PLUGIN = "org.jlleitschuh.gradle:ktlint-gradle:${KT_LINT}" const val SAFE_ARGS_GRADLE_PLUGIN = "androidx.navigation:navigation-safe-args-gradle-plugin:${SAFE_ARGS}" - const val DAGGER_HILT_PLUGIN = "com.google.dagger:hilt-android-gradle-plugin:2.38.1" - const val KOTLIN_GRADLE_PLUGIN = "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10" + const val DAGGER_HILT_PLUGIN = "com.google.dagger:hilt-android-gradle-plugin:${Lib.Di.DAGGER_VERSION}" + const val KOTLIN_GRADLE_PLUGIN = "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20" const val ANDROID_APPLICATION_PLUGIN = "com.android.application" const val ANDROID_LIBRARY_PLUGIN = "com.android.library" const val KOTLIN_ANDROID_PLUGIN = "kotlin-android" @@ -19,19 +21,26 @@ object BuildPlugins { const val DAGGER_HILT = "dagger.hilt.android.plugin" const val ktLint = "org.jlleitschuh.gradle.ktlint" const val SAFE_ARGS_KOTLIN = "androidx.navigation.safeargs.kotlin" + const val TWITTER_COMPOSE_RULES = "com.twitter.compose.rules:ktlint:$TWITTER_COMPOSE_RULES_VER" + const val KOTLINTER = "org.jmailen.kotlinter" + const val ANDROID_TEST = "com.android.test" + const val JETBRAINS_KOTLIN_ANDROID = "org.jetbrains.kotlin.android" + const val SECRETS_GRADLE_PLUGIN = + "com.google.android.libraries.mapsplatform.secrets-gradle-plugin" } object Lib { object Kotlin { - const val KOTLIN_VERSION = "1.6.0" - private const val KTX_CORE_VERSION = "1.2.0" + const val KOTLIN_VERSION = "1.7.20" + private const val KTX_CORE_VERSION = "1.9.0" + private const val COROUTINES_VERSION = "1.6.4" const val KT_STD = "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${KOTLIN_VERSION}" private const val KTX_CORE = "androidx.core:core-ktx:${KTX_CORE_VERSION}" private const val DATE_TIME = "org.jetbrains.kotlinx:kotlinx-datetime:0.3.2" - const val COROUTINES = "org.jetbrains.kotlinx:kotlinx-coroutines-core:${KOTLIN_VERSION}" + const val COROUTINES = "org.jetbrains.kotlinx:kotlinx-coroutines-core:${COROUTINES_VERSION}" private const val COROUTINES_ANDROID = - "org.jetbrains.kotlinx:kotlinx-coroutines-android:${KOTLIN_VERSION}" + "org.jetbrains.kotlinx:kotlinx-coroutines-android:${COROUTINES_VERSION}" val list = listOf(KT_STD, KTX_CORE, DATE_TIME, COROUTINES, COROUTINES_ANDROID) } @@ -47,9 +56,9 @@ object Lib { object Androidx { // Compose - const val composeVersion = "1.1.0" - private const val SPLASH_SCREEN_API = "androidx.core:core-splashscreen:1.0.0-beta01" - private const val APP_COMPAT = "androidx.appcompat:appcompat:1.3.0-beta01" + const val composeVersion = "1.3.2" + private const val SPLASH_SCREEN_API = "androidx.core:core-splashscreen:1.0.0" + private const val APP_COMPAT = "androidx.appcompat:appcompat:1.5.1" val list = listOf( APP_COMPAT, @@ -57,13 +66,14 @@ object Lib { ) object Compose { + private const val ACTIVITY_COMPOSE = "androidx.activity:activity-compose:${composeVersion}" private const val CONSTRAINT_LAYOUT_COMPOSE = "androidx.constraintlayout:constraintlayout-compose:1.0.0" private const val COMPOSE_UI = "androidx.compose.ui:ui:${composeVersion}" private const val COMPOSE_LIVEDATA = "androidx.compose.runtime:runtime-livedata:${composeVersion}" - private const val COMPOSE_MATERIAL = "androidx.compose.material:material:${composeVersion}" + private const val COMPOSE_MATERIAL = "androidx.compose.material:material:1.3.1" private const val COMPOSE_TOOLING = "androidx.compose.ui:ui-tooling-preview:${composeVersion}" private const val COMPOSE_DEBUG_TOOLING = "androidx.compose.ui:ui-tooling:${composeVersion}" private const val COMPOSE_NAVIGATION = "androidx.navigation:navigation-compose:2.5.0-alpha01" @@ -83,22 +93,23 @@ object Lib { object Accompanist { - const val insets = "com.google.accompanist:accompanist-insets:0.23.0" - const val pager = "com.google.accompanist:accompanist-pager:0.23.0" - const val pagerIndicators = "com.google.accompanist:accompanist-pager-indicators:0.23.0" + private const val ACCOMPANIST_VERSION = "0.27.0" + const val insets = "com.google.accompanist:accompanist-insets:$ACCOMPANIST_VERSION" + const val pager = "com.google.accompanist:accompanist-pager:$ACCOMPANIST_VERSION" + const val pagerIndicators = "com.google.accompanist:accompanist-pager-indicators:$ACCOMPANIST_VERSION" const val systemuicontroller = - "com.google.accompanist:accompanist-systemuicontroller:0.23.0" + "com.google.accompanist:accompanist-systemuicontroller:$ACCOMPANIST_VERSION" val list = listOf(insets, pager, pagerIndicators, systemuicontroller) } object Di { - private const val DAGGER_VERSION = "2.40.5" + const val DAGGER_VERSION = "2.43" const val hilt = "com.google.dagger:hilt-android:${DAGGER_VERSION}" const val hiltAndroidCompiler = "com.google.dagger:hilt-android-compiler:${DAGGER_VERSION}" const val viewmodel = "androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03" const val hiltCompiler = "androidx.hilt:hilt-compiler:1.0.0" - const val hiltNavigationCompose = "androidx.hilt:hilt-navigation-compose:1.0.0-rc01" + const val hiltNavigationCompose = "androidx.hilt:hilt-navigation-compose:1.0.0" } object Paging { @@ -109,11 +120,11 @@ object Lib { } object Room { - private const val roomVersion = "2.4.1" + private const val roomVersion = "2.4.3" const val roomRuntime = "androidx.room:room-runtime:$roomVersion" const val roomCompiler = "androidx.room:room-compiler:$roomVersion" const val roomKtx = "androidx.room:room-ktx:$roomVersion" - const val roomPaging = "androidx.room:room-paging:2.4.1" + const val roomPaging = "androidx.room:room-paging:$roomVersion" const val testing = "androidx.room:room-testing:$roomVersion" } @@ -126,17 +137,37 @@ object Lib { object ThirdParty { private const val COIL_COMPOSE = "io.coil-kt:coil-compose:1.4.0" + private const val SECRETS_GRADLE_VERSION = "2.0.1" + + const val SECRETS_GRADLE = + "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:$SECRETS_GRADLE_VERSION" val list = listOf(COIL_COMPOSE) } + object Crash { + private const val APP_CENTER_SDK_VERSION = "4.4.5" + const val APP_CENTER_ANALYSIS = "com.microsoft.appcenter:appcenter-analytics:${APP_CENTER_SDK_VERSION}" + const val APP_CENTER_CRASHES = "com.microsoft.appcenter:appcenter-crashes:${APP_CENTER_SDK_VERSION}" + } } object UnitTesting { + private const val ANDROID_JUNIT_VERSION = "1.1.4" + private const val ESPRESSO_VERSION = "3.5.0" + private const val UI_AUTOMATOR_VERSION = "2.2.0" + private const val BENCHMARK_VERSION = "1.2.0-alpha08" + private const val PROFILE_INSTALLER_VERSION = "1.2.1" + const val junit = "junit:junit:4.13.2" const val MOCKK = "io.mockk:mockk:1.10.5" const val coroutineTest = "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.0" const val turbin = "app.cash.turbine:turbine:0.7.0" + const val ESPRESSO = "androidx.test.espresso:espresso-core:$ESPRESSO_VERSION" + const val ANDROID_JUNIT = "androidx.test.ext:junit:$ANDROID_JUNIT_VERSION" + const val UI_AUTOMATOR = "androidx.test.uiautomator:uiautomator:$UI_AUTOMATOR_VERSION" + const val BENCHMARK = "androidx.benchmark:benchmark-macro-junit4:$BENCHMARK_VERSION" + const val PROFILE_INSTALLER = "androidx.profileinstaller:profileinstaller:$PROFILE_INSTALLER_VERSION" val list = listOf(junit, MOCKK, coroutineTest, turbin) } diff --git a/common/.gitignore b/core/common/.gitignore similarity index 100% rename from common/.gitignore rename to core/common/.gitignore diff --git a/common/build.gradle.kts b/core/common/build.gradle.kts similarity index 97% rename from common/build.gradle.kts rename to core/common/build.gradle.kts index e9bdb2f..1deb345 100644 --- a/common/build.gradle.kts +++ b/core/common/build.gradle.kts @@ -43,7 +43,6 @@ dependencies { /*DI*/ implementation(Lib.Di.hilt) implementation(Lib.Di.hiltNavigationCompose) - implementation(Lib.Di.viewmodel) kapt(Lib.Di.hiltCompiler) kapt(Lib.Di.hiltAndroidCompiler) diff --git a/common/consumer-rules.pro b/core/common/consumer-rules.pro similarity index 100% rename from common/consumer-rules.pro rename to core/common/consumer-rules.pro diff --git a/common/proguard-rules.pro b/core/common/proguard-rules.pro similarity index 100% rename from common/proguard-rules.pro rename to core/common/proguard-rules.pro diff --git a/common/src/main/AndroidManifest.xml b/core/common/src/main/AndroidManifest.xml similarity index 100% rename from common/src/main/AndroidManifest.xml rename to core/common/src/main/AndroidManifest.xml diff --git a/common/src/main/java/com/mutualmobile/praxis/extensions/PrimitiveExtensions.kt b/core/common/src/main/java/com/mutualmobile/praxis/extensions/PrimitiveExtensions.kt similarity index 100% rename from common/src/main/java/com/mutualmobile/praxis/extensions/PrimitiveExtensions.kt rename to core/common/src/main/java/com/mutualmobile/praxis/extensions/PrimitiveExtensions.kt diff --git a/common/src/main/java/com/mutualmobile/praxis/extensions/ReactiveExtensions.kt b/core/common/src/main/java/com/mutualmobile/praxis/extensions/ReactiveExtensions.kt similarity index 100% rename from common/src/main/java/com/mutualmobile/praxis/extensions/ReactiveExtensions.kt rename to core/common/src/main/java/com/mutualmobile/praxis/extensions/ReactiveExtensions.kt diff --git a/common/src/main/java/com/mutualmobile/praxis/extensions/ViewExtensions.kt b/core/common/src/main/java/com/mutualmobile/praxis/extensions/ViewExtensions.kt similarity index 100% rename from common/src/main/java/com/mutualmobile/praxis/extensions/ViewExtensions.kt rename to core/common/src/main/java/com/mutualmobile/praxis/extensions/ViewExtensions.kt diff --git a/common/src/main/java/com/mutualmobile/praxis/injection/DispatcherModule.kt b/core/common/src/main/java/com/mutualmobile/praxis/injection/DispatcherModule.kt similarity index 100% rename from common/src/main/java/com/mutualmobile/praxis/injection/DispatcherModule.kt rename to core/common/src/main/java/com/mutualmobile/praxis/injection/DispatcherModule.kt diff --git a/common/src/main/java/com/mutualmobile/praxis/injection/dispatcher/CoroutineDispatcherProvider.kt b/core/common/src/main/java/com/mutualmobile/praxis/injection/dispatcher/CoroutineDispatcherProvider.kt similarity index 100% rename from common/src/main/java/com/mutualmobile/praxis/injection/dispatcher/CoroutineDispatcherProvider.kt rename to core/common/src/main/java/com/mutualmobile/praxis/injection/dispatcher/CoroutineDispatcherProvider.kt diff --git a/common/src/main/java/com/mutualmobile/praxis/injection/dispatcher/RealCoroutineDispatcherProvider.kt b/core/common/src/main/java/com/mutualmobile/praxis/injection/dispatcher/RealCoroutineDispatcherProvider.kt similarity index 100% rename from common/src/main/java/com/mutualmobile/praxis/injection/dispatcher/RealCoroutineDispatcherProvider.kt rename to core/common/src/main/java/com/mutualmobile/praxis/injection/dispatcher/RealCoroutineDispatcherProvider.kt diff --git a/common/src/main/res/values/strings.xml b/core/common/src/main/res/values/strings.xml similarity index 100% rename from common/src/main/res/values/strings.xml rename to core/common/src/main/res/values/strings.xml diff --git a/commonui/.gitignore b/core/data/.gitignore similarity index 100% rename from commonui/.gitignore rename to core/data/.gitignore diff --git a/data/build.gradle.kts b/core/data/build.gradle.kts similarity index 92% rename from data/build.gradle.kts rename to core/data/build.gradle.kts index 00e49bf..783f5e7 100644 --- a/data/build.gradle.kts +++ b/core/data/build.gradle.kts @@ -29,15 +29,14 @@ kapt { } dependencies { - implementation(project(":common")) - implementation(project(":domain")) + implementation(project(":core:common")) + implementation(project(":core:domain")) Lib.Kotlin.list.forEach(::implementation) Lib.Networking.ktorList.forEach(::implementation) /*DI*/ implementation(Lib.Di.hilt) implementation(Lib.Di.hiltNavigationCompose) - implementation(Lib.Di.viewmodel) kapt(Lib.Di.hiltCompiler) kapt(Lib.Di.hiltAndroidCompiler) diff --git a/data/proguard-rules.pro b/core/data/proguard-rules.pro similarity index 100% rename from data/proguard-rules.pro rename to core/data/proguard-rules.pro diff --git a/data/src/androidTest/java/com/mutualmobile/praxis/data/ExampleInstrumentedTest.kt b/core/data/src/androidTest/java/com/mutualmobile/praxis/data/ExampleInstrumentedTest.kt similarity index 100% rename from data/src/androidTest/java/com/mutualmobile/praxis/data/ExampleInstrumentedTest.kt rename to core/data/src/androidTest/java/com/mutualmobile/praxis/data/ExampleInstrumentedTest.kt diff --git a/data/src/main/AndroidManifest.xml b/core/data/src/main/AndroidManifest.xml similarity index 100% rename from data/src/main/AndroidManifest.xml rename to core/data/src/main/AndroidManifest.xml diff --git a/data/src/main/java/com/mutualmobile/praxis/data/AppConstants.kt b/core/data/src/main/java/com/mutualmobile/praxis/data/AppConstants.kt similarity index 100% rename from data/src/main/java/com/mutualmobile/praxis/data/AppConstants.kt rename to core/data/src/main/java/com/mutualmobile/praxis/data/AppConstants.kt diff --git a/data/src/main/java/com/mutualmobile/praxis/data/injection/DataMappersModule.kt b/core/data/src/main/java/com/mutualmobile/praxis/data/injection/DataMappersModule.kt similarity index 100% rename from data/src/main/java/com/mutualmobile/praxis/data/injection/DataMappersModule.kt rename to core/data/src/main/java/com/mutualmobile/praxis/data/injection/DataMappersModule.kt diff --git a/data/src/main/java/com/mutualmobile/praxis/data/injection/DataModule.kt b/core/data/src/main/java/com/mutualmobile/praxis/data/injection/DataModule.kt similarity index 100% rename from data/src/main/java/com/mutualmobile/praxis/data/injection/DataModule.kt rename to core/data/src/main/java/com/mutualmobile/praxis/data/injection/DataModule.kt diff --git a/data/src/main/java/com/mutualmobile/praxis/data/injection/NetworkModule.kt b/core/data/src/main/java/com/mutualmobile/praxis/data/injection/NetworkModule.kt similarity index 100% rename from data/src/main/java/com/mutualmobile/praxis/data/injection/NetworkModule.kt rename to core/data/src/main/java/com/mutualmobile/praxis/data/injection/NetworkModule.kt diff --git a/data/src/main/java/com/mutualmobile/praxis/data/injection/RandomPhotosModule.kt b/core/data/src/main/java/com/mutualmobile/praxis/data/injection/RandomPhotosModule.kt similarity index 100% rename from data/src/main/java/com/mutualmobile/praxis/data/injection/RandomPhotosModule.kt rename to core/data/src/main/java/com/mutualmobile/praxis/data/injection/RandomPhotosModule.kt diff --git a/data/src/main/java/com/mutualmobile/praxis/data/injection/RandomPhotosRepositoryModule.kt b/core/data/src/main/java/com/mutualmobile/praxis/data/injection/RandomPhotosRepositoryModule.kt similarity index 100% rename from data/src/main/java/com/mutualmobile/praxis/data/injection/RandomPhotosRepositoryModule.kt rename to core/data/src/main/java/com/mutualmobile/praxis/data/injection/RandomPhotosRepositoryModule.kt diff --git a/data/src/main/java/com/mutualmobile/praxis/data/injection/RepositoryModule.kt b/core/data/src/main/java/com/mutualmobile/praxis/data/injection/RepositoryModule.kt similarity index 100% rename from data/src/main/java/com/mutualmobile/praxis/data/injection/RepositoryModule.kt rename to core/data/src/main/java/com/mutualmobile/praxis/data/injection/RepositoryModule.kt diff --git a/data/src/main/java/com/mutualmobile/praxis/data/injection/SourcesModule.kt b/core/data/src/main/java/com/mutualmobile/praxis/data/injection/SourcesModule.kt similarity index 100% rename from data/src/main/java/com/mutualmobile/praxis/data/injection/SourcesModule.kt rename to core/data/src/main/java/com/mutualmobile/praxis/data/injection/SourcesModule.kt diff --git a/data/src/main/java/com/mutualmobile/praxis/data/injection/UseCaseModule.kt b/core/data/src/main/java/com/mutualmobile/praxis/data/injection/UseCaseModule.kt similarity index 100% rename from data/src/main/java/com/mutualmobile/praxis/data/injection/UseCaseModule.kt rename to core/data/src/main/java/com/mutualmobile/praxis/data/injection/UseCaseModule.kt diff --git a/data/src/main/java/com/mutualmobile/praxis/data/local/AppDatabase.kt b/core/data/src/main/java/com/mutualmobile/praxis/data/local/AppDatabase.kt similarity index 73% rename from data/src/main/java/com/mutualmobile/praxis/data/local/AppDatabase.kt rename to core/data/src/main/java/com/mutualmobile/praxis/data/local/AppDatabase.kt index 0fb49b5..92b5adc 100644 --- a/data/src/main/java/com/mutualmobile/praxis/data/local/AppDatabase.kt +++ b/core/data/src/main/java/com/mutualmobile/praxis/data/local/AppDatabase.kt @@ -4,6 +4,6 @@ import androidx.room.Database import androidx.room.RoomDatabase import com.mutualmobile.praxis.data.local.model.SampleEntity -@Database(entities = [SampleEntity::class], version = 1) +@Database(entities = [SampleEntity::class], version = 1, exportSchema = false) abstract class AppDatabase : RoomDatabase() diff --git a/data/src/main/java/com/mutualmobile/praxis/data/local/model/SampleEntity.kt b/core/data/src/main/java/com/mutualmobile/praxis/data/local/model/SampleEntity.kt similarity index 100% rename from data/src/main/java/com/mutualmobile/praxis/data/local/model/SampleEntity.kt rename to core/data/src/main/java/com/mutualmobile/praxis/data/local/model/SampleEntity.kt diff --git a/data/src/main/java/com/mutualmobile/praxis/data/mapper/EntityMapper.kt b/core/data/src/main/java/com/mutualmobile/praxis/data/mapper/EntityMapper.kt similarity index 100% rename from data/src/main/java/com/mutualmobile/praxis/data/mapper/EntityMapper.kt rename to core/data/src/main/java/com/mutualmobile/praxis/data/mapper/EntityMapper.kt diff --git a/data/src/main/java/com/mutualmobile/praxis/data/remote/SafeApiCall.kt b/core/data/src/main/java/com/mutualmobile/praxis/data/remote/SafeApiCall.kt similarity index 100% rename from data/src/main/java/com/mutualmobile/praxis/data/remote/SafeApiCall.kt rename to core/data/src/main/java/com/mutualmobile/praxis/data/remote/SafeApiCall.kt diff --git a/data/src/main/java/com/mutualmobile/praxis/data/repositories/PicSumPhotoFetchRepositoryImpl.kt b/core/data/src/main/java/com/mutualmobile/praxis/data/repositories/PicSumPhotoFetchRepositoryImpl.kt similarity index 100% rename from data/src/main/java/com/mutualmobile/praxis/data/repositories/PicSumPhotoFetchRepositoryImpl.kt rename to core/data/src/main/java/com/mutualmobile/praxis/data/repositories/PicSumPhotoFetchRepositoryImpl.kt diff --git a/data/src/main/java/com/mutualmobile/praxis/data/repositories/RandomFileServiceImpl.kt b/core/data/src/main/java/com/mutualmobile/praxis/data/repositories/RandomFileServiceImpl.kt similarity index 100% rename from data/src/main/java/com/mutualmobile/praxis/data/repositories/RandomFileServiceImpl.kt rename to core/data/src/main/java/com/mutualmobile/praxis/data/repositories/RandomFileServiceImpl.kt diff --git a/data/src/test/java/com/mutualmobile/praxis/data/ExampleUnitTest.kt b/core/data/src/test/java/com/mutualmobile/praxis/data/ExampleUnitTest.kt similarity index 100% rename from data/src/test/java/com/mutualmobile/praxis/data/ExampleUnitTest.kt rename to core/data/src/test/java/com/mutualmobile/praxis/data/ExampleUnitTest.kt diff --git a/data/.gitignore b/core/domain/.gitignore similarity index 100% rename from data/.gitignore rename to core/domain/.gitignore diff --git a/domain/build.gradle.kts b/core/domain/build.gradle.kts similarity index 100% rename from domain/build.gradle.kts rename to core/domain/build.gradle.kts diff --git a/domain/src/main/java/com/mutualmobile/praxis/domain/SafeResult.kt b/core/domain/src/main/java/com/mutualmobile/praxis/domain/SafeResult.kt similarity index 100% rename from domain/src/main/java/com/mutualmobile/praxis/domain/SafeResult.kt rename to core/domain/src/main/java/com/mutualmobile/praxis/domain/SafeResult.kt diff --git a/domain/src/main/java/com/mutualmobile/praxis/domain/mappers/DomainModel.kt b/core/domain/src/main/java/com/mutualmobile/praxis/domain/mappers/DomainModel.kt similarity index 100% rename from domain/src/main/java/com/mutualmobile/praxis/domain/mappers/DomainModel.kt rename to core/domain/src/main/java/com/mutualmobile/praxis/domain/mappers/DomainModel.kt diff --git a/domain/src/main/java/com/mutualmobile/praxis/domain/model/StreamingFile.kt b/core/domain/src/main/java/com/mutualmobile/praxis/domain/model/StreamingFile.kt similarity index 100% rename from domain/src/main/java/com/mutualmobile/praxis/domain/model/StreamingFile.kt rename to core/domain/src/main/java/com/mutualmobile/praxis/domain/model/StreamingFile.kt diff --git a/domain/src/main/java/com/mutualmobile/praxis/domain/repositories/PhotoFetchListener.kt b/core/domain/src/main/java/com/mutualmobile/praxis/domain/repositories/PhotoFetchListener.kt similarity index 100% rename from domain/src/main/java/com/mutualmobile/praxis/domain/repositories/PhotoFetchListener.kt rename to core/domain/src/main/java/com/mutualmobile/praxis/domain/repositories/PhotoFetchListener.kt diff --git a/domain/src/main/java/com/mutualmobile/praxis/domain/repositories/PhotoFetchRepository.kt b/core/domain/src/main/java/com/mutualmobile/praxis/domain/repositories/PhotoFetchRepository.kt similarity index 100% rename from domain/src/main/java/com/mutualmobile/praxis/domain/repositories/PhotoFetchRepository.kt rename to core/domain/src/main/java/com/mutualmobile/praxis/domain/repositories/PhotoFetchRepository.kt diff --git a/domain/src/main/java/com/mutualmobile/praxis/domain/repositories/RandomFileService.kt b/core/domain/src/main/java/com/mutualmobile/praxis/domain/repositories/RandomFileService.kt similarity index 100% rename from domain/src/main/java/com/mutualmobile/praxis/domain/repositories/RandomFileService.kt rename to core/domain/src/main/java/com/mutualmobile/praxis/domain/repositories/RandomFileService.kt diff --git a/domain/src/main/java/com/mutualmobile/praxis/domain/usecases/BaseUseCase.kt b/core/domain/src/main/java/com/mutualmobile/praxis/domain/usecases/BaseUseCase.kt similarity index 100% rename from domain/src/main/java/com/mutualmobile/praxis/domain/usecases/BaseUseCase.kt rename to core/domain/src/main/java/com/mutualmobile/praxis/domain/usecases/BaseUseCase.kt diff --git a/domain/src/main/java/com/mutualmobile/praxis/domain/usecases/FetchRandomPhotoUseCase.kt b/core/domain/src/main/java/com/mutualmobile/praxis/domain/usecases/FetchRandomPhotoUseCase.kt similarity index 100% rename from domain/src/main/java/com/mutualmobile/praxis/domain/usecases/FetchRandomPhotoUseCase.kt rename to core/domain/src/main/java/com/mutualmobile/praxis/domain/usecases/FetchRandomPhotoUseCase.kt diff --git a/domain/src/test/java/com/mutualmobile/praxis/domain/ExampleUnitTest.kt b/core/domain/src/test/java/com/mutualmobile/praxis/domain/ExampleUnitTest.kt similarity index 100% rename from domain/src/test/java/com/mutualmobile/praxis/domain/ExampleUnitTest.kt rename to core/domain/src/test/java/com/mutualmobile/praxis/domain/ExampleUnitTest.kt diff --git a/domain/.gitignore b/core/navigator/.gitignore similarity index 100% rename from domain/.gitignore rename to core/navigator/.gitignore diff --git a/navigator/build.gradle.kts b/core/navigator/build.gradle.kts similarity index 97% rename from navigator/build.gradle.kts rename to core/navigator/build.gradle.kts index fe83c7e..7b62d0f 100644 --- a/navigator/build.gradle.kts +++ b/core/navigator/build.gradle.kts @@ -54,7 +54,6 @@ dependencies { /*DI*/ implementation(Lib.Di.hilt) implementation(Lib.Di.hiltNavigationCompose) - implementation(Lib.Di.viewmodel) kapt(Lib.Di.hiltCompiler) kapt(Lib.Di.hiltAndroidCompiler) diff --git a/commonui/consumer-rules.pro b/core/navigator/consumer-rules.pro similarity index 100% rename from commonui/consumer-rules.pro rename to core/navigator/consumer-rules.pro diff --git a/commonui/proguard-rules.pro b/core/navigator/proguard-rules.pro similarity index 100% rename from commonui/proguard-rules.pro rename to core/navigator/proguard-rules.pro diff --git a/navigator/src/main/AndroidManifest.xml b/core/navigator/src/main/AndroidManifest.xml similarity index 100% rename from navigator/src/main/AndroidManifest.xml rename to core/navigator/src/main/AndroidManifest.xml diff --git a/navigator/src/main/java/com/mutualmobile/praxis/navigator/NavigationCommand.kt b/core/navigator/src/main/java/com/mutualmobile/praxis/navigator/NavigationCommand.kt similarity index 100% rename from navigator/src/main/java/com/mutualmobile/praxis/navigator/NavigationCommand.kt rename to core/navigator/src/main/java/com/mutualmobile/praxis/navigator/NavigationCommand.kt diff --git a/navigator/src/main/java/com/mutualmobile/praxis/navigator/NavigationKeys.kt b/core/navigator/src/main/java/com/mutualmobile/praxis/navigator/NavigationKeys.kt similarity index 100% rename from navigator/src/main/java/com/mutualmobile/praxis/navigator/NavigationKeys.kt rename to core/navigator/src/main/java/com/mutualmobile/praxis/navigator/NavigationKeys.kt diff --git a/navigator/src/main/java/com/mutualmobile/praxis/navigator/Navigator.kt b/core/navigator/src/main/java/com/mutualmobile/praxis/navigator/Navigator.kt similarity index 96% rename from navigator/src/main/java/com/mutualmobile/praxis/navigator/Navigator.kt rename to core/navigator/src/main/java/com/mutualmobile/praxis/navigator/Navigator.kt index 4c4d7fb..d6c73a7 100644 --- a/navigator/src/main/java/com/mutualmobile/praxis/navigator/Navigator.kt +++ b/core/navigator/src/main/java/com/mutualmobile/praxis/navigator/Navigator.kt @@ -23,7 +23,7 @@ abstract class Navigator { abstract class ComposeNavigator : Navigator() { abstract fun navigate(route: String, optionsBuilder: (NavOptionsBuilder.() -> Unit)? = null) - abstract fun observeResult(key: String, route: String? = null): Flow + abstract fun observeResult(key: String, route: String? = null): Flow abstract fun navigateBackWithResult(key: String, result: T, route: String?) abstract fun popUpTo(route: String, inclusive: Boolean) @@ -49,9 +49,6 @@ abstract class ComposeNavigator : Navigator() { is ComposeNavigationCommand.NavigateUpWithResult<*> -> { navUpWithResult(navigationCommand) } - else -> { - throw RuntimeException("can't handle this with ComposeNavigator") - } } } diff --git a/navigator/src/main/java/com/mutualmobile/praxis/navigator/Screens.kt b/core/navigator/src/main/java/com/mutualmobile/praxis/navigator/Screens.kt similarity index 94% rename from navigator/src/main/java/com/mutualmobile/praxis/navigator/Screens.kt rename to core/navigator/src/main/java/com/mutualmobile/praxis/navigator/Screens.kt index 623b581..0b9db7e 100644 --- a/navigator/src/main/java/com/mutualmobile/praxis/navigator/Screens.kt +++ b/core/navigator/src/main/java/com/mutualmobile/praxis/navigator/Screens.kt @@ -1,8 +1,6 @@ package com.mutualmobile.praxis.navigator import androidx.navigation.NamedNavArgument -import androidx.navigation.NavType -import androidx.navigation.navArgument sealed class PraxisScreen( val route: String, diff --git a/navigator/src/main/java/com/mutualmobile/praxis/navigator/composenavigator/ComposeNavigator.kt b/core/navigator/src/main/java/com/mutualmobile/praxis/navigator/composenavigator/ComposeNavigator.kt similarity index 99% rename from navigator/src/main/java/com/mutualmobile/praxis/navigator/composenavigator/ComposeNavigator.kt rename to core/navigator/src/main/java/com/mutualmobile/praxis/navigator/composenavigator/ComposeNavigator.kt index 4fcebd7..722d960 100644 --- a/navigator/src/main/java/com/mutualmobile/praxis/navigator/composenavigator/ComposeNavigator.kt +++ b/core/navigator/src/main/java/com/mutualmobile/praxis/navigator/composenavigator/ComposeNavigator.kt @@ -41,7 +41,7 @@ class PraxisCloneComposeNavigator @Inject constructor(): ComposeNavigator() { } @OptIn(ExperimentalCoroutinesApi::class) - override fun observeResult(key: String, route: String?): Flow { + override fun observeResult(key: String, route: String?): Flow { return navControllerFlow .filterNotNull() .flatMapLatest { navController -> diff --git a/navigator/.gitignore b/feature/commonui/.gitignore similarity index 100% rename from navigator/.gitignore rename to feature/commonui/.gitignore diff --git a/commonui/build.gradle.kts b/feature/commonui/build.gradle.kts similarity index 98% rename from commonui/build.gradle.kts rename to feature/commonui/build.gradle.kts index 73940cf..a9b0961 100644 --- a/commonui/build.gradle.kts +++ b/feature/commonui/build.gradle.kts @@ -55,7 +55,6 @@ dependencies { /*DI*/ implementation(Lib.Di.hilt) implementation(Lib.Di.hiltNavigationCompose) - implementation(Lib.Di.viewmodel) kapt(Lib.Di.hiltCompiler) kapt(Lib.Di.hiltAndroidCompiler) diff --git a/navigator/consumer-rules.pro b/feature/commonui/consumer-rules.pro similarity index 100% rename from navigator/consumer-rules.pro rename to feature/commonui/consumer-rules.pro diff --git a/navigator/proguard-rules.pro b/feature/commonui/proguard-rules.pro similarity index 100% rename from navigator/proguard-rules.pro rename to feature/commonui/proguard-rules.pro diff --git a/commonui/src/main/AndroidManifest.xml b/feature/commonui/src/main/AndroidManifest.xml similarity index 100% rename from commonui/src/main/AndroidManifest.xml rename to feature/commonui/src/main/AndroidManifest.xml diff --git a/commonui/src/main/java/com/mutualmobile/praxis/commonui/keyboard/Keyboard.kt b/feature/commonui/src/main/java/com/mutualmobile/praxis/commonui/keyboard/Keyboard.kt similarity index 100% rename from commonui/src/main/java/com/mutualmobile/praxis/commonui/keyboard/Keyboard.kt rename to feature/commonui/src/main/java/com/mutualmobile/praxis/commonui/keyboard/Keyboard.kt diff --git a/commonui/src/main/java/com/mutualmobile/praxis/commonui/material/DefaultSnackbar.kt b/feature/commonui/src/main/java/com/mutualmobile/praxis/commonui/material/DefaultSnackbar.kt similarity index 100% rename from commonui/src/main/java/com/mutualmobile/praxis/commonui/material/DefaultSnackbar.kt rename to feature/commonui/src/main/java/com/mutualmobile/praxis/commonui/material/DefaultSnackbar.kt diff --git a/commonui/src/main/java/com/mutualmobile/praxis/commonui/material/PraxisSurfaceAppBar.kt b/feature/commonui/src/main/java/com/mutualmobile/praxis/commonui/material/PraxisSurfaceAppBar.kt similarity index 100% rename from commonui/src/main/java/com/mutualmobile/praxis/commonui/material/PraxisSurfaceAppBar.kt rename to feature/commonui/src/main/java/com/mutualmobile/praxis/commonui/material/PraxisSurfaceAppBar.kt diff --git a/commonui/src/main/java/com/mutualmobile/praxis/commonui/reusable/SlackDragComposableView.kt b/feature/commonui/src/main/java/com/mutualmobile/praxis/commonui/reusable/SlackDragComposableView.kt similarity index 100% rename from commonui/src/main/java/com/mutualmobile/praxis/commonui/reusable/SlackDragComposableView.kt rename to feature/commonui/src/main/java/com/mutualmobile/praxis/commonui/reusable/SlackDragComposableView.kt diff --git a/commonui/src/main/java/com/mutualmobile/praxis/commonui/reusable/SlackImageBox.kt b/feature/commonui/src/main/java/com/mutualmobile/praxis/commonui/reusable/SlackImageBox.kt similarity index 100% rename from commonui/src/main/java/com/mutualmobile/praxis/commonui/reusable/SlackImageBox.kt rename to feature/commonui/src/main/java/com/mutualmobile/praxis/commonui/reusable/SlackImageBox.kt diff --git a/commonui/src/main/java/com/mutualmobile/praxis/commonui/reusable/SlackListItem.kt b/feature/commonui/src/main/java/com/mutualmobile/praxis/commonui/reusable/SlackListItem.kt similarity index 100% rename from commonui/src/main/java/com/mutualmobile/praxis/commonui/reusable/SlackListItem.kt rename to feature/commonui/src/main/java/com/mutualmobile/praxis/commonui/reusable/SlackListItem.kt diff --git a/commonui/src/main/java/com/mutualmobile/praxis/commonui/theme/Color.kt b/feature/commonui/src/main/java/com/mutualmobile/praxis/commonui/theme/Color.kt similarity index 100% rename from commonui/src/main/java/com/mutualmobile/praxis/commonui/theme/Color.kt rename to feature/commonui/src/main/java/com/mutualmobile/praxis/commonui/theme/Color.kt diff --git a/commonui/src/main/java/com/mutualmobile/praxis/commonui/theme/PraxisSurface.kt b/feature/commonui/src/main/java/com/mutualmobile/praxis/commonui/theme/PraxisSurface.kt similarity index 100% rename from commonui/src/main/java/com/mutualmobile/praxis/commonui/theme/PraxisSurface.kt rename to feature/commonui/src/main/java/com/mutualmobile/praxis/commonui/theme/PraxisSurface.kt diff --git a/commonui/src/main/java/com/mutualmobile/praxis/commonui/theme/Shape.kt b/feature/commonui/src/main/java/com/mutualmobile/praxis/commonui/theme/Shape.kt similarity index 100% rename from commonui/src/main/java/com/mutualmobile/praxis/commonui/theme/Shape.kt rename to feature/commonui/src/main/java/com/mutualmobile/praxis/commonui/theme/Shape.kt diff --git a/commonui/src/main/java/com/mutualmobile/praxis/commonui/theme/Theme.kt b/feature/commonui/src/main/java/com/mutualmobile/praxis/commonui/theme/Theme.kt similarity index 100% rename from commonui/src/main/java/com/mutualmobile/praxis/commonui/theme/Theme.kt rename to feature/commonui/src/main/java/com/mutualmobile/praxis/commonui/theme/Theme.kt diff --git a/commonui/src/main/java/com/mutualmobile/praxis/commonui/theme/Type.kt b/feature/commonui/src/main/java/com/mutualmobile/praxis/commonui/theme/Type.kt similarity index 100% rename from commonui/src/main/java/com/mutualmobile/praxis/commonui/theme/Type.kt rename to feature/commonui/src/main/java/com/mutualmobile/praxis/commonui/theme/Type.kt diff --git a/commonui/src/main/res/anim/slide_left_in.xml b/feature/commonui/src/main/res/anim/slide_left_in.xml similarity index 100% rename from commonui/src/main/res/anim/slide_left_in.xml rename to feature/commonui/src/main/res/anim/slide_left_in.xml diff --git a/commonui/src/main/res/anim/slide_left_out.xml b/feature/commonui/src/main/res/anim/slide_left_out.xml similarity index 100% rename from commonui/src/main/res/anim/slide_left_out.xml rename to feature/commonui/src/main/res/anim/slide_left_out.xml diff --git a/commonui/src/main/res/anim/slide_right_in.xml b/feature/commonui/src/main/res/anim/slide_right_in.xml similarity index 100% rename from commonui/src/main/res/anim/slide_right_in.xml rename to feature/commonui/src/main/res/anim/slide_right_in.xml diff --git a/commonui/src/main/res/anim/slide_right_out.xml b/feature/commonui/src/main/res/anim/slide_right_out.xml similarity index 100% rename from commonui/src/main/res/anim/slide_right_out.xml rename to feature/commonui/src/main/res/anim/slide_right_out.xml diff --git a/commonui/src/main/res/drawable/ic_email.xml b/feature/commonui/src/main/res/drawable/ic_email.xml similarity index 100% rename from commonui/src/main/res/drawable/ic_email.xml rename to feature/commonui/src/main/res/drawable/ic_email.xml diff --git a/commonui/src/main/res/drawable/ic_eye.xml b/feature/commonui/src/main/res/drawable/ic_eye.xml similarity index 100% rename from commonui/src/main/res/drawable/ic_eye.xml rename to feature/commonui/src/main/res/drawable/ic_eye.xml diff --git a/commonui/src/main/res/font/lato_bold.ttf b/feature/commonui/src/main/res/font/lato_bold.ttf similarity index 100% rename from commonui/src/main/res/font/lato_bold.ttf rename to feature/commonui/src/main/res/font/lato_bold.ttf diff --git a/commonui/src/main/res/font/lato_light.ttf b/feature/commonui/src/main/res/font/lato_light.ttf similarity index 100% rename from commonui/src/main/res/font/lato_light.ttf rename to feature/commonui/src/main/res/font/lato_light.ttf diff --git a/commonui/src/main/res/font/lato_regular.ttf b/feature/commonui/src/main/res/font/lato_regular.ttf similarity index 100% rename from commonui/src/main/res/font/lato_regular.ttf rename to feature/commonui/src/main/res/font/lato_regular.ttf diff --git a/commonui/src/main/res/mipmap-hdpi/ic_launcher.png b/feature/commonui/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from commonui/src/main/res/mipmap-hdpi/ic_launcher.png rename to feature/commonui/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/commonui/src/main/res/mipmap-mdpi/ic_launcher.png b/feature/commonui/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from commonui/src/main/res/mipmap-mdpi/ic_launcher.png rename to feature/commonui/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/commonui/src/main/res/mipmap-xhdpi/ic_launcher.png b/feature/commonui/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from commonui/src/main/res/mipmap-xhdpi/ic_launcher.png rename to feature/commonui/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/commonui/src/main/res/mipmap-xxhdpi/ic_launcher.png b/feature/commonui/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from commonui/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to feature/commonui/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/commonui/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/feature/commonui/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from commonui/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to feature/commonui/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/commonui/src/main/res/values-v21/styles.xml b/feature/commonui/src/main/res/values-v21/styles.xml similarity index 100% rename from commonui/src/main/res/values-v21/styles.xml rename to feature/commonui/src/main/res/values-v21/styles.xml diff --git a/commonui/src/main/res/values/colors.xml b/feature/commonui/src/main/res/values/colors.xml similarity index 100% rename from commonui/src/main/res/values/colors.xml rename to feature/commonui/src/main/res/values/colors.xml diff --git a/commonui/src/main/res/values/dimens.xml b/feature/commonui/src/main/res/values/dimens.xml similarity index 100% rename from commonui/src/main/res/values/dimens.xml rename to feature/commonui/src/main/res/values/dimens.xml diff --git a/commonui/src/main/res/values/integer.xml b/feature/commonui/src/main/res/values/integer.xml similarity index 100% rename from commonui/src/main/res/values/integer.xml rename to feature/commonui/src/main/res/values/integer.xml diff --git a/commonui/src/main/res/values/strings.xml b/feature/commonui/src/main/res/values/strings.xml similarity index 100% rename from commonui/src/main/res/values/strings.xml rename to feature/commonui/src/main/res/values/strings.xml diff --git a/commonui/src/main/res/values/styles.xml b/feature/commonui/src/main/res/values/styles.xml similarity index 100% rename from commonui/src/main/res/values/styles.xml rename to feature/commonui/src/main/res/values/styles.xml diff --git a/ui-authentication/.gitignore b/feature/ui-authentication/.gitignore similarity index 100% rename from ui-authentication/.gitignore rename to feature/ui-authentication/.gitignore diff --git a/ui-authentication/build.gradle.kts b/feature/ui-authentication/build.gradle.kts similarity index 90% rename from ui-authentication/build.gradle.kts rename to feature/ui-authentication/build.gradle.kts index f976ad7..0d673ee 100644 --- a/ui-authentication/build.gradle.kts +++ b/feature/ui-authentication/build.gradle.kts @@ -56,11 +56,11 @@ kapt { dependencies { /*Kotlin*/ - implementation(project(":data")) - implementation(project(":domain")) - implementation(project(":common")) - implementation(project(":navigator")) - implementation(project(":commonui")) + implementation(project(":core:data")) + implementation(project(":core:domain")) + implementation(project(":core:common")) + implementation(project(":core:navigator")) + implementation(project(":feature:commonui")) @@ -74,7 +74,6 @@ dependencies { /*DI*/ implementation(Lib.Di.hilt) implementation(Lib.Di.hiltNavigationCompose) - implementation(Lib.Di.viewmodel) kapt(Lib.Di.hiltCompiler) kapt(Lib.Di.hiltAndroidCompiler) diff --git a/ui-authentication/consumer-rules.pro b/feature/ui-authentication/consumer-rules.pro similarity index 100% rename from ui-authentication/consumer-rules.pro rename to feature/ui-authentication/consumer-rules.pro diff --git a/ui-authentication/proguard-rules.pro b/feature/ui-authentication/proguard-rules.pro similarity index 100% rename from ui-authentication/proguard-rules.pro rename to feature/ui-authentication/proguard-rules.pro diff --git a/ui-authentication/src/main/AndroidManifest.xml b/feature/ui-authentication/src/main/AndroidManifest.xml similarity index 100% rename from ui-authentication/src/main/AndroidManifest.xml rename to feature/ui-authentication/src/main/AndroidManifest.xml diff --git a/ui-authentication/src/main/java/com/praxis/feat/authentication/nav/AuthNavGraph.kt b/feature/ui-authentication/src/main/java/com/praxis/feat/authentication/nav/AuthNavGraph.kt similarity index 100% rename from ui-authentication/src/main/java/com/praxis/feat/authentication/nav/AuthNavGraph.kt rename to feature/ui-authentication/src/main/java/com/praxis/feat/authentication/nav/AuthNavGraph.kt diff --git a/ui-authentication/src/main/java/com/praxis/feat/authentication/services/Validatable.kt b/feature/ui-authentication/src/main/java/com/praxis/feat/authentication/services/Validatable.kt similarity index 100% rename from ui-authentication/src/main/java/com/praxis/feat/authentication/services/Validatable.kt rename to feature/ui-authentication/src/main/java/com/praxis/feat/authentication/services/Validatable.kt diff --git a/ui-authentication/src/main/java/com/praxis/feat/authentication/ui/AuthenticationUI.kt b/feature/ui-authentication/src/main/java/com/praxis/feat/authentication/ui/AuthenticationUI.kt similarity index 100% rename from ui-authentication/src/main/java/com/praxis/feat/authentication/ui/AuthenticationUI.kt rename to feature/ui-authentication/src/main/java/com/praxis/feat/authentication/ui/AuthenticationUI.kt diff --git a/ui-authentication/src/main/java/com/praxis/feat/authentication/ui/ForgotPasswordUI.kt b/feature/ui-authentication/src/main/java/com/praxis/feat/authentication/ui/ForgotPasswordUI.kt similarity index 100% rename from ui-authentication/src/main/java/com/praxis/feat/authentication/ui/ForgotPasswordUI.kt rename to feature/ui-authentication/src/main/java/com/praxis/feat/authentication/ui/ForgotPasswordUI.kt diff --git a/ui-authentication/src/main/java/com/praxis/feat/authentication/ui/exceptions/FormValidationFailed.kt b/feature/ui-authentication/src/main/java/com/praxis/feat/authentication/ui/exceptions/FormValidationFailed.kt similarity index 100% rename from ui-authentication/src/main/java/com/praxis/feat/authentication/ui/exceptions/FormValidationFailed.kt rename to feature/ui-authentication/src/main/java/com/praxis/feat/authentication/ui/exceptions/FormValidationFailed.kt diff --git a/ui-authentication/src/main/java/com/praxis/feat/authentication/ui/model/FailureType.kt b/feature/ui-authentication/src/main/java/com/praxis/feat/authentication/ui/model/FailureType.kt similarity index 100% rename from ui-authentication/src/main/java/com/praxis/feat/authentication/ui/model/FailureType.kt rename to feature/ui-authentication/src/main/java/com/praxis/feat/authentication/ui/model/FailureType.kt diff --git a/ui-authentication/src/main/java/com/praxis/feat/authentication/ui/model/LoginForm.kt b/feature/ui-authentication/src/main/java/com/praxis/feat/authentication/ui/model/LoginForm.kt similarity index 100% rename from ui-authentication/src/main/java/com/praxis/feat/authentication/ui/model/LoginForm.kt rename to feature/ui-authentication/src/main/java/com/praxis/feat/authentication/ui/model/LoginForm.kt diff --git a/ui-authentication/src/main/java/com/praxis/feat/authentication/vm/AuthVM.kt b/feature/ui-authentication/src/main/java/com/praxis/feat/authentication/vm/AuthVM.kt similarity index 94% rename from ui-authentication/src/main/java/com/praxis/feat/authentication/vm/AuthVM.kt rename to feature/ui-authentication/src/main/java/com/praxis/feat/authentication/vm/AuthVM.kt index ecb1eaf..5b99ff5 100644 --- a/ui-authentication/src/main/java/com/praxis/feat/authentication/vm/AuthVM.kt +++ b/feature/ui-authentication/src/main/java/com/praxis/feat/authentication/vm/AuthVM.kt @@ -66,13 +66,15 @@ class AuthVM @Inject constructor( } private fun observePasswordReset() { - composeNavigator.observeResult(NavigationKeys.ForgotPassword).onStart { - val message = savedStateHandle.get(NavigationKeys.ForgotPassword) + composeNavigator.observeResult(NavigationKeys.ForgotPassword).onStart { + val message = savedStateHandle.get(NavigationKeys.ForgotPassword) message?.let { emit(it) } } - .onEach { snackBarState.value = it } + .onEach { + snackBarState.value = it?:"" + } .launchIn(viewModelScope) } diff --git a/ui-authentication/src/main/java/com/praxis/feat/authentication/vm/ForgotPasswordVM.kt b/feature/ui-authentication/src/main/java/com/praxis/feat/authentication/vm/ForgotPasswordVM.kt similarity index 100% rename from ui-authentication/src/main/java/com/praxis/feat/authentication/vm/ForgotPasswordVM.kt rename to feature/ui-authentication/src/main/java/com/praxis/feat/authentication/vm/ForgotPasswordVM.kt diff --git a/ui-authentication/src/test/java/com/praxis/feat/authentication/vm/AuthVMTest.kt b/feature/ui-authentication/src/test/java/com/praxis/feat/authentication/vm/AuthVMTest.kt similarity index 100% rename from ui-authentication/src/test/java/com/praxis/feat/authentication/vm/AuthVMTest.kt rename to feature/ui-authentication/src/test/java/com/praxis/feat/authentication/vm/AuthVMTest.kt diff --git a/ui-onboarding/.gitignore b/feature/ui-onboarding/.gitignore similarity index 100% rename from ui-onboarding/.gitignore rename to feature/ui-onboarding/.gitignore diff --git a/ui-onboarding/build.gradle.kts b/feature/ui-onboarding/build.gradle.kts similarity index 90% rename from ui-onboarding/build.gradle.kts rename to feature/ui-onboarding/build.gradle.kts index ced77d9..216ad6d 100644 --- a/ui-onboarding/build.gradle.kts +++ b/feature/ui-onboarding/build.gradle.kts @@ -58,11 +58,11 @@ dependencies { /*Kotlin*/ - implementation(project(":data")) - implementation(project(":domain")) - implementation(project(":common")) - implementation(project(":navigator")) - implementation(project(":commonui")) + implementation(project(":core:data")) + implementation(project(":core:domain")) + implementation(project(":core:common")) + implementation(project(":core:navigator")) + implementation(project(":feature:commonui")) Lib.Androidx.list.forEach(::implementation) @@ -75,7 +75,6 @@ dependencies { /*DI*/ implementation(Lib.Di.hilt) implementation(Lib.Di.hiltNavigationCompose) - implementation(Lib.Di.viewmodel) kapt(Lib.Di.hiltCompiler) kapt(Lib.Di.hiltAndroidCompiler) diff --git a/ui-onboarding/consumer-rules.pro b/feature/ui-onboarding/consumer-rules.pro similarity index 100% rename from ui-onboarding/consumer-rules.pro rename to feature/ui-onboarding/consumer-rules.pro diff --git a/ui-onboarding/proguard-rules.pro b/feature/ui-onboarding/proguard-rules.pro similarity index 100% rename from ui-onboarding/proguard-rules.pro rename to feature/ui-onboarding/proguard-rules.pro diff --git a/ui-onboarding/src/androidTest/java/com/mutualmobile/praxis/uionboarding/ExampleInstrumentedTest.kt b/feature/ui-onboarding/src/androidTest/java/com/mutualmobile/praxis/uionboarding/ExampleInstrumentedTest.kt similarity index 100% rename from ui-onboarding/src/androidTest/java/com/mutualmobile/praxis/uionboarding/ExampleInstrumentedTest.kt rename to feature/ui-onboarding/src/androidTest/java/com/mutualmobile/praxis/uionboarding/ExampleInstrumentedTest.kt diff --git a/ui-onboarding/src/main/AndroidManifest.xml b/feature/ui-onboarding/src/main/AndroidManifest.xml similarity index 100% rename from ui-onboarding/src/main/AndroidManifest.xml rename to feature/ui-onboarding/src/main/AndroidManifest.xml diff --git a/ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/CommonInputUI.kt b/feature/ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/CommonInputUI.kt similarity index 98% rename from ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/CommonInputUI.kt rename to feature/ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/CommonInputUI.kt index 65592eb..8e7d11a 100644 --- a/ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/CommonInputUI.kt +++ b/feature/ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/CommonInputUI.kt @@ -18,7 +18,6 @@ import com.mutualmobile.praxis.commonui.theme.PraxisColorProvider import com.mutualmobile.praxis.commonui.theme.PraxisTypography import com.mutualmobile.praxis.navigator.ComposeNavigator import com.mutualmobile.praxis.navigator.PraxisRoute -import com.mutualmobile.praxis.navigator.PraxisScreen @Composable fun CommonInputUI( diff --git a/ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/EmailInputView.kt b/feature/ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/EmailInputView.kt similarity index 100% rename from ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/EmailInputView.kt rename to feature/ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/EmailInputView.kt diff --git a/ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/GettingStarted.kt b/feature/ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/GettingStarted.kt similarity index 100% rename from ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/GettingStarted.kt rename to feature/ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/GettingStarted.kt diff --git a/ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/ScreenInputUI.kt b/feature/ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/ScreenInputUI.kt similarity index 100% rename from ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/ScreenInputUI.kt rename to feature/ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/ScreenInputUI.kt diff --git a/ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/SkipTypingScreen.kt b/feature/ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/SkipTypingScreen.kt similarity index 100% rename from ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/SkipTypingScreen.kt rename to feature/ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/SkipTypingScreen.kt diff --git a/ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/WorkspaceInputView.kt b/feature/ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/WorkspaceInputView.kt similarity index 100% rename from ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/WorkspaceInputView.kt rename to feature/ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/compose/WorkspaceInputView.kt diff --git a/ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/nav/OnboardingNavigation.kt b/feature/ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/nav/OnboardingNavigation.kt similarity index 100% rename from ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/nav/OnboardingNavigation.kt rename to feature/ui-onboarding/src/main/java/com/mutualmobile/praxis/uionboarding/nav/OnboardingNavigation.kt diff --git a/ui-onboarding/src/main/res/drawable-hdpi/gettingstarted.png b/feature/ui-onboarding/src/main/res/drawable-hdpi/gettingstarted.png similarity index 100% rename from ui-onboarding/src/main/res/drawable-hdpi/gettingstarted.png rename to feature/ui-onboarding/src/main/res/drawable-hdpi/gettingstarted.png diff --git a/ui-onboarding/src/main/res/drawable-xxhdpi/gettingstarted.png b/feature/ui-onboarding/src/main/res/drawable-xxhdpi/gettingstarted.png similarity index 100% rename from ui-onboarding/src/main/res/drawable-xxhdpi/gettingstarted.png rename to feature/ui-onboarding/src/main/res/drawable-xxhdpi/gettingstarted.png diff --git a/ui-onboarding/src/main/res/drawable-xxxhdpi/gettingstarted.png b/feature/ui-onboarding/src/main/res/drawable-xxxhdpi/gettingstarted.png similarity index 100% rename from ui-onboarding/src/main/res/drawable-xxxhdpi/gettingstarted.png rename to feature/ui-onboarding/src/main/res/drawable-xxxhdpi/gettingstarted.png diff --git a/ui-onboarding/src/main/res/values/strings.xml b/feature/ui-onboarding/src/main/res/values/strings.xml similarity index 100% rename from ui-onboarding/src/main/res/values/strings.xml rename to feature/ui-onboarding/src/main/res/values/strings.xml diff --git a/ui-onboarding/src/test/java/com/mutualmobile/praxis/uionboarding/ExampleUnitTest.kt b/feature/ui-onboarding/src/test/java/com/mutualmobile/praxis/uionboarding/ExampleUnitTest.kt similarity index 100% rename from ui-onboarding/src/test/java/com/mutualmobile/praxis/uionboarding/ExampleUnitTest.kt rename to feature/ui-onboarding/src/test/java/com/mutualmobile/praxis/uionboarding/ExampleUnitTest.kt diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d8cebfc..4048f78 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Thu Jan 27 08:55:19 IST 2022 +#Mon Dec 19 10:17:12 IST 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip distributionPath=wrapper/dists -zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/macrobenchmark/.gitignore b/macrobenchmark/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/macrobenchmark/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/macrobenchmark/build.gradle.kts b/macrobenchmark/build.gradle.kts new file mode 100644 index 0000000..cf91ab6 --- /dev/null +++ b/macrobenchmark/build.gradle.kts @@ -0,0 +1,52 @@ +plugins { + id(BuildPlugins.ANDROID_TEST) + id(BuildPlugins.JETBRAINS_KOTLIN_ANDROID) +} + +android { + namespace = "com.mutualmobile.praxis.macrobenchmark" + compileSdk = 33 + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = "1.8" + } + + defaultConfig { + minSdk = 24 + targetSdk = AppVersions.TARGET_SDK + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + // This benchmark buildType is used for benchmarking, and should function like your + // release build (for example, with minification on). It"s signed with a debug key + // for easy local/CI testing. + create("benchmark") { + isDebuggable = true + signingConfig = getByName("debug").signingConfig + matchingFallbacks += listOf("release") + } + } + + targetProjectPath = ":app" + experimentalProperties["android.experimental.self-instrumenting"] = true +} + +dependencies { + implementation(UnitTesting.ANDROID_JUNIT) + implementation(UnitTesting.ESPRESSO) + implementation(UnitTesting.UI_AUTOMATOR) + implementation(UnitTesting.BENCHMARK) +} + +androidComponents { + beforeVariants(selector().all()) { + it.enabled = it.buildType == "benchmark" + } +} \ No newline at end of file diff --git a/macrobenchmark/src/main/AndroidManifest.xml b/macrobenchmark/src/main/AndroidManifest.xml new file mode 100644 index 0000000..13ebc5e --- /dev/null +++ b/macrobenchmark/src/main/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/macrobenchmark/src/main/java/com/mutualmobile/praxis/macrobenchmark/Utils.kt b/macrobenchmark/src/main/java/com/mutualmobile/praxis/macrobenchmark/Utils.kt new file mode 100644 index 0000000..b78164e --- /dev/null +++ b/macrobenchmark/src/main/java/com/mutualmobile/praxis/macrobenchmark/Utils.kt @@ -0,0 +1,3 @@ +package com.mutualmobile.praxis.macrobenchmark + +const val PACKAGE_NAME = "com.mutualmobile.praxis" diff --git a/macrobenchmark/src/main/java/com/mutualmobile/praxis/macrobenchmark/baselineprofile/StartUpBaselineProfile.kt b/macrobenchmark/src/main/java/com/mutualmobile/praxis/macrobenchmark/baselineprofile/StartUpBaselineProfile.kt new file mode 100644 index 0000000..161e3b9 --- /dev/null +++ b/macrobenchmark/src/main/java/com/mutualmobile/praxis/macrobenchmark/baselineprofile/StartUpBaselineProfile.kt @@ -0,0 +1,19 @@ +package com.mutualmobile.praxis.macrobenchmark.baselineprofile + +import androidx.benchmark.macro.junit4.BaselineProfileRule +import com.mutualmobile.praxis.macrobenchmark.PACKAGE_NAME +import org.junit.Rule +import org.junit.Test + +class StartUpBaselineProfile { + @get:Rule + val baselineProfile = BaselineProfileRule() + + @Test + fun startUp() = baselineProfile.collectBaselineProfile( + PACKAGE_NAME, + profileBlock = { + startActivityAndWait() + } + ) +} \ No newline at end of file diff --git a/macrobenchmark/src/main/java/com/mutualmobile/praxis/macrobenchmark/startup/StartupBenchmark.kt b/macrobenchmark/src/main/java/com/mutualmobile/praxis/macrobenchmark/startup/StartupBenchmark.kt new file mode 100644 index 0000000..d8581d1 --- /dev/null +++ b/macrobenchmark/src/main/java/com/mutualmobile/praxis/macrobenchmark/startup/StartupBenchmark.kt @@ -0,0 +1,61 @@ +package com.mutualmobile.praxis.macrobenchmark.startup + +import androidx.benchmark.macro.FrameTimingMetric +import androidx.benchmark.macro.StartupMode +import androidx.benchmark.macro.StartupTimingMetric +import androidx.benchmark.macro.junit4.MacrobenchmarkRule +import androidx.test.ext.junit.runners.AndroidJUnit4 +import com.mutualmobile.praxis.macrobenchmark.PACKAGE_NAME +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith + +/** + * It navigates to the device's home screen, and launches the default activity. + * + * Before running this benchmark: + * 1) switch your app's active build variant in the Studio (affects Studio runs only) + * 2) add `` to your app's manifest, within the `` tag + * + * Run this benchmark from Studio to see startup measurements, and captured system traces + * for investigating your app's performance. + */ + +@RunWith(AndroidJUnit4::class) +class StartupBenchmark { + @get:Rule + val benchmarkRule = MacrobenchmarkRule() + + @Test + fun startup() = benchmarkRule.measureRepeated( + packageName = PACKAGE_NAME, + metrics = listOf(StartupTimingMetric()), + iterations = 3, + startupMode = StartupMode.HOT + ) { + pressHome() + startActivityAndWait() + } + + @Test + fun warmStartup() = benchmarkRule.measureRepeated( + packageName = PACKAGE_NAME, + metrics = listOf(StartupTimingMetric(), FrameTimingMetric()), + iterations = 2, + startupMode = StartupMode.WARM + ) { + pressHome() + startActivityAndWait() + } + + @Test + fun hotStartup() = benchmarkRule.measureRepeated( + packageName = PACKAGE_NAME, + metrics = listOf(StartupTimingMetric()), + iterations = 3, + startupMode = StartupMode.HOT + ) { + pressHome() + startActivityAndWait() + } +} diff --git a/settings.gradle.kts b/settings.gradle.kts index 56f746d..21201a6 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -2,13 +2,14 @@ include(":app") // Feature modules -include(":ui-onboarding") -include(":ui-authentication") +include(":feature:ui-onboarding") +include(":feature:ui-authentication") +include(":feature:commonui") // Other modules -include(":domain") -include(":data") -include(":common") -include(":commonui") -include(":navigator") +include(":core:domain") +include(":core:data") +include(":core:common") +include(":core:navigator") +include(":macrobenchmark")