mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
6ef91061e8
Summary: This is the first step towards fixing https://github.com/facebook/react-native/issues/25349. These are the changes to the podspec to correctly update dependencies and build config that will cause any breaking change for users or libraries. I am breaking these changes out from https://github.com/facebook/react-native/pull/25393 as suggested by fkgozali in https://github.com/facebook/react-native/pull/25393#issuecomment-508322884. These are the changes: - Made C++ headers in `React-Core` private by default so that ObjC files can import the module without failures. - Reduced the number of `yoga` headers that are exposed for the same reason as above. As far as I can see this doesn't cause issues but we can find another solution if it does. - Adding some missing dependencies to fix undefined symbols errors. - Added `DoubleConversion` to `HEADER_SEARCH_PATHS` where it was missing. ## Changelog [iOS] [Fixed] - Updated podspecs for improved compatibility with different install types. Pull Request resolved: https://github.com/facebook/react-native/pull/25496 Test Plan: Everything should work exactly as before. I have a branch on my [sample project](https://github.com/jtreanor/react-native-cocoapods-frameworks) here which points at this branch to show that it is still working `Podfile` to demonstrate this is fixed. You can see that it works with these steps: 1. `git clone git@github.com:jtreanor/react-native-cocoapods-frameworks.git` 2. `git checkout podspec-updates` 3. `cd ios && pod install` 4. `cd .. && react-native run-ios` The sample app will build and run successfully. Reviewed By: mmmulani Differential Revision: D16167346 Pulled By: fkgozali fbshipit-source-id: 1917b2f8779cb172362a457fb3fce686c55056d3
54 lines
2.0 KiB
Ruby
54 lines
2.0 KiB
Ruby
# Copyright (c) Facebook, Inc. and its affiliates.
|
||
#
|
||
# This source code is licensed under the MIT license found in the
|
||
# LICENSE file in the root directory of this source tree.
|
||
|
||
package = JSON.parse(File.read(File.expand_path('../../package.json', __dir__)))
|
||
version = package['version']
|
||
|
||
source = { :git => ENV['INSTALL_YOGA_FROM_LOCATION'] || 'https://github.com/facebook/react-native.git' }
|
||
if version == '1000.0.0'
|
||
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
||
source[:commit] = `git rev-parse HEAD`.strip
|
||
else
|
||
source[:tag] = "v#{version}"
|
||
end
|
||
|
||
Pod::Spec.new do |spec|
|
||
spec.name = 'yoga'
|
||
spec.version = "#{version}.React"
|
||
spec.license = { :type => 'MIT' }
|
||
spec.homepage = 'https://yogalayout.com'
|
||
spec.documentation_url = 'https://yogalayout.com/docs/'
|
||
|
||
spec.summary = 'Yoga is a cross-platform layout engine which implements Flexbox.'
|
||
spec.description = 'Yoga is a cross-platform layout engine enabling maximum collaboration within your team by implementing an API many designers are familiar with, and opening it up to developers across different platforms.'
|
||
|
||
spec.authors = 'Facebook'
|
||
spec.source = source
|
||
|
||
spec.module_name = 'yoga'
|
||
spec.requires_arc = false
|
||
spec.compiler_flags = [
|
||
'-fno-omit-frame-pointer',
|
||
'-fexceptions',
|
||
'-Wall',
|
||
'-Werror',
|
||
'-std=c++1y',
|
||
'-fPIC'
|
||
]
|
||
|
||
# Pinning to the same version as React.podspec.
|
||
spec.platforms = { :ios => "9.0", :tvos => "9.2" }
|
||
|
||
# Set this environment variable when *not* using the `:path` option to install the pod.
|
||
# E.g. when publishing this spec to a spec repo.
|
||
source_files = 'yoga/**/*.{cpp,h}'
|
||
source_files = File.join('ReactCommon/yoga', source_files) if ENV['INSTALL_YOGA_WITHOUT_PATH_OPTION']
|
||
spec.source_files = source_files
|
||
|
||
header_files = 'yoga/{Yoga,YGEnums,YGMacros,YGValue}.h'
|
||
header_files = File.join('ReactCommon/yoga', header_files) if ENV['INSTALL_YOGA_WITHOUT_PATH_OPTION']
|
||
spec.public_header_files = header_files
|
||
end
|