add flavour to metadata

This commit is contained in:
tobiasKaminsky 2017-11-12 16:32:42 +01:00
parent bf09109c49
commit d5ecb34df7
No known key found for this signature in database
GPG Key ID: 0E00D4D47D0C5AF7
14 changed files with 54 additions and 4 deletions

View File

@ -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',

View File

@ -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

View File

@ -0,0 +1 @@
The Nextcloud Android app gives you access to all your files in your Nextcloud

View File

@ -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.

View File

@ -0,0 +1 @@
The Nextcloud Dev app is a development snapshot and can be installed parallel.

View File

@ -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

View File

@ -0,0 +1 @@
The Nextcloud Android app gives you access to all your files in your Nextcloud

View File

@ -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.

View File

@ -0,0 +1 @@
The Nextcloud Dev app is a development snapshot and can be installed parallel.

View File

@ -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')