fix: Emojiが多すぎてAndroidでリリースできない問題を修正

This commit is contained in:
usbharu 2024-01-05 14:51:11 +09:00
parent af496662b3
commit e9ec136a56
Signed by: usbharu
GPG Key ID: 6556747BF94EEBC8
1 changed files with 13 additions and 2 deletions

View File

@ -31,11 +31,19 @@ class EmojiPlugin : Plugin<Project> {
var group: String = "" var group: String = ""
var subgroup: String = "" var subgroup: String = ""
var emojiCount = 0
var groupCount = 0
data class Emoji(val group: String, val value: String) data class Emoji(val group: String, val value: String)
val enumList = mutableMapOf<String, Emoji>() val enumList = mutableMapOf<String, Emoji>()
//TODO グループ分けしたことで重複がなくなるはずなので修正 //TODO グループ分けしたことで重複がなくなるはずなので修正
for (s in split) { for (s in split) {
if(emojiCount >= 99){
emojiCount = 0
groupCount++
}
when { when {
s.startsWith("# group:") -> { s.startsWith("# group:") -> {
group = s.substringAfter(": ") group = s.substringAfter(": ")
@ -62,14 +70,15 @@ class EmojiPlugin : Plugin<Project> {
"minimally-qualified" -> "Status.MINIMALLY_QUALIFIED" "minimally-qualified" -> "Status.MINIMALLY_QUALIFIED"
else -> { else -> {
break println(status)
continue
} }
} }
enumList.put( enumList.put(
description, description,
Emoji( Emoji(
group, group+groupCount,
"${ "${
(description + "_" + status).toUpperCase() (description + "_" + status).toUpperCase()
.replace(" ", "_") .replace(" ", "_")
@ -110,6 +119,8 @@ class EmojiPlugin : Plugin<Project> {
}(\"$group\",\"$subgroup\",\"$code\",\"$char\",\"$description\",$statusString)" }(\"$group\",\"$subgroup\",\"$code\",\"$char\",\"$description\",$statusString)"
) )
) )
emojiCount++
} }
} }
} }