Class: Pod::Installer::Xcode::PodsProjectWriter
- Inherits:
-
Object
- Object
- Pod::Installer::Xcode::PodsProjectWriter
- Defined in:
- lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb
Instance Attribute Summary collapse
-
#installation_options ⇒ InstallationOptions
readonly
Installation_options.
-
#pod_target_installation_results ⇒ Hash<String, TargetInstallationResult>
readonly
Pod_target_installation_results Hash of pod target name to installation results.
-
#projects ⇒ Array<Project>
readonly
Projects The list project to write.
-
#sandbox ⇒ Sandbox
readonly
Sandbox The Pods sandbox instance.
Instance Method Summary collapse
-
#initialize(sandbox, projects, pod_target_installation_results, installation_options) ⇒ PodsProjectWriter
constructor
Initialize a new instance.
-
#write! { ... } ⇒ Object
Writes projects to disk.
Constructor Details
#initialize(sandbox, projects, pod_target_installation_results, installation_options) ⇒ PodsProjectWriter
Initialize a new instance
31 32 33 34 35 36 |
# File 'lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb', line 31 def initialize(sandbox, projects, pod_target_installation_results, ) @sandbox = sandbox @projects = projects @pod_target_installation_results = pod_target_installation_results @installation_options = end |
Instance Attribute Details
#installation_options ⇒ InstallationOptions (readonly)
Returns installation_options.
22 23 24 |
# File 'lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb', line 22 def @installation_options end |
#pod_target_installation_results ⇒ Hash<String, TargetInstallationResult> (readonly)
Returns pod_target_installation_results Hash of pod target name to installation results.
18 19 20 |
# File 'lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb', line 18 def pod_target_installation_results @pod_target_installation_results end |
#projects ⇒ Array<Project> (readonly)
Returns projects The list project to write.
13 14 15 |
# File 'lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb', line 13 def projects @projects end |
#sandbox ⇒ Sandbox (readonly)
Returns sandbox The Pods sandbox instance.
8 9 10 |
# File 'lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb', line 8 def sandbox @sandbox end |
Instance Method Details
#write! { ... } ⇒ Object
Writes projects to disk.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb', line 42 def write! cleanup_projects(projects) projects.each do |project| library_product_types = [:framework, :dynamic_library, :static_library] results_by_native_target = Hash[pod_target_installation_results.map do |_, result| [result.native_target, result] end] project.recreate_user_schemes(false) do |scheme, target| next unless target.respond_to?(:symbol_type) next unless library_product_types.include? target.symbol_type installation_result = results_by_native_target[target] next unless installation_result installation_result.test_native_targets.each do |test_native_target| scheme.add_test_target(test_native_target) end end end yield if block_given? save_projects(projects) end |