diff --git a/integration/ServiceTestRuleSample/build.gradle b/integration/ServiceTestRuleSample/build.gradle index c9439e65e..79c5e2dbb 100644 --- a/integration/ServiceTestRuleSample/build.gradle +++ b/integration/ServiceTestRuleSample/build.gradle @@ -1,13 +1,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + ext.agpVersion = "7.0.2" repositories { // Insert local test repo here google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.2' + classpath "com.android.tools.build:gradle:$agpVersion" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/runner/AndroidJunitRunnerSample/build.gradle b/runner/AndroidJunitRunnerSample/build.gradle index 73d165a05..08e62a0ca 100644 --- a/runner/AndroidJunitRunnerSample/build.gradle +++ b/runner/AndroidJunitRunnerSample/build.gradle @@ -1,13 +1,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + ext.agpVersion = "7.0.2" repositories { // Insert local test repo here google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.2' + classpath "com.android.tools.build:gradle:$agpVersion" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/runner/AndroidTestOrchestratorSample/build.gradle b/runner/AndroidTestOrchestratorSample/build.gradle index 73d165a05..08e62a0ca 100644 --- a/runner/AndroidTestOrchestratorSample/build.gradle +++ b/runner/AndroidTestOrchestratorSample/build.gradle @@ -1,13 +1,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + ext.agpVersion = "7.0.2" repositories { // Insert local test repo here google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.2' + classpath "com.android.tools.build:gradle:$agpVersion" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/ui/espresso/AccessibilitySample/build.gradle b/ui/espresso/AccessibilitySample/build.gradle index 760b2d580..34e8f698f 100644 --- a/ui/espresso/AccessibilitySample/build.gradle +++ b/ui/espresso/AccessibilitySample/build.gradle @@ -1,15 +1,16 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.3.40' + ext.kotlinVersion = "1.4.31" + ext.agpVersion = "7.0.2" repositories { // Insert local test repo here google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.2' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath "com.android.tools.build:gradle:$agpVersion" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/ui/espresso/BasicSample/app/build.gradle b/ui/espresso/BasicSample/app/build.gradle index cd9086011..cb401e273 100644 --- a/ui/espresso/BasicSample/app/build.gradle +++ b/ui/espresso/BasicSample/app/build.gradle @@ -40,7 +40,7 @@ dependencies { implementation 'com.google.guava:guava:' + rootProject.guavaVersion // Testing-only dependencies - androidTestImplementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + androidTestImplementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" androidTestImplementation 'androidx.test:core:' + rootProject.coreVersion androidTestImplementation 'androidx.test:core-ktx:' + rootProject.coreVersion androidTestImplementation 'androidx.test.ext:junit:' + rootProject.extJUnitVersion diff --git a/ui/espresso/BasicSample/build.gradle b/ui/espresso/BasicSample/build.gradle index 53583ed27..f28e5235f 100644 --- a/ui/espresso/BasicSample/build.gradle +++ b/ui/espresso/BasicSample/build.gradle @@ -1,15 +1,16 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.4.31' + ext.kotlinVersion = "1.4.31" + ext.agpVersion = "7.0.2" repositories { // Insert local test repo here google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.2' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath "com.android.tools.build:gradle:$agpVersion" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/ui/espresso/CustomMatcherSample/build.gradle b/ui/espresso/CustomMatcherSample/build.gradle index 9003680c9..7d0cc0b4a 100644 --- a/ui/espresso/CustomMatcherSample/build.gradle +++ b/ui/espresso/CustomMatcherSample/build.gradle @@ -1,13 +1,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + ext.agpVersion = "7.0.2" repositories { // Insert local test repo here google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.2' + classpath "com.android.tools.build:gradle:$agpVersion" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/ui/espresso/DataAdapterSample/build.gradle b/ui/espresso/DataAdapterSample/build.gradle index f63a3680b..772f8a2ec 100644 --- a/ui/espresso/DataAdapterSample/build.gradle +++ b/ui/espresso/DataAdapterSample/build.gradle @@ -1,13 +1,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + ext.agpVersion = "7.0.2" repositories { // Insert local test repo here google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.2' + classpath "com.android.tools.build:gradle:$agpVersion" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/ui/espresso/FragmentScenarioSample/app/build.gradle b/ui/espresso/FragmentScenarioSample/app/build.gradle index 17e5114b4..7e2e82ba0 100644 --- a/ui/espresso/FragmentScenarioSample/app/build.gradle +++ b/ui/espresso/FragmentScenarioSample/app/build.gradle @@ -33,11 +33,18 @@ android { // include the android resources in local tests. See http://robolectric.org/migrating/#migrating-to-40 unitTests.includeAndroidResources = true } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = '1.8' + } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" implementation 'androidx.appcompat:appcompat:' + rootProject.androidxCompatVersion implementation 'androidx.core:core-ktx:' + rootProject.androidxCoreVersion implementation 'androidx.fragment:fragment-ktx:' + rootProject.androidxFragmentVersion diff --git a/ui/espresso/FragmentScenarioSample/app/src/sharedTest/java/com/example/android/testing/espresso/fragmentscenario/SampleDialogFragmentTest.kt b/ui/espresso/FragmentScenarioSample/app/src/sharedTest/java/com/example/android/testing/espresso/fragmentscenario/SampleDialogFragmentTest.kt index 0eb667118..8844e0f71 100644 --- a/ui/espresso/FragmentScenarioSample/app/src/sharedTest/java/com/example/android/testing/espresso/fragmentscenario/SampleDialogFragmentTest.kt +++ b/ui/espresso/FragmentScenarioSample/app/src/sharedTest/java/com/example/android/testing/espresso/fragmentscenario/SampleDialogFragmentTest.kt @@ -18,7 +18,6 @@ import org.robolectric.annotation.LooperMode * See [testing documentation](http://d.android.com/tools/testing). */ @RunWith(AndroidJUnit4::class) -@LooperMode(LooperMode.Mode.PAUSED) class SampleDialogFragmentTest { @Test diff --git a/ui/espresso/FragmentScenarioSample/app/src/sharedTest/java/com/example/android/testing/espresso/fragmentscenario/SampleFragmentTest.kt b/ui/espresso/FragmentScenarioSample/app/src/sharedTest/java/com/example/android/testing/espresso/fragmentscenario/SampleFragmentTest.kt index 54a9a40e4..b35a058d0 100644 --- a/ui/espresso/FragmentScenarioSample/app/src/sharedTest/java/com/example/android/testing/espresso/fragmentscenario/SampleFragmentTest.kt +++ b/ui/espresso/FragmentScenarioSample/app/src/sharedTest/java/com/example/android/testing/espresso/fragmentscenario/SampleFragmentTest.kt @@ -17,7 +17,6 @@ import org.robolectric.annotation.LooperMode * See [testing documentation](http://d.android.com/tools/testing). */ @RunWith(AndroidJUnit4::class) -@LooperMode(LooperMode.Mode.PAUSED) class SampleFragmentTest { @Test fun launchFragmentAndVerifyUI() { diff --git a/ui/espresso/FragmentScenarioSample/build.gradle b/ui/espresso/FragmentScenarioSample/build.gradle index 5da62e993..44de1873f 100644 --- a/ui/espresso/FragmentScenarioSample/build.gradle +++ b/ui/espresso/FragmentScenarioSample/build.gradle @@ -1,15 +1,16 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.3.72' + ext.kotlinVersion = "1.4.31" + ext.agpVersion = "7.0.2" repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.2' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath "com.android.tools.build:gradle:$agpVersion" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" } } @@ -28,8 +29,8 @@ task clean(type: Delete) { ext { buildToolsVersion = "31.0.0" androidxCoreVersion = "1.6.0" - androidxCompatVersion = "1.1.0-rc01" - androidxFragmentVersion = "1.1.0-rc01" + androidxCompatVersion = "1.3.1" + androidxFragmentVersion = "1.3.6" coreVersion = "1.4.1-alpha01" extJUnitVersion = "1.1.4-alpha01" runnerVersion = "1.4.1-alpha01" diff --git a/ui/espresso/FragmentScenarioSample/gradle.properties b/ui/espresso/FragmentScenarioSample/gradle.properties index 3be565ea9..c13b18e9c 100644 --- a/ui/espresso/FragmentScenarioSample/gradle.properties +++ b/ui/espresso/FragmentScenarioSample/gradle.properties @@ -10,8 +10,7 @@ org.gradle.jvmargs=-Xmx1536m # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true -android.useAndroidX=true +# org.gradle.parallel=true # AndroidX package structure to make it clearer which packages are bundled with the # Android operating system, and which are packaged with your app's APK # https://developer.android.com/topic/libraries/support-library/androidx-rn diff --git a/ui/espresso/FragmentScenarioSample/gradle/wrapper/gradle-wrapper.properties b/ui/espresso/FragmentScenarioSample/gradle/wrapper/gradle-wrapper.properties index 0b4379475..5e8f057b6 100644 --- a/ui/espresso/FragmentScenarioSample/gradle/wrapper/gradle-wrapper.properties +++ b/ui/espresso/FragmentScenarioSample/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip diff --git a/ui/espresso/IdlingResourceSample/build.gradle b/ui/espresso/IdlingResourceSample/build.gradle index 6f4c22452..eb8199601 100644 --- a/ui/espresso/IdlingResourceSample/build.gradle +++ b/ui/espresso/IdlingResourceSample/build.gradle @@ -17,13 +17,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + ext.agpVersion = "7.0.2" repositories { // Insert local test repo here google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.2' + classpath "com.android.tools.build:gradle:$agpVersion" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/ui/espresso/IntentsAdvancedSample/build.gradle b/ui/espresso/IntentsAdvancedSample/build.gradle index 9bee4cb86..34b4bfff2 100644 --- a/ui/espresso/IntentsAdvancedSample/build.gradle +++ b/ui/espresso/IntentsAdvancedSample/build.gradle @@ -1,13 +1,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + ext.agpVersion = "7.0.2" repositories { // Insert local test repo here google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.2' + classpath "com.android.tools.build:gradle:$agpVersion" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/ui/espresso/IntentsBasicSample/build.gradle b/ui/espresso/IntentsBasicSample/build.gradle index 6b95dcc18..6dda0aeb9 100644 --- a/ui/espresso/IntentsBasicSample/build.gradle +++ b/ui/espresso/IntentsBasicSample/build.gradle @@ -1,13 +1,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + ext.agpVersion = "7.0.2" repositories { // Insert local test repo here google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.2' + classpath "com.android.tools.build:gradle:$agpVersion" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/ui/espresso/MultiProcessSample/build.gradle b/ui/espresso/MultiProcessSample/build.gradle index 6d519e5a8..6ec6532db 100644 --- a/ui/espresso/MultiProcessSample/build.gradle +++ b/ui/espresso/MultiProcessSample/build.gradle @@ -17,13 +17,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + ext.agpVersion = "7.0.2" repositories { // Insert local test repo here google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.2' + classpath "com.android.tools.build:gradle:$agpVersion" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/ui/espresso/MultiWindowSample/build.gradle b/ui/espresso/MultiWindowSample/build.gradle index bd225e8e3..4c0902da4 100644 --- a/ui/espresso/MultiWindowSample/build.gradle +++ b/ui/espresso/MultiWindowSample/build.gradle @@ -1,13 +1,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + ext.agpVersion = "7.0.2" repositories { // Insert local test repo here google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.2' + classpath "com.android.tools.build:gradle:$agpVersion" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/ui/espresso/RecyclerViewSample/build.gradle b/ui/espresso/RecyclerViewSample/build.gradle index 9b6f55b71..b8f932bde 100644 --- a/ui/espresso/RecyclerViewSample/build.gradle +++ b/ui/espresso/RecyclerViewSample/build.gradle @@ -17,13 +17,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + ext.agpVersion = "7.0.2" repositories { // Insert local test repo here google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.2' + classpath "com.android.tools.build:gradle:$agpVersion" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/ui/espresso/WebBasicSample/build.gradle b/ui/espresso/WebBasicSample/build.gradle index 73d165a05..08e62a0ca 100644 --- a/ui/espresso/WebBasicSample/build.gradle +++ b/ui/espresso/WebBasicSample/build.gradle @@ -1,13 +1,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + ext.agpVersion = "7.0.2" repositories { // Insert local test repo here google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.2' + classpath "com.android.tools.build:gradle:$agpVersion" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/ui/uiautomator/BasicSample/build.gradle b/ui/uiautomator/BasicSample/build.gradle index 1db264f83..fdcb8469d 100644 --- a/ui/uiautomator/BasicSample/build.gradle +++ b/ui/uiautomator/BasicSample/build.gradle @@ -1,13 +1,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + ext.agpVersion = "7.0.2" repositories { // Insert local test repo here google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.2' + classpath "com.android.tools.build:gradle:$agpVersion" } } diff --git a/unit/BasicSample/app/build.gradle b/unit/BasicSample/app/build.gradle index d0926a3d4..68bd91064 100644 --- a/unit/BasicSample/app/build.gradle +++ b/unit/BasicSample/app/build.gradle @@ -32,6 +32,6 @@ android { dependencies { // Unit testing dependencies. - testCompile 'junit:junit:' + rootProject.junitVersion; - testCompile 'org.mockito:mockito-core:' + rootProject.mockitoVersion; + testImplementation 'junit:junit:' + rootProject.junitVersion; + testImplementation 'org.mockito:mockito-core:' + rootProject.mockitoVersion; } diff --git a/unit/BasicSample/build.gradle b/unit/BasicSample/build.gradle index 33365d169..31e1ea606 100644 --- a/unit/BasicSample/build.gradle +++ b/unit/BasicSample/build.gradle @@ -16,13 +16,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + ext.agpVersion = "7.0.2" repositories { // Insert local test repo here google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.2' + classpath "com.android.tools.build:gradle:$agpVersion" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/unit/BasicUnitAndroidTest/build.gradle b/unit/BasicUnitAndroidTest/build.gradle index 9335c3ccd..d89482b51 100644 --- a/unit/BasicUnitAndroidTest/build.gradle +++ b/unit/BasicUnitAndroidTest/build.gradle @@ -1,13 +1,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + ext.agpVersion = "7.0.2" repositories { // Insert local test repo here google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.2' + classpath "com.android.tools.build:gradle:$agpVersion" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/update_versions.sh b/update_versions.sh index 68189555e..47aeadd16 100755 --- a/update_versions.sh +++ b/update_versions.sh @@ -9,10 +9,14 @@ set -ex # Exit immediately if a command exits with a non-zero status. #repourl="https:\/\/oss.sonatype.org\/content\/repositories\/orgrobolectric-1216" #repourl="http:\/\/localhost:1480" buildToolsVersion="31.0.0" +agpVersion="7.0.2" +kotlinVersion="1.4.31" compileSdkVersion="30" targetSdkVersion="30" androidxAnnotationVersion="1.2.0" +androidxCompatVersion="1.3.1" androidxCoreVersion="1.6.0" +androidxFragmentVersion="1.3.6" androidxRecyclerVersion="1.2.1" guavaVersion="30.1.1-android" truthVersion="1.1.3" @@ -33,15 +37,19 @@ for p in $(cat projects.conf); do pushd $p > /dev/null # Silent pushd # Replace versions + sed -i "s/buildToolsVersion = \".*\"/buildToolsVersion = \"$buildToolsVersion\"/" build.gradle + sed -i "s/agpVersion = \".*\"/agpVersion = \"$agpVersion\"/" build.gradle + sed -i "s/kotlinVersion = \".*\"/kotlinVersion = \"$kotlinVersion\"/" build.gradle sed -i "s/coreVersion = \".*\"/coreVersion = \"$coreVersion\"/" build.gradle sed -i "s/extJUnitVersion = \".*\"/extJUnitVersion = \"$extJUnitVersion\"/" build.gradle sed -i "s/extTruthVersion = \".*\"/extTruthVersion = \"$extTruthVersion\"/" build.gradle sed -i "s/runnerVersion = \".*\"/runnerVersion = \"$runnerVersion\"/" build.gradle sed -i "s/rulesVersion = \".*\"/rulesVersion = \"$rulesVersion\"/" build.gradle sed -i "s/espressoVersion = \".*\"/espressoVersion = \"$espressoVersion\"/" build.gradle - sed -i "s/buildToolsVersion = \".*\"/buildToolsVersion = \"$buildToolsVersion\"/" build.gradle sed -i "s/androidxAnnotationVersion = \".*\"/androidxAnnotationVersion = \"$androidxAnnotationVersion\"/" build.gradle + sed -i "s/androidxCompatVersion = \".*\"/androidxCompatVersion = \"$androidxCompatVersion\"/" build.gradle sed -i "s/androidxCoreVersion = \".*\"/androidxCoreVersion = \"$androidxCoreVersion\"/" build.gradle + sed -i "s/androidxFragmentVersion = \".*\"/androidxFragmentVersion = \"$androidxFragmentVersion\"/" build.gradle sed -i "s/androidxRecyclerVersion = \".*\"/androidxRecyclerVersion = \"$androidxRecyclerVersion\"/" build.gradle sed -i "s/guavaVersion = \".*\"/guavaVersion = \"$guavaVersion\"/" build.gradle sed -i "s/truthVersion = \".*\"/truthVersion = \"$truthVersion\"/" build.gradle @@ -51,7 +59,7 @@ for p in $(cat projects.conf); do sed -i "s/robolectricVersion = \".*\"/robolectricVersion = \"$robolectricVersion\"/" build.gradle if [ ! -z "$repourl" ] then - sed -i "s/.*jcenter()/ jcenter()\n maven {\n url \"$repourl\"\n }/" build.gradle + sed -i "s/.*google()/ google()\n maven {\n url \"$repourl\"\n }/" build.gradle fi popd > /dev/null # Silent popd done