Merge branch 'master' of git@github.com:osmandapp/Osmand.git

This commit is contained in:
sonora 2011-10-11 22:03:40 +02:00
commit 6c364445ae
2 changed files with 10 additions and 5 deletions

View file

@ -1,6 +1,7 @@
#!/bin/sh #!/bin/sh
DIRECTORY=$(cd `dirname $0` && pwd) DIRECTORY=$(cd `dirname $0` && pwd)
BRANCHES_CHANGED=0
GIT_DIR="$DIRECTORY"/osmand-git GIT_DIR="$DIRECTORY"/osmand-git
GIT_ORIGIN_NAME=origin GIT_ORIGIN_NAME=origin
BUILD_DIR="$DIRECTORY"/builds BUILD_DIR="$DIRECTORY"/builds
@ -25,14 +26,12 @@ do
ch=$(expr index "$i" ">") ch=$(expr index "$i" ">")
if [ $ch = 0 ]; then if [ $ch = 0 ]; then
BRANCH=${i#"$GIT_ORIGIN_NAME/"} 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 git diff --exit-code "$BRANCH" "$GIT_ORIGIN_NAME/$BRANCH" --quiet
RES_DIFF=$? RES_DIFF=$?
if [ $RES_DIFF != 0 ]; then if [ $RES_DIFF != 0 ]; then
echo "Checkouting branch and create build for $BRANCH" echo "Checkouting branch and create build for $BRANCH"
## reset all previous changes in working tree ## reset all previous changes in working tree
BRANCHES_CHANGED=1
git checkout . git checkout .
git reset HEAD --hard git reset HEAD --hard
git checkout -f $BRANCH git checkout -f $BRANCH
@ -58,7 +57,7 @@ do
if [ ! -d assets ]; then if [ ! -d assets ]; then
mkdir assets mkdir assets
fi fi
ant clean debug &> "$DIRECTORY/build.log" ant clean debug
if [ "$BRANCH" = "release" ]; then if [ "$BRANCH" = "release" ]; then
cp bin/OsmAnd-debug.apk "$LATESTS_DIR/OsmAnd-stable.apk" cp bin/OsmAnd-debug.apk "$LATESTS_DIR/OsmAnd-stable.apk"
@ -85,3 +84,5 @@ do
fi fi
fi fi
done done
exit $BRANCHES_CHANGED

View file

@ -11,13 +11,17 @@ mkdir -p $LOG_DIR
echo > $LOG_FILE echo > $LOG_FILE
touch $CLOG_FILE touch $CLOG_FILE
#git pull --rebase 2>&1 >>$LOG_FILE git pull --rebase 2>&1 >>$LOG_FILE
# 1. Update git directory # 1. Update git directory
"${DIRECTORY}/update_git.sh" >>$LOG_FILE 2>&1 "${DIRECTORY}/update_git.sh" >>$LOG_FILE 2>&1
# 2. Go through branches and generates builds # 2. Go through branches and generates builds
"${DIRECTORY}/build_branches.sh" >>$LOG_FILE 2>&1 "${DIRECTORY}/build_branches.sh" >>$LOG_FILE 2>&1
# exit if nothing was changed
if [ $? == 0 ]; then
exit
fi
# 3. upload to ftp server # 3. upload to ftp server
#"${DIRECTORY}/upload_ftp.sh" 2>&1 >>$LOG_FILE #"${DIRECTORY}/upload_ftp.sh" 2>&1 >>$LOG_FILE