From c1b0f398e672b82aed72244ae1170b576de174aa Mon Sep 17 00:00:00 2001 From: Kevin Gozali Date: Fri, 12 Jul 2019 22:34:14 -0700 Subject: [PATCH] TM iOS: move jscallinvoker under ReactCommon podspec Summary: This essentially changes the header namespace to ` ReactCommon}/JSCallInvoker.h | 0 ReactCommon/turbomodule/core/TurboModule.h | 2 +- .../turbomodule/core/TurboModuleUtils.h | 2 +- .../core/platform/ios/RCTTurboModule.h | 2 +- .../core/platform/ios/RCTTurboModule.mm | 2 +- .../platform/ios/RCTTurboModuleManager.mm | 2 +- scripts/autolink-ios.rb | 2 +- template/ios/Podfile | 2 +- 19 files changed, 42 insertions(+), 79 deletions(-) delete mode 100644 ReactCommon/jscallinvoker/React-jscallinvoker.podspec rename ReactCommon/jscallinvoker/{jsireact => ReactCommon}/BridgeJSCallInvoker.cpp (93%) rename ReactCommon/jscallinvoker/{jsireact => ReactCommon}/BridgeJSCallInvoker.h (96%) rename ReactCommon/jscallinvoker/{jsireact => ReactCommon}/JSCallInvoker.h (100%) diff --git a/RNTester/Podfile.lock b/RNTester/Podfile.lock index 06be840d4d3056..9a372bae0a0d1c 100644 --- a/RNTester/Podfile.lock +++ b/RNTester/Podfile.lock @@ -74,9 +74,6 @@ PODS: - React-DevSupport (1000.0.0): - React-Core (= 1000.0.0) - React-RCTWebSocket (= 1000.0.0) - - React-jscallinvoker (1000.0.0): - - Folly (= 2018.10.22.00) - - React-cxxreact (= 1000.0.0) - React-jsi (1000.0.0): - boost-for-react-native (= 1.63.0) - DoubleConversion @@ -122,22 +119,27 @@ PODS: - React-Core (= 1000.0.0) - React-RCTWebSocket (1000.0.0): - React-Core (= 1000.0.0) + - ReactCommon/jscallinvoker (1000.0.0): + - DoubleConversion + - Folly (= 2018.10.22.00) + - glog + - React-cxxreact (= 1000.0.0) - ReactCommon/turbomodule/core (1000.0.0): - DoubleConversion - Folly (= 2018.10.22.00) - glog - React-Core/CxxBridge (= 1000.0.0) - React-cxxreact (= 1000.0.0) - - React-jscallinvoker (= 1000.0.0) - React-jsi (= 1000.0.0) + - ReactCommon/jscallinvoker (= 1000.0.0) - ReactCommon/turbomodule/samples (1000.0.0): - DoubleConversion - Folly (= 2018.10.22.00) - glog - React-Core/CxxBridge (= 1000.0.0) - React-cxxreact (= 1000.0.0) - - React-jscallinvoker (= 1000.0.0) - React-jsi (= 1000.0.0) + - ReactCommon/jscallinvoker (= 1000.0.0) - ReactCommon/turbomodule/core (= 1000.0.0) - yoga (1000.0.0.React) @@ -155,7 +157,6 @@ DEPENDENCIES: - React-CoreModules (from `../React/CoreModules`) - React-cxxreact (from `../ReactCommon/cxxreact`) - React-DevSupport (from `../React`) - - React-jscallinvoker (from `../ReactCommon/jscallinvoker`) - React-jsi (from `../ReactCommon/jsi`) - React-jsiexecutor (from `../ReactCommon/jsiexecutor`) - React-jsinspector (from `../ReactCommon/jsinspector`) @@ -171,6 +172,7 @@ DEPENDENCIES: - React-RCTText (from `../Libraries/Text`) - React-RCTVibration (from `../Libraries/Vibration`) - React-RCTWebSocket (from `../Libraries/WebSocket`) + - ReactCommon/jscallinvoker (from `../ReactCommon`) - ReactCommon/turbomodule/core (from `../ReactCommon`) - ReactCommon/turbomodule/samples (from `../ReactCommon`) - yoga (from `../ReactCommon/yoga`) @@ -206,8 +208,6 @@ EXTERNAL SOURCES: :path: "../ReactCommon/cxxreact" React-DevSupport: :path: "../React" - React-jscallinvoker: - :path: "../ReactCommon/jscallinvoker" React-jsi: :path: "../ReactCommon/jsi" React-jsiexecutor: @@ -258,7 +258,6 @@ SPEC CHECKSUMS: React-CoreModules: b4d2aa51d008ec9edf74f3a03075bbf0359c325f React-cxxreact: 7c4242192149ce0205b53efaa03e3bf86ba4337c React-DevSupport: f34768e3aad3e59ee9800c752a78bc6cb24d0f75 - React-jscallinvoker: e730f2eca4cb27830af459c0a9af00ac6691bf4c React-jsi: 98d1f9d8a79d2720ba6a44c2d928a77f315b7e4f React-jsiexecutor: c0ab8c80a6e88380d63f583690a50d4a723b47b5 React-jsinspector: ea0a218071a11c3687cef2480580180caa6a64c0 @@ -274,7 +273,7 @@ SPEC CHECKSUMS: React-RCTText: 469ec754592c92fc639825e558908c2f0e783e2c React-RCTVibration: ade3c169b54f3bc16c9a9918e17e48ef66aee6ba React-RCTWebSocket: cb5317e9a4adc37191660f819fb21d63433584ef - ReactCommon: 85e9a652d56873ab4e91820ecd759ca006dc1b56 + ReactCommon: 040ed4788f8cae2ffa23b2d5fb0d4afa58c6d646 yoga: b72aa5b3708cc93c5897f8297122d6eba1331e07 PODFILE CHECKSUM: f866eab42001b1d59349bce6b20d00912cdc700c diff --git a/RNTester/RNTesterPods.xcodeproj/project.pbxproj b/RNTester/RNTesterPods.xcodeproj/project.pbxproj index 691488d894e474..5b3b7d43d2d8e5 100644 --- a/RNTester/RNTesterPods.xcodeproj/project.pbxproj +++ b/RNTester/RNTesterPods.xcodeproj/project.pbxproj @@ -134,7 +134,6 @@ E7DB20FA22B2BD53005AC45F /* libReact-Core.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libReact-Core.a"; sourceTree = BUILT_PRODUCTS_DIR; }; E7DB20FC22B2BD53005AC45F /* libReact-cxxreact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libReact-cxxreact.a"; sourceTree = BUILT_PRODUCTS_DIR; }; E7DB20FE22B2BD53005AC45F /* libReact-DevSupport.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libReact-DevSupport.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - E7DB210022B2BD53005AC45F /* libReact-jscallinvoker.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libReact-jscallinvoker.a"; sourceTree = BUILT_PRODUCTS_DIR; }; E7DB210222B2BD53005AC45F /* libReact-jsi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libReact-jsi.a"; sourceTree = BUILT_PRODUCTS_DIR; }; E7DB210422B2BD53005AC45F /* libReact-jsiexecutor.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libReact-jsiexecutor.a"; sourceTree = BUILT_PRODUCTS_DIR; }; E7DB210622B2BD53005AC45F /* libReact-jsinspector.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libReact-jsinspector.a"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -255,7 +254,6 @@ E7DB20FA22B2BD53005AC45F /* libReact-Core.a */, E7DB20FC22B2BD53005AC45F /* libReact-cxxreact.a */, E7DB20FE22B2BD53005AC45F /* libReact-DevSupport.a */, - E7DB210022B2BD53005AC45F /* libReact-jscallinvoker.a */, E7DB210222B2BD53005AC45F /* libReact-jsi.a */, E7DB210422B2BD53005AC45F /* libReact-jsiexecutor.a */, E7DB210622B2BD53005AC45F /* libReact-jsinspector.a */, @@ -760,7 +758,6 @@ "-l\"React-RCTVibration\"", "-l\"React-RCTWebSocket\"", "-l\"React-cxxreact\"", - "-l\"React-jscallinvoker\"", "-l\"React-jsi\"", "-l\"React-jsiexecutor\"", "-l\"React-jsinspector\"", @@ -838,7 +835,6 @@ "-l\"React-RCTVibration\"", "-l\"React-RCTWebSocket\"", "-l\"React-cxxreact\"", - "-l\"React-jscallinvoker\"", "-l\"React-jsi\"", "-l\"React-jsiexecutor\"", "-l\"React-jsinspector\"", diff --git a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon/JSCallInvokerHolder.h b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon/JSCallInvokerHolder.h index 8886af04de30f2..028f86e2c0e292 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon/JSCallInvokerHolder.h +++ b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon/JSCallInvokerHolder.h @@ -8,7 +8,7 @@ #pragma once #include -#include +#include #include namespace facebook { diff --git a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon/TurboModuleManagerDelegate.h b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon/TurboModuleManagerDelegate.h index c8121a1f4431b3..fe07922c99b22a 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon/TurboModuleManagerDelegate.h +++ b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon/TurboModuleManagerDelegate.h @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include diff --git a/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h b/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h index beb67067f0dac4..dab2007434e8bc 100644 --- a/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h +++ b/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include "CxxModuleWrapper.h" #include "JavaModuleWrapper.h" diff --git a/ReactCommon/ReactCommon.podspec b/ReactCommon/ReactCommon.podspec index 9737e311e39a7d..6d3ace59288e5d 100644 --- a/ReactCommon/ReactCommon.podspec +++ b/ReactCommon/ReactCommon.podspec @@ -37,14 +37,23 @@ Pod::Spec.new do |s| "USE_HEADERMAP" => "YES", "CLANG_CXX_LANGUAGE_STANDARD" => "c++14" } + s.subspec "jscallinvoker" do |ss| + ss.source_files = "jscallinvoker/**/*.{cpp,h}" + + ss.dependency "React-cxxreact", version + ss.dependency "DoubleConversion" + ss.dependency "Folly", folly_version + ss.dependency "glog" + end + s.subspec "turbomodule" do |ss| + ss.dependency "ReactCommon/jscallinvoker", version ss.dependency "React-Core/CxxBridge", version ss.dependency "React-cxxreact", version ss.dependency "React-jsi", version ss.dependency "Folly", folly_version ss.dependency "DoubleConversion" ss.dependency "glog" - ss.dependency "React-jscallinvoker", version ss.subspec "core" do |sss| sss.source_files = "turbomodule/core/*.{cpp,h}", diff --git a/ReactCommon/jscallinvoker/Android.mk b/ReactCommon/jscallinvoker/Android.mk index 82e87cd216a46e..c6718fd9b00121 100644 --- a/ReactCommon/jscallinvoker/Android.mk +++ b/ReactCommon/jscallinvoker/Android.mk @@ -8,7 +8,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) # Header search path for all source files in this module. -LOCAL_C_INCLUDES := $(LOCAL_PATH)/jsireact +LOCAL_C_INCLUDES := $(LOCAL_PATH)/ReactCommon # Header search path for modules that depend on this module LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) @@ -20,8 +20,8 @@ LOCAL_STATIC_LIBRARIES = libreactnative # Name of this module. LOCAL_MODULE := jscallinvoker -# Compile all local c++ files under ./jsireact -LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/jsireact/*.cpp) +# Compile all local c++ files under ./ReactCommon +LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/ReactCommon/*.cpp) # Build the files in this directory as a shared library include $(BUILD_STATIC_LIBRARY) diff --git a/ReactCommon/jscallinvoker/BUCK b/ReactCommon/jscallinvoker/BUCK index 2c0dc7bc2512c4..a4a01df4e425e3 100644 --- a/ReactCommon/jscallinvoker/BUCK +++ b/ReactCommon/jscallinvoker/BUCK @@ -1,15 +1,15 @@ -load("//tools/build_defs/oss:rn_defs.bzl", "ANDROID", "APPLE", "react_native_xplat_target", "rn_xplat_cxx_library") +load("//tools/build_defs/oss:rn_defs.bzl", "ANDROID", "APPLE", "react_native_xplat_target", "rn_xplat_cxx_library", "subdir_glob") rn_xplat_cxx_library( name = "jscallinvoker", - srcs = [ - "jsireact/BridgeJSCallInvoker.cpp", - ], + srcs = glob(["**/*.cpp"]), header_namespace = "", - exported_headers = { - "jsireact/BridgeJSCallInvoker.h": "jsireact/BridgeJSCallInvoker.h", - "jsireact/JSCallInvoker.h": "jsireact/JSCallInvoker.h", - }, + exported_headers = subdir_glob( + [ + ("ReactCommon", "*.h"), + ], + prefix = "ReactCommon", + ), compiler_flags = [ "-fexceptions", "-frtti", diff --git a/ReactCommon/jscallinvoker/React-jscallinvoker.podspec b/ReactCommon/jscallinvoker/React-jscallinvoker.podspec deleted file mode 100644 index 335e59929b82fd..00000000000000 --- a/ReactCommon/jscallinvoker/React-jscallinvoker.podspec +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 -# Copyright (c) Facebook, Inc. and its affiliates. -# -# This source code is licensed under the MIT license found in the -# LICENSE file in the root directory of this source tree. - -require "json" - -package = JSON.parse(File.read(File.join(__dir__, "..", "..", "package.json"))) -version = package['version'] - -source = { :git => 'https://github.com/facebook/react-native.git' } -if version == '1000.0.0' - # This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in. - source[:commit] = `git rev-parse HEAD`.strip -else - source[:tag] = "v#{version}" -end - -folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32' -folly_version = '2018.10.22.00' -boost_compiler_flags = '-Wno-documentation' - -Pod::Spec.new do |s| - s.name = "React-jscallinvoker" - s.version = version - s.summary = "-" # TODO - s.homepage = "http://facebook.github.io/react-native/" - s.license = package["license"] - s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "9.0", :tvos => "9.2" } - s.source = source - s.source_files = "jsireact/*.{cpp,h}" - s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags - s.header_dir = "jsireact" - s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/Folly\" \"$(PODS_ROOT)/DoubleConversion\"" } - - s.dependency "React-cxxreact", version - s.dependency "Folly", folly_version - -end diff --git a/ReactCommon/jscallinvoker/jsireact/BridgeJSCallInvoker.cpp b/ReactCommon/jscallinvoker/ReactCommon/BridgeJSCallInvoker.cpp similarity index 93% rename from ReactCommon/jscallinvoker/jsireact/BridgeJSCallInvoker.cpp rename to ReactCommon/jscallinvoker/ReactCommon/BridgeJSCallInvoker.cpp index ed44cf84c3c45a..89686228ad0189 100644 --- a/ReactCommon/jscallinvoker/jsireact/BridgeJSCallInvoker.cpp +++ b/ReactCommon/jscallinvoker/ReactCommon/BridgeJSCallInvoker.cpp @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#include +#include #include namespace facebook { diff --git a/ReactCommon/jscallinvoker/jsireact/BridgeJSCallInvoker.h b/ReactCommon/jscallinvoker/ReactCommon/BridgeJSCallInvoker.h similarity index 96% rename from ReactCommon/jscallinvoker/jsireact/BridgeJSCallInvoker.h rename to ReactCommon/jscallinvoker/ReactCommon/BridgeJSCallInvoker.h index fa21c2a74d7e45..4b21100b25fa6b 100644 --- a/ReactCommon/jscallinvoker/jsireact/BridgeJSCallInvoker.h +++ b/ReactCommon/jscallinvoker/ReactCommon/BridgeJSCallInvoker.h @@ -10,7 +10,7 @@ #include #include -#include +#include namespace facebook { namespace react { diff --git a/ReactCommon/jscallinvoker/jsireact/JSCallInvoker.h b/ReactCommon/jscallinvoker/ReactCommon/JSCallInvoker.h similarity index 100% rename from ReactCommon/jscallinvoker/jsireact/JSCallInvoker.h rename to ReactCommon/jscallinvoker/ReactCommon/JSCallInvoker.h diff --git a/ReactCommon/turbomodule/core/TurboModule.h b/ReactCommon/turbomodule/core/TurboModule.h index 54a39fd76218bd..ced41c0ba00150 100644 --- a/ReactCommon/turbomodule/core/TurboModule.h +++ b/ReactCommon/turbomodule/core/TurboModule.h @@ -12,7 +12,7 @@ #include -#include +#include namespace facebook { namespace react { diff --git a/ReactCommon/turbomodule/core/TurboModuleUtils.h b/ReactCommon/turbomodule/core/TurboModuleUtils.h index 61615ac77132ad..b998aa05c31db6 100644 --- a/ReactCommon/turbomodule/core/TurboModuleUtils.h +++ b/ReactCommon/turbomodule/core/TurboModuleUtils.h @@ -11,7 +11,7 @@ #include -#include +#include using namespace facebook; diff --git a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModule.h b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModule.h index fb47a06bdd3365..4c05f2ff1075d4 100644 --- a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModule.h +++ b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModule.h @@ -12,9 +12,9 @@ #import #import #import +#import #import #import -#import #import #import diff --git a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModule.mm b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModule.mm index 7209c8c264e7fa..dc6bf4bc408550 100644 --- a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModule.mm +++ b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModule.mm @@ -18,10 +18,10 @@ #import #import #import +#import #import #import #import -#import using namespace facebook; diff --git a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm index beabd96de5843a..c3e9f82d11c881 100644 --- a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm +++ b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm @@ -16,9 +16,9 @@ #import #import #import +#import #import #import -#import using namespace facebook; diff --git a/scripts/autolink-ios.rb b/scripts/autolink-ios.rb index 8b72aeb8ba6911..31e8a022f69978 100644 --- a/scripts/autolink-ios.rb +++ b/scripts/autolink-ios.rb @@ -33,10 +33,10 @@ def use_react_native! (options={}) end pod 'React-cxxreact', :path => "#{prefix}/ReactCommon/cxxreact" - pod 'React-jscallinvoker', :path => "#{prefix}/ReactCommon/jscallinvoker" pod 'React-jsi', :path => "#{prefix}/ReactCommon/jsi" pod 'React-jsiexecutor', :path => "#{prefix}/ReactCommon/jsiexecutor" pod 'React-jsinspector', :path => "#{prefix}/ReactCommon/jsinspector" + pod 'ReactCommon/jscallinvoker', :path => "#{prefix}/ReactCommon" pod 'ReactCommon/turbomodule/core', :path => "#{prefix}/ReactCommon" pod 'yoga', :path => "#{prefix}/ReactCommon/yoga" diff --git a/template/ios/Podfile b/template/ios/Podfile index e545dacb203227..5be9812ad51d13 100644 --- a/template/ios/Podfile +++ b/template/ios/Podfile @@ -23,10 +23,10 @@ target 'HelloWorld' do pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket' pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact' - pod 'React-jscallinvoker', :path => "../node_modules/react-native/ReactCommon/jscallinvoker" pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi' pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor' pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector' + pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon" pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon" pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'