Skip to content

Commit 00dea85

Browse files
build(deps): bump com.android.tools.build:gradle from 8.7.2 to 9.2.1 (#4865)
* build(deps): bump com.android.tools.build:gradle from 8.7.2 to 9.2.1 Signed-off-by: Jorge Aguado Recio <jaguado@izertis.com> * chore: add calens file Signed-off-by: Jorge Aguado Recio <jaguado@izertis.com> --------- Signed-off-by: Jorge Aguado Recio <jaguado@izertis.com> Co-authored-by: Jorge Aguado Recio <jaguado@izertis.com>
1 parent 8ad9fc2 commit 00dea85

23 files changed

Lines changed: 235 additions & 361 deletions

File tree

‎changelog/unreleased/4865‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Change: Bump AGP from 8.7.2 to 9.2.1
2+
3+
Android Gradle Plugin (AGP) has been updated from version 8.7.2 to 9.2.1, along
4+
with other dependencies required to build the app with this new version.
5+
6+
https://github.com/owncloud/android/pull/4865

‎gradle.properties‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
android.defaults.buildfeatures.buildconfig=true
21
android.enableJetifier=true
3-
android.nonFinalResIds=false
42
android.nonTransitiveRClass=false
53
android.useAndroidX=true
64
org.gradle.jvmargs=-Xmx1536M

‎gradle/libs.versions.toml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[versions]
2-
androidGradlePlugin = "8.7.2"
2+
androidGradlePlugin = "9.2.1"
33
androidxActivity = "1.6.1"
44
androidxAnnotation = "1.6.0"
55
androidxAppCompat = "1.6.1"
@@ -15,8 +15,8 @@ androidxFragment = "1.5.7"
1515
androidxLegacy = "1.0.0"
1616
androidxLifecycle = "2.5.1"
1717
androidxLifecycleExtensions = "2.2.0"
18-
androidxRoom = "2.5.1"
19-
androidxSqlite = "2.3.1"
18+
androidxRoom = "2.8.4"
19+
androidxSqlite = "2.5.2"
2020
androidxTest = "1.4.0"
2121
androidxTestExt = "1.1.5"
2222
androidxTestMonitor = "1.6.1"
@@ -33,9 +33,9 @@ glide = "4.15.1"
3333
glideToVectorYou = "v2.0.0"
3434
junit4 = "4.13.2"
3535
koin = "3.3.3"
36-
kotlin = "1.9.20"
36+
kotlin = "2.3.10"
3737
kotlinxCoroutines = "1.9.0"
38-
ksp = "1.9.20-1.0.14"
38+
ksp = "2.3.10"
3939
ktlint = "14.2.0"
4040
markwon = "4.6.2"
4141
material = "1.8.0"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

‎owncloudApp/build.gradle‎

Lines changed: 22 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
apply plugin: 'com.android.application'
22
apply plugin: 'com.google.devtools.ksp'
3-
apply plugin: 'kotlin-android'
43
apply plugin: 'kotlin-parcelize'
54

65
def commitSHA1 = 'COMMIT_SHA1'
@@ -93,11 +92,11 @@ dependencies {
9392
}
9493

9594
android {
96-
compileSdkVersion sdkCompileVersion
95+
compileSdk sdkCompileVersion
9796

9897
defaultConfig {
99-
minSdkVersion sdkMinVersion
100-
targetSdkVersion sdkTargetVersion
98+
minSdk sdkMinVersion
99+
targetSdk sdkTargetVersion
101100

102101
testInstrumentationRunner "com.owncloud.android.utils.OCTestAndroidJUnitRunner"
103102

@@ -113,10 +112,6 @@ android {
113112
targetCompatibility JavaVersion.VERSION_17
114113
}
115114

116-
kotlinOptions {
117-
jvmTarget = JavaVersion.VERSION_17.toString()
118-
}
119-
120115
sourceSets {
121116
androidTest.java.srcDirs += "src/test-common/java"
122117
test.java.srcDirs += "src/test-common/java"
@@ -166,11 +161,6 @@ android {
166161
}
167162
}
168163

169-
applicationVariants.all { variant ->
170-
def appName = System.env.OC_APP_NAME
171-
setOutputFileName(variant, appName, project)
172-
}
173-
174164
testOptions {
175165
packagingOptions {
176166
jniLibs {
@@ -183,9 +173,10 @@ android {
183173

184174
buildFeatures {
185175
viewBinding true
176+
buildConfig true
186177
}
187178

188-
packagingOptions {
179+
packaging {
189180
resources.excludes.add("META-INF/*")
190181
}
191182

@@ -194,50 +185,23 @@ android {
194185
}
195186

196187
// Updates output file names of a given variant to format
197-
// [appName].[variant.versionName].[OC_BUILD_NUMBER]-[variant.name].apk.
198-
//
199-
// OC_BUILD_NUMBER is an environment variable read directly in this method. If undefined, it's not added.
200-
//
201-
// @param variant Build variant instance which output file name will be updated.
202-
// @param appName String to use as first part of the new file name. May be undefined, the original
203-
// project.archivesBaseName property will be used instead.
204-
// @param callerProject Caller project.
205-
206-
def setOutputFileName(variant, appName, callerProject) {
207-
logger.info("Setting new name for output of variant $variant.name")
208-
209-
def originalFile = variant.outputs[0].outputFile
210-
def originalName = originalFile.name
211-
println "originalName is $originalName"
212-
213-
def newName = ""
214-
215-
if (appName) {
216-
newName += appName
217-
} else {
218-
newName += "owncloud"
219-
}
220-
221-
def versionName = "$variant.mergedFlavor.versionName"
222-
if (variant.mergedFlavor.manifestPlaceholders.versionName != null) {
223-
versionName = "$variant.mergedFlavor.manifestPlaceholders.versionName"
224-
}
225-
if (variant.buildType.manifestPlaceholders.versionName != null) {
226-
versionName = "$variant.buildType.manifestPlaceholders.versionName"
227-
}
228-
newName += "_$versionName"
229-
230-
def buildNumber = System.env.OC_BUILD_NUMBER
231-
if (buildNumber) {
232-
newName += "_$buildNumber"
233-
}
234-
235-
newName += originalName.substring(callerProject.archivesBaseName.length())
236-
237-
println "$variant.name: newName is $newName"
238-
239-
variant.outputs.all {
240-
outputFileName = newName
188+
// [appName].[variant.versionName].[OC_BUILD_NUMBER]-[variant.name].apk using the new AGP Variant API (androidComponents)
189+
androidComponents {
190+
onVariants(selector().all()) { variant ->
191+
def appName = System.env.OC_APP_NAME ?: "owncloud"
192+
def buildNumber = System.env.OC_BUILD_NUMBER
193+
variant.outputs.each { output ->
194+
if (output.outputType == com.android.build.api.variant.VariantOutputConfiguration.OutputType.SINGLE) {
195+
output.outputFileName.set(output.versionName.map { versionName ->
196+
def newName = appName + "_" + versionName
197+
if (buildNumber) {
198+
newName += "_" + buildNumber
199+
}
200+
newName += "-" + variant.name + ".apk"
201+
newName
202+
})
203+
}
204+
}
241205
}
242206
}
243207

‎owncloudApp/src/main/java/com/owncloud/android/media/MediaControlView.java‎

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
* @author David A. Velasco
55
* @author Christian Schabesberger
66
* @author David González Verdugo
7-
* Copyright (C) 2020 ownCloud GmbH.
7+
* @author Jorge Aguado Recio
8+
*
9+
* Copyright (C) 2026 ownCloud GmbH.
810
* <p>
911
* This program is free software: you can redistribute it and/or modify
1012
* it under the terms of the GNU General Public License version 2,
@@ -292,32 +294,28 @@ public void setEnabled(boolean enabled) {
292294
public void onClick(View v) {
293295
int pos;
294296
boolean playing = mPlayer.isPlaying();
295-
switch (v.getId()) {
296-
297-
case R.id.playBtn:
298-
doPauseResume();
299-
break;
300-
301-
case R.id.rewindBtn:
302-
pos = mPlayer.getCurrentPosition();
303-
pos -= 5000;
304-
mPlayer.seekTo(pos);
305-
if (!playing) {
306-
mPlayer.pause(); // necessary in some 2.3.x devices
307-
}
308-
setProgress();
309-
break;
310-
311-
case R.id.forwardBtn:
312-
pos = mPlayer.getCurrentPosition();
313-
pos += 15000;
314-
mPlayer.seekTo(pos);
315-
if (!playing) {
316-
mPlayer.pause(); // necessary in some 2.3.x devices
317-
}
318-
setProgress();
319-
break;
320-
297+
int id = v.getId();
298+
299+
// Using an if / else if / else block because Java switch statements
300+
// with resource ID comparisons are no longer supported in AGP 9
301+
if (id == R.id.playBtn) {
302+
doPauseResume();
303+
} else if (id == R.id.rewindBtn) {
304+
pos = mPlayer.getCurrentPosition();
305+
pos -= 5000;
306+
mPlayer.seekTo(pos);
307+
if (!playing) {
308+
mPlayer.pause(); // necessary in some 2.3.x devices
309+
}
310+
setProgress();
311+
} else if (id == R.id.forwardBtn) {
312+
pos = mPlayer.getCurrentPosition();
313+
pos += 15000;
314+
mPlayer.seekTo(pos);
315+
if (!playing) {
316+
mPlayer.pause(); // necessary in some 2.3.x devices
317+
}
318+
setProgress();
321319
}
322320
}
323321

‎owncloudApp/src/main/java/com/owncloud/android/presentation/sharing/shares/PublicShareDialogFragment.kt‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
* @author Christian Schabesberger
77
* @author Aitor Ballesteros Pavón
88
* @author Juan Carlos Garrote Gascón
9+
* @author Jorge Aguado Recio
910
*
10-
* Copyright (C) 2024 ownCloud GmbH.
11+
* Copyright (C) 2026 ownCloud GmbH.
1112
*
1213
* This program is free software: you can redistribute it and/or modify
1314
* it under the terms of the GNU General Public License version 2,
@@ -50,6 +51,7 @@ import com.owncloud.android.R
5051
import com.owncloud.android.databinding.SharePublicDialogBinding
5152
import com.owncloud.android.domain.capabilities.model.CapabilityBooleanType
5253
import com.owncloud.android.domain.capabilities.model.OCCapability
54+
import com.owncloud.android.domain.capabilities.model.PasswordPolicy
5355
import com.owncloud.android.domain.exceptions.UnhandledHttpCodeException
5456
import com.owncloud.android.domain.files.model.OCFile
5557
import com.owncloud.android.domain.sharing.shares.model.OCShare
@@ -364,7 +366,7 @@ class PublicShareDialogFragment : DialogFragment() {
364366
}
365367
}
366368

367-
private fun updateRequirementsPasswordPolicy(password: String, passwordPolicy: OCCapability.PasswordPolicy) {
369+
private fun updateRequirementsPasswordPolicy(password: String, passwordPolicy: PasswordPolicy) {
368370

369371
var hasMinCharacters = true
370372
var hasMaxCharacters = true

‎owncloudApp/src/main/java/com/owncloud/android/presentation/spaces/links/SetPasswordDialogFragment.kt‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import androidx.core.widget.doOnTextChanged
3737
import androidx.fragment.app.DialogFragment
3838
import com.owncloud.android.R
3939
import com.owncloud.android.databinding.SetPasswordDialogBinding
40-
import com.owncloud.android.domain.capabilities.model.OCCapability
40+
import com.owncloud.android.domain.capabilities.model.PasswordPolicy
4141
import com.owncloud.android.presentation.capabilities.CapabilityViewModel
4242
import com.owncloud.android.presentation.common.UIResult
4343
import com.owncloud.android.presentation.sharing.generatePassword
@@ -57,7 +57,7 @@ class SetPasswordDialogFragment: DialogFragment() {
5757

5858
private lateinit var setPasswordListener: SetPasswordListener
5959

60-
private var passwordPolicy: OCCapability.PasswordPolicy? = null
60+
private var passwordPolicy: PasswordPolicy? = null
6161

6262
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
6363
_binding = SetPasswordDialogBinding.inflate(inflater, container, false)
@@ -134,7 +134,7 @@ class SetPasswordDialogFragment: DialogFragment() {
134134
setPasswordListener.onCancelPassword()
135135
}
136136

137-
private fun updatePasswordPolicyRequirements(password: String, passwordPolicy: OCCapability.PasswordPolicy) {
137+
private fun updatePasswordPolicyRequirements(password: String, passwordPolicy: PasswordPolicy) {
138138
var hasMinCharacters = true
139139
var hasMaxCharacters = true
140140
var hasUpperCase = true

‎owncloudApp/src/main/java/com/owncloud/android/ui/activity/ReceiveExternalFilesActivity.java‎

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -506,23 +506,22 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
506506
@Override
507507
public void onClick(View v) {
508508
// click on button
509-
switch (v.getId()) {
510-
case R.id.uploader_choose_folder:
511-
mUploadPath = ""; // first element in mParents is root dir, represented by "";
512-
// init mUploadPath with "/" results in a "//" prefix
513-
for (String p : mParents) {
514-
mUploadPath += p + File.separator;
515-
}
516-
if (!isPlainTextUpload()) {
517-
Timber.d("Uploading file to dir %s", mUploadPath);
518-
uploadFiles();
519-
} else {
520-
showUploadTextDialog();
521-
}
522-
break;
523-
524-
default:
525-
throw new IllegalArgumentException("Wrong element clicked");
509+
// Using an if / else if / else block because Java switch statements
510+
// with resource ID comparisons are no longer supported in AGP 9
511+
if (v.getId() == R.id.uploader_choose_folder) {
512+
mUploadPath = ""; // first element in mParents is root dir, represented by "";
513+
// init mUploadPath with "/" results in a "//" prefix
514+
for (String p : mParents) {
515+
mUploadPath += p + File.separator;
516+
}
517+
if (!isPlainTextUpload()) {
518+
Timber.d("Uploading file to dir %s", mUploadPath);
519+
uploadFiles();
520+
} else {
521+
showUploadTextDialog();
522+
}
523+
} else {
524+
throw new IllegalArgumentException("Wrong element clicked");
526525
}
527526
}
528527

‎owncloudComLibrary/build.gradle‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
apply plugin: 'com.android.library'
2-
apply plugin: 'kotlin-android'
32
apply plugin: 'com.google.devtools.ksp'
43
apply plugin: 'kotlin-parcelize'
54

@@ -33,22 +32,18 @@ dependencies {
3332
}
3433

3534
android {
36-
compileSdkVersion sdkCompileVersion
35+
compileSdk sdkCompileVersion
3736

3837
defaultConfig {
39-
minSdkVersion sdkMinVersion
40-
targetSdkVersion sdkTargetVersion
38+
minSdk sdkMinVersion
39+
targetSdk sdkTargetVersion
4140
}
4241

4342
compileOptions {
4443
sourceCompatibility JavaVersion.VERSION_17
4544
targetCompatibility JavaVersion.VERSION_17
4645
}
4746

48-
kotlinOptions {
49-
jvmTarget = JavaVersion.VERSION_17.toString()
50-
}
51-
5247
lint {
5348
abortOnError false
5449
ignoreWarnings true

0 commit comments

Comments
 (0)