@@ -17,20 +17,36 @@ val platforms = Platform.values()
17
17
const val jdk = " JDK_18_x64"
18
18
19
19
enum class Platform {
20
- Windows , Linux , MacOS ;
20
+ Windows , Linux , MacOSX64 , MacosArm64 ;
21
21
}
22
22
23
23
fun Platform.nativeTaskPrefix (): String = when (this ) {
24
24
Platform .Windows -> " mingwX64"
25
25
Platform .Linux -> " linuxX64"
26
- Platform .MacOS -> " macosX64"
26
+ Platform .MacOSX64 -> " macosX64"
27
+ Platform .MacosArm64 -> " macosArm64"
28
+
27
29
}
28
30
fun Platform.buildTypeName (): String = when (this ) {
29
31
Platform .Windows , Platform .Linux -> name
30
- Platform .MacOS -> " Mac OS X"
32
+ Platform .MacOSX64 -> " Mac OS X64"
33
+ Platform .MacosArm64 -> " Mac OS Arm64"
34
+ }
35
+
36
+ fun Platform.expectedArch (): String? = when (this ) {
37
+ Platform .Windows , Platform .Linux -> null
38
+ Platform .MacOSX64 -> " x86_64"
39
+ Platform .MacosArm64 -> " aarch64"
40
+ }
41
+
42
+ fun Platform.buildTypeId (): String = when (this ) {
43
+ Platform .MacosArm64 -> buildTypeName().replace(" " , " _" )
44
+ else -> osName()
31
45
}
32
- fun Platform.buildTypeId (): String = buildTypeName().substringBefore(" " )
33
- fun Platform.teamcityAgentName (): String = buildTypeName()
46
+
47
+ fun Platform.osName (): String = buildTypeName().substringBefore(" " )
48
+
49
+ fun Platform.teamcityAgentName (): String = osName()
34
50
35
51
36
52
const val BUILD_CONFIGURE_VERSION_ID = " Build_Version"
@@ -65,11 +81,14 @@ fun Project.buildType(name: String, platform: Platform, configure: BuildType.()
65
81
66
82
requirements {
67
83
contains(" teamcity.agent.jvm.os.name" , platform.teamcityAgentName())
84
+ platform.expectedArch()?.let {
85
+ contains(" teamcity.agent.jvm.os.arch" , it)
86
+ }
68
87
}
69
88
70
89
params {
71
90
// This parameter is needed for macOS agent to be compatible
72
- if (platform == Platform .MacOS ) param(" env.JDK_17" , " " )
91
+ if (platform == Platform .MacOSX64 ) param(" env.JDK_17" , " " )
73
92
}
74
93
75
94
commonConfigure()
0 commit comments