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 4.2.2 to 7.0.2 #3954

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
18 changes: 18 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@ on:
branches: [ main, develop ]

jobs:
# Temporary add build of Android tests, which cannot be run on the CI right now, but they need to at least compile
# So it will be mandatory for this action to be successful on every PRs
compile-android-test:
name: Compile Android tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Compile Android tests
run: ./gradlew clean assembleAndroidTest --stacktrace -PallWarningsAsErrors=false

integration-tests:
name: Integration Tests (Synapse)
runs-on: ubuntu-latest
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.36.0/ktlint && chmod a+x ktlint
./ktlint --android --experimental -v

# Lint for main module and all the other modules
android-lint:
name: Android Linter
runs-on: ubuntu-latest
Expand All @@ -37,14 +38,16 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Lint analysis of the SDK
run: ./gradlew clean :matrix-sdk-android:lintRelease --stacktrace
- name: Lint analysis
run: ./gradlew clean :vector:lint --stacktrace
- name: Upload reports
uses: actions/upload-artifact@v2
with:
name: linting-report-android-sdk
path: matrix-sdk-android/build/reports/*.*
name: lint-report
path: |
vector/build/reports/*.*

# Lint for Gplay and Fdroid release APK
apk-lint:
name: Lint APK (${{ matrix.target }})
runs-on: ubuntu-latest
Expand All @@ -69,6 +72,6 @@ jobs:
uses: actions/upload-artifact@v2
if: always()
with:
name: release-debug-linting-report-${{ matrix.target }}
name: release-lint-report-${{ matrix.target }}
path: |
vector/build/reports/*.*
6 changes: 3 additions & 3 deletions attachment-viewer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '1.8'
jvmTarget = "11"
}

buildFeatures {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools">
android:layout_height="match_parent">

<ImageView
android:id="@+id/imageView"
android:visibility="visible"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent"
android:importantForAccessibility="no"
android:visibility="visible" />

<ProgressBar
android:layout_centerInParent="true"
android:id="@+id/imageLoaderProgress"
style="?android:attr/progressBarStyle"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerInParent="true"
android:visibility="visible"
tools:visibility="gone" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:importantForAccessibility="no"
android:scaleType="centerInside" />

<VideoView
Expand All @@ -22,6 +23,7 @@
android:layout_width="44dp"
android:layout_height="44dp"
android:layout_centerInParent="true"
android:contentDescription="@string/a11y_play_pause"
android:visibility="gone"
tools:visibility="visible" />

Expand Down
5 changes: 5 additions & 0 deletions attachment-viewer/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- TODO Create a dedicated module for translations to be able to translate this string like the others (See #3955) -->
<string name="a11y_play_pause">Play or pause the video</string>
</resources>
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ buildscript {
}
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
// Release notes of Android Gradle Plugin (AGP):
// https://developer.android.com/studio/releases/gradle-plugin
classpath 'com.android.tools.build:gradle:7.0.2'
classpath 'com.google.gms:google-services:4.3.10'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.3'
Expand Down
2 changes: 2 additions & 0 deletions changelog.d/3954.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Upgrade AGP to 7.0.2.
When compiling using command line, make sure to use the JDK 11 by adding for instance `-Dorg.gradle.java.home=/Applications/Android\ Studio\ Preview.app/Contents/jre/Contents/Home` or by setting JAVA_HOME.
3 changes: 0 additions & 3 deletions diff-match-patch/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@ apply plugin: 'java-library'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
}

sourceCompatibility = "8"
targetCompatibility = "8"
9 changes: 6 additions & 3 deletions library/ui-styles/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = "11"
}

buildFeatures {
viewBinding true
}
Expand Down
7 changes: 6 additions & 1 deletion library/ui-styles/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="im.vector.lib.ui.styles"/>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="im.vector.lib.ui.styles">

<application android:supportsRtl="true" />

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
tools:ignore="UselessParent">

<!-- Inspired from https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/layout/progress_dialog.xml -->
<LinearLayout
Expand Down
6 changes: 3 additions & 3 deletions matrix-sdk-android-rx/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "11"
}
}

Expand Down
10 changes: 3 additions & 7 deletions matrix-sdk-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,13 @@ android {
installOptions "-g"
}

lintOptions {
lintConfig file("lint.xml")
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "11"
}

sourceSets {
Expand Down
34 changes: 0 additions & 34 deletions matrix-sdk-android/lint.xml

This file was deleted.

18 changes: 18 additions & 0 deletions matrix-sdk-android/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.matrix.android.sdk">

<application>

<!--
This is mandatory to run integration tests
-->
<provider
android:name="androidx.work.impl.WorkManagerInitializer"
android:authorities="${applicationId}.workmanager-init"
android:exported="false"
tools:node="remove" />

</application>

</manifest>
9 changes: 0 additions & 9 deletions matrix-sdk-android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@

<application android:networkSecurityConfig="@xml/network_security_config">

<!--
This is mandatory to run integration tests
-->
<provider
android:name="androidx.work.impl.WorkManagerInitializer"
android:authorities="${applicationId}.workmanager-init"
android:exported="false"
tools:node="remove" />

<!--
The SDK offers a secured File provider to access downloaded files.
Access to these file will be given via the FileService, with a temporary
Expand Down
7 changes: 4 additions & 3 deletions vector/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -284,16 +284,17 @@ android {
lintOptions {
lintConfig file("lint.xml")

checkDependencies true
abortOnError true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "11"
}

sourceSets {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.media.AudioManager
import android.os.Build
import timber.log.Timber
import java.lang.ref.WeakReference

Expand Down Expand Up @@ -69,11 +68,7 @@ class WiredHeadsetStateReceiver : BroadcastReceiver() {
fun createAndRegister(context: Context, listener: HeadsetEventListener): WiredHeadsetStateReceiver {
val receiver = WiredHeadsetStateReceiver()
receiver.delegate = WeakReference(listener)
val action = if (Build.VERSION.SDK_INT >= 21) {
AudioManager.ACTION_HEADSET_PLUG
} else {
Intent.ACTION_HEADSET_PLUG
}
val action = AudioManager.ACTION_HEADSET_PLUG
context.registerReceiver(receiver, IntentFilter(action))
return receiver
}
Expand Down