Class: Pod::Installer::UserProjectIntegrator::TargetIntegrator
- Inherits:
-
Object
- Object
- Pod::Installer::UserProjectIntegrator::TargetIntegrator
- Defined in:
- lib/cocoapods/installer/user_project_integrator/target_integrator.rb,
lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb
Overview
This class is responsible for integrating the library generated by a TargetDefinition with its destination project.
Defined Under Namespace
Classes: XCConfigIntegrator
Constant Summary collapse
- EMBED_FRAMEWORK_TARGET_TYPES =
frameworks are embedded in the output directory / product bundle.
[:application, :unit_test_bundle].freeze
Instance Attribute Summary collapse
-
#target ⇒ AggregateTarget
readonly
The target that should be integrated.
Instance Method Summary collapse
-
#initialize(target) ⇒ TargetIntegrator
constructor
Init a new TargetIntegrator.
-
#inspect ⇒ String
A string representation suitable for debugging.
-
#integrate! ⇒ void
Integrates the user project targets.
Constructor Details
#initialize(target) ⇒ TargetIntegrator
Init a new TargetIntegrator
25 26 27 |
# File 'lib/cocoapods/installer/user_project_integrator/target_integrator.rb', line 25 def initialize(target) @target = target end |
Instance Attribute Details
#target ⇒ AggregateTarget (readonly)
Returns the target that should be integrated.
19 20 21 |
# File 'lib/cocoapods/installer/user_project_integrator/target_integrator.rb', line 19 def target @target end |
Instance Method Details
#inspect ⇒ String
Returns a string representation suitable for debugging.
69 70 71 |
# File 'lib/cocoapods/installer/user_project_integrator/target_integrator.rb', line 69 def inspect "#<#{self.class} for target `#{target.label}'>" end |
#integrate! ⇒ void
This method returns an undefined value.
Integrates the user project targets. Only the targets that do not already have the Pods library in their frameworks build phase are processed.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/cocoapods/installer/user_project_integrator/target_integrator.rb', line 35 def integrate! UI.section() do # TODO: refactor into Xcodeproj https://github.com/CocoaPods/Xcodeproj/issues/202 project_is_dirty = [ XCConfigIntegrator.integrate(target, native_targets), update_to_cocoapods_0_34, , unless native_targets_to_integrate.empty? add_pods_library if target.requires_frameworks? add_copy_resources_script_phase add_check_manifest_lock_script_phase true end, ].any? if project_is_dirty user_project.save else # There is a bug in Xcode where the process of deleting and # re-creating the xcconfig files used in the build # configuration cause building the user project to fail until # Xcode is relaunched. # # Touching/saving the project causes Xcode to reload these. # # https://github.com/CocoaPods/CocoaPods/issues/2665 FileUtils.touch(user_project.path + 'project.pbxproj') end end end |