Create project form template, such buildSrc plugin
Install the buildSrc into current folder, copy and past the commands into your terminal.
echo "$(curl -fsSL https://raw.githubusercontent.com/hacktons/tpl/master/install-buildsrc)" | bash
PS: Inspired by the homebrew installation way
Now you will have some generated files:
Apply the plugin into your project.
apply plugin: 'com.android.application'
apply plugin: 'hi' // 'hi' is our plugin name
Now your can build/sync within Android Studio, the buildSrc should just work fine.