Closed miurahr closed 11 months ago
To workaround the error, I crafted a task
// clean work folder for jpackage
def jpackageWorkdir = layout.buildDirectory.file('jpackage')
tasks.register('cleanJpkgWorkdir', Delete) {
delete jpackageWorkdir
}
tasks.jpackage {
dependsOn cleanJpkgWorkdir
}
Because jpackage does not support a build cache, which means always not-up-to-date, so the clean and build task are invoked.
Either that or simply use clean with jpackage. It does not hurt to have a clean build before making a distribution.
Gradle tasks should be safe for multiple target executions. The task
jpackage
is always executed and went to failure.It is because task
jpackage
is not up-to-date because the task has not declared any outputs despite executing actions. OpenJDKjpackage
command assumes that target directory is not exist when executed. When multiple execution ofgradle jpackage
cause error because target folder already exists.The task should report output files to gradle core then gradle can detect up-to-date status. It can be said for other tasks that are registered from
JPackageTask
type.You can find a log like as follows;