Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump gradle from 7.2.2 to 7.3.1 #7364

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -342,17 +342,21 @@ subprojects { project ->
if (it instanceof com.android.build.gradle.LibraryExtension) {
libraryVariants.all { variant ->
def outputFolder = new File("build/generated/ksp/${variant.name}/kotlin")
variant.addJavaSourceFoldersToModel(outputFolder)
android.sourceSets.getAt(variant.name).java {
srcDir(outputFolder)
if (outputFolder.exists()) {
variant.addJavaSourceFoldersToModel(outputFolder)
android.sourceSets.getAt(variant.name).java {
srcDir(outputFolder)
}
}
}
} else if (it instanceof com.android.build.gradle.AppExtension) {
applicationVariants.all { variant ->
def outputFolder = new File("build/generated/ksp/${variant.name}/kotlin")
variant.addJavaSourceFoldersToModel(outputFolder)
android.sourceSets.getAt(variant.name).java {
srcDir(outputFolder)
if (outputFolder.exists()) {
variant.addJavaSourceFoldersToModel(outputFolder)
android.sourceSets.getAt(variant.name).java {
srcDir(outputFolder)
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ext.versions = [
'targetCompat' : JavaVersion.VERSION_11,
]

def gradle = "7.2.2"
def gradle = "7.3.1"
// Ref: https://kotlinlang.org/releases.html
def kotlin = "1.7.20"
def kotlinCoroutines = "1.6.4"
Expand Down
1 change: 1 addition & 0 deletions dependencies_groups.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ ext.groups = [
'io.netty',
'io.noties.markwon',
'io.opencensus',
'io.perfmark',
'io.reactivex.rxjava2',
'io.realm',
'io.sentry',
Expand Down
1 change: 1 addition & 0 deletions library/attachment-viewer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
namespace "im.vector.lib.attachmentviewer"

compileSdk versions.compileSdk

Expand Down
2 changes: 1 addition & 1 deletion library/attachment-viewer/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="im.vector.lib.attachmentviewer" />
<manifest />
2 changes: 2 additions & 0 deletions library/core-utils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ plugins {
}

android {
namespace "im.vector.lib.core.utils"

compileSdk versions.compileSdk
defaultConfig {
minSdk versions.minSdk
Expand Down
2 changes: 1 addition & 1 deletion library/core-utils/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="im.vector.lib.core.utils" />
<manifest />
2 changes: 2 additions & 0 deletions library/external/dialpad/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
namespace "com.android.dialer.dialpadview"

compileSdk versions.compileSdk

defaultConfig {
Expand Down
2 changes: 1 addition & 1 deletion library/external/dialpad/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.android.dialer.dialpadview" />
<manifest />
2 changes: 2 additions & 0 deletions library/external/jsonviewer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ buildscript {
}

android {
namespace "org.billcarsonfr.jsonviewer"

compileSdk versions.compileSdk

defaultConfig {
Expand Down
2 changes: 1 addition & 1 deletion library/external/jsonviewer/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<manifest package="org.billcarsonfr.jsonviewer" />
<manifest />
2 changes: 2 additions & 0 deletions library/multipicker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-parcelize'

android {
namespace "im.vector.lib.multipicker"

compileSdk versions.compileSdk

defaultConfig {
Expand Down
3 changes: 1 addition & 2 deletions library/multipicker/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="im.vector.lib.multipicker">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application>
<provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package im.vector.lib.multipicker

import android.annotation.SuppressLint
import android.content.ContentResolver
import android.content.Context
import android.content.Intent
Expand All @@ -34,6 +35,7 @@ class ContactPicker : Picker<MultiPickerContactType>() {
* Call this function from onActivityResult(int, int, Intent).
* Returns selected contact or empty list if user did not select any contacts.
*/
@SuppressLint("Recycle")
override fun getSelectedFiles(context: Context, data: Intent?): List<MultiPickerContactType> {
val contactList = mutableListOf<MultiPickerContactType>()

Expand Down
2 changes: 2 additions & 0 deletions library/ui-strings/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ plugins {
}

android {
namespace "im.vector.lib.strings"

compileSdk versions.compileSdk
defaultConfig {
minSdk versions.minSdk
Expand Down
2 changes: 1 addition & 1 deletion library/ui-strings/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="im.vector.lib.strings" />
<manifest />
2 changes: 2 additions & 0 deletions library/ui-styles/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ plugins {

android {

namespace "im.vector.lib.ui.styles"

compileSdk versions.compileSdk
defaultConfig {
minSdk versions.minSdk
Expand Down
3 changes: 1 addition & 2 deletions library/ui-styles/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="im.vector.lib.ui.styles">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application android:theme="@style/Theme.Vector.Light">
<activity
Expand Down
5 changes: 2 additions & 3 deletions library/ui-styles/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"
package="im.vector.lib.ui.styles">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application android:supportsRtl="true" />

</manifest>
</manifest>
2 changes: 2 additions & 0 deletions matrix-sdk-android-flow/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ plugins {
}

android {
namespace "org.matrix.android.sdk.flow"

compileSdk versions.compileSdk

defaultConfig {
Expand Down
5 changes: 1 addition & 4 deletions matrix-sdk-android-flow/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.matrix.android.sdk.flow">

</manifest>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" />
2 changes: 2 additions & 0 deletions matrix-sdk-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ dokkaHtml {
}

android {
namespace "org.matrix.android.sdk"

testOptions.unitTests.includeAndroidResources = true

compileSdk versions.compileSdk
Expand Down
3 changes: 1 addition & 2 deletions matrix-sdk-android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.matrix.android.sdk">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ internal class FileUploader @Inject constructor(
workingFile.outputStream().use {
inputStream.copyTo(it)
}
inputStream.close()
workingFile
}
}
Expand Down
1 change: 1 addition & 0 deletions vector-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ ext.abiVersionCodes = ["armeabi-v7a": 1, "arm64-v8a": 2, "x86": 3, "x86_64": 4].
def buildNumber = System.env.BUILDKITE_BUILD_NUMBER as Integer ?: 0

android {
namespace "im.vector.application"
// Due to a bug introduced in Android gradle plugin 3.6.0, we have to specify the ndk version to use
// Ref: https://issuetracker.google.com/issues/144111441
ndkVersion "21.3.6528147"
Expand Down
3 changes: 1 addition & 2 deletions vector-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="im.vector.application">
xmlns:tools="http://schemas.android.com/tools">

<application
android:name="im.vector.app.VectorApplication"
Expand Down
2 changes: 2 additions & 0 deletions vector-config/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ plugins {
}

android {
namespace "im.vector.app.config"

compileSdk versions.compileSdk

defaultConfig {
Expand Down
2 changes: 1 addition & 1 deletion vector-config/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="im.vector.app.config" />
<manifest />
1 change: 1 addition & 0 deletions vector/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ project.android.buildTypes.all { buildType ->
initScreenshotTests(project)

android {
namespace "im.vector.app"
// Due to a bug introduced in Android gradle plugin 3.6.0, we have to specify the ndk version to use
// Ref: https://issuetracker.google.com/issues/144111441
ndkVersion "21.3.6528147"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import io.mockk.every
import io.mockk.mockk
import kotlinx.coroutines.test.runTest
import org.amshove.kluent.shouldBeEqualTo
import org.junit.Ignore
import org.junit.Test
import org.matrix.android.sdk.api.session.crypto.model.UserVerificationLevel
import org.matrix.android.sdk.api.session.room.model.Membership
Expand All @@ -36,6 +37,7 @@ import kotlin.coroutines.suspendCoroutine
class RoomMemberListControllerTest {

@Test
@Ignore("Too flaky")
fun testControllerUserVerificationLevel() = runTest {
val roomListController = RoomMemberListController(
avatarRenderer = mockk {
Expand Down
3 changes: 1 addition & 2 deletions vector/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="im.vector.app">
xmlns:tools="http://schemas.android.com/tools">

<!-- Needed for VOIP call to detect and switch to headset-->
<uses-permission
Expand Down
2 changes: 2 additions & 0 deletions vector/src/main/java/im/vector/app/core/files/FileSaver.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package im.vector.app.core.files

import android.annotation.SuppressLint
import android.app.DownloadManager
import android.content.ContentValues
import android.content.Context
Expand Down Expand Up @@ -52,6 +53,7 @@ fun writeToFile(data: ByteArray, file: File) {
}
}

@SuppressLint("Recycle")
fun addEntryToDownloadManager(
context: Context,
file: File,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package im.vector.app.core.utils

import android.annotation.SuppressLint
import android.app.Activity
import android.app.DownloadManager
import android.content.ActivityNotFoundException
Expand Down Expand Up @@ -256,6 +257,7 @@ private fun appendTimeToFilename(name: String): String {
return """${filename}_$dateExtension.$fileExtension"""
}

@SuppressLint("Recycle")
suspend fun saveMedia(
context: Context,
file: File,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ class KeysExporter @Inject constructor(
when {
output == null -> throw IllegalStateException("Exported file not found")
output.statSize != expectedSize -> {
throw UnexpectedExportKeysFileSizeException(
val exception = UnexpectedExportKeysFileSizeException(
expectedFileSize = expectedSize,
actualFileSize = output.statSize
)
output.close()
throw exception
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
package im.vector.app.features.crypto.keys

import android.net.Uri
import android.os.ParcelFileDescriptor
import im.vector.app.core.dispatchers.CoroutineDispatchers
import im.vector.app.test.fakes.FakeContext
import im.vector.app.test.fakes.FakeCryptoService
import im.vector.app.test.fakes.FakeSession
import io.mockk.every
import io.mockk.justRun
import io.mockk.mockk
import io.mockk.verify
import kotlinx.coroutines.Dispatchers
Expand Down Expand Up @@ -91,7 +91,10 @@ class KeysExporterTest {

private fun givenFileDescriptorWithSize(size: Long) {
context.givenFileDescriptor(A_URI, mode = "r") {
mockk<ParcelFileDescriptor>().also { every { it.statSize } returns size }
mockk {
every { statSize } returns size
justRun { close() }
}
}
}
}