@rnx-kit/react-native-host 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,20 @@
1
1
  require 'json'
2
2
 
3
+ source_files = 'cocoa/*.{h,m,mm}'
4
+ public_header_files = 'cocoa/{ReactNativeHost,RNXHostConfig}.h'
5
+
3
6
  package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
7
  version = package['version']
5
8
  repository = package['repository']
9
+ repo_dir = repository['directory']
10
+
11
+ new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
12
+ preprocessor_definitions = ['FOLLY_NO_CONFIG=1']
13
+ if new_arch_enabled
14
+ preprocessor_definitions << 'RCT_NEW_ARCH_ENABLED=1'
15
+ preprocessor_definitions << 'USE_FABRIC=1'
16
+ preprocessor_definitions << 'USE_TURBOMODULE=1'
17
+ end
6
18
 
7
19
  Pod::Spec.new do |s|
8
20
  s.name = 'ReactNativeHost'
@@ -17,14 +29,28 @@ Pod::Spec.new do |s|
17
29
  s.osx.deployment_target = '10.15'
18
30
 
19
31
  s.dependency 'React-Core'
32
+ s.dependency 'React-cxxreact'
33
+
34
+ if new_arch_enabled
35
+ s.dependency 'ReactCommon/turbomodule/core'
36
+ s.dependency 'React-RCTFabric'
37
+ end
20
38
 
21
- s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
39
+ s.pod_target_xcconfig = {
40
+ 'CLANG_CXX_LANGUAGE_STANDARD' => 'gnu++17',
41
+ 'DEFINES_MODULE' => 'YES',
42
+ 'GCC_PREPROCESSOR_DEFINITIONS' => preprocessor_definitions,
43
+ 'HEADER_SEARCH_PATHS' => [
44
+ '$(PODS_ROOT)/Headers/Private/React-Core',
45
+ '$(PODS_ROOT)/boost',
46
+ ],
47
+ }
22
48
 
23
49
  # Include both package and repository relative paths to allow the podspec to
24
50
  # be consumed from both a local path, and as a podspec outside a spec
25
51
  # repository.
26
- s.source_files = 'cocoa/*.{h,m,mm}', # :path
27
- "#{repository['directory']}/cocoa/*.{h,m,mm}" # :podspec
28
- s.public_header_files = 'cocoa/*.h', # :path
29
- "#{repository['directory']}/cocoa/*.h" # :podspec
52
+ s.source_files = source_files, # :path
53
+ "#{repo_dir}/#{source_files}" # :podspec
54
+ s.public_header_files = public_header_files, # :path
55
+ "#{repo_dir}/#{public_header_files}" # :podspec
30
56
  end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rnx-kit/react-native-host",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Simplify React Native initialization",
5
5
  "homepage": "https://github.com/microsoft/rnx-kit/tree/main/packages/react-native-host#readme",
6
6
  "license": "MIT",