Skip to content

Commit 6ca2c55

Browse files
Abduqodiri Qurbonzodaqurbonzoda
authored andcommitted
Implement option to publish only to space or sonatype repository
1 parent 1aeb7be commit 6ca2c55

File tree

4 files changed

+30
-20
lines changed

4 files changed

+30
-20
lines changed

.teamcity/additionalConfiguration.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import jetbrains.buildServer.configs.kotlin.v2019_2.BuildType
77
import jetbrains.buildServer.configs.kotlin.v2019_2.BuildTypeSettings
8+
import jetbrains.buildServer.configs.kotlin.v2019_2.ParameterDisplay
89
import jetbrains.buildServer.configs.kotlin.v2019_2.Project
910
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.GradleBuildStep
1011
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle
@@ -14,6 +15,9 @@ fun Project.additionalConfiguration() {
1415
val gradleBuild = knownBuilds.buildOn(platform).steps.items.single() as GradleBuildStep
1516
gradleBuild.tasks += " " + "fastBenchmark"
1617

18+
knownBuilds.deployPublish.params {
19+
select("reverse.dep.*.system.publication_repository", "space", display = ParameterDisplay.PROMPT, label = "Publication Repository", options = listOf("space", "sonatype"))
20+
}
1721
knownBuilds.deployOn(platform).params {
1822
param("system.space.user", "abduqodiri.qurbonzoda")
1923
password("system.space.token", "credentialsJSON:7aa03210-1f86-452e-b786-920f8a321b7d")

build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ infra {
2121
include(":kotlinx-benchmark-runtime")
2222

2323
libraryRepoUrl = "https://github.com/Kotlin/kotlinx-benchmark"
24-
sonatype {}
24+
25+
if (project.findProperty("publication_repository") == "sonatype") {
26+
sonatype {}
27+
}
2528
}
2629
}
2730

plugin/build.gradle

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,17 @@ task createClasspathManifest {
118118
}
119119

120120

121-
// publish to Space repository
122-
publishing {
123-
repositories {
124-
maven {
125-
name = "space"
126-
url = "https://maven.pkg.jetbrains.space/kotlin/p/kotlinx/dev"
127-
credentials {
128-
username = project.findProperty("space.user")
129-
password = project.findProperty("space.token")
121+
if (project.findProperty("publication_repository") == "space") {
122+
// publish to Space repository
123+
publishing {
124+
repositories {
125+
maven {
126+
name = "space"
127+
url = "https://maven.pkg.jetbrains.space/kotlin/p/kotlinx/dev"
128+
credentials {
129+
username = project.findProperty("space.user")
130+
password = project.findProperty("space.token")
131+
}
130132
}
131133
}
132134
}

runtime/build.gradle

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,17 @@ kotlin {
8383
}
8484
}
8585

86-
87-
// publish to Space repository
88-
publishing {
89-
repositories {
90-
maven {
91-
name = "space"
92-
url = "https://maven.pkg.jetbrains.space/kotlin/p/kotlinx/dev"
93-
credentials {
94-
username = project.findProperty("space.user")
95-
password = project.findProperty("space.token")
86+
if (project.findProperty("publication_repository") == "space") {
87+
// publish to Space repository
88+
publishing {
89+
repositories {
90+
maven {
91+
name = "space"
92+
url = "https://maven.pkg.jetbrains.space/kotlin/p/kotlinx/dev"
93+
credentials {
94+
username = project.findProperty("space.user")
95+
password = project.findProperty("space.token")
96+
}
9697
}
9798
}
9899
}

0 commit comments

Comments
 (0)