Skip to content

Instantly share code, notes, and snippets.

@hfase01
Last active December 19, 2015 18:18
Show Gist options
  • Save hfase01/5997332 to your computer and use it in GitHub Desktop.
Save hfase01/5997332 to your computer and use it in GitHub Desktop.
This is a small executable meant to be installed in a **/bin/ directory and sourced from an interactive prompt from the base directory of a CM10.1 or Carbon repo to build and archive the source.
#!/bin/bash -e
DEV="xt897c"
SAVEDIR="~/ANDROID-BUILDS"
OUTPUTDIR="$(date '+%m-%d-%Y')"
if [ ! -d "$SAVEDIR" ]; then
mkdir -p "$SAVEDIR"
fi
source $PWD/build/envsetup.sh
if [ ! -d "$SAVEDIR/$OUTPUTDIR" ]; then
mkdir -p "$SAVEDIR/$OUTPUTDIR"
fi
if [ ! -d "$PWD/vendor/cm/get-prebuilts" ]; then
$PWD/vendor/cm/get-prebuilts
fi
# export OUT_DIR_COMMON_BASE="$SAVEDIR/$OUTPUTDIR"
# Trying symbolic links rather than ENV settings.
rm -rf $PWD/out
ln -s $SAVEDIR/$OUTPUTDIR $PWD/out
# make clean -j $(grep processor /proc/cpuinfo | wc -l)
prebuilts/misc/linux-x86/ccache/ccache -M 100G
export USE_CCACHE=1
# echo "brunch $DEV >> $OUT_DIR_COMMON_BASE/output.txt& && tail -f $OUT_DIR_COMMON_BASE:/output.txt"
echo "brunch $DEV >> $PWD/out/output.txt& && tail -f $PWD/out/output.txt"
# brunch $DEV >> $PWD/out/output.txt& && tail -f $PWD/out/output.txt
# tail -f $OUT_DIR_COMMON_BASE/output.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment