Created
November 29, 2014 18:25
-
-
Save danybony/b7390d55bf58507a9314 to your computer and use it in GitHub Desktop.
Setup and start AOSP build with ccache and build target passed as parameter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function show_help { | |
echo "Usage:" | |
echo "./startbuild.sh -t <build_target> [-c -h]" | |
echo | |
echo "Parameters:" | |
echo "-t: specify the build target as per lunch (required)" | |
echo "-c: perform a clean build, calling make clean" | |
echo "-h: show this" | |
} | |
CLEAN=false | |
THREADS=16 | |
while getopts "cjh?t:" opt; do | |
case "$opt" in | |
h|\?) | |
show_help | |
exit 0 | |
;; | |
c) CLEAN=true | |
;; | |
t) TARGET=$OPTARG | |
;; | |
esac | |
done | |
if [ -z "$TARGET" ]; then | |
echo "Error: Target required" | |
show_help | |
exit 0 | |
fi | |
export USE_CCACHE=1 | |
. build/envsetup.sh | |
lunch $TARGET | |
if $CLEAN; then | |
echo "Cleaning..." | |
make clean | |
fi | |
echo "Starting build in backgroud" | |
nohup make -j$THREADS & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment