Bootstrap.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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("--------------------------")
  22. process.exit(0);
  23. }
  24. if (options["help"]) {
  25. printHelp();
  26. }
  27. if (options["lint"]) {
  28. var lintTask = jake.Task['build:lint'];
  29. lintTask.invoke();
  30. }
  31. // Atomic Editor Build
  32. if (cmd == "buildeditor") {
  33. // simple build check for submodules not being initialized
  34. if (!fs.existsSync(host.atomicRoot + "Submodules/CEF/Windows")) {
  35. console.log("\nBUILD ERROR:\n\nSubmodules not initialized. When cloning repository, please use:\ngit clone --recursive https://github.com/AtomicGameEngine/AtomicGameEngine\n")
  36. process.exit(1);
  37. }
  38. console.log("\n\nBuilding Atomic Editor, this process will take a few minutes\n");
  39. var buildTask = jake.Task['build:atomiceditor'];
  40. if (options["with-android"]) {
  41. if (!process.env.ANDROID_NDK) {
  42. console.log("\nANDROID_NDK environment variable not set, exiting\n");
  43. process.exit(1);
  44. }
  45. }
  46. if (options["with-ios"]) {
  47. if (os.platform() != "darwin") {
  48. console.log("\niOS platform requires macOS, exiting\n");
  49. process.exit(1);
  50. }
  51. }
  52. buildTask.invoke();
  53. }