/dist/dist.sh

http://jplex.googlecode.com/ · Shell · 63 lines · 61 code · 1 blank · 1 comment · 0 complexity · 59796044ccfcce063915b86701c04579 MD5 · raw file

  1. #!/bin/sh
  2. VERSION=`cat ../src/jPlex.js | grep version: | awk '{ print $2 }' | sed -e "s/[',]//g"`
  3. REV=`svn info | grep sion | head -n 1 | (awk '{ print $NF; }')`
  4. VERSION=$VERSION.$REV
  5. SEPARATOR=":"
  6. FINALFILE=jplex-$VERSION
  7. if [ $1 = "win" ]; then
  8. SEPARATOR="\;"
  9. fi
  10. echo "Dist files:"
  11. echo "\tPrototype:\t1.6.1 RC2"
  12. echo "\tScriptaculous:\t1.8.1"
  13. echo "\tjPlex:\t\t$VERSION"
  14. echo "Output folder: \n\t$FINALFILE/"
  15. cd tools/dist/src/
  16. javac Main.java -classpath .$SEPARATOR../../yuicompressor-2.4.jar
  17. cd ../../../
  18. mkdir $FINALFILE
  19. if [ ! $? = 0 ]; then
  20. echo "This release has already been dist"
  21. exit 2;
  22. fi
  23. mkdir $FINALFILE/assets
  24. java -classpath tools/yuicompressor-2.4.jar$SEPARATOR./tools/dist/src/ Main ../ $FINALFILE
  25. if [ ! $? = 0 ]; then
  26. rm -rf $FINALFILE
  27. fi
  28. #Then copy the demo files
  29. cd ../demo/stable/
  30. mkdir static
  31. php ../../dist/dist_demos.php
  32. cp -R assets libs static/;
  33. for i in `find static | grep '\.svn$'`; do
  34. rm -rf $i;
  35. done;
  36. cd -
  37. cp -r ../demo $FINALFILE/
  38. for i in `find $FINALFILE/demo | grep '\.svn$'`; do
  39. rm -rf $i;
  40. done;
  41. for i in `find $FINALFILE/demo | grep '\.html$'`; do
  42. cat $i | sed -e 's/src\/jPlex\.js/jplex\.js/g' | sed -e 's/src\/.*ie7\.css/assets\/jplex-ie7\.css/g' | sed -e 's/src\/.*ie6\.css/assets\/jplex-ie6\.css/g' | sed -e 's/src\/.*\.css/assets\/jplex\.css/g' > $i.tmp
  43. mv $i.tmp $i
  44. done;
  45. mv $FINALFILE/demo/stable/static $FINALFILE/demo/
  46. rm -rf $FINALFILE/demo/stable $FINALFILE/demo/static/libs/assets $FINALFILE/demo/static/libs/jplex.js
  47. rm -rf ../demo/stable/static