Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI script #3

Open
wants to merge 2 commits into
base: cm-10.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/bash
function quit(){
local ret=$?
if [ "$ret" != "0" ]; then
echo "[ERROR] ret=$ret"
shift
echo $@
exit $ret
fi
}

function check_enviroment(){
PACKAGES="git gnupg flex bison gperf build-essential zip bzr curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386 schedtool"
for package in ${PACKAGES}; do
dpkg -l | grep ${package} > /dev/null
quit $?
done
}

function main(){
BUILD_DIR=~/kindle-build
LOG=${BUILD_DIR}/log.log

if [ "$#" == "1" ]; then
TARGET=$1
else
TARGET=jem
fi

echo "Check git config"
git config --get user.name > /dev/null
quit $? "Not set user.name in gitconfig"
git config --get user.email > /dev/null
quit $? "Not set user.email in gitconfig"

echo "Check build enviroment"
#check_enviroment

echo "Init"
mkdir -p ${BUILD_DIR}/.repo
cd ${BUILD_DIR}

repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1

CPUCORES=$(grep processor /proc/cpuinfo | wc -l)
if [ "${CPUCORES}" -ge "8" ]; then
JOBS=8
else
JOBS=${CPUCORES}
fi

echo "Init customized manifest"
curl -L -o .repo/local_manifest.xml -O -L https://raw.github.com/KFire-Android/android_local_manifest/cm-10.1/local_manifest.xml
quit $?
repo sync -j${JOBS}
quit $?

vendor/cm/get-prebuilts

echo "Start build"
. build/envsetup.sh
rm -rf $LOG && time brunch ${TARGET} -j${CPUCORES} 2>&1 | tee -a $LOG
}

main $@
2 changes: 1 addition & 1 deletion local_manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<project path="kernel/amazon/otter-common" name="KFire-Android/kernel_omap_otter-common" />
<project path="kernel/amazon/bowser-common" name="KFire-Android/kernel_omap_bowser-common" />

<project path="device/amazon/omap4-common" name="KFire-Android/android_device_amazon_omap4-common" />
<project path="device/amazon/omap4-common" name="KFire-Android/android_device_amazon_omap4-common" revision="refs/heads/cm-10.1-dev" />
<project path="device/amazon/otter-common" name="KFire-Android/android_device_amazon_otter-common" />
<project path="device/amazon/bowser-common" name="KFire-Android/android_device_amazon_bowser-common" />

Expand Down