From 9c0c014a54e5a9c2f702ed8b384caeccef3ba0df Mon Sep 17 00:00:00 2001 From: Roman Tsisyk Date: Tue, 31 Jan 2023 10:45:52 +0200 Subject: [PATCH] [android] Fix Google Play metadata checks Follow up e1e25100715db04867b98a6ac332dd1785b89e19 Signed-off-by: Roman Tsisyk --- android/build.gradle | 4 +- .../fdroid/play/listings/be/release-notes.txt | 2 +- .../play/listings/es-ES/title-google.txt | 1 + .../play/listings/eu-ES/title-google.txt | 1 + .../play/listings/fr-FR/release-notes.txt | 2 +- .../fdroid/play/listings/uk/release-notes.txt | 2 +- .../play/listings/zh-TW/title-google.txt | 1 + tools/python/check_store_metadata.py | 43 +++++++++++-------- 8 files changed, 33 insertions(+), 23 deletions(-) create mode 100644 android/src/fdroid/play/listings/es-ES/title-google.txt create mode 100644 android/src/fdroid/play/listings/eu-ES/title-google.txt create mode 100644 android/src/fdroid/play/listings/zh-TW/title-google.txt diff --git a/android/build.gradle b/android/build.gradle index d5d8760854..a6199ca8ae 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -494,8 +494,8 @@ huaweiPublish { 'ta-IN': 'ta_IN', 'te-IN': 'te_IN', ] - def files = fileTree(dir: "$projectDir/src/google/play/release-notes", - include: '**/default.txt') + def files = fileTree(dir: "$projectDir/src/fdroid/play/listings", + include: '**/release-notes.txt') files.each { File file -> def path = file.getPath() def locale = file.parentFile.getName() diff --git a/android/src/fdroid/play/listings/be/release-notes.txt b/android/src/fdroid/play/listings/be/release-notes.txt index da6ff8535d..740c9fa360 100644 --- a/android/src/fdroid/play/listings/be/release-notes.txt +++ b/android/src/fdroid/play/listings/be/release-notes.txt @@ -8,4 +8,4 @@ • Харватыя дададзена ў Шэнгенскую зону • Павялічана максімальная колькасць рэдагуемых паверхаў будынкаў да 50 • TTS: уключаны беларуская і некаторыя іншыя мовы -…падрабязней: omaps.app/news \ No newline at end of file +…падрабязней: omaps.app/news diff --git a/android/src/fdroid/play/listings/es-ES/title-google.txt b/android/src/fdroid/play/listings/es-ES/title-google.txt new file mode 100644 index 0000000000..c3c0894ed8 --- /dev/null +++ b/android/src/fdroid/play/listings/es-ES/title-google.txt @@ -0,0 +1 @@ +OrganicMaps: GPS sin conexión diff --git a/android/src/fdroid/play/listings/eu-ES/title-google.txt b/android/src/fdroid/play/listings/eu-ES/title-google.txt new file mode 100644 index 0000000000..f3398e9a75 --- /dev/null +++ b/android/src/fdroid/play/listings/eu-ES/title-google.txt @@ -0,0 +1 @@ +Organic Maps: offline GPS diff --git a/android/src/fdroid/play/listings/fr-FR/release-notes.txt b/android/src/fdroid/play/listings/fr-FR/release-notes.txt index cda9b16a2f..5d199eb1d4 100644 --- a/android/src/fdroid/play/listings/fr-FR/release-notes.txt +++ b/android/src/fdroid/play/listings/fr-FR/release-notes.txt @@ -7,4 +7,4 @@ • Ajout de la Croatie à l'espace Schengen • Augmentation du nombre d'étages modifiables sur un bâtiment de 25 à 50 • Activation du Basque, Biélorusse, Croate, Norvégien, Marathi, Souahili dans TTS. -…Plus sur : omaps.app/news +…Plus: omaps.app/news diff --git a/android/src/fdroid/play/listings/uk/release-notes.txt b/android/src/fdroid/play/listings/uk/release-notes.txt index db1b86500f..e3e1386d63 100644 --- a/android/src/fdroid/play/listings/uk/release-notes.txt +++ b/android/src/fdroid/play/listings/uk/release-notes.txt @@ -8,4 +8,4 @@ • Хорватія додана до Шенгенської зони • Збільшено максимальну кількість редагованих поверхів будівель до 50 • TTS: включені білоруська та деякі інші мови -…докладніше: omaps.app/news \ No newline at end of file +…докладніше: omaps.app/news diff --git a/android/src/fdroid/play/listings/zh-TW/title-google.txt b/android/src/fdroid/play/listings/zh-TW/title-google.txt new file mode 100644 index 0000000000..07d632c421 --- /dev/null +++ b/android/src/fdroid/play/listings/zh-TW/title-google.txt @@ -0,0 +1 @@ +Organic Maps 離線登山、單車與 GPS 導航 diff --git a/tools/python/check_store_metadata.py b/tools/python/check_store_metadata.py index 5d245669db..3d48c79360 100755 --- a/tools/python/check_store_metadata.py +++ b/tools/python/check_store_metadata.py @@ -134,12 +134,14 @@ def check_raw(path, max_length): ok = error(path, "too long: got={}, expected={}", cur_length, max_length) return ok, text -def check_text(path, max): +def check_text(path, max, optional=False): try: return done(path, check_raw(path, max)[0]) except FileNotFoundError as e: + if optional: + return True, print("🚫", path) - return True, + return False, def check_url(path,): (ok, url) = check_raw(path, 500) @@ -159,22 +161,28 @@ def check_exact(path, expected): ok = error(path, "invalid value: got={}, expected={}", value, expected) return done(path, ok) + def check_android(): ok = True - for flavor in glob.glob('android/src/*/play/'): - ok = check_url(flavor + "contact-website.txt") and ok - ok = check_email(flavor + "contact-email.txt") and ok - ok = check_exact(flavor + "default-language.txt", "en-US") and ok - maxTitle = 30 if 'google' in flavor else 50 - for locale in glob.glob(flavor + 'listings/*/'): - if locale.split('/')[-2] not in GPLAY_LOCALES: - ok = error(locale, "unsupported locale") and ok - continue - ok = check_text(locale + "title.txt", maxTitle) and ok - ok = check_text(locale + "short-description.txt", 80) and ok - ok = check_text(locale + "full-description.txt", 4000) and ok - for locale in glob.glob(flavor + 'release-notes/??-??/'): - ok = check_text(locale + "default.txt", 500) and ok + flavor = 'android/src/fdroid/play/' + ok = check_url(flavor + 'contact-website.txt') and ok + ok = check_email(flavor + 'contact-email.txt') and ok + ok = check_exact(flavor + 'default-language.txt', 'en-US') and ok + for locale in glob.glob(flavor + 'listings/*/'): + if locale.split('/')[-2] not in GPLAY_LOCALES: + ok = error(locale, 'unsupported locale') and ok + continue + ok = check_text(locale + 'title.txt', 50) and ok + ok = check_text(locale + 'title-google.txt', 30) and ok + ok = check_text(locale + 'short-description.txt', 80) and ok + ok = check_text(locale + 'short-description-google.txt', 80, True) and ok + ok = check_text(locale + 'full-description.txt', 4000) and ok + ok = check_text(locale + 'full-description-google.txt', 4000, True) and ok + for locale in glob.glob(flavor + 'release-notes/*/'): + if locale.split('/')[-2] not in GPLAY_LOCALES: + ok = error(locale, 'unsupported locale') and ok + continue + ok = check_text(locale + 'default.txt', 500) and ok return ok @@ -206,8 +214,7 @@ def check_ios(): ok = check_text(locale + "promotional_text.txt", 170) and ok ok = check_text(locale + "description.txt", 4000) and ok ok = check_text(locale + "release_notes.txt", 4000) and ok - if os.path.exists(locale + "keywords.txt"): - ok = check_text(locale + "keywords.txt", 100) and ok + ok = check_text(locale + "keywords.txt", 100, True) and ok ok = check_url(locale + "support_url.txt") and ok ok = check_url(locale + "marketing_url.txt") and ok ok = check_url(locale + "privacy_url.txt") and ok