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
68import jetbrains.buildServer.configs.kotlin.v2019_2.Project
79import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.GradleBuildStep
10+ import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle
811
912fun 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
1621fun 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) }
0 commit comments