ToolEnvironment.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #pragma once
  2. #include <Atomic/Core/Object.h>
  3. using namespace Atomic;
  4. namespace ToolCore
  5. {
  6. // the tool environment contains paths for various
  7. // binaries, data paths, example folder, etc
  8. // it is either built from the cli, AtomicEditor, environment variables,
  9. // or a json config file, this avoids needing to symlink folders, etc
  10. class ToolEnvironment : public Object
  11. {
  12. OBJECT(ToolEnvironment)
  13. public:
  14. ToolEnvironment(Context* context);
  15. virtual ~ToolEnvironment();
  16. // dev build init env from json
  17. bool InitFromJSON();
  18. void SetRootSourceDir(const String& sourceDir);
  19. void SetRootBuildDir(const String& buildDir, bool setBinaryPaths = false);
  20. const String& GetRootSourceDir() { return rootSourceDir_; }
  21. const String& GetRootBuildDir() { return rootBuildDir_; }
  22. const String& GetEditorBinary() { return editorBinary_; }
  23. const String& GetPlayerBinary() { return playerBinary_; }
  24. const String& GetToolBinary() { return toolBinary_; }
  25. const String& GetCoreDataDir() { return resourceCoreDataDir_; }
  26. const String& GetPlayerDataDir() { return resourcePlayerDataDir_; }
  27. const String& GetEditorDataDir() { return resourceEditorDataDir_; }
  28. const String& GetDeploymentDataDir() { return toolBinary_; }
  29. const String& GetProjectTemplatesDir() { return projectTemplatesDir_; }
  30. const String& GetExamplesDir() { return examplesDir_; }
  31. const String& GetDevConfigFilename();
  32. void Dump();
  33. private:
  34. // root source directory (for development builds)
  35. String rootSourceDir_;
  36. // root build directory (for development builds)
  37. String rootBuildDir_;
  38. // path to the Atomic Editor binary
  39. String editorBinary_;
  40. // path to Atomic player binary used when running content from the editor or cli
  41. String playerBinary_;
  42. // path to the AtomicTool command line binary
  43. String toolBinary_;
  44. // examples directory
  45. String examplesDir_;
  46. // project templates directory
  47. String projectTemplatesDir_;
  48. // resources
  49. String resourceCoreDataDir_;
  50. String resourcePlayerDataDir_;
  51. String resourceEditorDataDir_;
  52. // deployment
  53. // static deployment data directory
  54. String deploymentDataDir_;
  55. // whether to use individual build folders, or the deployment data dir for binaries
  56. bool useBuildDirs_;
  57. String macBuildDir_;
  58. String windowsBuildDir_;
  59. String linuxBuildDir_;
  60. String androidBuildDir_;
  61. String iosBuildDir_;
  62. String webBuildDir_;
  63. String devConfigFilename_;
  64. };
  65. }