Skip to content

Commit

Permalink
Have CocoaPods read some values from package.json
Browse files Browse the repository at this point in the history
Allows you to keep versions, descriptions in sync
  • Loading branch information
nevir committed Mar 22, 2016
1 parent 1f94a00 commit 8723aee
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions React.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
require 'json'

package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

Pod::Spec.new do |s|
s.name = "React"
s.version = "0.0.1-master"
s.summary = "Build high quality mobile apps using React."
s.version = package['version'].start_with?('0.0.0') ? '0.0.1-master' : package['version']
s.summary = package['description']
s.description = <<-DESC
React Native apps are built using the React JS
framework, and render directly to native UIKit
Expand All @@ -16,7 +20,7 @@ Pod::Spec.new do |s|
quality or capability.
DESC
s.homepage = "http://facebook.github.io/react-native/"
s.license = "BSD"
s.license = package['license']
s.author = "Facebook"
s.source = { :git => "https://github.com/facebook/react-native.git", :tag => "v#{s.version}" }
s.default_subspec = 'Core'
Expand Down

0 comments on commit 8723aee

Please sign in to comment.