Commit a06624b3 authored by Eloy Duran's avatar Eloy Duran

Make the installer work with the refactored Xcode::Project.

parent ffefba98
...@@ -52,19 +52,19 @@ module Pod ...@@ -52,19 +52,19 @@ module Pod
build_specification_sets.each do |set| build_specification_sets.each do |set|
spec = set.specification spec = set.specification
xcconfig.merge!(spec.xcconfig) xcconfig.merge!(spec.xcconfig)
xcodeproj.add_group(spec.name) group = xcodeproj.add_pod_group(spec.name)
# Only add implementation files to the compile phase # Only add implementation files to the compile phase
spec.implementation_files.each do |file| spec.implementation_files.each do |file|
xcodeproj.add_source_file(file, spec.name, nil, spec.compiler_flags) group.add_source_file(file, nil, spec.compiler_flags)
end end
# Add header files to a `copy header build phase` for each destination # Add header files to a `copy header build phase` for each destination
# directory in the pod's header directory. # directory in the pod's header directory.
set.specification.copy_header_mappings.each do |header_dir, files| set.specification.copy_header_mappings.each do |header_dir, files|
copy_phase_uuid = xcodeproj.add_copy_header_build_phase(spec.name, header_dir) copy_phase = xcodeproj.add_copy_header_build_phase(spec.name, header_dir)
files.each do |file| files.each do |file|
xcodeproj.add_source_file(file, spec.name, copy_phase_uuid) group.add_source_file(file, copy_phase)
end end
end end
......
...@@ -130,6 +130,11 @@ module Pod ...@@ -130,6 +130,11 @@ module Pod
alias_method :file_uuids, :files alias_method :file_uuids, :files
alias_method :file_uuids=, :files= alias_method :file_uuids=, :files=
def initialize(project, uuid, attributes)
super
self.file_uuids ||= []
end
def files def files
list_by_class(file_uuids, PBXBuildFile) list_by_class(file_uuids, PBXBuildFile)
end end
...@@ -307,7 +312,7 @@ module Pod ...@@ -307,7 +312,7 @@ module Pod
"runOnlyForDeploymentPostprocessing" => "0", "runOnlyForDeploymentPostprocessing" => "0",
}) })
targets.first.buildPhases << phase targets.first.buildPhases << phase
phase.uuid phase
end end
# A silly hack to pretty print the objects hash from MacRuby. # A silly hack to pretty print the objects hash from MacRuby.
......
...@@ -144,14 +144,14 @@ describe "Pod::Xcode::Project" do ...@@ -144,14 +144,14 @@ describe "Pod::Xcode::Project" do
end end
it "creates a copy build header phase which will copy headers to a specified path" do it "creates a copy build header phase which will copy headers to a specified path" do
phase_uuid = @project.add_copy_header_build_phase("SomePod", "Path/To/Source") phase = @project.add_copy_header_build_phase("SomePod", "Path/To/Source")
find_object({ find_object({
'isa' => 'PBXCopyFilesBuildPhase', 'isa' => 'PBXCopyFilesBuildPhase',
'dstPath' => '$(PUBLIC_HEADERS_FOLDER_PATH)/Path/To/Source', 'dstPath' => '$(PUBLIC_HEADERS_FOLDER_PATH)/Path/To/Source',
'name' => 'Copy SomePod Public Headers' 'name' => 'Copy SomePod Public Headers'
}).should.not == nil }).should.not == nil
target = @project.targets.first target = @project.targets.first
target.attributes['buildPhases'].should.include phase_uuid target.attributes['buildPhases'].should.include phase.uuid
end end
it "adds a `h' file as a build file and adds it to the `headers build' phase list" do it "adds a `h' file as a build file and adds it to the `headers build' phase list" do
......
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