The Transform.toSet() methods return a HashSet instance that has non-deterministic ordering.
These methods are used to construct a number of task inputs and outputs, including:
It is important that task inputs and outputs are consistent to ensure Gradle can correctly determine if a task is up-to-date.
These are not just theoretical issues, as reported by #591.
When docExtensions are added as Closures to asciidoctorj, the AbstractAsciiDoctorTask adds a number of Gradle/Groovy dependencies to the Classpath used to invoke Asciidoctor. Since AbstractAsciidoctorTask.configurations is registered as a task input, this inconsistent classpath ordering leads to cache misses and tasks not being considered UP-TO-DATE, resulting in unneccessary re-execution.
This change simply changes Transform.toSet() methods to return a LinkedHashSet, ensuring consistent iteration order for the returned Sets.
The
Transform.toSet()
methods return a HashSet instance that has non-deterministic ordering. These methods are used to construct a number of task inputs and outputs, including:AbstractAsciidoctorBaseTask.getBackendOutputDirectories
AsciidoctorEpubTask.ebookFormats
AbstractAsciidoctorTask.configurations
It is important that task inputs and outputs are consistent to ensure Gradle can correctly determine if a task is up-to-date.
These are not just theoretical issues, as reported by #591. When
docExtensions
are added as Closures toasciidoctorj
, theAbstractAsciiDoctorTask
adds a number of Gradle/Groovy dependencies to the Classpath used to invoke Asciidoctor. SinceAbstractAsciidoctorTask.configurations
is registered as a task input, this inconsistent classpath ordering leads to cache misses and tasks not being consideredUP-TO-DATE
, resulting in unneccessary re-execution.This change simply changes
Transform.toSet()
methods to return aLinkedHashSet
, ensuring consistent iteration order for the returned Sets.Fixes #591