BuildBase.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. // add in search order, first added is first searched
  22. // will warn on name conflicts
  23. void AddResourceDir(const String& dir);
  24. void BuildLog(const String& message);
  25. void BuildWarn(const String& warning);
  26. void BuildError(const String& error);
  27. protected:
  28. void GenerateResourcePackage(const String& resourcePackagePath);
  29. void BuildResourceEntries();
  30. String buildPath_;
  31. PODVector<BuildResourceEntry*> resourceEntries_;
  32. bool containsMDL_;
  33. private:
  34. Vector<String> buildLog_;
  35. Vector<String> buildWarnings_;
  36. Vector<String> buildErrors_;
  37. void ScanResourceDirectory(const String& resourceDir);
  38. SharedPtr<Project> project_;
  39. SharedPtr<ResourcePackager> resourcePackager_;
  40. Vector<String> resourceDirs_;
  41. };
  42. }