From be2bd007de66a4bff0d0a96065bb23cd2d84534f Mon Sep 17 00:00:00 2001 From: JP Simard Date: Tue, 24 May 2016 13:17:36 -0700 Subject: [PATCH 1/6] update CocoaPods gem to 1.0 --- Gemfile.lock | 52 +++++++++++++++++++++++++++------------------------ jazzy.gemspec | 2 +- 2 files changed, 29 insertions(+), 25 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 44eed961e..c7715dff7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,7 +2,7 @@ PATH remote: . specs: jazzy (0.6.2) - cocoapods (~> 0.39) + cocoapods (~> 1.0) mustache (~> 0.99) open4 redcarpet (~> 3.2) @@ -23,38 +23,41 @@ GEM addressable (2.4.0) ast (2.2.0) bacon (1.2.0) - claide (0.9.1) + claide (1.0.0) clintegracon (0.7.0) colored (~> 1.2) diffy - cocoapods (0.39.0) + cocoapods (1.0.1) activesupport (>= 4.0.2) - claide (~> 0.9.1) - cocoapods-core (= 0.39.0) - cocoapods-downloader (~> 0.9.3) - cocoapods-plugins (~> 0.4.2) - cocoapods-search (~> 0.1.0) - cocoapods-stats (~> 0.6.2) - cocoapods-trunk (~> 0.6.4) - cocoapods-try (~> 0.5.1) + claide (>= 1.0.0, < 2.0) + cocoapods-core (= 1.0.1) + cocoapods-deintegrate (>= 1.0.0, < 2.0) + cocoapods-downloader (>= 1.0.0, < 2.0) + cocoapods-plugins (>= 1.0.0, < 2.0) + cocoapods-search (>= 1.0.0, < 2.0) + cocoapods-stats (>= 1.0.0, < 2.0) + cocoapods-trunk (>= 1.0.0, < 2.0) + cocoapods-try (>= 1.0.0, < 2.0) colored (~> 1.2) escape (~> 0.0.4) - molinillo (~> 0.4.0) + fourflusher (~> 0.3.0) + molinillo (~> 0.4.5) nap (~> 1.0) - xcodeproj (~> 0.28.2) - cocoapods-core (0.39.0) + xcodeproj (>= 1.1.0, < 2.0) + cocoapods-core (1.0.1) activesupport (>= 4.0.2) fuzzy_match (~> 2.0.4) nap (~> 1.0) - cocoapods-downloader (0.9.3) - cocoapods-plugins (0.4.2) + cocoapods-deintegrate (1.0.0) + cocoapods-downloader (1.0.0) + cocoapods-plugins (1.0.0) nap - cocoapods-search (0.1.0) - cocoapods-stats (0.6.2) - cocoapods-trunk (0.6.4) + cocoapods-search (1.0.0) + cocoapods-stats (1.0.0) + cocoapods-trunk (1.0.0) nap (>= 0.8, < 2.0) netrc (= 0.7.8) - cocoapods-try (0.5.1) + cocoapods-try (1.0.0) colored (1.2) crack (0.4.3) safe_yaml (~> 1.0.0) @@ -70,6 +73,7 @@ GEM escape (0.0.4) faraday (0.9.2) multipart-post (>= 1.2, < 3) + fourflusher (0.3.1) fuzzy_match (2.0.4) git (1.3.0) hashdiff (0.3.0) @@ -77,7 +81,7 @@ GEM json (1.8.3) liferaft (0.0.4) metaclass (0.0.4) - minitest (5.8.4) + minitest (5.9.0) mocha (1.1.0) metaclass (~> 0.0.1) mocha-on-bacon (0.2.2) @@ -98,7 +102,7 @@ GEM rainbow (2.1.0) rake (10.5.0) redcarpet (3.3.4) - rouge (1.10.1) + rouge (1.11.0) rubocop (0.39.0) parser (>= 2.3.0.7, < 3.0) powerpack (~> 0.1) @@ -123,9 +127,9 @@ GEM hashdiff xcinvoke (0.2.1) liferaft (~> 0.0.4) - xcodeproj (0.28.2) + xcodeproj (1.1.0) activesupport (>= 3) - claide (~> 0.9.1) + claide (>= 1.0.0, < 2.0) colored (~> 1.2) PLATFORMS diff --git a/jazzy.gemspec b/jazzy.gemspec index ef50b069c..01dbb54e6 100644 --- a/jazzy.gemspec +++ b/jazzy.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |spec| spec.extensions = ['lib/jazzy/SourceKitten/Rakefile'] - spec.add_runtime_dependency 'cocoapods', '~> 0.39' + spec.add_runtime_dependency 'cocoapods', '~> 1.0' spec.add_runtime_dependency 'mustache', '~> 0.99' spec.add_runtime_dependency 'open4' spec.add_runtime_dependency 'redcarpet', '~> 3.2' From 1d8b1a75cb7fc09f62c4355d922a7bbcce9dbb8a Mon Sep 17 00:00:00 2001 From: Samuel Giddins Date: Wed, 8 Jun 2016 02:36:52 -0500 Subject: [PATCH 2/6] [PodspecDocumenter] Compute targets for CocoaPods 1.0 --- lib/jazzy/podspec_documenter.rb | 51 +++++++++++++++------------------ 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/lib/jazzy/podspec_documenter.rb b/lib/jazzy/podspec_documenter.rb index fc75c600b..7c0a9a5fc 100644 --- a/lib/jazzy/podspec_documenter.rb +++ b/lib/jazzy/podspec_documenter.rb @@ -10,17 +10,25 @@ def initialize(podspec) end def sourcekitten_output - sandbox = Pod::Sandbox.new(pod_config.sandbox_root) - installer = Pod::Installer.new(sandbox, podfile) - installer.install! - stdout = Dir.chdir(sandbox.root) do - pod_targets.map do |t| - SourceKitten.run_sourcekitten( - %W(doc --module-name #{podspec.module_name} -- -target #{t}), - ) + installation_root = Pathname(Dir.mktmpdir(['jazzy', podspec.name])) + installation_root.rmtree if installation_root.exist? + Pod::Config.instance.with_changes(installation_root: installation_root) do + sandbox = Pod::Sandbox.new(Pod::Config.instance.sandbox_root) + installer = Pod::Installer.new(sandbox, podfile) + installer.install! + stdout = Dir.chdir(sandbox.root) do + targets = installer.pod_targets + .select { |pt| pt.pod_name == podspec.root.name} + .map(&:label) + + targets.map do |t| + SourceKitten.run_sourcekitten( + %W(doc --module-name #{podspec.module_name} -- -target #{t}), + ) + end end + stdout.reduce([]) { |a, s| a + JSON.load(s) }.to_json end - stdout.reduce([]) { |a, s| a + JSON.load(s) }.to_json end def self.create_podspec(podspec_path) @@ -82,18 +90,6 @@ def self.github_file_prefix(podspec) # @!group SourceKitten output helper methods - attr_reader :pod_targets - - def pod_config - Pod::Config.instance.tap do |c| - c.installation_root = Pathname(Dir.mktmpdir) - c.installation_root.rmtree if c.installation_root.exist? - c.integrate_targets = false - c.deduplicate_targets = false - c.deterministic_uuids = false - end - end - def pod_path if podspec.defined_in_file podspec.defined_in_file.parent @@ -105,19 +101,18 @@ def pod_path def podfile podspec = @podspec path = pod_path - targets = (@pod_targets ||= []) @podfile ||= Pod::Podfile.new do - platform :ios, '8.0' + install! 'cocoapods', + integrate_targets: false, + deterministic_uuids: false + [podspec, *podspec.recursive_subspecs].each do |ss| ss.available_platforms.each do |p| # Travis builds take too long when building docs for all available # platforms for the Moya integration spec, so we just document OSX. # TODO: remove once jazzy is fast enough. - next if ENV['JAZZY_INTEGRATION_SPECS'] && - !p.to_s.start_with?('OS X') - t = "Jazzy-#{ss.name.gsub('/', '__')}-#{p.name}" - targets << "Pods-#{t}-#{ss.root.name}" - target(t) do + next if ENV['JAZZY_INTEGRATION_SPECS'] && p.name != :osx + target("Jazzy-#{ss.name.gsub('/', '__')}-#{p.name}") do use_frameworks! platform p.name, p.deployment_target pod ss.name, path: path.realpath.to_s From ede02abafc80feffd649ad156afa5bd52deeb476 Mon Sep 17 00:00:00 2001 From: Samuel Giddins Date: Wed, 8 Jun 2016 12:58:18 -0500 Subject: [PATCH 3/6] [Integration] Ensure updating the CocoaPods specs repo is silent --- spec/integration_spec.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/spec/integration_spec.rb b/spec/integration_spec.rb index 64a3f7593..e5325d6f4 100644 --- a/spec/integration_spec.rb +++ b/spec/integration_spec.rb @@ -49,8 +49,15 @@ require 'CLIntegracon' require 'cocoapods' -Pod::Config.instance.silent = true -Pod::Command::Setup.invoke +Pod::Config.instance.with_changes(silent: true) do + config = Pod::Config.instance + # working around a bug where `pod setup --silent` isn't silent + if config.sources_manager.master_repo_functional? + Pod::Command::Repo::Update.invoke(%w(master)) + else + Pod::Command::Setup.invoke + end +end CLIntegracon.configure do |c| c.spec_path = ROOT + 'spec/integration_specs' From 2ea5864e8780f201a7d22407c015b9447aaa5530 Mon Sep 17 00:00:00 2001 From: JP Simard Date: Wed, 8 Jun 2016 13:08:41 -0700 Subject: [PATCH 4/6] update integration specs for rouge 1.11.0 --- spec/integration_specs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/integration_specs b/spec/integration_specs index 554a5ea02..8cbd362e9 160000 --- a/spec/integration_specs +++ b/spec/integration_specs @@ -1 +1 @@ -Subproject commit 554a5ea02a5d598d92a7b443176e9dff84a17220 +Subproject commit 8cbd362e989ff9355eb589a22a7d8d674578522c From d3ef2d74e61341e9efec3cef36cae84d9e153b15 Mon Sep 17 00:00:00 2001 From: JP Simard Date: Wed, 8 Jun 2016 14:02:15 -0700 Subject: [PATCH 5/6] fix rubocop violations --- lib/jazzy/podspec_documenter.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/jazzy/podspec_documenter.rb b/lib/jazzy/podspec_documenter.rb index 7c0a9a5fc..97586e1e3 100644 --- a/lib/jazzy/podspec_documenter.rb +++ b/lib/jazzy/podspec_documenter.rb @@ -18,8 +18,8 @@ def sourcekitten_output installer.install! stdout = Dir.chdir(sandbox.root) do targets = installer.pod_targets - .select { |pt| pt.pod_name == podspec.root.name} - .map(&:label) + .select { |pt| pt.pod_name == podspec.root.name } + .map(&:label) targets.map do |t| SourceKitten.run_sourcekitten( @@ -103,8 +103,8 @@ def podfile path = pod_path @podfile ||= Pod::Podfile.new do install! 'cocoapods', - integrate_targets: false, - deterministic_uuids: false + integrate_targets: false, + deterministic_uuids: false [podspec, *podspec.recursive_subspecs].each do |ss| ss.available_platforms.each do |p| From fa03b9ec9c9cd5c43bbb319c8efd7ffba92f8b6e Mon Sep 17 00:00:00 2001 From: JP Simard Date: Wed, 8 Jun 2016 14:28:57 -0700 Subject: [PATCH 6/6] add changelog entries for cocoapods & rouge updates --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 874d5951e..36bee86bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ [Gurrinder](https://github.com/gurrinder) [#503](https://github.com/realm/jazzy/issues/503) +* The `cocoapods` gem was updated to 1.0.1 and `rouge` to 1.11.0. + [JP Simard](https://github.com/jpsim) + ##### Bug Fixes * None.