Fixes current CI failures and allows tree shaking of native dev support code.

Summary:
* The dev support code moved into a `DevSupport` subspec, meaning that only if the subspec is specified in the user’s Podfile will the packager client, dev menu, etc be included. This is mainly done through checks for header availability.

  It also improves the weird situation where you had to specify the `RCTWebSocket` subspec if you wanted to be able to use the packager client during development.

* I removed hardcoding the release version in the podspec on release, because the podspec still relies on `package.json` when evaluating, so there’s no real point in not also getting the version number from there. This should remove any requirement to perform maintenance of the OSS release script regarding the podspec.
Closes https://github.com/facebook/react-native/pull/12602

Differential Revision: D4621021

Pulled By: ericvicenti

fbshipit-source-id: 6c208371fc40ea607809a6ab05dd3714ed9980cf
This commit is contained in:
Eloy Durán
2017-02-27 13:25:47 -08:00
committed by Facebook Github Bot
parent 24a7665df5
commit 19caaba1d5
6 changed files with 61 additions and 25 deletions

View File

@@ -1,10 +1,19 @@
require "json"
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
version = package['version']
source = { :git => '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 were presumably in.
source[:commit] = `git rev-parse HEAD`.strip
else
source[:tag] = "v#{version}"
end
Pod::Spec.new do |s|
s.name = "React"
s.version = package["version"]
s.version = version
s.summary = package["description"]
s.description = <<-DESC
React Native apps are built using the React JS
@@ -22,7 +31,7 @@ Pod::Spec.new do |s|
s.homepage = "http://facebook.github.io/react-native/"
s.license = package["license"]
s.author = "Facebook"
s.source = { :git => "https://github.com/facebook/react-native.git", :tag => "v#{s.version}" }
s.source = source
s.default_subspec = "Core"
s.requires_arc = true
s.platform = :ios, "8.0"
@@ -34,11 +43,17 @@ Pod::Spec.new do |s|
ss.dependency "Yoga", "#{package["version"]}.React"
ss.dependency "React/cxxreact"
ss.source_files = "React/**/*.{c,h,m,mm,S}"
ss.exclude_files = "**/__tests__/*", "IntegrationTests/*", "React/**/RCTTVView.*", "ReactCommon/yoga/*", "React/Cxx*/*"
ss.exclude_files = "**/__tests__/*", "IntegrationTests/*", "React/DevSupport/*", "React/Modules/RCTDev{LoadingView,Menu}.*", "React/**/RCTTVView.*", "ReactCommon/yoga/*", "React/Cxx*/*"
ss.framework = "JavaScriptCore"
ss.libraries = "stdc++"
end
s.subspec "DevSupport" do |ss|
ss.dependency "React/Core"
ss.dependency "React/RCTWebSocket"
ss.source_files = "React/DevSupport/*", "React/Modules/RCTDev{LoadingView,Menu}.*"
end
s.subspec "tvOS" do |ss|
ss.dependency "React/Core"
ss.source_files = "React/**/RCTTVView.{h, m}"