UNPKG

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