Class: Pod::Installer::Xcode::PodsProjectGenerator::AppHostInstaller
- Inherits:
-
Object
- Object
- Pod::Installer::Xcode::PodsProjectGenerator::AppHostInstaller
- Includes:
- TargetInstallerHelper
- Defined in:
- lib/cocoapods/installer/xcode/pods_project_generator/app_host_installer.rb
Overview
Installs an app host target to a given project.
Instance Attribute Summary collapse
-
#platform ⇒ Platform
readonly
The platform to use for this app host.
-
#project ⇒ Pod::Project
readonly
The ‘Pods/Pods.xcodeproj` to install the app host into.
-
#sandbox ⇒ Sandbox
readonly
Sandbox The sandbox used for this installation.
-
#test_type ⇒ Symbol
readonly
The test type this app host is going to be used for.
Instance Method Summary collapse
-
#initialize(sandbox, project, platform, test_type) ⇒ AppHostInstaller
constructor
Initialize a new instance.
-
#install! ⇒ PBXNativeTarget
The app host native target that was installed.
Methods included from TargetInstallerHelper
create_info_plist_file_with_sandbox, update_changed_file
Constructor Details
#initialize(sandbox, project, platform, test_type) ⇒ AppHostInstaller
Initialize a new instance
35 36 37 38 39 40 |
# File 'lib/cocoapods/installer/xcode/pods_project_generator/app_host_installer.rb', line 35 def initialize(sandbox, project, platform, test_type) @sandbox = sandbox @project = project @platform = platform @test_type = test_type end |
Instance Attribute Details
#platform ⇒ Platform (readonly)
Returns the platform to use for this app host.
22 23 24 |
# File 'lib/cocoapods/installer/xcode/pods_project_generator/app_host_installer.rb', line 22 def platform @platform end |
#project ⇒ Pod::Project (readonly)
Returns The ‘Pods/Pods.xcodeproj` to install the app host into.
18 19 20 |
# File 'lib/cocoapods/installer/xcode/pods_project_generator/app_host_installer.rb', line 18 def project @project end |
#sandbox ⇒ Sandbox (readonly)
Returns sandbox The sandbox used for this installation.
13 14 15 |
# File 'lib/cocoapods/installer/xcode/pods_project_generator/app_host_installer.rb', line 13 def sandbox @sandbox end |
#test_type ⇒ Symbol (readonly)
Returns the test type this app host is going to be used for.
26 27 28 |
# File 'lib/cocoapods/installer/xcode/pods_project_generator/app_host_installer.rb', line 26 def test_type @test_type end |
Instance Method Details
#install! ⇒ PBXNativeTarget
Returns the app host native target that was installed.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/cocoapods/installer/xcode/pods_project_generator/app_host_installer.rb', line 44 def install! name = app_host_label platform_name = platform.name app_host_target = Pod::Generator::AppTargetHelper.add_app_target(project, platform_name, deployment_target, name) app_host_target.build_configurations.each do |configuration| configuration.build_settings['PRODUCT_NAME'] = name configuration.build_settings['PRODUCT_BUNDLE_IDENTIFIER'] = 'org.cocoapods.${PRODUCT_NAME:rfc1034identifier}' configuration.build_settings['CODE_SIGN_IDENTITY'] = '' if platform == :osx configuration.build_settings['CURRENT_PROJECT_VERSION'] = '1' end Pod::Generator::AppTargetHelper.add_app_host_main_file(project, app_host_target, platform_name, name) create_info_plist_file_with_sandbox(sandbox, app_host_info_plist_path, app_host_target, '1.0.0', platform, :appl) project[name].new_file(app_host_info_plist_path) app_host_target end |