- if not os.path.isdir(root_dir):
- return (None, "Subdir '" + app['builds'][-1]['subdir'] + "'is not a valid directory")
-
- paths = common.manifest_paths(root_dir, flavours)
+ hpak = None
+ hver = None
+ hcode = "0"
+ for subdir in possible_subdirs(app):
+ root_dir = os.path.join(build_dir, subdir)
+ paths = common.manifest_paths(root_dir, flavours)
+ version, vercode, package = \
+ common.parse_androidmanifests(paths, app['Update Check Ignore'])
+ if app_matches_packagename(app, package) and version and vercode:
+ logging.debug("Manifest exists in subdir '{0}'. Found version {1} ({2})"
+ .format(subdir, version, vercode))
+ if int(vercode) > int(hcode):
+ hpak = package
+ hcode = str(int(vercode))
+ hver = version