BsBuildManager.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsIReflectable.h"
  4. #include "BsModule.h"
  5. #include "BsPlatformInfo.h"
  6. namespace BansheeEngine
  7. {
  8. /**
  9. * @brief Contains build information for a specific platform to be
  10. * used by the build manager.
  11. */
  12. class BS_ED_EXPORT BuildData : public IReflectable
  13. {
  14. public:
  15. BuildData();
  16. PlatformType activePlatform;
  17. Vector<SPtr<PlatformInfo>> platformData;
  18. /************************************************************************/
  19. /* RTTI */
  20. /************************************************************************/
  21. public:
  22. friend class BuildDataRTTI;
  23. static RTTITypeBase* getRTTIStatic();
  24. virtual RTTITypeBase* getRTTI() const;
  25. };
  26. /**
  27. * @brief Handles building of the game executable and related files.
  28. */
  29. class BS_ED_EXPORT BuildManager : public Module<BuildManager>
  30. {
  31. public:
  32. BuildManager();
  33. /**
  34. * @brief Returns a list of available platforms the executable can be built for.
  35. */
  36. const Vector<PlatformType>& getAvailablePlatforms() const;
  37. /**
  38. * @brief Returns the currently active platform.
  39. */
  40. PlatformType getActivePlatform() const;
  41. /**
  42. * @brief Changes the active build platform. Might cause asset reimport.
  43. */
  44. void setActivePlatform(PlatformType type);
  45. /**
  46. * @brief Gets stored build setting for the active platform.
  47. */
  48. SPtr<PlatformInfo> getActivePlatformInfo() const;
  49. /**
  50. * @brief Gets stored build setting for a specific platform.
  51. */
  52. SPtr<PlatformInfo> getPlatformInfo(PlatformType type) const;
  53. /**
  54. * @brief Returns a list of file names of all .NET assemblies
  55. * required for a specific platform.
  56. */
  57. Vector<WString> getFrameworkAssemblies(PlatformType type) const;
  58. /**
  59. * @brief Returns the location of the pre-built executable for the specified platform.
  60. */
  61. Path getMainExecutable(PlatformType type) const;
  62. /**
  63. * @brief Returns a list of script defines for a specific platform.
  64. */
  65. WString getDefines(PlatformType type) const;
  66. /**
  67. * @brief Stores build settings for all platforms in the specified file.
  68. */
  69. void save(const Path& outFile);
  70. /**
  71. * @brief Loads a previously stored list of build settings.
  72. */
  73. void load(const Path& inFile);
  74. /**
  75. * @brief Clears currently active build settings.
  76. */
  77. void clear();
  78. private:
  79. SPtr<BuildData> mBuildData;
  80. };
  81. }