@@ -143,67 +143,43 @@ fun Project.build(platform: String, versionBuild: BuildType) = platform(platform
143
143
artifactRules = " +:build/maven=>maven\n +:build/api=>api"
144
144
}
145
145
146
- fun Project.benchmark (target : String , platform : String ) = BuildType {
147
- // ID is prepended with Project ID, so don't repeat it here
148
- // ID should conform to identifier rules, so just letters, numbers and underscore
149
- id(" ${target} Benchmark_${platform.substringBefore(" " )} " )
150
- // Display name of the build configuration
151
- this .name = " ${target} Benchmark ($platform )"
152
-
146
+ fun Project.benchmark (target : String , platform : String ) = platform(platform, " ${target} Benchmark" ) {
153
147
steps {
154
148
gradle {
155
149
name = " Benchmark"
156
- tasks = " ${ if (target == " native " ) nativeTarget( platform) else target} Benchmark "
150
+ tasks = benchmarkTask (target, platform)
157
151
jdkHome = " %env.$jdk %"
158
152
param(" org.jfrog.artifactory.selectedDeployableServer.defaultModuleVersionConfiguration" , " GLOBAL" )
159
153
buildFile = " "
160
154
gradleWrapperPath = " "
161
155
}
162
156
}
163
157
164
- // What files to publish as build artifacts
165
158
artifactRules = " benchmarks/build/reports/**=> reports"
166
159
167
160
requirements {
168
- equals(" system.ec2.instance-type" , " m5d.xlarge" )
169
- contains(" teamcity.agent.jvm.os.name" , platform)
170
- noLessThan(" teamcity.agent.hardware.memorySizeMb" , " 6144" )
171
- }
172
-
173
- params {
174
- // This parameter is needed for macOS agent to be compatible
175
- if (platform.startsWith(" Mac" )) param(" env.JDK_17" , " " )
176
- }
177
-
178
- // Allow to fetch build status through API for badges
179
- allowExternalStatus = true
180
-
181
- // Configure VCS, by default use the same and only VCS root from which this configuration is fetched
182
- vcs {
183
- root(DslContext .settingsRoot)
184
- showDependenciesChanges = true
185
- checkoutMode = CheckoutMode .ON_AGENT
161
+ benchmarkAgentInstanceTypeRequirement(platform)
186
162
}
187
163
188
164
failureConditions {
189
- errorMessage = true
190
- nonZeroExitCode = true
191
165
executionTimeoutMin = 1440
192
166
}
167
+ }
193
168
194
- features {
195
- feature {
196
- id = " perfmon"
197
- type = " perfmon"
198
- }
169
+ fun benchmarkTask (target : String , platform : String ): String = when (target) {
170
+ " js" , " jvm" -> " ${target} Benchmark"
171
+ " native" -> when (platform) {
172
+ " Mac OS X" -> " macosX64Benchmark"
173
+ " Linux" -> " linuxX64Benchmark"
174
+ " Windows" -> " mingwX64Benchmark"
175
+ else -> throw IllegalArgumentException (" Unknown platform: $platform " )
199
176
}
200
- }.also { buildType(it) }
177
+ else -> throw IllegalArgumentException (" Unknown target: $target " )
178
+ }
201
179
202
- fun nativeTarget (platform : String ): String = when (platform) {
203
- " Mac OS X" -> " macosX64"
204
- " Linux" -> " linuxX64"
205
- " Windows" -> " mingwX64"
206
- else -> throw IllegalArgumentException (" Unknown platform: $platform " )
180
+ fun Requirements.benchmarkAgentInstanceTypeRequirement (platform : String ) {
181
+ if (platform == " Linux" ) equals(" system.ec2.instance-type" , " m5d.xlarge" )
182
+ else if (platform == " Windows" ) equals(" system.ec2.instance-type" , " m5.xlarge" )
207
183
}
208
184
209
185
fun BuildType.dependsOn (build : BuildType , configure : Dependency .() -> Unit ) =
0 commit comments