BuildConfig.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. var os = require('os');
  2. var path = require('path');
  3. var spawnSync = require('child_process').spawnSync;
  4. function processOptions(config) {
  5. config["config"] = config["debug"] ? "Debug" : "Release";
  6. // AtomicNET
  7. if (config["nonet"]) {
  8. config["with-atomicnet"] = false;
  9. } else {
  10. if (os.platform() == "win32") {
  11. config["with-atomicnet"] = true;
  12. } else {
  13. // see if xbuild is available
  14. config["with-atomicnet"] = false;
  15. if ( spawnSync) // TODO: CI box doesn't have spawnSync
  16. config["with-atomicnet"] = spawnSync("which", ["xbuild"]).status == 1 ? false : true;
  17. }
  18. }
  19. // paths
  20. config.atomicRoot = path.resolve(__dirname, "../..") + "/";
  21. config.artifactsRoot = config.atomicRoot + "/Artifacts/";
  22. config.editorAppFolder = (os.platform() == "darwin") ? config.artifactsRoot + "/AtomicEditor/AtomicEditor.app/" : config.artifactsRoot + "AtomicEditor/";
  23. config.toolDataFolder = config.editorAppFolder + (os.platform() == "darwin" ? "Contents/Resources/ToolData/" : "Resources/ToolData/");
  24. return config;
  25. }
  26. exports = module.exports = processOptions(require('minimist')(process.argv.slice(2), {
  27. "default" : {
  28. "noclean" : false,
  29. "debug" : false,
  30. "nonet" : false,
  31. "with-android" : false,
  32. "with-ios" : false,
  33. "with-docs" : false,
  34. "with-examples" : false
  35. }
  36. }));