BuildCommon.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. var fs = require('fs-extra');
  2. var os = require('os');
  3. var path = require("path");
  4. var host = require("./Host");
  5. var atomicRoot = host.atomicRoot;
  6. namespace('build', function() {
  7. task('genscripts', {
  8. async: true
  9. }, function(platform) {
  10. process.chdir(atomicRoot);
  11. var modules = host.getScriptModules(platform);
  12. var bindCmd = host.atomicTool + " bind \"" + atomicRoot + "\" ";
  13. var node;
  14. switch(os.platform()) {
  15. case "win32":
  16. node = "Build/Windows/node/node.exe";
  17. break;
  18. case "darwin":
  19. node = "Build/Mac/node/node";
  20. break;
  21. case "linux":
  22. node = "Build/Linux/node/node";
  23. break;
  24. }
  25. var cmds = [];
  26. for (var pkgName in modules) {
  27. cmds.push(bindCmd + "Script/Packages/" + pkgName + "/ " + platform);
  28. }
  29. if (node) {
  30. // compile
  31. cmds.push(node + " ./Build/node_modules/typeScript/bin/tsc -p ./Script");
  32. // lint
  33. cmds.push(node + " ./Build/node_modules/tslint/bin/tslint -c ./Script/tslint.json ./Script/TypeScript/*.ts");
  34. cmds.push(node + " ./Build/node_modules/tslint/bin/tslint -c ./Script/tslint.json ./Script/AtomicEditor/**/*.ts");
  35. } else {
  36. throw new Error("Node not configured for this platform: " + os.platform());
  37. }
  38. jake.exec(cmds, function() {
  39. complete();
  40. }, {
  41. printStdout: true
  42. });
  43. });
  44. }); // end of build namespace