From e3cfed8cedbe65f4bffeedbde4aa1e6b1c7c7ffc Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Wed, 1 Feb 2023 19:35:03 +0100 Subject: [PATCH] Allow to specify target and templates directory with Gradle properties --- libraries/tools/kotlin-stdlib-docs/build.gradle.kts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/tools/kotlin-stdlib-docs/build.gradle.kts b/libraries/tools/kotlin-stdlib-docs/build.gradle.kts index e8e2c15ff88..ec1c1c11d45 100644 --- a/libraries/tools/kotlin-stdlib-docs/build.gradle.kts +++ b/libraries/tools/kotlin-stdlib-docs/build.gradle.kts @@ -12,7 +12,7 @@ evaluationDependsOnChildren() fun pKotlinBig() = project("kotlin_big").ext -val outputDir = file("$buildDir/doc") +val outputDir = file(findProperty("docsBuildDir") as String? ?: "$buildDir/doc") val outputDirLatest = file("$outputDir/latest") val outputDirPrevious = file("$outputDir/previous") val kotlin_root: String by pKotlinBig() @@ -21,12 +21,16 @@ val kotlin_native_root = file("$kotlin_root/kotlin-native").absolutePath val github_revision: String by pKotlinBig() val localRoot = kotlin_root val baseUrl = URL("https://github.com/JetBrains/kotlin/tree/$github_revision") -val templatesDir = file("$projectDir/templates").invariantSeparatorsPath +val templatesDir = file(findProperty("templatesDir") as String? ?: "$projectDir/templates").invariantSeparatorsPath val cleanDocs by tasks.registering(Delete::class) { delete(outputDir) } +tasks.clean { + dependsOn(cleanDocs) +} + val prepare by tasks.registering { dependsOn(":kotlin_big:extractLibs") }