@@ -13,9 +13,22 @@ const {dependencies, platforms} = require('./configuration');
13
13
const yargs = require ( 'yargs' ) ;
14
14
15
15
/*::
16
- import type {Dependency, Platform} from './types';
16
+ import type {Dependency, Destination, Platform} from './types';
17
17
*/
18
18
19
+ // CI can't use commas in cache keys, so 'macOS,variant=Mac Catalyst' was creating troubles
20
+ // This map that converts from platforms to valid Xcodebuild destinations.
21
+ const platformToDestination /*: $ReadOnly<{|[Platform]: Destination|}> */ = {
22
+ ios : 'iOS' ,
23
+ 'ios-simulator' : 'iOS Simulator' ,
24
+ macos : 'macOS' ,
25
+ 'mac-catalyst' : 'macOS,variant=Mac Catalyst' ,
26
+ tvos : 'tvOS' ,
27
+ 'tvos-simulator' : 'tvOS Simulator' ,
28
+ xros : 'visionOS' ,
29
+ 'xros-simulator' : 'visionOS Simulator' ,
30
+ } ;
31
+
19
32
const arrayLike = ( value /*: Array<any> */ ) /*: Array<any> */ =>
20
33
Array . isArray ( value ) ? value : [ value ] ;
21
34
@@ -74,7 +87,7 @@ async function getCLIConfiguration() /*: Promise<?{|
74
87
build: boolean,
75
88
compose: boolean,
76
89
|},
77
- platforms : $ReadOnlyArray<Platform >,
90
+ destinations : $ReadOnlyArray<Destination >,
78
91
dependencies: $ReadOnlyArray<Dependency>,
79
92
configuration: string,
80
93
|}> */ {
@@ -102,7 +115,9 @@ async function getCLIConfiguration() /*: Promise<?{|
102
115
}
103
116
104
117
// Prepare platforms and dependencies
105
- const resolvedPlatforms = platforms . filter ( p => argv . platforms . includes ( p ) ) ;
118
+ const resolvedPlatforms = platforms
119
+ . filter ( p => argv . platforms . includes ( p ) )
120
+ . map ( p => platformToDestination [ p ] ) ;
106
121
const resolvedDependencies = dependencies . filter ( d =>
107
122
argv . dependencies . includes ( d . name ) ,
108
123
) ;
@@ -121,7 +136,7 @@ async function getCLIConfiguration() /*: Promise<?{|
121
136
build : runAllCommands || argv . build != null ,
122
137
compose : runAllCommands || argv . compose != null ,
123
138
} ,
124
- platforms : resolvedPlatforms ,
139
+ destinations : resolvedPlatforms ,
125
140
dependencies : resolvedDependencies ,
126
141
configuration : argv . configuration ,
127
142
} ;
0 commit comments