File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -351,8 +351,9 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
351
351
// Check availability
352
352
try {
353
353
this . $childProcess . exec ( "gem which cocoapods" ) . wait ( ) ;
354
+ this . $childProcess . exec ( "gem which xcodeproj" ) . wait ( ) ;
354
355
} catch ( e ) {
355
- this . $errors . failWithoutHelp ( "CocoaPods are not installed. Run `sudo gem install cocoapods` and try again." ) ;
356
+ this . $errors . failWithoutHelp ( "CocoaPods or ruby gem 'xcodeproj' is not installed. Run `sudo gem install cocoapods` and try again." ) ;
356
357
}
357
358
358
359
let projectPodfileContent = this . $fs . readText ( this . projectPodFilePath ) . wait ( ) ;
@@ -363,7 +364,14 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
363
364
if ( firstPostInstallIndex !== - 1 && firstPostInstallIndex !== projectPodfileContent . lastIndexOf ( IOSProjectService . PODFILE_POST_INSTALL_SECTION_NAME ) ) {
364
365
this . $logger . warn ( `Podfile contains more than one post_install sections. You need to open ${ this . projectPodFilePath } file and manually resolve this issue.` ) ;
365
366
}
366
-
367
+
368
+ let pbxprojFilePath = path . join ( this . platformData . projectRoot , this . $projectData . projectName + IOSProjectService . XCODE_PROJECT_EXT_NAME , "xcuserdata" ) ;
369
+ if ( ! this . $fs . exists ( pbxprojFilePath ) . wait ( ) ) {
370
+ this . $logger . info ( "Creating project scheme..." ) ;
371
+ let createSchemeRubyScript = `ruby -e "require 'xcodeproj'; xcproj = Xcodeproj::Project.open('${ this . $projectData . projectName } .xcodeproj'); xcproj.recreate_user_schemes; xcproj.save"` ;
372
+ this . $childProcess . exec ( createSchemeRubyScript , { cwd : this . platformData . projectRoot } ) . wait ( ) ;
373
+ }
374
+
367
375
this . $logger . info ( "Installing pods..." ) ;
368
376
this . $childProcess . exec ( "pod install" , { cwd : this . platformData . projectRoot } ) . wait ( ) ;
369
377
}
You can’t perform that action at this time.
0 commit comments