Add sourcelink to generated documentation

This commit is contained in:
Abduqodiri Qurbonzoda
2021-06-22 08:02:26 +03:00
committed by Space
parent 6a9b9dc0a5
commit d8d9a2689d
3 changed files with 31 additions and 10 deletions
@@ -4,11 +4,12 @@
<property name="build" location="${base}/build"/>
<!-- Generates the standard library documentation using Dokka. -->
<property name="github.revision" value="master"/>
<property name="docs.output" location="${build}/doc"/>
<property name="dokka.format" value="kotlin-website-html"/>
<property name="github_revision" value="IT_IS_SET_FROM_GRADLE0"/>
<property name="kotlin_root" location="IT_IS_SET_FROM_GRADLE1"/>
<property name="kotlin_libs" location="IS_IS_SET_FROM_GRADLE2"/>
@@ -111,6 +112,8 @@
<sourceroot path="${kotlin_stdlib_dir}/src"/>
<sourceroot path="${kotlin_stdlib_dir}/unsigned/src"/>
<sourcelink path="${kotlin_root}" url="https://github.com/JetBrains/kotlin/tree/${github_revision}" linesuffix="#L"/>
<target value="Common"/>
<target value="JVM"/>
<target value="JRE6"/>
@@ -143,6 +146,8 @@
<packageoptions prefix="kotlin.coroutines.jvm.internal" suppress="true"/>
<packageoptions prefix="kotlin.coroutines.experimental.migration" suppress="true"/>
<sourcelink path="${kotlin_root}" url="https://github.com/JetBrains/kotlin/tree/${github_revision}" linesuffix="#L"/>
<target value="JVM"/>
<target value="JRE6"/>
</passconfig>
@@ -165,6 +170,7 @@
<packageoptions prefix="kotlin.coroutines.jvm.internal" suppress="true"/>
<packageoptions prefix="kotlin.coroutines.experimental.migration" suppress="true"/>
<sourcelink path="${kotlin_root}" url="https://github.com/JetBrains/kotlin/tree/${github_revision}" linesuffix="#L"/>
<target value="JVM"/>
<target value="JRE7"/>
@@ -189,6 +195,8 @@
<packageoptions prefix="kotlin.coroutines.jvm.internal" suppress="true"/>
<packageoptions prefix="kotlin.coroutines.experimental.migration" suppress="true"/>
<sourcelink path="${kotlin_root}" url="https://github.com/JetBrains/kotlin/tree/${github_revision}" linesuffix="#L"/>
<target value="JVM"/>
<target value="JRE8"/>
</passconfig>
@@ -229,8 +237,6 @@
<sourceroot path="${kotlin_builtins_dir}/src/kotlin/internal/progressionUtil.kt"/>
<sourceroot path="${kotlin_builtins_dir}/src/kotlin/Unit.kt"/>
<!--<sourcelink path=".." url="http://github.com/JetBrains/kotlin/blob/${github.revision}" linesuffix="#L"/>-->
<!-- TODO Docs? -->
<packageoptions prefix="org.w3c" reportUndocumented="false"/>
<packageoptions prefix="org.khronos" reportUndocumented="false"/>
@@ -238,6 +244,8 @@
<packageoptions prefix="kotlin.reflect.jvm.internal" suppress="true"/>
<packageoptions prefix="kotlin.js.internal" suppress="true"/>
<sourcelink path="${kotlin_root}" url="https://github.com/JetBrains/kotlin/tree/${github_revision}" linesuffix="#L"/>
<target value="JS"/>
</passconfig>
@@ -254,13 +262,6 @@
includeRootPackage="false"
sincekotlin="1.3">
<!--
From https://github.com/JetBrains/kotlin-native/blob/6bc47171ca960b38d91332c5d84f6c4eeeeca06a/backend.native/build.gradle#L193
project(':Interop:Runtime').file('src/main/kotlin'),
project(':Interop:Runtime').file('src/native/kotlin'),
project(':Interop:JsRuntime').file('src/main/kotlin'),
project(':runtime').file('src/main/kotlin')
-->
<sourceroot path="${kotlin_native_root}/Interop/Runtime/src/main/kotlin"/>
<sourceroot path="${kotlin_native_root}/Interop/Runtime/src/native/kotlin"/>
<sourceroot path="${kotlin_native_root}/Interop/JsRuntime/src/main/kotlin"/>
@@ -269,6 +270,8 @@
<packageoptions prefix="kotlin.native.internal" suppress="true"/>
<packageoptions prefix="kotlin.test" suppress="true"/>
<sourcelink path="${kotlin_root}" url="https://github.com/JetBrains/kotlin/tree/${github_revision}" linesuffix="#L"/>
<target value="Native" />
</passconfig>
@@ -302,6 +305,8 @@
<sourceroot path="${kotlin_test_dir}/common/src/main/kotlin"/>
<sourceroot path="${kotlin_test_dir}/annotations-common/src/main/kotlin"/>
<sourcelink path="${kotlin_root}" url="https://github.com/JetBrains/kotlin/tree/${github_revision}" linesuffix="#L"/>
<target value="Common" />
<target value="JVM"/>
<target value="JS"/>
@@ -319,6 +324,8 @@
includeRootPackage="false">
<sourceroot path="${kotlin_test_dir}/jvm/src/main/kotlin"/>
<sourcelink path="${kotlin_root}" url="https://github.com/JetBrains/kotlin/tree/${github_revision}" linesuffix="#L"/>
<target value="JVM" />
<packageoptions prefix="org.junit" skipdeprecated="true"/>
</passconfig>
@@ -335,6 +342,8 @@
includeRootPackage="false">
<sourceroot path="${kotlin_test_dir}/junit/src/main/kotlin"/>
<sourcelink path="${kotlin_root}" url="https://github.com/JetBrains/kotlin/tree/${github_revision}" linesuffix="#L"/>
<!--<target value="JVM" />-->
<target value="JUnit"/>
<ExternalDocumentationLink url="https://kotlinlang.org/api/latest/jvm/stdlib/" packageListUrl="${stdlib.package.list}" />
@@ -352,6 +361,8 @@
includeRootPackage="false">
<sourceroot path="${kotlin_test_dir}/junit5/src/main/kotlin"/>
<sourcelink path="${kotlin_root}" url="https://github.com/JetBrains/kotlin/tree/${github_revision}" linesuffix="#L"/>
<!--<target value="JVM" />-->
<target value="JUnit5"/>
<ExternalDocumentationLink url="https://kotlinlang.org/api/latest/jvm/stdlib/" packageListUrl="${stdlib.package.list}" />
@@ -370,6 +381,8 @@
includeRootPackage="false">
<sourceroot path="${kotlin_test_dir}/testng/src/main/kotlin"/>
<sourcelink path="${kotlin_root}" url="https://github.com/JetBrains/kotlin/tree/${github_revision}" linesuffix="#L"/>
<!--<target value="JVM" />-->
<target value="TestNG"/>
<ExternalDocumentationLink url="https://kotlinlang.org/api/latest/jvm/stdlib/" packageListUrl="${stdlib.package.list}" />
@@ -388,6 +401,8 @@
sincekotlin="1.1">
<sourceroot path="${kotlin_test_dir}/js/src/main/kotlin"/>
<sourcelink path="${kotlin_root}" url="https://github.com/JetBrains/kotlin/tree/${github_revision}" linesuffix="#L"/>
<packageoptions prefix="org.junit" skipdeprecated="true"/>
<target value="JS" />
<ExternalDocumentationLink url="https://kotlinlang.org/api/latest/jvm/stdlib/" packageListUrl="${stdlib.package.list}" />
@@ -405,6 +420,8 @@
sincekotlin="1.3">
<sourceroot path="${kotlin_native_root}/runtime/src/main/kotlin/kotlin/test"/>
<sourcelink path="${kotlin_root}" url="https://github.com/JetBrains/kotlin/tree/${github_revision}" linesuffix="#L"/>
<target value="Native" />
<ExternalDocumentationLink url="https://kotlinlang.org/api/latest/jvm/stdlib/" packageListUrl="${stdlib.package.list}" />
</passconfig>
@@ -53,6 +53,7 @@ setupCallDokka.doLast {
pAnt().ant_exe.path,
"-f", file("build-docs.xml").path,
"v2",
"-Dgithub_revision=${pKotlinBig().github_revision}",
"-Dkotlin_root=${pKotlinBig().kotlin_root}",
"-Dkotlin_libs=${pKotlinBig().kotlin_libs}",
"-Dkotlin_native_root=${pKotlinNative().kotlin_native_root}",
@@ -6,11 +6,13 @@ final boolean isTeamcityBuild = System.getenv("TEAMCITY_VERSION") != null
final File kotlinRootDir = rootProject.file( "../../../")
final File kotlinLibsDir = new File(buildDir, 'libs')
final String githubRevision = isTeamcityBuild ? project.property("githubRevision") : "master"
final String kotlinVersion = isTeamcityBuild ? project.property("deployVersion") : "1.5.255-SNAPSHOT"
final String repo = isTeamcityBuild ? new File(buildDir, 'repo') : new File(kotlinRootDir, 'build/repo')
println("# Extracting info:")
println(" isTeamcityBuild: $isTeamcityBuild")
println(" githubRevision: $githubRevision")
println(" kotlinVersion: $kotlinVersion")
println(" repo: $repo")
@@ -60,5 +62,6 @@ modules.forEach { module ->
extractLibs.dependsOn libsTask
}
project.extensions.github_revision = githubRevision
project.extensions.kotlin_root = kotlinRootDir
project.extensions.kotlin_libs = kotlinLibsDir