From 1bc832c9b154d6732eaba2b67d6119baec5f8a83 Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Mon, 21 Aug 2023 17:31:13 -0400 Subject: 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. --- src/android/app/build.gradle.kts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/android/app/build.gradle.kts b/src/android/app/build.gradle.kts index 9a47e2bd8..a8db70511 100644 --- a/src/android/app/build.gradle.kts +++ b/src/android/app/build.gradle.kts @@ -160,6 +160,11 @@ android { } } +tasks.create("ktlintReset") { + delete(File(buildDir.path + File.separator + "intermediates/ktLint")) +} + +tasks.getByPath("loadKtlintReporters").dependsOn("ktlintReset") tasks.getByPath("preBuild").dependsOn("ktlintCheck") ktlint { -- cgit v1.2.3