UNPKG

4.28 kBPlain TextView Raw
1# Copyright (c) Facebook, Inc. and its affiliates.
2#
3# This source code is licensed under the MIT license found in the
4# LICENSE file in the root directory of this source tree.
5
6require "json"
7
8package = JSON.parse(File.read(File.join(__dir__, "package.json")))
9version = package['version']
10
11source = { :git => 'https://github.com/facebook/react-native.git' }
12if version == '1000.0.0'
13 # This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
14 source[:commit] = `git rev-parse HEAD`.strip
15else
16 source[:tag] = "v#{version}"
17end
18
19folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
20folly_version = '2018.10.22.00'
21boost_compiler_flags = '-Wno-documentation'
22
23header_subspecs = {
24 'ARTHeaders' => 'Libraries/ART/**/*.h',
25 'CoreModulesHeaders' => 'React/CoreModules/**/*.h',
26 'RCTActionSheetHeaders' => 'Libraries/ActionSheetIOS/*.h',
27 'RCTAnimationHeaders' => 'Libraries/NativeAnimation/{Drivers/*,Nodes/*,*}.{h}',
28 'RCTBlobHeaders' => 'Libraries/Blob/{RCTBlobManager,RCTFileReaderModule}.h',
29 'RCTImageHeaders' => 'Libraries/Image/*.h',
30 'RCTLinkingHeaders' => 'Libraries/LinkingIOS/*.h',
31 'RCTNetworkHeaders' => 'Libraries/Network/*.h',
32 'RCTPushNotificationHeaders' => 'Libraries/PushNotificationIOS/*.h',
33 'RCTSettingsHeaders' => 'Libraries/Settings/*.h',
34 'RCTTextHeaders' => 'Libraries/Text/**/*.h',
35 'RCTVibrationHeaders' => 'Libraries/Vibration/*.h',
36}
37
38Pod::Spec.new do |s|
39 s.name = "React-Core"
40 s.version = version
41 s.summary = "The core of React Native."
42 s.homepage = "http://facebook.github.io/react-native/"
43 s.license = package["license"]
44 s.author = "Facebook, Inc. and its affiliates"
45 s.platforms = { :ios => "9.0", :tvos => "9.2" }
46 s.source = source
47 s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
48 s.header_dir = "React"
49 s.framework = "JavaScriptCore"
50 s.library = "stdc++"
51 s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Folly\"" }
52 s.user_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/Headers/Private/React-Core\""}
53 s.default_subspec = "Default"
54
55 s.subspec "Default" do |ss|
56 ss.source_files = "React/**/*.{c,h,m,mm,S,cpp}"
57 ss.exclude_files = "React/CoreModules/**/*",
58 "React/DevSupport/**/*",
59 "React/Fabric/**/*",
60 "React/Inspector/**/*"
61 ss.ios.exclude_files = "React/**/RCTTV*.*"
62 ss.tvos.exclude_files = "React/Modules/RCTClipboard*",
63 "React/Views/RCTDatePicker*",
64 "React/Views/RCTPicker*",
65 "React/Views/RCTRefreshControl*",
66 "React/Views/RCTSlider*",
67 "React/Views/RCTSwitch*",
68 ss.private_header_files = "React/Cxx*/*.h"
69 end
70
71 s.subspec "DevSupport" do |ss|
72 ss.source_files = "React/DevSupport/*.{h,mm,m}",
73 "React/Inspector/*.{h,mm,m}"
74
75 ss.dependency "React-Core/Default", version
76 ss.dependency "React-Core/RCTWebSocket", version
77 ss.dependency "React-jsinspector", version
78 end
79
80 s.subspec "RCTWebSocket" do |ss|
81 ss.source_files = "Libraries/WebSocket/*.{h,m}"
82 ss.dependency "React-Core/Default", version
83 end
84
85 # Add a subspec containing just the headers for each
86 # pod that should live under <React/*.h>
87 header_subspecs.each do |name, headers|
88 s.subspec name do |ss|
89 ss.source_files = headers
90 ss.dependency "React-Core/Default"
91 end
92 end
93
94 s.dependency "Folly", folly_version
95 s.dependency "React-cxxreact", version
96 s.dependency "React-jsi", version
97 s.dependency "React-jsiexecutor", version
98 s.dependency "Yoga"
99 s.dependency "glog"
100end