I made this task:
ext.unarchiveDir = "run/assets/Textures/MonkeySheet"
ext.archiveDir = "assets/Textures/MonkeySheet"
task convertToDDS(type : Copy) {
from unarchiveDir
into archiveDir
include('**/*.TGA', '**/*.tga')
eachFile { FileCopyDetails fcd ->
println "convert to dds ${fcd}"
def cmd = ["C:/Program Files/NVIDIA Corporation/NVIDIA Texture Tools 2/bin/nvcompress.exe"]
cmd += "-alpha"
cmd += "-nomips"
cmd += "-bc3"
cmd += fcd.file.absolutePath
fcd.name = fcd.name.substring(0, fcd.name.lastIndexOf(".")) + ".dds"
fcd.name = fcd.name.toLowerCase()
exec {
commandLine cmd
}
fcd.exclude()
}
}
When I run it, sometimes it works as intended, and sometimes I get BUILD SUCCESSFUL without anything done. with -debug I see:
15:16:09.586 [DEBUG] [org.gradle.api.internal.changedetection.state.CacheBackedT
askHistoryRepository] Snapshotting property rootSpec$1 (RELATIVE) for task ':con
vertToDDS'
15:16:09.586 [DEBUG] [org.gradle.api.internal.changedetection.state.CacheBackedT
askHistoryRepository] Snapshotting property destinationDir (OUTPUT) for task ':c
onvertToDDS'
15:16:09.587 [DEBUG] [org.gradle.api.internal.changedetection.state.CacheBackedT
askHistoryRepository] No discovered inputs for task ':convertToDDS'
15:16:09.587 [INFO] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExe
cuter] Skipping task ':convertToDDS' as it is up-to-date (took 0.001 secs).