@@ -8,19 +8,34 @@ plugins {
8
8
id(" org.jetbrains.dokka" )
9
9
}
10
10
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 " )
12
33
13
- fun pKotlinBig () = project(" kotlin_big" ).ext
14
34
15
35
val outputDir = file(findProperty(" docsBuildDir" ) as String? ? : " $buildDir /doc" )
16
36
val inputDirPrevious = file(findProperty(" docsPreviousVersionsDir" ) as String? ? : " $outputDir /previous" )
17
37
val outputDirPartial = outputDir.resolve(" partial" )
18
- val kotlin_root: String by pKotlinBig()
19
- val kotlin_libs: String by pKotlinBig()
20
38
val 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 " )
24
39
val templatesDir = file(findProperty(" templatesDir" ) as String? ? : " $projectDir /templates" ).invariantSeparatorsPath
25
40
26
41
val cleanDocs by tasks.registering(Delete ::class ) {
@@ -39,7 +54,6 @@ repositories {
39
54
mavenCentral()
40
55
maven(url = " https://maven.pkg.jetbrains.space/kotlin/p/dokka/dev" )
41
56
}
42
- val dokka_version: String by project
43
57
44
58
dependencies {
45
59
dokkaPlugin(project(" :plugins:dokka-samples-transformer-plugin" ))
@@ -371,13 +385,13 @@ fun GradleDokkaSourceSetBuilder.perPackageOption(packageNamePrefix: String, acti
371
385
372
386
fun GradleDokkaSourceSetBuilder.sourceLinksFromRoot () {
373
387
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 " ) )
376
390
remoteLineSuffix.set(" #L" )
377
391
}
378
392
}
379
393
380
- gradle.projectsEvaluated {
394
+ run {
381
395
val versions = listOf (/* "1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7",*/ " 1.8" )
382
396
val latestVersion = versions.last()
383
397
0 commit comments