Class: Pod::SPM::Resolver::Result
- Inherits:
-
Object
- Object
- Pod::SPM::Resolver::Result
- Includes:
- Config::Mixin
- Defined in:
- lib/cocoapods-spm/resolver/result.rb
Direct Known Subclasses
Defined Under Namespace
Classes: WritableResult
Constant Summary collapse
- ATTRS =
{ :spm_pkgs => [], :spm_dependencies_by_target => {}, :project_pkgs => nil, }.freeze
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Result
constructor
A new instance of Result.
- #linker_flags_for(target) ⇒ Object
- #spm_dependencies_for(target) ⇒ Object
- #spm_pkgs_for(target) ⇒ Object
- #spm_targets_for(target, exclude_default_xcode_linking: true) ⇒ Object
Methods included from Config::SPMConfigMixin
Methods included from Config::PodConfigMixin
Methods included from Config::ProjectConfigMixin
Constructor Details
Instance Method Details
#linker_flags_for(target) ⇒ Object
46 47 48 49 50 51 |
# File 'lib/cocoapods-spm/resolver/result.rb', line 46 def linker_flags_for(target) ( spm_targets_for(target).flat_map(&:linker_flags) + spm_pkgs_for(target).flat_map(&:linker_flags) ).uniq end |
#spm_dependencies_for(target) ⇒ Object
33 34 35 |
# File 'lib/cocoapods-spm/resolver/result.rb', line 33 def spm_dependencies_for(target) @spm_dependencies_by_target[target.to_s].to_a end |
#spm_pkgs_for(target) ⇒ Object
29 30 31 |
# File 'lib/cocoapods-spm/resolver/result.rb', line 29 def spm_pkgs_for(target) spm_dependencies_for(target).map(&:pkg).uniq(&:name) end |
#spm_targets_for(target, exclude_default_xcode_linking: true) ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/cocoapods-spm/resolver/result.rb', line 37 def spm_targets_for(target, exclude_default_xcode_linking: true) targets = spm_dependencies_for(target).flat_map do |d| project_pkgs.resolve_recursive_targets_of(d.pkg.name, d.product) end.uniq(&:name) return targets.reject(&:use_default_xcode_linking?) if exclude_default_xcode_linking targets end |