5

Recently I decided to dive into the Android Open Source Project world. This is how I picture my life will be with AOSP:

In order to dig into the AOSP world, I need to get my hands dirty and modify code in the projects. And I am going to do it on three different computers so I need to store my work in remote git repositories. So I need to fork the AOSP manifest in my own github account and work from that.

Say later I try to play with the frameworks project, then I need to fork this project into my own github account as well:

<project path="frameworks/base" name="platform/frameworks/base" groups="pdk-cw-fs,pdk-fs" />

Ideally, when I do a local repo sync, the frameworks/base project will be fetched from my own github account and all other projects will be fetched from google git repo.

Here is what I did in action:

What I want to do is forking the AOSP manifest git repo to my github and work from there. Then I do:

repo sync -u git@github.com:my_own_github_account/platform_manifest.git

Then I do:

repo sync

However I received a lot of error in the console like:

fatal: remote error: 
  my_own_github_account/platform/external/libopus is not a valid repository name
  Email support@github.com for help

It seems repo will assume the projects will come from the same base as the manifest project. I am not sure how to properly do a repo sync with a forked manifest.

Additionally, I am not sure if the way I tried to start work on AOSP is silly or unprofessional. If so I will appreciate it if you can point me to the right way of doing it. Thanks in advance.

4

1 回答 1

6

实际上,我在这里发现这篇文章几乎完美地回答了我的问题:https ://www.primianotucci.com/blog/fork-android-on-github 。

我无法进行 repo sync 的原因是 repo 文件中的这一行:

<remote  name="aosp"
           fetch=".."
           review="https://android-review.googlesource.com/" />

这两个点表示获取与 repo manifest 项目本身相关的项目。这就是 repo 尝试从 my_own_github_account 同步的原因

然后我把它改成

  <remote  name="aosp"
           fetch="https://android.googlesource.com" />

然后回购同步正常工作。

如果我想从自己的 github 帐户同步特定项目怎么办?

当然,您需要将该项目镜像到您自己的 github 帐户。然后像这样修改清单文件:

将此行添加到清单文件:

 <remote name="origin" fetch="https://github.com/my_own_github_account" />

该名称是您要用于您自己的子项目的远程获取源。

然后添加这个:

<project path="frameworks/base" name="platform/base"
            remote="origin" revision="your_default_revision" />

请注意,为了覆盖默认的远程获取源,您需要添加remote="origin".

然后,当您这样做时repo sync,repo 将从您自己的 github 帐户获取框架/基础,并从 google 源获取其他项目。

于 2016-04-04T02:12:04.003 回答