ToolEnvironment.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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& GetExamplesDir() { return examplesDir_; }
  30. const String& GetDevConfigFilename();
  31. void Dump();
  32. private:
  33. // root source directory (for development builds)
  34. String rootSourceDir_;
  35. // root build directory (for development builds)
  36. String rootBuildDir_;
  37. // path to the Atomic Editor binary
  38. String editorBinary_;
  39. // path to Atomic player binary used when running content from the editor or cli
  40. String playerBinary_;
  41. // path to the AtomicTool command line binary
  42. String toolBinary_;
  43. // examples directory
  44. String examplesDir_;
  45. // resources
  46. String resourceCoreDataDir_;
  47. String resourcePlayerDataDir_;
  48. String resourceEditorDataDir_;
  49. // deployment
  50. // static deployment data directory
  51. String deploymentDataDir_;
  52. // whether to use individual build folders, or the deployment data dir for binaries
  53. bool useBuildDirs_;
  54. String macBuildDir_;
  55. String windowsBuildDir_;
  56. String linuxBuildDir_;
  57. String androidBuildDir_;
  58. String iosBuildDir_;
  59. String webBuildDir_;
  60. String devConfigFilename_;
  61. };
  62. }