Skip to content

Commit

Permalink
Enable suppression of generated files for Android plugin 3.2.0-alpha
Browse files Browse the repository at this point in the history
Fix #308
  • Loading branch information
semoro committed May 18, 2018
1 parent 9865da2 commit ab3621a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/src/main/kotlin/DokkaBootstrapImpl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class DokkaBootstrapImpl : DokkaBootstrap {
languageVersion,
apiVersion,
cacheRoot,
suppressedFiles.map { File(it) }
suppressedFiles.map { File(it) }.toSet()
)
)
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class DocumentationOptions(val outputDir: String,
val languageVersion: String?,
val apiVersion: String?,
cacheRoot: String? = null,
val suppressedFiles: List<File> = emptyList()) {
val suppressedFiles: Set<File> = emptySet()) {
init {
if (perPackageOptions.any { it.prefix == "" })
throw IllegalArgumentException("Please do not register packageOptions with all match pattern, use global settings instead")
Expand Down
8 changes: 6 additions & 2 deletions runners/android-gradle-plugin/src/main/kotlin/mainAndroid.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ open class DokkaAndroidTask : DokkaTask() {
@Input var noAndroidSdkLink: Boolean = false

override fun collectSuppressedFiles(sourceRoots: List<SourceRoot>): List<String> {
val generatedSubpath = "${project.buildDir}/generated/source".replace("/", File.separator)
return sourceRoots.filter { generatedSubpath in it.path }.flatMap { File(it.path).walk().toList() }.map { it.absolutePath }
val generatedRoot = project.buildDir.resolve("generated").absoluteFile
return sourceRoots
.map { File(it.path) }
.filter { it.startsWith(generatedRoot) }
.flatMap { it.walk().toList() }
.map { it.absolutePath }
}

init {
Expand Down

0 comments on commit ab3621a

Please sign in to comment.