Merge pull request #3954 from vector-im/dependabot/gradle/com.android.tools.build-gradle-7.0.2
Bump gradle from 4.2.2 to 7.0.2
This commit is contained in:
commit
377c4e00a3
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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/*.*
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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" />
|
||||
|
||||
|
|
|
@ -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
|
||||
|
@ -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" />
|
||||
|
||||
|
|
|
@ -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>
|
|
@ -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'
|
||||
|
|
|
@ -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,6 +3,3 @@ apply plugin: 'java-library'
|
|||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
}
|
||||
|
||||
sourceCompatibility = "8"
|
||||
targetCompatibility = "8"
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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>
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<lint>
|
||||
<!-- Modify some severity -->
|
||||
|
||||
<!-- Resource -->
|
||||
<issue id="MissingTranslation" severity="warning" />
|
||||
<issue id="TypographyEllipsis" severity="error" />
|
||||
<issue id="ImpliedQuantity" severity="warning" />
|
||||
|
||||
<!-- UX -->
|
||||
<issue id="ButtonOrder" severity="error" />
|
||||
|
||||
<!-- Layout -->
|
||||
<issue id="UnknownIdInLayout" severity="error" />
|
||||
<issue id="StringFormatCount" severity="error" />
|
||||
<issue id="HardcodedText" severity="error" />
|
||||
<issue id="SpUsage" severity="error" />
|
||||
<issue id="ObsoleteLayoutParam" severity="error" />
|
||||
<issue id="InefficientWeight" severity="error" />
|
||||
<issue id="DisableBaselineAlignment" severity="error" />
|
||||
<issue id="ScrollViewSize" severity="error" />
|
||||
|
||||
<!-- RTL -->
|
||||
<issue id="RtlEnabled" severity="error" />
|
||||
<issue id="RtlHardcoded" severity="error" />
|
||||
<issue id="RtlSymmetry" severity="error" />
|
||||
|
||||
<!-- Code -->
|
||||
<issue id="SetTextI18n" severity="error" />
|
||||
<issue id="ViewConstructor" severity="error" />
|
||||
<issue id="UseValueOf" severity="error" />
|
||||
<issue id="ObsoleteSdkInt" severity="error" />
|
||||
|
||||
</lint>
|
|
@ -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>
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue