You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

updatePushVersion.sh 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/bash
  2. if [ "$#" != "2" ]
  3. then
  4. echo "Usage: $0 <runtime version> <js version>"
  5. echo "If the runtime version contains the string 'vaadin', then a vaadin atmosphere version will be assumed, otherwise an upstream atmosphere version".
  6. echo "If a version is set to -, the version will not be updated"
  7. exit 1
  8. fi
  9. pushd `dirname $0`/.. > /dev/null
  10. basedir=`pwd`
  11. popd > /dev/null
  12. currentRuntime=`grep ENTITY "$basedir"/push/ivy.xml|grep runtime.version|cut -d\" -f 2`
  13. currentJs=`grep ENTITY "$basedir"/push/ivy.xml|grep js.version|cut -d\" -f 2`
  14. sed=`which sed`
  15. uname|grep Darwin > /dev/null
  16. if [ "$?" = "0" ]
  17. then
  18. # Mac if uname output contains Darwin
  19. sed=`which gsed`
  20. if [ "$sed" = "" ]
  21. then
  22. echo "Install gnu sed (gsed) using e.g. brew install gnu-sed"
  23. exit 2
  24. fi
  25. fi
  26. echo "Currently using runtime $currentRuntime and JS $currentJs"
  27. newRuntime=$1
  28. newJs=$2
  29. if [ "$newRuntime" != "-" ]
  30. then
  31. echo "Updating runtime to $newRuntime..."
  32. $sed -i "s#$currentRuntime#$newRuntime#" "$basedir"/push/ivy.xml
  33. $sed -i "s/$currentRuntime/$newRuntime/g" "$basedir"/push/build.xml
  34. $sed -i "s/$currentRuntime/$newRuntime/g" "$basedir"/server/src/com/vaadin/server/Constants.java
  35. if [[ $newRuntime == *"vaadin"* ]]
  36. then
  37. $sed -i "s/org.atmosphere/com.vaadin.external.atmosphere/g" "$basedir"/push/ivy.xml
  38. else
  39. $sed -i "s/com.vaadin.external.atmosphere/org.atmosphere/g" "$basedir"/push/ivy.xml
  40. fi
  41. fi
  42. if [ "$newJs" != "-" ]
  43. then
  44. echo "Updating JS to $newJs..."
  45. $sed -i "s/$currentJs/$newJs/g" "$basedir"/push/ivy.xml
  46. fi