Skip to content
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

update CocoaPods gem to 1.0 #569

Merged
merged 6 commits into from
Jun 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
52 changes: 28 additions & 24 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PATH
remote: .
specs:
jazzy (0.6.2)
cocoapods (~> 0.39)
cocoapods (~> 1.0)
mustache (~> 0.99)
open4
redcarpet (~> 3.2)
Expand All @@ -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)
Expand All @@ -70,14 +73,15 @@ 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)
i18n (0.7.0)
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)
Expand All @@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion jazzy.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
51 changes: 23 additions & 28 deletions lib/jazzy/podspec_documenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
11 changes: 9 additions & 2 deletions spec/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion spec/integration_specs
Submodule integration_specs updated 23 files
+2 −2 document_alamofire/after/docs/Protocols/ResponseSerializerType.html
+2 −2 ...fire/after/docs/docsets/Alamofire.docset/Contents/Resources/Documents/Protocols/ResponseSerializerType.html
+0 −1 document_moya_podspec/after/execution_output.txt
+1 −1 document_realm_objc/after/docs/Classes/RLMArray.html
+1 −1 document_realm_objc/after/docs/Classes/RLMResults.html
+1 −1 document_realm_objc/after/docs/Classes/RLMSortDescriptor.html
+1 −1 document_realm_objc/after/docs/Protocols/RLMCollection.html
+1 −1 document_realm_objc/after/docs/docsets/Realm.docset/Contents/Resources/Documents/Classes/RLMArray.html
+1 −1 document_realm_objc/after/docs/docsets/Realm.docset/Contents/Resources/Documents/Classes/RLMResults.html
+1 −1 ...ment_realm_objc/after/docs/docsets/Realm.docset/Contents/Resources/Documents/Classes/RLMSortDescriptor.html
+1 −1 document_realm_objc/after/docs/docsets/Realm.docset/Contents/Resources/Documents/Protocols/RLMCollection.html
+1 −1 document_realm_swift/after/docs/Classes/AnyRealmCollection.html
+1 −1 document_realm_swift/after/docs/Classes/LinkingObjects.html
+1 −1 document_realm_swift/after/docs/Classes/List.html
+1 −1 document_realm_swift/after/docs/Classes/Results.html
+2 −2 document_realm_swift/after/docs/Protocols/RealmCollectionType.html
+1 −1 document_realm_swift/after/docs/Structs/SortDescriptor.html
+1 −1 ...alm_swift/after/docs/docsets/RealmSwift.docset/Contents/Resources/Documents/Classes/AnyRealmCollection.html
+1 −1 ...t_realm_swift/after/docs/docsets/RealmSwift.docset/Contents/Resources/Documents/Classes/LinkingObjects.html
+1 −1 document_realm_swift/after/docs/docsets/RealmSwift.docset/Contents/Resources/Documents/Classes/List.html
+1 −1 document_realm_swift/after/docs/docsets/RealmSwift.docset/Contents/Resources/Documents/Classes/Results.html
+2 −2 ..._swift/after/docs/docsets/RealmSwift.docset/Contents/Resources/Documents/Protocols/RealmCollectionType.html
+1 −1 ...t_realm_swift/after/docs/docsets/RealmSwift.docset/Contents/Resources/Documents/Structs/SortDescriptor.html