UNPKG

2.75 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
23Pod::Spec.new do |s|
24 s.name = "ReactCommon"
25 s.module_name = "ReactCommon"
26 s.version = version
27 s.summary = "-" # TODO
28 s.homepage = "http://facebook.github.io/react-native/"
29 s.license = package["license"]
30 s.author = "Facebook, Inc. and its affiliates"
31 s.platforms = { :ios => "9.0", :tvos => "9.2" }
32 s.source = source
33 s.header_dir = "ReactCommon" # Use global header_dir for all subspecs for use_frameworks! compatibility
34 s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
35 s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/React-Core\"",
36 "USE_HEADERMAP" => "YES",
37 "CLANG_CXX_LANGUAGE_STANDARD" => "c++14" }
38
39 s.subspec "callinvoker" do |ss|
40 ss.source_files = "callinvoker/**/*.{cpp,h}"
41
42 ss.dependency "React-cxxreact", version
43 ss.dependency "DoubleConversion"
44 ss.dependency "Folly", folly_version
45 ss.dependency "glog"
46 end
47
48 s.subspec "turbomodule" do |ss|
49 ss.dependency "ReactCommon/callinvoker", version
50 ss.dependency "React-Core", version
51 ss.dependency "React-cxxreact", version
52 ss.dependency "React-jsi", version
53 ss.dependency "Folly", folly_version
54 ss.dependency "DoubleConversion"
55 ss.dependency "glog"
56
57 ss.subspec "core" do |sss|
58 sss.source_files = "turbomodule/core/*.{cpp,h}",
59 "turbomodule/core/platform/ios/*.{mm,cpp,h}"
60 end
61
62 ss.subspec "samples" do |sss|
63 sss.source_files = "turbomodule/samples/*.{cpp,h}",
64 "turbomodule/samples/platform/ios/*.{mm,cpp,h}"
65 sss.dependency "ReactCommon/turbomodule/core", version
66 end
67 end
68end