Class: Pod::Podfile
Defined Under Namespace
Classes: TargetDefinition
Instance Attribute Summary collapse
Instance Method Summary
collapse
included, #patch_method
Instance Attribute Details
#spm_resolver ⇒ Object
Returns the value of attribute spm_resolver.
7
8
9
|
# File 'lib/cocoapods-spm/def/podfile.rb', line 7
def spm_resolver
@spm_resolver
end
|
Instance Method Details
#config_cocoapods_spm(options) ⇒ Object
9
10
11
|
# File 'lib/cocoapods-spm/def/podfile.rb', line 9
def config_cocoapods_spm(options)
SPM::Config.instance.dsl_config.merge!(options)
end
|
#macro_pods ⇒ Object
13
14
15
|
# File 'lib/cocoapods-spm/def/podfile.rb', line 13
def macro_pods
@macro_pods ||= {}
end
|
52
53
54
|
# File 'lib/cocoapods-spm/def/podfile.rb', line 52
def platforms
@platforms ||= target_definition_list.filter_map { |d| d.platform&.name }.uniq || [:ios]
end
|
#spm_pkg(name, options) ⇒ Object
27
28
29
|
# File 'lib/cocoapods-spm/def/podfile.rb', line 27
def spm_pkg(name, options)
current_target_definition.store_spm_pkg(name, options)
end
|
#spm_pkgs ⇒ Object
31
32
33
|
# File 'lib/cocoapods-spm/def/podfile.rb', line 31
def spm_pkgs
spm_pkgs_by_aggregate_target.values.flatten.uniq(&:name)
end
|
#spm_pkgs_by_aggregate_target ⇒ Object
39
40
41
42
43
44
45
46
47
48
49
50
|
# File 'lib/cocoapods-spm/def/podfile.rb', line 39
def spm_pkgs_by_aggregate_target
@spm_pkgs_by_aggregate_target ||= begin
dict = {}
to_visit = root_target_definitions.map { |t| [t, []] }
until to_visit.empty?
target, acc = to_visit.pop
dict[target.to_s] = (target.spm_pkgs + acc).uniq
to_visit += target.children.map { |t| [t, dict[target.to_s]] }
end
dict
end
end
|
#spm_pkgs_for(target) ⇒ Object
35
36
37
|
# File 'lib/cocoapods-spm/def/podfile.rb', line 35
def spm_pkgs_for(target)
spm_pkgs_by_aggregate_target[target.to_s]
end
|