Follow instructions at https://source.android.com/source/downloading.html except those noted below. You need to set up authentication to be able to submit changes. DroidDriver is an “unbundled” project. If you specify the repo manifest branch “droiddriver-dev” (see below), you'll get only the relevant projects instead of the whole AOSP tree.
Create a dir for AOSP, e.g. ~/android/aosp. It should be separate from your work on the internal repo to avoid confusion. Then get a local client of the repo:
$ mkdir droiddriver-dev $ cd droiddriver-dev $ repo init -u https://android.googlesource.com/a/platform/manifest -b droiddriver-dev $ repo sync
The code should be downloaded to the current dir. You may see some lines in the output like:
curl: (22) The requested URL returned error: 401 Unauthorized
These messages seem non-fatal and you should see these dirs after it is done:
build/ external/ frameworks/ Makefile prebuilts/
repo start somebranchname .
After submitting a branch to gerrit for review, each commit will show up as an individual patch set on gerrit. First the code needs to be code reviewed (+2), then verified & submitted by an approver. Reviewers without approval rights are limited to adding a code review +1.
If commits are uploaded together (on the same branch) then they are considered dependent upon eachother. To submit an individual commit without requiring other commits to be merged first, that commit must be cherry picked to a new branch. This can be done either locally or via the gerrit UI.
Reviewers must be added to each changeset for them to approve the code. Reviews can be specified on command line in this format:
$ repo upload --re="<firstname.lastname@example.org>,<email@example.com>" .
The ‘<>’ above are literal. The emails must have been registered with Gerrit. You can also use the “--cc” flag.
When commenting on the code, posts will show up as drafts. Drafts are not visible to other users. To post the drafts, press the reply button (keyboard shortcut ‘a’) and then click Post.
get fetchcommand from the gerrit changeset under the Download menu
repo prune command can be used to delete already merged branches.