build.sh 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #!/bin/sh
  2. # This file is part of the Symfony Standard Edition.
  3. #
  4. # (c) Fabien Potencier <fabien@symfony.com>
  5. #
  6. # For the full copyright and license information, please view the LICENSE
  7. # file that was distributed with this source code.
  8. DIR=`php -r "echo realpath(dirname(\\$_SERVER['argv'][0]));"`
  9. cd $DIR
  10. VERSION=`cat VERSION`
  11. if [ ! -d "$DIR/build" ]; then
  12. mkdir -p $DIR/build
  13. fi
  14. $DIR/bin/build_bootstrap.php
  15. $DIR/app/console assets:install web/
  16. # Without vendors
  17. rm -rf /tmp/Symfony
  18. mkdir /tmp/Symfony
  19. cp -r app /tmp/Symfony/
  20. cp -r bin /tmp/Symfony/
  21. cp -r src /tmp/Symfony/
  22. cp -r web /tmp/Symfony/
  23. cp -r README.rst /tmp/Symfony/
  24. cp -r LICENSE /tmp/Symfony/
  25. cp -r VERSION /tmp/Symfony/
  26. cd /tmp/Symfony
  27. sudo rm -rf app/cache/* app/logs/* .git*
  28. chmod 777 app/cache app/logs
  29. # DS_Store cleanup
  30. find . -name .DS_Store | xargs rm -rf -
  31. cd ..
  32. # avoid the creation of ._* files
  33. export COPY_EXTENDED_ATTRIBUTES_DISABLE=true
  34. export COPYFILE_DISABLE=true
  35. tar zcpf $DIR/build/Symfony_Standard_$VERSION.tgz Symfony
  36. sudo rm -f $DIR/build/Symfony_Standard_$VERSION.zip
  37. zip -rq $DIR/build/Symfony_Standard_$VERSION.zip Symfony
  38. # With vendors
  39. cd $DIR
  40. rm -rf /tmp/vendor
  41. mkdir /tmp/vendor
  42. TARGET=/tmp/vendor
  43. if [ ! -d "$DIR/vendor" ]; then
  44. echo "The master vendor directory does not exist"
  45. exit
  46. fi
  47. cp -r $DIR/vendor/* $TARGET/
  48. # Assetic
  49. cd $TARGET/assetic && rm -rf phpunit.xml* README* tests
  50. # Doctrine ORM
  51. cd $TARGET/doctrine && rm -rf UPGRADE* build* bin tests tools lib/vendor
  52. # Doctrine DBAL
  53. cd $TARGET/doctrine-dbal && rm -rf bin build* tests lib/vendor
  54. # Doctrine Common
  55. cd $TARGET/doctrine-common && rm -rf build* tests lib/vendor
  56. # Swiftmailer
  57. cd $TARGET/swiftmailer && rm -rf CHANGES README* build* docs notes test-suite tests create_pear_package.php package*
  58. # Symfony
  59. cd $TARGET/symfony && rm -rf README.md phpunit.xml* tests *.sh vendor
  60. # Twig
  61. cd $TARGET/twig && rm -rf AUTHORS CHANGELOG README.markdown bin doc package.xml.tpl phpunit.xml* test
  62. # Twig Extensions
  63. cd $TARGET/twig-extensions && rm -rf README doc phpunit.xml* test
  64. # Monolog
  65. cd $TARGET/monolog && rm -rf README.markdown phpunit.xml* tests
  66. # Metadata
  67. cd $TARGET/metadata && rm -rf README.rst phpunit.xml* tests
  68. # cleanup
  69. find $TARGET -name .git | xargs rm -rf -
  70. find $TARGET -name .gitignore | xargs rm -rf -
  71. find $TARGET -name .gitmodules | xargs rm -rf -
  72. find $TARGET -name .svn | xargs rm -rf -
  73. cd /tmp/
  74. mv /tmp/vendor /tmp/Symfony/
  75. tar zcpf $DIR/build/Symfony_Standard_Vendors_$VERSION.tgz Symfony
  76. sudo rm -f $DIR/build/Symfony_Standard_Vendors_$VERSION.zip
  77. zip -rq $DIR/build/Symfony_Standard_Vendors_$VERSION.zip Symfony