-
Notifications
You must be signed in to change notification settings - Fork 67
Description
AtomicFUTransformerBase
doesn't delete the destination directory before copying files. If any of the source files are deleted, the destination will still contain the deleted files.
Solution
AtomicFUTransformerBase
should delete destinationDirectory
before the task executes.
Steps to reproduce
I have a Kotlin Gradle project that uses Atomicfu plugin.
The project has a single test in src/main/kotlin
.
When I run ./gradlew check
I see a single passing test.
I delete the test in src/main/kotlin
.
When I re-run check
I still see a single passing test. This is unexpected. The test should not run, because it was deleted.
I run ./gradlew clean
, then ./gradlew check
. I now see no tests, as expected.
Workaround
As a workaround the AtomicFU tasks can be modified to clear the destination directory before each execution:
tasks.withType<kotlinx.atomicfu.plugin.gradle.AtomicFUTransformTask>().configureEach {
doFirst("clear stale files") {
destinationDirectory.get().asFile.deleteRecursively()
}
}
Metadata
Metadata
Assignees
Labels
Type
Projects
Status