Bootstrap.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // Load `jake` global
  2. require('../node_modules/jake/lib/jake');
  3. // Load jake tasks, patch in our node modules, etc
  4. var host = require('./Host');
  5. var os = require('os');
  6. // Parse args
  7. var options = require('minimist')(process.argv.slice(2));
  8. var cmd = options._[0];
  9. // Make options availabe to host
  10. host.options = options;
  11. function printHelp() {
  12. console.log("\nAtomic Editor Build Script")
  13. console.log("--------------------------")
  14. console.log("--help : This help text")
  15. console.log("--with-android : Build with Android platform support");
  16. console.log("--with-ios : Build with iOS platform support");
  17. console.log("--debug : Build debug version of the editor and associated platform runtimes")
  18. console.log("--noclean : Do not clean before building, useful during development")
  19. console.log("--nonet : Build without AtomicNET C# scripting support")
  20. console.log("--------------------------")
  21. process.exit(0);
  22. }
  23. if (options["help"]) {
  24. printHelp();
  25. }
  26. if (options["lint"]) {
  27. var lintTask = jake.Task['build:lint'];
  28. lintTask.invoke();
  29. }
  30. // Atomic Editor Build
  31. if (cmd == "buildeditor") {
  32. console.log("\n\nBuilding Atomic Editor, this process will take a few minutes\n");
  33. var buildTask = jake.Task['build:atomiceditor'];
  34. if (options["with-android"]) {
  35. if (!process.env.ANDROID_NDK) {
  36. console.log("\nANDROID_NDK environment variable not set, exiting\n");
  37. process.exit(1);
  38. }
  39. }
  40. if (options["with-ios"]) {
  41. if (os.platform() != "darwin") {
  42. console.log("\niOS platform requires macOS, exiting\n");
  43. process.exit(1);
  44. }
  45. }
  46. buildTask.invoke();
  47. }