diff --git a/auth-lib/build.gradle.kts b/auth-lib/build.gradle.kts index 40f314b..c9b819e 100644 --- a/auth-lib/build.gradle.kts +++ b/auth-lib/build.gradle.kts @@ -200,34 +200,34 @@ afterEvaluate { tasks.register(dokkaTaskName, DokkaTask::class.java) { description = "Generates Dokka documentation for ${variant.name}." - // Configure source sets - dokkaSourceSets { - configureEach { - // Include both Kotlin and Java sources - val sourceDirs = variant.sourceSets.flatMap { - it.javaDirectories - } - sourceDirs.forEach { sourceDir -> - if (sourceDir.exists()) { - this@configureEach.sourceRoots.from(sourceDir) - } + // Dokka 1.x NPEs on androidTest source sets with AGP 8.7+. + // Clear auto-discovered sets and register only this variant. + @Suppress("DEPRECATION") + dokkaSourceSets.clear() + dokkaSourceSets.register(variant.name) { + // Include both Kotlin and Java sources + variant.sourceSets.flatMap { + it.javaDirectories + it.kotlinDirectories + }.forEach { sourceDir -> + if (sourceDir.exists()) { + sourceRoots.from(sourceDir) } + } - // Configure classpath - classpath.from(variant.javaCompileProvider.get().classpath) - classpath.from(project.files(android.bootClasspath.joinToString(File.pathSeparator))) + // Configure classpath + classpath.from(variant.javaCompileProvider.get().classpath) + classpath.from(project.files(android.bootClasspath.joinToString(File.pathSeparator))) - // External documentation links - externalDocumentationLink { - url.set(uri("https://docs.oracle.com/javase/8/docs/api/").toURL()) - } - externalDocumentationLink { - url.set(uri("https://developer.android.com/reference/").toURL()) - } - - // Suppress warnings for undocumented code (optional) - suppressInheritedMembers.set(false) + // External documentation links + externalDocumentationLink { + url.set(uri("https://docs.oracle.com/javase/8/docs/api/").toURL()) + } + externalDocumentationLink { + url.set(uri("https://developer.android.com/reference/").toURL()) } + + // Suppress warnings for undocumented code (optional) + suppressInheritedMembers.set(false) } // Output directory diff --git a/build.gradle.kts b/build.gradle.kts index 435a28c..f615907 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -29,7 +29,7 @@ buildscript { dependencies { classpath("com.android.tools.build:gradle:8.7.3") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") - classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.9.10") + classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.9.20") } }