You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I report my first issue, so thank you for your comprehension. Problem : I think it is the way that asciidoctor implemented their code that makes the users write the gradle configuration unnaturally. FYI, Gradle is now using kotlin as default instead of groovy. see below for detail code.
Error message when gradle clean build or gradle jar :
Could not determine the dependencies of task ':asciidoctor'.
> Configuration with name '<path>/spring-restdocs-asciidoctor-3.0.0.jar' not found.
Related code for build.gradle.kts
val asciidoctorExt by configurations.creating
dependencies {
asciidoctorExt("org.springframework.restdocs:spring-restdocs-asciidoctor")
}
tasks.asciidoctor {
configurations(listOf(asciidoctorExt))
// this line should in fact be written as such : configurations(asciidoctorExt) which doesn't build
}
see here, the message from Vampire from the gradle community for the reason of this syntax issue:
that's imho a shortcoming of the Asciidoctor plugin that you should report.
There is configurations(Object... configs) and configurations(Iterable configs) and it can handle either Configuration objects or anything else by converting it to a String and using that as configuration name.
Configuration is iterable, so the second variant is chosen. The configuration is iterated and so the File instances are used.
On those then toString() is called which gives the paths of the files in the configuration and that is then used as configuration name which gives the error you mentioned.
Before you gave a String which is not Iterable, so the first variant was used and interpreted as configuration name correctly.
So you either need to use configurations(asciidoctorExt as Any) or configurations(listOf(asciidoctorExt)) or configurations(asciidoctorExt.name). source
FYI link to a whole kotlin build file (following the best practices -as I can any way thanks to vampire help) can be found on my [github] (vifeng/TicketToTheMoon@3564599)
The text was updated successfully, but these errors were encountered:
Hi,
I report my first issue, so thank you for your comprehension.
Problem : I think it is the way that asciidoctor implemented their code that makes the users write the gradle configuration unnaturally. FYI, Gradle is now using kotlin as default instead of groovy. see below for detail code.
Error message when gradle clean build or gradle jar :
Related code for build.gradle.kts
see here, the message from Vampire from the gradle community for the reason of this syntax issue:
that's imho a shortcoming of the Asciidoctor plugin that you should report.
There is configurations(Object... configs) and configurations(Iterable configs) and it can handle either Configuration objects or anything else by converting it to a String and using that as configuration name.
Configuration is iterable, so the second variant is chosen. The configuration is iterated and so the File instances are used.
On those then toString() is called which gives the paths of the files in the configuration and that is then used as configuration name which gives the error you mentioned.
Before you gave a String which is not Iterable, so the first variant was used and interpreted as configuration name correctly.
So you either need to use configurations(asciidoctorExt as Any) or configurations(listOf(asciidoctorExt)) or configurations(asciidoctorExt.name).
source
FYI link to a whole kotlin build file (following the best practices -as I can any way thanks to vampire help) can be found on my [github] (vifeng/TicketToTheMoon@3564599)
The text was updated successfully, but these errors were encountered: