Class: Pod::DyInstaller::Xcode::PodsProjectGenerator
- Inherits:
-
Object
- Object
- Pod::DyInstaller::Xcode::PodsProjectGenerator
- Defined in:
- lib/pod/installer/xcode/pods_project_generator.rb,
lib/pod/installer/xcode/pods_project_generator/target_installer.rb,
lib/pod/installer/xcode/pods_project_generator/pod_target_installer.rb,
lib/pod/installer/xcode/pods_project_generator/pod_target_integrator.rb,
lib/pod/installer/xcode/pods_project_generator/file_references_installer.rb,
lib/pod/installer/xcode/pods_project_generator/aggregate_target_installer.rb
Overview
The PodsProjectGenerator handles generation of the ‘Pods/Pods.xcodeproj’
Defined Under Namespace
Classes: AggregateTargetInstaller, FileReferencesInstaller, PodTargetInstaller, PodTargetIntegrator, TargetInstaller
Instance Attribute Summary collapse
-
#aggregate_targets ⇒ Array<AggregateTarget>
readonly
The model representations of an aggregation of pod targets generated for a target definition in the Podfile.
-
#analysis_result ⇒ Analyzer
readonly
The analyzer which provides the information about what needs to be installed.
-
#config ⇒ Config
readonly
The global CocoaPods configuration.
-
#installation_options ⇒ InstallationOptions
readonly
The installation options from the Podfile.
-
#pod_targets ⇒ Array<PodTarget>
readonly
The model representations of pod targets.
-
#project ⇒ Pod::Project
readonly
The ‘Pods/Pods.xcodeproj` project.
-
#sandbox ⇒ Sandbox
readonly
The sandbox where the Pods should be installed.
Instance Method Summary collapse
- #generate! ⇒ Object
-
#initialize(aggregate_targets, sandbox, pod_targets, analysis_result, installation_options, config) ⇒ PodsProjectGenerator
constructor
Initialize a new instance.
-
#share_development_pod_schemes ⇒ void
Shares schemes of development Pods.
- #write ⇒ Object
Constructor Details
#initialize(aggregate_targets, sandbox, pod_targets, analysis_result, installation_options, config) ⇒ PodsProjectGenerator
Initialize a new instance
53 54 55 56 57 58 59 60 |
# File 'lib/pod/installer/xcode/pods_project_generator.rb', line 53 def initialize(aggregate_targets, sandbox, pod_targets, analysis_result, , config) @aggregate_targets = aggregate_targets @sandbox = sandbox @pod_targets = pod_targets @analysis_result = analysis_result @installation_options = @config = config end |
Instance Attribute Details
#aggregate_targets ⇒ Array<AggregateTarget> (readonly)
Returns The model representations of an aggregation of pod targets generated for a target definition in the Podfile.
21 22 23 |
# File 'lib/pod/installer/xcode/pods_project_generator.rb', line 21 def aggregate_targets @aggregate_targets end |
#analysis_result ⇒ Analyzer (readonly)
Returns the analyzer which provides the information about what needs to be installed.
34 35 36 |
# File 'lib/pod/installer/xcode/pods_project_generator.rb', line 34 def analysis_result @analysis_result end |
#config ⇒ Config (readonly)
Returns the global CocoaPods configuration.
42 43 44 |
# File 'lib/pod/installer/xcode/pods_project_generator.rb', line 42 def config @config end |
#installation_options ⇒ InstallationOptions (readonly)
Returns the installation options from the Podfile.
38 39 40 |
# File 'lib/pod/installer/xcode/pods_project_generator.rb', line 38 def @installation_options end |
#pod_targets ⇒ Array<PodTarget> (readonly)
Returns The model representations of pod targets.
29 30 31 |
# File 'lib/pod/installer/xcode/pods_project_generator.rb', line 29 def pod_targets @pod_targets end |
#project ⇒ Pod::Project (readonly)
Returns the ‘Pods/Pods.xcodeproj` project.
15 16 17 |
# File 'lib/pod/installer/xcode/pods_project_generator.rb', line 15 def project @project end |
#sandbox ⇒ Sandbox (readonly)
Returns The sandbox where the Pods should be installed.
25 26 27 |
# File 'lib/pod/installer/xcode/pods_project_generator.rb', line 25 def sandbox @sandbox end |
Instance Method Details
#generate! ⇒ Object
62 63 64 65 66 67 68 |
# File 'lib/pod/installer/xcode/pods_project_generator.rb', line 62 def generate! prepare install_file_references install_libraries integrate_targets set_target_dependencies end |
#share_development_pod_schemes ⇒ void
This method returns an undefined value.
Shares schemes of development Pods.
93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/pod/installer/xcode/pods_project_generator.rb', line 93 def share_development_pod_schemes development_pod_targets.select(&:should_build?).each do |pod_target| next unless share_scheme_for_development_pod?(pod_target.pod_name) Xcodeproj::XCScheme.share_scheme(project.path, pod_target.label) if pod_target.contains_test_specifications? pod_target.supported_test_types.each do |test_type| Xcodeproj::XCScheme.share_scheme(project.path, pod_target.test_target_label(test_type)) end end end end |
#write ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/pod/installer/xcode/pods_project_generator.rb', line 70 def write UI. "- Writing Xcode project file to #{UI.path sandbox.project_path}" do project.pods.remove_from_project if project.pods.empty? project.development_pods.remove_from_project if project.development_pods.empty? project.sort(:groups_position => :below) if .deterministic_uuids? UI.('- Generating deterministic UUIDs') { project.predictabilize_uuids } end library_product_types = [:framework, :dynamic_library, :static_library] project.recreate_user_schemes(false) do |scheme, target| next unless library_product_types.include? target.symbol_type pod_target = pod_targets.find { |pt| pt.native_target == target } next if pod_target.nil? || pod_target.test_native_targets.empty? pod_target.test_native_targets.each { |test_native_target| scheme.add_test_target(test_native_target) } end project.save end end |