def _download_sdk_for_mac(temp_d): archive_path = path.join(temp_d, "sdk.zip") lib.download_with_progress_bar('Downloading Android SDK', _android_sdk_url(), archive_path) LOG.info('Download complete, extracting SDK') zip_process = lib.PopenWithoutNewConsole(["unzip", archive_path, '-d', "/Applications"], stdout=PIPE, stderr=STDOUT) output = zip_process.communicate()[0] LOG.debug("unzip output") LOG.debug(output) return _create_path_info_from_sdk("/Applications/android-sdk-macosx/")
def _download_sdk_for_windows(temp_d): archive_path = path.join(temp_d, "sdk.zip") lib.download_with_progress_bar('Downloading Android SDK', _android_sdk_url(), archive_path) LOG.info('Download complete, extracting SDK') zip_to_extract = zipfile.ZipFile(archive_path) zip_to_extract.extractall("C:\\") zip_to_extract.close() # TODO: should this really be hardcoded to C:\android-sdk-windows? # wasn't sure if we were allowing user to specify location.. return _create_path_info_from_sdk("C:\\android-sdk-windows")
def _download_sdk_for_mac(temp_d): archive_path = path.join(temp_d, "sdk.zip") lib.download_with_progress_bar( "Downloading Android SDK", "https://trigger.io/redirect/android/macosx", archive_path ) LOG.info("Download complete, extracting SDK") zip_process = lib.PopenWithoutNewConsole(["unzip", archive_path, "-d", "/Applications"], stdout=PIPE, stderr=STDOUT) output = zip_process.communicate()[0] LOG.debug("unzip output") LOG.debug(output) return _create_path_info_from_sdk("/Applications/android-sdk-macosx/tools/android")
def _download_sdk_for_mac(temp_d): archive_path = path.join(temp_d, "sdk.zip") lib.download_with_progress_bar('Downloading Android SDK', _android_sdk_url(), archive_path) LOG.info('Download complete, extracting SDK') zip_process = lib.PopenWithoutNewConsole( ["unzip", archive_path, '-d', "/Applications"], stdout=PIPE, stderr=STDOUT) output = zip_process.communicate()[0] LOG.debug("unzip output") LOG.debug(output) return _create_path_info_from_sdk("/Applications/android-sdk-macosx/")
def _download_sdk_for_linux(temp_d): archive_path = path.join(temp_d, "sdk.tgz") lib.download_with_progress_bar('Downloading Android SDK', _android_sdk_url(), archive_path) LOG.info('Download complete, extracting SDK') if not path.isdir(path.expanduser("~/.forge")): os.mkdir(path.expanduser("~/.forge")) zip_process = lib.PopenWithoutNewConsole(["tar", "zxf", archive_path, "-C", path.expanduser("~/.forge")], stdout=PIPE, stderr=STDOUT) output = zip_process.communicate()[0] LOG.debug("unzip output") LOG.debug(output) return _create_path_info_from_sdk(path.expanduser("~/.forge/android-sdk-linux/"))
def _download_sdk_for_linux(temp_d): archive_path = path.join(temp_d, "sdk.tgz") lib.download_with_progress_bar('Downloading Android SDK', _android_sdk_url(), archive_path) LOG.info('Download complete, extracting SDK') if not path.isdir(path.expanduser("~/.forge")): os.mkdir(path.expanduser("~/.forge")) zip_process = lib.PopenWithoutNewConsole( ["tar", "zxf", archive_path, "-C", path.expanduser("~/.forge")], stdout=PIPE, stderr=STDOUT) output = zip_process.communicate()[0] LOG.debug("unzip output") LOG.debug(output) return _create_path_info_from_sdk( path.expanduser("~/.forge/android-sdk-linux/"))