3
3
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file.
4
4
*/
5
5
6
+ import jetbrains.buildServer.configs.kotlin.v2019_2.BuildType
7
+ import jetbrains.buildServer.configs.kotlin.v2019_2.BuildTypeSettings
6
8
import jetbrains.buildServer.configs.kotlin.v2019_2.Project
7
9
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.GradleBuildStep
10
+ import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle
8
11
9
12
fun Project.additionalConfiguration () {
10
13
platforms.forEach { platform ->
11
14
val gradleBuild = knownBuilds.buildOn(platform).steps.items.single() as GradleBuildStep
12
15
gradleBuild.tasks + = " " + fastBenchmarkTasks(platform)
13
16
}
17
+
18
+ deployPlugin()
14
19
}
15
20
16
21
fun fastBenchmarkTasks (platform : Platform ): String {
17
22
return listOf (
18
23
" js" , " jvm" , platform.nativeTaskPrefix()
19
24
).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