Class: Pod::PodTarget

Inherits:
Object
  • Object
show all
Includes:
CocoapodsCatalystSupport::TargetUtils
Defined in:
lib/cocoapods-catalyst-support/pod/pod_target.rb

Instance Method Summary collapse

Methods included from CocoapodsCatalystSupport::TargetUtils

#module_name

Instance Method Details

#frameworksObject



27
28
29
30
31
# File 'lib/cocoapods-catalyst-support/pod/pod_target.rb', line 27

def frameworks
  return file_accessors.flat_map do |accessor| 
    accessor.spec_consumer.frameworks.map do |name| PodDependency.newFramework name  end + accessor.spec_consumer.libraries.map do |name| PodDependency.newLibrary name end
  end
end

#resourcesObject



7
8
9
10
11
# File 'lib/cocoapods-catalyst-support/pod/pod_target.rb', line 7

def resources 
  resources = file_accessors.flat_map do |accessor| accessor.resources end.map do |path| "#{path.basename}" end
  bundles = file_accessors.flat_map do |accessor| accessor.resource_bundles end.flat_map do |dic| dic.keys end.map do |s| s + ".bundle" end
  return resources + bundles
end

#vendor_productsObject



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/cocoapods-catalyst-support/pod/pod_target.rb', line 13

def vendor_products
  return file_accessors.flat_map do |accessor| 
    accessor.vendored_frameworks + accessor.vendored_libraries
  end.map do |s| s.basename 
  end.map do |s|
    name = "#{s}"
    if name.include? "framework"
      PodDependency.newFramework name.sub(".framework", "").sub(".xcframework", "")
    else
      PodDependency.newLibrary name.sub("lib", "").sub(".a", "")
    end
  end
end