Class: Pod::Podfile
- Inherits:
-
Object
show all
- Defined in:
- lib/cocoapods-spm/def/podfile.rb,
lib/cocoapods-spm/def/target_definition.rb
Defined Under Namespace
Classes: TargetDefinition
Instance Attribute Summary collapse
Instance Method Summary
collapse
Instance Attribute Details
#spm_analyzer ⇒ Object
Returns the value of attribute spm_analyzer.
5
6
7
|
# File 'lib/cocoapods-spm/def/podfile.rb', line 5
def spm_analyzer
@spm_analyzer
end
|
Instance Method Details
#config_cocoapods_spm(options) ⇒ Object
8
9
10
|
# File 'lib/cocoapods-spm/def/podfile.rb', line 8
def config_cocoapods_spm(options)
SPM::Config.instance.dsl_config = options
end
|
#macro_pods ⇒ Object
12
13
14
|
# File 'lib/cocoapods-spm/def/podfile.rb', line 12
def macro_pods
@macro_pods ||= {}
end
|
#origin_pod ⇒ Object
7
|
# File 'lib/cocoapods-spm/def/podfile.rb', line 7
alias origin_pod pod
|
#pod(name = nil, *requirements) ⇒ Object
16
17
18
19
20
21
22
23
24
|
# File 'lib/cocoapods-spm/def/podfile.rb', line 16
def pod(name = nil, *requirements)
macro = requirements[0].delete(:macro) if requirements.first.is_a?(Hash)
macro ||= {}
unless macro.empty?
requirements[0][:path] = prepare_macro_pod_dir(name, macro)
macro_pods[name] = macro
end
origin_pod(name, *requirements)
end
|
#spm_pkg(name, options) ⇒ Object
26
27
28
|
# File 'lib/cocoapods-spm/def/podfile.rb', line 26
def spm_pkg(name, options)
current_target_definition.store_spm_pkg(name, options)
end
|
#spm_pkgs_by_aggregate_target ⇒ Object
34
35
36
37
38
39
40
41
|
# File 'lib/cocoapods-spm/def/podfile.rb', line 34
def spm_pkgs_by_aggregate_target
@spm_pkgs_by_aggregate_target ||= begin
common_spm_pkgs = root_target_definitions.flat_map(&:spm_pkgs)
target_definition_list.reject(&:abstract?).to_h do |target|
[target.to_s, (common_spm_pkgs + target.spm_pkgs).uniq(&:name)]
end
end
end
|
#spm_pkgs_for(target) ⇒ Object
30
31
32
|
# File 'lib/cocoapods-spm/def/podfile.rb', line 30
def spm_pkgs_for(target)
spm_pkgs_by_aggregate_target[target.to_s]
end
|