소스 검색

android: lint: Delete generated ktlint folder between builds

There's a bug in ktlint where it will run into an error if you build the project, delete a source file, and then build again. It will be unable to find the file you deleted and can't recover until these files are deleted. This just deletes those files before every run.
Charles Lombardo 2 년 전
부모
커밋
1bc832c9b1
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      src/android/app/build.gradle.kts

+ 5 - 0
src/android/app/build.gradle.kts

@@ -160,6 +160,11 @@ android {
     }
 }
 
+tasks.create<Delete>("ktlintReset") {
+    delete(File(buildDir.path + File.separator + "intermediates/ktLint"))
+}
+
+tasks.getByPath("loadKtlintReporters").dependsOn("ktlintReset")
 tasks.getByPath("preBuild").dependsOn("ktlintCheck")
 
 ktlint {