@@ -14,15 +14,33 @@ fun benchmarksProject() = Project {
14
14
this .id(" Benchmarks" )
15
15
this .name = " Benchmarks"
16
16
17
+ val benchmarkAll = benchmarkAll()
17
18
val benchmarks = listOf (
18
19
benchmark(" js" , " Linux" ),
19
20
benchmark(" jvm" , " Linux" ),
20
21
* platforms.map { benchmark(" native" , it) }.toTypedArray()
21
22
)
22
23
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())
24
34
}
25
35
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
+
26
44
fun Project.benchmark (target : String , platform : String ) = platform(platform, " ${target} Benchmark" ) {
27
45
steps {
28
46
gradle {
@@ -62,6 +80,21 @@ fun Requirements.benchmarkAgentInstanceTypeRequirement(platform: String) {
62
80
else if (platform == " Windows" ) equals(" system.ec2.instance-type" , " m5.xlarge" )
63
81
}
64
82
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
+
65
98
fun Project.platform (platform : String , name : String , configure : BuildType .() -> Unit ) = BuildType {
66
99
// ID is prepended with Project ID, so don't repeat it here
67
100
// ID should conform to identifier rules, so just letters, numbers and underscore
0 commit comments