@@ -33,13 +33,36 @@ target 'GoogleMapsPlusExample' do
3333 config . build_settings [ 'IPHONEOS_DEPLOYMENT_TARGET' ] = '16.0'
3434 end
3535 end
36- require 'fileutils'
37- svgkit_path = File . join ( installer . sandbox . pod_dir ( 'SVGKit' ) , 'Source' )
38- Dir . glob ( File . join ( svgkit_path , '**' , '*.{h,m}' ) ) . each do |file |
39- FileUtils . chmod ( "u+w" , file )
40- text = File . read ( file )
41- new_contents = text . gsub ( '#import "Node.h"' , '#import "SVGKit/Node.h"' )
42- File . open ( file , 'w' ) { |f | f . write ( new_contents ) }
43- end
36+
37+ # --- SVGKit Patch ---
38+ require 'fileutils'
39+ svgkit_path = File . join ( installer . sandbox . pod_dir ( 'SVGKit' ) , 'Source' )
40+
41+ # node fix
42+ Dir . glob ( File . join ( svgkit_path , '**' , '*.{h,m}' ) ) . each do |file |
43+ FileUtils . chmod ( "u+w" , file )
44+ text = File . read ( file )
45+ new_contents = text . gsub ( '#import "Node.h"' , '#import "SVGKit/Node.h"' )
46+ File . open ( file , 'w' ) { |f | f . write ( new_contents ) }
47+ # puts "Patched Node import in: #{file}"
48+ end
49+
50+ # import CSSValue.h
51+ Dir . glob ( File . join ( svgkit_path , '**' , '*.{h,m}' ) ) . each do |file |
52+ FileUtils . chmod ( "u+w" , file )
53+ text = File . read ( file )
54+ new_contents = text . gsub ( '#import "CSSValue.h"' , '#import "SVGKit/CSSValue.h"' )
55+ File . open ( file , 'w' ) { |f | f . write ( new_contents ) }
56+ # puts "Patched CSSValue import in: #{file}"
57+ end
58+
59+ # import SVGLength.h
60+ Dir . glob ( File . join ( svgkit_path , '**' , '*.{h,m}' ) ) . each do |file |
61+ FileUtils . chmod ( "u+w" , file )
62+ text = File . read ( file )
63+ new_contents = text . gsub ( '#import "SVGLength.h"' , '#import "SVGKit/SVGLength.h"' )
64+ File . open ( file , 'w' ) { |f | f . write ( new_contents ) }
65+ # puts "Patched SVGLength import in: #{file}"
66+ end
4467 end
4568end
0 commit comments