diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index be1db5a9a5..e1d63a1520 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 diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index a65e6b5dee..0f11915258 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 @@ -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/*.* diff --git a/attachment-viewer/build.gradle b/attachment-viewer/build.gradle index c393c5f483..d62062ae14 100644 --- a/attachment-viewer/build.gradle +++ b/attachment-viewer/build.gradle @@ -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 { diff --git a/attachment-viewer/src/main/res/layout/item_animated_image_attachment.xml b/attachment-viewer/src/main/res/layout/item_animated_image_attachment.xml index 1096267124..cfeb5e9cc6 100644 --- a/attachment-viewer/src/main/res/layout/item_animated_image_attachment.xml +++ b/attachment-viewer/src/main/res/layout/item_animated_image_attachment.xml @@ -1,21 +1,22 @@ + android:layout_height="match_parent"> + android:layout_height="match_parent" + android:importantForAccessibility="no" + android:visibility="visible" /> diff --git a/attachment-viewer/src/main/res/layout/item_video_attachment.xml b/attachment-viewer/src/main/res/layout/item_video_attachment.xml index 7dd13ea460..cd55be5cb4 100644 --- a/attachment-viewer/src/main/res/layout/item_video_attachment.xml +++ b/attachment-viewer/src/main/res/layout/item_video_attachment.xml @@ -9,6 +9,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center" + android:importantForAccessibility="no" android:scaleType="centerInside" /> diff --git a/attachment-viewer/src/main/res/values/strings.xml b/attachment-viewer/src/main/res/values/strings.xml new file mode 100644 index 0000000000..3b32209868 --- /dev/null +++ b/attachment-viewer/src/main/res/values/strings.xml @@ -0,0 +1,5 @@ + + + + Play or pause the video + \ No newline at end of file diff --git a/build.gradle b/build.gradle index dc75b34846..ef26530298 100644 --- a/build.gradle +++ b/build.gradle @@ -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' diff --git a/changelog.d/3954.feature b/changelog.d/3954.feature new file mode 100644 index 0000000000..132277032c --- /dev/null +++ b/changelog.d/3954.feature @@ -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. \ No newline at end of file diff --git a/diff-match-patch/build.gradle b/diff-match-patch/build.gradle index 82292e24db..f623c57a49 100644 --- a/diff-match-patch/build.gradle +++ b/diff-match-patch/build.gradle @@ -3,6 +3,3 @@ apply plugin: 'java-library' dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) } - -sourceCompatibility = "8" -targetCompatibility = "8" diff --git a/library/ui-styles/build.gradle b/library/ui-styles/build.gradle index e264ef8319..365e4b902c 100644 --- a/library/ui-styles/build.gradle +++ b/library/ui-styles/build.gradle @@ -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 } diff --git a/library/ui-styles/src/main/AndroidManifest.xml b/library/ui-styles/src/main/AndroidManifest.xml index 19aa89e2e7..254827465d 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 09c88cc50b..32c4f666c7 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"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/matrix-sdk-android/src/androidTest/AndroidManifest.xml b/matrix-sdk-android/src/androidTest/AndroidManifest.xml new file mode 100644 index 0000000000..274bd8c87b --- /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 220a168f60..de0731422c 100644 --- a/matrix-sdk-android/src/main/AndroidManifest.xml +++ b/matrix-sdk-android/src/main/AndroidManifest.xml @@ -10,15 +10,6 @@ - - -