|
@@ -5,6 +5,7 @@
|
|
|
// license information: https://github.com/AtomicGameEngine/AtomicGameEngine
|
|
// license information: https://github.com/AtomicGameEngine/AtomicGameEngine
|
|
|
//
|
|
//
|
|
|
|
|
|
|
|
|
|
+#include <Atomic/Core/StringUtils.h>
|
|
|
#include <Atomic/IO/FileSystem.h>
|
|
#include <Atomic/IO/FileSystem.h>
|
|
|
|
|
|
|
|
#include "../ToolSystem.h"
|
|
#include "../ToolSystem.h"
|
|
@@ -47,6 +48,71 @@ void BuildWindows::Initialize()
|
|
|
|
|
|
|
|
BuildResourceEntries();
|
|
BuildResourceEntries();
|
|
|
|
|
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void BuildWindows::BuildAtomicNET()
|
|
|
|
|
+{
|
|
|
|
|
+ // AtomicNET
|
|
|
|
|
+
|
|
|
|
|
+ FileSystem* fileSystem = GetSubsystem<FileSystem>();
|
|
|
|
|
+ ToolEnvironment* tenv = GetSubsystem<ToolEnvironment>();
|
|
|
|
|
+ ToolSystem* tsystem = GetSubsystem<ToolSystem>();
|
|
|
|
|
+ Project* project = tsystem->GetProject();
|
|
|
|
|
+ String projectResources = project->GetResourcePath();
|
|
|
|
|
+
|
|
|
|
|
+ String assembliesPath = projectResources + "Assemblies/";
|
|
|
|
|
+
|
|
|
|
|
+ // if no assemblies path, no need to install AtomicNET
|
|
|
|
|
+ if (!fileSystem->DirExists(assembliesPath))
|
|
|
|
|
+ return;
|
|
|
|
|
+
|
|
|
|
|
+ Vector<String> results;
|
|
|
|
|
+ fileSystem->ScanDir(results, assembliesPath, "*.dll", SCAN_FILES, true);
|
|
|
|
|
+
|
|
|
|
|
+ // if no assembiles in Assemblies path, no need to install AtomicNET
|
|
|
|
|
+ if (!results.Size())
|
|
|
|
|
+ return;
|
|
|
|
|
+
|
|
|
|
|
+ fileSystem->CreateDir(buildPath_ + "/AtomicPlayer_Resources/AtomicNET");
|
|
|
|
|
+ fileSystem->CreateDir(buildPath_ + "/AtomicPlayer_Resources/AtomicNET/Atomic");
|
|
|
|
|
+ fileSystem->CreateDir(buildPath_ + "/AtomicPlayer_Resources/AtomicNET/Atomic/Assemblies");
|
|
|
|
|
+
|
|
|
|
|
+ fileSystem->CopyDir(tenv->GetNETCoreCLRAbsPath(), buildPath_ + "/AtomicPlayer_Resources/AtomicNET/CoreCLR");
|
|
|
|
|
+ fileSystem->CopyDir(tenv->GetNETTPAPaths(), buildPath_ + "/AtomicPlayer_Resources/AtomicNET/Atomic/TPA");
|
|
|
|
|
+
|
|
|
|
|
+ // Atomic Assemblies
|
|
|
|
|
+
|
|
|
|
|
+ const String& assemblyLoadPaths = tenv->GetNETAssemblyLoadPaths();
|
|
|
|
|
+ Vector<String> paths = assemblyLoadPaths.Split(';');
|
|
|
|
|
+
|
|
|
|
|
+ for (unsigned i = 0; i < paths.Size(); i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ Vector<String> loadResults;
|
|
|
|
|
+ fileSystem->ScanDir(loadResults, paths[i], "*.dll", SCAN_FILES, true);
|
|
|
|
|
+
|
|
|
|
|
+ for (unsigned j = 0; j < loadResults.Size(); j++)
|
|
|
|
|
+ {
|
|
|
|
|
+ String pathName, fileName, ext;
|
|
|
|
|
+ SplitPath(loadResults[j], pathName, fileName, ext);
|
|
|
|
|
+
|
|
|
|
|
+ if (fileName != "AtomicNETEngine")
|
|
|
|
|
+ continue;
|
|
|
|
|
+
|
|
|
|
|
+ fileSystem->Copy(paths[i] + "/" + loadResults[j], ToString("%s/AtomicPlayer_Resources/AtomicNET/Atomic/Assemblies/%s.dll", buildPath_.CString(), fileName.CString()));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // Project assemblied
|
|
|
|
|
+ for (unsigned i = 0; i < results.Size(); i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ String pathName, fileName, ext;
|
|
|
|
|
+ SplitPath(results[i], pathName, fileName, ext);
|
|
|
|
|
+ fileSystem->Copy(assembliesPath + results[i], ToString("%s/AtomicPlayer_Resources/AtomicNET/Atomic/Assemblies/%s.dll", buildPath_.CString(), fileName.CString()));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void BuildWindows::Build(const String& buildPath)
|
|
void BuildWindows::Build(const String& buildPath)
|
|
@@ -77,6 +143,8 @@ void BuildWindows::Build(const String& buildPath)
|
|
|
fileSystem->Copy(playerBinary, buildPath_ + "/AtomicPlayer.exe");
|
|
fileSystem->Copy(playerBinary, buildPath_ + "/AtomicPlayer.exe");
|
|
|
fileSystem->Copy(d3d9dll, buildPath_ + "/D3DCompiler_47.dll");
|
|
fileSystem->Copy(d3d9dll, buildPath_ + "/D3DCompiler_47.dll");
|
|
|
|
|
|
|
|
|
|
+ BuildAtomicNET();
|
|
|
|
|
+
|
|
|
buildSystem->BuildComplete(PLATFORMID_WINDOWS, buildPath_);
|
|
buildSystem->BuildComplete(PLATFORMID_WINDOWS, buildPath_);
|
|
|
|
|
|
|
|
}
|
|
}
|