jbake-gradle-plugin
jbake-gradle-plugin copied to clipboard
JBake task doesn't clean stale outputs
If input files are removed, the matching output files aren't removed. It's possible to work around the issue but I believe the bake task should take care of the cleaning to enhance the experience for all users. Using incremental change API, it should be easy to match removed files and delete them from the output folder.
The API is marked as introduced in Gradle 5.4.
For context, the workaround is:
// Delete baked output before baking
allprojects {
pluginManager.withPlugin('org.jbake.site') {
tasks.named('bake', JBakeTask) {
doFirst {
output.deleteDir()
output.mkdirs()
}
}
}
}
Using the InputChanges
API would be much better.