Q:

How can I include Gradle Plugins in a Script plugin in Kotlin DSL?

I split my build in 2 files.
build.gradle.kts documentation.gradle.kts and I d'like to 
include the documentation.gradle.kts in my main buildscript.
So I could share it with other projects. But I am getting an error about asciidoctorj not found.
What am I missing?

build.gradle.kts
apply(from = "./gradle-plugins/documentation.gradle.kts")

documentation.gradle.kts
import com.github.jrubygradle.JRubyPlugin
import org.asciidoctor.gradle.AsciidoctorPlugin
import org.asciidoctor.gradle.AsciidoctorTask

buildscript {
    repositories {
         maven { url = uri("https://nexus/repository/public") }
         maven { url = uri("https://nexus/repository/public-plugins") }
    }
    dependencies {
        classpath("com.github.jruby-gradle:jruby-gradle-plugin:1.4.0")
        classpath("org.asciidoctor:asciidoctor-gradle-plugin:1.5.9.2")
    }
}

apply<JRubyPlugin>()
apply<AsciidoctorPlugin>()

asciidoctorj {
    version = "1.5.4"
}

Error
Script compilation error:

  Line 19: asciidoctorj {
           ^ Unresolved reference: asciidoctorj

1 error

A:

Since you're not using the plugins block, you'll have to do
configure<AsciidoctorExtension> {

}

instead of
asciidoctor {

}

