From d5ecb34df78e53145e469bd660214b8f6c8302ba Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Sun, 12 Nov 2017 16:32:42 +0100 Subject: [PATCH] add flavour to metadata --- fdroidserver/update.py | 14 +++++++- .../android/en-US/full_description.txt | 1 + .../android/en-US/short_description.txt | 1 + .../fastlane/metadata/android/en-US/title.txt | 1 + .../android/en-US/full_description.txt | 1 + .../android/en-US/short_description.txt | 1 + .../fastlane/metadata/android/en-US/title.txt | 1 + .../android/en-US/full_description.txt | 1 + .../android/en-US/short_description.txt | 1 + .../fastlane/metadata/android/en-US/title.txt | 1 + .../android/en-US/full_description.txt | 1 + .../android/en-US/short_description.txt | 1 + .../fastlane/metadata/android/en-US/title.txt | 1 + tests/update.TestCase | 32 +++++++++++++++++-- 14 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 tests/source-files/com.nextcloud.client.dev/src/generic/fastlane/metadata/android/en-US/full_description.txt create mode 100644 tests/source-files/com.nextcloud.client.dev/src/generic/fastlane/metadata/android/en-US/short_description.txt create mode 100644 tests/source-files/com.nextcloud.client.dev/src/generic/fastlane/metadata/android/en-US/title.txt create mode 100644 tests/source-files/com.nextcloud.client.dev/src/versionDev/fastlane/metadata/android/en-US/full_description.txt create mode 100644 tests/source-files/com.nextcloud.client.dev/src/versionDev/fastlane/metadata/android/en-US/short_description.txt create mode 100644 tests/source-files/com.nextcloud.client.dev/src/versionDev/fastlane/metadata/android/en-US/title.txt create mode 100644 tests/source-files/com.nextcloud.client/src/generic/fastlane/metadata/android/en-US/full_description.txt create mode 100644 tests/source-files/com.nextcloud.client/src/generic/fastlane/metadata/android/en-US/short_description.txt create mode 100644 tests/source-files/com.nextcloud.client/src/generic/fastlane/metadata/android/en-US/title.txt create mode 100644 tests/source-files/com.nextcloud.client/src/versionDev/fastlane/metadata/android/en-US/full_description.txt create mode 100644 tests/source-files/com.nextcloud.client/src/versionDev/fastlane/metadata/android/en-US/short_description.txt create mode 100644 tests/source-files/com.nextcloud.client/src/versionDev/fastlane/metadata/android/en-US/title.txt diff --git a/fdroidserver/update.py b/fdroidserver/update.py index 61026cab..71c4e430 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -772,7 +772,8 @@ def insert_localized_app_metadata(apps): """ - sourcedirs = glob.glob(os.path.join('build', '[A-Za-z]*', 'fastlane', 'metadata', 'android', '[a-z][a-z]*')) + sourcedirs = glob.glob(os.path.join('build', '[A-Za-z]*', 'src', '[A-Za-z]*', 'fastlane', 'metadata', 'android', '[a-z][a-z]*')) + sourcedirs += glob.glob(os.path.join('build', '[A-Za-z]*', 'fastlane', 'metadata', 'android', '[a-z][a-z]*')) sourcedirs += glob.glob(os.path.join('build', '[A-Za-z]*', 'metadata', '[a-z][a-z]*')) sourcedirs += glob.glob(os.path.join('metadata', '[A-Za-z]*', '[a-z][a-z]*')) @@ -787,6 +788,17 @@ def insert_localized_app_metadata(apps): continue locale = segments[-1] destdir = os.path.join('repo', packageName, locale) + + # flavours specified in build receipt + build_flavours = "" + if apps[packageName] and 'builds' in apps[packageName] and len(apps[packageName].builds) > 0\ + and 'gradle' in apps[packageName].builds[-1]: + build_flavours = apps[packageName].builds[-1].gradle + + if len(segments) >= 5 and segments[4] == "fastlane" and segments[3] not in build_flavours: + logging.debug("ignoring due to wrong flavour") + continue + for f in files: if f in ('description.txt', 'full_description.txt'): _set_localized_text_entry(apps[packageName], locale, 'description', diff --git a/tests/source-files/com.nextcloud.client.dev/src/generic/fastlane/metadata/android/en-US/full_description.txt b/tests/source-files/com.nextcloud.client.dev/src/generic/fastlane/metadata/android/en-US/full_description.txt new file mode 100644 index 00000000..f11ffa13 --- /dev/null +++ b/tests/source-files/com.nextcloud.client.dev/src/generic/fastlane/metadata/android/en-US/full_description.txt @@ -0,0 +1 @@ +The copyleft libre software Nextcloud Android app, gives you access to all the files in your Nextcloud.\n\nFeatures:\n* Easy, modern interface, suited to the theme of your server\n* Upload files to your Nextcloud server\n* Share them with others\n* Keep your favorite files and folders synced\n* Search across all folders on your server\n* Auto Upload for photos and videos taken by your device\n* Keep up to date with notifications\n* Multi-account support\n* Secure access to your data with fingerprint or PIN\n* Integration with DAVdroid for easy setup of calendar & Contacts synchronization\n\nPlease report all issues at https://github.com/nextcloud/android/issues and discuss this app at https://help.nextcloud.com/c/clients/android\n\nNew to Nextcloud? Nextcloud is a private file sync & share and communication server. It is libre software, and you can host it yourself or pay a company to do it for you. That way, you are in control of your photos, your calendar and contact data, your documents and everything else.\n\nCheck out Nextcloud at https://nextcloud.com \ No newline at end of file diff --git a/tests/source-files/com.nextcloud.client.dev/src/generic/fastlane/metadata/android/en-US/short_description.txt b/tests/source-files/com.nextcloud.client.dev/src/generic/fastlane/metadata/android/en-US/short_description.txt new file mode 100644 index 00000000..69b7d99b --- /dev/null +++ b/tests/source-files/com.nextcloud.client.dev/src/generic/fastlane/metadata/android/en-US/short_description.txt @@ -0,0 +1 @@ +The Nextcloud Android app gives you access to all your files in your Nextcloud \ No newline at end of file diff --git a/tests/source-files/com.nextcloud.client.dev/src/generic/fastlane/metadata/android/en-US/title.txt b/tests/source-files/com.nextcloud.client.dev/src/generic/fastlane/metadata/android/en-US/title.txt new file mode 100644 index 00000000..9928b03a --- /dev/null +++ b/tests/source-files/com.nextcloud.client.dev/src/generic/fastlane/metadata/android/en-US/title.txt @@ -0,0 +1 @@ +Nextcloud \ No newline at end of file diff --git a/tests/source-files/com.nextcloud.client.dev/src/versionDev/fastlane/metadata/android/en-US/full_description.txt b/tests/source-files/com.nextcloud.client.dev/src/versionDev/fastlane/metadata/android/en-US/full_description.txt new file mode 100644 index 00000000..8593fc4f --- /dev/null +++ b/tests/source-files/com.nextcloud.client.dev/src/versionDev/fastlane/metadata/android/en-US/full_description.txt @@ -0,0 +1 @@ +The Open Source Nextcloud Android app allows you to access all your files on your Nextcloud.\nThis is a dev version of the official Nextcloud app and includes brand-new, untested features which might lead to instabilities and data loss. The app is designed for users willing to test the new features and to report bugs if they occur. Do not use it for your productive work!\n\nThe dev version can be installed alongside the official Nextcloud app which is available at F-Droid, too. Once a day it is checked if the source code was updated, so there can be longer pauses between builds. diff --git a/tests/source-files/com.nextcloud.client.dev/src/versionDev/fastlane/metadata/android/en-US/short_description.txt b/tests/source-files/com.nextcloud.client.dev/src/versionDev/fastlane/metadata/android/en-US/short_description.txt new file mode 100644 index 00000000..42b3df3e --- /dev/null +++ b/tests/source-files/com.nextcloud.client.dev/src/versionDev/fastlane/metadata/android/en-US/short_description.txt @@ -0,0 +1 @@ +The Nextcloud Dev app is a development snapshot and can be installed parallel. diff --git a/tests/source-files/com.nextcloud.client.dev/src/versionDev/fastlane/metadata/android/en-US/title.txt b/tests/source-files/com.nextcloud.client.dev/src/versionDev/fastlane/metadata/android/en-US/title.txt new file mode 100644 index 00000000..dc9e6199 --- /dev/null +++ b/tests/source-files/com.nextcloud.client.dev/src/versionDev/fastlane/metadata/android/en-US/title.txt @@ -0,0 +1 @@ +Nextcloud Dev \ No newline at end of file diff --git a/tests/source-files/com.nextcloud.client/src/generic/fastlane/metadata/android/en-US/full_description.txt b/tests/source-files/com.nextcloud.client/src/generic/fastlane/metadata/android/en-US/full_description.txt new file mode 100644 index 00000000..f11ffa13 --- /dev/null +++ b/tests/source-files/com.nextcloud.client/src/generic/fastlane/metadata/android/en-US/full_description.txt @@ -0,0 +1 @@ +The copyleft libre software Nextcloud Android app, gives you access to all the files in your Nextcloud.\n\nFeatures:\n* Easy, modern interface, suited to the theme of your server\n* Upload files to your Nextcloud server\n* Share them with others\n* Keep your favorite files and folders synced\n* Search across all folders on your server\n* Auto Upload for photos and videos taken by your device\n* Keep up to date with notifications\n* Multi-account support\n* Secure access to your data with fingerprint or PIN\n* Integration with DAVdroid for easy setup of calendar & Contacts synchronization\n\nPlease report all issues at https://github.com/nextcloud/android/issues and discuss this app at https://help.nextcloud.com/c/clients/android\n\nNew to Nextcloud? Nextcloud is a private file sync & share and communication server. It is libre software, and you can host it yourself or pay a company to do it for you. That way, you are in control of your photos, your calendar and contact data, your documents and everything else.\n\nCheck out Nextcloud at https://nextcloud.com \ No newline at end of file diff --git a/tests/source-files/com.nextcloud.client/src/generic/fastlane/metadata/android/en-US/short_description.txt b/tests/source-files/com.nextcloud.client/src/generic/fastlane/metadata/android/en-US/short_description.txt new file mode 100644 index 00000000..69b7d99b --- /dev/null +++ b/tests/source-files/com.nextcloud.client/src/generic/fastlane/metadata/android/en-US/short_description.txt @@ -0,0 +1 @@ +The Nextcloud Android app gives you access to all your files in your Nextcloud \ No newline at end of file diff --git a/tests/source-files/com.nextcloud.client/src/generic/fastlane/metadata/android/en-US/title.txt b/tests/source-files/com.nextcloud.client/src/generic/fastlane/metadata/android/en-US/title.txt new file mode 100644 index 00000000..9928b03a --- /dev/null +++ b/tests/source-files/com.nextcloud.client/src/generic/fastlane/metadata/android/en-US/title.txt @@ -0,0 +1 @@ +Nextcloud \ No newline at end of file diff --git a/tests/source-files/com.nextcloud.client/src/versionDev/fastlane/metadata/android/en-US/full_description.txt b/tests/source-files/com.nextcloud.client/src/versionDev/fastlane/metadata/android/en-US/full_description.txt new file mode 100644 index 00000000..8593fc4f --- /dev/null +++ b/tests/source-files/com.nextcloud.client/src/versionDev/fastlane/metadata/android/en-US/full_description.txt @@ -0,0 +1 @@ +The Open Source Nextcloud Android app allows you to access all your files on your Nextcloud.\nThis is a dev version of the official Nextcloud app and includes brand-new, untested features which might lead to instabilities and data loss. The app is designed for users willing to test the new features and to report bugs if they occur. Do not use it for your productive work!\n\nThe dev version can be installed alongside the official Nextcloud app which is available at F-Droid, too. Once a day it is checked if the source code was updated, so there can be longer pauses between builds. diff --git a/tests/source-files/com.nextcloud.client/src/versionDev/fastlane/metadata/android/en-US/short_description.txt b/tests/source-files/com.nextcloud.client/src/versionDev/fastlane/metadata/android/en-US/short_description.txt new file mode 100644 index 00000000..42b3df3e --- /dev/null +++ b/tests/source-files/com.nextcloud.client/src/versionDev/fastlane/metadata/android/en-US/short_description.txt @@ -0,0 +1 @@ +The Nextcloud Dev app is a development snapshot and can be installed parallel. diff --git a/tests/source-files/com.nextcloud.client/src/versionDev/fastlane/metadata/android/en-US/title.txt b/tests/source-files/com.nextcloud.client/src/versionDev/fastlane/metadata/android/en-US/title.txt new file mode 100644 index 00000000..dc9e6199 --- /dev/null +++ b/tests/source-files/com.nextcloud.client/src/versionDev/fastlane/metadata/android/en-US/title.txt @@ -0,0 +1 @@ +Nextcloud Dev \ No newline at end of file diff --git a/tests/update.TestCase b/tests/update.TestCase index 8a88fc4e..6753c0ca 100755 --- a/tests/update.TestCase +++ b/tests/update.TestCase @@ -42,19 +42,37 @@ class UpdateTest(unittest.TestCase): shutil.rmtree(os.path.join('repo', 'info.guardianproject.urzip'), ignore_errors=True) + shutil.rmtree(os.path.join('build', 'com.nextcloud.client'), ignore_errors=True) + shutil.copytree(os.path.join('source-files', 'com.nextcloud.client'), os.path.join('build', 'com.nextcloud.client')) + + shutil.rmtree(os.path.join('build', 'com.nextcloud.client.dev'), ignore_errors=True) + shutil.copytree(os.path.join('source-files', 'com.nextcloud.client.dev'), + os.path.join('build', 'com.nextcloud.client.dev')) + apps = dict() - for packageName in ('info.guardianproject.urzip', 'org.videolan.vlc', 'obb.mainpatch.current'): - apps[packageName] = dict() + for packageName in ('info.guardianproject.urzip', 'org.videolan.vlc', 'obb.mainpatch.current', + 'com.nextcloud.client', 'com.nextcloud.client.dev'): + apps[packageName] = fdroidserver.metadata.App() apps[packageName]['id'] = packageName apps[packageName]['CurrentVersionCode'] = 0xcafebeef + apps['info.guardianproject.urzip']['CurrentVersionCode'] = 100 + + buildnextcloudclient = fdroidserver.metadata.Build() + buildnextcloudclient.gradle = ['generic'] + apps['com.nextcloud.client']['builds'] = [buildnextcloudclient] + + buildnextclouddevclient = fdroidserver.metadata.Build() + buildnextclouddevclient.gradle = ['versionDev'] + apps['com.nextcloud.client.dev']['builds'] = [buildnextclouddevclient] + fdroidserver.update.insert_localized_app_metadata(apps) appdir = os.path.join('repo', 'info.guardianproject.urzip', 'en-US') self.assertTrue(os.path.isfile(os.path.join(appdir, 'icon.png'))) self.assertTrue(os.path.isfile(os.path.join(appdir, 'featureGraphic.png'))) - self.assertEqual(3, len(apps)) + self.assertEqual(5, len(apps)) for packageName, app in apps.items(): self.assertTrue('localized' in app) self.assertTrue('en-US' in app['localized']) @@ -77,6 +95,14 @@ class UpdateTest(unittest.TestCase): self.assertEqual('featureGraphic.png', app['localized']['en-US']['featureGraphic']) self.assertEqual(1, len(app['localized']['en-US']['phoneScreenshots'])) self.assertEqual(1, len(app['localized']['en-US']['sevenInchScreenshots'])) + elif packageName == 'com.nextcloud.client': + self.assertEqual('Nextcloud', app['localized']['en-US']['name']) + self.assertEqual(1073, len(app['localized']['en-US']['description'])) + self.assertEqual(78, len(app['localized']['en-US']['summary'])) + elif packageName == 'com.nextcloud.client.dev': + self.assertEqual('Nextcloud Dev', app['localized']['en-US']['name']) + self.assertEqual(586, len(app['localized']['en-US']['description'])) + self.assertEqual(79, len(app['localized']['en-US']['summary'])) def test_insert_triple_t_metadata(self): importer = os.path.join(localmodule, 'tests', 'tmp', 'importer') -- 2.30.2