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.BuildType
7
- import jetbrains.buildServer.configs.kotlin.BuildTypeSettings
8
- import jetbrains.buildServer.configs.kotlin.DslContext
9
- import jetbrains.buildServer.configs.kotlin.ParameterDisplay
10
- import jetbrains.buildServer.configs.kotlin.Project
6
+ import jetbrains.buildServer.configs.kotlin.*
11
7
import jetbrains.buildServer.configs.kotlin.buildFeatures.commitStatusPublisher
12
8
import jetbrains.buildServer.configs.kotlin.buildSteps.gradle
13
9
@@ -37,12 +33,18 @@ fun Project.additionalConfiguration() {
37
33
}
38
34
39
35
deployPlugin()
36
+
37
+ // Check with Kotlin master only on Linux
38
+ buildWithKotlinMaster(Platform .Linux , knownBuilds.buildVersion).also {
39
+ knownBuilds.buildAll.dependsOnSnapshot(it, onFailure = FailureAction .ADD_PROBLEM )
40
+ }
40
41
}
41
42
42
43
const val gradlePublishKey = " gradle.publish.key"
43
44
const val gradlePublishSecret = " gradle.publish.secret"
44
45
45
46
const val DEPLOY_PUBLISH_PLUGIN_ID = " Deploy_Publish_Plugin"
47
+ const val BUILD_WITH_KOTLIN_MASTER_ID = " Build_with_Kotlin_Master_Linux"
46
48
47
49
fun Project.deployPlugin () = BuildType {
48
50
id(DEPLOY_PUBLISH_PLUGIN_ID )
@@ -81,4 +83,48 @@ fun Project.deployPlugin() = BuildType {
81
83
gradleWrapperPath = " "
82
84
}
83
85
}
86
+ }.also { buildType(it) }
87
+
88
+ fun Project.buildWithKotlinMaster (platform : Platform , versionBuild : BuildType ) = BuildType {
89
+ id(BUILD_WITH_KOTLIN_MASTER_ID )
90
+ this .name = " Build with Kotlin Master (${platform.buildTypeName()} )"
91
+
92
+ requirements {
93
+ contains(" teamcity.agent.jvm.os.name" , platform.teamcityAgentName())
94
+ }
95
+ commonConfigure()
96
+
97
+ dependsOnSnapshot(versionBuild)
98
+ params {
99
+ param(versionSuffixParameter, versionBuild.depParamRefs[versionSuffixParameter].ref)
100
+ param(teamcitySuffixParameter, versionBuild.depParamRefs[teamcitySuffixParameter].ref)
101
+ }
102
+
103
+ val kotlinVersionParameter = " dep.Kotlin_KotlinPublic_BuildNumber.deployVersion"
104
+
105
+ dependsOn(AbsoluteId (" Kotlin_KotlinPublic_Artifacts" )) {
106
+ artifacts {
107
+ buildRule = lastSuccessful()
108
+ cleanDestination = true
109
+ artifactRules = " +:maven.zip!**=>artifacts/kotlin\n " +
110
+ " +:kotlin-native-prebuilt-linux-x86_64-%$kotlinVersionParameter %.tar.gz!**=>artifacts/native"
111
+ }
112
+ }
113
+
114
+ steps {
115
+ gradle {
116
+ name = " Build and Test ${platform.buildTypeName()} Binaries"
117
+ jdkHome = " %env.$jdk %"
118
+ jvmArgs = " -Xmx1g"
119
+ tasks = " clean publishToBuildLocal check"
120
+ // --continue is needed to run tests for all targets even if one target fails
121
+ gradleParams = " --info --stacktrace -P$versionSuffixParameter =%$versionSuffixParameter % -P$teamcitySuffixParameter =%$teamcitySuffixParameter % --continue"
122
+ gradleParams + = " -Pkotlin_repo_url=file://%teamcity.build.checkoutDir%/artifacts/kotlin -Pkotlin_version=%$kotlinVersionParameter % -Pkotlin.native.version=%$kotlinVersionParameter %"
123
+ buildFile = " "
124
+ gradleWrapperPath = " "
125
+ }
126
+ }
127
+
128
+ // What files to publish as build artifacts
129
+ artifactRules = " +:build/maven=>maven\n +:build/api=>api\n +:artifacts"
84
130
}.also { buildType(it) }
0 commit comments