From f0f778e87287a5c4f55b8ea9e1f6be3045c8fa9e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Sep 2021 23:09:57 +0000 Subject: [PATCH 01/10] Bump gradle from 4.2.2 to 7.0.2 Bumps gradle from 4.2.2 to 7.0.2. --- updated-dependencies: - dependency-name: com.android.tools.build:gradle dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index dc75b34846b..05024aa7597 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:4.2.2' + 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' From 9a0f38455a7f70e28d7e2d76370d3414f4b8193d Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 2 Sep 2021 09:36:13 +0200 Subject: [PATCH 02/10] Add link to the release notes --- build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.gradle b/build.gradle index 05024aa7597..ef26530298f 100644 --- a/build.gradle +++ b/build.gradle @@ -12,6 +12,8 @@ buildscript { } } dependencies { + // 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" From f37dadc1bbe59f975ef3008b4264e1760b910336 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 2 Sep 2021 09:38:24 +0200 Subject: [PATCH 03/10] Fix lint issue We are now API 21 min --- .../vector/app/core/services/WiredHeadsetStateReceiver.kt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/vector/src/main/java/im/vector/app/core/services/WiredHeadsetStateReceiver.kt b/vector/src/main/java/im/vector/app/core/services/WiredHeadsetStateReceiver.kt index e276e248514..ac6ced002ed 100644 --- a/vector/src/main/java/im/vector/app/core/services/WiredHeadsetStateReceiver.kt +++ b/vector/src/main/java/im/vector/app/core/services/WiredHeadsetStateReceiver.kt @@ -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 } From 616e5b17f024ee4caba91cd7dcfd6f5b485eaebe Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 2 Sep 2021 09:43:39 +0200 Subject: [PATCH 04/10] Fix warning provider#androidx.work.impl.WorkManagerInitializer was tagged at AndroidManifest.xml:16 to remove other declarations but no other declaration present --- .../src/androidTest/AndroidManifest.xml | 18 ++++++++++++++++++ .../src/main/AndroidManifest.xml | 9 --------- 2 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 matrix-sdk-android/src/androidTest/AndroidManifest.xml diff --git a/matrix-sdk-android/src/androidTest/AndroidManifest.xml b/matrix-sdk-android/src/androidTest/AndroidManifest.xml new file mode 100644 index 00000000000..274bd8c87b1 --- /dev/null +++ b/matrix-sdk-android/src/androidTest/AndroidManifest.xml @@ -0,0 +1,18 @@ + + + + + + + + + + diff --git a/matrix-sdk-android/src/main/AndroidManifest.xml b/matrix-sdk-android/src/main/AndroidManifest.xml index 220a168f60e..de0731422c1 100644 --- a/matrix-sdk-android/src/main/AndroidManifest.xml +++ b/matrix-sdk-android/src/main/AndroidManifest.xml @@ -10,15 +10,6 @@ - - - + Play or pause the video + \ No newline at end of file diff --git a/library/ui-styles/src/main/AndroidManifest.xml b/library/ui-styles/src/main/AndroidManifest.xml index 19aa89e2e7d..254827465d5 100644 --- a/library/ui-styles/src/main/AndroidManifest.xml +++ b/library/ui-styles/src/main/AndroidManifest.xml @@ -1,2 +1,7 @@ - \ No newline at end of file + + + + + \ No newline at end of file diff --git a/library/ui-styles/src/main/res/layout/dialog_progress_material.xml b/library/ui-styles/src/main/res/layout/dialog_progress_material.xml index 09c88cc50b6..32c4f666c78 100644 --- a/library/ui-styles/src/main/res/layout/dialog_progress_material.xml +++ b/library/ui-styles/src/main/res/layout/dialog_progress_material.xml @@ -2,7 +2,8 @@ + android:layout_height="wrap_content" + tools:ignore="UselessParent"> Date: Thu, 2 Sep 2021 10:42:56 +0200 Subject: [PATCH 08/10] Lint now check all the modules, but is does not check all the variants. Let's keep it like that for now https://developer.android.com/studio/releases/gradle-plugin#running_lint_on_default_variant_only --- .github/workflows/quality.yml | 33 +++----------------------------- matrix-sdk-android/build.gradle | 4 ---- matrix-sdk-android/lint.xml | 34 --------------------------------- vector/build.gradle | 1 + 4 files changed, 4 insertions(+), 68 deletions(-) delete mode 100644 matrix-sdk-android/lint.xml diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index a65e6b5dee7..55f1f31d88d 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -37,38 +37,11 @@ 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/*.* - - apk-lint: - name: Lint APK (${{ matrix.target }}) - runs-on: ubuntu-latest - if: github.ref != 'refs/heads/main' - strategy: - fail-fast: false - matrix: - target: [ Gplay, Fdroid ] - 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: Lint ${{ matrix.target }} release - run: ./gradlew clean lint${{ matrix.target }}Release --stacktrace - - name: Upload ${{ matrix.target }} linting report - uses: actions/upload-artifact@v2 - if: always() - with: - name: release-debug-linting-report-${{ matrix.target }} + name: lint-report path: | vector/build/reports/*.* diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle index 356240f5ecd..cbae6a05b3a 100644 --- a/matrix-sdk-android/build.gradle +++ b/matrix-sdk-android/build.gradle @@ -67,10 +67,6 @@ android { installOptions "-g" } - lintOptions { - lintConfig file("lint.xml") - } - compileOptions { sourceCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11 diff --git a/matrix-sdk-android/lint.xml b/matrix-sdk-android/lint.xml deleted file mode 100644 index 134aba822b4..00000000000 --- a/matrix-sdk-android/lint.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vector/build.gradle b/vector/build.gradle index b153b67b12e..36023c1dcc9 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -284,6 +284,7 @@ android { lintOptions { lintConfig file("lint.xml") + checkDependencies true abortOnError true } From cdd300609403c5c355239b7ca18b003c0b73565b Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 3 Sep 2021 09:42:53 +0200 Subject: [PATCH 09/10] Lint for Gplay and Fdroid release APK More issues can be detected. --- .github/workflows/quality.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 55f1f31d88d..0f119152581 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -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 @@ -45,3 +46,32 @@ jobs: 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 + if: github.ref != 'refs/heads/main' + strategy: + fail-fast: false + matrix: + target: [ Gplay, Fdroid ] + 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: Lint ${{ matrix.target }} release + run: ./gradlew clean lint${{ matrix.target }}Release --stacktrace + - name: Upload ${{ matrix.target }} linting report + uses: actions/upload-artifact@v2 + if: always() + with: + name: release-lint-report-${{ matrix.target }} + path: | + vector/build/reports/*.* From 08538153a5ab8b5d77948476d92cdd09b3305a2c Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 3 Sep 2021 10:29:22 +0200 Subject: [PATCH 10/10] Temporary add build of Android tests, which cannot be run on the CI right now, but they need to at least compile --- .github/workflows/integration.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index be1db5a9a5c..e1d63a15206 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -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