如何在分配AOSP清单后正确运行repo sync?

dar*_*ord 2 android-build android-source repo

最近我决定潜入Android开源项目世界.这就是我对AOSP生活的看法:

为了深入了解AOSP世界,我需要弄清楚并修改项目中的代码.我打算在三台不同的计算机上完成它,所以我需要将我的工作存储在远程git存储库中.所以我需要在我自己的github帐户中分叉AOSP清单并从中开始工作.

稍后我说尝试使用框架项目,然后我需要将这个项目分成我自己的github帐户:

<project path="frameworks/base" name="platform/frameworks/base" groups="pdk-cw-fs,pdk-fs" />
Run Code Online (Sandbox Code Playgroud)

理想情况下,当我进行本地repo同步时,框架/基础项目将从我自己的github帐户中获取,所有其他项目将从google git repo获取.

这是我在行动中所做的:

我想要做的是将AOSP清单git repo分配给我的github并从那里开始工作.然后我做:

repo sync -u git@github.com:my_own_github_account/platform_manifest.git
Run Code Online (Sandbox Code Playgroud)

然后我做:

repo sync
Run Code Online (Sandbox Code Playgroud)

但是我在控制台中收到了很多错误:

fatal: remote error: 
  my_own_github_account/platform/external/libopus is not a valid repository name
  Email support@github.com for help
Run Code Online (Sandbox Code Playgroud)

似乎repo将假设项目将来自与清单项目相同的基础.我不确定如何正确地与分叉清单进行repo同步.

另外,我不确定我尝试开始AOSP工作的方式是愚蠢还是不专业.如果是这样,如果你能指出我正确的做法,我将不胜感激.提前致谢.

dar*_*ord 5

其实我发现这篇文章几乎完全回答了我的问题:https://www.primianotucci.com/blog/fork-android-on-github.

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

<remote  name="aosp"
           fetch=".."
           review="https://android-review.googlesource.com/" />
Run Code Online (Sandbox Code Playgroud)

这两个点意味着相对于repo清单项目本身获取项目.这就是为什么repo试图从my_own_github_account同步

然后我把它改成了

  <remote  name="aosp"
           fetch="https://android.googlesource.com" />
Run Code Online (Sandbox Code Playgroud)

然后repo sync正常工作.

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

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

将此行添加到清单文件:

 <remote name="origin" fetch="https://github.com/my_own_github_account" />
Run Code Online (Sandbox Code Playgroud)

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

然后添加:

<project path="frameworks/base" name="platform/base"
            remote="origin" revision="your_default_revision" />
Run Code Online (Sandbox Code Playgroud)

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

然后,当你这样做时repo sync,repo将从你自己的github帐户获取框架/ base,并从google source获取其他项目.