bigrushdog

ics_build

Dec 1st, 2011
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.66 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. while [ "$1" != "" ]; do
  4.     case $1 in
  5.         -s | --sync )           shift
  6.                                 SYNC_REPO="true"
  7.                                 ;;
  8.         -c | --clobber )        shift
  9.                 CLOBBER_REPO="true"
  10.                                 ;;
  11.         -h | --help )           echo " -s or --sync to repo sync, -c or --clobber to clean entire repo, -h or --help to display this help dialog"
  12.                                 exit
  13.                                 ;;
  14.         * )                     echo " -s or --sync to repo sync, -c or --clobber to clean entire repo, -h or --help to display this help dialog"
  15.                                 exit 1
  16.     esac
  17. done
  18.  
  19. export DATE=$(date +%Y-%m-%d_%H_%M)
  20. WORKING="/home/bigrushdog/tiamat-aosp"
  21. OUT=$WORKING/out/target/product/stingray/
  22. PRODUCT=full_stingray-ota-eng.root.zip
  23. DEST=/home/bigrushdog/downloads
  24.  
  25. cd $WORKING
  26.  
  27. if [ "$CLOBBER_REPO" == "true" ]; then
  28.   echo "Cleaning Eos AOSP Repository"
  29.   make clobber
  30. fi
  31.  
  32. if [ "$SYNC_REPO" == "true" ]; then
  33.   echo "Syncing Eos AOSP Repository"
  34.   repo sync
  35. fi
  36.  
  37. echo "Making build environment"
  38. source build/envsetup.sh
  39.  
  40. echo "Ordering full_stingray-eng from lunch menu"
  41. lunch full_stingray-eng
  42.  
  43. echo "Getting compile start time and initializing build"
  44.  
  45. START=$(date +%s)
  46.  
  47. make -j16 otapackage
  48.  
  49. END=$(date +%s)
  50. DIFF=$(( $END - $START ))
  51. tmp=$(printf ""%dh:%dm:%ds"\n" $(($DIFF/3600)) $(($DIFF%3600/60)) $(($DIFF%60)))
  52.  
  53. echo "Build finished! You compiled AOSP in $tmp"
  54.  
  55. echo "Moving output zip and renaming for distro"
  56.  
  57. if [ ! -d $DEST ]; then
  58.   mkdir $DEST
  59. fi
  60.  
  61. mv $OUT/$PRODUCT $DEST/full_stingray-ota-$DATE.zip
  62.  
  63. exit 0
  64.  
  65.  
Advertisement
Add Comment
Please, Sign In to add comment