UNPKG

3.41 kBPlain TextView Raw
1require "json"
2
3package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
5reactVersion = '0.0.0'
6
7begin
8 reactVersion = JSON.parse(File.read(File.join(__dir__, "..", "..", "node_modules", "react-native", "package.json")))["version"]
9rescue
10 # Example app
11 reactVersion = JSON.parse(File.read(File.join(__dir__, "node_modules", "react-native", "package.json")))["version"]
12end
13
14rnVersion = reactVersion.split('.')[1]
15
16folly_prefix = ""
17if rnVersion.to_i >= 64
18 folly_prefix = "RCT-"
19end
20
21
22folly_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DRNVERSION=' + rnVersion
23folly_compiler_flags = folly_flags + ' ' + '-Wno-comma -Wno-shorten-64-to-32'
24folly_version = '2021.04.26.00'
25boost_compiler_flags = '-Wno-documentation'
26
27Pod::Spec.new do |s|
28 s.name = "RNReanimated"
29 s.version = package["version"]
30 s.summary = package["description"]
31 s.description = <<-DESC
32 RNReanimated
33 DESC
34 s.homepage = "https://github.com/software-mansion/react-native-reanimated"
35 s.license = "MIT"
36 # s.license = { :type => "MIT", :file => "FILE_LICENSE" }
37 s.author = { "author" => "author@domain.cn" }
38 s.platforms = { :ios => "9.0", :tvos => "9.0" }
39 s.source = { :git => "https://github.com/software-mansion/react-native-reanimated.git", :tag => "#{s.version}" }
40
41 s.source_files = [
42 "ios/**/*.{mm,h,m}",
43 "Common/cpp/**/*.cpp",
44 "Common/cpp/headers/**/*.h"
45 ]
46
47 s.preserve_paths = [
48 "Common/cpp/hidden_headers/**"
49 ]
50
51 s.pod_target_xcconfig = {
52 "USE_HEADERMAP" => "YES",
53 "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/#{folly_prefix}Folly\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/React-Core\" "
54 }
55 s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
56 s.xcconfig = {
57 "CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
58 "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/#{folly_prefix}Folly\" \"${PODS_ROOT}/Headers/Public/React-hermes\" \"${PODS_ROOT}/Headers/Public/hermes-engine\"",
59 "OTHER_CFLAGS" => "$(inherited)" + " " + folly_flags }
60
61 s.requires_arc = true
62
63 s.dependency "React"
64 s.dependency 'FBLazyVector'
65 s.dependency 'FBReactNativeSpec'
66 s.dependency 'RCTRequired'
67 s.dependency 'RCTTypeSafety'
68 s.dependency 'React-Core'
69 s.dependency 'React-CoreModules'
70 s.dependency 'React-Core/DevSupport'
71 s.dependency 'React-RCTActionSheet'
72 s.dependency 'React-RCTNetwork'
73 s.dependency 'React-RCTAnimation'
74 s.dependency 'React-RCTLinking'
75 s.dependency 'React-RCTBlob'
76 s.dependency 'React-RCTSettings'
77 s.dependency 'React-RCTText'
78 s.dependency 'React-RCTVibration'
79 s.dependency 'React-RCTImage'
80 s.dependency 'React-Core/RCTWebSocket'
81 s.dependency 'React-cxxreact'
82 s.dependency 'React-jsi'
83 s.dependency 'React-jsiexecutor'
84 s.dependency 'React-jsinspector'
85 s.dependency 'ReactCommon/turbomodule/core'
86 s.dependency 'Yoga'
87 s.dependency 'DoubleConversion'
88 s.dependency 'glog'
89
90 if reactVersion.match(/^0.62/)
91 s.dependency 'ReactCommon/callinvoker'
92 else
93 s.dependency 'React-callinvoker'
94 end
95
96 s.dependency "#{folly_prefix}Folly"
97
98end