diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml index b3328bda..74c44c99 100644 --- a/.github/workflows/build_and_test.yaml +++ b/.github/workflows/build_and_test.yaml @@ -55,7 +55,7 @@ jobs: run: ./gradlew check -Pkmp4free=false -Pios=false -Pjs=false --scan --stacktrace - name: Run All Checks with Multiplatform - KMP4FREE Enabled - run: ./gradlew check -Pkmp4free=true -Pios=true -Pjs=true --scan --stacktrace + run: ./gradlew check -Pkmp4free=true -Pios=true -Pjs=true --scan --stacktrace --rerun-tasks - name: (Fail-only) Bundle test reports if: failure() @@ -86,16 +86,16 @@ jobs: java-version: '17' check-latest: true - - name: Instrumentation Tests - uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2 - with: - api-level: ${{ matrix.api-level }} - target: default - arch: x86_64 - script: ./gradlew connectedCheck --no-build-cache --no-daemon --stacktrace - - - name: Upload results - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4 - with: - name: insrumentation-test-results - path: ./**/build/reports/androidTests/connected/** +# - name: Instrumentation Tests +# uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2 +# with: +# api-level: ${{ matrix.api-level }} +# target: default +# arch: x86_64 +# script: ./gradlew connectedCheck --no-build-cache --no-daemon --stacktrace +# +# - name: Upload results +# uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4 +# with: +# name: insrumentation-test-results +# path: ./**/build/reports/androidTests/connected/** diff --git a/app-test-host/build.gradle b/app-test-host/build.gradle new file mode 100644 index 00000000..66ac8462 --- /dev/null +++ b/app-test-host/build.gradle @@ -0,0 +1,37 @@ +plugins { + id 'com.android.test' + id 'kotlin-android' +} + +android { + compileSdk = Integer.parseInt(libs.versions.android.compile.sdk.get()) + + defaultConfig { + minSdkVersion Integer.parseInt(libs.versions.android.min.sdk.get()) + targetSdkVersion Integer.parseInt(libs.versions.android.target.sdk.get()) + testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' + } + + namespace = "com.handstandsam.shoppingapp.android.tests" + + targetProjectPath = ":app" + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_1_8 + } +} + +dependencies { + compileOnly(project(":app")) + + implementation libs.androidx.espresso + implementation libs.androidx.espresso.contrib + implementation libs.androidx.test.rules + implementation libs.androidx.testrunner + implementation(project(":app-test-suite")) +} diff --git a/app-test-host/src/main/java/com/handstandsam/shoppingapp/tests/AndroidTestModuleTest.kt b/app-test-host/src/main/java/com/handstandsam/shoppingapp/tests/AndroidTestModuleTest.kt new file mode 100644 index 00000000..533bd043 --- /dev/null +++ b/app-test-host/src/main/java/com/handstandsam/shoppingapp/tests/AndroidTestModuleTest.kt @@ -0,0 +1,34 @@ +package com.handstandsam.shoppingapp.tests + +import androidx.lifecycle.Lifecycle +import androidx.test.core.app.ActivityScenario +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.action.ViewActions.typeText +import androidx.test.espresso.matcher.ViewMatchers.withId +import com.handstandsam.shoppingapp.R +import com.handstandsam.shoppingapp.features.login.LoginActivity +import org.junit.Assert.assertTrue +import org.junit.Test + +/** + * com.android.test + */ +class AndroidTestModuleTest { + + @Test + fun androidTestModule() { + assertTrue(true) + } + + @Test + fun androidTestModuleLoginActivityTypeUsernameTest() { + val activityScenario: ActivityScenario = + ActivityScenario.launch(LoginActivity::class.java) + + activityScenario.moveToState(Lifecycle.State.RESUMED) + + onView(withId(R.id.username)).perform(typeText("username")) + + activityScenario.moveToState(Lifecycle.State.DESTROYED) + } +} \ No newline at end of file diff --git a/app-test-suite/build.gradle b/app-test-suite/build.gradle new file mode 100644 index 00000000..ee3e5917 --- /dev/null +++ b/app-test-suite/build.gradle @@ -0,0 +1,21 @@ +plugins { + id 'shoppingapp.android.lib' + id 'kotlin-android' +} + +android { + namespace = "com.handstandsam.shoppingapp.android.tests.lib" + + variantFilter { variant -> + setIgnore(!variant.name.toLowerCase().endsWith("debug")) + } +} + +dependencies { + compileOnly project(path: ':app') + + implementation libs.androidx.espresso + implementation libs.androidx.espresso.contrib + implementation libs.androidx.test.rules + implementation libs.androidx.testrunner +} diff --git a/app-test-suite/src/main/java/com/handstandsam/shoppingapp/tests/TestInLibraryModuleTest.kt b/app-test-suite/src/main/java/com/handstandsam/shoppingapp/tests/TestInLibraryModuleTest.kt new file mode 100644 index 00000000..4542d712 --- /dev/null +++ b/app-test-suite/src/main/java/com/handstandsam/shoppingapp/tests/TestInLibraryModuleTest.kt @@ -0,0 +1,23 @@ +package com.handstandsam.shoppingapp.tests + +import androidx.lifecycle.Lifecycle +import androidx.test.core.app.ActivityScenario +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.action.ViewActions.typeText +import androidx.test.espresso.matcher.ViewMatchers.withId +import com.handstandsam.shoppingapp.R +import com.handstandsam.shoppingapp.features.login.LoginActivity +import org.junit.Assert.assertTrue +import org.junit.Test + +/** + * com.android.library + */ +class TestInLibraryModuleTest { + + @Test + fun testInLibraryModule() { + println("Test in Library Module!") + assertTrue(true) + } +} \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 5685dc67..6789e2c1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,145 +1,120 @@ plugins { - id 'com.android.application' - id 'kotlin-android' - alias(libs.plugins.dependency.guard) + id 'com.android.application' + id 'kotlin-android' + alias(libs.plugins.dependency.guard) } android { - compileSdk = Integer.parseInt(libs.versions.android.compile.sdk.get()) - - namespace = "com.handstandsam.shoppingapp" - - defaultConfig { - applicationId "com.handstandsam.shoppingapp" - minSdkVersion Integer.parseInt(libs.versions.android.min.sdk.get()) - targetSdkVersion Integer.parseInt(libs.versions.android.target.sdk.get()) - versionCode 1 - versionName "1.0" - vectorDrawables.useSupportLibrary = true - testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' + compileSdk = Integer.parseInt(libs.versions.android.compile.sdk.get()) + + namespace = "com.handstandsam.shoppingapp" + + defaultConfig { + applicationId "com.handstandsam.shoppingapp" + minSdkVersion Integer.parseInt(libs.versions.android.min.sdk.get()) + targetSdkVersion Integer.parseInt(libs.versions.android.target.sdk.get()) + versionCode 1 + versionName "1.0" + vectorDrawables.useSupportLibrary = true + testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' + } + + testOptions { + execution 'ANDROIDX_TEST_ORCHESTRATOR' + animationsDisabled = true + } + + variantFilter { variant -> + setIgnore(!variant.name.toLowerCase().endsWith("debug")) + } + + lint { + baseline = file("lint-baseline.xml") + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } + } - testOptions { - execution 'ANDROIDX_TEST_ORCHESTRATOR' - animationsDisabled = true - } - - flavorDimensions "server" - - productFlavors { - inmemory { - dimension "server" - } - - mockserver { - dimension "server" - } - - liveserver { - dimension "server" - } - } + buildFeatures { + compose true + } - variantFilter { variant -> - def fullName = variant.name.toLowerCase() - def names = variant.flavors*.name - // Only Allow Debug variants - if (fullName.endsWith("debug")) { - println(fullName + " - " + names) - // Gradle ignores any variants that satisfy the conditions above. - setIgnore(false) - } else { - setIgnore(true) - } - } + kotlinOptions { + jvmTarget = JavaVersion.VERSION_1_8 + } - lint { - baseline = file("lint-baseline.xml") - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - - buildFeatures { - compose true - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } - - composeOptions { - kotlinCompilerExtensionVersion libs.versions.compose.compiler.get() - } + composeOptions { + kotlinCompilerExtensionVersion libs.versions.compose.compiler.get() + } } dependencies { - implementation project(":compose-ui") - - implementation project(":models") - implementation project(":mock-data") - implementation project(":shopping-cart") - - // AndroidX Libraries - implementation libs.androidx.appcompat.v7 - implementation libs.androidx.material - implementation libs.androidx.lifecycle.runtime.ktx - - // Networking - implementation libs.glide - implementation libs.okhttp - implementation project(":networking") - debugImplementation libs.okhttp.logging.interceptor - - // Kotlin - implementation libs.kotlin.coroutines - implementation libs.kotlin.coroutines.android - - //Flavor Modules - inmemoryImplementation project(":app-flavor-inmemory") - mockserverImplementation project(":app-flavor-mockserver") - liveserverImplementation project(":app-flavor-liveserver") - - //Logging - implementation libs.timber - - // Compose - implementation libs.androidx.compose.compiler - implementation libs.androidx.compose.runtime - implementation libs.androidx.compose.ui - implementation libs.androidx.compose.foundation - implementation libs.androidx.compose.material - implementation libs.androidx.compose.material.icons.extended - implementation libs.androidx.compose.animation - implementation libs.androidx.compose.ui.tooling - implementation libs.androidx.activity.compose - - implementation libs.accompanist.coil - implementation libs.coil.compose - implementation libs.landscapist.coil - implementation libs.androidx.lifecycle.runtime.ktx - - //JVM Tests Only - testImplementation libs.junit - - androidTestImplementation libs.androidx.espresso - androidTestImplementation libs.androidx.espresso.contrib - androidTestImplementation libs.androidx.test.rules - androidTestImplementation libs.androidx.testrunner - androidTestUtil libs.androidx.test.orchestrator + implementation project(":compose-ui") + + implementation project(":models") + implementation project(":mock-data") + implementation project(":shopping-cart") + + // AndroidX Libraries + implementation libs.androidx.appcompat.v7 + implementation libs.androidx.material + implementation libs.androidx.lifecycle.runtime.ktx + + // Networking + implementation libs.glide + implementation libs.okhttp + implementation project(":networking") + debugImplementation libs.okhttp.logging.interceptor + + // Kotlin + implementation libs.kotlin.coroutines + implementation libs.kotlin.coroutines.android + + //Flavor Modules + implementation project(":app-flavor-inmemory") +// implementation project(":app-flavor-mockserver") +// implementation project(":app-flavor-liveserver") + + //Logging + implementation libs.timber + + // Compose + implementation libs.androidx.compose.compiler + implementation libs.androidx.compose.runtime + implementation libs.androidx.compose.ui + implementation libs.androidx.compose.foundation + implementation libs.androidx.compose.material + implementation libs.androidx.compose.material.icons.extended + implementation libs.androidx.compose.animation + implementation libs.androidx.compose.ui.tooling + implementation libs.androidx.activity.compose + + implementation libs.accompanist.coil + implementation libs.coil.compose + implementation libs.landscapist.coil + implementation libs.androidx.lifecycle.runtime.ktx + + //JVM Tests Only + testImplementation libs.junit + + androidTestImplementation libs.androidx.espresso + androidTestImplementation libs.androidx.espresso.contrib + androidTestImplementation libs.androidx.test.rules + androidTestImplementation libs.androidx.testrunner + androidTestImplementation(project(":app-test-suite")) } dependencyGuard { - configuration("inmemoryDebugRuntimeClasspath") { - modules = true - } + configuration("debugRuntimeClasspath") { + modules = true + } } diff --git a/app/dependencies/debugRuntimeClasspath.txt b/app/dependencies/debugRuntimeClasspath.txt new file mode 100644 index 00000000..c4f23331 --- /dev/null +++ b/app/dependencies/debugRuntimeClasspath.txt @@ -0,0 +1,167 @@ +:app-flavor-inmemory +:compose-ui +:mock-data +:models +:networking +:shopping-cart +androidx.activity:activity-compose:1.7.2 +androidx.activity:activity-ktx:1.7.2 +androidx.activity:activity:1.7.2 +androidx.annotation:annotation-experimental:1.3.0 +androidx.annotation:annotation-jvm:1.6.0 +androidx.annotation:annotation:1.6.0 +androidx.appcompat:appcompat-resources:1.6.1 +androidx.appcompat:appcompat:1.6.1 +androidx.arch.core:core-common:2.2.0 +androidx.arch.core:core-runtime:2.2.0 +androidx.autofill:autofill:1.0.0 +androidx.cardview:cardview:1.0.0 +androidx.collection:collection:1.2.0 +androidx.compose.animation:animation-android:1.5.1 +androidx.compose.animation:animation-core-android:1.5.1 +androidx.compose.animation:animation-core:1.5.1 +androidx.compose.animation:animation:1.5.1 +androidx.compose.compiler:compiler:1.5.3 +androidx.compose.foundation:foundation-android:1.5.1 +androidx.compose.foundation:foundation-layout-android:1.5.1 +androidx.compose.foundation:foundation-layout:1.5.1 +androidx.compose.foundation:foundation:1.5.1 +androidx.compose.material:material-android:1.5.1 +androidx.compose.material:material-icons-core-android:1.5.1 +androidx.compose.material:material-icons-core:1.5.1 +androidx.compose.material:material-icons-extended-android:1.5.1 +androidx.compose.material:material-icons-extended:1.5.1 +androidx.compose.material:material-ripple-android:1.5.1 +androidx.compose.material:material-ripple:1.5.1 +androidx.compose.material:material:1.5.1 +androidx.compose.runtime:runtime-android:1.5.1 +androidx.compose.runtime:runtime-saveable-android:1.5.1 +androidx.compose.runtime:runtime-saveable:1.5.1 +androidx.compose.runtime:runtime:1.5.1 +androidx.compose.ui:ui-android:1.5.1 +androidx.compose.ui:ui-geometry-android:1.5.1 +androidx.compose.ui:ui-geometry:1.5.1 +androidx.compose.ui:ui-graphics-android:1.5.1 +androidx.compose.ui:ui-graphics:1.5.1 +androidx.compose.ui:ui-text-android:1.5.1 +androidx.compose.ui:ui-text:1.5.1 +androidx.compose.ui:ui-tooling-android:1.5.1 +androidx.compose.ui:ui-tooling-data-android:1.5.1 +androidx.compose.ui:ui-tooling-data:1.5.1 +androidx.compose.ui:ui-tooling-preview-android:1.5.1 +androidx.compose.ui:ui-tooling-preview:1.5.1 +androidx.compose.ui:ui-tooling:1.5.1 +androidx.compose.ui:ui-unit-android:1.5.1 +androidx.compose.ui:ui-unit:1.5.1 +androidx.compose.ui:ui-util-android:1.5.1 +androidx.compose.ui:ui-util:1.5.1 +androidx.compose.ui:ui:1.5.1 +androidx.concurrent:concurrent-futures:1.1.0 +androidx.constraintlayout:constraintlayout-solver:2.0.1 +androidx.constraintlayout:constraintlayout:2.0.1 +androidx.coordinatorlayout:coordinatorlayout:1.1.0 +androidx.core:core-ktx:1.10.0 +androidx.core:core:1.10.0 +androidx.cursoradapter:cursoradapter:1.0.0 +androidx.customview:customview-poolingcontainer:1.0.0 +androidx.customview:customview:1.1.0 +androidx.documentfile:documentfile:1.0.0 +androidx.drawerlayout:drawerlayout:1.1.1 +androidx.dynamicanimation:dynamicanimation:1.0.0 +androidx.emoji2:emoji2-views-helper:1.4.0 +androidx.emoji2:emoji2:1.4.0 +androidx.exifinterface:exifinterface:1.3.3 +androidx.fragment:fragment:1.3.6 +androidx.interpolator:interpolator:1.0.0 +androidx.legacy:legacy-support-core-utils:1.0.0 +androidx.lifecycle:lifecycle-common:2.6.2 +androidx.lifecycle:lifecycle-livedata-core:2.6.2 +androidx.lifecycle:lifecycle-livedata:2.6.2 +androidx.lifecycle:lifecycle-process:2.6.2 +androidx.lifecycle:lifecycle-runtime-ktx:2.6.2 +androidx.lifecycle:lifecycle-runtime:2.6.2 +androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2 +androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.2 +androidx.lifecycle:lifecycle-viewmodel:2.6.2 +androidx.loader:loader:1.0.0 +androidx.localbroadcastmanager:localbroadcastmanager:1.0.0 +androidx.print:print:1.0.0 +androidx.profileinstaller:profileinstaller:1.3.0 +androidx.recyclerview:recyclerview:1.1.0 +androidx.resourceinspection:resourceinspection-annotation:1.0.1 +androidx.savedstate:savedstate-ktx:1.2.1 +androidx.savedstate:savedstate:1.2.1 +androidx.startup:startup-runtime:1.1.1 +androidx.tracing:tracing:1.0.0 +androidx.transition:transition:1.2.0 +androidx.vectordrawable:vectordrawable-animated:1.1.0 +androidx.vectordrawable:vectordrawable:1.1.0 +androidx.versionedparcelable:versionedparcelable:1.1.1 +androidx.viewpager2:viewpager2:1.0.0 +androidx.viewpager:viewpager:1.0.0 +com.github.bumptech.glide:annotations:4.11.0 +com.github.bumptech.glide:disklrucache:4.11.0 +com.github.bumptech.glide:gifdecoder:4.11.0 +com.github.bumptech.glide:glide:4.11.0 +com.github.skydoves:landscapist-coil:1.3.0 +com.github.skydoves:landscapist:1.3.0 +com.google.accompanist:accompanist-coil:0.15.0 +com.google.accompanist:accompanist-drawablepainter:0.25.1 +com.google.accompanist:accompanist-imageloading-core:0.15.0 +com.google.android.material:material:1.9.0 +com.google.errorprone:error_prone_annotations:2.15.0 +com.google.guava:listenablefuture:1.0 +com.jakewharton.timber:timber:4.5.1 +com.squareup.okhttp3:logging-interceptor:4.11.0 +com.squareup.okhttp3:okhttp:4.11.0 +com.squareup.okio:okio-jvm:3.2.0 +com.squareup.okio:okio:3.2.0 +io.coil-kt:coil-base:2.2.0 +io.coil-kt:coil-compose-base:2.2.0 +io.coil-kt:coil-compose:2.2.0 +io.coil-kt:coil:2.2.0 +io.ktor:ktor-client-content-negotiation-jvm:2.1.0 +io.ktor:ktor-client-content-negotiation:2.1.0 +io.ktor:ktor-client-core-jvm:2.1.0 +io.ktor:ktor-client-core:2.1.0 +io.ktor:ktor-client-logging-jvm:2.1.0 +io.ktor:ktor-client-logging:2.1.0 +io.ktor:ktor-events-jvm:2.1.0 +io.ktor:ktor-events:2.1.0 +io.ktor:ktor-http-jvm:2.1.0 +io.ktor:ktor-http:2.1.0 +io.ktor:ktor-io-jvm:2.1.0 +io.ktor:ktor-io:2.1.0 +io.ktor:ktor-serialization-jvm:2.1.0 +io.ktor:ktor-serialization-kotlinx-json-jvm:2.1.0 +io.ktor:ktor-serialization-kotlinx-json:2.1.0 +io.ktor:ktor-serialization-kotlinx-jvm:2.1.0 +io.ktor:ktor-serialization-kotlinx:2.1.0 +io.ktor:ktor-serialization:2.1.0 +io.ktor:ktor-utils-jvm:2.1.0 +io.ktor:ktor-utils:2.1.0 +io.ktor:ktor-websocket-serialization-jvm:2.1.0 +io.ktor:ktor-websocket-serialization:2.1.0 +io.ktor:ktor-websockets-jvm:2.1.0 +io.ktor:ktor-websockets:2.1.0 +org.jetbrains.compose.foundation:foundation:1.5.1 +org.jetbrains.compose.material:material:1.5.1 +org.jetbrains.compose.ui:ui:1.5.1 +org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.7.10 +org.jetbrains.kotlin:kotlin-parcelize-runtime:1.7.10 +org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10 +org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.10 +org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10 +org.jetbrains.kotlin:kotlin-stdlib:1.9.10 +org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3 +org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3 +org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.3 +org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3 +org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.7.3 +org.jetbrains.kotlinx:kotlinx-coroutines-slf4j:1.7.3 +org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.4.1 +org.jetbrains.kotlinx:kotlinx-serialization-core:1.4.1 +org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.4.1 +org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1 +org.jetbrains:annotations:23.0.0 +org.slf4j:slf4j-api:1.7.36 diff --git a/app/dependencies/inmemoryDebugRuntimeClasspath.txt b/app/dependencies/inmemoryDebugRuntimeClasspath.txt deleted file mode 100644 index c1b1e1bb..00000000 --- a/app/dependencies/inmemoryDebugRuntimeClasspath.txt +++ /dev/null @@ -1,146 +0,0 @@ -:app-flavor-inmemory -:compose-ui -:mock-data -:models -:networking -:shopping-cart -androidx.activity:activity-compose:1.4.0 -androidx.activity:activity-ktx:1.4.0 -androidx.activity:activity:1.4.0 -androidx.annotation:annotation-experimental:1.1.0 -androidx.annotation:annotation:1.3.0 -androidx.appcompat:appcompat-resources:1.4.1 -androidx.appcompat:appcompat:1.4.1 -androidx.arch.core:core-common:2.1.0 -androidx.arch.core:core-runtime:2.1.0 -androidx.autofill:autofill:1.0.0 -androidx.cardview:cardview:1.0.0 -androidx.collection:collection-ktx:1.1.0 -androidx.collection:collection:1.1.0 -androidx.compose.animation:animation-core:1.2.0 -androidx.compose.animation:animation:1.2.0 -androidx.compose.compiler:compiler:1.3.0 -androidx.compose.foundation:foundation-layout:1.2.1 -androidx.compose.foundation:foundation:1.2.1 -androidx.compose.material:material-icons-core:1.2.1 -androidx.compose.material:material-icons-extended:1.2.0 -androidx.compose.material:material-ripple:1.2.1 -androidx.compose.material:material:1.2.1 -androidx.compose.runtime:runtime-saveable:1.2.1 -androidx.compose.runtime:runtime:1.2.1 -androidx.compose.ui:ui-geometry:1.2.1 -androidx.compose.ui:ui-graphics:1.2.1 -androidx.compose.ui:ui-text:1.2.1 -androidx.compose.ui:ui-tooling-data:1.2.0 -androidx.compose.ui:ui-tooling-preview:1.2.0 -androidx.compose.ui:ui-tooling:1.2.0 -androidx.compose.ui:ui-unit:1.2.1 -androidx.compose.ui:ui-util:1.2.1 -androidx.compose.ui:ui:1.2.1 -androidx.concurrent:concurrent-futures:1.0.0 -androidx.constraintlayout:constraintlayout-solver:2.0.1 -androidx.constraintlayout:constraintlayout:2.0.1 -androidx.coordinatorlayout:coordinatorlayout:1.1.0 -androidx.core:core-ktx:1.6.0 -androidx.core:core:1.7.0 -androidx.cursoradapter:cursoradapter:1.0.0 -androidx.customview:customview-poolingcontainer:1.0.0 -androidx.customview:customview:1.1.0 -androidx.documentfile:documentfile:1.0.0 -androidx.drawerlayout:drawerlayout:1.1.1 -androidx.dynamicanimation:dynamicanimation:1.0.0 -androidx.emoji2:emoji2-views-helper:1.0.0 -androidx.emoji2:emoji2:1.0.0 -androidx.exifinterface:exifinterface:1.3.2 -androidx.fragment:fragment:1.3.6 -androidx.interpolator:interpolator:1.0.0 -androidx.legacy:legacy-support-core-utils:1.0.0 -androidx.lifecycle:lifecycle-common-java8:2.4.1 -androidx.lifecycle:lifecycle-common:2.4.1 -androidx.lifecycle:lifecycle-livedata-core:2.3.1 -androidx.lifecycle:lifecycle-livedata:2.0.0 -androidx.lifecycle:lifecycle-process:2.4.0 -androidx.lifecycle:lifecycle-runtime-ktx:2.4.1 -androidx.lifecycle:lifecycle-runtime:2.4.1 -androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1 -androidx.lifecycle:lifecycle-viewmodel-savedstate:2.3.1 -androidx.lifecycle:lifecycle-viewmodel:2.3.1 -androidx.loader:loader:1.0.0 -androidx.localbroadcastmanager:localbroadcastmanager:1.0.0 -androidx.print:print:1.0.0 -androidx.profileinstaller:profileinstaller:1.2.0 -androidx.recyclerview:recyclerview:1.1.0 -androidx.resourceinspection:resourceinspection-annotation:1.0.0 -androidx.savedstate:savedstate-ktx:1.2.0 -androidx.savedstate:savedstate:1.2.0 -androidx.startup:startup-runtime:1.1.1 -androidx.tracing:tracing:1.0.0 -androidx.transition:transition:1.2.0 -androidx.vectordrawable:vectordrawable-animated:1.1.0 -androidx.vectordrawable:vectordrawable:1.1.0 -androidx.versionedparcelable:versionedparcelable:1.1.1 -androidx.viewpager2:viewpager2:1.0.0 -androidx.viewpager:viewpager:1.0.0 -com.github.bumptech.glide:annotations:4.11.0 -com.github.bumptech.glide:disklrucache:4.11.0 -com.github.bumptech.glide:gifdecoder:4.11.0 -com.github.bumptech.glide:glide:4.11.0 -com.github.skydoves:landscapist-coil:1.3.0 -com.github.skydoves:landscapist:1.3.0 -com.google.accompanist:accompanist-coil:0.15.0 -com.google.accompanist:accompanist-imageloading-core:0.15.0 -com.google.android.material:material:1.5.0 -com.google.guava:listenablefuture:1.0 -com.jakewharton.timber:timber:4.5.1 -com.squareup.okhttp3:logging-interceptor:4.9.3 -com.squareup.okhttp3:okhttp:4.9.3 -com.squareup.okio:okio:2.10.0 -io.coil-kt:coil-base:1.3.1 -io.coil-kt:coil-compose-base:1.3.1 -io.coil-kt:coil-compose:1.3.1 -io.coil-kt:coil:1.3.1 -io.ktor:ktor-client-content-negotiation-jvm:2.1.0 -io.ktor:ktor-client-content-negotiation:2.1.0 -io.ktor:ktor-client-core-jvm:2.1.0 -io.ktor:ktor-client-core:2.1.0 -io.ktor:ktor-client-logging-jvm:2.1.0 -io.ktor:ktor-client-logging:2.1.0 -io.ktor:ktor-events-jvm:2.1.0 -io.ktor:ktor-events:2.1.0 -io.ktor:ktor-http-jvm:2.1.0 -io.ktor:ktor-http:2.1.0 -io.ktor:ktor-io-jvm:2.1.0 -io.ktor:ktor-io:2.1.0 -io.ktor:ktor-serialization-jvm:2.1.0 -io.ktor:ktor-serialization-kotlinx-json-jvm:2.1.0 -io.ktor:ktor-serialization-kotlinx-json:2.1.0 -io.ktor:ktor-serialization-kotlinx-jvm:2.1.0 -io.ktor:ktor-serialization-kotlinx:2.1.0 -io.ktor:ktor-serialization:2.1.0 -io.ktor:ktor-utils-jvm:2.1.0 -io.ktor:ktor-utils:2.1.0 -io.ktor:ktor-websocket-serialization-jvm:2.1.0 -io.ktor:ktor-websocket-serialization:2.1.0 -io.ktor:ktor-websockets-jvm:2.1.0 -io.ktor:ktor-websockets:2.1.0 -org.jetbrains.compose.foundation:foundation:1.2.0-alpha01-dev770 -org.jetbrains.compose.material:material:1.2.0-alpha01-dev770 -org.jetbrains.compose.ui:ui:1.2.0-alpha01-dev770 -org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.5.10 -org.jetbrains.kotlin:kotlin-parcelize-runtime:1.5.10 -org.jetbrains.kotlin:kotlin-stdlib-common:1.7.10 -org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10 -org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10 -org.jetbrains.kotlin:kotlin-stdlib:1.7.10 -org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 -org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.4 -org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4 -org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4 -org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.6.4 -org.jetbrains.kotlinx:kotlinx-coroutines-slf4j:1.6.4 -org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.4.0 -org.jetbrains.kotlinx:kotlinx-serialization-core:1.4.0 -org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.4.0 -org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.0 -org.jetbrains:annotations:13.0 -org.slf4j:slf4j-api:1.7.36 diff --git a/app/lint-baseline.xml b/app/lint-baseline.xml index 6c3fcd6f..4fda7f40 100644 --- a/app/lint-baseline.xml +++ b/app/lint-baseline.xml @@ -1,11 +1,11 @@ - + + message="Lint found one or more custom checks that could not be loaded. The most likely reason for this is that it is using an older, incompatible or unsupported API in lint. Make sure these lint checks are updated to the new APIs. The issue registry class is timber.lint.IssueRegistry. The class loading issue is com/android/tools/lint/detector/api/Detector$JavaPsiScanner: ClassLoader.defineClass1(ClassLoader.java:-2)←ClassLoader.defineClass(ClassLoader.java:1012)←UrlClassLoader.consumeClassData(UrlClassLoader.java:258)←JdkZipResourceFile.findClass(JdkZipResourceFile.java:89)←JarLoader.findClass(JarLoader.java:63)←ClassPath.findClassInLoader(ClassPath.java:243)←ClassPath.findClass(ClassPath.java:176)←UrlClassLoader.findClass(UrlClassLoader.java:214)←ClassLoader.loadClass(ClassLoader.java:587)←ClassLoader.loadClass(ClassLoader.java:520)←IssueRegistry.getIssues(IssueRegistry.java:10)←JarFileIssueRegistry$Factory.loadIssueRegistry(JarFileIssueRegistry.kt:263)←JarFileIssueRegistry$Factory.get(JarFileIssueRegistry.kt:181)←JarFileIssueRegistry$Factory.get(JarFileIssueRegistry.kt:140)←JarFileIssueRegistry$Factory.get$default(JarFileIssueRegistry.kt:113)←LintDriver.registerCustomDetectors(LintDriver.kt:689)←LintDriver.initializeExtraRegistries(LintDriver.kt:587)←LintDriver.doAnalyze(LintDriver.kt:485)←LintDriver.doAnalyze$default(LintDriver.kt:473)←LintDriver.mergeOnly(LintDriver.kt:459)←LintCliClient$mergeOnly$1.invoke(LintCliClient.kt:251)←LintCliClient$mergeOnly$1.invoke(LintCliClient.kt:248)←LintCliClient.run(LintCliClient.kt:279)←LintCliClient.mergeOnly(LintCliClient.kt:248)←Main.run(Main.java:1691)←Main.run(Main.java:275)←NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)←NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)←DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)←Method.invoke(Method.java:568)←AndroidLintWorkAction.invokeLintMainRunMethod(AndroidLintWorkAction.kt:98)←AndroidLintWorkAction.runLint(AndroidLintWorkAction.kt:87)←AndroidLintWorkAction.execute(AndroidLintWorkAction.kt:62)←DefaultWorkerServer.execute(DefaultWorkerServer.java:63)←NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:66)←NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:62)←ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:100)←NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:62)←AbstractWorker$1.call(AbstractWorker.java:44)←AbstractWorker$1.call(AbstractWorker.java:41)←DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)←DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)←DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)←DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)←DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)←DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)←DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)←DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)←AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)←NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:59)←DefaultWorkerExecutor.lambda$submitWork$0(DefaultWorkerExecutor.java:170)←FutureTask.run(FutureTask.java:264)←DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:187)←DefaultConditionalExecutionQueue$ExecutionRunner.access$700(DefaultConditionalExecutionQueue.java:120)←DefaultConditionalExecutionQueue$ExecutionRunner$1.run(DefaultConditionalExecutionQueue.java:162)←Factories$1.create(Factories.java:31)←DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:264)←DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:128)←DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:133)←DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:157)←DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:126)←Executors$RunnableAdapter.call(Executors.java:539)←FutureTask.run(FutureTask.java:264)←ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)←AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)←ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)←ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)←Thread.run(Thread.java:833)"> + file="$GRADLE_USER_HOME/caches/transforms-4/3330de6bef117ba9a3353d95b2b49f0e/transformed/timber-4.5.1/jars/lint.jar"/> + + + + + id="AndroidGradlePluginVersion" + message="A newer version of com.android.tools.build:gradle than 8.1.0 is available: 8.3.0. (There is also a newer version of 8.1.𝑥 available, if upgrading to 8.3.0 is difficult: 8.1.4)" + errorLine1="android_gradle_plugin = "8.1.0"" + errorLine2=" ~~~~~~~"> + file="$HOME/Development/ShoppingApp/gradle/libs.versions.toml" + line="3" + column="25"/> + + + + + + + + + + + + + id="GradleDependency" + message="A newer version of androidx.lifecycle:lifecycle-runtime-ktx than 2.6.2 is available: 2.7.0" + errorLine1="androidx_lifecycle = "2.6.2"" + errorLine2=" ~~~~~~~"> + file="$HOME/Development/ShoppingApp/gradle/libs.versions.toml" + line="10" + column="22"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + = + ActivityScenario.launch(LoginActivity::class.java) + + activityScenario.moveToState(Lifecycle.State.RESUMED) + + onView(withId(R.id.password)).perform(typeText("password")) + + activityScenario.moveToState(Lifecycle.State.DESTROYED) + } + +} \ No newline at end of file diff --git a/app/src/androidTest/java/com/handstandsam/shoppingapp/tests/Test.kt b/app/src/androidTest/java/com/handstandsam/shoppingapp/tests/Test.kt deleted file mode 100644 index 570f1105..00000000 --- a/app/src/androidTest/java/com/handstandsam/shoppingapp/tests/Test.kt +++ /dev/null @@ -1,17 +0,0 @@ -package com.handstandsam.shoppingapp.tests - -import org.junit.Test - -class Test { - - @Test - fun testException() { - throw RuntimeException("Test Exception!") - } - - @Test - fun testSuccess() { - throw RuntimeException("Test Success!") - } - -} \ No newline at end of file diff --git a/dependencies/classpath.txt b/dependencies/classpath.txt index e0644875..ba19c205 100644 --- a/dependencies/classpath.txt +++ b/dependencies/classpath.txt @@ -1,74 +1,69 @@ -androidx.databinding:databinding-common:7.2.2 -androidx.databinding:databinding-compiler-common:7.2.2 -com.android.databinding:baseLibrary:7.2.2 -com.android.tools.analytics-library:crash:30.2.2 -com.android.tools.analytics-library:protos:30.2.2 -com.android.tools.analytics-library:shared:30.2.2 -com.android.tools.analytics-library:tracker:30.2.2 -com.android.tools.build.jetifier:jetifier-core:1.0.0-beta09 -com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta09 -com.android.tools.build:aapt2-proto:7.2.2-7984345 -com.android.tools.build:aaptcompiler:7.2.2 -com.android.tools.build:apksig:7.2.2 -com.android.tools.build:apkzlib:7.2.2 -com.android.tools.build:builder-model:7.2.2 -com.android.tools.build:builder-test-api:7.2.2 -com.android.tools.build:builder:7.2.2 -com.android.tools.build:bundletool:1.8.2 -com.android.tools.build:gradle-api:7.2.2 -com.android.tools.build:gradle:7.2.2 -com.android.tools.build:manifest-merger:30.2.2 +androidx.databinding:databinding-common:8.1.0 +androidx.databinding:databinding-compiler-common:8.1.0 +com.android.databinding:baseLibrary:8.1.0 +com.android.tools.analytics-library:crash:31.1.0 +com.android.tools.analytics-library:protos:31.1.0 +com.android.tools.analytics-library:shared:31.1.0 +com.android.tools.analytics-library:tracker:31.1.0 +com.android.tools.build.jetifier:jetifier-core:1.0.0-beta10 +com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta10 +com.android.tools.build:aapt2-proto:8.1.0-10154469 +com.android.tools.build:aaptcompiler:8.1.0 +com.android.tools.build:apksig:8.1.0 +com.android.tools.build:apkzlib:8.1.0 +com.android.tools.build:builder-model:8.1.0 +com.android.tools.build:builder-test-api:8.1.0 +com.android.tools.build:builder:8.1.0 +com.android.tools.build:bundletool:1.14.0 +com.android.tools.build:gradle-api:8.1.0 +com.android.tools.build:gradle-settings-api:8.1.0 +com.android.tools.build:gradle:8.1.0 +com.android.tools.build:manifest-merger:31.1.0 com.android.tools.build:transform-api:2.0.0-deprecated-use-gradle-api -com.android.tools.ddms:ddmlib:30.2.2 -com.android.tools.layoutlib:layoutlib-api:30.2.2 -com.android.tools.lint:lint-model:30.2.2 -com.android.tools.lint:lint-typedef-remover:30.2.2 -com.android.tools.utp:android-device-provider-ddmlib-proto:30.2.2 -com.android.tools.utp:android-device-provider-gradle-proto:30.2.2 -com.android.tools.utp:android-test-plugin-host-additional-test-output-proto:30.2.2 -com.android.tools.utp:android-test-plugin-host-coverage-proto:30.2.2 -com.android.tools.utp:android-test-plugin-host-retention-proto:30.2.2 -com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:30.2.2 -com.android.tools:annotations:30.2.2 -com.android.tools:common:30.2.2 -com.android.tools:dvlib:30.2.2 -com.android.tools:repository:30.2.2 -com.android.tools:sdk-common:30.2.2 -com.android.tools:sdklib:30.2.2 -com.android:signflinger:7.2.2 -com.android:zipflinger:7.2.2 +com.android.tools.ddms:ddmlib:31.1.0 +com.android.tools.layoutlib:layoutlib-api:31.1.0 +com.android.tools.lint:lint-model:31.1.0 +com.android.tools.lint:lint-typedef-remover:31.1.0 +com.android.tools.utp:android-device-provider-ddmlib-proto:31.1.0 +com.android.tools.utp:android-device-provider-gradle-proto:31.1.0 +com.android.tools.utp:android-test-plugin-host-additional-test-output-proto:31.1.0 +com.android.tools.utp:android-test-plugin-host-apk-installer-proto:31.1.0 +com.android.tools.utp:android-test-plugin-host-coverage-proto:31.1.0 +com.android.tools.utp:android-test-plugin-host-emulator-control-proto:31.1.0 +com.android.tools.utp:android-test-plugin-host-logcat-proto:31.1.0 +com.android.tools.utp:android-test-plugin-host-retention-proto:31.1.0 +com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:31.1.0 +com.android.tools:annotations:31.1.0 +com.android.tools:common:31.1.0 +com.android.tools:dvlib:31.1.0 +com.android.tools:repository:31.1.0 +com.android.tools:sdk-common:31.1.0 +com.android.tools:sdklib:31.1.0 +com.android:signflinger:8.1.0 +com.android:zipflinger:8.1.0 com.annimon:stream:1.1.7 -com.dropbox.dependency-guard:com.dropbox.dependency-guard.gradle.plugin:0.4.0 -com.dropbox.dependency-guard:dependency-guard:0.4.0 -com.fasterxml.jackson.core:jackson-annotations:2.11.1 -com.fasterxml.jackson.core:jackson-core:2.11.1 -com.fasterxml.jackson.core:jackson-databind:2.11.1 -com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.11.1 -com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.11.1 -com.fasterxml.jackson.module:jackson-module-kotlin:2.11.1 -com.fasterxml.woodstox:woodstox-core:6.2.1 -com.github.gundy:semver4j:0.16.4 +com.dropbox.dependency-guard:com.dropbox.dependency-guard.gradle.plugin:0.5.0 +com.dropbox.dependency-guard:dependency-guard:0.5.0 com.google.android:annotations:4.1.1.4 -com.google.api.grpc:proto-google-common-protos:1.12.0 +com.google.api.grpc:proto-google-common-protos:2.0.1 com.google.auto.value:auto-value-annotations:1.6.2 com.google.code.findbugs:jsr305:3.0.2 com.google.code.gson:gson:2.8.9 -com.google.crypto.tink:tink:1.3.0-rc2 +com.google.crypto.tink:tink:1.7.0 com.google.dagger:dagger:2.28.3 -com.google.errorprone:error_prone_annotations:2.3.4 +com.google.errorprone:error_prone_annotations:2.11.0 com.google.flatbuffers:flatbuffers-java:1.12.0 com.google.guava:failureaccess:1.0.1 -com.google.guava:guava:30.1-jre +com.google.guava:guava:31.1-jre com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava com.google.j2objc:j2objc-annotations:1.3 com.google.jimfs:jimfs:1.1 -com.google.protobuf:protobuf-java-util:3.10.0 -com.google.protobuf:protobuf-java:3.10.0 -com.google.testing.platform:core-proto:0.0.8-alpha07 -com.googlecode.json-simple:json-simple:1.1 +com.google.protobuf:protobuf-java-util:3.19.3 +com.google.protobuf:protobuf-java:3.19.3 +com.google.testing.platform:core-proto:0.0.8-alpha08 com.googlecode.juniversalchardet:juniversalchardet:1.0.3 com.handstandsam.kmp4free:kmp4free:0.1.0 -com.squareup.sqldelight:gradle-plugin:1.5.3 +com.squareup.sqldelight:gradle-plugin:1.5.5 com.squareup:javapoet:1.10.0 com.squareup:javawriter:2.5.0 com.sun.activation:javax.activation:1.2.0 @@ -78,90 +73,83 @@ commons-codec:commons-codec:1.11 commons-io:commons-io:2.4 commons-logging:commons-logging:1.2 de.danielbechler:java-object-diff:0.95 -de.undercouch:gradle-download-task:4.1.1 -io.grpc:grpc-api:1.21.1 -io.grpc:grpc-context:1.21.1 -io.grpc:grpc-core:1.21.1 -io.grpc:grpc-netty:1.21.1 -io.grpc:grpc-protobuf-lite:1.21.1 -io.grpc:grpc-protobuf:1.21.1 -io.grpc:grpc-stub:1.21.1 -io.netty:netty-buffer:4.1.34.Final -io.netty:netty-codec-http2:4.1.34.Final -io.netty:netty-codec-http:4.1.34.Final -io.netty:netty-codec-socks:4.1.34.Final -io.netty:netty-codec:4.1.34.Final -io.netty:netty-common:4.1.34.Final -io.netty:netty-handler-proxy:4.1.34.Final -io.netty:netty-handler:4.1.34.Final -io.netty:netty-resolver:4.1.34.Final -io.netty:netty-transport:4.1.34.Final -io.opencensus:opencensus-api:0.21.0 -io.opencensus:opencensus-contrib-grpc-metrics:0.21.0 -it.unimi.dsi:fastutil:8.4.0 +io.grpc:grpc-api:1.45.1 +io.grpc:grpc-context:1.45.1 +io.grpc:grpc-core:1.45.1 +io.grpc:grpc-netty:1.45.1 +io.grpc:grpc-protobuf-lite:1.45.1 +io.grpc:grpc-protobuf:1.45.1 +io.grpc:grpc-stub:1.45.1 +io.netty:netty-buffer:4.1.72.Final +io.netty:netty-codec-http2:4.1.72.Final +io.netty:netty-codec-http:4.1.72.Final +io.netty:netty-codec-socks:4.1.72.Final +io.netty:netty-codec:4.1.72.Final +io.netty:netty-common:4.1.72.Final +io.netty:netty-handler-proxy:4.1.72.Final +io.netty:netty-handler:4.1.72.Final +io.netty:netty-resolver:4.1.72.Final +io.netty:netty-tcnative-classes:2.0.46.Final +io.netty:netty-transport:4.1.72.Final +io.perfmark:perfmark-api:0.23.0 jakarta.activation:jakarta.activation-api:1.2.1 jakarta.xml.bind:jakarta.xml.bind-api:2.3.2 +javax.annotation:javax.annotation-api:1.3.2 javax.inject:javax.inject:1 net.java.dev.jna:jna-platform:5.6.0 net.java.dev.jna:jna:5.6.0 net.sf.jopt-simple:jopt-simple:4.9 net.sf.kxml:kxml2:2.3.0 -org.apache.commons:commons-compress:1.20 -org.apache.httpcomponents:httpclient:4.5.9 -org.apache.httpcomponents:httpcore:4.4.11 +org.apache.commons:commons-compress:1.21 +org.apache.httpcomponents:httpclient:4.5.13 +org.apache.httpcomponents:httpcore:4.4.15 org.apache.httpcomponents:httpmime:4.5.6 org.bitbucket.b_c:jose4j:0.7.0 -org.bouncycastle:bcpkix-jdk15on:1.56 -org.bouncycastle:bcprov-jdk15on:1.56 -org.checkerframework:checker-qual:3.5.0 -org.codehaus.mojo:animal-sniffer-annotations:1.17 -org.codehaus.woodstox:stax2-api:4.2.1 +org.bouncycastle:bcpkix-jdk15on:1.67 +org.bouncycastle:bcprov-jdk15on:1.67 +org.checkerframework:checker-qual:3.12.0 +org.codehaus.mojo:animal-sniffer-annotations:1.19 org.glassfish.jaxb:jaxb-runtime:2.3.2 org.glassfish.jaxb:txw2:2.3.2 org.jdom:jdom2:2.0.6 -org.jetbrains.compose:compose-gradle-plugin:1.2.0-alpha01-dev770 -org.jetbrains.dokka:dokka-core:1.4.32 +org.jetbrains.compose:compose-gradle-plugin:1.5.1 org.jetbrains.intellij.deps:trove4j:1.0.20200330 -org.jetbrains.kotlin:kotlin-android-extensions:1.7.10 -org.jetbrains.kotlin:kotlin-annotation-processing-gradle:1.7.10 -org.jetbrains.kotlin:kotlin-build-common:1.7.10 -org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.10 -org.jetbrains.kotlin:kotlin-compiler-runner:1.7.10 -org.jetbrains.kotlin:kotlin-daemon-client:1.7.10 -org.jetbrains.kotlin:kotlin-daemon-embeddable:1.7.10 -org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.7.10 -org.jetbrains.kotlin:kotlin-gradle-plugin-idea:1.7.10 -org.jetbrains.kotlin:kotlin-gradle-plugin-model:1.7.10 -org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10 -org.jetbrains.kotlin:kotlin-klib-commonizer-api:1.7.10 -org.jetbrains.kotlin:kotlin-native-utils:1.7.10 -org.jetbrains.kotlin:kotlin-project-model:1.7.10 -org.jetbrains.kotlin:kotlin-reflect:1.5.31 -org.jetbrains.kotlin:kotlin-scripting-common:1.7.10 -org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.7.10 -org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.7.10 -org.jetbrains.kotlin:kotlin-scripting-jvm:1.7.10 -org.jetbrains.kotlin:kotlin-stdlib-common:1.5.31 -org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.31 -org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31 -org.jetbrains.kotlin:kotlin-stdlib:1.5.31 -org.jetbrains.kotlin:kotlin-tooling-core:1.7.10 -org.jetbrains.kotlin:kotlin-tooling-metadata:1.7.10 -org.jetbrains.kotlin:kotlin-util-io:1.7.10 -org.jetbrains.kotlin:kotlin-util-klib:1.7.10 +org.jetbrains.kotlin:kotlin-android-extensions:1.9.10 +org.jetbrains.kotlin:kotlin-build-tools-api:1.9.10 +org.jetbrains.kotlin:kotlin-compiler-embeddable:1.9.10 +org.jetbrains.kotlin:kotlin-compiler-runner:1.9.10 +org.jetbrains.kotlin:kotlin-daemon-client:1.9.10 +org.jetbrains.kotlin:kotlin-daemon-embeddable:1.9.10 +org.jetbrains.kotlin:kotlin-gradle-plugin-annotations:1.9.10 +org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.9.10 +org.jetbrains.kotlin:kotlin-gradle-plugin-idea-proto:1.9.10 +org.jetbrains.kotlin:kotlin-gradle-plugin-idea:1.9.10 +org.jetbrains.kotlin:kotlin-gradle-plugin-model:1.9.10 +org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10 +org.jetbrains.kotlin:kotlin-gradle-plugins-bom:1.9.10 +org.jetbrains.kotlin:kotlin-klib-commonizer-api:1.9.10 +org.jetbrains.kotlin:kotlin-native-utils:1.9.10 +org.jetbrains.kotlin:kotlin-project-model:1.9.10 +org.jetbrains.kotlin:kotlin-reflect:1.8.20-RC2 +org.jetbrains.kotlin:kotlin-scripting-common:1.9.10 +org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.9.10 +org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.9.10 +org.jetbrains.kotlin:kotlin-scripting-jvm:1.9.10 +org.jetbrains.kotlin:kotlin-stdlib-common:1.8.20-RC2 +org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.20-RC2 +org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20-RC2 +org.jetbrains.kotlin:kotlin-stdlib:1.8.20-RC2 +org.jetbrains.kotlin:kotlin-tooling-core:1.9.10 +org.jetbrains.kotlin:kotlin-util-io:1.9.10 +org.jetbrains.kotlin:kotlin-util-klib:1.9.10 org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.0 -org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1 org.jetbrains:annotations:13.0 -org.jetbrains:markdown-jvm:0.2.1 -org.jetbrains:markdown:0.2.1 -org.json:json:20180813 -org.jsoup:jsoup:1.13.1 org.jvnet.staxex:stax-ex:1.8.1 -org.ow2.asm:asm-analysis:9.1 -org.ow2.asm:asm-commons:9.1 -org.ow2.asm:asm-tree:9.1 -org.ow2.asm:asm-util:9.1 -org.ow2.asm:asm:9.1 +org.ow2.asm:asm-analysis:9.2 +org.ow2.asm:asm-commons:9.2 +org.ow2.asm:asm-tree:9.2 +org.ow2.asm:asm-util:9.2 +org.ow2.asm:asm:9.2 org.slf4j:slf4j-api:1.7.30 org.tensorflow:tensorflow-lite-metadata:0.1.0-rc2 org.threeten:threetenbp:1.3.3 diff --git a/gradle.properties b/gradle.properties index e5877d17..9fb4e54c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,7 +11,7 @@ # The setting is particularly useful for tweaking memory settings. android.enableJetifier=false android.useAndroidX=true -org.gradle.jvmargs=-Xmx1536m +org.gradle.jvmargs=-Xmx4g # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit @@ -29,4 +29,7 @@ kotlin.mpp.enableCInteropCommonization=true # KMP4FREE kmp4free=true ios=false -js=true \ No newline at end of file +js=true + +# Temp property to not have to upgrade AGP for now +android.suppressUnsupportedCompileSdk=34 \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0d363f33..6f763f44 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -17,7 +17,7 @@ assertj = "3.23.1" coil_compose = "2.2.0" compose = "1.5.1" compose_compiler = "1.5.3" -dependency_guard = "0.4.0" +dependency_guard = "0.5.0" espresso = "3.5.1" glide = "4.11.0" jetbrains_compose = "1.5.1" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index db9a6b82..17655d0e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle b/settings.gradle index 75e19b37..d3593500 100644 --- a/settings.gradle +++ b/settings.gradle @@ -15,6 +15,8 @@ plugins { rootProject.name = 'ShoppingApp' include ':app' +include ':app-test-host' +include ':app-test-suite' include ':app-flavor-inmemory' include ':app-flavor-liveserver' include ':app-flavor-mockserver' diff --git a/shopping-cart-room/build.gradle b/shopping-cart-room/build.gradle index 0a4ee34e..26157534 100644 --- a/shopping-cart-room/build.gradle +++ b/shopping-cart-room/build.gradle @@ -22,8 +22,8 @@ dependencies { implementation libs.androidx.lifecycle.livedata.core // LiveData for Reactive Streams from Queries -// // Unit Tests -// androidTestImplementation libs.junit -// androidTestImplementation libs.androidx.persistence.room.test // Test helpers -// androidTestImplementation libs.androidx.testrunner + // Unit Tests + androidTestImplementation libs.junit + androidTestImplementation libs.androidx.persistence.room.test // Test helpers + androidTestImplementation libs.androidx.testrunner } \ No newline at end of file diff --git a/shopping-cart-room/src/androidTest/java/com/handstandsam/shoppingapp/cart/RoomShoppingCartTest.kt b/shopping-cart-room/src/androidTest/java/com/handstandsam/shoppingapp/cart/RoomShoppingCartTest.kt index 01a042f9..ec9906ab 100644 --- a/shopping-cart-room/src/androidTest/java/com/handstandsam/shoppingapp/cart/RoomShoppingCartTest.kt +++ b/shopping-cart-room/src/androidTest/java/com/handstandsam/shoppingapp/cart/RoomShoppingCartTest.kt @@ -3,8 +3,10 @@ package com.handstandsam.shoppingapp.cart import android.os.Handler import android.os.Looper import com.handstandsam.shoppingapp.models.Item +import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.runBlocking import org.junit.Before +import org.junit.Ignore import org.junit.Test import java.util.concurrent.CountDownLatch import java.util.concurrent.TimeUnit @@ -14,69 +16,72 @@ import java.util.concurrent.TimeUnit */ class RoomShoppingCartTest { - private lateinit var testDelegate: RoomShoppingCartTestDelegate + private lateinit var testDelegate: RoomShoppingCartTestDelegate - @Before - fun setUp() { - //Using a latch is a hack to force the cart observer to register on the Main thread, but wait until it's done. - val latch = CountDownLatch(1) - Handler(Looper.getMainLooper()).post { - testDelegate = RoomShoppingCartTestDelegate() - latch.countDown() - } - latch.await(1, TimeUnit.SECONDS) + @Before + fun setUp() { + //Using a latch is a hack to force the cart observer to register on the Main thread, but wait until it's done. + val latch = CountDownLatch(1) + Handler(Looper.getMainLooper()).post { + testDelegate = RoomShoppingCartTestDelegate().apply { + runBlocking(Dispatchers.IO) { clearDb() } + } + latch.countDown() } + latch.await(1, TimeUnit.SECONDS) + } - @Test - fun happyPath() = runBlocking { - testDelegate - .assertTotalItemsInCart(0, 0) - .incrementItemInCart(item1) - .assertPersisted(item1, 1) - .assertTotalItemsInCart(1, 1) - .incrementItemInCart(item2) - .assertPersisted(item1, quantity = 1) - .assertPersisted(item2, quantity = 1) - .assertTotalItemsInCart(2, 2) - .incrementItemInCart(item1) - .assertPersisted(item1, quantity = 2) - .assertTotalItemsInCart(2, 3) - .decrementItemInCart(item2) - .assertTotalItemsInCart(1, 2) - .assertPersisted(item1, quantity = 2) - .clearDb() - .assertTotalItemsInCart(0, 0) - } + @Ignore + @Test + fun happyPath() = runBlocking { + testDelegate + .assertTotalItemsInCart(0, 0) + .incrementItemInCart(item1) + .assertPersisted(item1, 1) + .assertTotalItemsInCart(1, 1) + .incrementItemInCart(item2) + .assertPersisted(item1, expectedQuantity = 1) + .assertPersisted(item2, expectedQuantity = 1) + .assertTotalItemsInCart(2, 2) + .incrementItemInCart(item1) + .assertPersisted(item1, expectedQuantity = 2) + .assertTotalItemsInCart(2, 3) + .decrementItemInCart(item2) + .assertTotalItemsInCart(1, 2) + .assertPersisted(item1, expectedQuantity = 2) + .clearDb() + .assertTotalItemsInCart(0, 0) + } - @Test - fun removeItemThatIsNotThere() = runBlocking { - testDelegate - .assertTotalItemsInCart(0, 0) - .decrementItemInCart(item2) - .assertTotalItemsInCart(0, 0) - } + @Test + fun removeItemThatIsNotThere() = runBlocking { + testDelegate + .assertTotalItemsInCart(0, 0) + .decrementItemInCart(item2) + .assertTotalItemsInCart(0, 0) + } - @Test - fun add300Items() = runBlocking { - val limit = 300 - (1..limit).forEach { _ -> - testDelegate.incrementItemInCart(item1) - } - testDelegate.assertTotalItemsInCart(1, limit) + @Ignore + @Test + fun add300Items() = runBlocking { + val limit = 300 + (1..limit).forEach { _ -> + testDelegate.incrementItemInCart(item1) } + testDelegate.assertTotalItemsInCart(1, limit) + } - companion object { - val item1 = Item( - label = "Cool Thing 1", - image = "https://...jpg", - link = null - ) - - val item2 = Item( - label = "Cool Thing 2", - image = "https://...jpg", - link = null - ) - } + companion object { + val item1 = Item( + label = "Cool Thing 1", + image = "https://...jpg", + link = null + ) + val item2 = Item( + label = "Cool Thing 2", + image = "https://...jpg", + link = null + ) + } } \ No newline at end of file diff --git a/shopping-cart-room/src/androidTest/java/com/handstandsam/shoppingapp/cart/RoomShoppingCartTestDelegate.kt b/shopping-cart-room/src/androidTest/java/com/handstandsam/shoppingapp/cart/RoomShoppingCartTestDelegate.kt index b1bc7376..4746d940 100644 --- a/shopping-cart-room/src/androidTest/java/com/handstandsam/shoppingapp/cart/RoomShoppingCartTestDelegate.kt +++ b/shopping-cart-room/src/androidTest/java/com/handstandsam/shoppingapp/cart/RoomShoppingCartTestDelegate.kt @@ -28,14 +28,14 @@ class RoomShoppingCartTestDelegate { println("after adding item: ${shoppingCart.latestItemsInCart()}") } - suspend fun assertPersisted(item: Item, quantity: Long) = apply { - println("asserting there is $quantity of $item") + suspend fun assertPersisted(expectedItem: Item, expectedQuantity: Long) = apply { + println("asserting there is $expectedQuantity of $expectedItem") val matchingItemsInCart = shoppingCart.latestItemsInCart() - .filter { it.item.label == item.label } + .filter { it.item.label == expectedItem.label } assertEquals(matchingItemsInCart.size, 1) val matchingItemInCart = matchingItemsInCart[0] - assertEquals(matchingItemInCart.item, item) - assertEquals(matchingItemInCart.quantity, quantity) + assertEquals(expectedItem, matchingItemInCart.item) + assertEquals(expectedQuantity, matchingItemInCart.quantity) } suspend fun assertTotalItemsInCart(typeCount: Int, totalCount: Int) = apply {