summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2015-01-02 16:20:26 +0200
committerVaadin Code Review <review@vaadin.com>2015-03-10 13:45:05 +0000
commit3373024142a2adc22654afca1c5ac6ca195d3660 (patch)
tree10094ba489abfd2a11ab463e0ebb6a2975260ac1
parent9086245a6d2052fe813b3ef4296c686aad82b244 (diff)
downloadvaadin-framework-3373024142a2adc22654afca1c5ac6ca195d3660.tar.gz
vaadin-framework-3373024142a2adc22654afca1c5ac6ca195d3660.zip
Script for updating push version
Supports both Vaadin atmosphere versions and upstream versions Change-Id: I4d4965354a19c071dbd0bfb295e311e7cd55a63f
-rwxr-xr-xscripts/updatePushVersion.sh55
1 files changed, 55 insertions, 0 deletions
diff --git a/scripts/updatePushVersion.sh b/scripts/updatePushVersion.sh
new file mode 100755
index 0000000000..d2e83e0454
--- /dev/null
+++ b/scripts/updatePushVersion.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+if [ "$#" != "2" ]
+then
+ echo "Usage: $0 <runtime version> <js version>"
+ echo "If the runtime version contains the string 'vaadin', then a vaadin atmosphere version will be assumed, otherwise an upstream atmosphere version".
+ echo "If a version is set to -, the version will not be updated"
+ exit 1
+fi
+
+pushd `dirname $0`/.. > /dev/null
+basedir=`pwd`
+popd > /dev/null
+
+currentRuntime=`grep ENTITY "$basedir"/push/ivy.xml|grep runtime.version|cut -d\" -f 2`
+currentJs=`grep ENTITY "$basedir"/push/ivy.xml|grep js.version|cut -d\" -f 2`
+
+sed=`which sed`
+
+uname|grep Darwin > /dev/null
+if [ "$?" = "0" ]
+then
+ # Mac if uname output contains Darwin
+ sed=`which gsed`
+ if [ "$sed" = "" ]
+ then
+ echo "Install gnu sed (gsed) using e.g. brew install gnu-sed"
+ exit 2
+ fi
+fi
+
+echo "Currently using runtime $currentRuntime and JS $currentJs"
+
+newRuntime=$1
+newJs=$2
+
+if [ "$newRuntime" != "-" ]
+then
+ echo "Updating runtime to $newRuntime..."
+ $sed -i "s#$currentRuntime#$newRuntime#" "$basedir"/push/ivy.xml
+ $sed -i "s/$currentRuntime/$newRuntime/g" "$basedir"/push/build.xml
+ $sed -i "s/$currentRuntime/$newRuntime/g" "$basedir"/server/src/com/vaadin/server/Constants.java
+ if [[ $newRuntime == *"vaadin"* ]]
+ then
+ $sed -i "s/org.atmosphere/com.vaadin.external.atmosphere/g" "$basedir"/push/ivy.xml
+ else
+ $sed -i "s/com.vaadin.external.atmosphere/org.atmosphere/g" "$basedir"/push/ivy.xml
+ fi
+fi
+
+if [ "$newJs" != "-" ]
+then
+ echo "Updating JS to $newJs..."
+ $sed -i "s/$currentJs/$newJs/g" "$basedir"/push/ivy.xml
+fi