-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move/copy legacy docs build to a separate directory
(cherry picked from commit 9bceb6c)
- Loading branch information
Showing
13 changed files
with
106 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
kotlin-stdlib-docs-legacy | ||
=================== | ||
|
||
Legacy scripts to build API documentation for kotlin stdlib, kotlin test (and others?) libraries for | ||
kotlinlang.org web-site. | ||
|
||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
98 changes: 98 additions & 0 deletions
98
libraries/tools/kotlin-stdlib-docs-legacy/kotlin_big/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
apply plugin: 'base' | ||
|
||
final boolean isTeamcityBuild = System.getenv("TEAMCITY_VERSION") != null | ||
|
||
// kotlin/libraries/tools/kotlin-stdlib-docs -> kotlin | ||
final String kotlinRootDir = rootProject.file("../../../").absolutePath.replace('\\', '/') | ||
final String kotlinLibsDir = "$buildDir/libs" | ||
|
||
final String githubRevision = isTeamcityBuild ? project.property("githubRevision") : "master" | ||
final String kotlinVersion = isTeamcityBuild ? project.property("deployVersion") : "1.8.255-SNAPSHOT" | ||
final String repo = isTeamcityBuild ? project.property("kotlinLibsRepo") : "$kotlinRootDir/build/repo" | ||
|
||
println("# Extracting info:") | ||
println(" isTeamcityBuild: $isTeamcityBuild") | ||
println(" githubRevision: $githubRevision") | ||
println(" kotlinVersion: $kotlinVersion") | ||
println(" repo: $repo") | ||
|
||
repositories { | ||
maven { url = repo } | ||
mavenCentral() | ||
} | ||
|
||
final List<String> modules = [ | ||
"kotlin-stdlib", | ||
"kotlin-stdlib-common", | ||
"kotlin-stdlib-jdk7", | ||
"kotlin-stdlib-jdk8", | ||
"kotlin-stdlib-js", | ||
"kotlin-test", | ||
"kotlin-test-js", | ||
"kotlin-test-junit5", | ||
"kotlin-test-junit", | ||
"kotlin-test-testng", | ||
"kotlin-test-common", | ||
] | ||
|
||
|
||
task extractLibs() { } | ||
|
||
|
||
modules.forEach { module -> | ||
final String lib = "kotlin_lib_$module" | ||
|
||
final Configuration lib_src = configurations.create(lib) | ||
|
||
if (module == "kotlin-test-js") { | ||
lib_src.attributes {attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, "kotlin-runtime")) } | ||
} | ||
|
||
dependencies { | ||
"$lib"(group: 'org.jetbrains.kotlin', name: module, version: kotlinVersion) | ||
} | ||
|
||
final Task libsTask = tasks.create("extract_lib_$module", Sync) { | ||
dependsOn lib_src | ||
|
||
from { lib_src } | ||
into "$kotlinLibsDir/$module" | ||
} | ||
|
||
extractLibs.dependsOn libsTask | ||
} | ||
|
||
project.extensions.github_revision = githubRevision | ||
project.extensions.kotlin_root = kotlinRootDir | ||
project.extensions.kotlin_libs = kotlinLibsDir | ||
|
||
// TODO: Eliminate this workaround when KT-52977 gets fixed in the Kotlin compiler used in Dokka | ||
final List<File> enumsToComment = [ | ||
"$kotlinRootDir/libraries/stdlib/jdk7/src/kotlin/io/path/PathWalkOption.kt", | ||
"$kotlinRootDir/libraries/stdlib/jdk7/src/kotlin/io/path/CopyActionResult.kt", | ||
"$kotlinRootDir/libraries/stdlib/jdk7/src/kotlin/io/path/OnErrorResult.kt", | ||
].collect { new File(it) } | ||
|
||
project.extensions.commentOutSinceKotlinForNewEnums = { | ||
for (file in enumsToComment) { | ||
final List<String> lines = file.readLines() | ||
for (def i = 0; i < lines.size(); i++) { | ||
if (lines[i].startsWith("@SinceKotlin")) { | ||
lines[i] = "//" + lines[i] | ||
} | ||
} | ||
file.write(String.join("\n", lines)) | ||
} | ||
} | ||
|
||
project.extensions.uncommentSinceKotlinForNewEnums = { | ||
for (file in enumsToComment) { | ||
final List<String> lines = file.readLines() | ||
for (def i = 0; i < lines.size(); i++) { | ||
if (lines[i].startsWith("//@SinceKotlin")) { | ||
lines[i] = lines[i].substring(2) | ||
} | ||
} | ||
file.write(String.join("\n", lines)) | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.