@@ -8,19 +8,34 @@ plugins {
88 id(" org.jetbrains.dokka" )
99}
1010
11- evaluationDependsOnChildren()
11+ val isTeamcityBuild = project.hasProperty(" teamcity.version" )
12+
13+ // kotlin/libraries/tools/kotlin-stdlib-docs -> kotlin
14+ val kotlin_root = rootProject.file(" ../../../" ).absoluteFile.invariantSeparatorsPath
15+ val kotlin_libs by extra(" $buildDir /libs" )
16+
17+ val rootProperties = java.util.Properties ().apply {
18+ file(kotlin_root).resolve(" gradle.properties" ).inputStream().use { stream -> load(stream) }
19+ }
20+ val defaultSnapshotVersion: String by rootProperties
21+
22+ val githubRevision = if (isTeamcityBuild) project.property(" githubRevision" ) else " master"
23+ val artifactsVersion by extra(if (isTeamcityBuild) project.property(" deployVersion" ) as String else defaultSnapshotVersion)
24+ val artifactsRepo by extra(if (isTeamcityBuild) project.property(" kotlinLibsRepo" ) as String else " $kotlin_root /build/repo" )
25+ val dokka_version: String by project
26+
27+ println (" # Parameters summary:" )
28+ println (" isTeamcityBuild: $isTeamcityBuild " )
29+ println (" dokka version: $dokka_version " )
30+ println (" githubRevision: $githubRevision " )
31+ println (" artifacts version: $artifactsVersion " )
32+ println (" artifacts repo: $artifactsRepo " )
1233
13- fun pKotlinBig () = project(" kotlin_big" ).ext
1434
1535val outputDir = file(findProperty(" docsBuildDir" ) as String? ? : " $buildDir /doc" )
1636val inputDirPrevious = file(findProperty(" docsPreviousVersionsDir" ) as String? ? : " $outputDir /previous" )
1737val outputDirPartial = outputDir.resolve(" partial" )
18- val kotlin_root: String by pKotlinBig()
19- val kotlin_libs: String by pKotlinBig()
2038val kotlin_native_root = file(" $kotlin_root /kotlin-native" ).absolutePath
21- val github_revision: String by pKotlinBig()
22- val localRoot = kotlin_root
23- val baseUrl = URL (" https://github.com/JetBrains/kotlin/tree/$github_revision " )
2439val templatesDir = file(findProperty(" templatesDir" ) as String? ? : " $projectDir /templates" ).invariantSeparatorsPath
2540
2641val cleanDocs by tasks.registering(Delete ::class ) {
@@ -39,7 +54,6 @@ repositories {
3954 mavenCentral()
4055 maven(url = " https://maven.pkg.jetbrains.space/kotlin/p/dokka/dev" )
4156}
42- val dokka_version: String by project
4357
4458dependencies {
4559 dokkaPlugin(project(" :plugins:dokka-samples-transformer-plugin" ))
@@ -371,13 +385,13 @@ fun GradleDokkaSourceSetBuilder.perPackageOption(packageNamePrefix: String, acti
371385
372386fun GradleDokkaSourceSetBuilder.sourceLinksFromRoot () {
373387 sourceLink {
374- localDirectory.set(file(localRoot ))
375- remoteUrl.set(baseUrl )
388+ localDirectory.set(file(kotlin_root ))
389+ remoteUrl.set(URL ( " https://github.com/JetBrains/kotlin/tree/ $githubRevision " ) )
376390 remoteLineSuffix.set(" #L" )
377391 }
378392}
379393
380- gradle.projectsEvaluated {
394+ run {
381395 val versions = listOf (/* "1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7",*/ " 1.8" )
382396 val latestVersion = versions.last()
383397
0 commit comments