Skip to content

Commit

Permalink
[Installer|TargetInstaller] Improve handling of frameworks in Pods pr…
Browse files Browse the repository at this point in the history
…oject.
  • Loading branch information
fabiopelosin committed Dec 19, 2012
1 parent 1a34157 commit b262b87
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Expand Up @@ -9,7 +9,7 @@ GIT

GIT
remote: git://github.com/CocoaPods/Xcodeproj.git
revision: d2bd1824f39ca1f2742e1e7af352db36251a267d
revision: 72b587172e84cfd38aa9ce70c5f6075aca19973c
specs:
xcodeproj (0.4.0)
activesupport (~> 3.2.6)
Expand Down
6 changes: 2 additions & 4 deletions lib/cocoapods/installer.rb
Expand Up @@ -220,7 +220,7 @@ def generate_local_pods
def generate_names_of_pods_to_install
changed_pods_names = []
if update_mode
changed_pods_names += pods.select do |pods|
changed_pods_names += pods.select do |pod|
pod.top_specification.version.head? ||
resolver.pods_from_external_sources.include?(pod.name)
end
Expand Down Expand Up @@ -334,9 +334,6 @@ def add_file_references_to_pods_project
local_pods.each do |pod|
pod.add_file_references_to_project(pods_project)
pod.link_headers
pod.frameworks.each do |framework|
file_ref= pods_project.add_system_framework(framework, pod.platform.name)
end

unless pod.resources.empty?
resources_group = pods_project.new_group(pod.name, "Resources")
Expand Down Expand Up @@ -406,6 +403,7 @@ def generate_target_support_files
#
def write_pod_project
UI.message "- Writing Xcode project file to #{UI.path sandbox.project_path}" do
pods_project['Frameworks'].sort_by_type!
pods_project.main_group.sort_by_type!
pods_project.save_as(sandbox.project_path)
end
Expand Down
20 changes: 15 additions & 5 deletions lib/cocoapods/installer/target_installer.rb
Expand Up @@ -22,7 +22,7 @@ def initialize(sandbox, library)
def install!
add_file_reference_for_support_files
add_target
add_build_files_to_target
add_pod_references

create_xcconfig_file
create_prefix_header
Expand Down Expand Up @@ -126,15 +126,25 @@ def add_target
c.base_configuration_reference = xcconfig_file_ref
end

library.target = @target
library.target = @target
end

# Adds the build files of the pods to the target.
# Adds the build files of the pods to the target and adds a refence to
# the frameworks of the Pods.
#
# @note The Frameworks are used only for presentation purporses as the
# xcconfig is the authoritative source about their information.
#
# @return [void]
#
def add_build_files_to_target
pods.each { |p| p.add_build_files_to_target(target) }
def add_pod_references
pods.each do |pod|
pod.add_build_files_to_target(target)

pod.frameworks.each do |framework|
framework_ref = project.add_system_framework(framework, target)
end
end
end

# Generates the contents of the xcconfig file and saves it to disk.
Expand Down

0 comments on commit b262b87

Please sign in to comment.