def _read_version_subdir(self, *args): versions = [] if not os.path.exists(join(*args)): self.buildozer.debug('build-tools folder not found {}'.format( join(*args))) return parse("0") for v in os.listdir(join(*args)): try: versions.append(parse(v)) except: pass if not versions: self.buildozer.error( 'Unable to find the latest version for {}'.format(join(*args))) return parse("0") return max(versions)
def _read_version_subdir(self, *args): versions = [] if not os.path.exists(join(*args)): self.buildozer.debug('build-tools folder not found {}'.format(join( *args))) return parse("0") for v in os.listdir(join(*args)): try: versions.append(parse(v)) except: pass if not versions: self.buildozer.error( 'Unable to find the latest version for {}'.format(join(*args))) return parse("0") return max(versions)
def _find_latest_package(self, packages, key): package_versions = [] for p in packages: if not p.startswith(key): continue version_string = p.split(key)[-1] version = parse(version_string) package_versions.append(version) if not package_versions: return return max(package_versions)
def _android_list_build_tools_versions(self): available_packages = self._sdkmanager('--list') lines = available_packages[0].split('\n') build_tools_versions = [] for line in lines: if not line.strip().startswith('build-tools;'): continue package_name = line.strip().split(' ')[0] assert package_name.count(';') == 1, ( 'could not parse package "{}"'.format(package_name)) version = package_name.split(';')[1] build_tools_versions.append(parse(version)) return build_tools_versions