-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPodfile.example
More file actions
43 lines (36 loc) · 1.63 KB
/
Copy pathPodfile.example
File metadata and controls
43 lines (36 loc) · 1.63 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
# this is example of Podfile - used only for iOS build when you use Cocoa Pods modules
# If you want to use cocoapods when you build your app - rename this to "Podfile"
# and modify according to your pods list, but you should keep post_install stage !
# when XCode project will be generated, we also put this Podfile into XCode project
# folder and call pod install for prepare workspace etc.
platform :ios, '10.0'
#use_frameworks!
# pod list:
pod 'GoogleMLKit/TextRecognition'
target 'rhorunner' do
end
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == "Pods-rhorunner"
puts "Updating #{target.name} OTHER_LDFLAGS"
target.build_configurations.each do |config|
xcconfig_path = config.base_configuration_reference.real_path
# read from xcconfig to build_settings dictionary
build_settings = Hash[*File.read(xcconfig_path).lines.map{|x| x.split(/\s*=\s*/, 2)}.flatten]
# modify OTHER_LDFLAGS
config_line = build_settings['OTHER_LDFLAGS']
if (config_line != nil)
config_line = config_line.gsub("$(inherited) ","")
build_settings['OTHER_LDFLAGS'] = config_line
puts "updated OTHER_LDFLAGS = "+config_line
end
# write build_settings dictionary to xcconfig
File.open(xcconfig_path, "w") do |file|
build_settings.each do |key,value|
file.write(key + " = " + value)
end
end
end
end
end
end