Skip to content

Commit d6c638f

Browse files
authored
Merge pull request #1354 from jbc25/oppia-1610-upgrade-gradle-and-libraries
Oppia 1610 upgrade gradle and libraries
2 parents bdefe6e + dd6c470 commit d6c638f

File tree

6 files changed

+45
-41
lines changed

6 files changed

+45
-41
lines changed

app/build.gradle

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ apply plugin: 'com.android.application'
44
apply from: '../jacoco.gradle'
55
apply from: '../sonarqube.gradle'
66

7-
repositories {
8-
maven { url "https://jitpack.io" }
9-
}
10-
117
def version_code = 114
128
def version_name = "7.4.9"
139

@@ -240,7 +236,7 @@ android {
240236

241237
}
242238

243-
flavorDimensions "main"
239+
flavorDimensions = ["main"]
244240

245241
productFlavors {
246242
normal { dimension "main" }
@@ -249,40 +245,44 @@ android {
249245
useLibrary 'android.test.mock'
250246
namespace 'org.digitalcampus.mobile.learning'
251247

252-
android.buildFeatures.viewBinding = true
248+
buildFeatures {
249+
buildConfig true
250+
viewBinding = true
251+
}
252+
253253
}
254254

255255
dependencies {
256-
def workVersion = '2.7.1'
257-
def roomVersion = "1.1.1"
258-
def fragmentVersion = '1.5.4'
256+
def workVersion = '2.9.1'
257+
def roomVersion = "2.6.1"
258+
def fragmentVersion = '1.8.2'
259259
def daggerVersion = '2.41'
260-
def appcompatVersion = '1.6.0-rc01'
261-
def espressoVersion = '3.5.1'
260+
def appcompatVersion = '1.7.0'
261+
def espressoVersion = '3.6.1'
262262

263263
implementation fileTree(include: ['*.jar'], dir: 'libs')
264264
implementation 'joda-time:joda-time:2.10.13'
265-
implementation 'com.google.android.material:material:1.7.0'
265+
implementation 'com.google.android.material:material:1.12.0'
266266
implementation 'com.google.android.flexbox:flexbox:3.0.0'
267267

268-
implementation 'androidx.core:core:1.9.0'
268+
implementation 'androidx.core:core:1.13.1'
269269
implementation 'androidx.cardview:cardview:1.0.0'
270-
implementation 'androidx.preference:preference:1.2.0'
270+
implementation 'androidx.preference:preference:1.2.1'
271271

272272
implementation "androidx.appcompat:appcompat:$appcompatVersion"
273273

274-
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
275-
implementation 'androidx.navigation:navigation-fragment:2.5.3'
276-
implementation 'androidx.navigation:navigation-ui:2.5.3'
274+
implementation 'androidx.vectordrawable:vectordrawable:1.2.0'
275+
implementation 'androidx.navigation:navigation-fragment:2.7.7'
276+
implementation 'androidx.navigation:navigation-ui:2.7.7'
277277
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
278278
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
279-
implementation 'androidx.concurrent:concurrent-futures:1.1.0'
280-
implementation "android.arch.persistence.room:runtime:$roomVersion"
279+
implementation 'androidx.concurrent:concurrent-futures:1.2.0'
280+
implementation "androidx.room:room-runtime:$roomVersion"
281281
implementation "androidx.work:work-runtime:$workVersion"
282-
implementation 'com.google.guava:guava:31.1-android'
282+
implementation 'com.google.guava:guava:33.2.1-android'
283283

284284
androidTestImplementation "androidx.work:work-testing:$workVersion"
285-
annotationProcessor "android.arch.persistence.room:compiler:$roomVersion"
285+
annotationProcessor "androidx.room:room-compiler:$roomVersion"
286286

287287
implementation 'javax.xml.stream:stax-api:1.0'
288288
implementation 'com.squareup.picasso:picasso:2.71828'
@@ -294,7 +294,7 @@ dependencies {
294294
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
295295
implementation 'com.mikhaellopez:circularprogressbar:3.1.0'
296296
implementation 'com.github.badoualy:stepper-indicator:1.0.7'
297-
implementation 'com.google.code.gson:gson:2.9.0'
297+
implementation 'com.google.code.gson:gson:2.10.1'
298298
implementation 'com.hbb20:ccp:2.6.0' //Phone code picker
299299

300300
//Dagger Dependencies
@@ -308,17 +308,17 @@ dependencies {
308308
implementation "com.squareup.inject:assisted-inject-annotations-dagger2:0.8.1"
309309

310310
//JUnit Dependencies
311-
testImplementation 'androidx.test.ext:junit:1.1.5'
311+
testImplementation 'androidx.test.ext:junit:1.2.1'
312312
testImplementation "org.json:json:20220924"
313313

314314
androidTestImplementation 'com.squareup.okhttp3:mockwebserver:4.9.3'
315-
androidTestImplementation 'androidx.test:runner:1.5.2'
316-
androidTestImplementation 'androidx.test:rules:1.5.0'
317-
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
315+
androidTestImplementation 'androidx.test:runner:1.6.2'
316+
androidTestImplementation 'androidx.test:rules:1.6.1'
317+
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
318318
androidTestImplementation 'androidx.annotation:annotation:1.3.0'
319-
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
320-
androidTestUtil 'androidx.test:orchestrator:1.4.2'
321-
androidTestUtil 'androidx.test.services:test-services:1.4.2'
319+
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.3.0'
320+
androidTestUtil 'androidx.test:orchestrator:1.5.0'
321+
androidTestUtil 'androidx.test.services:test-services:1.5.0'
322322

323323
//Espresso Dependencies
324324
androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion"
@@ -334,8 +334,8 @@ dependencies {
334334

335335
// Fragment testing
336336
implementation "androidx.fragment:fragment:$fragmentVersion"
337-
debugImplementation 'androidx.test:core:1.5.0'
338-
debugImplementation "androidx.fragment:fragment-testing:1.5.4"
337+
debugImplementation 'androidx.test:core:1.6.1'
338+
debugImplementation "androidx.fragment:fragment-testing:1.8.2"
339339

340340
//Mockito Dependencies
341341
testImplementation 'org.mockito:mockito-core:4.3.1'
@@ -353,11 +353,12 @@ dependencies {
353353
}
354354

355355

356-
task grantPermissions(type: Exec, dependsOn: 'installNormalDebug') {
356+
tasks.register('grantPermissions', Exec) {
357+
dependsOn 'installNormalDebug'
357358
group = 'test'
358359
description = 'Grant permissions for testing.'
359360

360-
def adb = android.getAdbExe().toString()
361+
def adb = android.getAdbExecutable().toString()
361362
if (!System.getProperty('os.name').toLowerCase().contains('windows')) {
362363
logger.lifecycle('Granting permissions for a non windows os')
363364
} else {
@@ -369,7 +370,7 @@ task grantPermissions(type: Exec, dependsOn: 'installNormalDebug') {
369370

370371
}
371372

372-
tasks.whenTaskAdded { task ->
373+
tasks.configureEach { task ->
373374
if (task.name.startsWith('connectedAndroidTest') ||
374375
task.name.startsWith('connectedDebugAndroidTest') ||
375376
task.name.startsWith('assembleDebugAndroidTest') ||

app/src/androidTest/java/androidTestFiles/utils/TestUtils.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,20 @@
22

33
import android.app.Activity;
44

5-
import androidx.test.espresso.core.internal.deps.guava.collect.Iterables;
65
import androidx.test.runner.lifecycle.ActivityLifecycleMonitorRegistry;
76
import androidx.test.runner.lifecycle.Stage;
87

98
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
109

10+
import com.google.common.collect.Iterables;
11+
1112
public class TestUtils{
1213
public static Activity getCurrentActivity() {
1314
getInstrumentation().waitForIdleSync();
1415
final Activity[] activity = new Activity[1];
1516
getInstrumentation().runOnMainSync(() -> {
1617
java.util.Collection<Activity> activities = ActivityLifecycleMonitorRegistry.getInstance().getActivitiesInStage(Stage.RESUMED);
17-
activity[0] = (Activity) Iterables.getOnlyElement(activities);
18+
activity[0] = Iterables.getOnlyElement(activities);
1819
});
1920
return activity[0];
2021

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ buildscript {
1010

1111
}
1212
dependencies {
13-
classpath 'com.android.tools.build:gradle:7.4.2'
13+
classpath 'com.android.tools.build:gradle:8.5.2'
1414
classpath "com.neenbedankt.gradle.plugins:android-apt:1.8"
15-
classpath "org.jacoco:org.jacoco.core:0.8.8"
15+
classpath "org.jacoco:org.jacoco.core:0.8.12"
1616
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.8"
1717
}
1818
}

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
# Specifies the JVM arguments used for the daemon process.
88
# The setting is particularly useful for tweaking memory settings.
99
android.enableJetifier=true
10+
android.nonFinalResIds=false
11+
android.nonTransitiveRClass=false
1012
android.useAndroidX=true
1113
org.gradle.jvmargs=-Xmx1536m
1214
# When configured, Gradle will run in incubating parallel mode.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Tue Apr 04 17:23:00 CEST 2023
22
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
44
distributionPath=wrapper/dists
55
zipStorePath=wrapper/dists
66
zipStoreBase=GRADLE_USER_HOME

jacoco.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ task jacocoTestReport(type: JacocoReport, dependsOn: ['connectedCheck']) {
1414
description = "Generate Jacoco coverage reports for Debug build"
1515

1616
reports {
17-
xml.enabled true
18-
html.enabled true
17+
xml.required = true
18+
html.required = true
1919
}
2020

2121
def fileFilter = [

0 commit comments

Comments
 (0)