forked from instructure/canvas-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Podfile
154 lines (130 loc) · 5.34 KB
/
Podfile
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
source 'https://github.com/CocoaPods/Specs.git'
workspace 'Canvas.xcworkspace'
inhibit_all_warnings!
platform :ios, '15.0'
require_relative './rn/Teacher/node_modules/react-native/scripts/react_native_pods'
def firebase_pods
pod 'GoogleUtilities', '~> 7.13'
pod 'Firebase/Crashlytics', '~> 10.23.1'
pod 'Firebase/RemoteConfig', '~> 10.23.1'
end
def canvas_crashlytics_rn_firebase_pods
pod 'GoogleUtilities', '~> 7.13'
pod 'Firebase/Crashlytics', '~> 10.23.1'
end
def react_native_pods
use_react_native!(:path => './rn/Teacher/node_modules/react-native')
# node modules
# use_native_modules!
pod 'BVLinearGradient', :path => './rn/Teacher/node_modules/react-native-linear-gradient'
pod 'Interactable', :path => './rn/Teacher/node_modules/react-native-interactable'
pod 'react-native-camera', :path => './rn/Teacher/node_modules/react-native-camera'
pod 'react-native-document-picker', :path => './rn/Teacher/node_modules/react-native-document-picker'
pod 'react-native-image-picker', :path => './rn/Teacher/node_modules/react-native-image-picker'
pod 'react-native-segmented-control', :path => './rn/Teacher/node_modules/@react-native-community/segmented-control'
pod 'ReactNativeART', :path => './rn/Teacher/node_modules/@react-native-community/art'
pod 'RNAudio', :path => './rn/Teacher/node_modules/react-native-audio'
pod 'RNCAsyncStorage', :path => './rn/Teacher/node_modules/@react-native-community/async-storage'
pod 'RNCPicker', :path => './rn/Teacher/node_modules/@react-native-community/picker'
pod 'RNDateTimePicker', :path => './rn/Teacher/node_modules/@react-native-community/datetimepicker'
pod 'RNFS', :path => './rn/Teacher/node_modules/react-native-fs'
pod 'RNSearchBar', :path => './rn/Teacher/node_modules/react-native-search-bar'
pod 'RNSound', :path => './rn/Teacher/node_modules/react-native-sound'
end
abstract_target 'defaults' do
use_frameworks!
react_native_pods
target 'Teacher' do
project 'rn/Teacher/ios/Teacher.xcodeproj'
firebase_pods
end
target 'TeacherTests' do
project 'rn/Teacher/ios/Teacher.xcodeproj'
firebase_pods
end
target 'Student' do
project 'Student/Student.xcodeproj'
firebase_pods
end
target 'SubmitAssignment' do
project 'Student/Student.xcodeproj'
firebase_pods
end
target 'StudentUnitTests' do
project 'Student/Student.xcodeproj'
firebase_pods
end
target 'CanvasCore' do
project 'CanvasCore/CanvasCore.xcodeproj'
canvas_crashlytics_rn_firebase_pods
end
end
abstract_target 'parent_defaults' do
use_frameworks!
firebase_pods
target 'Parent' do
project 'Parent/Parent.xcodeproj'
end
target 'ParentUnitTests' do
project 'Parent/Parent.xcodeproj'
end
end
post_install do |installer|
puts "\nPost Install Hooks"
xcode_base_version = `xcodebuild -version | grep 'Xcode' | awk '{print $2}' | cut -d . -f 1`
installer.pod_targets.each do |target|
silenceWarningsInUmbrellas = %w[ React-Core ]
next unless silenceWarningsInUmbrellas.include? target.name
target.umbrella_header_path.open("r+") do |file|
contents = file.read()
file.seek 0
file.puts '_Pragma("clang diagnostic push")'
file.puts '_Pragma("clang diagnostic ignored \"-Weverything\"")'
file.puts contents
file.puts '_Pragma("clang diagnostic pop")'
end
end
# https://github.com/CocoaPods/CocoaPods/issues/11553
installer.pods_project.build_configurations.each do |config|
config.build_settings['DEAD_CODE_STRIPPING'] = 'YES'
end
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['GCC_WARN_INHIBIT_ALL_WARNINGS'] = 'YES'
config.build_settings.delete('IPHONEOS_DEPLOYMENT_TARGET')
config.build_settings.delete('ONLY_ACTIVE_ARCH')
# Remove ARCHS settings from Pods, let them inherit from workspace / https://github.com/CocoaPods/CocoaPods/issues/10189
config.build_settings.delete 'ARCHS'
# This was added to work around an Xcode 13.3 bug when deploying to iOS 14 devices. https://developer.apple.com/forums/thread/702028?answerId=708408022
config.build_settings['OTHER_LDFLAGS'] = '$(inherited) -Xlinker -no_fixup_chains'
# For xcode 15+ only
if config.base_configuration_reference && Integer(xcode_base_version) >= 15
xcconfig_path = config.base_configuration_reference.real_path
xcconfig = File.read(xcconfig_path)
xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
end
end
usesNonAppExAPI = %w[
react-native-camera
React
react-native-document-picker
react-native-wkwebview
]
next unless usesNonAppExAPI.include? target.name
puts "- Disable APPLICATION_EXTENSION_API_ONLY on #{target.name}"
target.build_configurations.each do |config|
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO'
end
end
# Non-executable bundles shouldn't be code signed
installer.pods_project.targets.each do |target|
if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
target.build_configurations.each do |config|
puts "- Disable CODE_SIGNING_ALLOWED on #{target} (#{config})"
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
end
end
end
puts "\n"
end