@@ -31,32 +31,31 @@ describe('build', function () {
31
31
32
32
it ( 'should generate appropriate args if a single buildFlag is passed in' , function ( done ) {
33
33
var isDevice = true ;
34
- var buildFlags = '-xcconfig TestXcconfigFlag ' ;
34
+ var buildFlags = '' ;
35
35
36
36
var args = getXcodeBuildArgs ( 'TestProjectName' , testProjectPath , 'TestConfiguration' , isDevice , buildFlags ) ;
37
- expect ( args [ 0 ] ) . toEqual ( '-xcconfig' ) ;
38
- expect ( args [ 1 ] ) . toEqual ( 'TestXcconfigFlag' ) ;
39
- expect ( args [ 2 ] ) . toEqual ( '-workspace' ) ;
40
- expect ( args [ 3 ] ) . toEqual ( 'TestProjectName.xcworkspace' ) ;
41
- expect ( args [ 4 ] ) . toEqual ( '-scheme' ) ;
42
- expect ( args [ 5 ] ) . toEqual ( 'TestProjectName' ) ;
43
- expect ( args [ 6 ] ) . toEqual ( '-configuration' ) ;
44
- expect ( args [ 7 ] ) . toEqual ( 'TestConfiguration' ) ;
45
- expect ( args [ 8 ] ) . toEqual ( '-destination' ) ;
46
- expect ( args [ 9 ] ) . toEqual ( 'generic/platform=iOS' ) ;
47
- expect ( args [ 10 ] ) . toEqual ( '-archivePath' ) ;
48
- expect ( args [ 11 ] ) . toEqual ( 'TestProjectName.xcarchive' ) ;
49
- expect ( args [ 12 ] ) . toEqual ( 'archive' ) ;
50
- expect ( args [ 13 ] ) . toEqual ( 'CONFIGURATION_BUILD_DIR =' + path . join ( testProjectPath , 'build' , 'device' ) ) ;
51
- expect ( args [ 14 ] ) . toEqual ( 'SHARED_PRECOMPS_DIR=' + path . join ( testProjectPath , 'build' , 'sharedpch' ) ) ;
52
- expect ( args . length ) . toEqual ( 15 ) ;
37
+ expect ( args ) . toEqual ( [
38
+ '-workspace' ,
39
+ 'TestProjectName.xcworkspace' ,
40
+ '-scheme' ,
41
+ 'TestProjectName' ,
42
+ '-configuration' ,
43
+ 'TestConfiguration' ,
44
+ '-destination' ,
45
+ 'generic/platform=iOS' ,
46
+ '-archivePath' ,
47
+ 'TestProjectName.xcarchive' ,
48
+ 'archive' ,
49
+ 'CONFIGURATION_BUILD_DIR=' + path . join ( testProjectPath , 'build' , 'device' ) ,
50
+ 'SHARED_PRECOMPS_DIR =' + path . join ( testProjectPath , 'build' , 'sharedpch' )
51
+ ] ) ;
52
+ expect ( args . length ) . toEqual ( 13 ) ;
53
53
done ( ) ;
54
54
} ) ;
55
55
56
56
it ( 'should generate appropriate args if buildFlags are passed in' , function ( done ) {
57
57
var isDevice = true ;
58
58
var buildFlags = [
59
- '-xcconfig TestXcconfigFlag' ,
60
59
'-workspace TestWorkspaceFlag' ,
61
60
'-scheme TestSchemeFlag' ,
62
61
'-configuration TestConfigurationFlag' ,
@@ -67,66 +66,66 @@ describe('build', function () {
67
66
] ;
68
67
69
68
var args = getXcodeBuildArgs ( 'TestProjectName' , testProjectPath , 'TestConfiguration' , isDevice , buildFlags ) ;
70
- expect ( args [ 0 ] ) . toEqual ( '-xcconfig' ) ;
71
- expect ( args [ 1 ] ) . toEqual ( 'TestXcconfigFlag' ) ;
72
- expect ( args [ 2 ] ) . toEqual ( '-workspace' ) ;
73
- expect ( args [ 3 ] ) . toEqual ( 'TestWorkspaceFlag' ) ;
74
- expect ( args [ 4 ] ) . toEqual ( '-scheme' ) ;
75
- expect ( args [ 5 ] ) . toEqual ( 'TestSchemeFlag' ) ;
76
- expect ( args [ 6 ] ) . toEqual ( '-configuration' ) ;
77
- expect ( args [ 7 ] ) . toEqual ( 'TestConfigurationFlag' ) ;
78
- expect ( args [ 8 ] ) . toEqual ( '-destination' ) ;
79
- expect ( args [ 9 ] ) . toEqual ( 'TestDestinationFlag' ) ;
80
- expect ( args [ 10 ] ) . toEqual ( '-archivePath' ) ;
81
- expect ( args [ 11 ] ) . toEqual ( 'TestArchivePathFlag' ) ;
82
- expect ( args [ 12 ] ) . toEqual ( 'archive' ) ;
83
- expect ( args [ 13 ] ) . toEqual ( 'CONFIGURATION_BUILD_DIR=TestConfigBuildDirFlag' ) ;
84
- expect ( args [ 14 ] ) . toEqual ( 'SHARED_PRECOMPS_DIR=TestSharedPrecompsDirFlag' ) ;
85
- expect ( args . length ) . toEqual ( 15 ) ;
69
+ expect ( args ) . toEqual ( [
70
+ '-workspace' ,
71
+ 'TestWorkspaceFlag' ,
72
+ '-scheme' ,
73
+ 'TestSchemeFlag' ,
74
+ '-configuration' ,
75
+ 'TestConfigurationFlag' ,
76
+ '-destination' ,
77
+ 'TestDestinationFlag' ,
78
+ '-archivePath' ,
79
+ 'TestArchivePathFlag' ,
80
+ 'archive' ,
81
+ 'CONFIGURATION_BUILD_DIR=TestConfigBuildDirFlag' ,
82
+ 'SHARED_PRECOMPS_DIR=TestSharedPrecompsDirFlag'
83
+ ] ) ;
84
+ expect ( args . length ) . toEqual ( 13 ) ;
86
85
done ( ) ;
87
86
} ) ;
88
87
89
88
it ( 'should generate appropriate args for device' , function ( done ) {
90
89
var isDevice = true ;
91
90
var args = getXcodeBuildArgs ( 'TestProjectName' , testProjectPath , 'TestConfiguration' , isDevice , null ) ;
92
- expect ( args [ 0 ] ) . toEqual ( '-xcconfig' ) ;
93
- expect ( args [ 1 ] ) . toEqual ( path . join ( '/test' , 'build-testconfiguration.xcconfig' ) ) ;
94
- expect ( args [ 2 ] ) . toEqual ( '-workspace' ) ;
95
- expect ( args [ 3 ] ) . toEqual ( 'TestProjectName.xcworkspace' ) ;
96
- expect ( args [ 4 ] ) . toEqual ( '-scheme' ) ;
97
- expect ( args [ 5 ] ) . toEqual ( 'TestProjectName' ) ;
98
- expect ( args [ 6 ] ) . toEqual ( '-configuration' ) ;
99
- expect ( args [ 7 ] ) . toEqual ( 'TestConfiguration' ) ;
100
- expect ( args [ 8 ] ) . toEqual ( '-destination' ) ;
101
- expect ( args [ 9 ] ) . toEqual ( 'generic/platform=iOS' ) ;
102
- expect ( args [ 10 ] ) . toEqual ( '-archivePath' ) ;
103
- expect ( args [ 11 ] ) . toEqual ( 'TestProjectName.xcarchive' ) ;
104
- expect ( args [ 12 ] ) . toEqual ( 'archive' ) ;
105
- expect ( args [ 13 ] ) . toEqual ( 'CONFIGURATION_BUILD_DIR =' + path . join ( testProjectPath , 'build' , 'device' ) ) ;
106
- expect ( args [ 14 ] ) . toEqual ( 'SHARED_PRECOMPS_DIR=' + path . join ( testProjectPath , 'build' , 'sharedpch' ) ) ;
107
- expect ( args . length ) . toEqual ( 15 ) ;
91
+ expect ( args ) . toEqual ( [
92
+ '-workspace' ,
93
+ 'TestProjectName.xcworkspace' ,
94
+ '-scheme' ,
95
+ 'TestProjectName' ,
96
+ '-configuration' ,
97
+ 'TestConfiguration' ,
98
+ '-destination' ,
99
+ 'generic/platform=iOS' ,
100
+ '-archivePath' ,
101
+ 'TestProjectName.xcarchive' ,
102
+ 'archive' ,
103
+ 'CONFIGURATION_BUILD_DIR=' + path . join ( testProjectPath , 'build' , 'device' ) ,
104
+ 'SHARED_PRECOMPS_DIR =' + path . join ( testProjectPath , 'build' , 'sharedpch' )
105
+ ] ) ;
106
+ expect ( args . length ) . toEqual ( 13 ) ;
108
107
done ( ) ;
109
108
} ) ;
110
109
111
110
it ( 'should generate appropriate args for simulator' , function ( done ) {
112
111
var isDevice = false ;
113
112
var args = getXcodeBuildArgs ( 'TestProjectName' , testProjectPath , 'TestConfiguration' , isDevice , null , 'iPhone 5s' ) ;
114
- expect ( args [ 0 ] ) . toEqual ( '-xcconfig' ) ;
115
- expect ( args [ 1 ] ) . toEqual ( path . join ( '/test' , 'build-testconfiguration.xcconfig' ) ) ;
116
- expect ( args [ 2 ] ) . toEqual ( '-workspace' ) ;
117
- expect ( args [ 3 ] ) . toEqual ( 'TestProjectName.xcworkspace' ) ;
118
- expect ( args [ 4 ] ) . toEqual ( '-scheme' ) ;
119
- expect ( args [ 5 ] ) . toEqual ( 'TestProjectName' ) ;
120
- expect ( args [ 6 ] ) . toEqual ( '-configuration' ) ;
121
- expect ( args [ 7 ] ) . toEqual ( 'TestConfiguration' ) ;
122
- expect ( args [ 8 ] ) . toEqual ( '-sdk' ) ;
123
- expect ( args [ 9 ] ) . toEqual ( 'iphonesimulator' ) ;
124
- expect ( args [ 10 ] ) . toEqual ( '-destination' ) ;
125
- expect ( args [ 11 ] ) . toEqual ( 'platform=iOS Simulator,name=iPhone 5s' ) ;
126
- expect ( args [ 12 ] ) . toEqual ( 'build' ) ;
127
- expect ( args [ 13 ] ) . toEqual ( 'CONFIGURATION_BUILD_DIR =' + path . join ( testProjectPath , 'build' , 'emulator' ) ) ;
128
- expect ( args [ 14 ] ) . toEqual ( 'SHARED_PRECOMPS_DIR=' + path . join ( testProjectPath , 'build' , 'sharedpch' ) ) ;
129
- expect ( args . length ) . toEqual ( 15 ) ;
113
+ expect ( args ) . toEqual ( [
114
+ '-workspace' ,
115
+ 'TestProjectName.xcworkspace' ,
116
+ '-scheme' ,
117
+ 'TestProjectName' ,
118
+ '-configuration' ,
119
+ 'TestConfiguration' ,
120
+ '-sdk' ,
121
+ 'iphonesimulator' ,
122
+ '-destination' ,
123
+ 'platform=iOS Simulator,name=iPhone 5s' ,
124
+ 'build' ,
125
+ 'CONFIGURATION_BUILD_DIR=' + path . join ( testProjectPath , 'build' , 'emulator' ) ,
126
+ 'SHARED_PRECOMPS_DIR =' + path . join ( testProjectPath , 'build' , 'sharedpch' )
127
+ ] ) ;
128
+ expect ( args . length ) . toEqual ( 13 ) ;
130
129
done ( ) ;
131
130
} ) ;
132
131
@@ -135,24 +134,24 @@ describe('build', function () {
135
134
var buildFlags = '-sdk TestSdkFlag' ;
136
135
137
136
var args = getXcodeBuildArgs ( 'TestProjectName' , testProjectPath , 'TestConfiguration' , isDevice , buildFlags ) ;
138
- expect ( args [ 0 ] ) . toEqual ( '-xcconfig' ) ;
139
- expect ( args [ 1 ] ) . toEqual ( path . join ( '/test' , 'build-testconfiguration.xcconfig' ) ) ;
140
- expect ( args [ 2 ] ) . toEqual ( '-workspace' ) ;
141
- expect ( args [ 3 ] ) . toEqual ( 'TestProjectName.xcworkspace' ) ;
142
- expect ( args [ 4 ] ) . toEqual ( '-scheme' ) ;
143
- expect ( args [ 5 ] ) . toEqual ( 'TestProjectName' ) ;
144
- expect ( args [ 6 ] ) . toEqual ( '-configuration' ) ;
145
- expect ( args [ 7 ] ) . toEqual ( 'TestConfiguration' ) ;
146
- expect ( args [ 8 ] ) . toEqual ( '-destination' ) ;
147
- expect ( args [ 9 ] ) . toEqual ( 'generic/platform=iOS' ) ;
148
- expect ( args [ 10 ] ) . toEqual ( '-archivePath' ) ;
149
- expect ( args [ 11 ] ) . toEqual ( 'TestProjectName.xcarchive' ) ;
150
- expect ( args [ 12 ] ) . toEqual ( 'archive' ) ;
151
- expect ( args [ 13 ] ) . toEqual ( 'CONFIGURATION_BUILD_DIR =' + path . join ( testProjectPath , 'build' , 'device' ) ) ;
152
- expect ( args [ 14 ] ) . toEqual ( 'SHARED_PRECOMPS_DIR=' + path . join ( testProjectPath , 'build' , 'sharedpch' ) ) ;
153
- expect ( args [ 15 ] ) . toEqual ( '-sdk' ) ;
154
- expect ( args [ 16 ] ) . toEqual ( 'TestSdkFlag' ) ;
155
- expect ( args . length ) . toEqual ( 17 ) ;
137
+ expect ( args ) . toEqual ( [
138
+ '-workspace' ,
139
+ 'TestProjectName.xcworkspace' ,
140
+ '-scheme' ,
141
+ 'TestProjectName' ,
142
+ '-configuration' ,
143
+ 'TestConfiguration' ,
144
+ '-destination' ,
145
+ 'generic/platform=iOS' ,
146
+ '-archivePath' ,
147
+ 'TestProjectName.xcarchive' ,
148
+ 'archive' ,
149
+ 'CONFIGURATION_BUILD_DIR=' + path . join ( testProjectPath , 'build' , 'device' ) ,
150
+ 'SHARED_PRECOMPS_DIR =' + path . join ( testProjectPath , 'build' , 'sharedpch' ) ,
151
+ '-sdk' ,
152
+ 'TestSdkFlag'
153
+ ] ) ;
154
+ expect ( args . length ) . toEqual ( 15 ) ;
156
155
done ( ) ;
157
156
} ) ;
158
157
@@ -161,47 +160,47 @@ describe('build', function () {
161
160
var buildFlags = '-archivePath TestArchivePathFlag' ;
162
161
163
162
var args = getXcodeBuildArgs ( 'TestProjectName' , testProjectPath , 'TestConfiguration' , isDevice , buildFlags , 'iPhone 5s' ) ;
164
- expect ( args [ 0 ] ) . toEqual ( '-xcconfig' ) ;
165
- expect ( args [ 1 ] ) . toEqual ( path . join ( '/test' , 'build-testconfiguration.xcconfig' ) ) ;
166
- expect ( args [ 2 ] ) . toEqual ( '-workspace' ) ;
167
- expect ( args [ 3 ] ) . toEqual ( 'TestProjectName.xcworkspace' ) ;
168
- expect ( args [ 4 ] ) . toEqual ( '-scheme' ) ;
169
- expect ( args [ 5 ] ) . toEqual ( 'TestProjectName' ) ;
170
- expect ( args [ 6 ] ) . toEqual ( '-configuration' ) ;
171
- expect ( args [ 7 ] ) . toEqual ( 'TestConfiguration' ) ;
172
- expect ( args [ 8 ] ) . toEqual ( '-sdk' ) ;
173
- expect ( args [ 9 ] ) . toEqual ( 'iphonesimulator' ) ;
174
- expect ( args [ 10 ] ) . toEqual ( '-destination' ) ;
175
- expect ( args [ 11 ] ) . toEqual ( 'platform=iOS Simulator,name=iPhone 5s' ) ;
176
- expect ( args [ 12 ] ) . toEqual ( 'build' ) ;
177
- expect ( args [ 13 ] ) . toEqual ( 'CONFIGURATION_BUILD_DIR =' + path . join ( testProjectPath , 'build' , 'emulator' ) ) ;
178
- expect ( args [ 14 ] ) . toEqual ( 'SHARED_PRECOMPS_DIR=' + path . join ( testProjectPath , 'build' , 'sharedpch' ) ) ;
179
- expect ( args [ 15 ] ) . toEqual ( '-archivePath' ) ;
180
- expect ( args [ 16 ] ) . toEqual ( 'TestArchivePathFlag' ) ;
181
- expect ( args . length ) . toEqual ( 17 ) ;
163
+ expect ( args ) . toEqual ( [
164
+ '-workspace' ,
165
+ 'TestProjectName.xcworkspace' ,
166
+ '-scheme' ,
167
+ 'TestProjectName' ,
168
+ '-configuration' ,
169
+ 'TestConfiguration' ,
170
+ '-sdk' ,
171
+ 'iphonesimulator' ,
172
+ '-destination' ,
173
+ 'platform=iOS Simulator,name=iPhone 5s' ,
174
+ 'build' ,
175
+ 'CONFIGURATION_BUILD_DIR=' + path . join ( testProjectPath , 'build' , 'emulator' ) ,
176
+ 'SHARED_PRECOMPS_DIR =' + path . join ( testProjectPath , 'build' , 'sharedpch' ) ,
177
+ '-archivePath' ,
178
+ 'TestArchivePathFlag'
179
+ ] ) ;
180
+ expect ( args . length ) . toEqual ( 15 ) ;
182
181
done ( ) ;
183
182
} ) ;
184
183
185
184
it ( 'should generate appropriate args for automatic provisioning' , function ( done ) {
186
185
var isDevice = true ;
187
186
var args = getXcodeBuildArgs ( 'TestProjectName' , testProjectPath , 'TestConfiguration' , isDevice , null , null , true ) ;
188
- expect ( args [ 0 ] ) . toEqual ( '-xcconfig' ) ;
189
- expect ( args [ 1 ] ) . toEqual ( path . join ( '/test' , 'build-testconfiguration.xcconfig' ) ) ;
190
- expect ( args [ 2 ] ) . toEqual ( '-workspace' ) ;
191
- expect ( args [ 3 ] ) . toEqual ( 'TestProjectName.xcworkspace' ) ;
192
- expect ( args [ 4 ] ) . toEqual ( '-scheme' ) ;
193
- expect ( args [ 5 ] ) . toEqual ( 'TestProjectName' ) ;
194
- expect ( args [ 6 ] ) . toEqual ( '-configuration' ) ;
195
- expect ( args [ 7 ] ) . toEqual ( 'TestConfiguration' ) ;
196
- expect ( args [ 8 ] ) . toEqual ( '-destination' ) ;
197
- expect ( args [ 9 ] ) . toEqual ( 'generic/platform=iOS' ) ;
198
- expect ( args [ 10 ] ) . toEqual ( '-archivePath' ) ;
199
- expect ( args [ 11 ] ) . toEqual ( 'TestProjectName.xcarchive' ) ;
200
- expect ( args [ 12 ] ) . toEqual ( '-allowProvisioningUpdates' ) ;
201
- expect ( args [ 13 ] ) . toEqual ( 'archive' ) ;
202
- expect ( args [ 14 ] ) . toEqual ( 'CONFIGURATION_BUILD_DIR =' + path . join ( testProjectPath , 'build' , 'device' ) ) ;
203
- expect ( args [ 15 ] ) . toEqual ( 'SHARED_PRECOMPS_DIR=' + path . join ( testProjectPath , 'build' , 'sharedpch' ) ) ;
204
- expect ( args . length ) . toEqual ( 16 ) ;
187
+ expect ( args ) . toEqual ( [
188
+ '-workspace' ,
189
+ 'TestProjectName.xcworkspace' ,
190
+ '-scheme' ,
191
+ 'TestProjectName' ,
192
+ '-configuration' ,
193
+ 'TestConfiguration' ,
194
+ '-destination' ,
195
+ 'generic/platform=iOS' ,
196
+ '-archivePath' ,
197
+ 'TestProjectName.xcarchive' ,
198
+ '-allowProvisioningUpdates' ,
199
+ 'archive' ,
200
+ 'CONFIGURATION_BUILD_DIR=' + path . join ( testProjectPath , 'build' , 'device' ) ,
201
+ 'SHARED_PRECOMPS_DIR =' + path . join ( testProjectPath , 'build' , 'sharedpch' )
202
+ ] ) ;
203
+ expect ( args . length ) . toEqual ( 14 ) ;
205
204
done ( ) ;
206
205
} ) ;
207
206
} ) ;
@@ -242,14 +241,6 @@ describe('build', function () {
242
241
243
242
var parseBuildFlag = build . __get__ ( 'parseBuildFlag' ) ;
244
243
245
- it ( 'should detect an xcconfig change' , function ( done ) {
246
- var buildFlag = '-xcconfig /path/to/config' ;
247
- var args = { 'otherFlags' : [ ] } ;
248
- parseBuildFlag ( buildFlag , args ) ;
249
- expect ( args . xcconfig ) . toEqual ( '/path/to/config' ) ;
250
- expect ( args . otherFlags . length ) . toEqual ( 0 ) ;
251
- done ( ) ;
252
- } ) ;
253
244
it ( 'should detect a workspace change' , function ( done ) {
254
245
var buildFlag = '-workspace MyTestWorkspace' ;
255
246
var args = { 'otherFlags' : [ ] } ;
0 commit comments