Skip to content

Commit

Permalink
[Turbo Modules] Configure podspec for codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
Riccardo Cipolleschi committed Mar 10, 2022
1 parent 9f67f17 commit c2cd950
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 1 deletion.
7 changes: 6 additions & 1 deletion AwesomeApp/ios/AwesomeApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
CD35780927DA5BB60015DDA1 /* RCTCalendarModule.m in Sources */ = {isa = PBXBuildFile; fileRef = CD35780827DA5BB60015DDA1 /* RCTCalendarModule.m */; };
CD35780A27DA5BB60015DDA1 /* RCTCalendarModule.m in Sources */ = {isa = PBXBuildFile; fileRef = CD35780827DA5BB60015DDA1 /* RCTCalendarModule.m */; };
CD35780D27DA64630015DDA1 /* NativeCalendarModule.js in Resources */ = {isa = PBXBuildFile; fileRef = CD35780C27DA64630015DDA1 /* NativeCalendarModule.js */; };
CD35780F27DA661D0015DDA1 /* CalendarModule.podspec in Resources */ = {isa = PBXBuildFile; fileRef = CD35780E27DA661D0015DDA1 /* CalendarModule.podspec */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -47,6 +48,7 @@
CD35780727DA5B070015DDA1 /* RCTCalendarModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTCalendarModule.h; sourceTree = "<group>"; };
CD35780827DA5BB60015DDA1 /* RCTCalendarModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RCTCalendarModule.m; sourceTree = "<group>"; };
CD35780C27DA64630015DDA1 /* NativeCalendarModule.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = NativeCalendarModule.js; sourceTree = "<group>"; };
CD35780E27DA661D0015DDA1 /* CalendarModule.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = CalendarModule.podspec; sourceTree = "<group>"; };
DB3D66F1E8C331413A6C8B5B /* Pods-AwesomeApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AwesomeApp.debug.xcconfig"; path = "Target Support Files/Pods-AwesomeApp/Pods-AwesomeApp.debug.xcconfig"; sourceTree = "<group>"; };
E3E6FABEA70823814F58837F /* Pods-AwesomeApp-AwesomeAppTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AwesomeApp-AwesomeAppTests.release.xcconfig"; path = "Target Support Files/Pods-AwesomeApp-AwesomeAppTests/Pods-AwesomeApp-AwesomeAppTests.release.xcconfig"; sourceTree = "<group>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -161,16 +163,18 @@
CD35780B27DA64520015DDA1 /* js */,
CD35780727DA5B070015DDA1 /* RCTCalendarModule.h */,
CD35780827DA5BB60015DDA1 /* RCTCalendarModule.m */,
CD35780E27DA661D0015DDA1 /* CalendarModule.podspec */,
);
name = CalendarModule;
path = AwesomeApp/CalendarModule;
sourceTree = "<group>";
};
CD35780B27DA64520015DDA1 /* js */ = {
isa = PBXGroup;
children = (
CD35780C27DA64630015DDA1 /* NativeCalendarModule.js */,
);
name = js;
path = js;
sourceTree = "<group>";
};
/* End PBXGroup section */
Expand Down Expand Up @@ -269,6 +273,7 @@
files = (
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
CD35780D27DA64630015DDA1 /* NativeCalendarModule.js in Resources */,
CD35780F27DA661D0015DDA1 /* CalendarModule.podspec in Resources */,
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
29 changes: 29 additions & 0 deletions AwesomeApp/ios/AwesomeApp/CalendarModule/CalendarModule.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
folly_version = '2021.06.28.00-v2'
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
Pod::Spec.new do |s|
s.name = "CalendarModule"
s.version = "0.0.1"
s.summary = "Calendar Module"
s.description = "Calendar Module"
s.homepage = "https://github.com/facebook/react-native.git"
s.license = "MIT"
s.platforms = { :ios => "11.0" }
s.author = ""
s.source = { :git => "https://github.com/facebook/react-native.git", :tag => "#{s.version}" }

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

s.compiler_flags = folly_compiler_flags

s.pod_target_xcconfig = {
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\""
}

s.dependency "React"
s.dependency "React-RCTFabric" # This is for fabric component
s.dependency "React-Codegen"
s.dependency "RCT-Folly", folly_version
s.dependency "RCTRequired"
s.dependency "RCTTypeSafety"
s.dependency "ReactCommon/turbomodule/core"
end
File renamed without changes.
File renamed without changes.
File renamed without changes.
35 changes: 35 additions & 0 deletions RUN.md
Original file line number Diff line number Diff line change
Expand Up @@ -390,3 +390,38 @@ export interface Spec extends TurboModule {
export default (TurboModuleRegistry.get<Spec>('CalendarModule'): ?Spec);
```
### [[Turbo Modules] Configure podspec for codegen]()
Steps:
* In the `AwesomeApp/CalendarModule` group, create a `CalendarModule.podspec` file
* Copy the following code:
```ruby
folly_version = '2021.06.28.00-v2'
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
Pod::Spec.new do |s|
s.name = "CalendarModule"
s.version = "0.0.1"
s.summary = "Calendar Module"
s.description = "Calendar Module"
s.homepage = "https://github.com/facebook/react-native.git"
s.license = "MIT"
s.platforms = { :ios => "11.0" }
s.author = ""
s.source = { :git => "https://github.com/facebook/react-native.git", :tag => "#{s.version}" }
s.source_files = "./**/*.{h,m,mm,swift}"
s.compiler_flags = folly_compiler_flags
s.pod_target_xcconfig = {
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\""
}
s.dependency "React"
s.dependency "React-RCTFabric" # This is for fabric component
s.dependency "React-Codegen"
s.dependency "RCT-Folly", folly_version
s.dependency "RCTRequired"
s.dependency "RCTTypeSafety"
s.dependency "ReactCommon/turbomodule/core"
end
```

0 comments on commit c2cd950

Please sign in to comment.