From 69472cd50a7805d989f28a254cee47c52e83f493 Mon Sep 17 00:00:00 2001 From: Niels van Velzen Date: Wed, 5 May 2021 17:41:18 +0200 Subject: [PATCH] Update Kotlin and Gradle plugin to latest version and add Android linter to linting workflow --- .github/workflows/app-lint.yaml | 4 ++-- app/build.gradle.kts | 11 +++-------- build.gradle.kts | 2 +- gradle.properties | 2 +- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/app-lint.yaml b/.github/workflows/app-lint.yaml index c10fa1a45..0afb727c6 100644 --- a/.github/workflows/app-lint.yaml +++ b/.github/workflows/app-lint.yaml @@ -27,8 +27,8 @@ jobs: key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} restore-keys: | ${{ runner.os }}-gradle- - - name: Run detekt task - run: ./gradlew --build-cache --no-daemon --info detekt + - name: Run detekt and lint task + run: ./gradlew --build-cache --no-daemon --info detekt lint - name: Upload SARIF files uses: github/codeql-action/upload-sarif@v1 if: ${{ always() }} diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 869190f2f..12e44a44a 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -21,14 +21,9 @@ android { viewBinding = true } - compileOptions { - // Use Java 1.8 features - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = compileOptions.targetCompatibility.toString() + lintOptions { + isAbortOnError = false + sarifReport = true } buildTypes { diff --git a/build.gradle.kts b/build.gradle.kts index f815adb09..e16990762 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,7 +6,7 @@ buildscript { dependencies { val kotlinVersion: String by project - classpath("com.android.tools.build:gradle:4.1.3") + classpath("com.android.tools.build:gradle:4.2.0") classpath(kotlin("gradle-plugin", kotlinVersion)) classpath(kotlin("serialization", kotlinVersion)) } diff --git a/gradle.properties b/gradle.properties index 329675cdd..35f059e85 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m # Kotlin version -kotlinVersion=1.4.31 +kotlinVersion=1.5.0 # Kotlin compiler kotlin.incremental=true