The code source is separated to three parts, AOSP & Kernel & SLA, You can download them one by one, and merge them into a whole one.
repo init -u https://android.googlesource.com/platform/manifest -b
Repo sync –j16
You can get a whole set of source code after following below steps.
1、repo get the aosp code source
2、Move the linux code source to AOSP, and rename it to kernel-3.18
3、Unzip the SLA tar ball, cover the appropriate files.