Skip to content
This repository was archived by the owner on Jul 1, 2025. It is now read-only.

Commit 7ec3849

Browse files
author
Riccardo Cipolleschi
committed
[Setup] update podspec
1 parent a2d9d5c commit 7ec3849

File tree

2 files changed

+58
-18
lines changed

2 files changed

+58
-18
lines changed

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,61 @@ Start from there up to the `[TurboModule] Test the Turbomodule` section. Then, f
66
## Table of contents
77

88
* [[Setup] Update to 0.71-RC.3](#update)
9+
* [[Setup] Update podspec](#update-podspec)
10+
911

1012
## Steps
1113

1214
### <a name="update">[[Setup] Update to 0.71-RC.3]()
1315

1416
1. `cd NewArchitecture` - It has been created in this [step](https://github.com/react-native-community/RNNewArchitectureLibraries/tree/feat/back-turbomodule-070#tm-test).
1517
2. `yarn add react-native@0.71.0-rc.3`
18+
19+
### <a name="update-podspec">[[Setup] Update podspec]()
20+
21+
1. Open the `calculator/calculator.podspec` file
22+
2. Update it as it follows:
23+
```diff
24+
require "json"
25+
26+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
27+
28+
-folly_version = '2021.07.22.00'
29+
-folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
30+
31+
Pod::Spec.new do |s|
32+
s.name = "calculator"
33+
s.version = package["version"]
34+
s.summary = package["description"]
35+
s.description = package["description"]
36+
s.homepage = package["homepage"]
37+
s.license = package["license"]
38+
s.platforms = { :ios => "11.0" }
39+
s.author = package["author"]
40+
s.source = { :git => package["repository"], :tag => "#{s.version}" }
41+
42+
s.source_files = "ios/**/*.{h,m,mm,swift}"
43+
44+
+ s.pod_target_xcconfig = {
45+
+ "DEFINE_MODULES" => "YES",
46+
+ "BUILD_LIBRARY_FOR_DISTRIBUTION" => "YES",
47+
+ "SWIFT_OBJC_BRIDGING_HEADER" => "../../node_modules/calculator/ios/calculator-Bridging-Header.h"
48+
+ }
49+
50+
+ install_modules_dependencies(s)
51+
- # This guard prevent to install the dependencies when we run `pod install` in the old architecture.
52+
- if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
53+
- s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
54+
- s.pod_target_xcconfig = {
55+
- "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
56+
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
57+
- }
58+
-
59+
- s.dependency "React-Codegen"
60+
- s.dependency "RCT-Folly", folly_version
61+
- s.dependency "RCTRequired"
62+
- s.dependency "RCTTypeSafety"
63+
- s.dependency "ReactCommon/turbomodule/core"
64+
- end
65+
end
66+
```

calculator/calculator.podspec

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ require "json"
22

33
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
44

5-
folly_version = '2021.07.22.00'
6-
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
7-
85
Pod::Spec.new do |s|
96
s.name = "calculator"
107
s.version = package["version"]
@@ -18,20 +15,12 @@ Pod::Spec.new do |s|
1815

1916
s.source_files = "ios/**/*.{h,m,mm,swift}"
2017

21-
s.dependency "React-Core"
22-
23-
# This guard prevent to install the dependencies when we run `pod install` in the old architecture.
24-
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
25-
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
26-
s.pod_target_xcconfig = {
27-
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
28-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
29-
}
18+
s.pod_target_xcconfig = {
19+
"DEFINES_MODULE" => "YES",
20+
"BUILD_LIBRARY_FOR_DISTRIBUTION" => "YES",
21+
"SWIFT_OBJC_BRIDGING_HEADER" => "../../node_modules/calculator/ios/calculator-Bridging-Header.h",
22+
"OTHER_CPLUSPLUSFLAGS" => "-DRCT_NEW_ARCH_ENABLED=1"
23+
}
3024

31-
s.dependency "React-Codegen"
32-
s.dependency "RCT-Folly", folly_version
33-
s.dependency "RCTRequired"
34-
s.dependency "RCTTypeSafety"
35-
s.dependency "ReactCommon/turbomodule/core"
36-
end
25+
install_modules_dependencies(s)
3726
end

0 commit comments

Comments
 (0)