Class: CocoapodsMangle::Context
- Inherits:
-
Object
- Object
- CocoapodsMangle::Context
- Defined in:
- lib/cocoapods_mangle/context.rb
Overview
Context for mangling
Instance Method Summary collapse
-
#initialize(installer_context, options) ⇒ Context
constructor
Initializes the context for mangling.
-
#mangle_prefix ⇒ String
The mangle prefix to be used.
-
#pod_target_labels ⇒ Array<String>
The targets in the pods project to be mangled.
-
#pod_xcconfig_paths ⇒ Array<String>
Paths to all pod xcconfig files which should be updated.
-
#pods_project_path ⇒ String
The path to pods project.
-
#specs_checksum ⇒ String
A checksum representing the current state of the target dependencies.
-
#xcconfig_path ⇒ String
The path to the mangle xcconfig.
Constructor Details
#initialize(installer_context, options) ⇒ Context
Initializes the context for mangling
14 15 16 17 |
# File 'lib/cocoapods_mangle/context.rb', line 14 def initialize(installer_context, ) @installer_context = installer_context @options = end |
Instance Method Details
#mangle_prefix ⇒ String
Returns The mangle prefix to be used.
26 27 28 29 |
# File 'lib/cocoapods_mangle/context.rb', line 26 def mangle_prefix return default_mangle_prefix unless @options[:mangle_prefix] @options[:mangle_prefix] end |
#pod_target_labels ⇒ Array<String>
Returns The targets in the pods project to be mangled.
37 38 39 |
# File 'lib/cocoapods_mangle/context.rb', line 37 def pod_target_labels umbrella_pod_targets.map(&:cocoapods_target_label) end |
#pod_xcconfig_paths ⇒ Array<String>
Returns Paths to all pod xcconfig files which should be updated.
42 43 44 45 46 47 48 49 50 |
# File 'lib/cocoapods_mangle/context.rb', line 42 def pod_xcconfig_paths pod_xcconfigs = [] @installer_context.pods_project.targets.each do |target| target.build_configurations.each do |config| pod_xcconfigs << config.base_configuration_reference.real_path end end pod_xcconfigs.uniq end |
#pods_project_path ⇒ String
Returns The path to pods project.
32 33 34 |
# File 'lib/cocoapods_mangle/context.rb', line 32 def pods_project_path @installer_context.pods_project.path end |
#specs_checksum ⇒ String
Returns A checksum representing the current state of the target dependencies.
53 54 55 56 57 58 |
# File 'lib/cocoapods_mangle/context.rb', line 53 def specs_checksum gem_summary = "#{CocoapodsMangle::NAME}=#{CocoapodsMangle::VERSION}" specs = umbrella_pod_targets.map(&:specs).flatten.uniq specs_summary = specs.map(&:checksum).join(',') Digest::SHA1.hexdigest("#{gem_summary},#{specs_summary}") end |
#xcconfig_path ⇒ String
Returns The path to the mangle xcconfig.
20 21 22 23 |
# File 'lib/cocoapods_mangle/context.rb', line 20 def xcconfig_path return default_xcconfig_path unless @options[:xcconfig_path] File.join(@installer_context.sandbox.root.parent, @options[:xcconfig_path]) end |