示例#1
0
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/")
示例#2
0
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 "C:\\android-sdk-windows"
示例#3
0
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")
示例#4
0
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/"))
示例#5
0
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 "/Applications/android-sdk-macosx/"
示例#6
0
def _download_sdk_for_linux(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')
    if not path.isdir(path.expanduser("~/.forge")):
        os.mkdir(path.expanduser("~/.forge"))

    zip_process = lib.PopenWithoutNewConsole(
        ["unzip", archive_path, '-d',
         path.expanduser("~/.forge")],
        stdout=PIPE,
        stderr=STDOUT)
    output = zip_process.communicate()[0]
    LOG.debug("unzip output")
    LOG.debug(output)

    return path.expanduser("~/.forge/android-sdk-linux/")