[Nexus 6P Android Development] kicker22004:
My script

Ok this is my script that I personally setup tonight so I can build what I want with or without Sub.. This is very much a "dirty" script but it works for me lol.

#!/bin/bash

DIR=$(echo $PWD)

FBASE="frameworks/base/"

SS="system/sepolicy/"

FBUILD="build"

FN="frameworks/native/"

####COLORS####

COFF=$(tput sgr0)

CGREEN=$(tput setaf 2)

CRED=$(tput setaf 1)

CBLUE=$(tput setaf 6)

clear

echo $CBLUE"BELOW ARE THE DIRECTORIES THIS SCRIPT WILL USE!"$COFF

echo $CRED"Framework_base directory: $CGREEN$DIR/$FBASE"

echo $CRED"Platform_system_sepolicy directory: $CGREEN$DIR/$SS"

echo $CRED"Platform_build directory: $CGREEN$DIR/$FBUILD"

echo $CRED"Platform_frameworks_native directory: $CGREEN$DIR/$FN"$COFF

while true; do

read -p "Do these directories look correct? (Y/N)" yn

case $yn in

[Yy]* ) break;;

[Nn]* ) echo "Something is wrong or user exited!"; exit;;

* ) echo "Please answer yes or no.";;

esac

done

do_sub() {

###Gather all of the needed git's###

echo $CBLUE"Switching Directory to: $FBASE"$COFF

cd $FBASE

echo "Grabbing Base"

git fetch https://github.com/TeamSubstratumResources/platform_frameworks_base.git

echo $CBLUE"Switching Directory to: $SS"$COFF

cd $DIR/$SS

echo "Grabbing Sepolicy"

git fetch https://github.com/TeamSubstratumResources/platform_system_sepolicy.git

echo $CBLUE"Switching Directory to: $FBUILD"$COFF

cd $DIR/$FBUILD

echo "Grabbing Build"

git fetch https://github.com/TeamSubstratumResources/platform_build.git

echo $CBLUE"Switching Directory to: $FN"$COFF

cd $DIR/$FN

echo "Grabbing Native"

git fetch https://github.com/TeamSubstratumResources/platform_frameworks_native.git

####Time to cherry pick####

######Platform_frameworks_base#####

echo $CBLUE"Switching Directory to: $FBASE"$COFF

cd $DIR/$FBASE

git cherry-pick 4da127de34eac85df93f0043eb25845c8fa3bdd2 \

2797fee2b1557eaa860299bcc284c4b62d847669 \

a86759a6591e37aab336e2996953c3baf96d548b \

7ad942e97f63b09c3969102c2091732fabaa5cd0 \

0b87997f9f69f164161c6a84cfe530b199b44399 \

19df4b30ef07eeea063c1afe8a2204d75b0be696 \

ab4fcdd4da01365514053aa7e2c358189f62575f \

59cfc8bc4ff7c8cc3aae7f14370e0fd2f5abb39d \

0ab20db562cb1cf8f0ef590a571958b2bd1ac391 \

d2ab084ef64acf02cf0816a2b75ea86a7840a099 \

138282a26c0eee009ceb7d62533656eab2d77cc4 \

f87677c95eb5289ed3b8f8f4d21dfb4b3daed60b \

d693e66eb73f961608af8b749a28cb8d4bc1b2b6 \

2bbaccf1c077ba3b6b399e82ad13a84e81de52a6 \

b334523e69a50203bda276087126b32b882a7668 \

721a1eb239949241249037d5dd4272b47b204ba8 \

cb0f037246f74cf07811f42ed77057074b77b900 \

1fb0eaa787686f84b4906059e367c27361709003 \

ab0f0dc5eaf73fe041ec84a16f19f432c5dc3432 \

263ff9d36c59777123d7b3f5ba8ef86ded72a383 \

dbee42eda9620d644e46d2b39466b7e61c8943f1 \

ae4e4efa77a1a73770bf1d7725ea07bb7240a91a

####Platform_system_sepolicy####

echo $CBLUE"Switching Directory to: $SS"$COFF

cd $DIR$SS

git cherry-pick aee6652434624ce379d0639556bee9d159e473f7

####Platform_build####

echo $CBLUE"Switching Directory to: $FBUILD"$COFF

cd $DIR/$FBUILD

git cherry-pick 14c91c2267faf939ea43dcb3016940f13205eaca

####Platform_frameworks_native####

echo $CBLUE"Switching Directory to: $FN"$COFF

cd $DIR/$FN

git cherry-pick 24fcdf9524051905d749ae572203a89aec193ff7

#####List any issues#####

###Clearing to spot these status outputs easier.. might be a bad thing...###

clear

echo "Checking status from all picks"

sleep 3

cd $DIR/$FBASE

git status

cd $DIR/$SS

git status

cd $DIR/$FBUILD

git status

cd $DIR/$FBUILD

git status

cd $DIR/$FN

git status

}

do_subBuild() {

####Same as the rest just no repo sync involved####

./killjack

. build/envsetup.sh

breakfast angler

mka clobber

mka bacon

##My save directory is on my other server, Change this####

cp out/target/product/angler/pure_nexus_angler-* /samba/PureNexus_Builds/

}

do_clean() {

####Clean up any chance of changes i've made####

rm -rf $DIR/frameworks

rm -rf $DIR/build

rm -rf $DIR/system

rm -rf $DIR/packages

cd $DIR

repo sync -j8 --force-sync

./killjack

. build/envsetup.sh

breakfast angler

mka clobber

mka bacon

##My save directory is on my other server, Change this####

cp out/target/product/angler/pure_nexus_angler-* /samba/PureNexus_Builds/

}

do_sync() {

cd $DIR

repo sync -j8 --force-sync

./killjack

. build/envsetup.sh

breakfast angler

mka clobber

mka bacon

##My save directory is on my other server, Change this####

cp out/target/product/angler/pure_nexus_angler-* /samba/PureNexus_Builds/

}

####Ask if you want a stock build or substratum####

clear

echo $CGREEN"1. Clean [Will erase any changes from substratum and resync]"

echo "2. Substratum [Will attempt to fetch needed picks for Substratum.]"

echo "3. Sync [If your stock and would like to build a new build (will force-sync so no mods) for this.]"

echo "4. Substratum build! [Run this after you have run 2..and cleaned up any commit issues!.]"

echo "5. Leave this script$COFF"

while true; do

read -p $CBLUE"Please make your selection (1,2,3,4,5)$COFF" yn

case $yn in

[1] ) do_clean; break;;

[2] ) do_sub; break;;

[3] ) do_sync; break;;

[4] ) do_subBuild; break;;

[5] ) exit;;

* ) echo "Please answer 1/2/3/4/5";;

esac

done

echo "Script complete"

exit 0

See anything i'm doing wrong?