Class: Pod::SPM::Hook
- Inherits:
-
Object
- Object
- Pod::SPM::Hook
- Defined in:
- lib/cocoapods-spm/main.rb
Instance Method Summary collapse
- #all_specs ⇒ Object
- #config ⇒ Object
-
#initialize(context) ⇒ Hook
constructor
A new instance of Hook.
- #pods_project ⇒ Object
- #run ⇒ Object
- #sandbox ⇒ Object
Constructor Details
#initialize(context) ⇒ Hook
Returns a new instance of Hook.
8 9 10 |
# File 'lib/cocoapods-spm/main.rb', line 8 def initialize(context) @context = context end |
Instance Method Details
#all_specs ⇒ Object
24 25 26 |
# File 'lib/cocoapods-spm/main.rb', line 24 def all_specs @all_specs ||= @context.umbrella_targets.flat_map(&:specs).uniq end |
#config ⇒ Object
20 21 22 |
# File 'lib/cocoapods-spm/main.rb', line 20 def config Config.instance end |
#pods_project ⇒ Object
16 17 18 |
# File 'lib/cocoapods-spm/main.rb', line 16 def pods_project @context.pods_project end |
#run ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/cocoapods-spm/main.rb', line 28 def run all_specs.each do |spec| if spec.spm_dependencies target = pods_project.targets.find { |t| t.name == spec.name } add_spm_dependencies(target, spec.spm_dependencies) end end update_import_paths pods_project.save end |
#sandbox ⇒ Object
12 13 14 |
# File 'lib/cocoapods-spm/main.rb', line 12 def sandbox @context.sandbox end |