From 1b4b872bb897a71200061400d30749ec415fc496 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 11 Oct 2011 21:38:51 +0200 Subject: [PATCH] Fix build - update scripts --- build-scripts/build_branches.sh | 9 +++++---- build-scripts/daily_build.sh | 6 +++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/build-scripts/build_branches.sh b/build-scripts/build_branches.sh index 95be4d470d..0bb4a45851 100755 --- a/build-scripts/build_branches.sh +++ b/build-scripts/build_branches.sh @@ -1,6 +1,7 @@ #!/bin/sh DIRECTORY=$(cd `dirname $0` && pwd) +BRANCHES_CHANGED=0 GIT_DIR="$DIRECTORY"/osmand-git GIT_ORIGIN_NAME=origin BUILD_DIR="$DIRECTORY"/builds @@ -25,14 +26,12 @@ do ch=$(expr index "$i" ">") if [ $ch = 0 ]; then BRANCH=${i#"$GIT_ORIGIN_NAME/"} - - echo "Checking if there are changes : $BRANCH - $GIT_ORIGIN_NAME/$BRANCH" - git diff --exit-code "$BRANCH" "$GIT_ORIGIN_NAME/$BRANCH" --quiet RES_DIFF=$? if [ $RES_DIFF != 0 ]; then echo "Checkouting branch and create build for $BRANCH" ## reset all previous changes in working tree + BRANCHES_CHANGED=1 git checkout . git reset HEAD --hard git checkout -f $BRANCH @@ -58,7 +57,7 @@ do if [ ! -d assets ]; then mkdir assets fi - ant clean debug &> "$DIRECTORY/build.log" + ant clean debug if [ "$BRANCH" = "release" ]; then cp bin/OsmAnd-debug.apk "$LATESTS_DIR/OsmAnd-stable.apk" @@ -85,3 +84,5 @@ do fi fi done + +exit BRANCHES_CHANGED diff --git a/build-scripts/daily_build.sh b/build-scripts/daily_build.sh index 2d4d65ab59..feb836a315 100755 --- a/build-scripts/daily_build.sh +++ b/build-scripts/daily_build.sh @@ -11,13 +11,17 @@ mkdir -p $LOG_DIR echo > $LOG_FILE touch $CLOG_FILE -#git pull --rebase 2>&1 >>$LOG_FILE +git pull --rebase 2>&1 >>$LOG_FILE # 1. Update git directory "${DIRECTORY}/update_git.sh" >>$LOG_FILE 2>&1 # 2. Go through branches and generates builds "${DIRECTORY}/build_branches.sh" >>$LOG_FILE 2>&1 +# exit if nothing was changed +if [ $? != 0 ]; then + exit +fi # 3. upload to ftp server #"${DIRECTORY}/upload_ftp.sh" 2>&1 >>$LOG_FILE