@@ -25,15 +25,6 @@ To debug in IntelliJ Idea, open the 'Maven Projects' tool window (View
25
25
*/
26
26
27
27
version = " 2018.2"
28
- val versionSuffixParameter = " versionSuffix"
29
- val teamcitySuffixParameter = " teamcitySuffix"
30
- val releaseVersionParameter = " releaseVersion"
31
-
32
- val bintrayUserName = " <<BINTRAY_USER>>"
33
- val bintrayToken = " <<BINTRAY_TOKEN>>"
34
-
35
- val platforms = listOf (" Windows" , " Linux" , " Mac OS X" )
36
- val jdk = " <<JDK>>"
37
28
38
29
project {
39
30
// Disable editing of project and build settings from the UI to avoid issues with TeamCity
@@ -109,7 +100,7 @@ fun Project.buildAll(versionBuild: BuildType) = BuildType {
109
100
commonConfigure()
110
101
}.also { buildType(it) }
111
102
112
- fun Project.build (platform : String , versionBuild : BuildType ) = platform(platform, " Build" ) {
103
+ fun Project.build (platform : Platform , versionBuild : BuildType ) = buildType( " Build" , platform ) {
113
104
114
105
dependsOnSnapshot(versionBuild)
115
106
@@ -120,7 +111,7 @@ fun Project.build(platform: String, versionBuild: BuildType) = platform(platform
120
111
121
112
steps {
122
113
gradle {
123
- name = " Build and Test $platform Binaries"
114
+ name = " Build and Test ${ platform.buildTypeName()} Binaries"
124
115
jdkHome = " %env.$jdk %"
125
116
jvmArgs = " -Xmx1g"
126
117
tasks = " clean publishToBuildLocal check"
@@ -135,21 +126,6 @@ fun Project.build(platform: String, versionBuild: BuildType) = platform(platform
135
126
artifactRules = " +:build/maven=>maven\n +:build/api=>api"
136
127
}
137
128
138
- fun BuildType.dependsOn (build : BuildType , configure : Dependency .() -> Unit ) =
139
- apply {
140
- dependencies.dependency(build, configure)
141
- }
142
-
143
- fun BuildType.dependsOnSnapshot (build : BuildType , onFailure : FailureAction = FailureAction .FAIL_TO_START , configure : SnapshotDependency .() -> Unit = {}) = apply {
144
- dependencies.dependency(build) {
145
- snapshot {
146
- configure()
147
- onDependencyFailure = onFailure
148
- onDependencyCancel = FailureAction .CANCEL
149
- }
150
- }
151
- }
152
-
153
129
fun Project.deployConfigure () = BuildType {
154
130
id(" Deploy_Configure" )
155
131
this .name = " Deploy (Configure Version)"
@@ -194,7 +170,7 @@ fun Project.deployPublish(configureBuild: BuildType) = BuildType {
194
170
}.also { buildType(it) }
195
171
196
172
197
- fun Project.deploy (platform : String , configureBuild : BuildType ) = platform(platform, " Deploy" ) {
173
+ fun Project.deploy (platform : Platform , configureBuild : BuildType ) = buildType( " Deploy" , platform ) {
198
174
type = BuildTypeSettings .Type .DEPLOYMENT
199
175
enablePersonalBuilds = false
200
176
maxRunningBuilds = 1
@@ -211,7 +187,7 @@ fun Project.deploy(platform: String, configureBuild: BuildType) = platform(platf
211
187
212
188
steps {
213
189
gradle {
214
- name = " Deploy $platform Binaries"
190
+ name = " Deploy ${ platform.buildTypeName()} Binaries"
215
191
jdkHome = " %env.$jdk %"
216
192
jvmArgs = " -Xmx1g"
217
193
gradleParams = " --info --stacktrace -P$versionSuffixParameter =%$versionSuffixParameter % -P$releaseVersionParameter =%$releaseVersionParameter % -PbintrayApiKey=%bintray-key% -PbintrayUser=%bintray-user%"
@@ -221,53 +197,3 @@ fun Project.deploy(platform: String, configureBuild: BuildType) = platform(platf
221
197
}
222
198
}
223
199
}.dependsOnSnapshot(configureBuild)
224
-
225
- fun Project.platform (platform : String , name : String , configure : BuildType .() -> Unit ) = BuildType {
226
- // ID is prepended with Project ID, so don't repeat it here
227
- // ID should conform to identifier rules, so just letters, numbers and underscore
228
- id(" ${name} _${platform.substringBefore(" " )} " )
229
- // Display name of the build configuration
230
- this .name = " $name ($platform )"
231
-
232
- requirements {
233
- contains(" teamcity.agent.jvm.os.name" , platform)
234
- }
235
-
236
- params {
237
- // This parameter is needed for macOS agent to be compatible
238
- if (platform.startsWith(" Mac" )) param(" env.JDK_17" , " " )
239
- }
240
-
241
- commonConfigure()
242
- configure()
243
- }.also { buildType(it) }
244
-
245
-
246
- fun BuildType.commonConfigure () {
247
- requirements {
248
- noLessThan(" teamcity.agent.hardware.memorySizeMb" , " 6144" )
249
- }
250
-
251
- // Allow to fetch build status through API for badges
252
- allowExternalStatus = true
253
-
254
- // Configure VCS, by default use the same and only VCS root from which this configuration is fetched
255
- vcs {
256
- root(DslContext .settingsRoot)
257
- showDependenciesChanges = true
258
- checkoutMode = CheckoutMode .ON_AGENT
259
- }
260
-
261
- failureConditions {
262
- errorMessage = true
263
- nonZeroExitCode = true
264
- executionTimeoutMin = 120
265
- }
266
-
267
- features {
268
- feature {
269
- id = " perfmon"
270
- type = " perfmon"
271
- }
272
- }
273
- }
0 commit comments