Commit a24f3975 authored by Fabio Pelosin's avatar Fabio Pelosin

Go green!

parent b929d99b
...@@ -8,9 +8,17 @@ module Pod ...@@ -8,9 +8,17 @@ module Pod
class LibraryData class LibraryData
def dependencies def dependencies
[] library.target_definition.dependencies
end end
def initialize(library)
@library = library
end
private
attr_reader :library
end end
end end
end end
......
...@@ -313,41 +313,6 @@ module Pod ...@@ -313,41 +313,6 @@ module Pod
@installed_specs.concat(specs_by_platform.values.flatten) @installed_specs.concat(specs_by_platform.values.flatten)
end end
# Runs the pre install hooks of the installed specs and of the Podfile.
#
# @return [void]
#
def run_pre_install_hooks
UI.message "- Running pre install hooks" do
installed_specs.each do |spec|
executed = spec.pre_install!(pod_data(spec), library_data(nil))
UI.message "- #{spec.name}" if executed
end
executed = @podfile.pre_install!(installer_data)
UI.message "- Podfile" if executed
end
end
# Runs the post install hooks of the installed specs and of the Podfile.
#
# @note Post install hooks run _before_ saving of project, so that they
# can alter it before it is written to the disk.
#
# @return [void]
#
def run_post_install_hooks
UI.message "- Running post install hooks" do
installed_specs.each do |spec|
target_installer_data = target_installers_data.first #TODO
executed = spec.post_install!(target_installer_data)
UI.message "- #{spec.name}" if executed
end
executed = @podfile.post_install!(installer_data)
UI.message "- Podfile" if executed
end
end
# Installs the file references in the Pods project. This is done once per # Installs the file references in the Pods project. This is done once per
# Pod as the same file reference might be shared by multiple targets. # Pod as the same file reference might be shared by multiple targets.
...@@ -428,6 +393,46 @@ module Pod ...@@ -428,6 +393,46 @@ module Pod
# @!group Hooks # @!group Hooks
# Runs the pre install hooks of the installed specs and of the Podfile.
#
# @return [void]
#
def run_pre_install_hooks
UI.message "- Running pre install hooks" do
installed_specs.each do |spec|
executed = spec.pre_install!(pod_data(spec), library_data(libraries.first)) #todo
UI.message "- #{spec.name}" if executed
end
executed = @podfile.pre_install!(installer_data)
UI.message "- Podfile" if executed
end
end
# Runs the post install hooks of the installed specs and of the Podfile.
#
# @note Post install hooks run _before_ saving of project, so that they
# can alter it before it is written to the disk.
#
# @return [void]
#
def run_post_install_hooks
UI.message "- Running post install hooks" do
installed_specs.each do |spec|
target_installer_data = target_installers_data.first #TODO
executed = spec.post_install!(target_installer_data)
UI.message "- #{spec.name}" if executed
end
executed = @podfile.post_install!(installer_data)
UI.message "- Podfile" if executed
end
end
public
# @!group Hooks Data
def installer_data def installer_data
Hooks::InstallerData.new(self) Hooks::InstallerData.new(self)
end end
...@@ -456,7 +461,7 @@ module Pod ...@@ -456,7 +461,7 @@ module Pod
end end
def library_data(library) def library_data(library)
Hooks::LibraryData.new Hooks::LibraryData.new(library)
end end
#-------------------------------------------------------------------------# #-------------------------------------------------------------------------#
......
...@@ -33,6 +33,9 @@ module Pod ...@@ -33,6 +33,9 @@ module Pod
# @return [void] # @return [void]
# #
def install! def install!
file_accessors.each do |fa|
fa.path_list.read_file_system
end
add_source_files_references add_source_files_references
add_resources_references add_resources_references
link_headers link_headers
......
Reachability (from `Reachability.podspec') Reachability (from `Reachability.podspec`)
\ No newline at end of file \ No newline at end of file
...@@ -36,10 +36,10 @@ Generating Pods Project ...@@ -36,10 +36,10 @@ Generating Pods Project
- Reachability - Reachability
- Adding source files to Pods project - Adding source files to Pods project
- Adding resources to Pods project - Adding resources to Pods project
- Linking headers
- Installing targets - Installing targets
- Installing target `Pods` iOS 6.0 - Installing target `Pods` iOS 6.0
- Adding Build files - Adding Build files
- Linking headers
- Generating xcconfig file at `Pods/Pods.xcconfig` - Generating xcconfig file at `Pods/Pods.xcconfig`
- Generating target header at `Pods/Pods-header.h` - Generating target header at `Pods/Pods-header.h`
- Generating prefix header at `Pods/Pods-prefix.pch` - Generating prefix header at `Pods/Pods-prefix.pch`
......
...@@ -199,6 +199,14 @@ def yaml_should_match(expected, produced) ...@@ -199,6 +199,14 @@ def yaml_should_match(expected, produced)
diff.gsub!("$produced", "produced".green) diff.gsub!("$produced", "produced".green)
diff.gsub!("$expected", "expected".red) diff.gsub!("$expected", "expected".red)
desc << ("--- DIFF " << "-" * 70) desc << ("--- DIFF " << "-" * 70)
Diffy::Diff.new(expected.to_s, produced.to_s, :source => 'files', :context => 3).each do |line|
case line
when /^\+/ then desc << line.gsub("\n",'').green
when /^-/ then desc << line.gsub("\n",'').red
else desc << line.gsub("\n",'')
end
end
desc << ("--- DIFF " << "-" * 70)
desc << diff desc << diff
desc << ("--- END " << "-" * 70) desc << ("--- END " << "-" * 70)
expected_yaml.should.satisfy(desc * "\n\n") do expected_yaml.should.satisfy(desc * "\n\n") 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