aboutsummaryrefslogtreecommitdiff
path: root/plugins/versioning/src/main/kotlin
diff options
context:
space:
mode:
authorMarcin Aman <marcin.aman@gmail.com>2021-06-21 11:44:55 +0200
committerGitHub <noreply@github.com>2021-06-21 11:44:55 +0200
commit2832b9a111ba3af0212cbc180e8b1535b8359a15 (patch)
treef463b0e12e520659691d782697d3ba13b8c0bf45 /plugins/versioning/src/main/kotlin
parenta0b77276242ec227f98bf69ed878b9d71c1c5888 (diff)
downloaddokka-2832b9a111ba3af0212cbc180e8b1535b8359a15.tar.gz
dokka-2832b9a111ba3af0212cbc180e8b1535b8359a15.tar.bz2
dokka-2832b9a111ba3af0212cbc180e8b1535b8359a15.zip
Don't use older dir from previous runs in versioning (#1963)
Diffstat (limited to 'plugins/versioning/src/main/kotlin')
-rw-r--r--plugins/versioning/src/main/kotlin/versioning/VersioningHandler.kt21
1 files changed, 12 insertions, 9 deletions
diff --git a/plugins/versioning/src/main/kotlin/versioning/VersioningHandler.kt b/plugins/versioning/src/main/kotlin/versioning/VersioningHandler.kt
index 41700282..da7ebdc1 100644
--- a/plugins/versioning/src/main/kotlin/versioning/VersioningHandler.kt
+++ b/plugins/versioning/src/main/kotlin/versioning/VersioningHandler.kt
@@ -73,19 +73,22 @@ class DefaultVersioningHandler(val context: DokkaContext) : VersioningHandler {
private fun copyVersion(version: VersionId, versionRoot: File, output: File) {
val targetParent = output.resolve(OLDER_VERSIONS_DIR).resolve(version).apply { mkdirs() }
+ val olderDirs = versionRoot.resolve(OLDER_VERSIONS_DIR)
runBlocking(Dispatchers.Default) {
coroutineScope {
- versionRoot.listFiles().orEmpty().forEach { versionRootContent ->
- launch {
- if (versionRootContent.isDirectory) versionRootContent.copyRecursively(
- targetParent.resolve(versionRootContent.name),
- overwrite = true
- )
- else processingStrategies.first {
- it.process(versionRootContent, targetParent.resolve(versionRootContent.name))
+ versionRoot.listFiles().orEmpty()
+ .filter { it.absolutePath != olderDirs.absolutePath }
+ .forEach { versionRootContent ->
+ launch {
+ if (versionRootContent.isDirectory) versionRootContent.copyRecursively(
+ targetParent.resolve(versionRootContent.name),
+ overwrite = true
+ )
+ else processingStrategies.first {
+ it.process(versionRootContent, targetParent.resolve(versionRootContent.name))
+ }
}
}
- }
}
}
}