@@ -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+
2644fun 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+
6598fun 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
0 commit comments