I’m trying to make a custom task, written in Kotlin, that generates a file through a commandline command. The problem is that this the external commandline program can’t handle if the generated file already exists.
So, what I am trying to do inside my @TaskAction
is to delete the contents of the output directory before running the command.
I tried to do the following, but I get Gradle import errors and Project resolve errors.
project.delete(
fileTree("${project.buildDir}/jpackageAppImage")
)
When I look in the docs for delete, it says that the input to that function can be
Any type of object accepted by
files(Object...)
When I look at the docs for files, it says it accepts a a FileTree
Can anyone help me out with this?