fastlane-plugin-wpmreleasetoolkit 8.1.0 → 9.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_update_metadata_source_action.rb +6 -4
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_validate_lib_strings_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_build_prechecks.rb +2 -2
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_beta.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_final_release.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_hotfix.rb +3 -2
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_release.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_codefreeze_prechecks.rb +3 -3
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_completecodefreeze_prechecks.rb +4 -4
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_file_by_version.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_translations_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_finalize_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_firebase_test.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_hotfix_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/buildkite_trigger_build_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/check_translation_progress.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_new_milestone_action.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_action.rb +4 -3
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/extract_release_notes_for_version_action.rb +3 -3
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/find_previous_tag.rb +58 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/get_prs_between_tags.rb +112 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_downloadmetadata_action.rb +5 -5
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_update_metadata_source.rb +6 -4
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/promo_screenshots_action.rb +24 -24
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/upload_to_s3.rb +37 -5
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_add_files_to_copy_action.rb +3 -3
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_download_action.rb +3 -3
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_update_action.rb +2 -2
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_validate_action.rb +3 -3
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_development_certificates_to_provisioning_profiles.rb +2 -2
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_devices_to_provisioning_profiles.rb +2 -2
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_betabuild_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_prechecks.rb +4 -4
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_preflight.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_beta.rb +5 -7
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb +3 -22
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_release.rb +6 -20
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_codefreeze_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_completecodefreeze_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_finalize_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_app_version.rb +11 -4
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_hotfix_prechecks.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_lint_localizations.rb +2 -2
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_tag_build.rb +2 -2
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb +4 -4
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_validate_ci_build.rb +2 -2
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_localize_helper.rb +39 -41
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_version_helper.rb +10 -11
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/configure_helper.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/git_helper.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb +39 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_adc_app_sizes_helper.rb +2 -2
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_git_helper.rb +2 -55
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_linter_helper.rb +3 -3
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_version_helper.rb +42 -52
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/metadata_block.rb +20 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/release_note_metadata_block.rb +72 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/release_note_short_metadata_block.rb +23 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/standard_metadata_block.rb +47 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/unknown_metadata_block.rb +13 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/whats_new_metadata_block.rb +53 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_download_helper.rb +13 -13
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb +11 -11
- data/lib/fastlane/plugin/wpmreleasetoolkit/version.rb +3 -1
- metadata +32 -15
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/get_prs_list_action.rb +0 -66
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_localize_project.rb +0 -43
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata.rb +0 -40
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/an_metadata_update_helper.rb +0 -152
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_update_helper.rb +0 -182
@@ -38,11 +38,11 @@ module Fastlane
|
|
38
38
|
source = d[0].split(/\u0004/).last
|
39
39
|
|
40
40
|
target_files.each do |file|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
41
|
+
next unless file[0].to_s == key
|
42
|
+
|
43
|
+
data = file[1]
|
44
|
+
msg = is_source ? source : d[1].first || '' # In the JSON, each Hash value is an array, with zero or one entry
|
45
|
+
update_key(target_locale, key, file, data, msg)
|
46
46
|
end
|
47
47
|
end
|
48
48
|
end
|
@@ -55,19 +55,19 @@ module Fastlane
|
|
55
55
|
|
56
56
|
@alternates.each do |file|
|
57
57
|
puts "Data: #{file[0]} - key: #{key}"
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
58
|
+
next unless file[0].to_s == key
|
59
|
+
|
60
|
+
puts "Alternate: #{key}"
|
61
|
+
data = file[1]
|
62
|
+
msg = is_source ? source : d[1].first || '' # In the JSON, each Hash value is an array, with zero or one entry
|
63
|
+
update_key(target_locale, key, file, data, msg)
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
68
|
def update_key(target_locale, key, file, data, msg)
|
69
69
|
message_len = msg.length
|
70
|
-
if
|
70
|
+
if data.key?(:max_size) && (data[:max_size] != 0) && (message_len > data[:max_size])
|
71
71
|
if data.key?(:alternate_key)
|
72
72
|
UI.message("#{target_locale} translation for #{key} exceeds maximum length (#{message_len}). Switching to the alternate translation.")
|
73
73
|
@alternates[data[:alternate_key]] = { desc: data[:desc], max_size: 0 }
|
@@ -111,7 +111,7 @@ module Fastlane
|
|
111
111
|
@alternates.clear
|
112
112
|
loc_data = JSON.parse(response.body) rescue loc_data = nil
|
113
113
|
parse_data(locale, loc_data, is_source)
|
114
|
-
reparse_alternates(target_locale, loc_data, is_source) unless @alternates.
|
114
|
+
reparse_alternates(target_locale, loc_data, is_source) unless @alternates.empty?
|
115
115
|
when '301'
|
116
116
|
# Follow the redirect
|
117
117
|
UI.message("Received 301 for `#{locale}`. Following redirect...")
|
@@ -32,14 +32,14 @@ module Fastlane
|
|
32
32
|
UI.user_error!('`drawText` not found – install it using `brew install automattic/build-tools/drawText`.') unless system('command -v drawText')
|
33
33
|
end
|
34
34
|
|
35
|
-
def read_config(
|
36
|
-
|
35
|
+
def read_config(config_file_path)
|
36
|
+
config_file_path = resolve_path(config_file_path)
|
37
37
|
|
38
38
|
begin
|
39
39
|
# NOTE: While JSON is a subset of YAML and thus YAML.load_file would technically cover both cases at once, in practice
|
40
40
|
# `JSON.parse` is more lenient with JSON files than `YAML.load_file` is — especially, it accepts `// comments` in the
|
41
41
|
# JSON file, despite this not being allowed in the spec — hence why we still try with `JSON.parse` for `.json` files.
|
42
|
-
return File.extname(
|
42
|
+
return File.extname(config_file_path) == '.json' ? JSON.parse(File.read(config_file_path)) : YAML.load_file(config_file_path)
|
43
43
|
rescue StandardError => e
|
44
44
|
UI.error(e)
|
45
45
|
UI.user_error!('Invalid JSON/YAML configuration. Please lint your config file to check for syntax errors.')
|
@@ -280,7 +280,7 @@ module Fastlane
|
|
280
280
|
|
281
281
|
def draw_text_to_canvas(canvas, text, width, height, x_position, y_position, font_size, stylesheet_path, position = 'center')
|
282
282
|
begin
|
283
|
-
|
283
|
+
temp_text_file = Tempfile.new
|
284
284
|
|
285
285
|
Action.sh('drawText', "html=#{text}", "maxWidth=#{width}", "maxHeight=#{height}", "output=#{tempTextFile.path}", "fontSize=#{font_size}", "stylesheet=#{stylesheet_path}", "alignment=#{position}")
|
286
286
|
|
@@ -292,8 +292,8 @@ module Fastlane
|
|
292
292
|
when 'top' then composite_image_top(text_frame, text_content, 0, 0)
|
293
293
|
end
|
294
294
|
ensure
|
295
|
-
|
296
|
-
|
295
|
+
temp_text_file.close
|
296
|
+
temp_text_file.unlink
|
297
297
|
end
|
298
298
|
|
299
299
|
composite_image(canvas, text_frame, x_position, y_position)
|
@@ -431,12 +431,12 @@ module Fastlane
|
|
431
431
|
end
|
432
432
|
|
433
433
|
def resolve_text_into_path(text, locale)
|
434
|
-
|
434
|
+
localized_file = format(text, locale)
|
435
435
|
|
436
|
-
text = if File.exist?(
|
437
|
-
|
438
|
-
elsif can_resolve_path(
|
439
|
-
resolve_path(
|
436
|
+
text = if File.exist?(localized_file)
|
437
|
+
localized_file
|
438
|
+
elsif can_resolve_path(localized_file)
|
439
|
+
resolve_path(localized_file).realpath.to_s
|
440
440
|
else
|
441
441
|
format(text, 'source')
|
442
442
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-wpmreleasetoolkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 9.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Automattic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05
|
11
|
+
date: 2023-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '3.3'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: fastlane
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '2.213'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '2.213'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: git
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,14 +114,14 @@ dependencies:
|
|
100
114
|
requirements:
|
101
115
|
- - "~>"
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
117
|
+
version: '6.1'
|
104
118
|
type: :runtime
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
122
|
- - "~>"
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
124
|
+
version: '6.1'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: parallel
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -185,33 +199,33 @@ dependencies:
|
|
185
199
|
- !ruby/object:Gem::Version
|
186
200
|
version: '1.0'
|
187
201
|
- !ruby/object:Gem::Dependency
|
188
|
-
name:
|
202
|
+
name: xcodeproj
|
189
203
|
requirement: !ruby/object:Gem::Requirement
|
190
204
|
requirements:
|
191
205
|
- - "~>"
|
192
206
|
- !ruby/object:Gem::Version
|
193
|
-
version: '1.
|
207
|
+
version: '1.22'
|
194
208
|
type: :runtime
|
195
209
|
prerelease: false
|
196
210
|
version_requirements: !ruby/object:Gem::Requirement
|
197
211
|
requirements:
|
198
212
|
- - "~>"
|
199
213
|
- !ruby/object:Gem::Version
|
200
|
-
version: '1.
|
214
|
+
version: '1.22'
|
201
215
|
- !ruby/object:Gem::Dependency
|
202
|
-
name:
|
216
|
+
name: google-cloud-storage
|
203
217
|
requirement: !ruby/object:Gem::Requirement
|
204
218
|
requirements:
|
205
219
|
- - "~>"
|
206
220
|
- !ruby/object:Gem::Version
|
207
|
-
version: '1.
|
221
|
+
version: '1.31'
|
208
222
|
type: :runtime
|
209
223
|
prerelease: false
|
210
224
|
version_requirements: !ruby/object:Gem::Requirement
|
211
225
|
requirements:
|
212
226
|
- - "~>"
|
213
227
|
- !ruby/object:Gem::Version
|
214
|
-
version: '1.
|
228
|
+
version: '1.31'
|
215
229
|
- !ruby/object:Gem::Dependency
|
216
230
|
name: bundler
|
217
231
|
requirement: !ruby/object:Gem::Requirement
|
@@ -415,8 +429,9 @@ files:
|
|
415
429
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_new_milestone_action.rb
|
416
430
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_action.rb
|
417
431
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/common/extract_release_notes_for_version_action.rb
|
432
|
+
- lib/fastlane/plugin/wpmreleasetoolkit/actions/common/find_previous_tag.rb
|
418
433
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/common/firebase_login.rb
|
419
|
-
- lib/fastlane/plugin/wpmreleasetoolkit/actions/common/
|
434
|
+
- lib/fastlane/plugin/wpmreleasetoolkit/actions/common/get_prs_between_tags.rb
|
420
435
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_downloadmetadata_action.rb
|
421
436
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_update_metadata_source.rb
|
422
437
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/common/promo_screenshots_action.rb
|
@@ -455,15 +470,12 @@ files:
|
|
455
470
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_store_app_sizes.rb
|
456
471
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_hotfix_prechecks.rb
|
457
472
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_lint_localizations.rb
|
458
|
-
- lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_localize_project.rb
|
459
473
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_merge_strings_files.rb
|
460
474
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_send_app_size_metrics.rb
|
461
475
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_tag_build.rb
|
462
|
-
- lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata.rb
|
463
476
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb
|
464
477
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_release_notes.rb
|
465
478
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_validate_ci_build.rb
|
466
|
-
- lib/fastlane/plugin/wpmreleasetoolkit/helper/an_metadata_update_helper.rb
|
467
479
|
- lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_emulator_helper.rb
|
468
480
|
- lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_git_helper.rb
|
469
481
|
- lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_localize_helper.rb
|
@@ -484,8 +496,13 @@ files:
|
|
484
496
|
- lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_linter_helper.rb
|
485
497
|
- lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_strings_file_validation_helper.rb
|
486
498
|
- lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_version_helper.rb
|
499
|
+
- lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/metadata_block.rb
|
500
|
+
- lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/release_note_metadata_block.rb
|
501
|
+
- lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/release_note_short_metadata_block.rb
|
502
|
+
- lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/standard_metadata_block.rb
|
503
|
+
- lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/unknown_metadata_block.rb
|
504
|
+
- lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/whats_new_metadata_block.rb
|
487
505
|
- lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_download_helper.rb
|
488
|
-
- lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_update_helper.rb
|
489
506
|
- lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb
|
490
507
|
- lib/fastlane/plugin/wpmreleasetoolkit/helper/release_notes_helper.rb
|
491
508
|
- lib/fastlane/plugin/wpmreleasetoolkit/helper/user_agent.rb
|
@@ -1,66 +0,0 @@
|
|
1
|
-
require 'fastlane/action'
|
2
|
-
require_relative '../../helper/github_helper'
|
3
|
-
|
4
|
-
module Fastlane
|
5
|
-
module Actions
|
6
|
-
class GetPrsListAction < Action
|
7
|
-
def self.run(params)
|
8
|
-
repository = params[:repository]
|
9
|
-
report_path = File.expand_path(params[:report_path])
|
10
|
-
milestone = params[:milestone]
|
11
|
-
|
12
|
-
# Get commit list
|
13
|
-
github_helper = Fastlane::Helper::GithubHelper.new(github_token: params[:github_token])
|
14
|
-
pr_list = github_helper.get_prs_for_milestone(repository, milestone)
|
15
|
-
|
16
|
-
File.open(report_path, 'w') do |file|
|
17
|
-
pr_list.each do |data|
|
18
|
-
file.puts("##{data[:number]}: #{data[:title]} @#{data[:user][:login]} #{data[:html_url]}")
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
UI.success("Found #{pr_list.count} PRs in #{milestone} – saved to #{report_path}")
|
23
|
-
end
|
24
|
-
|
25
|
-
def self.description
|
26
|
-
'Generate the list of the PRs in the given `repository` for the given `milestone` at the given `report_path`'
|
27
|
-
end
|
28
|
-
|
29
|
-
def self.authors
|
30
|
-
['Automattic']
|
31
|
-
end
|
32
|
-
|
33
|
-
def self.return_value
|
34
|
-
# If your method provides a return value, you can describe here what it does
|
35
|
-
end
|
36
|
-
|
37
|
-
def self.details
|
38
|
-
# Optional:
|
39
|
-
description
|
40
|
-
end
|
41
|
-
|
42
|
-
def self.available_options
|
43
|
-
[
|
44
|
-
FastlaneCore::ConfigItem.new(key: :repository,
|
45
|
-
env_name: 'GHHELPER_REPOSITORY',
|
46
|
-
description: 'The repository name, including the organization (e.g. `wordpress-mobile/wordpress-ios`)',
|
47
|
-
optional: false,
|
48
|
-
type: String),
|
49
|
-
FastlaneCore::ConfigItem.new(key: :report_path,
|
50
|
-
description: 'The path where the list of PRs should be written to',
|
51
|
-
optional: false,
|
52
|
-
type: String),
|
53
|
-
FastlaneCore::ConfigItem.new(key: :milestone,
|
54
|
-
description: 'The name of the milestone we want to fetch the list of PRs for (e.g.: `16.9`)',
|
55
|
-
optional: false,
|
56
|
-
type: String),
|
57
|
-
Fastlane::Helper::GithubHelper.github_token_config_item,
|
58
|
-
]
|
59
|
-
end
|
60
|
-
|
61
|
-
def self.is_supported?(platform)
|
62
|
-
true
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
module Fastlane
|
2
|
-
module Actions
|
3
|
-
class IosLocalizeProjectAction < Action
|
4
|
-
def self.run(params)
|
5
|
-
UI.message 'Updating project localisation...'
|
6
|
-
|
7
|
-
require_relative '../../helper/ios/ios_git_helper'
|
8
|
-
other_action.cocoapods()
|
9
|
-
Fastlane::Helper::Ios::GitHelper.localize_project()
|
10
|
-
|
11
|
-
UI.message 'Done.'
|
12
|
-
end
|
13
|
-
|
14
|
-
#####################################################
|
15
|
-
# @!group Documentation
|
16
|
-
#####################################################
|
17
|
-
|
18
|
-
def self.description
|
19
|
-
'Gathers the strings to localise. Deprecated'
|
20
|
-
end
|
21
|
-
|
22
|
-
def self.details
|
23
|
-
'Gathers the strings to localise. Deprecated in favor of the new `ios_generate_strings_file_from_code`'
|
24
|
-
end
|
25
|
-
|
26
|
-
def self.category
|
27
|
-
:deprecated
|
28
|
-
end
|
29
|
-
|
30
|
-
def self.deprecated_notes
|
31
|
-
'This action is deprecated in favor of `ios_generate_strings_file_from_code`'
|
32
|
-
end
|
33
|
-
|
34
|
-
def self.authors
|
35
|
-
['Automattic']
|
36
|
-
end
|
37
|
-
|
38
|
-
def self.is_supported?(platform)
|
39
|
-
platform == :ios
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
@@ -1,40 +0,0 @@
|
|
1
|
-
module Fastlane
|
2
|
-
module Actions
|
3
|
-
class IosUpdateMetadataAction < Action
|
4
|
-
def self.run(params)
|
5
|
-
require_relative '../../helper/ios/ios_git_helper'
|
6
|
-
|
7
|
-
Fastlane::Helper::Ios::GitHelper.update_metadata()
|
8
|
-
end
|
9
|
-
|
10
|
-
#####################################################
|
11
|
-
# @!group Documentation
|
12
|
-
#####################################################
|
13
|
-
|
14
|
-
def self.description
|
15
|
-
'Downloads translated metadata from the translation system'
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.details
|
19
|
-
'Downloads translated metadata from the translation system'
|
20
|
-
end
|
21
|
-
|
22
|
-
def self.available_options
|
23
|
-
end
|
24
|
-
|
25
|
-
def self.output
|
26
|
-
end
|
27
|
-
|
28
|
-
def self.return_value
|
29
|
-
end
|
30
|
-
|
31
|
-
def self.authors
|
32
|
-
['Automattic']
|
33
|
-
end
|
34
|
-
|
35
|
-
def self.is_supported?(platform)
|
36
|
-
[:ios, :mac].include?(platform)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
@@ -1,152 +0,0 @@
|
|
1
|
-
module Fastlane
|
2
|
-
module Helper
|
3
|
-
# Basic line handler
|
4
|
-
class MetadataBlock
|
5
|
-
attr_reader :block_key
|
6
|
-
|
7
|
-
def initialize(block_key)
|
8
|
-
@block_key = block_key
|
9
|
-
end
|
10
|
-
|
11
|
-
def handle_line(fw, line)
|
12
|
-
fw.puts(line) # Standard line handling: just copy
|
13
|
-
end
|
14
|
-
|
15
|
-
def is_handler_for(key)
|
16
|
-
true
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
class UnknownMetadataBlock < MetadataBlock
|
21
|
-
attr_reader :content_file_path
|
22
|
-
|
23
|
-
def initialize
|
24
|
-
super(nil)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
class StandardMetadataBlock < MetadataBlock
|
29
|
-
attr_reader :content_file_path
|
30
|
-
|
31
|
-
def initialize(block_key, content_file_path)
|
32
|
-
super(block_key)
|
33
|
-
@content_file_path = content_file_path
|
34
|
-
end
|
35
|
-
|
36
|
-
def is_handler_for(key)
|
37
|
-
key == @block_key.to_s
|
38
|
-
end
|
39
|
-
|
40
|
-
def handle_line(fw, line)
|
41
|
-
# put the new content on block start
|
42
|
-
# and skip all the other content
|
43
|
-
generate_block(fw) if line.start_with?('msgctxt')
|
44
|
-
end
|
45
|
-
|
46
|
-
def generate_block(fw)
|
47
|
-
# init
|
48
|
-
fw.puts("msgctxt \"#{@block_key}\"")
|
49
|
-
line_count = File.foreach(@content_file_path).inject(0) { |c, _line| c + 1 }
|
50
|
-
|
51
|
-
if line_count <= 1
|
52
|
-
# Single line output
|
53
|
-
fw.puts("msgid \"#{File.read(@content_file_path).rstrip}\"")
|
54
|
-
else
|
55
|
-
# Multiple line output
|
56
|
-
fw.puts('msgid ""')
|
57
|
-
|
58
|
-
# insert content
|
59
|
-
File.open(@content_file_path, 'r').each do |line|
|
60
|
-
fw.puts("\"#{line.strip}\\n\"")
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
# close
|
65
|
-
fw.puts('msgstr ""')
|
66
|
-
fw.puts('')
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
class ReleaseNoteMetadataBlock < StandardMetadataBlock
|
71
|
-
attr_reader :new_key, :keep_key, :rel_note_key, :release_version
|
72
|
-
|
73
|
-
def initialize(block_key, content_file_path, release_version)
|
74
|
-
super(block_key, content_file_path)
|
75
|
-
@rel_note_key = 'release_note'
|
76
|
-
@release_version = release_version
|
77
|
-
generate_keys(release_version)
|
78
|
-
end
|
79
|
-
|
80
|
-
def generate_keys(release_version)
|
81
|
-
values = release_version.split('.')
|
82
|
-
version_major = Integer(values[0])
|
83
|
-
version_minor = Integer(values[1])
|
84
|
-
@new_key = "#{@rel_note_key}_#{version_major.to_s.rjust(2, '0')}#{version_minor}"
|
85
|
-
|
86
|
-
version_major = version_major - 1 if version_minor == 0
|
87
|
-
version_minor = version_minor == 0 ? 9 : version_minor - 1
|
88
|
-
|
89
|
-
@keep_key = "#{@rel_note_key}_#{version_major.to_s.rjust(2, '0')}#{version_minor}"
|
90
|
-
end
|
91
|
-
|
92
|
-
def is_handler_for(key)
|
93
|
-
values = key.split('_')
|
94
|
-
key.start_with?(@rel_note_key) && values.length == 3 && is_int?(values[2].sub(/^0*/, ''))
|
95
|
-
end
|
96
|
-
|
97
|
-
def handle_line(fw, line)
|
98
|
-
# put content on block start or if copying the latest one
|
99
|
-
# and skip all the other content
|
100
|
-
if line.start_with?('msgctxt')
|
101
|
-
key = extract_key(line)
|
102
|
-
@is_copying = (key == @keep_key)
|
103
|
-
generate_block(fw) if @is_copying
|
104
|
-
end
|
105
|
-
|
106
|
-
fw.puts(line) if @is_copying
|
107
|
-
end
|
108
|
-
|
109
|
-
def generate_block(fw)
|
110
|
-
# init
|
111
|
-
fw.puts("msgctxt \"#{@new_key}\"")
|
112
|
-
fw.puts('msgid ""')
|
113
|
-
fw.puts("\"#{@release_version}:\\n\"")
|
114
|
-
|
115
|
-
# insert content
|
116
|
-
File.open(@content_file_path, 'r').each do |line|
|
117
|
-
fw.puts("\"#{line.strip}\\n\"")
|
118
|
-
end
|
119
|
-
|
120
|
-
# close
|
121
|
-
fw.puts('msgstr ""')
|
122
|
-
fw.puts('')
|
123
|
-
end
|
124
|
-
|
125
|
-
def extract_key(line)
|
126
|
-
line.split[1].tr('\"', '')
|
127
|
-
end
|
128
|
-
|
129
|
-
def is_int?(value)
|
130
|
-
true if Integer(value) rescue false
|
131
|
-
end
|
132
|
-
end
|
133
|
-
|
134
|
-
class ReleaseNoteShortMetadataBlock < ReleaseNoteMetadataBlock
|
135
|
-
def initialize(block_key, content_file_path, release_version)
|
136
|
-
super(block_key, content_file_path, release_version)
|
137
|
-
@rel_note_key = 'release_note_short'
|
138
|
-
@release_version = release_version
|
139
|
-
generate_keys(release_version)
|
140
|
-
end
|
141
|
-
|
142
|
-
def is_handler_for(key)
|
143
|
-
values = key.split('_')
|
144
|
-
key.start_with?(@rel_note_key) && values.length == 4 && is_int?(values[3].sub(/^0*/, ''))
|
145
|
-
end
|
146
|
-
|
147
|
-
def generate_block(fw)
|
148
|
-
super(fw) unless File.empty?(@content_file_path)
|
149
|
-
end
|
150
|
-
end
|
151
|
-
end
|
152
|
-
end
|