Method: Pod::Specification::DSL#script_phases=

Defined in:
lib/cocoapods-core/specification/dsl.rb

#script_phases=(*script_phases) ⇒ Object

This attribute allows to define a script phase to execute as part of compilation of the Pod. Unlike a prepare command, script phases execute as part of xcodebuild they can also utilize all environment variables that are set during compilation.

A Pod can provide multiple script phases to execute and they will be added in the order they were declared and after taking into consideration their execution position setting.

Note In order to provide visibility and awareness of the contents of all script phases, a warning will be presented to the user upon installing your pod if it includes any script phases.

Examples:


spec.script_phase = { :name => 'Hello World', :script => 'echo "Hello World"' }

spec.script_phase = { :name => 'Hello World', :script => 'echo "Hello World"', :execution_position => :before_compile }

spec.script_phase = { :name => 'Hello World', :script => 'puts "Hello World"', :shell_path => '/usr/bin/ruby' }

spec.script_phase = { :name => 'Hello World', :script => 'echo "Hello World"',
  :input_files => ['/path/to/input_file.txt'], :output_files => ['/path/to/output_file.txt']
}

spec.script_phase = { :name => 'Hello World', :script => 'echo "Hello World"',
  :input_file_lists => ['/path/to/input_files.xcfilelist'], :output_file_lists => ['/path/to/output_files.xcfilelist']
}

spec.script_phases = [
    { :name => 'Hello World', :script => 'echo "Hello World"' },
    { :name => 'Hello Ruby World', :script => 'puts "Hello World"', :shell_path => '/usr/bin/ruby' },
  ]

Parameters:

  • script_phases (Array<Hash{Symbol=>String}>)

    An array of hashes where each hash represents a single script phase.



1130
1131
1132
1133
# File 'lib/cocoapods-core/specification/dsl.rb', line 1130

attribute :script_phases,
:types => [Hash],
:container => Array,
:singularize => true