forked from expo/expo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
podfile_helpers.rb
36 lines (27 loc) · 955 Bytes
/
podfile_helpers.rb
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
require 'pathname'
def brown(message)
return "\e[33m#{message}\e[0m"
end
def blue(message)
return "\e[34m#{message}\e[0m"
end
def eval_versioned_scripts!(file_name, message: '', context: nil)
project_directory = Pod::Config.instance.project_root
project_root_directory = Pathname.new(File.dirname(project_directory))
glob_pattern = File.join(project_directory, "versioned-react-native/ABI*/#{file_name}")
Dir.glob(glob_pattern) { |file_path|
relative_file_path = Pathname.new(file_path).relative_path_from(project_root_directory)
unless message.empty?
puts brown "#{message} #{blue relative_file_path}"
end
eval File.read(file_path), context
}
end
def use_versioned_abis!
eval_versioned_scripts! 'dependencies.rb',
message: 'Using versioned dependencies from'
end
def run_versioned_postinstalls!(pod_name, target_installation_result)
eval_versioned_scripts! 'postinstalls.rb',
context: binding
end