jbake-gradle-plugin icon indicating copy to clipboard operation
jbake-gradle-plugin copied to clipboard

JBake task doesn't clean stale outputs

Open lacasseio opened this issue 4 years ago • 1 comments

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.

lacasseio avatar Jun 26 '20 00:06 lacasseio

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.

lacasseio avatar Jun 26 '20 00:06 lacasseio