Skip to content

Commit

Permalink
Merge pull request #1299 from jjoseba/oppia-1305-gradle-update
Browse files Browse the repository at this point in the history
oppia-1305: Update Android Gradle version to 7.3.1
  • Loading branch information
alexlittle authored Nov 29, 2022
2 parents 08a0dd9 + 1e8b18f commit bf233b1
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 27 deletions.
42 changes: 23 additions & 19 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ android {
vectorDrawables.useSupportLibrary = true

def interfaceLangs = runtimeProps.getProperty('INTERFACE_LANGUAGE_OPTIONS').split(",")
// Language region format in android resources requires 'r' char
interfaceLangs.eachWithIndex { lang, index -> interfaceLangs[index] = lang.replace("-", "-r")}
resConfigs interfaceLangs
// resConfigs "en", "es", "ar", "fi", "fr", "hi", "ur-rPK", "am-rET", "om-rET"
// Language region format in android resources requires 'r' char
interfaceLangs.eachWithIndex { lang, index -> interfaceLangs[index] = lang.replace("-", "-r")}
// resConfigs "en", "es", "ar", "fi", "fr", "hi", "ur-rPK", "am-rET", "om-rET"

}

Expand Down Expand Up @@ -208,31 +208,33 @@ android {
}

useLibrary 'android.test.mock'
namespace 'org.digitalcampus.mobile.learning'

android.buildFeatures.viewBinding = true
}

dependencies {
def workVersion = '2.7.1'
def roomVersion = "1.1.1"
def fragmentVersion = '1.2.5'
def fragmentVersion = '1.5.4'
def daggerVersion = '2.41'
def appcompatVersion = '1.6.0-rc01'
def espressoVersion = '3.5.0'

implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'joda-time:joda-time:2.10.13'
implementation 'com.google.android.material:material:1.6.1'
implementation 'com.google.android.material:material:1.7.0'
implementation 'com.google.android.flexbox:flexbox:3.0.0'

implementation 'androidx.core:core:1.7.0'
implementation 'androidx.core:core:1.9.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.preference:preference:1.2.0'

implementation "androidx.appcompat:appcompat:$appcompatVersion"

implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
implementation 'androidx.navigation:navigation-fragment:2.4.2'
implementation 'androidx.navigation:navigation-ui:2.4.2'
implementation 'androidx.navigation:navigation-fragment:2.5.3'
implementation 'androidx.navigation:navigation-ui:2.5.3'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.concurrent:concurrent-futures:1.1.0'
Expand Down Expand Up @@ -267,22 +269,22 @@ dependencies {
implementation "com.squareup.inject:assisted-inject-annotations-dagger2:0.8.1"

//JUnit Dependencies
testImplementation 'androidx.test.ext:junit:1.1.3'
testImplementation 'androidx.test.ext:junit:1.1.4'
testImplementation "org.json:json:20220924"

androidTestImplementation 'com.squareup.okhttp3:mockwebserver:4.9.3'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test:rules:1.4.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test:runner:1.5.1'
androidTestImplementation 'androidx.test:rules:1.5.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
androidTestImplementation 'androidx.annotation:annotation:1.3.0'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
androidTestUtil 'androidx.test:orchestrator:1.4.1'
androidTestUtil 'androidx.test:orchestrator:1.4.2'

//Espresso Dependencies
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-web:3.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.4.0'
androidTestImplementation('androidx.test.espresso:espresso-contrib:3.4.0') {
androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion"
androidTestImplementation "androidx.test.espresso:espresso-web:$espressoVersion"
androidTestImplementation "androidx.test.espresso:espresso-intents:$espressoVersion"
androidTestImplementation("androidx.test.espresso:espresso-contrib:$espressoVersion") {
exclude module: 'support-annotations'
exclude module: 'support-v4'
exclude module: 'support-v13'
Expand All @@ -292,8 +294,8 @@ dependencies {

// Fragment testing
implementation "androidx.fragment:fragment:$fragmentVersion"
debugImplementation 'androidx.test:core:1.4.0'
debugImplementation "androidx.fragment:fragment-testing:1.4.1"
debugImplementation 'androidx.test:core:1.5.0'
debugImplementation "androidx.fragment:fragment-testing:1.5.4"

//Mockito Dependencies
testImplementation 'org.mockito:mockito-core:4.3.1'
Expand Down Expand Up @@ -323,6 +325,8 @@ task grantPermissions(type: Exec, dependsOn: 'installNormalDebug') {
}

commandLine "${adb} shell pm grant ${android.defaultConfig.applicationId} android.permission.SET_ANIMATION_SCALE".split(' ')
commandLine "${adb} shell pm grant ${android.defaultConfig.applicationId} android.permission.SET_ANIMATION_SCALE".split(' ')

}

tasks.whenTaskAdded { task ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public void openCourseActivity() throws Exception {
public void openCourseActivityWrongPosition() throws Exception {

Intent i = getIntentParams(getMockCourse(), getMockSection(3), 5, false);
try (ActivityScenario<DeviceListActivity> scenario = ActivityScenario.launch(i)) {
try (ActivityScenario<DeviceListActivity> scenario = ActivityScenario.launchActivityForResult(i)) {

assertThat(scenario.getResult(), hasResultCode(android.app.Activity.RESULT_CANCELED));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void checkVideoNotCompleted() throws InterruptedException {

Intent videoActivityIntent = getTestVideoActivityIntent();

try (ActivityScenario<VideoPlayerActivity> scenario = ActivityScenario.launch(videoActivityIntent)) {
try (ActivityScenario<VideoPlayerActivity> scenario = ActivityScenario.launchActivityForResult(videoActivityIntent)) {

onView(isRoot()).perform(waitFor(TimeUnit.SECONDS.toMillis(MEDIA_TEST_LENGHT_SECONDS - 2)));

Expand All @@ -90,7 +90,7 @@ public void checkVideoCompleted() throws InterruptedException {

Intent videoActivityIntent = getTestVideoActivityIntent();

try (ActivityScenario<VideoPlayerActivity> scenario = ActivityScenario.launch(videoActivityIntent)) {
try (ActivityScenario<VideoPlayerActivity> scenario = ActivityScenario.launchActivityForResult(videoActivityIntent)) {

onView(isRoot()).perform(waitFor(TimeUnit.SECONDS.toMillis(MEDIA_TEST_LENGHT_SECONDS + 2)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static Activity getCurrentActivity() {
final Activity[] activity = new Activity[1];
getInstrumentation().runOnMainSync(() -> {
java.util.Collection<Activity> activities = ActivityLifecycleMonitorRegistry.getInstance().getActivitiesInStage(Stage.RESUMED);
activity[0] = Iterables.getOnlyElement(activities);
activity[0] = (Activity) Iterables.getOnlyElement(activities);
});
return activity[0];

Expand Down
3 changes: 1 addition & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.digitalcampus.mobile.learning">
xmlns:tools="http://schemas.android.com/tools">

<uses-sdk tools:ignore="GradleOverrides" />

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {

}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.2'
classpath 'com.android.tools.build:gradle:7.3.1'
classpath "com.neenbedankt.gradle.plugins:android-apt:1.8"
classpath "org.jacoco:org.jacoco.core:0.8.6"
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.8"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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-7.3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip

0 comments on commit bf233b1

Please sign in to comment.