Skip to content

Commit

Permalink
Merge pull request #4560 from JetBrains/core-api-r3
Browse files Browse the repository at this point in the history
Core API: Release reference with dokka 2+
  • Loading branch information
zoobestik authored Nov 20, 2024
2 parents d8254bd + 943fb1c commit 02347cc
Show file tree
Hide file tree
Showing 74 changed files with 6,504 additions and 6,757 deletions.
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ generated
.next
.teamcity/*.iml

scripts/doindex/package-lock.json
search-report*
data/page_views_map.json
/scripts/doindex/package-lock.json
/search-report*
/reports
/data/page_views_map.json
6 changes: 6 additions & 0 deletions .teamcity/BuildParams.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ object BuildParams {
const val DOKKA_TEMPLATES_VERSION = "1.9.10"

const val KOTLINX_COROUTINES_RELEASE_TAG = "1.9.0"
const val KOTLINX_COROUTINES_ID = "kotlinx.coroutines"
const val KOTLINX_SERIALIZATION_RELEASE_TAG = "v1.7.3"
const val KOTLINX_SERIALIZATION_ID = "kotlinx.serialization"
const val KOTLINX_DATETIME_RELEASE_TAG = "v0.6.1"
const val KOTLINX_DATETIME_ID = "kotlinx-datetime"
const val KOTLINX_IO_RELEASE_TAG = "v0.5.4" // copy tag supported in master, remove "v" after next release 0.5.5 or 0.6.0
const val KOTLINX_IO_ID = "kotlinx-io"
const val KOTLINX_METADATA_ID = "kotlinx-metadata-jvm"
const val KOTLIN_CORE_API_BUILD_ID = "Kotlin_KotlinRelease_2020_LibraryReferenceLatestDocs"
const val KOTLIN_RELEASE_TAG = "v2.0.21"

const val SEARCH_APP_ID = "7961PKYRXV"
Expand Down
73 changes: 73 additions & 0 deletions .teamcity/builds/TemplateSearchIndex.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package builds

import BuildParams.SEARCH_APP_ID
import builds.kotlinlang.buidTypes.PageViews
import jetbrains.buildServer.configs.kotlin.BuildSteps
import jetbrains.buildServer.configs.kotlin.BuildType
import jetbrains.buildServer.configs.kotlin.buildSteps.ScriptBuildStep
import vcsRoots.KotlinLangOrg

private const val SCRIPT_PATH = "scripts/doindex";

fun BuildSteps.scriptDistAnalyze(block: ScriptBuildStep.() -> Unit) = step(
ScriptBuildStep {
name = "Run dist/ analyzer"
//language=bash
scriptContent = """
#!/bin/sh
set -e
npm install
npm run generate-metadata
""".trimIndent()
dockerImage = "node:22-alpine"
workingDir = SCRIPT_PATH
dockerPull = true

block()
}
)

open class TemplateSearchIndex(init: BuildType.() -> Unit) : BuildType({
artifactRules = """
reports/** => reports.zip
""".trimIndent()

requirements {
doesNotContain("docker.server.osType", "windows")
}

params {
param("env.NODE_OPTIONS", "--max-old-space-size=32768")

param("env.WH_SEARCH_USER", SEARCH_APP_ID)
param("env.WH_SEARCH_WRITE_KEY", "%ALGOLIA_WRITE_API_KEY%")
param("env.WH_SKIP_PREFILTER", "true") // analyze all files
}

vcs {
root(
KotlinLangOrg, """
$SCRIPT_PATH
""".trimIndent()
)
cleanCheckout = true
showDependenciesChanges = true
}

steps {
scriptDistAnalyze {}
}

dependencies {
dependency(PageViews) {
snapshot {}
artifacts {
artifactRules = """
page_views_map.json => data/
""".trimIndent()
}
}
}

init()
})
62 changes: 27 additions & 35 deletions .teamcity/builds/apiReferences/BuildApiReferencesProject.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,53 +16,45 @@ import builds.apiReferences.kotlinx.serialization.KotlinxSerializationBuildApiRe
import builds.apiReferences.kotlinx.serialization.KotlinxSerializationBuildSearchIndex
import builds.apiReferences.kotlinx.serialization.KotlinxSerializationPrepareDokkaTemplates
import builds.apiReferences.stdlib.BuildStdlibApiReference
import builds.apiReferences.stdlib.StdlibBuildSearchIndex
import builds.apiReferences.stdlib.StdlibPrepareDokkaTemplates
import builds.apiReferences.templates.BuildApiReference
import builds.apiReferences.templates.BuildApiReferenceSearchIndex
import builds.apiReferences.templates.PrepareDokkaTemplate
import builds.apiReferences.vcsRoots.KotlinMetadataJvm
import builds.apiReferences.vcsRoots.KotlinxCoroutines
import builds.apiReferences.vcsRoots.KotlinxDatetime
import builds.apiReferences.vcsRoots.KotlinxIO
import builds.apiReferences.vcsRoots.KotlinxSerialization
import builds.apiReferences.vcsRoots.*
import jetbrains.buildServer.configs.kotlin.Project

object BuildApiReferencesProject : Project({
name = "API References"
description = "Build API references for kotlinlang.org"
name = "API References"
description = "Build API references for kotlinlang.org"

buildType(KotlinxDatetimeBuildApiReference)
buildType(KotlinxDatetimeBuildSearchIndex)
buildType(KotlinxDatetimePrepareDokkaTemplates)
buildType(KotlinxDatetimeBuildApiReference)
buildType(KotlinxDatetimeBuildSearchIndex)
buildType(KotlinxDatetimePrepareDokkaTemplates)

buildType(KotlinxIOBuildApiReference)
buildType(KotlinxIOBuildSearchIndex)
buildType(KotlinxIOPrepareDokkaTemplates)
buildType(KotlinxIOBuildApiReference)
buildType(KotlinxIOBuildSearchIndex)
buildType(KotlinxIOPrepareDokkaTemplates)

buildType(KotlinxSerializationBuildApiReference)
buildType(KotlinxSerializationBuildSearchIndex)
buildType(KotlinxSerializationPrepareDokkaTemplates)
buildType(KotlinxSerializationBuildApiReference)
buildType(KotlinxSerializationBuildSearchIndex)
buildType(KotlinxSerializationPrepareDokkaTemplates)

buildType(KotlinxCoroutinesBuildApiReference)
buildType(KotlinxCoroutinesBuildSearchIndex)
buildType(KotlinxCoroutinesPrepareDokkaTemplates)
buildType(KotlinxCoroutinesBuildApiReference)
buildType(KotlinxCoroutinesBuildSearchIndex)
buildType(KotlinxCoroutinesPrepareDokkaTemplates)

buildType(KotlinxMetadataJvmBuildApiReference)
buildType(KotlinxMetadataJvmBuildSearchIndex)
buildType(KotlinxMetadataJvmPrepareDokkaTemplates)
buildType(KotlinxMetadataJvmBuildApiReference)
buildType(KotlinxMetadataJvmBuildSearchIndex)
buildType(KotlinxMetadataJvmPrepareDokkaTemplates)

buildType(BuildStdlibApiReference)
buildType(StdlibBuildSearchIndex)
buildType(StdlibPrepareDokkaTemplates)
buildType(BuildStdlibApiReference)
buildType(StdlibPrepareDokkaTemplates)

vcsRoot(KotlinxSerialization)
vcsRoot(KotlinxCoroutines)
vcsRoot(KotlinxDatetime)
vcsRoot(KotlinxIO)
vcsRoot(KotlinMetadataJvm)
vcsRoot(KotlinxSerialization)
vcsRoot(KotlinxCoroutines)
vcsRoot(KotlinxDatetime)
vcsRoot(KotlinxIO)
vcsRoot(KotlinMetadataJvm)

template(PrepareDokkaTemplate)
template(BuildApiReference)
template(BuildApiReferenceSearchIndex)
template(PrepareDokkaTemplate)
template(BuildApiReference)
})
1 change: 1 addition & 0 deletions .teamcity/builds/apiReferences/extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ fun Dependencies.dependsOnDokkaTemplate(build: BuildType, artifactPath: String =
}
artifacts {
artifactRules = "+:dokka-templates/** => $artifactPath"
cleanDestination = true
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package builds.apiReferences.kotlinx.coroutines

import BuildParams.KOTLINX_COROUTINES_ID
import BuildParams.KOTLINX_COROUTINES_RELEASE_TAG
import builds.apiReferences.dependsOnDokkaTemplate
import builds.apiReferences.templates.BuildApiReference
import jetbrains.buildServer.configs.kotlin.BuildType

object KotlinxCoroutinesBuildApiReference : BuildType({
name = "kotlinx.coroutines API reference"
name = "$KOTLINX_COROUTINES_ID API reference"
description = "Build pages for Kotlinx Coroutines"

templates(BuildApiReference)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
package builds.apiReferences.kotlinx.coroutines

import builds.apiReferences.dependsOnDokkaPagesJson
import builds.apiReferences.templates.BuildApiReferenceSearchIndex
import jetbrains.buildServer.configs.kotlin.BuildType
import BuildParams.KOTLINX_COROUTINES_ID
import builds.TemplateSearchIndex

object KotlinxCoroutinesBuildSearchIndex: BuildType({
name = "Build search index for kotlinx.coroutines"
object KotlinxCoroutinesBuildSearchIndex : TemplateSearchIndex({
name = "$KOTLINX_COROUTINES_ID search"
description = "Build search index for Kotlinx Coroutines"

templates(BuildApiReferenceSearchIndex)
params {
param("env.ALGOLIA_INDEX_NAME", "$KOTLINX_COROUTINES_ID")
}

params {
param("env.ALGOLIA_INDEX_NAME", "kotlinx.coroutines")
param("env.API_REFERENCE_URL", "/api/kotlinx.coroutines")
}

dependencies {
dependsOnDokkaPagesJson(KotlinxCoroutinesBuildApiReference)
}
})
dependencies {
dependency(KotlinxCoroutinesBuildApiReference) {
snapshot {}
artifacts {
artifactRules = """
pages.zip!** => dist/api/$KOTLINX_COROUTINES_ID/
""".trimIndent()
cleanDestination = true
}
}
}
})
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package builds.apiReferences.kotlinx.coroutines

import BuildParams.KOTLINX_COROUTINES_ID
import builds.apiReferences.templates.PrepareDokkaTemplate
import jetbrains.buildServer.configs.kotlin.BuildType

object KotlinxCoroutinesPrepareDokkaTemplates: BuildType({
name = "Prepare dokka templates for kotlinx.coroutines"
object KotlinxCoroutinesPrepareDokkaTemplates : BuildType({
name = "$KOTLINX_COROUTINES_ID templates"
description = "Build dokka templates for Kotlinx Coroutines"

templates(PrepareDokkaTemplate)
templates(PrepareDokkaTemplate)

params {
param("env.ALGOLIA_INDEX_NAME", "kotlinx.coroutines")
}
})
params {
param("env.ALGOLIA_INDEX_NAME", "$KOTLINX_COROUTINES_ID")
}
})
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package builds.apiReferences.kotlinx.datetime

import BuildParams.KOTLINX_DATETIME_ID
import BuildParams.KOTLINX_DATETIME_RELEASE_TAG
import builds.apiReferences.dependsOnDokkaTemplate
import builds.apiReferences.templates.BuildApiReference
Expand All @@ -8,7 +9,8 @@ import builds.apiReferences.templates.scriptDropSnapshot
import jetbrains.buildServer.configs.kotlin.BuildType

object KotlinxDatetimeBuildApiReference : BuildType({
name = "kotlinx-datetime API reference"
name = "$KOTLINX_DATETIME_ID API reference"
description = "Build pages for Kotlinx Datetime"

templates(BuildApiReference)

Expand All @@ -28,9 +30,10 @@ object KotlinxDatetimeBuildApiReference : BuildType({

steps {
scriptDropSnapshot {
// language=bash
scriptContent = """
#!/bin/bash
sed -i -E "s/versionSuffix=SNAPSHOT//gi" ./gradle.properties
#!/bin/bash
sed -i -E "s/versionSuffix=SNAPSHOT//gi" ./gradle.properties
""".trimIndent()
}
buildDokkaHTML {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
package builds.apiReferences.kotlinx.datetime

import builds.apiReferences.dependsOnDokkaPagesJson
import builds.apiReferences.templates.BuildApiReferenceSearchIndex
import jetbrains.buildServer.configs.kotlin.BuildType
import BuildParams.KOTLINX_DATETIME_ID
import builds.TemplateSearchIndex

object KotlinxDatetimeBuildSearchIndex: BuildType({
name = "Build search index for kotlinx-datetime"
object KotlinxDatetimeBuildSearchIndex : TemplateSearchIndex({
name = "$KOTLINX_DATETIME_ID search"
description = "Build search index for Kotlinx Datetime"

templates(BuildApiReferenceSearchIndex)
params {
param("env.ALGOLIA_INDEX_NAME", "$KOTLINX_DATETIME_ID")
}

params {
param("env.ALGOLIA_INDEX_NAME", "kotlinx-datetime")
param("env.API_REFERENCE_URL", "/api/kotlinx-datetime")
}

dependencies {
dependsOnDokkaPagesJson(KotlinxDatetimeBuildApiReference)
}
dependencies {
dependency(KotlinxDatetimeBuildApiReference) {
snapshot {}
artifacts {
artifactRules = """
pages.zip!** => dist/api/$KOTLINX_DATETIME_ID/
""".trimIndent()
cleanDestination = true
}
}
}
})
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package builds.apiReferences.kotlinx.datetime

import BuildParams.KOTLINX_DATETIME_ID
import builds.apiReferences.templates.PrepareDokkaTemplate
import jetbrains.buildServer.configs.kotlin.BuildType

object KotlinxDatetimePrepareDokkaTemplates: BuildType({
name = "Prepare dokka templates for kotlinx-datetime"
object KotlinxDatetimePrepareDokkaTemplates : BuildType({
name = "$KOTLINX_DATETIME_ID templates"
description = "Build dokka templates for Kotlinx Datetime"

templates(PrepareDokkaTemplate)
templates(PrepareDokkaTemplate)

params {
param("env.ALGOLIA_INDEX_NAME", "kotlinx-datetime")
}
params {
param("env.ALGOLIA_INDEX_NAME", "$KOTLINX_DATETIME_ID")
}
})
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package builds.apiReferences.kotlinx.io

import BuildParams.KOTLINX_IO_ID
import BuildParams.KOTLINX_IO_RELEASE_TAG
import builds.apiReferences.dependsOnDokkaTemplate
import builds.apiReferences.templates.BuildApiReference
Expand All @@ -10,7 +11,8 @@ import jetbrains.buildServer.configs.kotlin.BuildType
import jetbrains.buildServer.configs.kotlin.buildSteps.script

object KotlinxIOBuildApiReference : BuildType({
name = "kotlinx-io API reference"
name = "$KOTLINX_IO_ID API reference"
description = "Build pages for Kotlinx IO"

templates(BuildApiReference)

Expand Down
Loading

0 comments on commit 02347cc

Please sign in to comment.