|
@@ -16,6 +16,9 @@
|
|
|
#include <Atomic/Script/ScriptSystem.h>
|
|
#include <Atomic/Script/ScriptSystem.h>
|
|
|
#include <AtomicJS/Javascript/Javascript.h>
|
|
#include <AtomicJS/Javascript/Javascript.h>
|
|
|
|
|
|
|
|
|
|
+#include <ToolCore/ToolSystem.h>
|
|
|
|
|
+#include <ToolCore/ToolEnvironment.h>
|
|
|
|
|
+
|
|
|
#ifdef ATOMIC_DOTNET
|
|
#ifdef ATOMIC_DOTNET
|
|
|
#include <AtomicNET/NETCore/NETHost.h>
|
|
#include <AtomicNET/NETCore/NETHost.h>
|
|
|
#include <AtomicNET/NETCore/NETCore.h>
|
|
#include <AtomicNET/NETCore/NETCore.h>
|
|
@@ -28,6 +31,14 @@ namespace Atomic
|
|
|
void jsapi_init_atomicnet(JSVM* vm);
|
|
void jsapi_init_atomicnet(JSVM* vm);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+using namespace ToolCore;
|
|
|
|
|
+
|
|
|
|
|
+namespace ToolCore
|
|
|
|
|
+{
|
|
|
|
|
+ extern void jsapi_init_toolcore(JSVM* vm);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
namespace AtomicEditor
|
|
namespace AtomicEditor
|
|
|
{
|
|
{
|
|
|
|
|
|
|
@@ -46,6 +57,8 @@ void AEEditorCommon::Start()
|
|
|
vm_ = javascript->InstantiateVM("MainVM");
|
|
vm_ = javascript->InstantiateVM("MainVM");
|
|
|
vm_->InitJSContext();
|
|
vm_->InitJSContext();
|
|
|
|
|
|
|
|
|
|
+ jsapi_init_toolcore(vm_);
|
|
|
|
|
+
|
|
|
#ifdef ATOMIC_DOTNET
|
|
#ifdef ATOMIC_DOTNET
|
|
|
jsapi_init_atomicnet(vm_);
|
|
jsapi_init_atomicnet(vm_);
|
|
|
#endif
|
|
#endif
|
|
@@ -68,34 +81,32 @@ void AEEditorCommon::Setup()
|
|
|
Javascript* javascript = new Javascript(context_);
|
|
Javascript* javascript = new Javascript(context_);
|
|
|
context_->RegisterSubsystem(javascript);
|
|
context_->RegisterSubsystem(javascript);
|
|
|
|
|
|
|
|
-#ifdef ATOMIC_DOTNET
|
|
|
|
|
-
|
|
|
|
|
- // Instantiate and register the AtomicNET subsystem
|
|
|
|
|
- SharedPtr<NETCore> netCore (new NETCore(context_));
|
|
|
|
|
- context_->RegisterSubsystem(netCore);
|
|
|
|
|
- String netCoreErrorMsg;
|
|
|
|
|
|
|
+ ToolEnvironment* env = new ToolEnvironment(context_);
|
|
|
|
|
+ context_->RegisterSubsystem(env);
|
|
|
|
|
|
|
|
#ifdef ATOMIC_DEV_BUILD
|
|
#ifdef ATOMIC_DEV_BUILD
|
|
|
|
|
|
|
|
- String assemblyLoadPaths = GetNativePath(ToString("%s/Artifacts/AtomicNET/", ATOMIC_ROOT_SOURCE_DIR));
|
|
|
|
|
-
|
|
|
|
|
-#ifdef ATOMIC_PLATFORM_WINDOWS
|
|
|
|
|
|
|
+ if (!env->InitFromJSON())
|
|
|
|
|
+ {
|
|
|
|
|
+ ErrorExit(ToString("Unable to initialize tool environment from %s", env->GetDevConfigFilename().CString()));
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+#else
|
|
|
|
|
|
|
|
- String coreCLRAbsPath = GetNativePath(ToString("%s/Submodules/CoreCLR/Windows/Debug/x64/", ATOMIC_ROOT_SOURCE_DIR));
|
|
|
|
|
- String coreCLRTPAPaths = ToString("%s/Submodules/CoreCLR/Windows/Debug/AnyCPU/TPA/", ATOMIC_ROOT_SOURCE_DIR);
|
|
|
|
|
- coreCLRTPAPaths += ToString(";%s/Artifacts/AtomicNET/TPA/", ATOMIC_ROOT_SOURCE_DIR);
|
|
|
|
|
|
|
+ env->InitFromPackage();
|
|
|
|
|
|
|
|
-#else
|
|
|
|
|
- String coreCLRAbsPath = GetNativePath(ToString("%s/Submodules/CoreCLR/OSX/Debug/x64/", ATOMIC_ROOT_SOURCE_DIR);
|
|
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#else
|
|
|
|
|
- assert(0);
|
|
|
|
|
-#endif
|
|
|
|
|
|
|
+#ifdef ATOMIC_DOTNET
|
|
|
|
|
+
|
|
|
|
|
+ // Instantiate and register the AtomicNET subsystem
|
|
|
|
|
+ SharedPtr<NETCore> netCore (new NETCore(context_));
|
|
|
|
|
+ context_->RegisterSubsystem(netCore);
|
|
|
|
|
+ String netCoreErrorMsg;
|
|
|
|
|
|
|
|
- NETHost::SetCoreCLRFilesAbsPath(coreCLRAbsPath);
|
|
|
|
|
- NETHost::SetCoreCLRTPAPaths(coreCLRTPAPaths);
|
|
|
|
|
- NETHost::SetCoreCLRAssemblyLoadPaths(assemblyLoadPaths);
|
|
|
|
|
|
|
+ NETHost::SetCoreCLRFilesAbsPath(env->GetNETCoreCLRAbsPath());
|
|
|
|
|
+ NETHost::SetCoreCLRTPAPaths(env->GetNETTPAPaths());
|
|
|
|
|
+ NETHost::SetCoreCLRAssemblyLoadPaths(env->GetNETAssemblyLoadPaths());
|
|
|
|
|
|
|
|
if (!netCore->Initialize(netCoreErrorMsg))
|
|
if (!netCore->Initialize(netCoreErrorMsg))
|
|
|
{
|
|
{
|
|
@@ -108,6 +119,8 @@ void AEEditorCommon::Setup()
|
|
|
}
|
|
}
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
|
|
+ ToolSystem* system = new ToolSystem(context_);
|
|
|
|
|
+ context_->RegisterSubsystem(system);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|