BuildBase.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
  2. // Please see LICENSE.md in repository root for license information
  3. // https://github.com/AtomicGameEngine/AtomicGameEngine
  4. #pragma once
  5. #include <Atomic/Core/Object.h>
  6. #include "BuildTypes.h"
  7. using namespace Atomic;
  8. namespace ToolCore
  9. {
  10. class ResourcePackager;
  11. class Project;
  12. class BuildBase : public Object
  13. {
  14. OBJECT(BuildBase);
  15. public:
  16. BuildBase(Context* context, Project* project);
  17. virtual ~BuildBase();
  18. virtual void Build(const String& buildPath) = 0;
  19. // some platforms may want to do their own packaging of resources
  20. virtual bool UseResourcePackager() { return true; }
  21. virtual String GetBuildSubfolder() = 0;
  22. // add in search order, first added is first searched
  23. // will warn on name conflicts
  24. void AddResourceDir(const String& dir);
  25. void BuildLog(const String& message);
  26. void BuildWarn(const String& warning);
  27. void BuildError(const String& error);
  28. protected:
  29. void GenerateResourcePackage(const String& resourcePackagePath);
  30. void BuildResourceEntries();
  31. void GetDefaultResourcePaths(Vector<String>& paths);
  32. String buildPath_;
  33. PODVector<BuildResourceEntry*> resourceEntries_;
  34. bool containsMDL_;
  35. private:
  36. Vector<String> buildLog_;
  37. Vector<String> buildWarnings_;
  38. Vector<String> buildErrors_;
  39. void ScanResourceDirectory(const String& resourceDir);
  40. SharedPtr<Project> project_;
  41. SharedPtr<ResourcePackager> resourcePackager_;
  42. Vector<String> resourceDirs_;
  43. };
  44. }