Created
May 19, 2018 13:40
-
-
Save matteocollina/b14eb877c35d6c796e370b6e55504bfa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# react-native-cli: 2.0.1 | |
# react-native: 0.55.3 | |
# NB: My rn files are inside "js" dir | |
project 'Golee.xcodeproj' | |
# Uncomment the next line to define a global platform for your project | |
# platform :ios, '9.0' | |
target 'Golee' do | |
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks | |
use_frameworks! | |
pod 'MBProgressHUD' | |
pod 'LIRequest' | |
pod 'Reachability' | |
pod 'KeychainAccess' | |
pod 'SKPhotoBrowser' | |
pod 'QRCodeReader.swift' | |
pod 'AFNetworking' | |
pod 'Fabric' | |
pod 'Crashlytics' | |
pod 'FBSDKCoreKit' | |
pod 'FBSDKLoginKit' | |
pod 'FBAudienceNetwork' | |
pod 'GoogleAnalytics' | |
pod 'AppCenter' | |
# Your 'node_modules' directory is probably in the root of your project, | |
# but if not, adjust the `:path` accordingly | |
pod 'React', :path => 'js/node_modules/react-native', :subspecs => [ | |
'Core', | |
'CxxBridge', | |
'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43 | |
'RCTText', | |
'RCTNetwork', | |
'RCTWebSocket', # needed for debugging | |
'RCTLinkingIOS', | |
# Add any other subspecs you want to use in your project | |
] | |
# Explicitly include Yoga if you are using RN >= 0.42.0 | |
pod 'yoga', :path => 'js/node_modules/react-native/ReactCommon/yoga' | |
# Third party deps podspec link | |
pod 'DoubleConversion', :podspec => 'js/node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' | |
pod 'glog', :podspec => 'js/node_modules/react-native/third-party-podspecs/GLog.podspec' | |
pod 'Folly', :podspec => 'js/node_modules/react-native/third-party-podspecs/Folly.podspec' | |
def change_lines_in_file(file_path, &change) | |
print "Fixing #{file_path}...\n" | |
contents = [] | |
file = File.open(file_path, 'r') | |
file.each_line do | line | | |
contents << line | |
end | |
file.close | |
File.open(file_path, 'w') do |f| | |
f.puts(change.call(contents)) | |
end | |
end | |
post_install do |installer| | |
# https://github.com/facebook/yoga/issues/711#issuecomment-381098373 | |
change_lines_in_file('./Pods/Target Support Files/yoga/yoga-umbrella.h') do |lines| | |
lines.reject do | line | | |
[ | |
'#import "Utils.h"', | |
'#import "YGLayout.h"', | |
'#import "YGNode.h"', | |
'#import "YGNodePrint.h"', | |
'#import "YGStyle.h"', | |
'#import "Yoga-internal.h"', | |
].include?(line.strip) | |
end | |
end | |
# https://github.com/facebook/yoga/issues/711#issuecomment-374605785 | |
change_lines_in_file('js/node_modules/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceSizeMeasureMode.h') do |lines| | |
unless lines[27].include?("#ifdef __cplusplus") | |
lines.insert(27, "#ifdef __cplusplus") | |
lines.insert(34, "#endif") | |
end | |
lines | |
end | |
# https://github.com/facebook/react-native/issues/13198 | |
change_lines_in_file('js/node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h') do |lines| | |
lines.map { |line| line.include?("#import <RCTAnimation/RCTValueAnimatedNode.h>") ? '#import "RCTValueAnimatedNode.h"' : line } | |
end | |
# https://github.com/facebook/react-native/issues/16039 | |
change_lines_in_file('js/node_modules/react-native/Libraries/WebSocket/RCTReconnectingWebSocket.m') do |lines| | |
lines.map { |line| line.include?("#import <fishhook/fishhook.h>") ? '#import "fishhook.h"' : line } | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment