Skip to content

Commit 116952d

Browse files
committed
Add short release notes handling on Android
1 parent 90cf573 commit 116952d

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_update_metadata_source_action.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,11 @@ def self.create_block_parsers(release_version, block_files)
7575

7676
# Init special handlers
7777
block_files.each do | key, file_path |
78-
if (key == :release_note)
78+
case key
79+
when :release_note
7980
@blocks.push (Fastlane::Helper::ReleaseNoteMetadataBlock.new(key, file_path, release_version))
81+
when :release_note_short
82+
@blocks.push (Fastlane::Helper::ReleaseNoteShortMetadataBlock.new(key, file_path, release_version))
8083
else
8184
@blocks.push (Fastlane::Helper::StandardMetadataBlock.new(key, file_path))
8285
end

lib/fastlane/plugin/wpmreleasetoolkit/helper/an_metadata_update_helper.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,5 +134,24 @@ def extract_key(line)
134134
end
135135
end
136136

137+
class ReleaseNoteShortMetadataBlock < ReleaseNoteMetadataBlock
138+
139+
def initialize(block_key, content_file_path, release_version)
140+
super(block_key, content_file_path, release_version)
141+
@rel_note_key = "release_note_short"
142+
@release_version = release_version
143+
generate_keys(release_version)
144+
end
145+
146+
def is_handler_for(key)
147+
values = key.split('_')
148+
key.start_with?(@rel_note_key) && values.length == 4 && (Integer(values[3].sub(/^[0]*/, "")) != nil rescue false)
149+
end
150+
151+
end
137152
end
153+
154+
155+
138156
end
157+

0 commit comments

Comments
 (0)