To get started with Android, you'll need to get familiar with Git and Repo.
To initialize your local repository:
repo init -u git://github.com/PhilSmith31/platform_manifest.git -b aosp-7.1.2_r36
or if you use SSH:
repo init -u git@github.com:PhilSmith31/platform_manifest.git -b aosp-7.1.2_r36
Then to sync up:
repo sync -c --no-tags --no-clone-bundle
Afterwards clone the dependencies device, kernel, vendor, device-settings (always see .dependencies file for that):
git clone https://github.com/PhilSmith31/platform_device_xiaomi_gemini.git -b aosp-7.1.2_r36 device/xiaomi/gemini
git clone https://github.com/PhilSmith31/platform_kernel_xiaomi_msm8996.git -b bb kernel/xiaomi/msm8996
git clone <url-to-proprietary-vendor> -b <branch-name> vendor/xiaomi
git clone https://github.com/PhilSmith31/platform_packages_resources_devicesettings.git -b aosp-7.1.2_r36 packages/resources/devicesettings
Sync again and allow overwriting local changes (be sure that this is okay at the moment):
repo sync -c --no-tags --no-clone-bundle --force-sync
To actually build the ROM you'll have to have an active python2 environment! Check out virtualenv and get familiar with it.
Set up build enviroment
. build/envsetup.sh
Select device (gemini)
lunch 2
Compile the rom
mka jdc