-
Notifications
You must be signed in to change notification settings - Fork 2
/
rn-mapbox-navigation.podspec
51 lines (42 loc) · 1.96 KB
/
rn-mapbox-navigation.podspec
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
require "json"
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
# TargetsToChangeToDynamic = ['MapboxMobileEvents']
TargetsToChangeToDynamic = []
$RNMBNAV = Object.new
def $RNMBNAV.post_install(installer)
installer.pod_targets.each do |pod|
if TargetsToChangeToDynamic.include?(pod.name)
if pod.send(:build_type) != Pod::BuildType.dynamic_framework
pod.instance_variable_set(:@build_type,Pod::BuildType.dynamic_framework)
puts "* Changed #{pod.name} to `#{pod.send(:build_type)}`"
fail "Unable to change build_type" unless mobile_events_target.send(:build_type) == Pod::BuildType.dynamic_framework
end
end
end
end
def $RNMBNAV.pre_install(installer)
installer.aggregate_targets.each do |target|
target.pod_targets.select { |p| TargetsToChangeToDynamic.include?(p.name) }.each do |mobile_events_target|
mobile_events_target.instance_variable_set(:@build_type,Pod::BuildType.dynamic_framework)
puts "* Changed #{mobile_events_target.name} to #{mobile_events_target.send(:build_type)}"
fail "Unable to change build_type" unless mobile_events_target.send(:build_type) == Pod::BuildType.dynamic_framework
end
end
end
Pod::Spec.new do |s|
s.name = "rn-mapbox-navigation"
s.version = package["version"]
s.summary = package["description"]
s.description = <<-DESC
Smart Mapbox turn-by-turn routing based on real-time traffic for React Native.
DESC
s.homepage = "https://github.com/homeeondemand/react-native-mapbox-navigation"
s.license = { :type => "MIT", :file => "LICENSE" }
s.authors = { "HOMEE" => "[email protected]" }
s.platforms = { :ios => "11.0" }
s.source = { :git => "https://github.com/homeeondemand/react-native-mapbox-navigation.git", :tag => "#{s.version}" }
s.source_files = "ios/**/*.{h,m,swift}"
s.requires_arc = true
s.dependency "React-Core"
s.dependency "MapboxNavigation", "~> 2.1.0"
end