Skip to content
This repository
Browse code

[TargetInstaller] Integrate with Xcodeproj f0d455bcd8.

  • Loading branch information...
commit e46ed11d1d6cee971b8547ad7aad7c62e8bfd19f 1 parent c74fc01
Fabio Pelosin irrationalfab authored
12 Gemfile.lock
... ... @@ -1,6 +1,6 @@
1 1 GIT
2 2 remote: git://github.com/CocoaPods/Xcodeproj.git
3   - revision: c651b216acd6db18128f5b2df77ed04d183e7a3f
  3 + revision: f0d455bcd839e8fdada2e117681ac93b296659b1
4 4 branch: develop
5 5 specs:
6 6 xcodeproj (0.2.0.rc2)
@@ -11,13 +11,13 @@ GEM
11 11 addressable (2.2.8)
12 12 awesome_print (1.0.2)
13 13 bacon (1.1.0)
14   - coderay (1.0.6)
  14 + coderay (1.0.7)
15 15 colored (1.2)
16 16 crack (0.3.1)
17 17 escape (0.0.4)
18 18 faraday (0.8.1)
19 19 multipart-post (~> 1.1)
20   - faraday_middleware (0.8.7)
  20 + faraday_middleware (0.8.8)
21 21 faraday (>= 0.7.4, < 0.9)
22 22 github-markup (0.7.2)
23 23 hashie (1.2.0)
@@ -32,7 +32,7 @@ GEM
32 32 mocha (>= 0.9.8)
33 33 multi_json (1.3.6)
34 34 multipart-post (1.1.5)
35   - octokit (1.4.0)
  35 + octokit (1.7.0)
36 36 addressable (~> 2.2)
37 37 faraday (~> 0.8)
38 38 faraday_middleware (~> 0.8)
@@ -47,11 +47,11 @@ GEM
47 47 rb-fsevent (0.9.1)
48 48 redcarpet (2.1.1)
49 49 slop (2.4.4)
50   - vcr (2.2.0)
  50 + vcr (2.2.2)
51 51 webmock (1.8.7)
52 52 addressable (>= 2.2.7)
53 53 crack (>= 0.1.7)
54   - yard (0.8.2)
  54 + yard (0.8.2.1)
55 55
56 56 PLATFORMS
57 57 ruby
6 lib/cocoapods/installer/target_installer.rb
@@ -62,15 +62,15 @@ def install!(pods, sandbox)
62 62
63 63 @target = @project.add_pod_target(@target_definition.label, @target_definition.platform)
64 64
65   - source_files_description = []
  65 + source_file_descriptions = []
66 66 pods.each do |pod|
67 67 xcconfig.merge!(pod.xcconfig)
68   - source_files_description += pod.source_files_description
  68 + source_file_descriptions += pod.source_file_descriptions
69 69
70 70 # TODO: this doesn't need to be done here, it has nothing to do with the target
71 71 pod.link_headers
72 72 end
73   - @target.add_source_files(source_files_description)
  73 + @target.add_source_files(source_file_descriptions)
74 74
75 75 xcconfig.merge!('HEADER_SEARCH_PATHS' => quoted(sandbox.header_search_paths).join(" "))
76 76
8 lib/cocoapods/local_pod.rb
@@ -328,16 +328,14 @@ def link_headers
328 328 #
329 329 # @return [void] Adds the pods source files to a given target.
330 330 #
331   - def source_files_description
  331 + def source_file_descriptions
332 332 result = []
333 333 source_files_by_spec.each do | spec, files |
334 334 compiler_flags = spec.compiler_flags.strip
335 335 files.each do |file|
336 336 file = file.relative_path_from(@sandbox.root)
337   - description = {}
338   - description[:path] = file
339   - description[:compiler_flags] = compiler_flags unless compiler_flags.empty?
340   - result << description
  337 + desc = Xcodeproj::Project::PBXNativeTarget::SourceFileDescription.new(file, compiler_flags, nil)
  338 + result << desc
341 339 end
342 340 end
343 341 result
2  spec/unit/installer/target_installer_spec.rb
@@ -40,7 +40,7 @@ def do_install!
40 40 end
41 41
42 42 it 'adds each pod to the static library target' do
43   - @pods[0].expects(:source_files_description).returns([])
  43 + @pods[0].expects(:source_file_descriptions).returns([])
44 44 do_install!
45 45 end
46 46
14 spec/unit/local_pod_spec.rb
@@ -75,16 +75,18 @@
75 75 end
76 76
77 77 it "can add it's source files to an Xcode project target" do
78   - @pod.source_files_description.should == [
79   - {:path => Pathname.new("BananaLib/Classes/Banana.h")},
80   - {:path => Pathname.new("BananaLib/Classes/Banana.m")}]
  78 + @pod.source_file_descriptions.should == [
  79 + Xcodeproj::Project::PBXNativeTarget::SourceFileDescription.new(Pathname.new("BananaLib/Classes/Banana.h"), "", nil),
  80 + Xcodeproj::Project::PBXNativeTarget::SourceFileDescription.new(Pathname.new("BananaLib/Classes/Banana.m"), "", nil)
  81 + ]
81 82 end
82 83
83 84 it "can add it's source files to a target with any specially configured compiler flags" do
84 85 @pod.top_specification.compiler_flags = '-d some_flag'
85   - @pod.source_files_description.should == [
86   - {:path => Pathname.new("BananaLib/Classes/Banana.h"), :compiler_flags => '-d some_flag'},
87   - {:path => Pathname.new("BananaLib/Classes/Banana.m"), :compiler_flags => '-d some_flag'}]
  86 + @pod.source_file_descriptions.should == [
  87 + Xcodeproj::Project::PBXNativeTarget::SourceFileDescription.new(Pathname.new("BananaLib/Classes/Banana.h"), '-d some_flag', nil),
  88 + Xcodeproj::Project::PBXNativeTarget::SourceFileDescription.new(Pathname.new("BananaLib/Classes/Banana.m"), '-d some_flag', nil)
  89 + ]
88 90 end
89 91
90 92 it "returns the platform" do

0 comments on commit e46ed11

Please sign in to comment.
Something went wrong with that request. Please try again.