Skip to content

Commit 8f63869

Browse files
authored
Merge pull request #450 from iangmaia/cleanup/remove-deliver-file
Remove Deliverfile related functionality
2 parents 5ca4081 + 8eeea65 commit 8f63869

File tree

7 files changed

+10
-72
lines changed

7 files changed

+10
-72
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- Remove the `skip_glotpress` parameter from the `ios_bump_version_release` action [#443]
1010
- Add the `public_version_xcconfig_file` parameter to the `ios_get_app_version` action to replace the need for an environment variable [#445]
1111
- Remove the `ios_localize_project` and `ios_update_metadata` actions [#447]
12+
- Remove the `skip_deliver` parameter from `ios_bump_version_hotfix` and `ios_bump_version_release` actions [#450]
1213

1314
### New Features
1415

lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_beta.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def self.run(params)
1515
Fastlane::Helper::Ios::VersionHelper.update_xc_configs(@new_beta_version, @short_version, @new_internal_version)
1616
UI.message 'Done!'
1717

18-
Fastlane::Helper::Ios::GitHelper.commit_version_bump(include_deliverfile: false)
18+
Fastlane::Helper::Ios::GitHelper.commit_version_bump()
1919
end
2020

2121
#####################################################

lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,11 @@ def self.run(params)
99
create_config(params[:previous_version], params[:version])
1010
show_config()
1111

12-
update_deliverfile = params[:skip_deliver] == false
13-
if update_deliverfile
14-
UI.message 'Updating Fastlane deliver file...'
15-
Fastlane::Helper::Ios::VersionHelper.update_fastlane_deliver(@new_short_version)
16-
UI.message 'Done!'
17-
end
18-
1912
UI.message 'Updating XcConfig...'
2013
Fastlane::Helper::Ios::VersionHelper.update_xc_configs(@new_version, @new_short_version, @new_version_internal)
2114
UI.message 'Done!'
2215

23-
Fastlane::Helper::Ios::GitHelper.commit_version_bump(include_deliverfile: update_deliverfile)
16+
Fastlane::Helper::Ios::GitHelper.commit_version_bump()
2417

2518
UI.message 'Done.'
2619
end
@@ -51,16 +44,6 @@ def self.available_options
5144
description: 'The version to branch from',
5245
is_string: true
5346
),
54-
FastlaneCore::ConfigItem.new(
55-
key: :skip_deliver,
56-
env_name: 'FL_IOS_BUMP_VERSION_HOTFIX_SKIP_DELIVER',
57-
description: 'Skips Deliverfile key update',
58-
is_string: false, # Boolean parameter
59-
optional: true,
60-
# Don't skip the Deliverfile by default. At the time of writing, 2 out of 3 consumers
61-
# still have a Deliverfile.
62-
default_value: false
63-
),
6447
]
6548
end
6649

lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_release.rb

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,11 @@ def self.run(params)
2121
Fastlane::Helper::GitHelper.create_branch(@new_release_branch, from: default_branch)
2222
UI.message 'Done!'
2323

24-
UI.message 'Updating Fastlane deliver file...' unless params[:skip_deliver]
25-
Fastlane::Helper::Ios::VersionHelper.update_fastlane_deliver(@new_short_version) unless params[:skip_deliver]
26-
UI.message 'Done!' unless params[:skip_deliver]
27-
2824
UI.message 'Updating XcConfig...'
2925
Fastlane::Helper::Ios::VersionHelper.update_xc_configs(@new_version, @new_short_version, @new_version_internal)
3026
UI.message 'Done!'
3127

32-
Fastlane::Helper::Ios::GitHelper.commit_version_bump(
33-
include_deliverfile: !params[:skip_deliver]
34-
)
28+
Fastlane::Helper::Ios::GitHelper.commit_version_bump()
3529

3630
UI.message 'Done.'
3731
end
@@ -50,11 +44,6 @@ def self.details
5044

5145
def self.available_options
5246
[
53-
FastlaneCore::ConfigItem.new(key: :skip_deliver,
54-
env_name: 'FL_IOS_CODEFREEZE_BUMP_SKIPDELIVER',
55-
description: 'Skips Deliver key update',
56-
type: Boolean,
57-
default_value: false),
5847
FastlaneCore::ConfigItem.new(key: :default_branch,
5948
env_name: 'FL_RELEASE_TOOLKIT_DEFAULT_BRANCH',
6049
description: 'Default branch of the repository',

lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_git_helper.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,11 @@ module GitHelper
88
#
99
# This typically commits and pushes:
1010
# - The files in `./config/*` – especially `Version.*.xcconfig` files
11-
# - The `fastlane/Deliverfile` file (which contains the `app_version` line)
1211
#
1312
# @env PROJECT_ROOT_FOLDER The path to the git root of the project
1413
#
15-
# @param [Bool] include_deliverfile If true (the default), includes the `fastlane/Deliverfile` in files being commited
16-
#
17-
def self.commit_version_bump(include_deliverfile: true)
14+
def self.commit_version_bump
1815
files_list = [File.join(get_from_env!(key: 'PROJECT_ROOT_FOLDER'), 'config', '.')]
19-
files_list.append File.join('fastlane', 'Deliverfile') if include_deliverfile
2016

2117
Fastlane::Helper::GitHelper.commit(message: 'Bump version number', files: files_list, push: true)
2218
end

lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_version_helper.rb

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -215,20 +215,6 @@ def self.bump_version_release
215215
return verified_version
216216
end
217217

218-
# Updates the `app_version` entry in the `Deliverfile`
219-
#
220-
# @param [String] new_version The new value to set the `app_version` entry to.
221-
# @raise [UserError] If the Deliverfile was not found.
222-
#
223-
def self.update_fastlane_deliver(new_version)
224-
fd_file = './fastlane/Deliverfile'
225-
if File.exist?(fd_file)
226-
Action.sh("sed -i '' \"s/app_version.*/app_version \\\"#{new_version}\\\"/\" #{fd_file}")
227-
else
228-
UI.user_error!("Can't find #{fd_file}.")
229-
end
230-
end
231-
232218
# Update the `.xcconfig` files (the public one, and the internal one if it exists) with the new version strings.
233219
#
234220
# @env PUBLIC_CONFIG_FILE The path to the xcconfig file containing the public version numbers.

spec/ios_bump_version_release_spec.rb

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,17 @@
1111
other_action_mock = double()
1212
allow(Fastlane::Action).to receive(:other_action).and_return(other_action_mock)
1313
allow(other_action_mock).to receive(:ensure_git_branch).with(branch: default_branch)
14-
15-
allow(Fastlane::Helper::GitHelper).to receive(:checkout_and_pull).with(default_branch)
16-
allow(Fastlane::Helper::GitHelper).to receive(:create_branch).with("release/#{next_version_short}", from: default_branch)
17-
1814
allow(Fastlane::Helper::Ios::VersionHelper).to receive(:read_from_config_file).and_return(version)
19-
allow(Fastlane::Helper::Ios::VersionHelper).to receive(:update_xc_configs).with(next_version, next_version_short, nil)
20-
end
21-
22-
it 'does the fastlane deliver update' do
23-
skip_deliver = false
24-
25-
expect(Fastlane::Helper::Ios::VersionHelper).to receive(:update_fastlane_deliver).with(next_version_short)
26-
expect(Fastlane::Helper::Ios::GitHelper).to receive(:commit_version_bump).with(include_deliverfile: !skip_deliver)
27-
28-
run_described_fastlane_action(
29-
skip_deliver: skip_deliver,
30-
default_branch: default_branch
31-
)
3215
end
3316

34-
it 'skips the fastlane deliver update properly' do
35-
skip_deliver = true
17+
it 'correctly uses the next version, short and long' do
18+
expect(Fastlane::Helper::GitHelper).to receive(:checkout_and_pull).with(default_branch)
19+
expect(Fastlane::Helper::GitHelper).to receive(:create_branch).with("release/#{next_version_short}", from: default_branch)
3620

37-
expect(Fastlane::Helper::Ios::VersionHelper).not_to receive(:update_fastlane_deliver)
38-
expect(Fastlane::Helper::Ios::GitHelper).to receive(:commit_version_bump).with(include_deliverfile: !skip_deliver)
21+
expect(Fastlane::Helper::Ios::VersionHelper).to receive(:update_xc_configs).with(next_version, next_version_short, nil)
22+
expect(Fastlane::Helper::Ios::GitHelper).to receive(:commit_version_bump)
3923

4024
run_described_fastlane_action(
41-
skip_deliver: skip_deliver,
4225
default_branch: default_branch
4326
)
4427
end

0 commit comments

Comments
 (0)