Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DONT MERGE] Update templates for Dokka 2.0.0 #4705

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions .teamcity/BuildParams.kt
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
object BuildParams {
const val DOKKA_TEMPLATES_VERSION = "1.9.10"
const val DOKKA_TEMPLATES_VERSION = "2.0.0"

const val KOTLINX_COROUTINES_RELEASE_TAG = "1.10.1"
const val KOTLINX_COROUTINES_RELEASE_LABEL = "1.10.1"
const val KOTLINX_COROUTINES_RELEASE_TAG = "whyoleg/dokka2-sync" // master``
const val KOTLINX_COROUTINES_ID = "kotlinx.coroutines"
const val KOTLINX_SERIALIZATION_RELEASE_TAG = "v1.8.0"

const val KOTLINX_SERIALIZATION_RELEASE_LABEL = "v1.8.0"
const val KOTLINX_SERIALIZATION_RELEASE_TAG = "whyoleg/dokka2-sync" // master
const val KOTLINX_SERIALIZATION_ID = "kotlinx.serialization"
const val KOTLINX_DATETIME_RELEASE_TAG = "v0.6.2"

const val KOTLINX_DATETIME_RELEASE_LABEL = "v0.6.2"
const val KOTLINX_DATETIME_RELEASE_TAG = "whyoleg/dokka2-sync" // latest-release
const val KOTLINX_DATETIME_ID = "kotlinx-datetime"
const val KOTLINX_IO_RELEASE_TAG = "0.6.0"

const val KOTLINX_IO_RELEASE_LABEL = "0.6.0" // KOTLINX_IO_RELEASE_TAG
const val KOTLINX_IO_RELEASE_TAG = "whyoleg/dokka2-sync" // 0.6.0
const val KOTLINX_IO_ID = "kotlinx-io"
const val KOTLINX_METADATA_ID = "kotlinx-metadata-jvm"

const val KOTLIN_RELEASE_LABEL = "2.1.0"
const val KOTLIN_RELEASE_TAG = "whyoleg/dokka2-sync-stdlib"
const val KOTLIN_CORE_API_BUILD_ID = "Kotlin_KotlinRelease_210_LibraryReferenceLatestDocs"
const val KOTLIN_RELEASE_TAG = "v2.1.0"
const val KOTLINX_METADATA_ID = "kotlinx-metadata-jvm"

const val KGP_RELEASE_LABEL = KOTLIN_RELEASE_LABEL
const val KGP_RELEASE_TAG = "whyoleg/dokka2-sync"
const val KGP_ID = "kotlin-gradle-plugin"
val KGP_RELEASE_TAG = if (KOTLIN_RELEASE_TAG >= "v2.1.0") KOTLIN_RELEASE_TAG else "2.1.0"

const val SEARCH_APP_ID = "7961PKYRXV"
const val SEARCH_INDEX_NAME = "prod_KOTLINLANG_WEBHELP"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package builds.apiReferences.kgp

import BuildParams.KGP_ID
import BuildParams.KGP_RELEASE_TAG
import BuildParams.KOTLIN_RELEASE_TAG
import BuildParams.KGP_RELEASE_LABEL
import builds.apiReferences.BuildApiPages
import builds.apiReferences.dependsOnDokkaTemplate
import builds.apiReferences.scriptBuildHtml
Expand All @@ -13,7 +12,7 @@ private const val KGP_API_OUTPUT_DIR = "libraries/tools/gradle/documentation/bui
private const val KGP_API_TEMPLATES_DIR = "build/api-reference/templates"

object KotlinGradlePluginBuildApiReference : BuildApiPages(
apiId = KGP_ID, releaseTag = KGP_RELEASE_TAG,
apiId = KGP_ID, releaseTag = KGP_RELEASE_LABEL,
pagesRoot = KGP_API_OUTPUT_DIR,
vcsDefaultTrigger = { enabled = false },
stepDropSnapshot = { null },
Expand All @@ -27,7 +26,7 @@ object KotlinGradlePluginBuildApiReference : BuildApiPages(
#!/bin/bash
set -e -u
./gradlew :gradle:documentation:dokkaKotlinlangDocumentation -PdeployVersion=${
KGP_RELEASE_TAG.removePrefix("v")
KGP_RELEASE_LABEL
} --no-daemon --no-configuration-cache
""".trimIndent()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package builds.apiReferences.kotlinx.coroutines

import BuildParams.KOTLINX_COROUTINES_ID
import BuildParams.KOTLINX_COROUTINES_RELEASE_TAG
import BuildParams.KOTLINX_COROUTINES_RELEASE_LABEL
import builds.apiReferences.BuildApiPages
import builds.apiReferences.dependsOnDokkaTemplate
import builds.apiReferences.vcsRoots.KotlinxCoroutines

object KotlinxCoroutinesBuildApiReference : BuildApiPages(
apiId = KOTLINX_COROUTINES_ID, releaseTag = KOTLINX_COROUTINES_RELEASE_TAG, init = {
apiId = KOTLINX_COROUTINES_ID, releaseTag = KOTLINX_COROUTINES_RELEASE_LABEL, init = {
vcs {
root(KotlinxCoroutines)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package builds.apiReferences.kotlinx.datetime

import BuildParams.KOTLINX_DATETIME_ID
import BuildParams.KOTLINX_DATETIME_RELEASE_TAG
import BuildParams.KOTLINX_DATETIME_RELEASE_LABEL
import builds.apiReferences.BuildApiPages
import builds.apiReferences.dependsOnDokkaTemplate
import builds.apiReferences.scriptBuildHtml
Expand All @@ -12,7 +12,7 @@ private const val DOKKA_HTML_RESULT = "core/build/dokka/html"

object KotlinxDatetimeBuildApiReference : BuildApiPages(
apiId = KOTLINX_DATETIME_ID,
releaseTag = KOTLINX_DATETIME_RELEASE_TAG,
releaseTag = KOTLINX_DATETIME_RELEASE_LABEL,
pagesRoot = DOKKA_HTML_RESULT,
stepDropSnapshot = {
scriptDropSnapshot {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package builds.apiReferences.kotlinx.io

import BuildParams.KOTLINX_IO_ID
import BuildParams.KOTLINX_IO_RELEASE_TAG
import BuildParams.KOTLINX_IO_RELEASE_LABEL
import builds.apiReferences.BuildApiPages
import builds.apiReferences.dependsOnDokkaTemplate
import builds.apiReferences.scriptBuildHtml
Expand All @@ -10,7 +10,7 @@ import jetbrains.buildServer.configs.kotlin.buildSteps.ScriptBuildStep

object KotlinxIOBuildApiReference : BuildApiPages(
apiId = KOTLINX_IO_ID,
releaseTag = KOTLINX_IO_RELEASE_TAG.removePrefix("v"),
releaseTag = KOTLINX_IO_RELEASE_LABEL.removePrefix("v"),
stepDokkaVersionSync = {
// TODO readme, and disable this step for other libs too
null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package builds.apiReferences.kotlinx.metadataJvm

import BuildParams.KOTLINX_METADATA_ID
import BuildParams.KOTLIN_RELEASE_TAG
import BuildParams.KOTLIN_RELEASE_LABEL
import builds.apiReferences.BuildApiPages
import builds.apiReferences.dependsOnDokkaTemplate
import builds.apiReferences.scriptBuildHtml
Expand All @@ -12,7 +12,7 @@ private const val LIB_DIR = "libraries/kotlinx-metadata/jvm"

object KotlinxMetadataJvmBuildApiReference : BuildApiPages(
apiId = KOTLINX_METADATA_ID,
releaseTag = KOTLIN_RELEASE_TAG,
releaseTag = KOTLIN_RELEASE_LABEL,
pagesRoot = "$LIB_DIR/build/dokka",
vcsDefaultTrigger = { enabled = false },
stepDropSnapshot = { null },
Expand All @@ -26,7 +26,7 @@ object KotlinxMetadataJvmBuildApiReference : BuildApiPages(
scriptContent = """
#!/bin/bash
set -e -u
./gradlew :kotlin-metadata-jvm:dokkaHtml -PdeployVersion=${KOTLIN_RELEASE_TAG.removePrefix("v")} --no-daemon --no-configuration-cache
./gradlew :kotlin-metadata-jvm:dokkaHtml -PdeployVersion=${KOTLIN_RELEASE_LABEL} --no-daemon --no-configuration-cache
""".trimIndent()
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package builds.apiReferences.kotlinx.serialization

import BuildParams.KOTLINX_SERIALIZATION_ID
import BuildParams.KOTLINX_SERIALIZATION_RELEASE_TAG
import BuildParams.KOTLINX_SERIALIZATION_RELEASE_LABEL
import builds.apiReferences.BuildApiPages
import builds.apiReferences.dependsOnDokkaTemplate
import builds.apiReferences.vcsRoots.KotlinxSerialization

object KotlinxSerializationBuildApiReference : BuildApiPages(
apiId = KOTLINX_SERIALIZATION_ID, releaseTag = KOTLINX_SERIALIZATION_RELEASE_TAG, init = {
apiId = KOTLINX_SERIALIZATION_ID, releaseTag = KOTLINX_SERIALIZATION_RELEASE_LABEL, init = {
vcs {
root(KotlinxSerialization)
}
Expand Down
2 changes: 1 addition & 1 deletion .teamcity/builds/apiReferences/vcsRoots/Kotlin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import jetbrains.buildServer.configs.kotlin.vcs.GitVcsRoot
object Kotlin : GitVcsRoot({
name = "kotlin metadata vcs root"
url = "[email protected]:JetBrains/kotlin.git"
branch = "refs/tags/$KOTLIN_RELEASE_TAG"
branch = KOTLIN_RELEASE_TAG
branchSpec = """
+:refs/heads/(*)
+:refs/tags/(*)
Expand Down
2 changes: 1 addition & 1 deletion .teamcity/builds/apiReferences/vcsRoots/KotlinKGP.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import jetbrains.buildServer.configs.kotlin.vcs.GitVcsRoot
object KotlinKGP : GitVcsRoot({
name = "kotlin Gradle Plugin vcs root"
url = "[email protected]:JetBrains/kotlin.git"
branch = "refs/${if (KGP_RELEASE_TAG.startsWith("v")) "tags" else "heads"}/$KGP_RELEASE_TAG"
branch = KGP_RELEASE_TAG
branchSpec = """
+:refs/heads/(*)
+:refs/tags/(*)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package builds.apiReferences.vcsRoots

import BuildParams.KOTLINX_COROUTINES_RELEASE_TAG
import jetbrains.buildServer.configs.kotlin.vcs.GitVcsRoot

object KotlinxCoroutines : GitVcsRoot({
name = "kotlinx.coroutines vcs root"
url = "[email protected]:Kotlin/kotlinx.coroutines.git"
branch = "refs/heads/master"
branch = KOTLINX_COROUTINES_RELEASE_TAG
branchSpec = """
+:refs/heads/(*)
""".trimIndent()
+:refs/heads/(*)
+:refs/tags/(*)
""".trimIndent()
useTagsAsBranches = true
checkoutPolicy = AgentCheckoutPolicy.USE_MIRRORS
authMethod = uploadedKey {
Expand Down
9 changes: 5 additions & 4 deletions .teamcity/builds/apiReferences/vcsRoots/KotlinxDatetime.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package builds.apiReferences.vcsRoots

import BuildParams.KOTLINX_DATETIME_RELEASE_TAG
import jetbrains.buildServer.configs.kotlin.vcs.GitVcsRoot

object KotlinxDatetime: GitVcsRoot({
name = "kotlinx-datetime vcs root"
url = "[email protected]:Kotlin/kotlinx-datetime.git"
branch = "refs/heads/latest-release"
branch = KOTLINX_DATETIME_RELEASE_TAG
branchSpec = """
+:refs/heads/(*)
+:refs/tags/(*)
""".trimIndent()
+:refs/heads/(*)
+:refs/tags/(*)
""".trimIndent()
useTagsAsBranches = true
authMethod = uploadedKey {
uploadedKey = "teamcity"
Expand Down
2 changes: 1 addition & 1 deletion .teamcity/builds/apiReferences/vcsRoots/KotlinxIO.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import jetbrains.buildServer.configs.kotlin.vcs.GitVcsRoot
object KotlinxIO : GitVcsRoot({
name = "kotlinx-io vcs root"
url = "[email protected]:Kotlin/kotlinx-io.git"
branch = "refs/tags/$KOTLINX_IO_RELEASE_TAG"
branch = KOTLINX_IO_RELEASE_TAG
branchSpec = """
+:refs/heads/(*)
+:refs/tags/(*)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package builds.apiReferences.vcsRoots

import BuildParams.KOTLINX_SERIALIZATION_RELEASE_TAG
import jetbrains.buildServer.configs.kotlin.vcs.GitVcsRoot

object KotlinxSerialization: GitVcsRoot({
name = "kotlinx.serialization vcs root"
url = "[email protected]:Kotlin/kotlinx.serialization.git"
branch = "refs/heads/master"
branch = KOTLINX_SERIALIZATION_RELEASE_TAG
branchSpec = """
+:refs/heads/(*)
""".trimIndent()
+:refs/heads/(*)
+:refs/tags/(*)
""".trimIndent()
useTagsAsBranches = true
authMethod = uploadedKey {
uploadedKey = "teamcity"
Expand Down
7 changes: 5 additions & 2 deletions .teamcity/vcsRoots/KotlinLangOrg.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ import jetbrains.buildServer.configs.kotlin.vcs.GitVcsRoot
object KotlinLangOrg: GitVcsRoot({
name = "kotlinlang.org VCS root"
url = "ssh://[email protected]/JetBrains/kotlin-web-site"
branch = "refs/heads/master"
branchSpec = "+:refs/heads/(*)"
branch = "master"
branchSpec = """
+:refs/heads/(*)
+:refs/tags/(*)
""".trimIndent()
authMethod = uploadedKey {
uploadedKey = "default teamcity key"
}
Expand Down
18 changes: 17 additions & 1 deletion dokka-templates/base.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,23 @@
<@header.display/>
<div id="container" data-test="content">
<div class="sidebar" id="leftColumn">
<div class="sidebar--inner" id="sideMenu"></div>
<div class="dropdown theme-dark_mobile" data-role="dropdown" id="toc-dropdown">
<ul role="listbox" id="toc-listbox" class="dropdown--list dropdown--list_toc-list"
data-role="dropdown-listbox">
<div class="dropdown--header">
<span>
<@template_cmd name="projectName">
${projectName}
</@template_cmd>
</span>
<button class="button" data-role="dropdown-toggle" aria-label="Close table of contents">
<i class="ui-kit-icon ui-kit-icon_cross"></i>
</button>
</div>
<div class="sidebar--inner" id="sideMenu"></div>
</ul>
<div class="dropdown--overlay"></div>
</div>
</div>
<div id="main">
<@content/>
Expand Down
49 changes: 27 additions & 22 deletions dokka-templates/includes/header.ftl
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
<#import "source_set_selector.ftl" as source_set_selector>
<#macro display>
<nav class="navigation" id="navigation-wrapper">
<div class="navigation--inner">
<div class="navigation-title">
<button class="menu-toggle" id="menu-toggle" type="button">toggle menu</button>
<div class="library-name">
<@template_cmd name="pathToRoot">
<a class="library-name--link" href="${pathToRoot}index.html">
<@template_cmd name="projectName">
${projectName}
</@template_cmd>
</a>
</@template_cmd>
</div>
<div class="library-version">
<#-- This can be handled by the versioning plugin -->
<@version/>
</div>
</div>
<@source_set_selector.display/>
<nav class="navigation theme-dark" id="navigation-wrapper">
<@template_cmd name="pathToRoot">
<a class="library-name--link" href="${pathToRoot}index.html">
<@template_cmd name="projectName">
${projectName}
</@template_cmd>
</a>
</@template_cmd>
<button class="navigation-controls--btn navigation-controls--btn_toc ui-kit_mobile-only" id="toc-toggle"
type="button">Toggle table of contents
</button>
<div class="navigation-controls--break ui-kit_mobile-only"></div>
<div class="library-version" id="library-version">
<#-- This can be handled by the versioning plugin -->
<@version/>
</div>
<div class="navigation-controls">
<button class="navigation-controls--btn navigation-controls--theme" id="theme-toggle-button" type="button">switch theme</button>
<div class="navigation-controls--btn navigation-controls--search" id="searchBar" role="button">search in API</div>
<@source_set_selector.display/>
<#if homepageLink?has_content>
<a class="navigation-controls--btn navigation-controls--btn_homepage" id="homepage-link"
href="${homepageLink}"></a>
</#if>
<button class="navigation-controls--btn navigation-controls--btn_theme" id="theme-toggle-button"
type="button">Switch theme
</button>
<div class="navigation-controls--btn navigation-controls--btn_search" id="searchBar" role="button">Search in
API
</div>
</div>
</nav>
</#macro>
</#macro>
34 changes: 31 additions & 3 deletions dokka-templates/includes/source_set_selector.ftl
Original file line number Diff line number Diff line change
@@ -1,9 +1,37 @@
<#macro display>
<#if sourceSets?has_content>
<div class="filter-section" id="filter-section">
<div class="filter-section filter-section_loading" id="filter-section">
<#list sourceSets as ss>
<button class="platform-tag platform-selector ${ss.platform}-like" data-active="" data-filter="${ss.filter}">${ss.name}</button>
<button class="platform-tag platform-selector ${ss.platform}-like" data-active=""
data-filter="${ss.filter}">${ss.name}</button>
</#list>
<div class="dropdown filter-section--dropdown" data-role="dropdown" id="filter-section-dropdown">
<button class="button button_dropdown filter-section--dropdown-toggle" role="combobox"
data-role="dropdown-toggle"
aria-controls="platform-tags-listbox"
aria-haspopup="listbox"
aria-expanded="false"
aria-label="Toggle source sets"
></button>
<ul role="listbox" id="platform-tags-listbox" class="dropdown--list" data-role="dropdown-listbox">
<div class="dropdown--header"><span>Platform filter</span>
<button class="button" data-role="dropdown-toggle" aria-label="Close platform filter">
<i class="ui-kit-icon ui-kit-icon_cross"></i>
</button>
</div>
<#list sourceSets as ss>
<li role="option" class="dropdown--option platform-selector-option ${ss.platform}-like" tabindex="0">
<label class="checkbox">
<input type="checkbox" class="checkbox--input" id="${ss.filter}"
data-filter="${ss.filter}"/>
<span class="checkbox--icon"></span>
${ss.name}
</label>
</li>
</#list>
</ul>
<div class="dropdown--overlay"></div>
</div>
</div>
</#if>
</#macro>
</#macro>
Loading