I’ve started to play with Gradle 2.12 nightly to take advantage of improvements in the software model, but I’m hitting the following error for an @ComponentBinaries rule:
* What went wrong:
A problem occurred configuring root project 'junit8188350447950370203'.
> Exception thrown while executing model rule: AsciidoctorPlugin.Rules#generateBinaries
> Cannot create 'components.docs.binaries.html' using creation rule 'AsciidoctorPlugin.Rules#generateBinaries > create(html)' as the rule 'AsciidoctorPlugin.Rules#generateBinaries > create(html)' has already been used to create this model element.
Are you defining multiple components? If so then the result is you’ll try to creating multiple binaries called “pdf” and “html”. You should give these unique names, typically via some convention that includes the originating component name. Essentially, yes, this rule is being run multiple times, once for each AsciidocDocumentSpec.
@mark_vieira You say that the binaries should be given unique names, but there is no indication of this in section 73.5.1 of the user guide. The example hard codes the binary name “exploded”. Should that example recommend unique names for binaries?
That does indeed make it seem like that rules is being evaluated twice.
That’s my understanding, unless @ComponentBinaries does some trickery here. In reality, you can’t have multiple model elements with the same path, so there cannot be two binaries.exploded.
@CedricChampeau are my assumptions correct. Is Peter running into a bug here?
Yup, 2.12 hasn’t fixed it. This may be an issue with the TestKit, but whatever the source of the problem, it’s a blocker for me continuing with the new software model experiment.