PlatformIOS.cpp 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. //
  2. // Copyright (c) 2014-2016 THUNDERBEAST GAMES LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to deal
  6. // in the Software without restriction, including without limitation the rights
  7. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. // copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. // THE SOFTWARE.
  21. //
  22. #include <ThirdParty/PugiXml/src/pugixml.hpp>
  23. #include "../Build/BuildIOS.h"
  24. #include "../License/LicenseSystem.h"
  25. #include "PlatformIOS.h"
  26. #ifdef ATOMIC_PLATFORM_OSX
  27. #include "PlatformIOSUtils.h"
  28. #endif
  29. namespace ToolCore
  30. {
  31. PlatformIOS::PlatformIOS(Context* context) : Platform(context)
  32. {
  33. }
  34. PlatformIOS::~PlatformIOS()
  35. {
  36. }
  37. String PlatformIOS::ParseProvisionAppIdentifierPrefix(const String& provisionFile)
  38. {
  39. #if defined(ATOMIC_PLATFORM_WINDOWS) || defined(ATOMIC_PLATFORM_LINUX)
  40. return String::EMPTY;
  41. #else
  42. String pdata = GetMobileProvisionData(provisionFile.CString());
  43. if (!pdata.Length())
  44. return String::EMPTY;
  45. pugi::xml_document doc;
  46. if (!doc.load(pdata.CString()))
  47. {
  48. return String::EMPTY;
  49. }
  50. String AppIDName;
  51. String ApplicationIdentifierPrefix;
  52. pugi::xml_node dict = doc.document_element().child("dict");
  53. for (pugi::xml_node key = dict.child("key"); key; key = key.next_sibling("key"))
  54. {
  55. String keyName = key.child_value();
  56. if (keyName == "AppIDName")
  57. {
  58. pugi::xml_node value = key.next_sibling();
  59. if (!strcmp(value.name(), "string"))
  60. AppIDName = value.child_value();
  61. }
  62. else if (keyName == "ApplicationIdentifierPrefix")
  63. {
  64. pugi::xml_node array = key.next_sibling();
  65. if (!strcmp(array.name(), "array"))
  66. {
  67. pugi::xml_node value = array.first_child();
  68. if (!strcmp(value.name(), "string"))
  69. ApplicationIdentifierPrefix = value.child_value();
  70. }
  71. }
  72. }
  73. return ApplicationIdentifierPrefix;
  74. #endif
  75. }
  76. BuildBase* PlatformIOS::NewBuild(Project *project)
  77. {
  78. return new BuildIOS(context_, project);
  79. }
  80. bool PlatformIOS::GetLicense()
  81. {
  82. return true;
  83. }
  84. }