Skip to content

Commit

Permalink
Merge pull request #4377 from JetBrains/ktl-1576-kotlin-io-api-ref
Browse files Browse the repository at this point in the history
feat(KTL-1576): added kotlinx-io dsl configuration
  • Loading branch information
zoobestik authored Sep 11, 2024
2 parents 286e8d1 + daae112 commit f235568
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 0 deletions.
1 change: 1 addition & 0 deletions .teamcity/BuildParams.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 9 additions & 0 deletions .teamcity/builds/apiReferences/BuildApiReferencesProject.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

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

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

buildType(KotlinxSerializationBuildApiReference)
buildType(KotlinxSerializationBuildSearchIndex)
buildType(KotlinxSerializationPrepareDokkaTemplates)
Expand All @@ -51,6 +59,7 @@ object BuildApiReferencesProject : Project({
vcsRoot(KotlinxSerialization)
vcsRoot(KotlinxCoroutines)
vcsRoot(KotlinxDatetime)
vcsRoot(KotlinxIO)
vcsRoot(KotlinMetadataJvm)

template(PrepareDokkaTemplate)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
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 {
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 {
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
Expand Up @@ -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),
)

Expand Down
18 changes: 18 additions & 0 deletions .teamcity/builds/apiReferences/vcsRoots/KotlinxIO.kt
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]:Kotlin/kotlinx-io.git"
branch = "refs/heads/ktl-1576-kotlinlang-api-ref"
branchSpec = """
+:refs/heads/(*)
+:refs/tags/(*)
""".trimIndent()
useTagsAsBranches = true
authMethod = uploadedKey {
uploadedKey = "teamcity"
}
})

0 comments on commit f235568

Please sign in to comment.