-
Notifications
You must be signed in to change notification settings - Fork 591
Expand file tree
/
Copy pathPodfile
More file actions
243 lines (198 loc) · 7.28 KB
/
Podfile
File metadata and controls
243 lines (198 loc) · 7.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# frozen_string_literal: true
using_bundler = defined? Bundler
unless using_bundler
puts "\nPlease re-run using:".red
puts " bundle exec pod install\n\n"
exit(1)
end
require 'dotenv'
Dotenv.load('.env.shared')
source 'https://github.com/artsy/Specs.git'
source 'https://cdn.cocoapods.org/'
require_relative './node_modules/react-native/scripts/react_native_pods'
require_relative './node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '12.1'
inhibit_all_warnings!
require 'down'
require 'json'
require 'fileutils'
$ReactNativeMapboxGLIOSVersion = '~> 6.3'
if !ENV['MAPBOX_DOWNLOAD_TOKEN']
raise "You need a MAPBOX_DOWNLOAD_TOKEN in your .env.shared file.\nIf you work at artsy, check 1password.\nOtherwise create your own in the mapbox dashboard. https://docs.mapbox.com/ios/maps/guides/install"
end
# mapbox needs credentials in `~/.netrc`, so we put them there and then remove them in post_install
$netrc_path = File.expand_path('~/.netrc')
$user_already_had_netrc_file = File.exists?($netrc_path)
def add_mapbox_creds
File.open($netrc_path, 'a+', 0600) { |f|
f.write("""machine api.mapbox.com
login mapbox
password #{ENV['MAPBOX_DOWNLOAD_TOKEN']}
""")
}
end
def remove_mapbox_creds
if $user_already_had_netrc_file
contents = File.read($netrc_path)
cleaned = contents.gsub(/machine api\.mapbox\.com\nlogin mapbox\npassword #{ENV['MAPBOX_DOWNLOAD_TOKEN']}\n/, "")
File.open($netrc_path, 'w') { |f|
f.write(cleaned)
}
else
File.delete($netrc_path)
end
end
add_mapbox_creds
pre_install do |installer|
$RNMBGL.pre_install(installer)
end
target 'Artsy' do
config = use_native_modules!
use_react_native!(
:path => './node_modules/react-native',
:production => ENV['CIRCLE_BUILD_NUM'],
)
# Networking
pod 'AFNetworking', '~> 2.5', subspecs: %w[Reachability Serialization Security NSURLSession NSURLConnection]
pod 'AFOAuth1Client', git: 'https://github.com/artsy/AFOAuth1Client.git', tag: '0.4.0-subspec-fix'
pod 'AFNetworkActivityLogger'
pod 'SDWebImage', '5.8.3'
# Core
pod 'ARGenericTableViewController', git: 'https://github.com/artsy/ARGenericTableViewController.git'
pod 'CocoaLumberjack', '2.4.0'
pod 'FLKAutoLayout', git: 'https://github.com/artsy/FLKAutoLayout.git', branch: 'v1'
pod 'FXBlurView'
pod 'ISO8601DateFormatter', git: 'https://github.com/artsy/iso-8601-date-formatter'
pod 'JLRoutes', git: 'https://github.com/artsy/JLRoutes.git'
pod 'JSDecoupledAppDelegate'
pod 'Mantle', '1.5.6'
pod 'MMMarkdown', '0.4'
pod 'NPKeyboardLayoutGuide'
pod 'UICKeyChainStore'
pod 'MARKRangeSlider'
pod 'EDColor'
# Core owned by Artsy
pod 'ORStackView', '2.0.3'
pod 'UIView+BooleanAnimations'
pod 'Aerodramus', '2.0.0'
# Language Enhancements
pod 'MultiDelegate'
pod 'ObjectiveSugar'
# Artsy Spec repo stuff
pod 'Artsy+UIFonts', '~> 3.3.4'
pod 'Artsy-UIButtons'
pod 'Artsy+UIColors'
pod 'Artsy+UILabels'
pod 'Extraction'
pod 'Emission', path: './emission', :inhibit_warnings => false
# For Stripe integration with Emission. Using a fork for this issue: https://github.com/tipsi/tipsi-stripe/issues/408
pod 'Pulley', git: 'https://github.com/artsy/Pulley.git', branch: 'master'
# Facebook
pod 'FBSDKCoreKit', '~> 9.3'
pod 'FBSDKLoginKit', '~> 9.3'
pod 'FBSDKShareKit', '~> 9.3'
# Google & Firebase
pod 'GoogleSignIn', '~> 5.0.2'
pod 'Firebase/Auth'
# Analytics
pod 'Segment-Appboy'
pod 'Segment-Adjust'
# Developer Pods
pod 'DHCShakeNotifier'
pod 'ORKeyboardReactingApplication'
# Swift pods 🎉
pod 'Then'
pod 'Interstellar/Core', git: 'https://github.com/artsy/Interstellar.git', branch: 'observable-unsubscribe'
pod 'Starscream'
pod 'SwiftyJSON'
# Used in Live Auctions to hold user-state
pod 'JWTDecode'
target 'Artsy Tests' do
inherit! :search_paths
pod 'OHHTTPStubs'
pod 'XCTest+OHHTTPStubSuiteCleanUp'
pod 'Specta'
pod 'Expecta', '1.0.6'
pod 'Expecta+Snapshots', '3.1.1'
pod 'OCMock'
pod 'Forgeries/Mocks'
# Swift pods 🎉
pod 'Quick', '2.0.0'
pod 'Nimble', '7.3.4'
pod 'Nimble-Snapshots', '6.3.0'
end
end
# Enables Flipper.
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
use_flipper!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0', 'Flipper-RSocket' => '1.3.1' })
post_install do |installer|
flipper_post_install(installer)
$RNMBGL.post_install(installer)
remove_mapbox_creds
# So we can show some of this stuff in the Admin panel
emission_podspec_json = installer.pod_targets.find { |f| f.name == 'Emission' }.specs[0].to_json
File.write('Pods/Local Podspecs/Emission.podspec.json', emission_podspec_json)
# Disable bitcode for now. Specifically needed for HockeySDK and ARAnalytics.
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
# Forces the minimum to be 9.0 as that's our last deployment targer, and new xcode build tools
# give an error in Xcode 10
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 9.0
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
end
end
end
# CI was having trouble shipping signed builds
# https://github.com/CocoaPods/CocoaPods/issues/4011
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ''
config.build_settings['CODE_SIGNING_REQUIRED'] = 'NO'
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
end
end
# For now Nimble Snapshots needs to stay at Swift 4.0
swift4 = ['Nimble-Snapshots']
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.0' if swift4.include?(target.name)
end
end
# Support toggling the RCT_Dev build flag so that we can have it in dev, but not in prod
react = installer.pods_project.targets.find { |target| target.name == 'React' }
react.build_configurations.each do |config|
allow_react_native_debugging = config.name == 'Debug' ? '1' : '0'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) RCT_DEV=' + allow_react_native_debugging
end
# TODO:
# * ORStackView: Move Laura's changes into master and update
# * Send PRs for the rest
%w[
Pods/ORStackView/Classes/ios/ORStackView.h
Pods/NAMapKit/NAMapKit/*.h
].flat_map { |x| Dir.glob(x) }.each do |header|
addition = "#import <UIKit/UIKit.h>\n"
contents = File.read(header)
next if contents.include?(addition)
File.open(header, 'w') do |file|
file.puts addition
file.puts contents
end
end
# TODO: Might be nice to have a `cocoapods-patch` plugin that applies patches like `patch-package` does for npm.
%w[
Pods/Nimble/Sources/NimbleObjectiveC
Pods/Nimble-Snapshots
Pods/Quick/Sources/QuickObjectiveC
].flat_map { |x| Dir.glob(File.join(x, '**/*.{h,m}')) }.each do |header|
contents = File.read(header)
patched = contents.sub(%r{["<]\w+/(\w+-Swift\.h)[">]}, '"\1"')
File.write(header, patched) if Regexp.last_match
end
end