anyone know how to convert this? I think I've part...
# kotlin-dsl
c
anyone know how to convert this? I think I've partially managed... I'm really not sure about the addStringOption though grar (the snippet is the groovy, the gray is my "progress"
Copy code
import org.gradle.accessors.dm.LibrariesForLibs

val asciidoclet by configurations.creating {}

val libs = the<LibrariesForLibs>()

dependencies {
  asciidoclet(libs.plugin.asciidoc.javadoc)
}

tasks.withType<Javadoc> {
  options {
    docletpath(*asciidoclet.files.toTypedArray())
    doclet = "org.asciidoctor.Asciidoclet"
    jFlags("-baseDir", project.layout.projectDirectory.asFile.name)
  }
}
v
iirc, you only have
MinimalJavadocOptions
and to use
addStringOption
you need to cast to
CoreJavadocOptions
or
StandardJavadocDocletOptions
.
c
Yeah it doesn't work anymore anyways... Apparently doesn't work on modern versions of Java 😢 I was going to delete this but I had to run out to see dune 2 I'm at the theater now
v
Have fun
c
Thanks, it was a good movie. Pretty close to 3 hours... I mean I'm never quite sure what time the movie actually starts but I know that start time was 3 and The credits rolled at 5:55... I'm just not sure how long the trailers were.
well kind of looks like I'm back to this... from another angle. Is casting really the only option in kotlin? the javadoc for javadoc is awful
is this the best (cleanest/most idiomatic) I can do?
Copy code
tasks.withType<Javadoc>().configureEach {
  val o = options as StandardJavadocDocletOptions
  o.encoding = "UTF-8"
  o.addStringOption("-tag", "apiNote:a:\"API Note:\"")
  o.addStringOption("-tag", "implNote:a:\"Implementation Note:\"")
}
v
Probably depends on what syntax you like most, there are quite some options
For example
Copy code
tasks.withType<Javadoc>().configureEach {
    (options as StandardJavadocDocletOptions).apply {
        encoding = "UTF-8"
        addStringOption("-tag", "apiNote:a:\"API Note:\"")
        addStringOption("-tag", "implNote:a:\"Implementation Note:\"")
    }
}
And yes, afair there is no way wihtout casting or using groovybuilder
c
🤦‍♂️ I need a temple rubbing emoji
thanks
👌 1