|
|
@@ -5,6 +5,7 @@
|
|
|
#include <Atomic/IO/FileSystem.h>
|
|
|
|
|
|
#include "../ToolSystem.h"
|
|
|
+#include "../ToolEnvironment.h"
|
|
|
#include "../Project/Project.h"
|
|
|
#include "BuildWindows.h"
|
|
|
#include "BuildSystem.h"
|
|
|
@@ -25,13 +26,20 @@ BuildWindows::~BuildWindows()
|
|
|
void BuildWindows::Initialize()
|
|
|
{
|
|
|
ToolSystem* tsystem = GetSubsystem<ToolSystem>();
|
|
|
+
|
|
|
Project* project = tsystem->GetProject();
|
|
|
|
|
|
- String dataPath = tsystem->GetDataPath();
|
|
|
+ Vector<String> defaultResourcePaths;
|
|
|
+ GetDefaultResourcePaths(defaultResourcePaths);
|
|
|
String projectResources = project->GetResourcePath();
|
|
|
- String coreDataFolder = dataPath + "CoreData/";
|
|
|
|
|
|
- AddResourceDir(coreDataFolder);
|
|
|
+ for (unsigned i = 0; i < defaultResourcePaths.Size(); i++)
|
|
|
+ {
|
|
|
+ AddResourceDir(defaultResourcePaths[i]);
|
|
|
+ }
|
|
|
+
|
|
|
+ // TODO: smart filtering of cache
|
|
|
+ AddResourceDir(project->GetProjectPath() + "Cache/");
|
|
|
AddResourceDir(projectResources);
|
|
|
|
|
|
BuildResourceEntries();
|
|
|
@@ -40,7 +48,7 @@ void BuildWindows::Initialize()
|
|
|
|
|
|
void BuildWindows::Build(const String& buildPath)
|
|
|
{
|
|
|
- ToolSystem* tsystem = GetSubsystem<ToolSystem>();
|
|
|
+ ToolEnvironment* tenv = GetSubsystem<ToolEnvironment>();
|
|
|
|
|
|
buildPath_ = AddTrailingSlash(buildPath) + GetBuildSubfolder();
|
|
|
|
|
|
@@ -49,12 +57,13 @@ void BuildWindows::Build(const String& buildPath)
|
|
|
BuildSystem* buildSystem = GetSubsystem<BuildSystem>();
|
|
|
|
|
|
FileSystem* fileSystem = GetSubsystem<FileSystem>();
|
|
|
+
|
|
|
if (fileSystem->DirExists(buildPath_))
|
|
|
fileSystem->RemoveDir(buildPath_, true);
|
|
|
|
|
|
- String buildSourceDir = tsystem->GetDataPath();
|
|
|
-
|
|
|
- buildSourceDir += "Deployment/Win64";
|
|
|
+ String rootSourceDir = tenv->GetRootSourceDir();
|
|
|
+ String playerBinary = tenv->GetPlayerBinary();
|
|
|
+ String d3d9dll = GetPath(playerBinary) + "/D3DCompiler_47.dll";
|
|
|
|
|
|
fileSystem->CreateDir(buildPath_);
|
|
|
fileSystem->CreateDir(buildPath_ + "/AtomicPlayer_Resources");
|
|
|
@@ -62,8 +71,8 @@ void BuildWindows::Build(const String& buildPath)
|
|
|
String resourcePackagePath = buildPath_ + "/AtomicPlayer_Resources/AtomicResources.pak";
|
|
|
GenerateResourcePackage(resourcePackagePath);
|
|
|
|
|
|
- fileSystem->Copy(buildSourceDir + "/AtomicPlayer.exe", buildPath_ + "/AtomicPlayer.exe");
|
|
|
- fileSystem->Copy(buildSourceDir + "/D3DCompiler_47.dll", buildPath_ + "/D3DCompiler_47.dll");
|
|
|
+ fileSystem->Copy(playerBinary, buildPath_ + "/AtomicPlayer.exe");
|
|
|
+ fileSystem->Copy(d3d9dll, buildPath_ + "/D3DCompiler_47.dll");
|
|
|
|
|
|
buildSystem->BuildComplete(PLATFORMID_WINDOWS, buildPath_);
|
|
|
|