I just upgraded from dokka 0.10.1 to 1.4.30. Is th...
# dokka
s
I just upgraded from dokka 0.10.1 to 1.4.30. Is there a simple way to migrate this code ? I'm trying to follow the migration steps, but have a hard time with this, especially the
outputDirectory
. Thanks in advance!
Copy code
dokka {
    outputFormat = 'html'
    outputDirectory = "$buildDir/doc"
}
Now I just try this, but it doesn't work:
Copy code
tasks.getByName("dokkaHtml") {
    outputDirectory.set(buildDir.resolve("doc"))
}
v
You missed
tasks.getByName<DokkaTask>("dokkaHtml") {..}
Please see https://kotlin.github.io/dokka/1.5.30/user_guide/gradle/usage/
s
Like this?
Copy code
tasks.getByName("dokkaHtml").configure {
    outputDirectory.set(buildDir.resolve("doc"))
}
With the above, I'm getting this: No signature of method: java.io.File.resolve() is applicable for argument types: (String) values: [doc]
It looks like it's working with this:
Copy code
tasks.getByName('dokkaHtml').configure {
    outputDirectory.set(file("$buildDir/doc"))
}
v
I'm sorry. I mean:
Copy code
tasks.getByName<DokkaTask>("dokkaHtml") {
    outputDirectory.set(buildDir.resolve("doc"))
}
It works with Gradle 6.8 and 7.2
e
s
Is this syntax in Kotlin or Groovy?
j
kotlin
s
Thanks, that's what I thought. For better or worse, my build.gradle is all Groovy syntax for now, so this:
Copy code
outputDirectory.set(buildDir.resolve("doc"))
doesn't work and I had to settle for this:
Copy code
outputDirectory.set(file("$buildDir/doc"))