repo是用于管理android的git仓库的工具。

之前想将android的代码放在github上面,并通过repo进行管理。但一直不知道怎么添加进去,那么多的git仓库,难道都要手动建立吗?

直到看到有人在github上面部署成功,分析一下他的manifest.xml才知道是怎么部署。

参考链接

http://blog.csdn.net/billpig/article/details/7604828

http://blog.csdn.net/shift_wwx/article/details/19557031

manifest.xml

分析的manifest.xml文件来源:

https://github.com/CyanogenMod/android

分析其中的default.xml,如下:

<?xml version="1.0" encoding="UTF-8"?>
<manifest> <remote name="github" // 远程服务器名称是“github”,后面用github表示fetch
fetch=".." // 获取数据的位置是"..",上一级目录
review="review.cyanogenmod.org" /> // gerrit审核的位置 <remote name="private" // 远程服务器名称“private”
fetch="ssh://git@github.com" /> // 从”ssh://git@github.com下载代码 <remote name="aosp" // aosp
fetch="https://android.googlesource.com" // 代码下载地址
review="android-review.googlesource.com"
revision="refs/tags/android-7.1.1_r6" /> // 默认的git分支 // 默认的下载地址,如果没有指定remote的话。
<default revision="refs/heads/cm-14.1" // 默认的代码下载地址
remote="github" // github,表示上面的remote设置的name="github"的一项,那么下载的地址fetch就是”..“
sync-c="true" // 只同步指定的分支
sync-j="4" /> // repo sync 默认的并行数目 <!-- AOSP Projects -->
// path:将代码下载到本地的build目录中
// name:${remote fetch}/${project name}.git
// remote 没有指定,那么久采用default地址,name=github,从”.."上一层目录下载。
// 结合name的值,就从../CyanogenMod/android_build.git这个仓库下载地址。查看作者github仓库,就能找到android_build这个仓库。
<project path="build" name="CyanogenMod/android_build" groups="pdk,tradefed">
<copyfile src="core/root.mk" dest="Makefile" />
</project> // 将代码下载到本地的build/blueprint目录,从remote="aosp“下载,也就是https://android.googlesource.com
// 在结合project的name,下载的仓库地址就是https://android.googlesource.com/platform/build/blueprint
<project path="build/blueprint" name="platform/build/blueprint" groups="pdk,tradefed" remote="aosp" /> // 从android_buld_kati.git仓库下载,放到本地的build/kati目录。
<project path="build/kati" name="CyanogenMod/android_build_kati" groups="pdk,tradefed" />
<project path="build/soong" name="platform/build/soong" groups="pdk,tradefed" remote="aosp" >
<linkfile src="root.bp" dest="Android.bp" />
<linkfile src="bootstrap.bash" dest="bootstrap.bash" />
</project>
<project path="abi/cpp" name="platform/abi/cpp" groups="pdk" remote="aosp" />
<project path="art" name="CyanogenMod/android_art" groups="pdk" />
<project path="bionic" name="CyanogenMod/android_bionic" groups="pdk" />
<project path="bootable/recovery" name="CyanogenMod/android_bootable_recovery" groups="pdk" />
<project path="cts" name="platform/cts" groups="cts,pdk-cw-fs,pdk-fs" remote="aosp" />
<project path="dalvik" name="CyanogenMod/android_dalvik" groups="pdk-cw-fs,pdk-fs" />
<project path="developers/build" name="platform/developers/build" remote="aosp" />
<project path="development" name="CyanogenMod/android_development" groups="pdk-cw-fs,pdk-fs" />
<project path="device/common" name="device/common" groups="pdk-cw-fs,pdk-fs" remote="aosp" />```
...

通过分析可以看出,作者将android的代码放在github上,并通过repo进行管理。

  • 自己需要改动的代码就建立仓库,放在自己的github上。

  • 不改动的代码就引用google原生的代码,这样就不需要在github上面建立仓库。

如果android的源码托管在github上的话可以采用这种方式,建立仓库的数量。一个android里面的git仓库接近500个。建立仓库,保存改动的代码,是个不错的方法。

当然也有很多人在自己的私有服务器搭建git仓库,放置android源码。


Tony Liu

2017-2-22, Shenzhen

repo manifest.xml 分析的更多相关文章

  1. repo manifest xml 文件修改后提交命令

    git push origin dev(本地分支):refs/for/tv/Internal_Jb910_develop_t

  2. 微擎模块的安装文件manifest.xml

    微擎在安装或卸载模块时会根据manifest.xml生成(或删除)数据库中相应记录,并执行manifest.xml里指定的脚本. manifest.xml文件内容详细介绍如下: manifest - ...

  3. manifest.xml微擎系统模块的安装文件内容

    微擎在安装或卸载模块时会根据manifest.xml生成(或删除)数据库中相应记录,并执行manifest.xml里指定的脚本. manifest.xml文件内容详细介绍如下: manifest - ...

  4. 每建一个Activity都要注册权限Manifest.xml

    每建一个Activity都要注册权限Manifest.xml 但是有时候自动注册好了,注意!不然的话是不能调用的!!!!!<activity android:name=".MainVi ...

  5. Solr Schema.xml和solrconfig.xml分析(转)

    Solr Schema.xml和solrconfig.xml分析 (http://yinwufeng.iteye.com/blog/964040) 一.字段配置(schema) schema.xml位 ...

  6. android之IntentFilter的用法_Intent.ACTION_TIME_TICK在manifest.xml不起作用

    在模仿一个天气预报的widget时候,用到了IntentFilter,感觉在manifest.xml注册的receiver跟用代码写registerReceiver()的效果应该是相同的,于是想证明一 ...

  7. 项目总结SpringMVC+hibernate框架 web.xml 分析(2)

    紧接 项目总结SpringMVC+hibernate框架 原理(MVC) applicationContext.xml 文件(3) 这一步讲解项目模块化的配置,项目中每个模块配置一个文件,命名规则为 ...

  8. Manifest XML signature is not valid(安装ClickOnce签名未通过验证)

    转载:http://stackoverflow.com/questions/12826798/manifest-xml-signature-is-not-valid 安装时,我的问题:  PLATFO ...

  9. Manifest.xml中删除了『存储/修改删除SD卡中的内容』和『手机通话/读取手机状态和身份』权限,但生成apk安装软件时仍提示 允许应用程序了解或使用这两个权限

    原因:Android系统会给targetSdk版本为“4”以下的应用自动分配WRITE_EXTERNAL_STORAGE 和 READ_PHONE_STATE 权限. 解放办法:在manifest.x ...

随机推荐

  1. php 解析xml

    解析xml,返回一个对象. $obj = simplexml_load_string($XML, 'SimpleXMLElement', LIBXML_NOCDATA); 查看结果var_dump($ ...

  2. Python中的break和continue的使用方法

    一.continue的使用方法(结束当前的循序,进行下一个数的循环) # *************************************************************** ...

  3. [svc]mousedos网络批量部署xp

    小时候对这个东西很好奇,不知道什么原理.一直觉得很好玩.现在研究了下,总结如下 软件的操作步骤很讲究,稍微不慎,则就需要重新来过 知识点: 1,掌握诺顿ghost分区为gh文件 2,学会清理至一个干净 ...

  4. iOS: 让键盘消失的的4种方法

    转自:http://leopard168.blog.163.com/blog/static/168471844201422121310352/ 在iOS app中,只要用到编辑框(UITextFiel ...

  5. PHP 对 memcache操作类

    <span style="font-size:18px;">class myMemcache { private $memcache; /** * 一般建议这2个值做成 ...

  6. 在Maprecue中利用MultipleOutputs输出多个文件

    用户在使用Mapreduce时默认以part-*命名, MultipleOutputs能够将不同的键值对输出到用户自己定义的不同的文件里. 实现过程是在调用output.write(key, new ...

  7. 针对Properties中实时性要求不高的配置参数,用Java缓存起来

    Properties常用于项目中参数的配置,当项目中某段程序需要获取动态参数时,就从Properties中读取该参数,使程序是可配置的.灵活的. 有些配置参数要求立即生效,有些则未必: 一.实时性要求 ...

  8. NIS & Kerberos配置

    NIS & Kerberos配置 所需RPM包列表: krb5-server-1.10.3-42.el6.x86_64.rpm krb5-workstation-1.10.3-42.el6.x ...

  9. Query图像滑块插件 (支持触摸/滑动手势)

    1.http://bxslider.com/ 2.http://www.slidesjs.com/ (http://www.html5cn.org/article-6437-1.html很多歌)

  10. js实现类似新闻条目人物简介不间断的滚动

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...