Method: Pod::Podfile::TargetDefinition#store_script_phase
- Defined in:
- lib/cocoapods-core/podfile/target_definition.rb
#store_script_phase(options) ⇒ void
This method returns an undefined value.
Stores the script phase to add for this target definition.
774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 |
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 774 def store_script_phase() option_keys = .keys unrecognized_keys = option_keys - Specification::ALL_SCRIPT_PHASE_KEYS unless unrecognized_keys.empty? raise StandardError, "Unrecognized options `#{unrecognized_keys}` in shell script `#{options[:name]}` within `#{name}` target. " \ "Available options are `#{Specification::ALL_SCRIPT_PHASE_KEYS}`." end missing_required_keys = Specification::SCRIPT_PHASE_REQUIRED_KEYS - option_keys unless missing_required_keys.empty? raise StandardError, "Missing required shell script phase options `#{missing_required_keys.join(', ')}`" end script_phases_hash = get_hash_value('script_phases', []) if script_phases_hash.map { || [:name] }.include?([:name]) raise StandardError, "Script phase with name `#{options[:name]}` name already present for target `#{name}`." end [:execution_position] = :any unless .key?(:execution_position) unless Specification::EXECUTION_POSITION_KEYS.include?([:execution_position]) raise StandardError, "Invalid execution position value `#{options[:execution_position]}` in shell script `#{options[:name]}` within `#{name}` target. " \ "Available options are `#{Specification::EXECUTION_POSITION_KEYS}`." end script_phases_hash << end |