BuildCmd.cpp 921 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #include <Atomic/Core/StringUtils.h>
  2. #include <Atomic/IO/Log.h>
  3. #include <Atomic/IO/File.h>
  4. #include "../ToolSystem.h"
  5. #include "BuildCmd.h"
  6. #include <Poco/File.h>
  7. namespace ToolCore
  8. {
  9. BuildCmd::BuildCmd(Context* context) : Command(context)
  10. {
  11. }
  12. BuildCmd::~BuildCmd()
  13. {
  14. }
  15. bool BuildCmd::Parse(const Vector<String>& arguments, unsigned startIndex, String& errorMsg)
  16. {
  17. String argument = arguments[startIndex].ToLower();
  18. String value = startIndex + 1 < arguments.Size() ? arguments[startIndex + 1] : String::EMPTY;
  19. if (argument != "build")
  20. {
  21. errorMsg = "Unable to parse build command";
  22. return false;
  23. }
  24. if (!value.Length())
  25. {
  26. errorMsg = "Unable to parse build platform";
  27. return false;
  28. }
  29. buildPlatform_ = value;
  30. return true;
  31. }
  32. void BuildCmd::Run()
  33. {
  34. LOGINFOF("Building project for: %s", buildPlatform_.CString());
  35. Finished();
  36. }
  37. }