From 52cc3f10c178f17c839e4a58ddd02d882ea460ac Mon Sep 17 00:00:00 2001 From: XiangRongLin <41164160+XiangRongLin@users.noreply.github.com> Date: Fri, 6 Aug 2021 18:11:22 +0200 Subject: [PATCH] Add gradle parameter to skip formatKtLint and use in CI --- .github/workflows/ci.yml | 5 +---- app/build.gradle | 5 ++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 06eb5679d..4da04c052 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,11 +46,8 @@ jobs: key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.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 - run: ./gradlew assembleDebug lintDebug testDebugUnitTest --stacktrace + run: ./gradlew assembleDebug lintDebug testDebugUnitTest --stacktrace -DskipFormatKtlint - name: Upload APK uses: actions/upload-artifact@v2 diff --git a/app/build.gradle b/app/build.gradle index 8c65f3a51..f88167b2e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -165,7 +165,10 @@ task formatKtlint(type: JavaExec) { } afterEvaluate { - preDebugBuild.dependsOn formatKtlint, runCheckstyle, runKtlint + if (!System.properties.containsKey('skipFormatKtlint')) { + preDebugBuild.dependsOn formatKtlint + } + preDebugBuild.dependsOn runCheckstyle, runKtlint } sonarqube {