|
| 1 | +# Copyright (c) Meta Platforms, Inc. and 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 | + |
| 6 | +require "json" |
| 7 | + |
| 8 | +package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "package.json"))) |
| 9 | +version = package['version'] |
| 10 | + |
| 11 | +source = { :git => 'https://github.com/facebook/react-native.git' } |
| 12 | +if 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 if system("git rev-parse --git-dir > /dev/null 2>&1") |
| 15 | +else |
| 16 | + source[:tag] = "v#{version}" |
| 17 | +end |
| 18 | + |
| 19 | +folly_config = get_folly_config() |
| 20 | +folly_compiler_flags = folly_config[:compiler_flags] |
| 21 | + |
| 22 | +header_search_paths = [ |
| 23 | + "\"$(PODS_ROOT)/RCT-Folly\"", |
| 24 | +] |
| 25 | + |
| 26 | +if ENV['USE_FRAMEWORKS'] |
| 27 | + header_search_paths << "\"$(PODS_TARGET_SRCROOT)/../..\"" |
| 28 | +end |
| 29 | + |
| 30 | +header_dir = 'jsinspector-modern/network' |
| 31 | +module_name = "jsinspector_modernnetwork" |
| 32 | + |
| 33 | +Pod::Spec.new do |s| |
| 34 | + s.name = "React-jsinspectornetwork" |
| 35 | + s.version = version |
| 36 | + s.summary = "Network inspection for React Native DevTools" |
| 37 | + s.homepage = "https://reactnative.dev/" |
| 38 | + s.license = package["license"] |
| 39 | + s.author = "Meta Platforms, Inc. and its affiliates" |
| 40 | + s.platforms = min_supported_versions |
| 41 | + s.source = source |
| 42 | + s.source_files = "*.{cpp,h}" |
| 43 | + s.header_dir = header_dir |
| 44 | + s.compiler_flags = folly_compiler_flags |
| 45 | + s.pod_target_xcconfig = { |
| 46 | + "HEADER_SEARCH_PATHS" => header_search_paths.join(' '), |
| 47 | + "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(), |
| 48 | + "DEFINES_MODULE" => "YES"} |
| 49 | + |
| 50 | + if ENV['USE_FRAMEWORKS'] |
| 51 | + s.module_name = module_name |
| 52 | + s.header_mappings_dir = "../.." |
| 53 | + end |
| 54 | + |
| 55 | + s.dependency "glog" |
| 56 | + s.dependency "RCT-Folly" |
| 57 | +end |
0 commit comments