aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-05-18 12:45:49 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-05-18 12:46:20 +0300
commitab3621abcc468cead0206d3c45f200f6c9ea10b9 (patch)
tree0579a3e75f4f4491d7ad0bbe2b1ca87c2f20e28d
parent9865da2e6e6c038ab6c719a6a03bb09184542d20 (diff)
downloaddokka-ab3621abcc468cead0206d3c45f200f6c9ea10b9.tar.gz
dokka-ab3621abcc468cead0206d3c45f200f6c9ea10b9.tar.bz2
dokka-ab3621abcc468cead0206d3c45f200f6c9ea10b9.zip
Enable suppression of generated files for Android plugin 3.2.0-alpha
Fix #308
-rw-r--r--core/src/main/kotlin/DokkaBootstrapImpl.kt2
-rw-r--r--core/src/main/kotlin/Kotlin/DocumentationBuilder.kt2
-rw-r--r--runners/android-gradle-plugin/src/main/kotlin/mainAndroid.kt8
3 files changed, 8 insertions, 4 deletions
diff --git a/core/src/main/kotlin/DokkaBootstrapImpl.kt b/core/src/main/kotlin/DokkaBootstrapImpl.kt
index 126a0175..aeaca8be 100644
--- a/core/src/main/kotlin/DokkaBootstrapImpl.kt
+++ b/core/src/main/kotlin/DokkaBootstrapImpl.kt
@@ -69,7 +69,7 @@ class DokkaBootstrapImpl : DokkaBootstrap {
languageVersion,
apiVersion,
cacheRoot,
- suppressedFiles.map { File(it) }
+ suppressedFiles.map { File(it) }.toSet()
)
)
}
diff --git a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
index 17e4bc1a..7b50fff5 100644
--- a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
+++ b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
@@ -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")
diff --git a/runners/android-gradle-plugin/src/main/kotlin/mainAndroid.kt b/runners/android-gradle-plugin/src/main/kotlin/mainAndroid.kt
index f2261120..bd2e88c2 100644
--- a/runners/android-gradle-plugin/src/main/kotlin/mainAndroid.kt
+++ b/runners/android-gradle-plugin/src/main/kotlin/mainAndroid.kt
@@ -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 {