_set_localized_text_entry(app, locale, 'Video',
os.path.join(root, f))
continue
+ elif f == 'whatsnew':
+ _set_localized_text_entry(app, segments[-1], 'WhatsNew',
+ os.path.join(root, f))
+ continue
base, extension = common.get_extension(f)
dirname = os.path.basename(root)
repo/packageName/locale/phoneScreenshots/1.png
repo/packageName/locale/phoneScreenshots/2.png
+ The changelog files must be text files named with the versionCode
+ ending with ".txt" and must be in the following layout:
+ https://github.com/fastlane/fastlane/blob/1.109.0/supply/README.md#changelogs-whats-new
+
+ repo/packageName/locale/changelogs/12345.txt
+
+ This will scan the each app's source repo then the metadata/ dir
+ for these standard locations of changelog files. If it finds
+ them, they will be added to the dict of all packages, with the
+ versions in the metadata/ folder taking precendence over the what
+ is in the app's source repo.
+
Where "packageName" is the app's packageName and "locale" is the locale
of the graphics, e.g. what language they are in, using the IETF RFC5646
format (en-US, fr-CA, es-MX, etc).
of graphic and screenshot files. If it finds them, it will copy
them into the repo. The fastlane files follow this pattern:
https://github.com/fastlane/fastlane/blob/1.109.0/supply/README.md#images-and-screenshots
+
"""
sourcedirs = glob.glob(os.path.join('build', '[A-Za-z]*', 'fastlane', 'metadata', 'android', '[a-z][a-z][A-Z-.@]*'))
_set_localized_text_entry(apps[packageName], locale, 'Video',
os.path.join(root, f))
continue
+ elif f == str(apps[packageName]['CurrentVersionCode']) + '.txt':
+ _set_localized_text_entry(apps[packageName], segments[-2], 'WhatsNew',
+ os.path.join(root, f))
+ continue
base, extension = common.get_extension(f)
if base in GRAPHIC_NAMES and extension in ALLOWED_EXTENSIONS:
class UpdateTest(unittest.TestCase):
'''fdroid update'''
+ def testInsertStoreMetadata(self):
+ config = dict()
+ fdroidserver.common.fill_config_defaults(config)
+ config['accepted_formats'] = ('txt', 'yml')
+ fdroidserver.update.config = config
+ fdroidserver.update.options = fdroidserver.common.options
+ os.chdir(os.path.join(localmodule, 'tests'))
+
+ apps = dict()
+ for packageName in ('info.guardianproject.urzip', 'org.videolan.vlc', 'obb.mainpatch.current'):
+ apps[packageName] = dict()
+ apps[packageName]['id'] = packageName
+ apps[packageName]['CurrentVersionCode'] = 0xcafebeef
+ apps['info.guardianproject.urzip']['CurrentVersionCode'] = 100
+ fdroidserver.update.insert_localized_app_metadata(apps)
+
+ self.assertEqual(3, len(apps))
+ for packageName, app in apps.items():
+ self.assertTrue('localized' in app)
+ self.assertTrue('en-US' in app['localized'])
+ self.assertEqual(1, len(app['localized']))
+ if packageName == 'info.guardianproject.urzip':
+ self.assertEqual(5, len(app['localized']['en-US']))
+ self.assertEqual('full description\n', app['localized']['en-US']['Description'])
+ self.assertEqual('title\n', app['localized']['en-US']['Name'])
+ self.assertEqual('short description\n', app['localized']['en-US']['Summary'])
+ self.assertEqual('video\n', app['localized']['en-US']['Video'])
+ self.assertEqual('100\n', app['localized']['en-US']['WhatsNew'])
+ elif packageName == 'org.videolan.vlc':
+ self.assertEqual('icon.png', app['localized']['en-US']['icon'])
+ self.assertEqual(9, len(app['localized']['en-US']['phoneScreenshots']))
+ self.assertEqual(15, len(app['localized']['en-US']['sevenInchScreenshots']))
+ elif packageName == 'obb.mainpatch.current':
+ self.assertEqual('icon.png', app['localized']['en-US']['icon'])
+ 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']))
+
def javagetsig(self, apkfile):
getsig_dir = os.path.join(os.path.dirname(__file__), 'getsig')
if not os.path.exists(getsig_dir + "/getsig.class"):
self.assertIsNone(pysig, "python sig should be None: " + str(sig))
def testScanApksAndObbs(self):
- os.chdir(os.path.dirname(__file__))
+ os.chdir(os.path.join(localmodule, 'tests'))
if os.path.basename(os.getcwd()) != 'tests':
raise Exception('This test must be run in the "tests/" subdir')
self.assertIsNone(apk.get('obbPatchFile'))
def test_scan_invalid_apk(self):
- os.chdir(os.path.dirname(__file__))
+ os.chdir(os.path.join(localmodule, 'tests'))
if os.path.basename(os.getcwd()) != 'tests':
raise Exception('This test must be run in the "tests/" subdir')