Bootstrap.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. var os = require('os');
  2. var fs = require('fs-extra');
  3. // Load `jake` global
  4. require('../node_modules/jake/lib/jake');
  5. // Load jake tasks, patch in our node modules, etc
  6. var host = require('./Host');
  7. // Parse args
  8. var options = require('minimist')(process.argv.slice(2));
  9. var cmd = options._[0];
  10. // Make options availabe to host
  11. host.options = options;
  12. function printHelp() {
  13. console.log("\nAtomic Editor Build Script")
  14. console.log("--------------------------")
  15. console.log("--help : This help text")
  16. console.log("--with-android : Build with Android platform support");
  17. console.log("--with-ios : Build with iOS platform support");
  18. console.log("--debug : Build debug version of the editor and associated platform runtimes")
  19. console.log("--noclean : Do not clean before building, useful during development")
  20. console.log("--nonet : Build without AtomicNET C# scripting support")
  21. console.log("--with-docs : Build and install API documents into the editor")
  22. console.log("--with-examples : Install examples into the editor")
  23. console.log("--------------------------")
  24. process.exit(0);
  25. }
  26. if (options["help"]) {
  27. printHelp();
  28. }
  29. if (options["lint"]) {
  30. var lintTask = jake.Task['build:lint'];
  31. lintTask.invoke();
  32. }
  33. // Atomic Editor Build
  34. if (cmd == "buildeditor") {
  35. // simple build check for submodules not being initialized
  36. if (!fs.existsSync(host.atomicRoot + "Submodules/CEF/Windows")) {
  37. console.log("\nBUILD ERROR:\n\nSubmodules not initialized. When cloning repository, please use:\ngit clone --recursive https://github.com/AtomicGameEngine/AtomicGameEngine\n")
  38. process.exit(1);
  39. }
  40. console.log("\n\nBuilding Atomic Editor, this process will take a few minutes\n");
  41. var buildTask = jake.Task['build:atomiceditor'];
  42. if (options["with-android"]) {
  43. if (!process.env.ANDROID_NDK) {
  44. console.log("\nANDROID_NDK environment variable not set, exiting\n");
  45. process.exit(1);
  46. }
  47. }
  48. if (options["with-ios"]) {
  49. if (os.platform() != "darwin") {
  50. console.log("\niOS platform requires macOS, exiting\n");
  51. process.exit(1);
  52. }
  53. }
  54. buildTask.invoke();
  55. }