ToolEnvironment.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. bool InitFromPackage();
  17. // dev build init env from json
  18. bool InitFromJSON(bool atomicTool = false);
  19. /// Root source and build directories for development source tree builds
  20. void SetRootSourceDir(const String& sourceDir);
  21. void SetRootBuildDir(const String& buildDir, bool setBinaryPaths = false);
  22. const String& GetRootSourceDir() { return rootSourceDir_; }
  23. const String& GetRootBuildDir() { return rootBuildDir_; }
  24. /// Binaries
  25. const String& GetEditorBinary() { return editorBinary_; }
  26. const String& GetPlayerBinary() { return playerBinary_; }
  27. const String& GetToolBinary() { return toolBinary_; }
  28. /// Resource directories
  29. const String& GetCoreDataDir() { return resourceCoreDataDir_; }
  30. const String& GetPlayerDataDir() { return resourcePlayerDataDir_; }
  31. const String& GetEditorDataDir() { return resourceEditorDataDir_; }
  32. /// Data directories
  33. const String& GetDeploymentDataDir() { return toolBinary_; }
  34. const String& GetToolDataDir() { return toolDataDir_; }
  35. const String& GetDevConfigFilename();
  36. void Dump();
  37. private:
  38. // root source directory (for development builds)
  39. String rootSourceDir_;
  40. // root build directory (for development builds)
  41. String rootBuildDir_;
  42. // path to the Atomic Editor binary
  43. String editorBinary_;
  44. // path to Atomic player binary used when running content from the editor or cli
  45. String playerBinary_;
  46. // path to the AtomicTool command line binary
  47. String toolBinary_;
  48. String toolDataDir_;
  49. // resources
  50. String resourceCoreDataDir_;
  51. String resourcePlayerDataDir_;
  52. String resourceEditorDataDir_;
  53. // deployment
  54. // static deployment data directory
  55. String deploymentDataDir_;
  56. // whether to use individual build folders, or the deployment data dir for binaries
  57. bool useBuildDirs_;
  58. String macBuildDir_;
  59. String windowsBuildDir_;
  60. String linuxBuildDir_;
  61. String androidBuildDir_;
  62. String iosBuildDir_;
  63. String webBuildDir_;
  64. String devConfigFilename_;
  65. };
  66. }