Skip to content
This repository was archived by the owner on May 6, 2021. It is now read-only.

Commit e7b099a

Browse files
committed
Support CocoaPods 1.0
Fixes #22 CP >= 1.0 sets a custom CONFIGURATION_BUILD_DIR which is not part of the framework search path for Playgrounds. We now generate a `post_install` hook for the Podfile which changes CONFIGURATION_BUILD_DIR for each Pod to make it work fine with Playgrounds again.
1 parent 1b1f2f5 commit e7b099a

File tree

3 files changed

+45
-27
lines changed

3 files changed

+45
-27
lines changed

Gemfile.lock

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,54 @@ PATH
22
remote: .
33
specs:
44
cocoapods-playgrounds (0.1.0)
5+
cocoapods (~> 1.0.0)
56

67
GEM
78
remote: https://rubygems.org/
89
specs:
9-
activesupport (4.2.5.1)
10+
activesupport (4.2.6)
1011
i18n (~> 0.7)
1112
json (~> 1.7, >= 1.7.7)
1213
minitest (~> 5.1)
1314
thread_safe (~> 0.3, >= 0.3.4)
1415
tzinfo (~> 1.1)
1516
ast (2.2.0)
1617
bacon (1.2.0)
17-
claide (0.9.1)
18-
cocoapods (0.39.0)
18+
claide (1.0.0)
19+
cocoapods (1.0.0)
1920
activesupport (>= 4.0.2)
20-
claide (~> 0.9.1)
21-
cocoapods-core (= 0.39.0)
22-
cocoapods-downloader (~> 0.9.3)
23-
cocoapods-plugins (~> 0.4.2)
24-
cocoapods-search (~> 0.1.0)
25-
cocoapods-stats (~> 0.6.2)
26-
cocoapods-trunk (~> 0.6.4)
27-
cocoapods-try (~> 0.5.1)
21+
claide (>= 1.0.0, < 2.0)
22+
cocoapods-core (= 1.0.0)
23+
cocoapods-deintegrate (>= 1.0.0, < 2.0)
24+
cocoapods-downloader (>= 1.0.0, < 2.0)
25+
cocoapods-plugins (>= 1.0.0, < 2.0)
26+
cocoapods-search (>= 1.0.0, < 2.0)
27+
cocoapods-stats (>= 1.0.0, < 2.0)
28+
cocoapods-trunk (>= 1.0.0, < 2.0)
29+
cocoapods-try (>= 1.0.0, < 2.0)
2830
colored (~> 1.2)
2931
escape (~> 0.0.4)
30-
molinillo (~> 0.4.0)
32+
fourflusher (~> 0.3.0)
33+
molinillo (~> 0.4.5)
3134
nap (~> 1.0)
32-
xcodeproj (~> 0.28.2)
33-
cocoapods-core (0.39.0)
35+
xcodeproj (>= 1.0.0, < 2.0)
36+
cocoapods-core (1.0.0)
3437
activesupport (>= 4.0.2)
3538
fuzzy_match (~> 2.0.4)
3639
nap (~> 1.0)
37-
cocoapods-downloader (0.9.3)
38-
cocoapods-plugins (0.4.2)
40+
cocoapods-deintegrate (1.0.0)
41+
cocoapods-downloader (1.0.0)
42+
cocoapods-plugins (1.0.0)
3943
nap
40-
cocoapods-search (0.1.0)
41-
cocoapods-stats (0.6.2)
42-
cocoapods-trunk (0.6.4)
44+
cocoapods-search (1.0.0)
45+
cocoapods-stats (1.0.0)
46+
cocoapods-trunk (1.0.0)
4347
nap (>= 0.8, < 2.0)
4448
netrc (= 0.7.8)
45-
cocoapods-try (0.5.1)
49+
cocoapods-try (1.0.0)
4650
colored (1.2)
4751
escape (0.0.4)
52+
fourflusher (0.3.0)
4853
fuzzy_match (2.0.4)
4954
i18n (0.7.0)
5055
json (1.8.3)
@@ -54,7 +59,7 @@ GEM
5459
metaclass (~> 0.0.1)
5560
mocha-on-bacon (0.2.2)
5661
mocha (>= 0.13.0)
57-
molinillo (0.4.2)
62+
molinillo (0.4.5)
5863
nap (1.1.0)
5964
netrc (0.7.8)
6065
parser (2.3.0.5)
@@ -75,9 +80,9 @@ GEM
7580
tzinfo (1.2.2)
7681
thread_safe (~> 0.1)
7782
unicode-display_width (0.3.1)
78-
xcodeproj (0.28.2)
83+
xcodeproj (1.0.0)
7984
activesupport (>= 3)
80-
claide (~> 0.9.1)
85+
claide (>= 1.0.0, < 2.0)
8186
colored (~> 1.2)
8287

8388
PLATFORMS

cocoapods-playgrounds.gemspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Gem::Specification.new do |spec|
1717
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
1818
spec.require_paths = ['lib']
1919

20+
spec.add_dependency 'cocoapods', '~> 1.0.0'
21+
2022
spec.add_development_dependency 'bundler', '~> 1.3'
2123
spec.add_development_dependency 'rake'
2224
end

lib/cocoapods-playgrounds/workspace.rb

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,21 @@ def copy_carthage_frameworks
120120
end
121121

122122
def generate_podfile
123-
contents = "use_frameworks!\n\n"
124-
contents << "target '#{target_name}' do\n"
125-
contents << "#{pods}\n"
126-
contents << "end\n"
123+
contents = <<-EOT
124+
use_frameworks!
125+
126+
target '#{target_name}' do
127+
#{pods}
128+
end
129+
130+
post_install do |installer|
131+
installer.pods_project.targets.each do |target|
132+
target.build_configurations.each do |config|
133+
config.build_settings['CONFIGURATION_BUILD_DIR'] = '$PODS_CONFIGURATION_BUILD_DIR'
134+
end
135+
end
136+
end
137+
EOT
127138
File.open('Podfile', 'w') { |f| f.write(contents) }
128139
end
129140

0 commit comments

Comments
 (0)