Module: Xcake::Constants
- Defined in:
- lib/xcake/constants.rb
Constant Summary collapse
- COMMON_BUILD_SETTINGS =
Xcodeproj::Constants::COMMON_BUILD_SETTINGS.dup.deep_merge( [:ios, :unit_test_bundle] => { 'LD_RUNPATH_SEARCH_PATHS' => [ '$(inherited)', '@executable_path/Frameworks', '@loader_path/Frameworks' ] }.freeze, [:ios, :ui_test_bundle] => { 'LD_RUNPATH_SEARCH_PATHS' => [ '$(inherited)', '@executable_path/Frameworks', '@loader_path/Frameworks' ] }.freeze, [:osx, :unit_test_bundle] => { 'LD_RUNPATH_SEARCH_PATHS' => [ '$(inherited)', '@executable_path/../Frameworks', '@loader_path/../Frameworks' ] }.freeze, [:osx, :ui_test_bundle] => { 'LD_RUNPATH_SEARCH_PATHS' => [ '$(inherited)', '@executable_path/../Frameworks', '@loader_path/../Frameworks' ] }.freeze ).freeze
- PRODUCT_TYPE_UTI =
Xcodeproj::Constants::PRODUCT_TYPE_UTI
- COPY_FILES_BUILD_PHASE_DESTINATIONS =
Xcodeproj::Constants::COPY_FILES_BUILD_PHASE_DESTINATIONS
Class Method Summary collapse
-
.common_build_settings(type, platform = nil, deployment_target = nil, target_product_type = nil, language = :objc) ⇒ Hash
Returns the common build settings for a given platform and configuration name.
-
.deep_dup(object) ⇒ Object
Creates a deep copy of the given object.
Class Method Details
.common_build_settings(type, platform = nil, deployment_target = nil, target_product_type = nil, language = :objc) ⇒ Hash
Returns the common build settings for a given platform and configuration name.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/xcake/constants.rb', line 63 def self.common_build_settings(type, platform = nil, deployment_target = nil, target_product_type = nil, language = :objc) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/LineLength target_product_type = (PRODUCT_TYPE_UTI.find { |_, v| v == target_product_type } || [target_product_type || :application])[0] # rubocop:disable Metrics/LineLength common_settings = COMMON_BUILD_SETTINGS # Use intersecting settings for all key sets as base settings = deep_dup(common_settings[:all]) # Match further common settings by key sets keys = [type, platform, target_product_type, language].compact key_combinations = (1..keys.length).flat_map { |n| keys.combination(n).to_a } key_combinations.each do |key_combination| settings.merge!(deep_dup(common_settings[key_combination] || {})) end if deployment_target case platform when :ios then settings['IPHONEOS_DEPLOYMENT_TARGET'] = deployment_target when :osx then settings['MACOSX_DEPLOYMENT_TARGET'] = deployment_target when :tvos then settings['TVOS_DEPLOYMENT_TARGET'] = deployment_target when :watchos then settings['WATCHOS_DEPLOYMENT_TARGET'] = deployment_target end end settings end |