Module: XCCache::SPM::Package::UmbrellaDescsMixin
- Included in:
- Umbrella
- Defined in:
- lib/xccache/spm/pkg/umbrella/descs.rb
Instance Method Summary collapse
- #binary_targets ⇒ Object
- #dependency_targets_of_products(products) ⇒ Object
- #desc_of(d) ⇒ Object
- #gen_metadata ⇒ Object
- #targets_of_products(products) ⇒ Object
- #xccache_desc ⇒ Object
Instance Method Details
#binary_targets ⇒ Object
29 30 31 |
# File 'lib/xccache/spm/pkg/umbrella/descs.rb', line 29 def binary_targets @descs_by_name.values.flatten.uniq.flat_map(&:binary_targets) end |
#dependency_targets_of_products(products) ⇒ Object
20 21 22 23 |
# File 'lib/xccache/spm/pkg/umbrella/descs.rb', line 20 def dependency_targets_of_products(products) products = [products] if products.is_a?(String) products.flat_map { |p| @dependency_targets_by_products[p] || [p] }.uniq end |
#desc_of(d) ⇒ Object
25 26 27 |
# File 'lib/xccache/spm/pkg/umbrella/descs.rb', line 25 def desc_of(d) @descs_by_name[d.split("/").first] end |
#gen_metadata ⇒ Object
5 6 7 8 9 |
# File 'lib/xccache/spm/pkg/umbrella/descs.rb', line 5 def UI.section("Generating metadata of packages", timing: true) do @descs, @descs_by_name = Description.descs_in_dir(root_dir, save_to_dir: config.) end end |
#targets_of_products(products) ⇒ Object
15 16 17 18 |
# File 'lib/xccache/spm/pkg/umbrella/descs.rb', line 15 def targets_of_products(products) products = [products] if products.is_a?(String) products.flat_map { |x| desc_of(x).targets_of_products(File.basename(x)) } end |
#xccache_desc ⇒ Object
11 12 13 |
# File 'lib/xccache/spm/pkg/umbrella/descs.rb', line 11 def xccache_desc @xccache_desc ||= desc_of("xccache") end |