Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix #5435: Fix Espresso tests in Gradle #5467

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 82 additions & 85 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 33
buildToolsVersion "30.0.2"
compileSdkVersion target_sdk_version
buildToolsVersion build_tools_version
defaultConfig {
applicationId "org.oppia.android"
minSdkVersion 21
targetSdkVersion 33
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version
versionCode 1
versionName "1.0"
multiDexEnabled true
Expand Down Expand Up @@ -155,90 +155,87 @@ if (project.gradle.startParameter?.taskRequests?.args[0]?.remove("--list-shards"
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation(
'androidx.appcompat:appcompat:1.0.2',
"androidx.compose.foundation:foundation:$compose_version",
"androidx.compose.foundation:foundation-layout:$compose_version",
"androidx.compose.material:material:$compose_version",
"androidx.compose.runtime:runtime:$compose_version",
"androidx.compose.runtime:runtime-livedata:$compose_version",
"androidx.compose.ui:ui:$compose_version",
"androidx.compose.ui:ui-tooling:$compose_version",
'androidx.constraintlayout:constraintlayout:1.1.3',
'androidx.core:core-ktx:1.0.2',
'androidx.legacy:legacy-support-v4:1.0.0',
'androidx.lifecycle:lifecycle-extensions:2.0.0',
'androidx.lifecycle:lifecycle-runtime-ktx:2.2.0-alpha03',
'androidx.navigation:navigation-fragment:2.0.0',
'androidx.navigation:navigation-fragment-ktx:2.0.0',
'androidx.navigation:navigation-ui:2.0.0',
'androidx.navigation:navigation-ui-ktx:2.0.0',
"androidx.fragment:fragment:$fragment_version",
'androidx.lifecycle:lifecycle-runtime-ktx:2.2.0-alpha03',
'androidx.multidex:multidex:2.0.1',
'androidx.recyclerview:recyclerview:1.0.0',
'androidx.work:work-runtime-ktx:2.4.0',
'com.github.bumptech.glide:glide:4.11.0',
'com.google.android.flexbox:flexbox:3.0.0',
'com.google.android.material:material:1.3.0',
"com.google.android.material:compose-theme-adapter:$compose_version",
'com.google.dagger:dagger:2.41',
'com.google.firebase:firebase-analytics:17.5.0',
'com.google.firebase:firebase-analytics-ktx:17.5.0',
'com.google.firebase:firebase-appcheck:16.0.0',
'com.google.firebase:firebase-appcheck-debug:16.0.0',
'com.google.firebase:firebase-appcheck-playintegrity:16.0.0',
'com.google.firebase:firebase-core:17.5.0',
'com.google.firebase:firebase-crashlytics:17.0.0',
'com.google.firebase:firebase-firestore-ktx:24.2.1',
'com.google.firebase:firebase-auth-ktx:19.3.1',
'com.google.guava:guava:28.1-android',
'com.google.protobuf:protobuf-javalite:3.17.3',
'nl.dionsegijn:konfetti:1.2.5',
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version",
'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4',
'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4',
'org.mockito:mockito-core:2.7.22',
'com.github.oppia:android-spotlight:cc23499d37dc8533a2876e45b5063e981a4583f4'
"androidx.appcompat:appcompat:$androidx_appcompat_appcompat",
"androidx.compose.foundation:foundation:$androidx_compose_foundation_foundation",
"androidx.compose.foundation:foundation-layout:$androidx_compose_foundation_foundation_layout",
"androidx.compose.material:material:$androidx_compose_material_material",
"androidx.compose.runtime:runtime:$androidx_compose_runtime_runtime",
"androidx.compose.runtime:runtime-livedata:$androidx_compose_runtime_runtime_livedata",
"androidx.compose.ui:ui:$androidx_compose_ui_ui",
"androidx.compose.ui:ui-tooling:$androidx_compose_ui_ui_tooling",
"androidx.constraintlayout:constraintlayout:$androidx_constraintlayout_constraintlayout",
"androidx.core:core-ktx:$androidx_core_core_ktx",
"androidx.lifecycle:lifecycle-extensions:$androidx_lifecycle_lifecycle_extensions",
"androidx.lifecycle:lifecycle-runtime-ktx:$androidx_lifecycle_lifecycle_runtime_ktx",
"androidx.navigation:navigation-fragment:$androidx_navigation_navigation_fragment",
"androidx.navigation:navigation-fragment-ktx:$androidx_navigation_navigation_fragment_ktx",
"androidx.navigation:navigation-ui:$androidx_navigation_navigation_ui",
"androidx.navigation:navigation-ui-ktx:$androidx_navigation_navigation_ui_ktx",
"androidx.fragment:fragment:$androidx_fragment_fragment",
"androidx.lifecycle:lifecycle-runtime-ktx:$androidx_lifecycle_lifecycle_runtime_ktx",
"androidx.multidex:multidex:$androidx_multidex_multidex",
"androidx.recyclerview:recyclerview:$androidx_recyclerview_recyclerview",
"androidx.work:work-runtime-ktx:$androidx_work_work_runtime_ktx",
"com.github.bumptech.glide:glide:$com_github_bumptech_glide_glide",
"com.google.android.flexbox:flexbox:$com_google_android_flexbox_flexbox",
"com.google.android.material:material:$com_google_android_material_material",
"com.google.android.material:compose-theme-adapter:$com_google_android_material_compose_theme_adapter",
"com.google.dagger:dagger:$com_google_dagger_dagger",
"com.google.firebase:firebase-analytics:$com_google_firebase_firebase_analytics",
"com.google.firebase:firebase-analytics-ktx:$com_google_firebase_firebase_analytics_ktx",
"com.google.firebase:firebase-appcheck:$com_google_firebase_firebase_appcheck",
"com.google.firebase:firebase-appcheck-debug:$com_google_firebase_firebase_appcheck_debug",
"com.google.firebase:firebase-appcheck-playintegrity:$com_google_firebase_firebase_appcheck_playintegrity",
"com.google.firebase:firebase-crashlytics:$com_google_firebase_firebase_crashlytics",
"com.google.firebase:firebase-firestore-ktx:$com_google_firebase_firebase_firestore_ktx",
"com.google.firebase:firebase-auth-ktx:$com_google_firebase_firebase_auth_ktx",
"com.google.guava:guava:$com_google_guava_guava",
"com.google.protobuf:protobuf-javalite:$com_google_protobuf_protobuf_javalite",
"nl.dionsegijn:konfetti:$nl_dionsegijn_konfetti",
"org.jetbrains.kotlin:kotlin-stdlib-jdk8:$org_jetbrains_kotlin_kotlin_stdlib_jdk8",
"org.jetbrains.kotlinx:kotlinx-coroutines-core:$org_jetbrains_kotlinx_kotlinx_coroutines_core",
"org.jetbrains.kotlinx:kotlinx-coroutines-android:$org_jetbrains_kotlinx_kotlinx_coroutines_android",
"org.mockito:mockito-core:$org_mockito_mockito_core",
"com.github.oppia:android-spotlight:$com_github_oppia_android_spotlight"
)
compileOnly(
'jakarta.xml.bind:jakarta.xml.bind-api:2.3.2',
'javax.annotation:javax.annotation-api:1.3.2',
'org.glassfish.jaxb:jaxb-runtime:2.3.2',
"jakarta.xml.bind:jakarta.xml.bind-api:$jakarta_xml_bind_jakarta_xml_bind_api",
"javax.annotation:javax.annotation-api:$javax_annotation_javax_annotation_api",
"org.glassfish.jaxb:jaxb-runtime:$org_glassfish_jaxb_jaxb_runtime",
)
testImplementation(
"androidx.compose.ui:ui-test-junit4:$compose_version",
'androidx.test:core:1.2.0',
'androidx.test.espresso:espresso-contrib:3.1.0',
'androidx.test.espresso:espresso-core:3.2.0',
'androidx.test.espresso:espresso-intents:3.1.0',
'androidx.test.ext:junit:1.1.1',
'androidx.test.ext:truth:1.4.0',
'androidx.work:work-testing:2.4.0',
'com.github.bumptech.glide:mocks:4.11.0',
'com.google.truth:truth:1.1.3',
'com.google.truth.extensions:truth-liteproto-extension:1.1.3',
'org.robolectric:annotations:4.5',
'org.robolectric:robolectric:4.5',
'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4',
"org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version",
'org.mockito:mockito-core:2.7.22',
"androidx.compose.ui:ui-test-junit4:$androidx_compose_ui_ui_test_junit4",
"androidx.test:core:$androidx_test_core",
"androidx.test.espresso:espresso-contrib:$androidx_test_espresso_espresso_contrib",
"androidx.test.espresso:espresso-core:$androidx_test_espresso_espresso_core",
"androidx.test.espresso:espresso-intents:$androidx_test_espresso_espresso_intents",
"androidx.test.ext:junit:$androidx_test_ext_junit",
"androidx.test.ext:truth:$androidx_test_ext_truth",
"androidx.work:work-testing:$androidx_work_work_testing",
"com.github.bumptech.glide:mocks:$com_github_bumptech_glide_mocks",
"com.google.truth:truth:$com_google_truth_truth",
"com.google.truth.extensions:truth-liteproto-extension:$com_google_truth_extensions_truth_liteproto_extension",
"org.robolectric:annotations:$org_robolectric_annotations",
"org.robolectric:robolectric:$org_robolectric_robolectric",
"org.jetbrains.kotlinx:kotlinx-coroutines-test:$org_jetbrains_kotlinx_kotlinx_coroutines_test",
"org.jetbrains.kotlin:kotlin-test-junit:$org_jetbrains_kotlin_kotlin_test_junit",
"org.mockito:mockito-core:$org_mockito_mockito_core",
project(":testing"),
)
androidTestImplementation(
"androidx.compose.ui:ui-test-junit4:$compose_version",
'androidx.test:core:1.2.0',
'androidx.test.espresso:espresso-contrib:3.1.0',
'androidx.test.espresso:espresso-core:3.2.0',
'androidx.test.espresso:espresso-intents:3.1.0',
'androidx.test.ext:junit:1.1.1',
'androidx.test.ext:truth:1.4.0',
'com.github.bumptech.glide:mocks:4.11.0',
'com.google.truth:truth:1.1.3',
'androidx.work:work-testing:2.4.0',
'com.google.truth.extensions:truth-liteproto-extension:1.1.3',
'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4',
'org.mockito:mockito-android:2.7.22',
'org.robolectric:annotations:4.5',
"androidx.compose.ui:ui-test-junit4:$androidx_compose_ui_ui_test_junit4",
"androidx.test:core:$androidx_test_core",
"androidx.test.espresso:espresso-contrib:$androidx_test_espresso_espresso_contrib",
"androidx.test.espresso:espresso-core:$androidx_test_espresso_espresso_core",
"androidx.test.espresso:espresso-intents:$androidx_test_espresso_espresso_intents",
"androidx.test.ext:junit:$androidx_test_ext_junit",
"androidx.test.ext:truth:$androidx_test_ext_truth",
"com.github.bumptech.glide:mocks:$com_github_bumptech_glide_mocks",
"com.google.truth:truth:$com_google_truth_truth",
"androidx.work:work-testing:$androidx_work_work_testing",
"com.google.truth.extensions:truth-liteproto-extension:$com_google_truth_extensions_truth_liteproto_extension",
"org.jetbrains.kotlinx:kotlinx-coroutines-test:$org_jetbrains_kotlinx_kotlinx_coroutines_test",
"org.robolectric:annotations:$org_robolectric_annotations",
)
// Adding the testing module directly causes duplicates of the below groups so we need to
// exclude them before adding the testing module to the androidTestImplementation dependencies
Expand All @@ -257,16 +254,16 @@ dependencies {
exclude group: "org.robolectric"
}
androidTestUtil(
'androidx.test:orchestrator:1.2.0',
"androidx.test:orchestrator:$androidx_test_orchestrator",
)
kapt(
'com.google.dagger:dagger-compiler:2.41'
"com.google.dagger:dagger-compiler:$com_google_dagger_dagger_compiler"
)
kaptTest(
'com.google.dagger:dagger-compiler:2.41'
"com.google.dagger:dagger-compiler:$com_google_dagger_dagger_compiler"
)
kaptAndroidTest(
'com.google.dagger:dagger-compiler:2.41'
"com.google.dagger:dagger-compiler:$com_google_dagger_dagger_compiler"
)
// TODO(#59): Remove this once Bazel is introduced
api project(':data')
Expand Down
93 changes: 90 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,96 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.6.10'
ext.fragment_version = '1.2.0-rc01'
ext.compose_version = '1.1.1'
// Top-level versions.
ext.min_sdk_version = 21
ext.target_sdk_version = 33
ext.build_tools_version = "30.0.2"
ext.kotlin_version = "1.6.10"
ext.compose_version = "1.1.1"

// Dependency versions.
ext.androidx_annotation_annotation = "1.2.0"
ext.androidx_appcompat_appcompat = "1.3.1"
ext.androidx_compose_foundation_foundation_layout = compose_version
ext.androidx_compose_foundation_foundation = compose_version
ext.androidx_compose_material_material = compose_version
ext.androidx_compose_runtime_runtime_livedata = compose_version
ext.androidx_compose_runtime_runtime = compose_version
ext.androidx_compose_ui_ui_test_junit4 = compose_version
ext.androidx_compose_ui_ui_tooling = compose_version
ext.androidx_compose_ui_ui = compose_version
ext.androidx_constraintlayout_constraintlayout = "2.0.1"
ext.androidx_core_core_ktx = "1.1.0"
ext.androidx_exifinterface_exifinterface = "1.0.0"
ext.androidx_fragment_fragment = "1.3.6"
ext.androidx_lifecycle_lifecycle_extensions = "2.2.0"
ext.androidx_lifecycle_lifecycle_livedata_ktx = "2.2.0"
ext.androidx_lifecycle_lifecycle_runtime_ktx = "2.3.1"
ext.androidx_multidex_multidex = "2.0.1"
ext.androidx_navigation_navigation_fragment_ktx = "2.0.0"
ext.androidx_navigation_navigation_fragment = "2.0.0"
ext.androidx_navigation_navigation_ui_ktx = "2.0.0"
ext.androidx_navigation_navigation_ui = "2.0.0"
ext.androidx_recyclerview_recyclerview = "1.1.0"
ext.androidx_test_espresso_espresso_accessibility = "3.2.0"
ext.androidx_test_espresso_espresso_contrib = "3.1.0"
ext.androidx_test_espresso_espresso_core = "3.3.0"
ext.androidx_test_espresso_espresso_intents = "3.1.0"
ext.androidx_test_ext_junit = "1.1.2"
ext.androidx_test_ext_truth = "1.4.0"
ext.androidx_test_core = "1.4.0"
ext.androidx_test_orchestrator = "1.2.0"
ext.androidx_test_runner = "1.3.0"
ext.androidx_work_work_runtime_ktx = "2.4.0"
ext.androidx_work_work_testing = "2.4.0"
ext.com_github_bumptech_glide_compiler = "4.11.0"
ext.com_github_bumptech_glide_glide = "4.11.0"
ext.com_github_bumptech_glide_mocks = "4.11.0"
ext.com_github_oppia_android_spotlight = "cc23499d37dc8533a2876e45b5063e981a4583f4"
ext.com_github_oppia_androidsvg = "5bc9c7553e94c3476e8ea32baea3c77567228fcd"
ext.com_github_oppia_kotlitex = "ccdf4170817fa3b48b8e1e452772dd58ecb71cf2"
ext.com_google_android_flexbox_flexbox = "3.0.0"
ext.com_google_android_material_compose_theme_adapter = compose_version
ext.com_google_android_material_material = "1.3.0"
ext.com_google_auto_service_auto_service = "1.0-rc4"
ext.com_google_dagger_dagger_compiler = "2.41"
ext.com_google_dagger_dagger = "2.41"
ext.com_google_firebase_firebase_analytics_ktx = "17.5.0"
ext.com_google_firebase_firebase_analytics = "17.5.0"
ext.com_google_firebase_firebase_appcheck_debug = "16.0.0"
ext.com_google_firebase_firebase_appcheck_playintegrity = "16.0.0"
ext.com_google_firebase_firebase_appcheck = "16.0.0"
ext.com_google_firebase_firebase_auth_ktx = "19.3.1"
ext.com_google_firebase_firebase_crashlytics = "17.1.1"
ext.com_google_firebase_firebase_firestore_ktx = "24.2.1"
ext.com_google_guava_guava = "31.0.1-android"
ext.com_google_protobuf_protobuf_javalite = "3.19.2"
ext.com_google_truth_extensions_truth_liteproto_extension = "1.1.3"
ext.com_google_truth_truth = "1.1.3"
ext.com_squareup_moshi_moshi_kotlin_codegen = "1.13.0"
ext.com_squareup_moshi_moshi_kotlin = "1.13.0"
ext.com_squareup_okhttp3_mockwebserver = "4.7.2"
ext.com_squareup_okhttp3_okhttp = "4.7.2"
ext.com_squareup_retrofit2_converter_moshi = "2.5.0"
ext.com_squareup_retrofit2_retrofit_mock = "2.5.0"
ext.com_squareup_retrofit2_retrofit = "2.9.0"
ext.jakarta_xml_bind_jakarta_xml_bind_api = "2.3.2"
ext.javax_annotation_javax_annotation_api = "1.3.2"
ext.junit_junit = "4.13.2"
ext.nl_dionsegijn_konfetti = "1.2.5"
ext.org_glassfish_jaxb_jaxb_runtime = "2.3.2"
ext.org_jetbrains_kotlin_kotlin_reflect = "1.6.0"
ext.org_jetbrains_kotlin_kotlin_stdlib_jdk8 = "1.6.21"
ext.org_jetbrains_kotlin_kotlin_stdlib = "1.6.21"
ext.org_jetbrains_kotlin_kotlin_test_junit = "1.3.72"
ext.org_jetbrains_kotlinx_kotlinx_coroutines_android = "1.6.4"
ext.org_jetbrains_kotlinx_kotlinx_coroutines_core = "1.6.4"
ext.org_jetbrains_kotlinx_kotlinx_coroutines_guava = "1.6.4"
ext.org_jetbrains_kotlinx_kotlinx_coroutines_test = "1.6.4"
ext.org_mockito_mockito_core = "3.9.0"
ext.org_robolectric_annotations = "4.5"
ext.org_robolectric_robolectric = "4.5"

repositories {
google()
gradlePluginPortal()
Expand Down
Loading
Loading