|
1 | | -require_relative '../node_modules/react-native/scripts/react_native_pods' |
| 1 | + |
2 | 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' |
3 | 3 |
|
4 | 4 | platform :ios, '11.0' |
@@ -38,25 +38,45 @@ target 'DynamsoftRnSample' do |
38 | 38 | # pod 'henry-capture-vision-react-native', :podspec => '../node_modules/react-native/henry-capture-vision-react-native/henry-capture-vision-react-native.podspec' |
39 | 39 | use_native_modules! |
40 | 40 |
|
41 | | - use_react_native!( |
42 | | - :path => config[:reactNativePath], |
43 | | - # to enable hermes on iOS, change `false` to `true` and then install pods |
44 | | - :hermes_enabled => false |
45 | | - ) |
| 41 | + # use_react_native!( |
| 42 | + # :path => config[:reactNativePath], |
| 43 | + # # to enable hermes on iOS, change `false` to `true` and then install pods |
| 44 | + # :hermes_enabled => false |
| 45 | + # ) |
46 | 46 |
|
47 | | - target 'DynamsoftRnSampleTests' do |
48 | | - inherit! :complete |
49 | | - # Pods for testing |
50 | | - end |
| 47 | + # target 'DynamsoftRnSampleTests' do |
| 48 | + # inherit! :complete |
| 49 | + # # Pods for testing |
| 50 | + # end |
51 | 51 |
|
52 | 52 | # Enables Flipper. |
53 | 53 | # |
54 | 54 | # Note that if you have use_frameworks! enabled, Flipper will not work and |
55 | 55 | # you should disable the next line. |
56 | | - use_flipper!() |
| 56 | + # use_flipper!() |
57 | 57 |
|
| 58 | + # post_install do |installer| |
| 59 | + # react_native_post_install(installer) |
| 60 | + # __apply_Xcode_12_5_M1_post_install_workaround(installer) |
| 61 | + # end |
58 | 62 | post_install do |installer| |
59 | | - react_native_post_install(installer) |
60 | | - __apply_Xcode_12_5_M1_post_install_workaround(installer) |
| 63 | + ## Fix for XCode 12.5 |
| 64 | + find_and_replace("../node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm", |
| 65 | + "_initializeModules:(NSArray<id<RCTBridgeModule>> *)modules", "_initializeModules:(NSArray<Class> *)modules") |
| 66 | + find_and_replace("../node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm", |
| 67 | + "RCTBridgeModuleNameForClass(module))", "RCTBridgeModuleNameForClass(Class(module)))") |
| 68 | + end |
| 69 | + |
| 70 | + def find_and_replace(dir, findstr, replacestr) |
| 71 | + Dir[dir].each do |name| |
| 72 | + text = File.read(name) |
| 73 | + replace = text.gsub(findstr,replacestr) |
| 74 | + if text != replace |
| 75 | + puts "Fix: " + name |
| 76 | + File.open(name, "w") { |file| file.puts replace } |
| 77 | + STDOUT.flush |
| 78 | + end |
| 79 | + end |
| 80 | + Dir[dir + '*/'].each(&method(:find_and_replace)) |
61 | 81 | end |
62 | 82 | end |
0 commit comments