Consider this as my podfile
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '11.0'
workspace 'ClientMobile.xcworkspace'
target 'Sdk' do
project 'ios-sdk/sdk.xcodeproj'
config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => false
)
end
target 'lib' do
project 'ios-lib/lib.xcodeproj'
end
target 'ClientMobile' do
config = use_native_modules!
# Pods for ClientMobile
end
post_install do |installer|
react_native_post_install(installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
Here we have 3 projects.
- Sdk (Framework Project)
- lib
- App (ClientMobile)
My Sdk is dependent on Lib and my App is dependent on SDK.
How would I structure it so that I can work smoothly in development.
Currently, I follow this flow.
- I have created a podspec file for my
lib
which I refer in my sdk
target 'Sdk' do
project 'ios-sdk/sdk.xcodeproj'
config = use_native_modules!
pod 'react-native-mobile' , :path => "./../mobile-example.podspec"
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => false
)
end
and then I build my sdk, have a podspec file to use output folder as a pod and then do pod install.
I am confident that this is the most in-efficient way of doing it because
- if I add a file in
lib
then to use it in mysdk
I need to do pod install again - I need to create framework and then do pod install
Can someone help me in making this process smooth for development?