Commit 33bf334a authored by Fabio Pelosin's avatar Fabio Pelosin

[Installer] Add system frameworks directly and add them to the targets

Systems frameworks are present only for illustrative purposes and adding
them in the target installers of the pods prevents incremental editing
of the Pod project
parent 57c793e3
...@@ -17,7 +17,7 @@ GIT ...@@ -17,7 +17,7 @@ GIT
GIT GIT
remote: https://github.com/CocoaPods/Xcodeproj.git remote: https://github.com/CocoaPods/Xcodeproj.git
revision: b0c1ee45e5922be4e5a71305bd2c5f8a4ce9f575 revision: 18fc2cac9304f0819d19b4848698638d969b5861
branch: paths-refactor branch: paths-refactor
specs: specs:
xcodeproj (0.9.0) xcodeproj (0.9.0)
......
...@@ -344,6 +344,16 @@ module Pod ...@@ -344,6 +344,16 @@ module Pod
target_installer = AggregateTargetInstaller.new(sandbox, target) target_installer = AggregateTargetInstaller.new(sandbox, target)
target_installer.install! target_installer.install!
end end
# TODO
# Move and add specs
pod_targets.sort_by(&:name).each do |pod_target|
pod_target.file_accessors.each do |file_accessor|
file_accessor.spec_consumer.frameworks.each do |framework|
ref = pods_project.add_system_framework(framework, pod_target.target)
end
end
end
end end
end end
...@@ -373,8 +383,7 @@ module Pod ...@@ -373,8 +383,7 @@ module Pod
# #
def link_aggregate_target def link_aggregate_target
aggregate_targets.each do |aggregate_target| aggregate_targets.each do |aggregate_target|
native_target = pods_project.targets.select { |t| t.name == aggregate_target.name }.first native_target = aggregate_target.target
products = pods_project.products_group
aggregate_target.pod_targets.each do |pod_target| aggregate_target.pod_targets.each do |pod_target|
product = pod_target.target.product_reference product = pod_target.target.product_reference
native_target.frameworks_build_phase.add_file_reference(product) native_target.frameworks_build_phase.add_file_reference(product)
......
...@@ -44,9 +44,6 @@ module Pod ...@@ -44,9 +44,6 @@ module Pod
file_refs = source_files.map { |sf| project.reference_for_path(sf) } file_refs = source_files.map { |sf| project.reference_for_path(sf) }
target.add_file_references(file_refs, flags) target.add_file_references(file_refs, flags)
file_accessor.spec_consumer.frameworks.each do |framework|
project.add_system_framework(framework, target)
end
end end
end end
end end
......
Subproject commit 67647cedb7de5847e4f4fbd8d0ffbc0de4a07471 Subproject commit 38233cf183d62dd70fdc874ae42c9fdf58a558e4
...@@ -100,13 +100,6 @@ module Pod ...@@ -100,13 +100,6 @@ module Pod
names.should.include("Banana.m") names.should.include("Banana.m")
end end
it 'adds the frameworks required by to the pod to the project for informative purposes' do
Specification::Consumer.any_instance.stubs(:frameworks).returns(['QuartzCore'])
@installer.install!
names = @installer.sandbox.project['Frameworks'].children.map(&:name)
names.sort.should == ["Foundation.framework", "QuartzCore.framework"]
end
#--------------------------------------# #--------------------------------------#
xit 'adds the resource bundle targets' do xit 'adds the resource bundle targets' do
......
...@@ -307,6 +307,13 @@ module Pod ...@@ -307,6 +307,13 @@ module Pod
@installer.send(:install_libraries) @installer.send(:install_libraries)
end end
xit 'adds the frameworks required by to the pod to the project for informative purposes' do
Specification::Consumer.any_instance.stubs(:frameworks).returns(['QuartzCore'])
@installer.install!
names = @installer.sandbox.project['Frameworks'].children.map(&:name)
names.sort.should == ["Foundation.framework", "QuartzCore.framework"]
end
end end
#--------------------------------------# #--------------------------------------#
...@@ -396,6 +403,8 @@ module Pod ...@@ -396,6 +403,8 @@ module Pod
project = Xcodeproj::Project.new('path') project = Xcodeproj::Project.new('path')
pods_target = project.new_target(:static_library, target.name, :ios) pods_target = project.new_target(:static_library, target.name, :ios)
target.target = pods_target
native_target = project.new_target(:static_library, pod_target.name, :ios) native_target = project.new_target(:static_library, pod_target.name, :ios)
pod_target.target = pods_target pod_target.target = pods_target
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment