batch_building_templates.rst 5.7 KB

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