Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for always_out_of_date flag in script phase #750

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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