11
votes

I have recently started to look into android development (aosp) and read about "repo" tool/wrapper that takes care of all the android's sub projects .

While I think repo does a fairly good job at what it does, I wanted to know if there are any alternatives to it.

I thought git submodules are sufficient for this but many posts on internet discourage use of submodules ( due to some "drawbacks" which I feel are not drawbacks at all ).

Keeping in mind that the source code for different sub projects should have their own releases or indipendednt code bases I am not sure if git subtree is a good solution for this.

It would be great if someone can point out some alternatives to repo or any other information about this.

2
Just be brave and use submodules. They are a powerful tool.Nick Volynkin
submodules are great if you use them right. if you have a usecase that they weren't designed for, then don't use them.strugee
@strugee "if you use them right" - it implies all developers in a company use it right. It is impossible. 90% of people, in my not humble opinion, are simply not qualified for their work. It should be taken into account while choosing tools that demand discipline and knowledge.Michael A.

2 Answers

4
votes

The repo tool is the standard way to work with AOSP code base. Sure you can manually manage the repos yourself but that is going to be rather tiresome and error prone.

Otherwise using submodules or subtrees won't let you inter-operate with Google and everyone else working on the AOSP codebase, so unless you are planning to do a one-way fork of AOSP there are no alternatives to the repo tool for working on AOSP.

0
votes

repo has one huge disadvantage: it detaches HEADs. You can't switch to specific branch under specific subrepo. Unless you do repo start

tsrc, as far as I know, has less functionality but doesn't have this specific problem.

Also, you can use embedded mechanisms of build systems like Bazel (git_repository/new_git_repository).