Commit 839286a3 authored by Fabio Pelosin's avatar Fabio Pelosin

[WIP] Add dedicated class for the arguments of the Hooks.

parent 8c17615b
...@@ -5,6 +5,9 @@ module Pod ...@@ -5,6 +5,9 @@ module Pod
require 'cocoapods/downloader' require 'cocoapods/downloader'
require 'cocoapods/file_list' require 'cocoapods/file_list'
require 'cocoapods/config' require 'cocoapods/config'
require 'cocoapods/dependency_injection'
require 'cocoapods/gem_version'
# Indicates a runtime error **not** caused by a bug. # Indicates a runtime error **not** caused by a bug.
# #
...@@ -25,7 +28,6 @@ module Pod ...@@ -25,7 +28,6 @@ module Pod
autoload :Installer, 'cocoapods/installer' autoload :Installer, 'cocoapods/installer'
autoload :SourcesManager, 'cocoapods/sources_manager' autoload :SourcesManager, 'cocoapods/sources_manager'
autoload :Library, 'cocoapods/library' autoload :Library, 'cocoapods/library'
autoload :LocalPod, 'cocoapods/local_pod'
autoload :Project, 'cocoapods/project' autoload :Project, 'cocoapods/project'
autoload :Resolver, 'cocoapods/resolver' autoload :Resolver, 'cocoapods/resolver'
autoload :Sandbox, 'cocoapods/sandbox' autoload :Sandbox, 'cocoapods/sandbox'
...@@ -47,6 +49,13 @@ module Pod ...@@ -47,6 +49,13 @@ module Pod
autoload :XCConfig, 'cocoapods/generator/xcconfig' autoload :XCConfig, 'cocoapods/generator/xcconfig'
end end
module Hooks
autoload :InstallerData, 'cocoapods/hooks/installer_data'
autoload :LibraryData, 'cocoapods/hooks/library_data'
autoload :PodData, 'cocoapods/hooks/pod_data'
autoload :TargetInstallerData, 'cocoapods/hooks/target_installer_data'
end
end end
if ENV['COCOA_PODS_ENV'] == 'development' if ENV['COCOA_PODS_ENV'] == 'development'
......
module Pod
module Hooks
# Stores the information of the Installer for the hooks
#
class InstallerData
# @return [Sandbox] sandbox the sandbox where the support files should
# be generated.
#
attr_accessor :sandbox
# @return [Library] The library whose target needs to be generated.
#
attr_accessor :libraries
# @return [Array<TargetInstaller>]
#
# attr_accessor :target_installers
# @return [Hash{TargetDefinition => Array<LocalPod>}] The local pod
# instances grouped by target.
#
# attr_accessor :local_pods_by_target
# @return [Array<LocalPod>] The list of LocalPod instances for each
# dependency sorted by name.
#
# attr_accessor :local_pods
# @return [Pod::Project] the `Pods/Pods.xcodeproj` project.
#
attr_accessor :project
def pods
# UI.warn "InstallerData#pods is deprecated"
# [] # TODO
end
end
end
end
module Pod
module Hooks
# Stores the information of
#
# Was target definition
#
class LibraryData
end
end
end
module Pod
module Hooks
# Stores the information of the Installer for the hooks
#
class PodData
attr_accessor :root
end
end
end
module Pod
module Hooks
class TargetInstallerData
# Stores the information of the target installer
# @todo This has to be removed, but this means the specs have to be
# updated if they need a reference to the prefix header.
#
# def prefix_header_filename
# UI.warn "The usage of the TargetInstaller#prefix_header_filename is deprecated."
# library.prefix_header_path.relative_path_from(sandbox.root)
# end
#
#
# @return [Sandbox] sandbox the sandbox where the support files should
# be generated.
#
attr_reader :sandbox
# @return [Library] The library whose target needs to be generated.
#
attr_reader :library
# @return [PBXNativeTarget] the target generated by the installation
# process.
#
# @note Generated by the {#add_target} step.
#
attr_reader :target
# @return [Project] the Pods project of the sandbox.
#
def project
sandbox.project
end
# @return [TargetDefinition] the target definition of the library.
#
def target_definition
library.target_definition
end
# @return [TargetDefinition] the target definition of the library.
#
def target
library.target
end
end
end
end
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