chiark / gitweb /
add flavour to metadata
authortobiasKaminsky <tobias@kaminsky.me>
Sun, 12 Nov 2017 15:32:42 +0000 (16:32 +0100)
committertobiasKaminsky <tobias@kaminsky.me>
Fri, 1 Dec 2017 14:25:00 +0000 (15:25 +0100)
14 files changed:
fdroidserver/update.py
tests/source-files/com.nextcloud.client.dev/src/generic/fastlane/metadata/android/en-US/full_description.txt [new file with mode: 0644]
tests/source-files/com.nextcloud.client.dev/src/generic/fastlane/metadata/android/en-US/short_description.txt [new file with mode: 0644]
tests/source-files/com.nextcloud.client.dev/src/generic/fastlane/metadata/android/en-US/title.txt [new file with mode: 0644]
tests/source-files/com.nextcloud.client.dev/src/versionDev/fastlane/metadata/android/en-US/full_description.txt [new file with mode: 0644]
tests/source-files/com.nextcloud.client.dev/src/versionDev/fastlane/metadata/android/en-US/short_description.txt [new file with mode: 0644]
tests/source-files/com.nextcloud.client.dev/src/versionDev/fastlane/metadata/android/en-US/title.txt [new file with mode: 0644]
tests/source-files/com.nextcloud.client/src/generic/fastlane/metadata/android/en-US/full_description.txt [new file with mode: 0644]
tests/source-files/com.nextcloud.client/src/generic/fastlane/metadata/android/en-US/short_description.txt [new file with mode: 0644]
tests/source-files/com.nextcloud.client/src/generic/fastlane/metadata/android/en-US/title.txt [new file with mode: 0644]
tests/source-files/com.nextcloud.client/src/versionDev/fastlane/metadata/android/en-US/full_description.txt [new file with mode: 0644]
tests/source-files/com.nextcloud.client/src/versionDev/fastlane/metadata/android/en-US/short_description.txt [new file with mode: 0644]
tests/source-files/com.nextcloud.client/src/versionDev/fastlane/metadata/android/en-US/title.txt [new file with mode: 0644]
tests/update.TestCase

index 61026cabfea4ba41394040428298e5912624f53a..71c4e430d4edee755dcae42f10ed0f09a81e4a2c 100644 (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',
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 (file)
index 0000000..f11ffa1
--- /dev/null
@@ -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 (file)
index 0000000..69b7d99
--- /dev/null
@@ -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 (file)
index 0000000..9928b03
--- /dev/null
@@ -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 (file)
index 0000000..8593fc4
--- /dev/null
@@ -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 (file)
index 0000000..42b3df3
--- /dev/null
@@ -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 (file)
index 0000000..dc9e619
--- /dev/null
@@ -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 (file)
index 0000000..f11ffa1
--- /dev/null
@@ -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 (file)
index 0000000..69b7d99
--- /dev/null
@@ -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 (file)
index 0000000..9928b03
--- /dev/null
@@ -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 (file)
index 0000000..8593fc4
--- /dev/null
@@ -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 (file)
index 0000000..42b3df3
--- /dev/null
@@ -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 (file)
index 0000000..dc9e619
--- /dev/null
@@ -0,0 +1 @@
+Nextcloud Dev
\ No newline at end of file
index 8a88fc4e936a9742769e231963a8f3301a446422..6753c0ca637122b09c8d88524d10a88fc17b9344 100755 (executable)
@@ -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')