Skip to content

Commit

Permalink
Now that headers are symlinked at install time, we no longer need to …
Browse files Browse the repository at this point in the history
…shuffle build phases.
  • Loading branch information
alloy committed Feb 15, 2012
1 parent 65594c6 commit 63af680
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 34 deletions.
6 changes: 0 additions & 6 deletions lib/cocoapods/installer/target_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,6 @@ def install!
end
xcconfig.merge!('HEADER_SEARCH_PATHS' => header_search_paths.sort.uniq.join(" "))

# Now that we have added all the source files and copy header phases,
# move the compile build phase to the end, so that headers are copied
# to the build products dir first, and thus Pod source files can enjoy
# the same namespacing of headers as the app would.
@target.move_compile_phase_to_end!

# Add all the target related support files to the group, even the copy
# resources script although the project doesn't actually use them.
support_files_group = @project.groups.find do |group|
Expand Down
13 changes: 0 additions & 13 deletions lib/cocoapods/xcodeproj_pods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,6 @@ def build_configuration(name)
build_configurations.find { |c| c.name == name }
end

class PBXNativeTarget
def move_compile_phase_to_end!
reflection = self.class.reflection(:buildPhases)
uuids = send(reflection.uuids_getter)
phase = buildPhases.find { |phase| phase.is_a?(PBXSourcesBuildPhase) }
uuids.delete(phase.uuid)
uuids << phase.uuid
phase = buildPhases.find { |phase| phase.is_a?(PBXFrameworksBuildPhase) }
uuids.delete(phase.uuid)
uuids << phase.uuid
end
end

class PBXCopyFilesBuildPhase
def self.new_pod_dir(project, pod_name, path)
new(project, nil, {
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

$:.unshift File.expand_path('../../external/xcodeproj/ext', __FILE__)
$:.unshift File.expand_path('../../external/xcodeproj/lib', __FILE__)
$:.unshift (ROOT + 'lib').to_s
$:.unshift((ROOT + 'lib').to_s)
require 'cocoapods'

$:.unshift((ROOT + 'spec').to_s)
Expand Down
14 changes: 0 additions & 14 deletions spec/unit/installer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,4 @@
installer = Pod::Installer.new(podfile)
installer.target_installers.map(&:definition).map(&:name).should == [:not_empty]
end

# TODO remove this functionality? We create the header structure at `pod install`
# time nowadays, so that *is* before anything else already.
it "moves the compile and link phases to the end of the build phases list, so Pod headers are copied first and sources can use the same header dir structure" do
podfile = Pod::Podfile.new do
platform :osx
dependency 'ASIHTTPRequest'
end
config.rootspec = podfile
installer = Pod::Installer.new(podfile)
installer.target_installers.first.install!
phases = installer.project.targets.first.buildPhases
phases.to_a.last(2).map(&:class).should == [Xcodeproj::Project::PBXSourcesBuildPhase, Xcodeproj::Project::PBXFrameworksBuildPhase]
end
end

0 comments on commit 63af680

Please sign in to comment.