Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	.gitignore
#	data/releases.yml
#	requirements.txt
  • Loading branch information
LiYing2010 committed Oct 11, 2024
2 parents 0c8cfa9 + 19165d8 commit 44dd947
Show file tree
Hide file tree
Showing 788 changed files with 54,431 additions and 11,211 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/verify-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
java-version: '17'
distribution: 'zulu'
- name: Run a verifier
uses: AlexanderPrendota/kotlin-samples-verifier@master
uses: zoobestik/kotlin-samples-verifier@master
with:
push-repository: 'https://github.com/JetBrains/kotlin-compiler-server'
tag-filter: '#tag="code" & kotlin-runnable="true" & !validate="false"'
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,16 @@ google-credentials.json
.env
pages/api/
external/
assets/docs/
assets/externals
pages/docs/tutorials/kotlin-for-py/
_teamcity
dist
libs
generated
.next
.teamcity/*.iml
/old/

scripts/doindex/package-lock.json
search-report*
data/page_views_map.json
9 changes: 5 additions & 4 deletions .teamcity/BuildParams.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
object BuildParams {
const val DOKKA_TEMPLATES_VERSION = "1.9.10"

const val KOTLINX_COROUTINES_RELEASE_TAG = "1.8.0"
const val KOTLINX_SERIALIZATION_RELEASE_TAG = "v1.6.3"
const val KOTLINX_DATETIME_RELEASE_TAG = "v0.6.0-RC"
const val KOTLINX_METADATA_JVM_RELEASE_TAG = "v0.9.0"
const val KOTLINX_COROUTINES_RELEASE_TAG = "1.9.0-RC"
const val KOTLINX_SERIALIZATION_RELEASE_TAG = "v1.7.3"
const val KOTLINX_DATETIME_RELEASE_TAG = "v0.6.0"
const val KOTLINX_IO_RELEASE_TAG = "0.5.4"
const val KOTLIN_RELEASE_TAG = "v2.0.20"

const val SEARCH_APP_ID = "7961PKYRXV"
const val SEARCH_INDEX_NAME = "prod_KOTLINLANG_WEBHELP"
Expand Down
21 changes: 16 additions & 5 deletions .teamcity/builds/apiReferences/BuildApiReferencesProject.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,26 @@ import builds.apiReferences.kotlinx.coroutines.KotlinxCoroutinesPrepareDokkaTemp
import builds.apiReferences.kotlinx.datetime.KotlinxDatetimeBuildApiReference
import builds.apiReferences.kotlinx.datetime.KotlinxDatetimeBuildSearchIndex
import builds.apiReferences.kotlinx.datetime.KotlinxDatetimePrepareDokkaTemplates
import builds.apiReferences.kotlinx.serialization.KotlinxSerializationBuildApiReference
import builds.apiReferences.kotlinx.serialization.KotlinxSerializationBuildSearchIndex
import builds.apiReferences.kotlinx.serialization.KotlinxSerializationPrepareDokkaTemplates
import builds.apiReferences.kotlinx.io.KotlinxIOBuildApiReference
import builds.apiReferences.kotlinx.io.KotlinxIOBuildSearchIndex
import builds.apiReferences.kotlinx.io.KotlinxIOPrepareDokkaTemplates
import builds.apiReferences.kotlinx.metadataJvm.KotlinxMetadataJvmBuildApiReference
import builds.apiReferences.kotlinx.metadataJvm.KotlinxMetadataJvmBuildSearchIndex
import builds.apiReferences.kotlinx.metadataJvm.KotlinxMetadataJvmPrepareDokkaTemplates
import builds.apiReferences.kotlinx.serialization.KotlinxSerializationBuildApiReference
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.KotlinxSerialization
import builds.apiReferences.vcsRoots.KotlinxDatetime
import builds.apiReferences.vcsRoots.KotlinMetadataJvm
import builds.apiReferences.vcsRoots.KotlinxIO
import builds.apiReferences.vcsRoots.KotlinxSerialization
import jetbrains.buildServer.configs.kotlin.Project

object BuildApiReferencesProject : Project({
Expand All @@ -31,6 +36,10 @@ object BuildApiReferencesProject : Project({
buildType(KotlinxDatetimeBuildSearchIndex)
buildType(KotlinxDatetimePrepareDokkaTemplates)

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

buildType(KotlinxSerializationBuildApiReference)
buildType(KotlinxSerializationBuildSearchIndex)
buildType(KotlinxSerializationPrepareDokkaTemplates)
Expand All @@ -44,11 +53,13 @@ object BuildApiReferencesProject : Project({
buildType(KotlinxMetadataJvmPrepareDokkaTemplates)

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

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

template(PrepareDokkaTemplate)
Expand Down
6 changes: 2 additions & 4 deletions .teamcity/builds/apiReferences/extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ import jetbrains.buildServer.configs.kotlin.FailureAction
fun Dependencies.dependsOnDokkaTemplate(build: BuildType, artifactPath: String = "dokka-templates") {
dependency(build) {
snapshot {
onDependencyFailure = FailureAction.CANCEL
onDependencyFailure = FailureAction.FAIL_TO_START
onDependencyCancel = FailureAction.CANCEL
}

artifacts {
artifactRules = "+:dokka-templates/** => $artifactPath"
}
Expand All @@ -20,10 +19,9 @@ fun Dependencies.dependsOnDokkaTemplate(build: BuildType, artifactPath: String =
fun Dependencies.dependsOnDokkaPagesJson(build: BuildType) {
dependency(build) {
snapshot {
onDependencyFailure = FailureAction.CANCEL
onDependencyFailure = FailureAction.FAIL_TO_START
onDependencyCancel = FailureAction.CANCEL
}

artifacts {
artifactRules = "+:pages.zip!scripts/pages.json => api-references"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package builds.apiReferences.kotlinx.io

import BuildParams.KOTLINX_IO_RELEASE_TAG
import builds.apiReferences.dependsOnDokkaTemplate
import builds.apiReferences.templates.BuildApiReference
import builds.apiReferences.templates.buildDokkaHTML
import builds.apiReferences.templates.scriptDokkaVersionSync
import builds.apiReferences.templates.scriptDropSnapshot
import jetbrains.buildServer.configs.kotlin.BuildType
import jetbrains.buildServer.configs.kotlin.buildSteps.script

object KotlinxIOBuildApiReference : BuildType({
name = "kotlinx-io API reference"

templates(BuildApiReference)

artifactRules = "build/dokka/htmlMultiModule/** => pages.zip"

params {
param("release.tag", KOTLINX_IO_RELEASE_TAG)
}

vcs {
root(builds.apiReferences.vcsRoots.KotlinxIO)
}

dependencies {
dependsOnDokkaTemplate(KotlinxIOPrepareDokkaTemplates)
}

steps {
scriptDropSnapshot {}
scriptDokkaVersionSync {
enabled = false // TODO readme, and disable this step for other libs too
}
buildDokkaHTML {
enabled = false // TODO add useGradlewWrapper = true
}
script {
name = "build api reference"
scriptContent = """
#!/bin/bash
set -e -u
./gradlew dokkaHtmlMultiModule --no-daemon --no-configuration-cache
""".trimIndent()
}
}
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package builds.apiReferences.kotlinx.io

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

object KotlinxIOBuildSearchIndex: BuildType({
name = "Build search index for kotlinx-io"

templates(BuildApiReferenceSearchIndex)

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

dependencies {
dependsOnDokkaPagesJson(KotlinxIOBuildApiReference)
}
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package builds.apiReferences.kotlinx.io

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

object KotlinxIOPrepareDokkaTemplates: BuildType({
name = "Prepare dokka templates for kotlinx-io"

templates(PrepareDokkaTemplate)

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

import BuildParams.KOTLINX_METADATA_JVM_RELEASE_TAG
import BuildParams.KOTLIN_RELEASE_TAG
import builds.apiReferences.dependsOnDokkaTemplate
import builds.apiReferences.templates.*
import jetbrains.buildServer.configs.kotlin.BuildType
Expand All @@ -16,7 +16,7 @@ object KotlinxMetadataJvmBuildApiReference : BuildType({
artifactRules = "$LIB_DIR/build/dokka/** => pages.zip"

params {
param("release.tag", KOTLINX_METADATA_JVM_RELEASE_TAG)
param("release.tag", KOTLIN_RELEASE_TAG)
}

triggers {
Expand All @@ -36,43 +36,14 @@ object KotlinxMetadataJvmBuildApiReference : BuildType({
buildDokkaHTML {
enabled = false
}
scriptDokkaVersionSync {
script {
name = "build api reference"
scriptContent = """
#!/bin/bash
set -e
set +x
set -o pipefail
set -u
# update Dokka version
sed -i -E "s/dokka ?= ?\"[0-9\.]+\"/dokka = \"1.9.0-dev-218\"/gi" ./gradle/libs.versions.toml
# Define the replacement string
replacement="maven(url = \"$DOKKA_SPACE_REPO\")\nmavenCentral"
# List of kts files to apply the command on
files=(
"./build.gradle.kts"
"./repo/gradle-settings-conventions/settings.gradle.kts"
"./repo/gradle-build-conventions/buildsrc-compat/build.gradle.kts"
)
# Loop through the files and apply the sed command
for file in "${'$'}{files[@]}"; do
sed -i -E "s|mavenCentral|${'$'}replacement|" "${'$'}file"
done
# modify Groovy file
sed -i -E "s|mavenCentral|maven \{ url \"$DOKKA_SPACE_REPO\" \}\nmavenCentral|" ./settings.gradle
set -e -u
# add Dokka dev artifacts to the list of trusted ones
sed -i -E "s|<trusted-artifacts>|<trusted-artifacts>\n<trust group=\"org.jetbrains.dokka\" />\n|" ./gradle/verification-metadata.xml
""".trimIndent()
}
script {
name = "build api reference"
scriptContent = """
./gradlew :kotlinx-metadata-jvm:dokkaHtml -PkotlinxMetadataDeployVersion=${KOTLINX_METADATA_JVM_RELEASE_TAG} --no-daemon
./gradlew :kotlin-metadata-jvm:dokkaHtml -PdeployVersion=${KOTLIN_RELEASE_TAG.removePrefix("v")} --no-daemon --no-configuration-cache
""".trimIndent()
}
}
Expand Down
43 changes: 32 additions & 11 deletions .teamcity/builds/apiReferences/stdlib/BuildStdlibApiReference.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,43 @@ package builds.apiReferences.stdlib

import jetbrains.buildServer.configs.kotlin.*
import jetbrains.buildServer.configs.kotlin.BuildType
import jetbrains.buildServer.configs.kotlin.buildSteps.script

object BuildStdlibApiReference : BuildType({
name = "Stdlib Api reference"
artifactRules = """
+:content/** => latest-version.zip
+:pages.json => ./
""".trimIndent()

artifactRules = "latest-version.zip"
steps {
script {
name = "Drop unnecessary files"
// language=bash
scriptContent = """
ls -la ./
ls -la ./content/
ls -la ./content/all-libs/
dependencies {
dependency(AbsoluteId("Kotlin_BuildPlayground_Sirius_LibraryReferenceLatestDocs")) {
snapshot {
reuseBuilds = ReuseBuilds.SUCCESSFUL
onDependencyFailure = FailureAction.FAIL_TO_START
}
artifacts {
cleanDestination = true
artifactRules = "latest-version.zip"
rm ./content/all-libs/not-found-version.html
# empty pages.json
mv ./content/all-libs/scripts/pages.json ./
echo "[]" > ./content/all-libs/scripts/pages.json
""".trimIndent()
}
}

dependencies {
dependency(AbsoluteId("Kotlin_KotlinRelease_2020_LibraryReferenceLatestDocs")) {
artifacts {
buildRule = tag(tag = "publish", branch = """
+:<default>
+:*
""".trimIndent())
cleanDestination = true
artifactRules = "+:latest-version.zip!** => content/"
}
}
}
})
})
28 changes: 28 additions & 0 deletions .teamcity/builds/apiReferences/stdlib/StdlibBuildSearchIndex.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package builds.apiReferences.stdlib

import builds.apiReferences.templates.BuildApiReferenceSearchIndex
import jetbrains.buildServer.configs.kotlin.BuildType
import jetbrains.buildServer.configs.kotlin.FailureAction

object StdlibBuildSearchIndex : BuildType({
name = "Build search index for stdlib"

templates(BuildApiReferenceSearchIndex)

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

dependencies {
dependency(BuildStdlibApiReference) {
snapshot {
onDependencyFailure = FailureAction.FAIL_TO_START
onDependencyCancel = FailureAction.CANCEL
}
artifacts {
artifactRules = "+:pages.json => api-references/"
}
}
}
})
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,11 @@ object StdlibPrepareDokkaTemplates: BuildType({
name = "Prepare dokka templates for stdlib"

templates(PrepareDokkaTemplate)

params {
param("env.ALGOLIA_INDEX_NAME", "api-core")
param("env.DOKKA_NOINDEX", "true")
param("env.DOKKA_CUSTOM_BODY", "core-api")
param("env.DOKKA_FEEDBACK", "true")
}
})
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import jetbrains.buildServer.configs.kotlin.Triggers
import jetbrains.buildServer.configs.kotlin.buildSteps.GradleBuildStep
import jetbrains.buildServer.configs.kotlin.buildSteps.ScriptBuildStep
import jetbrains.buildServer.configs.kotlin.triggers.VcsTrigger
import jetbrains.buildServer.configs.kotlin.triggers.vcs

fun BuildSteps.scriptDropSnapshot(block: ScriptBuildStep.() -> Unit) = step(
ScriptBuildStep {
Expand Down Expand Up @@ -44,6 +43,7 @@ fun BuildSteps.buildDokkaHTML(block: GradleBuildStep.() -> Unit) = step(
id = "step-build-dokka-html-id"
name = "Build dokka html"
tasks = "dokkaHtmlMultiModule"
useGradleWrapper = true
}.apply(block),
)

Expand All @@ -60,7 +60,6 @@ object BuildApiReference : Template({
artifactRules = "build/dokka/htmlMultiModule/** => pages.zip"

params {
param("teamcity.vcsTrigger.runBuildInNewEmptyBranch", "true")
param("DOKKA_TEMPLATES_VERSION", DOKKA_TEMPLATES_VERSION)
}

Expand Down
Loading

0 comments on commit 44dd947

Please sign in to comment.