PlatformIOS.cpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #include <ThirdParty/PugiXml/src/pugixml.hpp>
  2. #include "../Build/BuildIOS.h"
  3. #include "PlatformIOS.h"
  4. #ifdef ATOMIC_PLATFORM_OSX
  5. #include "PlatformIOSUtils.h"
  6. #endif
  7. namespace ToolCore
  8. {
  9. PlatformIOS::PlatformIOS(Context* context) : Platform(context)
  10. {
  11. }
  12. PlatformIOS::~PlatformIOS()
  13. {
  14. }
  15. String PlatformIOS::ParseProvisionAppIdentifierPrefix(const String& provisionFile)
  16. {
  17. #if defined(ATOMIC_PLATFORM_WINDOWS) || defined(ATOMIC_PLATFORM_LINUX)
  18. return String::EMPTY;
  19. #else
  20. String pdata = GetMobileProvisionData(provisionFile.CString());
  21. if (!pdata.Length())
  22. return String::EMPTY;
  23. pugi::xml_document doc;
  24. if (!doc.load(pdata.CString()))
  25. {
  26. return String::EMPTY;
  27. }
  28. String AppIDName;
  29. String ApplicationIdentifierPrefix;
  30. pugi::xml_node dict = doc.document_element().child("dict");
  31. for (pugi::xml_node key = dict.child("key"); key; key = key.next_sibling("key"))
  32. {
  33. String keyName = key.child_value();
  34. if (keyName == "AppIDName")
  35. {
  36. pugi::xml_node value = key.next_sibling();
  37. if (!strcmp(value.name(), "string"))
  38. AppIDName = value.child_value();
  39. }
  40. else if (keyName == "ApplicationIdentifierPrefix")
  41. {
  42. pugi::xml_node array = key.next_sibling();
  43. if (!strcmp(array.name(), "array"))
  44. {
  45. pugi::xml_node value = array.first_child();
  46. if (!strcmp(value.name(), "string"))
  47. ApplicationIdentifierPrefix = value.child_value();
  48. }
  49. }
  50. }
  51. return ApplicationIdentifierPrefix;
  52. #endif
  53. }
  54. BuildBase* PlatformIOS::NewBuild(Project *project)
  55. {
  56. return new BuildIOS(context_, project);
  57. }
  58. }