BuildWindows.cpp 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. #include <Atomic/IO/FileSystem.h>
  5. #include "../ToolSystem.h"
  6. #include "../Project/Project.h"
  7. #include "BuildWindows.h"
  8. #include "BuildSystem.h"
  9. namespace ToolCore
  10. {
  11. BuildWindows::BuildWindows(Context * context, Project *project) : BuildBase(context, project)
  12. {
  13. }
  14. BuildWindows::~BuildWindows()
  15. {
  16. }
  17. void BuildWindows::Initialize()
  18. {
  19. ToolSystem* tsystem = GetSubsystem<ToolSystem>();
  20. Project* project = tsystem->GetProject();
  21. String dataPath = tsystem->GetDataPath();
  22. String projectResources = project->GetResourcePath();
  23. String coreDataFolder = dataPath + "CoreData/";
  24. AddResourceDir(coreDataFolder);
  25. AddResourceDir(projectResources);
  26. BuildResourceEntries();
  27. }
  28. void BuildWindows::Build(const String& buildPath)
  29. {
  30. ToolSystem* tsystem = GetSubsystem<ToolSystem>();
  31. buildPath_ = AddTrailingSlash(buildPath) + GetBuildSubfolder();
  32. Initialize();
  33. BuildSystem* buildSystem = GetSubsystem<BuildSystem>();
  34. FileSystem* fileSystem = GetSubsystem<FileSystem>();
  35. if (fileSystem->DirExists(buildPath_))
  36. fileSystem->RemoveDir(buildPath_, true);
  37. String buildSourceDir = tsystem->GetDataPath();
  38. buildSourceDir += "Deployment/Win64";
  39. fileSystem->CreateDir(buildPath_);
  40. fileSystem->CreateDir(buildPath_ + "/AtomicPlayer_Resources");
  41. String resourcePackagePath = buildPath_ + "/AtomicPlayer_Resources/AtomicResources.pak";
  42. GenerateResourcePackage(resourcePackagePath);
  43. fileSystem->Copy(buildSourceDir + "/AtomicPlayer.exe", buildPath_ + "/AtomicPlayer.exe");
  44. fileSystem->Copy(buildSourceDir + "/D3DCompiler_47.dll", buildPath_ + "/D3DCompiler_47.dll");
  45. buildSystem->BuildComplete(PLATFORMID_WINDOWS, buildPath_);
  46. }
  47. /*
  48. void BuildWindows::Build(const String& buildPath)
  49. {
  50. ToolSystem* tsystem = GetSubsystem<ToolSystem>();
  51. buildPath_ = AddTrailingSlash(buildPath) + GetBuildSubfolder();
  52. Initialize();
  53. BuildSystem* buildSystem = GetSubsystem<BuildSystem>();
  54. FileSystem* fileSystem = GetSubsystem<FileSystem>();
  55. if (fileSystem->DirExists(buildPath_))
  56. fileSystem->RemoveDir(buildPath_, true);
  57. String dataPath = tsystem->GetDataPath();
  58. String appSrcPath = dataPath + "Deployment/MacOS/AtomicPlayer.app";
  59. fileSystem->CreateDir(buildPath_);
  60. buildPath_ += "/AtomicPlayer.app";
  61. fileSystem->CreateDir(buildPath_);
  62. fileSystem->CreateDir(buildPath_ + "/Contents");
  63. fileSystem->CreateDir(buildPath_ + "/Contents/MacOS");
  64. fileSystem->CreateDir(buildPath_ + "/Contents/Resources");
  65. String resourcePackagePath = buildPath_ + "/Contents/Resources/AtomicResources.pak";
  66. GenerateResourcePackage(resourcePackagePath);
  67. fileSystem->Copy(appSrcPath + "/Contents/Resources/Atomic.icns", buildPath_ + "/Contents/Resources/Atomic.icns");
  68. fileSystem->Copy(appSrcPath + "/Contents/Info.plist", buildPath_ + "/Contents/Info.plist");
  69. fileSystem->Copy(appSrcPath + "/Contents/MacOS/AtomicPlayer", buildPath_ + "/Contents/MacOS/AtomicPlayer");
  70. #ifdef ATOMIC_PLATFORM_OSX
  71. Vector<String> args;
  72. args.Push("+x");
  73. args.Push(buildPath_ + "/Contents/MacOS/AtomicPlayer");
  74. fileSystem->SystemRun("chmod", args);
  75. #endif
  76. buildPath_ = buildPath + "/Mac-Build";
  77. buildSystem->BuildComplete(PLATFORMID_MAC, buildPath_);
  78. }
  79. */
  80. }