From 665c49f59a03ed284d27654f2ace71ee5cf60616 Mon Sep 17 00:00:00 2001 From: Khaled Elnaggar Date: Fri, 10 Jan 2025 13:38:59 +0100 Subject: [PATCH] Updated all related dependencies and migrated to targetSDKVersion 34 (IDE-264) --- build.gradle | 22 ++++++++++-- catroid/build.gradle | 34 +++++++++---------- catroid/gradle/code_quality_tasks.gradle | 4 +-- .../src/androidTest/res/values/strings.xml | 3 +- catroid/src/catroid/res/values/strings.xml | 3 +- catroid/src/main/AndroidManifest.xml | 14 +++++++- .../catrobat/catroid/camera/CameraManager.kt | 6 ++-- .../catroid/utils/LiveDataExtensions.kt | 6 ++-- gradle.properties | 6 +++- gradle/wrapper/gradle-wrapper.properties | 4 +-- 10 files changed, 68 insertions(+), 34 deletions(-) diff --git a/build.gradle b/build.gradle index 3aa1f847ae2..3df795fbf06 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2022 The Catrobat Team + * Copyright (C) 2010-2025 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -24,23 +24,30 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.6.21' + ext { + agp_version1 = '8.6.1' + agp_version = '8.0.0' + } + ext.kotlin_version = '1.8.22' ext.koin_version = '2.1.6' ext.lifecycle_version = '2.2.0' ext.jacoco_core_version = '0.8.7' + repositories { google() mavenCentral() maven { url "https://developer.huawei.com/repo/" } + gradlePluginPortal() // Required for Gradle plugins } dependencies { // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files - classpath 'com.android.tools.build:gradle:7.4.2' + classpath "com.android.tools.build:gradle:$agp_version1" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jacoco:org.jacoco.core:$jacoco_core_version" classpath 'com.huawei.agconnect:agcp:1.4.2.300' + classpath 'com.github.ben-manes:gradle-versions-plugin:0.51.0' // Add the plugin here } } @@ -51,4 +58,13 @@ allprojects { mavenCentral() maven { url "https://developer.huawei.com/repo/" } } + + configurations.all { + resolutionStrategy { + force 'org.xerial:sqlite-jdbc:3.34.0' + } + } } + +// Apply the plugin explicitly to the root project +apply plugin: 'com.github.ben-manes.versions' diff --git a/catroid/build.gradle b/catroid/build.gradle index 2a48bc34023..3899dc74467 100644 --- a/catroid/build.gradle +++ b/catroid/build.gradle @@ -2,7 +2,7 @@ import com.android.build.api.dsl.ManagedVirtualDevice /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2023 The Catrobat Team + * Copyright (C) 2010-2025 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -52,12 +52,12 @@ ext { projectVersion = "0.9" gdxVersion = "1.9.10" mockitoVersion = "3.12.4" - espressoVersion = "3.1.0" + espressoVersion = "3.5.1" playServicesVersion = '17.0.1' cameraXVersion = "1.0.0-beta07" - room_version = "2.3.0" + room_version = "2.6.1" coroutines_version = "1.3.2" - work_manager_version = '2.7.1' + work_manager_version = '2.8.1' } apply plugin: 'com.android.application' @@ -107,7 +107,6 @@ def defaultVersionName = "1.3.0" android { compileSdk 34 - buildToolsVersion = "33.0.2" namespace 'org.catrobat.catroid' @@ -363,7 +362,7 @@ dependencies { implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5' implementation ('com.esotericsoftware:kryo:5.1.1') implementation 'id.zelory:compressor:2.1.1' - implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + implementation 'androidx.constraintlayout:constraintlayout:2.2.0' // WorkManager implementation "androidx.work:work-runtime-ktx:$work_manager_version" implementation "androidx.work:work-runtime:$work_manager_version" @@ -378,12 +377,12 @@ dependencies { } // Support libraries - implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'androidx.mediarouter:mediarouter:1.1.0' + implementation 'androidx.appcompat:appcompat:1.7.0' + implementation 'androidx.mediarouter:mediarouter:1.3.1' implementation 'androidx.cardview:cardview:1.0.0' - implementation 'com.google.android.material:material:1.2.1' - implementation 'androidx.browser:browser:1.2.0' - implementation 'androidx.core:core-ktx:1.3.2' + implementation 'com.google.android.material:material:1.10.0' + implementation 'androidx.browser:browser:1.8.0' + implementation 'androidx.core:core-ktx:1.12.0' @@ -402,7 +401,7 @@ dependencies { implementation "io.insert-koin:koin-androidx-scope:$koin_version" // Retrofit - implementation 'com.squareup.retrofit2:retrofit:2.9.0' + implementation 'com.squareup.retrofit2:retrofit:2.11.0' // retrofit moshi converter implementation 'com.squareup.retrofit2:converter-moshi:2.7.1' // Glide (Images downloader) @@ -410,8 +409,8 @@ dependencies { // Lifecycle implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version" - implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version" - implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version" + implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.1' + implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1' // Room implementation("androidx.room:room-runtime:$room_version") @@ -429,7 +428,7 @@ dependencies { implementation "com.google.android.gms:play-services-analytics:$playServicesVersion" implementation 'com.google.guava:guava:28.2-android' - implementation 'com.google.code.gson:gson:2.8.7' + implementation 'com.google.code.gson:gson:2.10.1' implementation 'com.koushikdutta.async:androidasync:2.2.1' implementation 'com.squareup.picasso:picasso:2.71828' @@ -498,13 +497,14 @@ dependencies { testImplementation 'org.powermock:powermock-module-junit4:2.0.0' testImplementation 'org.powermock:powermock-api-mockito2:2.0.0' - testImplementation 'org.robolectric:robolectric:4.7.3' + testImplementation 'org.robolectric:robolectric:4.14.1' + implementation 'androidx.databinding:viewbinding:8.6.1' testImplementation 'org.reflections:reflections:0.9.11' testImplementation 'org.json:json:20190722' // Retrofit testing - androidTestImplementation 'com.squareup.okhttp3:mockwebserver:3.14.9' + androidTestImplementation 'com.squareup.okhttp3:mockwebserver:4.11.0' // Koin for Unit tests androidTestImplementation "io.insert-koin:koin-test:$koin_version" diff --git a/catroid/gradle/code_quality_tasks.gradle b/catroid/gradle/code_quality_tasks.gradle index 80a318e80d8..90da52e8213 100644 --- a/catroid/gradle/code_quality_tasks.gradle +++ b/catroid/gradle/code_quality_tasks.gradle @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2022 The Catrobat Team + * Copyright (C) 2010-2025 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -68,7 +68,7 @@ task pmd(type: Pmd) { reports { xml.required = true - html.enabled = false + html.required = false xml.destination file("build/reports/pmd.xml") } } diff --git a/catroid/src/androidTest/res/values/strings.xml b/catroid/src/androidTest/res/values/strings.xml index 7c60e09eb79..cd67c27cb15 100644 --- a/catroid/src/androidTest/res/values/strings.xml +++ b/catroid/src/androidTest/res/values/strings.xml @@ -1,7 +1,7 @@ CatroidTest + "" diff --git a/catroid/src/catroid/res/values/strings.xml b/catroid/src/catroid/res/values/strings.xml index 28e5e666db6..735676c1fe9 100644 --- a/catroid/src/catroid/res/values/strings.xml +++ b/catroid/src/catroid/res/values/strings.xml @@ -1,7 +1,7 @@ + + + + + + + + + diff --git a/catroid/src/main/java/org/catrobat/catroid/camera/CameraManager.kt b/catroid/src/main/java/org/catrobat/catroid/camera/CameraManager.kt index 7f6c4680c07..fbbfe458e54 100644 --- a/catroid/src/main/java/org/catrobat/catroid/camera/CameraManager.kt +++ b/catroid/src/main/java/org/catrobat/catroid/camera/CameraManager.kt @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2022 The Catrobat Team + * Copyright (C) 2010-2025 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -47,7 +47,7 @@ import org.koin.java.KoinJavaComponent.get class CameraManager(private val stageActivity: StageActivity) : LifecycleOwner { private val cameraProvider = ProcessCameraProvider.getInstance(stageActivity).get() - private val lifecycle = LifecycleRegistry(this) + override val lifecycle = LifecycleRegistry(this) val previewView = PreviewView(stageActivity).apply { visibility = View.INVISIBLE } @@ -282,5 +282,5 @@ class CameraManager(private val stageActivity: StageActivity) : LifecycleOwner { destroy() } - override fun getLifecycle() = lifecycle + } diff --git a/catroid/src/main/java/org/catrobat/catroid/utils/LiveDataExtensions.kt b/catroid/src/main/java/org/catrobat/catroid/utils/LiveDataExtensions.kt index 8b850e17fb0..a7c64c139b6 100644 --- a/catroid/src/main/java/org/catrobat/catroid/utils/LiveDataExtensions.kt +++ b/catroid/src/main/java/org/catrobat/catroid/utils/LiveDataExtensions.kt @@ -1,6 +1,6 @@ /* * Catroid: An on-device visual programming system for Android devices - * Copyright (C) 2010-2022 The Catrobat Team + * Copyright (C) 2010-2025 The Catrobat Team * () * * This program is free software: you can redistribute it and/or modify @@ -68,8 +68,8 @@ fun LiveData.getOrAwaitValue( var data: T? = null val latch = CountDownLatch(1) val observer = object : Observer { - override fun onChanged(o: T?) { - data = o + override fun onChanged(value: T) { + data = value latch.countDown() this@getOrAwaitValue.removeObserver(this) } diff --git a/gradle.properties b/gradle.properties index 8fd81b20003..43f821059c2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ # # Catroid: An on-device visual programming system for Android devices -# Copyright (C) 2010-2022 The Catrobat Team +# Copyright (C) 2010-2025 The Catrobat Team # () # # This program is free software: you can redistribute it and/or modify @@ -32,3 +32,7 @@ android.useAndroidX=true android.enableJetifier=true org.gradle.caching=false +android.nonTransitiveRClass=false +android.nonFinalResIds=false +android.enableResourceValidation=false + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 68ddaeb6203..53c4d53382d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Jun 09 18:08:52 CEST 2023 +#Fri Jan 10 11:36:51 CET 2025 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists