@@ -127,6 +127,58 @@ describe('Xcode Suite', function() {
127127 } )
128128 } )
129129
130+ it ( 'run Xcode with project and no workspace' , ( done ) => {
131+ setResponseFile ( 'responseProject.json' ) ;
132+
133+ var tr = new trm . TaskRunner ( 'Xcode' , true , true ) ;
134+ tr . setInput ( 'actions' , 'build' ) ;
135+ tr . setInput ( 'configuration' , '$(Configuration)' ) ;
136+ tr . setInput ( 'sdk' , '$(SDK)' ) ;
137+ tr . setInput ( 'xcWorkspacePath' , '/user/build' ) ;
138+ tr . setInput ( 'scheme' , '' ) ;
139+ tr . setInput ( 'packageApp' , 'true' ) ;
140+ tr . setInput ( 'signMethod' , 'file' ) ;
141+ tr . setInput ( 'p12' , '/user/build' ) ;
142+ tr . setInput ( 'p12pwd' , '' ) ;
143+ tr . setInput ( 'provProfile' , '/user/build' ) ;
144+ tr . setInput ( 'removeProfile' , 'false' ) ;
145+ tr . setInput ( 'unlockDefaultKeychain' , 'false' ) ;
146+ tr . setInput ( 'defaultKeychainPassword' , '' ) ;
147+ tr . setInput ( 'iosSigningIdentity' , '' ) ;
148+ tr . setInput ( 'provProfileUuid' , '' ) ;
149+ tr . setInput ( 'args' , '-project test.xcodeproj' ) ;
150+ tr . setInput ( 'cwd' , '/user/build' ) ;
151+ tr . setInput ( 'outputPattern' , 'output/$(SDK)/$(Configuration)' ) ;
152+ tr . setInput ( 'xcodeDeveloperDir' , '' ) ;
153+ tr . setInput ( 'useXctool' , 'false' ) ;
154+ tr . setInput ( 'xctoolReporter' , '' ) ;
155+ tr . setInput ( 'publishJUnitResults' , 'false' ) ;
156+
157+ tr . run ( )
158+ . then ( ( ) => {
159+ assert ( tr . ran ( '/home/bin/xcodebuild -version' ) , 'xcodebuild for version should have been run.' ) ;
160+ assert ( tr . ran ( '/home/bin/xcodebuild -sdk $(SDK) -configuration $(Configuration) ' +
161+ 'build DSTROOT=/user/build/output/$(SDK)/$(Configuration)/build.dst ' +
162+ 'OBJROOT=/user/build/output/$(SDK)/$(Configuration)/build.obj ' +
163+ 'SYMROOT=/user/build/output/$(SDK)/$(Configuration)/build.sym ' +
164+ 'SHARED_PRECOMPS_DIR=/user/build/output/$(SDK)/$(Configuration)/build.pch ' +
165+ '-project test.xcodeproj' ) ,
166+ 'xcodebuild for building the ios project should have been run.' ) ;
167+ assert ( tr . ran ( '/home/bin/xcrun -sdk $(SDK) PackageApplication ' +
168+ '-v /user/build/output/$(SDK)/$(Configuration)/build.sym/Release.iphoneos/fun.app ' +
169+ '-o /user/build/output/$(SDK)/$(Configuration)/build.sym/Release.iphoneos/fun.ipa' ) ,
170+ "xcrun to package the app and generate an .ipa should have been run." ) ;
171+ assert ( tr . invokedToolCount == 3 , 'should have xcodebuild for version, xcodebuild for build and xcrun for packaging' ) ;
172+ assert ( tr . resultWasSet , 'task should have set a result' ) ;
173+ assert ( tr . stderr . length == 0 , 'should not have written to stderr' ) ;
174+ assert ( tr . succeeded , 'task should have succeeded' ) ;
175+ done ( ) ;
176+ } )
177+ . fail ( ( err ) => {
178+ done ( err ) ;
179+ } )
180+ } )
181+
130182 it ( 'run Xcode build with test action, publish test results' , ( done ) => {
131183 setResponseFile ( 'responseXctool.json' ) ;
132184
0 commit comments