Jeff Tycz
12/18/2020, 1:57 AM.kts gradle file and I dont know how to convert them properly
here are my two tasks
task androidJavadocs(type: Javadoc) {
failOnError = false
source = android.sourceSets.main.java.srcDirs
ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar"
classpath += files(ext.androidJar)
exclude '**/R.html', '**/R.*.html', '**/index.html'
}
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
classifier = 'javadoc'
from androidJavadocs.destinationDir
}
Can anyone help me out with this?Vampire
12/18/2020, 2:08 AMJeff Tycz
12/18/2020, 2:10 AMtype in the tasks for the most partJeff Tycz
12/18/2020, 2:14 AMval androidJavadocs by registering(Javadoc::class){
failOnError = false
source = android.sourceSets.main.java.srcDirs
ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar"
classpath += files(ext.androidJar)
exclude("**/R.html", "**/R.*.html", "**/index.html")
}
but there are many errors such as it does not know android.sourceSets.main.java.srcDirs or ext.androidJarVampire
12/18/2020, 2:23 AMisFailOnError in Kotlin, so isFailOnError = false.
The syntax for using ext is also different in Kotlin DSL, but my first question is, why you actually set that as extra property.
Using ext is almost always a dirty hack that can be solved better, either by a proper typed extension or a local variable.