Skip to content

Commit

Permalink
Merge pull request #750 from alvarhansen/alvar/always_out_of_date
Browse files Browse the repository at this point in the history
Add support for always_out_of_date flag in script phase
  • Loading branch information
dnkoutso authored Sep 22, 2023
2 parents 9320bf5 + 0000000 commit d349b65
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
[Gabriel Donadel](https://github.com/gabrieldonadel)
[#745](https://github.com/CocoaPods/Core/pull/745)

* Extend `script_phase` DSL to support `always_out_of_date` attribute.
[Alvar Hansen](https://github.com/alvarhansen)
[#750](https://github.com/CocoaPods/Core/pull/750)

##### Bug Fixes

* None.
Expand Down
4 changes: 4 additions & 0 deletions lib/cocoapods-core/podfile/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,10 @@ def target(name, options = nil)
# @option options [String] :dependency_file
# specifies the dependency file to use for this script phase.
#
# @option options [String] :always_out_of_date
# specifies whether or not this run script will be forced to
# run even on incremental builds
#
# @return [void]
#
def script_phase(options)
Expand Down
2 changes: 1 addition & 1 deletion lib/cocoapods-core/specification/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ def dependency=(args)
SCRIPT_PHASE_REQUIRED_KEYS = [:name, :script].freeze

SCRIPT_PHASE_OPTIONAL_KEYS = [:shell_path, :input_files, :output_files, :input_file_lists, :output_file_lists,
:show_env_vars_in_log, :execution_position, :dependency_file].freeze
:show_env_vars_in_log, :execution_position, :dependency_file, :always_out_of_date].freeze

EXECUTION_POSITION_KEYS = [:before_compile, :after_compile, :before_headers, :after_headers, :any].freeze

Expand Down
2 changes: 1 addition & 1 deletion spec/podfile/target_definition_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ module Pod
e = lambda { @parent.store_script_phase(:name => 'PhaseName', :unknown => 'Unknown') }.should.raise Podfile::StandardError
e.message.should == 'Unrecognized options `[:unknown]` in shell script `PhaseName` within `MyApp` target. ' \
'Available options are `[:name, :script, :shell_path, :input_files, :output_files, :input_file_lists, ' \
':output_file_lists, :show_env_vars_in_log, :execution_position, :dependency_file]`.'
':output_file_lists, :show_env_vars_in_log, :execution_position, :dependency_file, :always_out_of_date]`.'
end

it 'raises if script phase includes an invalid execution position key' do
Expand Down
2 changes: 1 addition & 1 deletion spec/specification/linter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ def result_should_include(*values)
@spec.script_phases = { :name => 'Hello World', :script => 'echo "Hello World"', :unknown => 'unknown' }
result_should_include('script_phases', 'Unrecognized option(s) `unknown` in script phase `Hello World`. ' \
'Available options are `name, script, shell_path, input_files, output_files, input_file_lists, ' \
'output_file_lists, show_env_vars_in_log, execution_position, dependency_file`.')
'output_file_lists, show_env_vars_in_log, execution_position, dependency_file, always_out_of_date`.')
end

it 'checks script phases include a valid execution position value' do
Expand Down

0 comments on commit d349b65

Please sign in to comment.