batch_building_templates.rst 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. .. _doc_batch_building_templates:
  2. Batch building templates
  3. ========================
  4. The following is almost the same script that we use to build all the
  5. export templates that go to the website. If you want to build or roll them
  6. yourself, this might be of use.
  7. (note: Apple stuff is missing)
  8. ::
  9. #This script is intended to run on Linux or OSX. Cygwin might work.
  10. # if this flag is set, build is tagged as release in the version
  11. # echo $IS_RELEASE_BUILD
  12. #Need to set path to EMScripten
  13. export EMSCRIPTEN_ROOT=/home/to/emscripten
  14. #Build templates
  15. #remove this stuff, will be created anew
  16. rm -rf templates
  17. mkdir -p templates
  18. # Windows 32 Release and Debug
  19. scons -j 4 p=windows target=release tools=no bits=32
  20. cp bin/godot.windows.opt.32.exe templates/windows_32_release.exe
  21. upx templates/windows_32_release.exe
  22. scons -j 4 p=windows target=release_debug tools=no bits=32
  23. cp bin/godot.windows.opt.debug.32.exe templates/windows_32_debug.exe
  24. upx templates/windows_32_debug.exe
  25. # Windows 64 Release and Debug (UPX does not support it yet)
  26. scons -j 4 p=windows target=release tools=no bits=64
  27. cp bin/godot.windows.opt.64.exe templates/windows_64_release.exe
  28. x86_64-w64-mingw32-strip templates/windows_64_release.exe
  29. scons -j 4 p=windows target=release_debug tools=no bits=64
  30. cp bin/godot.windows.opt.debug.64.exe templates/windows_64_debug.exe
  31. x86_64-w64-mingw32-strip templates/windows_64_debug.exe
  32. # Linux 64 Release and Debug
  33. scons -j 4 p=x11 target=release tools=no bits=64
  34. cp bin/godot.x11.opt.64 templates/linux_x11_64_release
  35. upx templates/linux_x11_64_release
  36. scons -j 4 p=x11 target=release_debug tools=no bits=64
  37. cp bin/godot.x11.opt.debug.64 templates/linux_x11_64_debug
  38. upx templates/linux_x11_64_debug
  39. # Linux 32 Release and Debug
  40. scons -j 4 p=x11 target=release tools=no bits=32
  41. cp bin/godot.x11.opt.32 templates/linux_x11_32_release
  42. upx templates/linux_x11_32_release
  43. scons -j 4 p=x11 target=release_debug tools=no bits=32
  44. cp bin/godot.x11.opt.debug.32 templates/linux_x11_32_debug
  45. upx templates/linux_x11_32_debug
  46. # Server for 32 and 64 bits (always in debug)
  47. scons -j 4 p=server target=release_debug tools=no bits=64
  48. cp bin/godot_server.server.opt.debug.64 templates/linux_server_64
  49. upx templates/linux_server_64
  50. scons -j 4 p=server target=release_debug tools=no bits=32
  51. cp bin/godot_server.server.opt.debug.32 templates/linux_server_32
  52. upx templates/linux_server_32
  53. # Android
  54. **IMPORTANT REPLACE THIS BY ACTUAL VALUES**
  55. export ANDROID_HOME=/home/to/android-sdk
  56. export ANDROID_NDK_ROOT=/home/to/android-ndk
  57. # git does not allow empty dirs, so create those
  58. mkdir -p platform/android/java/libs/armeabi
  59. mkdir -p platform/android/java/libs/x86
  60. #Android Release
  61. scons -j 4 p=android target=release
  62. cp bin/libgodot.android.opt.so platform/android/java/libs/armeabi/libgodot_android.so
  63. ./gradlew build
  64. cp platform/android/java/build/outputs/apk/java-release-unsigned.apk templates/android_release.apk
  65. #Android Debug
  66. scons -j 4 p=android target=release_debug
  67. cp bin/libgodot.android.opt.debug.so platform/android/java/libs/armeabi/libgodot_android.so
  68. ./gradlew build
  69. cp platform/android/java/build/outputs/apk/java-release-unsigned.apk templates/android_debug.apk
  70. # EMScripten
  71. scons -j 4 p=javascript target=release
  72. cp bin/godot.javascript.opt.html godot.html
  73. cp bin/godot.javascript.opt.js godot.js
  74. cp tools/html_fs/filesystem.js .
  75. zip javascript_release.zip godot.html godot.js filesystem.js
  76. mv javascript_release.zip templates/
  77. scons -j 4 p=javascript target=release_debug
  78. cp bin/godot.javascript.opt.debug.html godot.html
  79. cp bin/godot.javascript.opt.debug.js godot.js
  80. cp tools/html_fs/filesystem.js .
  81. zip javascript_debug.zip godot.html godot.js filesystem.js
  82. mv javascript_debug.zip templates/
  83. # BlackBerry 10 (currently disabled)
  84. #./path/to/bbndk/bbndk-env.sh
  85. #scons -j 4 platform/bb10/godot_bb10_opt.qnx.armle target=release
  86. #cp platform/bb10/godot_bb10_opt.qnx.armle platform/bb10/bar
  87. #scons -j 4 platform/bb10/godot_bb10.qnx.armle target=release_debug
  88. #cp platform/bb10/godot_bb10.qnx.armle platform/bb10/bar
  89. #cd platform/bb10/bar
  90. #zip -r bb10.zip *
  91. #mv bb10.zip ../../../templates
  92. #cd ../../..
  93. # BUILD ON MAC
  94. [...]
  95. # Build release executables with editor
  96. mkdir -p release
  97. scons -j 4 p=server target=release_debug bits=64
  98. cp bin/godot_server.server.opt.tools.64 release/linux_server.64
  99. upx release/linux_server.64
  100. scons -j 4 p=x11 target=release_debug tools=yes bits=64
  101. cp bin/godot.x11.opt.tools.64 release/godot_x11.64
  102. # upx release/godot_x11.64 -- fails on some linux distros
  103. scons -j 4 p=x11 target=release_debug tools=yes bits=32
  104. cp bin/godot.x11.opt.tools.32 release/godot_x11.32
  105. scons -j 4 p=windows target=release_debug tools=yes bits=64
  106. cp bin/godot.windows.opt.tools.64.exe release/godot_win64.exe
  107. x86_64-w64-mingw32-strip release/godot_win64.exe
  108. #upx release/godot_win64.exe
  109. scons -j 4 p=windows target=release_debug tools=yes bits=32
  110. cp bin/godot.windows.opt.tools.32.exe release/godot_win32.exe
  111. x86_64-w64-mingw32-strip release/godot_win32.exe
  112. #upx release/godot_win64.exe
  113. [..] # mac stuff
  114. # Update classes.xml (used to generate doc)
  115. cp doc/base/classes.xml .
  116. release/linux_server.64 -doctool classes.xml
  117. cd demos
  118. rm -f godot_demos.zip
  119. zip -r godot_demos *
  120. cd ..
  121. cd tools/export/blender25
  122. zip -r bettercollada *
  123. mv bettercollada.zip ../../..
  124. cd ../../..