• Windows 下面下载AOSP源码


    git clone https://android.googlesource.com/platform/manifest.git
    //没有梯子使用清华源
    git clone  https://aosp.tuna.tsinghua.edu.cn/platform/manifest.git
    
    cd manifest
    //没有梯子,使用 git branch -a 查看所有分支,找到想要的分支
    git branch -a
    git checkout android-6.0.1_r79 //这里以 6.0 最后一个版本下载
    // git checkout studio-master-dev // 这里检出 Android Studio源码

    创建 download.py 并执行, 这里进行了优化, 只检出最近一次的git历史代码, 耐心等待即可

    import xml.dom.minidom
    import os
    from subprocess import call
    
    # 1. 修改为源码要保存的路径
    rootdir = "D:/AOSP/studio"
    
    # 2. 设置 git 安装的路径
    git = "C:/Program Files/Git/bin/git.exe"
    
    # 3. 修改为第一步中 manifest 中 default.xml 保存的路径
    dom = xml.dom.minidom.parse("D:/AOSP/manifest/default.xml")
    root = dom.documentElement
    
    #prefix = git + " clone https://android.googlesource.com/"
    # 4. 没有梯子使用清华源下载
    prefix = git + " clone --depth 1 https://aosp.tuna.tsinghua.edu.cn/"
    suffix = ".git"
    
    if not os.path.exists(rootdir):
        os.mkdir(rootdir)
    
    for node in root.getElementsByTagName("project"):
        os.chdir(rootdir)
        d = node.getAttribute("path")
        last = d.rfind("/")
        if last != -1:
            d = rootdir + "/" + d[:last]
            if not os.path.exists(d):
                os.makedirs(d)
            os.chdir(d)
        cmd = prefix + node.getAttribute("name") + suffix
        print(cmd)
        call(cmd)
    

  • 相关阅读:
    jenkins
    Nexus5安装PostmarketOS(Alpine Linux)并装上Docker
    Abp Abp.AspNetZeroCore 2.0.0 2.1.1 Path
    音速启动 Vstart 5.7 win10手动移除后台设置主页
    Win10 20h2 19041 任务管理器 性能 蓝屏
    PostMan 在请求中自动添加Header
    LINQPad_6.9.15_Premium
    Byd 字段清单 通过JS端点导入
    SAP B1 修改数据库中b1版本号
    event是啥
  • 原文地址:https://www.cnblogs.com/beansoft/p/15391141.html
Copyright © 2020-2023  润新知