ToolEnvironment.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. //
  2. // Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
  3. // LICENSE: Atomic Game Engine Editor and Tools EULA
  4. // Please see LICENSE_ATOMIC_EDITOR_AND_TOOLS.md in repository root for
  5. // license information: https://github.com/AtomicGameEngine/AtomicGameEngine
  6. //
  7. #pragma once
  8. #include <Atomic/Core/Object.h>
  9. #include "ToolPrefs.h"
  10. using namespace Atomic;
  11. namespace ToolCore
  12. {
  13. // the tool environment contains paths for various
  14. // binaries, data paths, example folder, etc
  15. // it is either built from the cli, AtomicEditor, environment variables,
  16. // or a json config file, this avoids needing to symlink folders, etc
  17. class ToolEnvironment : public Object
  18. {
  19. OBJECT(ToolEnvironment)
  20. public:
  21. ToolEnvironment(Context* context);
  22. virtual ~ToolEnvironment();
  23. bool InitFromPackage();
  24. // dev build init env from json
  25. bool InitFromJSON(bool atomicTool = false);
  26. /// Root source and build directories for development source tree builds
  27. void SetRootSourceDir(const String& sourceDir);
  28. void SetRootBuildDir(const String& buildDir, bool setBinaryPaths = false);
  29. ToolPrefs* GetToolPrefs() { return toolPrefs_; }
  30. void SaveToolPrefs() { toolPrefs_->Save(); }
  31. void LoadToolPrefs() { toolPrefs_->Load(); }
  32. const String& GetRootSourceDir() { return rootSourceDir_; }
  33. const String& GetRootBuildDir() { return rootBuildDir_; }
  34. /// Binaries
  35. const String& GetEditorBinary() { return editorBinary_; }
  36. const String& GetPlayerBinary() { return playerBinary_; }
  37. const String& GetToolBinary() { return toolBinary_; }
  38. /// Resource directories
  39. const String& GetCoreDataDir() { return resourceCoreDataDir_; }
  40. const String& GetPlayerDataDir() { return resourcePlayerDataDir_; }
  41. const String& GetEditorDataDir() { return resourceEditorDataDir_; }
  42. /// AtomicNET
  43. const String& GetNETCoreCLRAbsPath() { return netCoreCLRAbsPath_; }
  44. const String& GetNETAssemblyLoadPaths() { return netAssemblyLoadPaths_; }
  45. const String& GetNETTPAPaths() { return netTPAPaths_; }
  46. const String& GetAtomicNETEngineAssemblyPath() { return netAtomicNETEngineAssemblyPath_; }
  47. /// Data directories
  48. const String& GetDeploymentDataDir() { return toolBinary_; }
  49. const String& GetToolDataDir() { return toolDataDir_; }
  50. const String& GetDevConfigFilename();
  51. // OSX
  52. const String& GetPlayerAppFolder() { return playerAppFolder_; }
  53. // iOS
  54. String GetIOSDeployBinary();
  55. void Dump();
  56. private:
  57. // root source directory (for development builds)
  58. String rootSourceDir_;
  59. // root build directory (for development builds)
  60. String rootBuildDir_;
  61. // path to the Atomic Editor binary
  62. String editorBinary_;
  63. // path to Atomic player binary used when running content from the editor or cli
  64. String playerBinary_;
  65. // path to Atomic player app (OSX)
  66. String playerAppFolder_;
  67. // path to the AtomicTool command line binary
  68. String toolBinary_;
  69. String toolDataDir_;
  70. // AtomicNET
  71. String netCoreCLRAbsPath_;
  72. String netAssemblyLoadPaths_;
  73. String netTPAPaths_;
  74. String netAtomicNETEngineAssemblyPath_;
  75. // resources
  76. String resourceCoreDataDir_;
  77. String resourcePlayerDataDir_;
  78. String resourceEditorDataDir_;
  79. // deployment
  80. // static deployment data directory
  81. String deploymentDataDir_;
  82. // whether to use individual build folders, or the deployment data dir for binaries
  83. bool useBuildDirs_;
  84. String macBuildDir_;
  85. String windowsBuildDir_;
  86. String linuxBuildDir_;
  87. String androidBuildDir_;
  88. String iosBuildDir_;
  89. String webBuildDir_;
  90. String devConfigFilename_;
  91. SharedPtr<ToolPrefs> toolPrefs_;
  92. };
  93. }