ToolEnvironment.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. // OSX
  37. const String& GetPlayerAppFolder() { return playerAppFolder_; }
  38. void Dump();
  39. private:
  40. // root source directory (for development builds)
  41. String rootSourceDir_;
  42. // root build directory (for development builds)
  43. String rootBuildDir_;
  44. // path to the Atomic Editor binary
  45. String editorBinary_;
  46. // path to Atomic player binary used when running content from the editor or cli
  47. String playerBinary_;
  48. // path to Atomic player app (OSX)
  49. String playerAppFolder_;
  50. // path to the AtomicTool command line binary
  51. String toolBinary_;
  52. String toolDataDir_;
  53. // resources
  54. String resourceCoreDataDir_;
  55. String resourcePlayerDataDir_;
  56. String resourceEditorDataDir_;
  57. // deployment
  58. // static deployment data directory
  59. String deploymentDataDir_;
  60. // whether to use individual build folders, or the deployment data dir for binaries
  61. bool useBuildDirs_;
  62. String macBuildDir_;
  63. String windowsBuildDir_;
  64. String linuxBuildDir_;
  65. String androidBuildDir_;
  66. String iosBuildDir_;
  67. String webBuildDir_;
  68. String devConfigFilename_;
  69. };
  70. }