asciidoctor-gradle-plugin
asciidoctor-gradle-plugin copied to clipboard
What is the equivalent of the `ruby.gems()` repository extensions with the kotlin DSL ?
Nowaday I tend to favor Kotlin DSL as it is type safe, and IntelliJ offers better suggestions.
However when I initiated a new project with asciidoctor revealjs. I had to go back to use the groovy DSL because ruby.gems()
raises an unresolvable reference
error on the ruby
identifier.
plugins {
id("org.asciidoctor.jvm.revealjs") version "3.3.2"
}
repositories {
mavenCentral()
ruby.gems()
}
I suppose the syntax is different, I have tried various combination but I cannot get it right. If you have any clue that would be appreciated. Many thanks in advance.
This is the answer I found somewhere else:
val repositoriesInternal = repositories as ExtensionAware
repositoriesInternal.extensions.configure(com.github.jrubygradle.api.core.RepositoryHandlerExtension::class) {
gems()
}
However this should be documented imo.
Hi all, I just read the Gradle 7.4 RC1 release note, and this problem might be fixed:
Starting with this version of Gradle, Kotlin DSL generates type-safe model accessors for custom extensions added to the
repositories {}
block. Custom extensions now have full content assist in the IDE.
So it's now possible to use
repositories {
ruby {
gems()
}
}
Do we just need to document how to do this in < Gradle 7.4?