Class: Pod::Installer::Xcode::PodsProjectGenerator::TargetInstallationResult
- Inherits:
-
Object
- Object
- Pod::Installer::Xcode::PodsProjectGenerator::TargetInstallationResult
- Defined in:
- lib/cocoapods/installer/xcode/pods_project_generator/target_installation_result.rb
Overview
A simple container produced after a target installation is completed.
Instance Attribute Summary collapse
-
#native_target ⇒ PBXNativeTarget
readonly
Native_target The native target that was produced for this target.
-
#resource_bundle_targets ⇒ Array<PBXNativeTarget>
readonly
Resource_bundle_targets The resource bundle targets that were produced for this target.
-
#target ⇒ Target
readonly
Target The target this installation result is for.
-
#test_native_targets ⇒ Array<PBXNativeTarget>
readonly
Test_native_targets The test native targets that were produced for this target.
-
#test_resource_bundle_targets ⇒ Hash{String=>Array<PBXNativeTarget>}
readonly
Test_resource_bundle_targets The test resource bundle targets that were produced for this target keyed by test spec name.
Instance Method Summary collapse
-
#initialize(target, native_target, resource_bundle_targets = [], test_native_targets = [], test_resource_bundle_targets = {}) ⇒ TargetInstallationResult
constructor
Initialize a new instance.
-
#native_target_for_spec(spec) ⇒ PBXNativeTarget
Returns the corresponding native target to use based on the provided specification.
-
#test_specs_by_native_target ⇒ Hash{Array => Specification}
A hash where the keys are the test native targets and the value an array of all the test specs associated with this native target.
Constructor Details
#initialize(target, native_target, resource_bundle_targets = [], test_native_targets = [], test_resource_bundle_targets = {}) ⇒ TargetInstallationResult
Initialize a new instance
44 45 46 47 48 49 50 51 |
# File 'lib/cocoapods/installer/xcode/pods_project_generator/target_installation_result.rb', line 44 def initialize(target, native_target, resource_bundle_targets = [], test_native_targets = [], test_resource_bundle_targets = {}) @target = target @native_target = native_target @resource_bundle_targets = resource_bundle_targets @test_native_targets = test_native_targets @test_resource_bundle_targets = test_resource_bundle_targets end |
Instance Attribute Details
#native_target ⇒ PBXNativeTarget (readonly)
Returns native_target The native target that was produced for this target.
16 17 18 |
# File 'lib/cocoapods/installer/xcode/pods_project_generator/target_installation_result.rb', line 16 def native_target @native_target end |
#resource_bundle_targets ⇒ Array<PBXNativeTarget> (readonly)
Returns resource_bundle_targets The resource bundle targets that were produced for this target. Can be empty if the target had no resource bundles.
22 23 24 |
# File 'lib/cocoapods/installer/xcode/pods_project_generator/target_installation_result.rb', line 22 def resource_bundle_targets @resource_bundle_targets end |
#target ⇒ Target (readonly)
Returns target The target this installation result is for.
11 12 13 |
# File 'lib/cocoapods/installer/xcode/pods_project_generator/target_installation_result.rb', line 11 def target @target end |
#test_native_targets ⇒ Array<PBXNativeTarget> (readonly)
Returns test_native_targets The test native targets that were produced for this target. Can be empty if there were no test native targets created (e.g. no test specs present).
28 29 30 |
# File 'lib/cocoapods/installer/xcode/pods_project_generator/target_installation_result.rb', line 28 def test_native_targets @test_native_targets end |
#test_resource_bundle_targets ⇒ Hash{String=>Array<PBXNativeTarget>} (readonly)
Returns test_resource_bundle_targets The test resource bundle targets that were produced for this target keyed by test spec name. Can be empty if the target had no resource bundles for any tests.
34 35 36 |
# File 'lib/cocoapods/installer/xcode/pods_project_generator/target_installation_result.rb', line 34 def test_resource_bundle_targets @test_resource_bundle_targets end |
Instance Method Details
#native_target_for_spec(spec) ⇒ PBXNativeTarget
Returns the corresponding native target to use based on the provided specification.
60 61 62 63 |
# File 'lib/cocoapods/installer/xcode/pods_project_generator/target_installation_result.rb', line 60 def native_target_for_spec(spec) return native_target unless spec.test_specification? test_native_target_from_spec(spec) end |
#test_specs_by_native_target ⇒ Hash{Array => Specification}
Returns a hash where the keys are the test native targets and the value an array of all the test specs associated with this native target.
68 69 70 71 72 73 |
# File 'lib/cocoapods/installer/xcode/pods_project_generator/target_installation_result.rb', line 68 def test_specs_by_native_target test_specs_by_native_target = target.test_specs.group_by do |test_spec| test_native_target_from_spec(test_spec) end test_specs_by_native_target.delete_if { |k, _| k.nil? } end |