@@ -565,6 +565,13 @@ def check_ios_mac_build_depends(self):
565
565
566
566
self .project_name = name
567
567
self .xcodeproj_name = xcodeproj_name
568
+ project_dir = self ._platforms .project_path ()
569
+ podfile = os .path .join (project_dir , 'Podfile' )
570
+ self .xcworkspace = os .path .join (project_dir , name + '.xcworkspace' )
571
+ self .cocoapods = os .path .exists (self .xcworkspace ) and os .path .exists (podfile )
572
+ if self .cocoapods :
573
+ cocos .Logging .info (MultiLanguage .get_string ('COMPILE_INFO_USE_COCOAPODS' ))
574
+
568
575
569
576
def _remove_res (self , target_path ):
570
577
build_cfg_dir = self ._build_cfg_path ()
@@ -739,11 +746,11 @@ def build_ios(self):
739
746
740
747
command = ' ' .join ([
741
748
"xcodebuild" ,
742
- "-project" ,
743
- "\" %s\" " % projectPath ,
749
+ "-workspace" if self . cocoapods else "- project" ,
750
+ "\" %s\" " % self . xcworkspace if self . cocoapods else projectPath ,
744
751
"-configuration" ,
745
752
"%s" % 'Debug' if self ._mode == 'debug' else 'Release' ,
746
- "-target" ,
753
+ "-scheme" if self . cocoapods else "- target" ,
747
754
"\" %s\" " % targetName ,
748
755
"%s" % "-arch i386" if self .use_sdk == 'iphonesimulator' else '' ,
749
756
"-sdk" ,
@@ -877,11 +884,11 @@ def build_mac(self):
877
884
878
885
command = ' ' .join ([
879
886
"xcodebuild" ,
880
- "-project" ,
881
- "\" %s\" " % projectPath ,
887
+ "-workspace" if self . cocoapods else "- project" ,
888
+ "\" %s\" " % self . xcworkspace if self . cocoapods else projectPath ,
882
889
"-configuration" ,
883
890
"%s" % 'Debug' if self ._mode == 'debug' else 'Release' ,
884
- "-target" ,
891
+ "-scheme" if self . cocoapods else "- target" ,
885
892
"\" %s\" " % targetName ,
886
893
"CONFIGURATION_BUILD_DIR=\" %s\" " % (output_dir )
887
894
])
0 commit comments