Skip to content

Commit c3b9465

Browse files
authored
Merge pull request #6858 from XiangRongLin/ci_ktlint
Add gradle parameter to skip formatKtLint and use in CI
2 parents 12e46e0 + 52cc3f1 commit c3b9465

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,8 @@ jobs:
4646
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
4747
restore-keys: ${{ runner.os }}-gradle
4848

49-
- name: Check if kotlin files are formatted correctly
50-
run: ./gradlew runKtlint
51-
5249
- name: Build debug APK and run jvm tests
53-
run: ./gradlew assembleDebug lintDebug testDebugUnitTest --stacktrace
50+
run: ./gradlew assembleDebug lintDebug testDebugUnitTest --stacktrace -DskipFormatKtlint
5451

5552
- name: Upload APK
5653
uses: actions/upload-artifact@v2

app/build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,10 @@ task formatKtlint(type: JavaExec) {
165165
}
166166

167167
afterEvaluate {
168-
preDebugBuild.dependsOn formatKtlint, runCheckstyle, runKtlint
168+
if (!System.properties.containsKey('skipFormatKtlint')) {
169+
preDebugBuild.dependsOn formatKtlint
170+
}
171+
preDebugBuild.dependsOn runCheckstyle, runKtlint
169172
}
170173

171174
sonarqube {

0 commit comments

Comments
 (0)