Skip to content

Commit 478be83

Browse files
author
Abduqodiri Qurbonzoda
committed
Add benchmarkAll build configuration
1 parent 48917ca commit 478be83

File tree

2 files changed

+34
-16
lines changed

2 files changed

+34
-16
lines changed

.teamcity/Benchmarks.kt

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,33 @@ fun benchmarksProject() = Project {
1414
this.id("Benchmarks")
1515
this.name = "Benchmarks"
1616

17+
val benchmarkAll = benchmarkAll()
1718
val benchmarks = listOf(
1819
benchmark("js", "Linux"),
1920
benchmark("jvm", "Linux"),
2021
*platforms.map { benchmark("native", it) }.toTypedArray()
2122
)
2223

23-
buildTypesOrder = benchmarks
24+
benchmarks.forEach { benchmark ->
25+
benchmarkAll.dependsOnSnapshot(benchmark, onFailure = FailureAction.ADD_PROBLEM)
26+
benchmarkAll.dependsOn(benchmark) {
27+
artifacts {
28+
artifactRules = "+:reports=>reports"
29+
}
30+
}
31+
}
32+
33+
buildTypesOrder = listOf(benchmarkAll, *benchmarks.toTypedArray())
2434
}
2535

36+
fun Project.benchmarkAll() = BuildType {
37+
id("Benchmark_All")
38+
this.name = "Benchmark (All)"
39+
type = BuildTypeSettings.Type.COMPOSITE
40+
41+
commonConfigure()
42+
}.also { buildType(it) }
43+
2644
fun Project.benchmark(target: String, platform: String) = platform(platform, "${target}Benchmark") {
2745
steps {
2846
gradle {
@@ -62,6 +80,21 @@ fun Requirements.benchmarkAgentInstanceTypeRequirement(platform: String) {
6280
else if (platform == "Windows") equals("system.ec2.instance-type", "m5.xlarge")
6381
}
6482

83+
fun BuildType.dependsOn(build: BuildType, configure: Dependency.() -> Unit) =
84+
apply {
85+
dependencies.dependency(build, configure)
86+
}
87+
88+
fun BuildType.dependsOnSnapshot(build: BuildType, onFailure: FailureAction = FailureAction.FAIL_TO_START, configure: SnapshotDependency.() -> Unit = {}) = apply {
89+
dependencies.dependency(build) {
90+
snapshot {
91+
configure()
92+
onDependencyFailure = onFailure
93+
onDependencyCancel = FailureAction.CANCEL
94+
}
95+
}
96+
}
97+
6598
fun Project.platform(platform: String, name: String, configure: BuildType.() -> Unit) = BuildType {
6699
// ID is prepended with Project ID, so don't repeat it here
67100
// ID should conform to identifier rules, so just letters, numbers and underscore

.teamcity/settings.kts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -139,21 +139,6 @@ fun Project.build(platform: String, versionBuild: BuildType) = platform(platform
139139
artifactRules = "+:build/maven=>maven\n+:build/api=>api"
140140
}
141141

142-
fun BuildType.dependsOn(build: BuildType, configure: Dependency.() -> Unit) =
143-
apply {
144-
dependencies.dependency(build, configure)
145-
}
146-
147-
fun BuildType.dependsOnSnapshot(build: BuildType, onFailure: FailureAction = FailureAction.FAIL_TO_START, configure: SnapshotDependency.() -> Unit = {}) = apply {
148-
dependencies.dependency(build) {
149-
snapshot {
150-
configure()
151-
onDependencyFailure = onFailure
152-
onDependencyCancel = FailureAction.CANCEL
153-
}
154-
}
155-
}
156-
157142
fun Project.deployConfigure() = BuildType {
158143
id("Deploy_Configure")
159144
this.name = "Deploy (Configure Version)"

0 commit comments

Comments
 (0)