blob: 495018de3d7e2ddff1ed96e3998cd24bdd3daddb [file] [log] [blame]
Dark Eyes43450542015-12-11 22:15:28 -05001#!/bin/bash
2
3# BlissPop Compilation Script
4#
5# Copyright (C) 2015 Team Bliss
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20
21# No scrollback buffer
22echo -e '\0033\0143'
23
24
25
26# Get intial time of script startup
27res1=$(date +%s.%N)
28
29
30
31# Specify colors for shell
32red='tput setaf 1' # red
33green='tput setaf 2' # green
34yellow='tput setaf 3' # yellow
35blue='tput setaf 4' # blue
36violet='tput setaf 5' # violet
37cyan='tput setaf 6' # cyan
38white='tput setaf 7' # white
39txtbld=$(tput bold) # Bold
40bldred=${txtbld}$(tput setaf 1) # Bold red
41bldgrn=${txtbld}$(tput setaf 2) # Bold green
42bldblu=${txtbld}$(tput setaf 4) # Bold blue
43bldcya=${txtbld}$(tput setaf 6) # Bold cyan
44normal='tput sgr0'
45
46
47tput bold
48tput setaf 1
49clear
50echo -e ""
51echo -e " ___ ___ ___ ___ "
52echo -e " /\ \ /\__\ ___ /\ \ /\ \ "
53echo -e " /::\ \ /:/ / /\ \ /::\ \ /::\ \ "
54echo -e " /:/\:\ \ /:/ / \:\ \ /:/\ \ \ /:/\ \ \ "
55echo -e " /::\~\:\__\ /:/ / /::\__\ _\:\~\ \ \ _\:\~\ \ \ "
56echo -e " /:/\:\ \:|__| /:/__/ __/:/\/__/ /\ \:\ \ \__\ /\ \:\ \ \__\ "
57echo -e " \:\~\:\/:/ / \:\ \ /\/:/ / \:\ \:\ \/__/ \:\ \:\ \/__/ "
58echo -e " \:\ \::/ / \:\ \ \::/__/ \:\ \:\__\ \:\ \:\__\ "
59echo -e " \:\/:/ / \:\ \ \:\__\ \:\/:/ / \:\/:/ / "
60echo -e " \::/__/ \:\__\ \/__/ \::/ / \::/ / "
61echo -e " ~~ \/__/ \/__/ \/__/ "
62echo -e ""
63echo -e ""
64echo -e ""
65echo -e ""
66echo -e ""
67
68sleep 3s
69
70
71# Confirm 'repo sync'
72echo -e "\n\n${bldgrn} Do you want to repo sync before proceeding?\n"
73echo ""
74echo -e "${bldblu} 1. Yes"
75echo -e "${bldblu} 2. No"
76echo ""
77echo ""
78$normal
79read askreposync
80
81# Confirm 'make clean'
82echo -e "\n\n${bldgrn} Do you want to make clean?\n"
83echo ""
84echo -e "${bldblu} 1. Yes"
85echo -e "${bldblu} 2. No"
86echo ""
87echo ""
88$normal
89read askClean
90
91echo ""
92echo ""
93if [ "$askreposync" == "1" ]
94then
95 echo -e "${bldred} Will repo sync before starting the build... "
96else
97 echo -e "${bldred} Will continue without repo syncing... "
98fi
99echo ""
100echo ""
101
102echo ""
103echo ""
104
105if [ "$askClean" == "1" ]
106then
107 echo -e "${bldred} Compilation will continue after cleaning previous build files... "
108else
109 echo -e "${bldred} ROM will be compiled without cleaning previous build files... "
110fi
111echo ""
112echo ""
113
114echo ""
115echo ""
116
117
118sleep 2s
119
120
121if [ "$askreposync" == "1" ]
122then
123 echo ""
124 echo ""
125 echo -e "${bldgrn} syncing... "
126 echo ""
127 echo ""
128 $normal
129 repo sync -j250
130fi
131
132if [ "$askClean" == "1" ]
133then
134 echo ""
135 echo ""
136 echo -e "${bldgrn} Cleaning before starting build... "
137 echo ""
138 echo ""
139 $normal
140 rm -rf out
141fi
142
143# Setup environment
144echo -e ""
145echo -e ""
146echo -e "${bldgrn} Setting up build environment..."
147echo -e ""
148echo -e ""
149$normal
150. build/envsetup.sh
151
152
153# Lunch device
154echo -e ""
155echo -e ""
156echo -e "${bldcya} Choose your device from the lunch menu..."
157echo -e ""
158echo -e ""
159$normal
160$green
161lunch
162
163# Start compilation
164echo -e ""
165echo -e ""
166echo -e "${bldcya} Starting compilation BlissPop..."
167echo -e ""
168echo -e ""
169$normal
170mka bacon
171echo -e ""
172
173
174
175# Compilation complete
176tput bold
177tput setaf 1
178echo -e ""
179echo -e "The build process has finished"
180echo -e ""
181echo -e ""