ARTICLE AD BOX
android.sdkDirectory and android.bootClasspath don't exist in Kotlin DSL.
For android.sdkDirectory I can use $ANDROID_HOME:
val javadoc by tasks.registering(Javadoc::class) { val sdkDirectory = System.getenv("ANDROID_HOME") classpath = files(File("${sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar")) ... }But for android.bootClasspath I haven't found a suitable replacement.
android.bootClasspath.forEach { classpath += fileTree(it) }According to the documentation, there are two providers:
How to use Provider<?> getSdkDirectory() to get the sdkDirectory?
How to use Provider<?> getBootClasspath() to get the bootClasspath?
It reads:
The returned Provider can only be used at execution time and
therefore must be used as a org.gradle.api.Task input to do so.
That's android.sdkComponents.sdkDirectory and android.sdkComponents.bootClasspath.
val bootClasspath: Provider<List<RegularFile>> = android.sdkComponents.bootClasspath val sdkDirectory: Provider<Directory> = android.sdkComponents.sdkDirectoryThe current error message, when trying to access the provider directly:
Unable to determine constructor argument #6: missing parameter of type Provider, or no service of type Provider<Provider<List<RegularFile>>>.
