From 0e2b8af627070adda5fbb2666ed369a4dacbdc80 Mon Sep 17 00:00:00 2001 From: berezinant Date: Fri, 16 Aug 2024 10:59:09 +0200 Subject: [PATCH 1/4] feat(KTL-1576): added kotlinx-io dsl configuration --- .teamcity/BuildParams.kt | 1 + .../BuildApiReferencesProject.kt | 9 +++++ .../kotlinx/io/KotlinxIOBuildApiReference.kt | 40 +++++++++++++++++++ .../kotlinx/io/KotlinxIOBuildSearchIndex.kt | 20 ++++++++++ .../io/KotlinxIOPrepareDokkaTemplates.kt | 14 +++++++ .../apiReferences/vcsRoots/KotlinxIO.kt | 18 +++++++++ 6 files changed, 102 insertions(+) create mode 100644 .teamcity/builds/apiReferences/kotlinx/io/KotlinxIOBuildApiReference.kt create mode 100644 .teamcity/builds/apiReferences/kotlinx/io/KotlinxIOBuildSearchIndex.kt create mode 100644 .teamcity/builds/apiReferences/kotlinx/io/KotlinxIOPrepareDokkaTemplates.kt create mode 100644 .teamcity/builds/apiReferences/vcsRoots/KotlinxIO.kt diff --git a/.teamcity/BuildParams.kt b/.teamcity/BuildParams.kt index 5f6eb84bd95..97ba257f1f4 100644 --- a/.teamcity/BuildParams.kt +++ b/.teamcity/BuildParams.kt @@ -4,6 +4,7 @@ object BuildParams { const val KOTLINX_COROUTINES_RELEASE_TAG = "1.9.0-RC" const val KOTLINX_SERIALIZATION_RELEASE_TAG = "v1.7.2" const val KOTLINX_DATETIME_RELEASE_TAG = "v0.6.0" + const val KOTLINX_IO_RELEASE_TAG = "0.5.2" const val KOTLIN_RELEASE_TAG = "v2.0.20" const val SEARCH_APP_ID = "7961PKYRXV" diff --git a/.teamcity/builds/apiReferences/BuildApiReferencesProject.kt b/.teamcity/builds/apiReferences/BuildApiReferencesProject.kt index 2876ea2b580..9d328b0da7f 100644 --- a/.teamcity/builds/apiReferences/BuildApiReferencesProject.kt +++ b/.teamcity/builds/apiReferences/BuildApiReferencesProject.kt @@ -6,6 +6,9 @@ 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.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 @@ -21,6 +24,7 @@ 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 jetbrains.buildServer.configs.kotlin.Project @@ -32,6 +36,10 @@ object BuildApiReferencesProject : Project({ buildType(KotlinxDatetimeBuildSearchIndex) buildType(KotlinxDatetimePrepareDokkaTemplates) + buildType(KotlinxIOBuildApiReference) + buildType(KotlinxIOBuildSearchIndex) + buildType(KotlinxIOPrepareDokkaTemplates) + buildType(KotlinxSerializationBuildApiReference) buildType(KotlinxSerializationBuildSearchIndex) buildType(KotlinxSerializationPrepareDokkaTemplates) @@ -51,6 +59,7 @@ object BuildApiReferencesProject : Project({ vcsRoot(KotlinxSerialization) vcsRoot(KotlinxCoroutines) vcsRoot(KotlinxDatetime) + vcsRoot(KotlinxIO) vcsRoot(KotlinMetadataJvm) template(PrepareDokkaTemplate) diff --git a/.teamcity/builds/apiReferences/kotlinx/io/KotlinxIOBuildApiReference.kt b/.teamcity/builds/apiReferences/kotlinx/io/KotlinxIOBuildApiReference.kt new file mode 100644 index 00000000000..ad98156f0f7 --- /dev/null +++ b/.teamcity/builds/apiReferences/kotlinx/io/KotlinxIOBuildApiReference.kt @@ -0,0 +1,40 @@ +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.scriptDropSnapshot +import jetbrains.buildServer.configs.kotlin.BuildType + +object KotlinxIOBuildApiReference : BuildType({ + name = "kotlinx-io API reference" + + templates(BuildApiReference) + + artifactRules = "core/build/dokka/html/** => pages.zip" + + params { + param("release.tag", KOTLINX_IO_RELEASE_TAG) + } + + vcs { + root(builds.apiReferences.vcsRoots.KotlinxIO) + } + + dependencies { + dependsOnDokkaTemplate(KotlinxIOPrepareDokkaTemplates, "core/dokka-templates") + } + + steps { + scriptDropSnapshot { + scriptContent = """ + #!/bin/bash + sed -i -E "s/versionSuffix=SNAPSHOT//gi" ./gradle.properties + """.trimIndent() + } + buildDokkaHTML { + tasks = ":kotlinx-io:dokkaHtmlMultiModule" + } + } +}) diff --git a/.teamcity/builds/apiReferences/kotlinx/io/KotlinxIOBuildSearchIndex.kt b/.teamcity/builds/apiReferences/kotlinx/io/KotlinxIOBuildSearchIndex.kt new file mode 100644 index 00000000000..00f7b8046f9 --- /dev/null +++ b/.teamcity/builds/apiReferences/kotlinx/io/KotlinxIOBuildSearchIndex.kt @@ -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) + } +}) diff --git a/.teamcity/builds/apiReferences/kotlinx/io/KotlinxIOPrepareDokkaTemplates.kt b/.teamcity/builds/apiReferences/kotlinx/io/KotlinxIOPrepareDokkaTemplates.kt new file mode 100644 index 00000000000..f2671d53547 --- /dev/null +++ b/.teamcity/builds/apiReferences/kotlinx/io/KotlinxIOPrepareDokkaTemplates.kt @@ -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") + } +}) diff --git a/.teamcity/builds/apiReferences/vcsRoots/KotlinxIO.kt b/.teamcity/builds/apiReferences/vcsRoots/KotlinxIO.kt new file mode 100644 index 00000000000..0263e439121 --- /dev/null +++ b/.teamcity/builds/apiReferences/vcsRoots/KotlinxIO.kt @@ -0,0 +1,18 @@ +package builds.apiReferences.vcsRoots + +import BuildParams.KOTLINX_IO_RELEASE_TAG +import jetbrains.buildServer.configs.kotlin.vcs.GitVcsRoot + +object KotlinxIO : GitVcsRoot({ + name = "kotlinx-io vcs root" + url = "git@github.com:Kotlin/kotlinx-io.git" + branch = "refs/tags/$KOTLINX_IO_RELEASE_TAG" + branchSpec = """ + +:refs/heads/(*) + +:refs/tags/(*) + """.trimIndent() + useTagsAsBranches = true + authMethod = uploadedKey { + uploadedKey = "teamcity" + } +}) From 8cc0a6656e2af9df0b0de34e787bc3af7db3b319 Mon Sep 17 00:00:00 2001 From: berezinant Date: Fri, 16 Aug 2024 11:39:49 +0200 Subject: [PATCH 2/4] fix(ktl-1576): run dokka for kotlinx-io --- .../kotlinx/io/KotlinxIOBuildApiReference.kt | 24 ++++++++++++++----- .../templates/BuildApiReference.kt | 1 + 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.teamcity/builds/apiReferences/kotlinx/io/KotlinxIOBuildApiReference.kt b/.teamcity/builds/apiReferences/kotlinx/io/KotlinxIOBuildApiReference.kt index ad98156f0f7..e5af10e060d 100644 --- a/.teamcity/builds/apiReferences/kotlinx/io/KotlinxIOBuildApiReference.kt +++ b/.teamcity/builds/apiReferences/kotlinx/io/KotlinxIOBuildApiReference.kt @@ -4,15 +4,17 @@ 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 = "core/build/dokka/html/** => pages.zip" + artifactRules = "build/dokka/htmlMultiModule/** => pages.zip" params { param("release.tag", KOTLINX_IO_RELEASE_TAG) @@ -28,13 +30,23 @@ object KotlinxIOBuildApiReference : BuildType({ steps { scriptDropSnapshot { - scriptContent = """ - #!/bin/bash - sed -i -E "s/versionSuffix=SNAPSHOT//gi" ./gradle.properties - """.trimIndent() + enabled = false // TODO readme, and disable this step for other libs too + } + scriptDokkaVersionSync { + enabled = false // TODO readme, and disable this step for other libs too } buildDokkaHTML { - tasks = ":kotlinx-io:dokkaHtmlMultiModule" + 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() } } }) diff --git a/.teamcity/builds/apiReferences/templates/BuildApiReference.kt b/.teamcity/builds/apiReferences/templates/BuildApiReference.kt index 6274e2da47b..d223cf2522a 100644 --- a/.teamcity/builds/apiReferences/templates/BuildApiReference.kt +++ b/.teamcity/builds/apiReferences/templates/BuildApiReference.kt @@ -43,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), ) From 67f7cbc287a133038e6be52bfe3baa22b4a206f4 Mon Sep 17 00:00:00 2001 From: berezinant Date: Fri, 23 Aug 2024 10:55:08 +0200 Subject: [PATCH 3/4] feat(KTL-1576): temporary switch kotlinx-io dsl configuration to branch --- .teamcity/builds/apiReferences/vcsRoots/KotlinxIO.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.teamcity/builds/apiReferences/vcsRoots/KotlinxIO.kt b/.teamcity/builds/apiReferences/vcsRoots/KotlinxIO.kt index 0263e439121..2c98e05766c 100644 --- a/.teamcity/builds/apiReferences/vcsRoots/KotlinxIO.kt +++ b/.teamcity/builds/apiReferences/vcsRoots/KotlinxIO.kt @@ -6,7 +6,7 @@ import jetbrains.buildServer.configs.kotlin.vcs.GitVcsRoot object KotlinxIO : GitVcsRoot({ name = "kotlinx-io vcs root" url = "git@github.com:Kotlin/kotlinx-io.git" - branch = "refs/tags/$KOTLINX_IO_RELEASE_TAG" + branch = "refs/heads/ktl-1576-kotlinlang-api-ref" branchSpec = """ +:refs/heads/(*) +:refs/tags/(*) From daae112012828ffaa147bae76aa72ab130cd0d0d Mon Sep 17 00:00:00 2001 From: berezinant Date: Tue, 27 Aug 2024 21:52:30 +0200 Subject: [PATCH 4/4] fix(ktl-1576): fix path for dokka templates for kotlinx-io --- .../apiReferences/kotlinx/io/KotlinxIOBuildApiReference.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.teamcity/builds/apiReferences/kotlinx/io/KotlinxIOBuildApiReference.kt b/.teamcity/builds/apiReferences/kotlinx/io/KotlinxIOBuildApiReference.kt index e5af10e060d..2ada2d9c956 100644 --- a/.teamcity/builds/apiReferences/kotlinx/io/KotlinxIOBuildApiReference.kt +++ b/.teamcity/builds/apiReferences/kotlinx/io/KotlinxIOBuildApiReference.kt @@ -25,7 +25,7 @@ object KotlinxIOBuildApiReference : BuildType({ } dependencies { - dependsOnDokkaTemplate(KotlinxIOPrepareDokkaTemplates, "core/dokka-templates") + dependsOnDokkaTemplate(KotlinxIOPrepareDokkaTemplates) } steps {