@@ -5,6 +5,7 @@ class ParamsXcodebuild:
55
66 def __init__ (self ) -> None :
77 self .__path_workspace = ""
8+ self .__path_project = ""
89 self .__scheme = "AgoraExample"
910 self .__configuration = "Development"
1011 self .__destination = "generic/platform=iOS"
@@ -15,6 +16,10 @@ def __init__(self) -> None:
1516 @property
1617 def get_workspace (self ):
1718 return self .__path_workspace
19+
20+ @property
21+ def get_project (self ):
22+ return self .__path_project
1823
1924 @property
2025 def get_scheme (self ):
@@ -45,6 +50,10 @@ def get_provisioning_profile_specifier(self):
4550 def workspace (self ,val ):
4651 self .__path_workspace = Path (val )
4752
53+ @get_project .setter
54+ def project (self ,val ):
55+ self .__path_project = Path (val )
56+
4857 @get_scheme .setter
4958 def scheme (self ,val ):
5059 self .__scheme = val
@@ -73,13 +82,13 @@ def provisioning_profile_specifier(self,val):
7382class XcodeCommand :
7483 def __init__ (self ) -> None :
7584 pass
76-
77- def XcodeBuild (self ,params :ParamsXcodebuild ):
78-
79- path_workspace = params .get_workspace
85+ path_project = params .get_project
8086 scheme = params .get_scheme
8187 configuration = params .get_configuration
8288 destination = params .get_destination
89+
90+ # ... existing ...
91+
8392 sdk = params .get_sdk
8493
8594 codesign_identity = params .get_codesign_identity
@@ -92,6 +101,16 @@ def XcodeBuild(self,params:ParamsXcodebuild):
92101 # -workspace "/Users/admin/Documents/Agora-Unreal-SDK-CPP-Example/AgoraExample_IOS.xcworkspace"
93102 # -scheme 'AgoraExample' -configuration "Development" -destination generic/platform=iOS -sdk iphoneos
94103
104+ target_param = ""
105+ if str (path_workspace ) != "" and str (path_workspace ) != "." :
106+ target_param = r" -workspace " + '"' + str (path_workspace ) + '"'
107+ elif str (path_project ) != "" and str (path_project ) != "." :
108+ target_param = r" -project " + '"' + str (path_project ) + '"'
109+
110+ command = (
111+ r"/usr/bin/xcrun xcodebuild build " +
112+ target_param - destination generic / platform = iOS - sdk iphoneos
113+
95114 command = (
96115 r"/usr/bin/xcrun xcodebuild build "
97116 r" -workspace " + '"' + str (path_workspace ) + '"' +
0 commit comments