-
-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Incorrect source_files path in Podspec #37
Conversation
The file glob was set up such that it would look for ios m and h files in the root directory instead of the ios directory.
@phil-flyclops The podspec is not located in the root directory, but in the |
@zoontek Yes, it was unable to find any files and would make an empty project as a result. The Podspec definition tells what repo to grab from, but doesn't have a way to define where the podspec file itself originally lived so it causes issues if you try to specify source_files from anywhere but the root of the project. CocoaPods explicitly dictates using paths relative from the root of the repository for this reason - https://guides.cocoapods.org/syntax/podspec.html#group_file_patterns |
@phil-flyclops I just gave it a try using this platform :ios, '9.0'
target 'RNLocalizeTest' do
# see https://facebook.github.io/react-native/docs/integration-with-existing-apps#configuring-cocoapods-dependencies
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
'CxxBridge',
'DevSupport',
'RCTAnimation',
'RCTNetwork',
'RCTText',
'RCTWebSocket',
# Add any other subspecs you want to use in your project
]
pod 'RNLocalize', :path => '../node_modules/react-native-localize/ios' # notice the /ios
end Edit: I might add this to the documentation |
The issue I had was stemming out of a use case like this where I have a Podspec instead of a Podfile referencing this as a transitive dependency and no longer have the ability to use relative paths like that - CocoaPods/CocoaPods#3276 I manually solved it for our use case since we have a Private Spec Repo of Pods - https://guides.cocoapods.org/making/private-cocoapods.html It seems like something that would affect folks who have the same use case, but if it is rare enough I can just keep adjusting it on my end as new versions of this library are published. |
To the use-case point, here are two major react native projects that keep their ios code isolated but Podspecs at the top level of the repository to deal with this problem. https://github.com/react-native-community/react-native-linear-gradient Would you be on board with having a copy of the Podspec in the root of the repo with the tweaked source_files directive so that we can support people using the current setup and people using private spec repos? |
@phil-flyclops I just published |
Sweet, thanks! |
The file glob was set up such that it would look for ios m and h
files in the root directory instead of the ios directory.