@@ -102,9 +102,20 @@ lane :release do |options|
102102end
103103
104104private_lane :build_xcframework do |options |
105- sh ( "./scripts/sync_gclient.sh #{ options [ :branch ] } " )
105+ ENV [ 'PATH' ] = "#{ ENV . fetch ( 'PATH' , nil ) } :#{ Dir . home } /webrtc/depot_tools"
106+ sh ( "./sync_gclient.sh #{ options [ :branch ] } " )
106107 inject_objc_runtime_name
107- sh ( "./scripts/build_xcframework.sh" )
108+
109+ Dir . chdir ( 'src' ) do
110+ sh ( "./tools_webrtc/ios/build_ios_libs.py \
111+ --deployment-target 13.0 \
112+ --extra-gn-args \
113+ is_debug=false \
114+ use_goma=false \
115+ use_rtti=true \
116+ rtc_libvpx_build_vp9=true")
117+ end
118+
108119 current_path = File . expand_path ( 'src/out_ios_libs/WebRTC.xcframework' )
109120 new_path = "./#{ File . basename ( current_path ) } "
110121 FileUtils . mv ( current_path , new_path )
176187private_lane :inject_objc_runtime_name do
177188 prefix = 'StreamRTC'
178189 Dir . glob ( 'src/**/*.{h,m,mm}' ) do |file |
179- next unless File . file? ( file )
180- next if file . include? ( '/build/' ) || file . include? ( '.git' )
190+ next if !File . file? ( file ) || file . include? ( '/build/' ) || file . include? ( '.git' )
181191
182192 content = File . read ( file , mode : 'rb' ) . encode ( 'UTF-8' , invalid : :replace , undef : :replace , replace : '' )
183193 original = content . dup
@@ -190,14 +200,13 @@ private_lane :inject_objc_runtime_name do
190200 pre_context = content [ 0 ...Regexp . last_match . begin ( 0 ) ] . split ( "\n " ) . last ( 3 ) . join ( "\n " )
191201 next match if pre_context . include? ( 'objc_runtime_name' )
192202
193- attr_line = "#{ indent } __attribute__((objc_runtime_name(\" #{ prefix } #{ classname [ 3 ..] } \" )))\n "
194- "#{ attr_line } #{ match } "
203+ "#{ indent } __attribute__((objc_runtime_name(\" #{ prefix } #{ classname [ 3 ..] } \" )))\n #{ match } "
195204 end
196205
197- if new_content ! = original
198- UI . message ( "π #{ file } " )
199- File . write ( file , new_content )
200- end
206+ next if new_content = = original
207+
208+ UI . message ( "π§ #{ file } " )
209+ File . write ( file , new_content )
201210 end
202211end
203212
0 commit comments