Skip to content

Commit 9dbbc2a

Browse files
author
Abduqodiri Qurbonzoda
committed
Add deploy plugin configuration
1 parent ac44fd9 commit 9dbbc2a

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

.teamcity/additionalConfiguration.kt

+41-1
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,58 @@
33
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file.
44
*/
55

6+
import jetbrains.buildServer.configs.kotlin.v2019_2.BuildType
7+
import jetbrains.buildServer.configs.kotlin.v2019_2.BuildTypeSettings
68
import jetbrains.buildServer.configs.kotlin.v2019_2.Project
79
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.GradleBuildStep
10+
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle
811

912
fun Project.additionalConfiguration() {
1013
platforms.forEach { platform ->
1114
val gradleBuild = knownBuilds.buildOn(platform).steps.items.single() as GradleBuildStep
1215
gradleBuild.tasks += " " + fastBenchmarkTasks(platform)
1316
}
17+
18+
deployPlugin()
1419
}
1520

1621
fun fastBenchmarkTasks(platform: Platform): String {
1722
return listOf(
1823
"js", "jvm", platform.nativeTaskPrefix()
1924
).joinToString(separator = " ", transform = { "${it}FastBenchmark" })
20-
}
25+
}
26+
27+
const val gradlePublishKey = "gradle.publish.key"
28+
const val gradlePublishSecret = "gradle.publish.secret"
29+
30+
const val DEPLOY_PUBLISH_PLUGIN_ID = "Deploy_Publish_Plugin"
31+
32+
fun Project.deployPlugin() = BuildType {
33+
id(DEPLOY_PUBLISH_PLUGIN_ID)
34+
this.name = "Deploy (Publish Plugin)"
35+
commonConfigure()
36+
37+
requirements {
38+
// Require Linux for publishPlugins
39+
contains("teamcity.agent.jvm.os.name", "Linux")
40+
}
41+
42+
dependsOnSnapshot(this@deployPlugin.knownBuilds.buildAll)
43+
buildNumberPattern = this@deployPlugin.knownBuilds.buildVersion.depParamRefs.buildNumber.ref
44+
45+
type = BuildTypeSettings.Type.DEPLOYMENT
46+
enablePersonalBuilds = false
47+
maxRunningBuilds = 1
48+
49+
steps {
50+
gradle {
51+
name = "Publish Plugin"
52+
jdkHome = "%env.$jdk%"
53+
jvmArgs = "-Xmx1g"
54+
gradleParams = "--info --stacktrace -P$gradlePublishKey=%$gradlePublishKey% -P$gradlePublishSecret=%$gradlePublishSecret%"
55+
tasks = "clean :plugin:publishPlugins"
56+
buildFile = ""
57+
gradleWrapperPath = ""
58+
}
59+
}
60+
}.also { buildType(it) }

plugin/build.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ buildscript {
1212

1313
plugins {
1414
id 'java-gradle-plugin'
15+
id 'maven-publish'
16+
id 'com.gradle.plugin-publish' version '0.12.0'
1517
}
1618

1719
apply plugin: 'org.jetbrains.kotlin.jvm'
@@ -33,6 +35,12 @@ repositories {
3335
gradlePluginPortal()
3436
}
3537

38+
pluginBundle {
39+
website = 'https://github.com/Kotlin/kotlinx-benchmark'
40+
vcsUrl = 'https://github.com/Kotlin/kotlinx-benchmark.git'
41+
tags = ['benchmarking', 'multiplatform', 'kotlin']
42+
}
43+
3644
gradlePlugin {
3745
plugins {
3846
benchmarkPlugin {

0 commit comments

Comments
 (0)