Skip to content

Commit

Permalink
Force rebuild if there was an update since the last build.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukele committed Jan 22, 2013
1 parent c8cdadf commit 3998271
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion build.sh
Expand Up @@ -46,7 +46,12 @@ _buildProject () {
projectAltName="$4"

(
checkoutProject "${projectName}" "${projectBranch}"
checkoutProject "${projectName}" "${projectBranch}" hasUpdates
echo "updates: $hasUpdates"
if [ "$hasUpdates" == "1" ]; then
# Remove the build folder so the project is compiled from scratch.
rm -rf "${_baseFolder}/${projectName}_${projectBranch}/build"
fi
compileAndMakePackage "${projectName}" "${projectBranch}" "${projectAltName}"
[ "${createDMG}" == "1" ] && createDMG
exit 0
Expand Down Expand Up @@ -92,6 +97,7 @@ checkoutProject () {
# config
projectName="$1"
projectBranch="$2"
local __resultvar=$3
projectDir="${projectName}_${projectBranch}";
projectRepo="${_baseURL}${_basePath}${projectName}"

Expand All @@ -101,7 +107,11 @@ checkoutProject () {
fi

cd "${projectDir}"
# Check if there are updates in remote branch.
current=`git rev-parse HEAD`
git pull; [ "$?" != "0" ] && exit 1
local diff="$(git diff $current..)"
eval $__resultvar="'$(test -z "$diff" && echo "0" || echo "1")'"
}

createDMG () {
Expand Down

0 comments on commit 3998271

Please sign in to comment.