Add gradle parameter to skip formatKtLint and use in CI

This commit is contained in:
XiangRongLin 2021-08-06 18:11:22 +02:00
parent 12e46e0a36
commit 52cc3f10c1
2 changed files with 5 additions and 5 deletions

View File

@ -46,11 +46,8 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle restore-keys: ${{ runner.os }}-gradle
- name: Check if kotlin files are formatted correctly
run: ./gradlew runKtlint
- name: Build debug APK and run jvm tests - name: Build debug APK and run jvm tests
run: ./gradlew assembleDebug lintDebug testDebugUnitTest --stacktrace run: ./gradlew assembleDebug lintDebug testDebugUnitTest --stacktrace -DskipFormatKtlint
- name: Upload APK - name: Upload APK
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2

View File

@ -165,7 +165,10 @@ task formatKtlint(type: JavaExec) {
} }
afterEvaluate { afterEvaluate {
preDebugBuild.dependsOn formatKtlint, runCheckstyle, runKtlint if (!System.properties.containsKey('skipFormatKtlint')) {
preDebugBuild.dependsOn formatKtlint
}
preDebugBuild.dependsOn runCheckstyle, runKtlint
} }
sonarqube { sonarqube {