Вопрос

I am working with the Android source code. Every time I do a repo sync I get to download loads of device-specific repositories I don't want because I will only target one device, let's say, HTC Ace.

Is there a way to avoid such overhead?

Это было полезно?

Решение

As someone else already has suggested, the local manifest can be used to patch the original manifest. However, manifests can also put projects into groups and you can use the -g option to repo init to choose which groups of projects you want to download.

I think all the device gits that you don't care about have been placed in the "device" group, so excluding that group by prefixing it with a hyphen should accomplish what you want. The default set of groups is "default,platform-platform", e.g. "default,platform-linux" or "default,platform-darwin", although the platform-* entry doesn't appear to match how the AOSP projects have been tagged. Anyway, this should get rid of the unwanted projects:

repo init -u ... -g default,-device

You can poke around the manifest (.repo/manifest.xml) to find additional groups that you're not interested in.

Другие советы

The aosp way of doing things is probably to use the repo tool to exclude or include specific packages. The best way of doing this is probably by adding your own local manifest that removes the packages you don't want. For instance, here is an example file:

<manifest>
  <remote name="origin"
           fetch="ssh://git@github.com/MyRepository/" />
  <remove-project name="device/lge/hammerhead"/>
  <remove-project name="device/lge/mako"/>
</manifest>

Throw this into a removal_manifest.xml (you can name it what ever you want) and put it into .repo/local_manifests in your repository.

Cyanogen has documented the local_manifests for all of us so you can refer back to their work here: Using Local Manifests

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top