Browse Source

BuildSystem bindings, Updates to cache file handling, successfully built a Mac player

Josh Engebretson 10 years ago
parent
commit
c2042fdd5f

+ 16 - 1
Script/AtomicEditor/ui/modal/build/BuildSettingsWindow.ts

@@ -70,11 +70,26 @@ class BuildSettingsWindow extends ModalWindow {
 
 
     handleWidgetEvent(ev: Atomic.UIWidgetEvent): boolean {
     handleWidgetEvent(ev: Atomic.UIWidgetEvent): boolean {
 
 
-
         if (ev.type == Atomic.UI_EVENT_TYPE_CLICK) {
         if (ev.type == Atomic.UI_EVENT_TYPE_CLICK) {
 
 
             var toolSystem = ToolCore.toolSystem;
             var toolSystem = ToolCore.toolSystem;
 
 
+            if (ev.target.id == "build") {
+
+              var buildSystem = ToolCore.buildSystem;
+              var toolSystem = ToolCore.toolSystem;
+
+              buildSystem.buildPath = "/Users/josh/Desktop/MyBuilds/";
+
+              var project = toolSystem.project;
+              var platform = toolSystem.currentPlatform;
+
+              var buildBase = platform.newBuild(project);
+              buildSystem.queueBuild(buildBase);
+              buildSystem.startNextBuild();
+
+            }
+
             if (ev.target.id == "set_current_platform") {
             if (ev.target.id == "set_current_platform") {
 
 
                 var index = this.platformSelect.value;
                 var index = this.platformSelect.value;

+ 3 - 2
Script/Packages/ToolCore/ToolCore.json

@@ -1,12 +1,13 @@
 {
 {
 	"name" : "ToolCore",
 	"name" : "ToolCore",
 	"sources" : ["Source/ToolCore", "Source/ToolCore/Project", "Source/ToolCore/Platform", "Source/ToolCore/Command",
 	"sources" : ["Source/ToolCore", "Source/ToolCore/Project", "Source/ToolCore/Platform", "Source/ToolCore/Command",
-							 "Source/ToolCore/Import", "Source/ToolCore/Assets", "Source/ToolCore/License"],
+							 "Source/ToolCore/Import", "Source/ToolCore/Assets", "Source/ToolCore/License", "Source/ToolCore/Build"],
 	"classes" : ["ToolEnvironment", "ToolSystem", "Project", "ProjectFile", "Platform", "PlatformMac", "PlatformWeb",
 	"classes" : ["ToolEnvironment", "ToolSystem", "Project", "ProjectFile", "Platform", "PlatformMac", "PlatformWeb",
 							 "PlatformWindows", "PlatformAndroid", "PlatformIOS", "Command", "PlayCmd", "OpenAssetImporter",
 							 "PlatformWindows", "PlatformAndroid", "PlatformIOS", "Command", "PlayCmd", "OpenAssetImporter",
 							 "Asset", "AssetDatabase", "AssetImporter", "AudioImporter", "ModelImporter", "MaterialImporter", "AnimationImportInfo",
 							 "Asset", "AssetDatabase", "AssetImporter", "AudioImporter", "ModelImporter", "MaterialImporter", "AnimationImportInfo",
 							 "PrefabImporter", "JavascriptImporter", "TextureImporter", "SpriterImporter", "PEXImporter", "LicenseSystem",
 							 "PrefabImporter", "JavascriptImporter", "TextureImporter", "SpriterImporter", "PEXImporter", "LicenseSystem",
-						 	 "ProjectUserPrefs", "ProjectBuildSettings"],
+						 	 "ProjectUserPrefs", "ProjectBuildSettings",
+						 	 "BuildBase", "BuildSystem", "BuildMac"],
 	"typescript_decl" : {
 	"typescript_decl" : {
 
 
 		"AssetDatabase" : [
 		"AssetDatabase" : [

+ 1 - 0
Script/TypeScript/AtomicWork.d.ts

@@ -241,6 +241,7 @@ declare module ToolCore {
     export var toolSystem: ToolSystem;
     export var toolSystem: ToolSystem;
     export var assetDatabase: AssetDatabase;
     export var assetDatabase: AssetDatabase;
     export var licenseSystem: LicenseSystem;
     export var licenseSystem: LicenseSystem;
+    export var buildSystem: BuildSystem;
 
 
     export function getToolEnvironment(): ToolEnvironment;
     export function getToolEnvironment(): ToolEnvironment;
     export function getToolSystem(): ToolSystem;
     export function getToolSystem(): ToolSystem;

+ 1 - 1
Source/Atomic/Atomic3D/Model.cpp

@@ -309,7 +309,7 @@ bool Model::BeginLoad(Deserializer& source)
     ResourceCache* cache = GetSubsystem<ResourceCache>();
     ResourceCache* cache = GetSubsystem<ResourceCache>();
     for (unsigned i = 0; i < animList.names_.Size(); ++i)
     for (unsigned i = 0; i < animList.names_.Size(); ++i)
     {
     {
-        AddAnimationResource(cache->GetResource<Animation>(animList.names_[i]));
+        AddAnimationResource(cache->GetResource<Animation>("Cache/" + animList.names_[i]));
     }
     }
 
 
     SetMemoryUse(memoryUse);
     SetMemoryUse(memoryUse);

+ 1 - 1
Source/Atomic/Scene/PrefabComponent.cpp

@@ -50,7 +50,7 @@ void PrefabComponent::RegisterObject(Context* context)
 void PrefabComponent::LoadPrefabNode()
 void PrefabComponent::LoadPrefabNode()
 {
 {
     ResourceCache* cache = GetSubsystem<ResourceCache>();
     ResourceCache* cache = GetSubsystem<ResourceCache>();
-    XMLFile* xmlfile = cache->GetResource<XMLFile>(prefabGUID_);
+    XMLFile* xmlfile = cache->GetResource<XMLFile>("Cache/" + prefabGUID_);
 
 
     if (!xmlfile || !node_)
     if (!xmlfile || !node_)
         return;
         return;

+ 83 - 27
Source/AtomicPlayer/Application/AtomicPlayer.cpp

@@ -24,40 +24,45 @@
 #include <Atomic/Engine/Engine.h>
 #include <Atomic/Engine/Engine.h>
 #include <Atomic/IO/FileSystem.h>
 #include <Atomic/IO/FileSystem.h>
 #include <Atomic/IO/Log.h>
 #include <Atomic/IO/Log.h>
+#include <Atomic/IO/IOEvents.h>
+#include <Atomic/Input/InputEvents.h>
 #include <Atomic/Core/Main.h>
 #include <Atomic/Core/Main.h>
 #include <Atomic/Core/ProcessUtils.h>
 #include <Atomic/Core/ProcessUtils.h>
 #include <Atomic/Resource/ResourceCache.h>
 #include <Atomic/Resource/ResourceCache.h>
 #include <Atomic/Resource/ResourceEvents.h>
 #include <Atomic/Resource/ResourceEvents.h>
+#include <Atomic/UI/UI.h>
 
 
 // Move me
 // Move me
 #include <Atomic/Environment/Environment.h>
 #include <Atomic/Environment/Environment.h>
 
 
 #include <AtomicJS/Javascript/Javascript.h>
 #include <AtomicJS/Javascript/Javascript.h>
 
 
+#include <AtomicPlayer/Player.h>
+
 #include "AtomicPlayer.h"
 #include "AtomicPlayer.h"
 
 
 #include <Atomic/DebugNew.h>
 #include <Atomic/DebugNew.h>
 
 
-#include <Atomic/UI/UI.h>
+#ifdef __APPLE__
+#include <unistd.h>
+#endif
 
 
-DEFINE_APPLICATION_MAIN(AtomicPlayer);
+DEFINE_APPLICATION_MAIN(AtomicPlayer::AtomicPlayerApp)
 
 
-// fixme
-static JSVM* vm = NULL;
-static Javascript* javascript = NULL;
+namespace AtomicPlayer
+{
 
 
-AtomicPlayer::AtomicPlayer(Context* context) :
+extern void jsapi_init_atomicplayer(JSVM* vm);
+
+AtomicPlayerApp::AtomicPlayerApp(Context* context) :
     Application(context)
     Application(context)
 {
 {
-#ifdef ATOMIC_3D
-    RegisterEnvironmentLibrary(context_);
-#endif
 }
 }
 
 
-void AtomicPlayer::Setup()
+void AtomicPlayerApp::Setup()
 {
 {
     FileSystem* filesystem = GetSubsystem<FileSystem>();
     FileSystem* filesystem = GetSubsystem<FileSystem>();
-    
+
     engineParameters_["WindowTitle"] = "AtomicPlayer";
     engineParameters_["WindowTitle"] = "AtomicPlayer";
 
 
 #if (ATOMIC_PLATFORM_ANDROID)
 #if (ATOMIC_PLATFORM_ANDROID)
@@ -72,10 +77,10 @@ void AtomicPlayer::Setup()
     engineParameters_["FullScreen"] = false;
     engineParameters_["FullScreen"] = false;
     engineParameters_["ResourcePaths"] = "AtomicResources";
     engineParameters_["ResourcePaths"] = "AtomicResources";
 #else
 #else
-    engineParameters_["ResourcePaths"] = "AtomicResources";
     engineParameters_["FullScreen"] = false;
     engineParameters_["FullScreen"] = false;
     engineParameters_["WindowWidth"] = 1280;
     engineParameters_["WindowWidth"] = 1280;
     engineParameters_["WindowHeight"] = 720;
     engineParameters_["WindowHeight"] = 720;
+    engineParameters_["ResourcePaths"] = "AtomicResources";
 #endif
 #endif
 
 
 #if ATOMIC_PLATFORM_WINDOWS
 #if ATOMIC_PLATFORM_WINDOWS
@@ -96,11 +101,9 @@ void AtomicPlayer::Setup()
             String argument = arguments[i].ToLower();
             String argument = arguments[i].ToLower();
             String value = i + 1 < arguments.Size() ? arguments[i + 1] : String::EMPTY;
             String value = i + 1 < arguments.Size() ? arguments[i + 1] : String::EMPTY;
 
 
-            if (argument == "--editor-resource-paths" && value.Length())
+            if (argument == "--log-std")
             {
             {
-                engineParameters_["ResourcePrefixPath"] = "";
-                value.Replace("!", ";");
-                engineParameters_["ResourcePaths"] = value;
+                SubscribeToEvent(E_LOGMESSAGE, HANDLER(AtomicPlayerApp, HandleLogMessage));
             }
             }
         }
         }
     }
     }
@@ -109,39 +112,92 @@ void AtomicPlayer::Setup()
     engineParameters_["LogName"] = filesystem->GetAppPreferencesDir("AtomicPlayer", "Logs") + "AtomicPlayer.log";
     engineParameters_["LogName"] = filesystem->GetAppPreferencesDir("AtomicPlayer", "Logs") + "AtomicPlayer.log";
 }
 }
 
 
-void AtomicPlayer::Start()
+void AtomicPlayerApp::Start()
 {
 {
+    Application::Start();
+
     // Instantiate and register the Javascript subsystem
     // Instantiate and register the Javascript subsystem
-    javascript = new Javascript(context_);
+    Javascript* javascript = new Javascript(context_);
     context_->RegisterSubsystem(javascript);
     context_->RegisterSubsystem(javascript);
 
 
-    vm = javascript->InstantiateVM("MainVM");
-    vm->InitJSContext();
+    vm_ = javascript->InstantiateVM("MainVM");
+    vm_->InitJSContext();
+
+    UI* ui = GetSubsystem<UI>();
+    ui->Initialize("DefaultUI/language/lng_en.tb.txt");
+    ui->LoadDefaultPlayerSkin();
+
+    SubscribeToEvent(E_JSERROR, HANDLER(AtomicPlayerApp, HandleJSError));
+
+    vm_->SetModuleSearchPaths("Modules");
 
 
-    vm->SetModuleSearchPaths("Modules");
+    // Instantiate and register the Player subsystem
+    context_->RegisterSubsystem(new AtomicPlayer::Player(context_));
+    AtomicPlayer::jsapi_init_atomicplayer(vm_);
+
+    JSVM* vm = JSVM::GetJSVM(0);
 
 
     if (!vm->ExecuteMain())
     if (!vm->ExecuteMain())
     {
     {
-        ErrorExit("Error executing Scripts/main.js");
+        SendEvent(E_EXITREQUESTED);
     }
     }
 
 
     return;
     return;
 }
 }
 
 
-void AtomicPlayer::Stop()
+void AtomicPlayerApp::Stop()
 {
 {
-    context_->RemoveSubsystem<Javascript>();
+    Application::Stop();
 }
 }
 
 
-void AtomicPlayer::HandleScriptReloadStarted(StringHash eventType, VariantMap& eventData)
+void AtomicPlayerApp::HandleScriptReloadStarted(StringHash eventType, VariantMap& eventData)
 {
 {
 }
 }
 
 
-void AtomicPlayer::HandleScriptReloadFinished(StringHash eventType, VariantMap& eventData)
+void AtomicPlayerApp::HandleScriptReloadFinished(StringHash eventType, VariantMap& eventData)
 {
 {
 }
 }
 
 
-void AtomicPlayer::HandleScriptReloadFailed(StringHash eventType, VariantMap& eventData)
+void AtomicPlayerApp::HandleScriptReloadFailed(StringHash eventType, VariantMap& eventData)
 {
 {
     ErrorExit();
     ErrorExit();
 }
 }
+
+void AtomicPlayerApp::HandleLogMessage(StringHash eventType, VariantMap& eventData)
+{
+    using namespace LogMessage;
+
+    int level = eventData[P_LEVEL].GetInt();
+    // The message may be multi-line, so split to rows in that case
+    Vector<String> rows = eventData[P_MESSAGE].GetString().Split('\n');
+
+    for (unsigned i = 0; i < rows.Size(); ++i)
+    {
+        if (level == LOG_ERROR)
+        {
+            fprintf(stderr, "%s\n", rows[i].CString());
+        }
+        else
+        {
+            fprintf(stdout, "%s\n", rows[i].CString());
+        }
+    }
+
+}
+
+void AtomicPlayerApp::HandleJSError(StringHash eventType, VariantMap& eventData)
+{
+    using namespace JSError;
+    //String errName = eventData[P_ERRORNAME].GetString();
+    //String errStack = eventData[P_ERRORSTACK].GetString();
+    String errMessage = eventData[P_ERRORMESSAGE].GetString();
+    String errFilename = eventData[P_ERRORFILENAME].GetString();
+    int errLineNumber = eventData[P_ERRORLINENUMBER].GetInt();
+
+    String errorString = ToString("%s - %s - Line: %i",
+                                  errFilename.CString(), errMessage.CString(), errLineNumber);
+
+}
+
+
+}

+ 20 - 7
Source/AtomicPlayer/Application/AtomicPlayer.h

@@ -24,16 +24,23 @@
 
 
 #include <Atomic/Engine/Application.h>
 #include <Atomic/Engine/Application.h>
 
 
+namespace Atomic
+{
+    class JSVM;
+}
+
 using namespace Atomic;
 using namespace Atomic;
 
 
-/// AtomicPlayer application runs a script specified on the command line.
-class AtomicPlayer : public Application
+namespace AtomicPlayer
 {
 {
-    OBJECT(AtomicPlayer);
+
+class AtomicPlayerApp : public Application
+{
+    OBJECT(AtomicPlayerApp);
 
 
 public:
 public:
     /// Construct.
     /// Construct.
-    AtomicPlayer(Context* context);
+    AtomicPlayerApp(Context* context);
 
 
     /// Setup before engine initialization. Verify that a script file has been specified.
     /// Setup before engine initialization. Verify that a script file has been specified.
     virtual void Setup();
     virtual void Setup();
@@ -43,14 +50,20 @@ public:
     virtual void Stop();
     virtual void Stop();
 
 
 private:
 private:
+
+    SharedPtr<JSVM> vm_;
+
     /// Handle reload start of the script file.
     /// Handle reload start of the script file.
     void HandleScriptReloadStarted(StringHash eventType, VariantMap& eventData);
     void HandleScriptReloadStarted(StringHash eventType, VariantMap& eventData);
     /// Handle reload success of the script file.
     /// Handle reload success of the script file.
     void HandleScriptReloadFinished(StringHash eventType, VariantMap& eventData);
     void HandleScriptReloadFinished(StringHash eventType, VariantMap& eventData);
     /// Handle reload failure of the script file.
     /// Handle reload failure of the script file.
     void HandleScriptReloadFailed(StringHash eventType, VariantMap& eventData);
     void HandleScriptReloadFailed(StringHash eventType, VariantMap& eventData);
-    
-    /// Script file.
-    SharedPtr<File> jsFile_;
+
+    void HandleJSError(StringHash eventType, VariantMap& eventData);
+
+    void HandleLogMessage(StringHash eventType, VariantMap& eventData);
 
 
 };
 };
+
+}

+ 1 - 1
Source/AtomicPlayer/Application/CMakeLists.txt

@@ -25,7 +25,7 @@ else()
 	add_executable(AtomicPlayer ${EXE_TYPE} ${SOURCE_FILES} ${ATOMIC_EDITOR_ICON})
 	add_executable(AtomicPlayer ${EXE_TYPE} ${SOURCE_FILES} ${ATOMIC_EDITOR_ICON})
 endif()
 endif()
 
 
-target_link_libraries(AtomicPlayer AtomicJS ${ATOMIC_LINK_LIBRARIES})
+target_link_libraries(AtomicPlayer AtomicJS AtomicPlayerLib AtomicPlayerJS ${ATOMIC_LINK_LIBRARIES})
 
 
 if (APPLE)
 if (APPLE)
 
 

+ 3 - 1
Source/AtomicPlayer/CMakeLists.txt

@@ -4,4 +4,6 @@ include_directories (${CMAKE_SOURCE_DIR}/Source/ThirdParty/rapidjson/include
 
 
 file (GLOB SOURCE_FILES *.cpp *.h)
 file (GLOB SOURCE_FILES *.cpp *.h)
 
 
-add_library(AtomicPlayer ${SOURCE_FILES})
+add_library(AtomicPlayerLib ${SOURCE_FILES})
+
+add_subdirectory(Application)

+ 1 - 1
Source/AtomicPlayerJS/CMakeLists.txt

@@ -21,6 +21,6 @@ set (SOURCE_FILES ${SOURCE_FILES} ${JAVASCRIPT_BINDINGS_SOURCE} )
 
 
 add_library(AtomicPlayerJS ${SOURCE_FILES})
 add_library(AtomicPlayerJS ${SOURCE_FILES})
 
 
-target_link_libraries(AtomicPlayerJS AtomicPlayer)
+target_link_libraries(AtomicPlayerJS AtomicPlayerLib)
 
 
 add_dependencies(AtomicPlayerJS AtomicTool)
 add_dependencies(AtomicPlayerJS AtomicTool)

+ 8 - 1
Source/ToolCore/Build/BuildBase.cpp

@@ -70,6 +70,7 @@ void BuildBase::ScanResourceDirectory(const String& resourceDir)
         for (unsigned j = 0; j < resourceEntries_.Size(); j++)
         for (unsigned j = 0; j < resourceEntries_.Size(); j++)
         {
         {
             const BuildResourceEntry* entry = resourceEntries_[j];
             const BuildResourceEntry* entry = resourceEntries_[j];
+
             if (entry->packagePath_ == filename)
             if (entry->packagePath_ == filename)
             {
             {
                 BuildWarn(ToString("Resource Path: %s already exists", filename.CString()));
                 BuildWarn(ToString("Resource Path: %s already exists", filename.CString()));
@@ -91,10 +92,16 @@ void BuildBase::ScanResourceDirectory(const String& resourceDir)
 // END LICENSE MANAGEMENT
 // END LICENSE MANAGEMENT
 
 
         newEntry->absolutePath_ = resourceDir + filename;
         newEntry->absolutePath_ = resourceDir + filename;
-        newEntry->packagePath_ = filename;
         newEntry->resourceDir_ = resourceDir;
         newEntry->resourceDir_ = resourceDir;
 
 
+        if (resourceDir.EndsWith("/Cache/"))
+            newEntry->packagePath_ = "Cache/" + filename;
+        else
+            newEntry->packagePath_ = filename;
+
         resourceEntries_.Push(newEntry);
         resourceEntries_.Push(newEntry);
+
+        //LOGINFOF("Adding resource: %s : %s", newEntry->absolutePath_.CString(), newEntry->packagePath_.CString());
     }
     }
 }
 }
 
 

+ 5 - 3
Source/ToolCore/Build/BuildMac.cpp

@@ -5,6 +5,7 @@
 #include <Atomic/IO/FileSystem.h>
 #include <Atomic/IO/FileSystem.h>
 
 
 #include "../ToolSystem.h"
 #include "../ToolSystem.h"
+#include "../ToolEnvironment.h"
 #include "../Project/Project.h"
 #include "../Project/Project.h"
 #include "BuildMac.h"
 #include "BuildMac.h"
 #include "BuildSystem.h"
 #include "BuildSystem.h"
@@ -37,6 +38,8 @@ void BuildMac::Initialize()
         AddResourceDir(defaultResourcePaths[i]);
         AddResourceDir(defaultResourcePaths[i]);
     }
     }
 
 
+    // TODO: smart filtering of cache
+    AddResourceDir(project->GetProjectPath() + "Cache/");
     AddResourceDir(projectResources);
     AddResourceDir(projectResources);
 
 
     BuildResourceEntries();
     BuildResourceEntries();
@@ -46,6 +49,7 @@ void BuildMac::Initialize()
 void BuildMac::Build(const String& buildPath)
 void BuildMac::Build(const String& buildPath)
 {
 {
     ToolSystem* tsystem = GetSubsystem<ToolSystem>();
     ToolSystem* tsystem = GetSubsystem<ToolSystem>();
+    ToolEnvironment* tenv = GetSubsystem<ToolEnvironment>();
 
 
     buildPath_ = AddTrailingSlash(buildPath) + GetBuildSubfolder();
     buildPath_ = AddTrailingSlash(buildPath) + GetBuildSubfolder();
 
 
@@ -57,9 +61,7 @@ void BuildMac::Build(const String& buildPath)
     if (fileSystem->DirExists(buildPath_))
     if (fileSystem->DirExists(buildPath_))
         fileSystem->RemoveDir(buildPath_, true);
         fileSystem->RemoveDir(buildPath_, true);
 
 
-    String dataPath = tsystem->GetDataPath();
-
-    String appSrcPath = dataPath + "Deployment/MacOS/AtomicPlayer.app";
+    String appSrcPath = tenv->GetPlayerAppFolder();
 
 
     fileSystem->CreateDir(buildPath_);
     fileSystem->CreateDir(buildPath_);
 
 

+ 0 - 1
Source/ToolCore/Project/Project.h

@@ -44,7 +44,6 @@ public:
     bool IsScriptsDirOrFile(const String& fullPath);
     bool IsScriptsDirOrFile(const String& fullPath);
     bool IsModulesDirOrFile(const String& fullPath);
     bool IsModulesDirOrFile(const String& fullPath);
 
 
-
     void AddPlatform(PlatformID platformID);
     void AddPlatform(PlatformID platformID);
     bool ContainsPlatform(PlatformID platformID);
     bool ContainsPlatform(PlatformID platformID);
     void RemovePlatform(PlatformID platformID);
     void RemovePlatform(PlatformID platformID);

+ 3 - 1
Source/ToolCore/ToolEnvironment.cpp

@@ -137,13 +137,15 @@ void ToolEnvironment::SetRootBuildDir(const String& buildDir, bool setBinaryPath
         playerBinary_ = rootBuildDir_ + "Source/AtomicPlayer/Release/AtomicPlayer.exe";
         playerBinary_ = rootBuildDir_ + "Source/AtomicPlayer/Release/AtomicPlayer.exe";
         editorBinary_ = rootBuildDir_ + "Source/AtomicEditor/Release/AtomicEditor.exe";
         editorBinary_ = rootBuildDir_ + "Source/AtomicEditor/Release/AtomicEditor.exe";
 #endif
 #endif
+
 #elif ATOMIC_PLATFORM_OSX
 #elif ATOMIC_PLATFORM_OSX
 
 
 #ifdef ATOMIC_XCODE
 #ifdef ATOMIC_XCODE
         playerBinary_ = rootBuildDir_ + "Source/AtomicPlayer/" + CMAKE_INTDIR + "/AtomicPlayer.app/Contents/MacOS/AtomicPlayer";
         playerBinary_ = rootBuildDir_ + "Source/AtomicPlayer/" + CMAKE_INTDIR + "/AtomicPlayer.app/Contents/MacOS/AtomicPlayer";
         editorBinary_ = rootBuildDir_ + "Source/AtomicEditor/" + CMAKE_INTDIR + "/AtomicEditor.app/Contents/MacOS/AtomicEditor";
         editorBinary_ = rootBuildDir_ + "Source/AtomicEditor/" + CMAKE_INTDIR + "/AtomicEditor.app/Contents/MacOS/AtomicEditor";
 #else
 #else
-        playerBinary_ = rootBuildDir_ + "Source/AtomicPlayer/AtomicPlayer.app/Contents/MacOS/AtomicPlayer";
+        playerBinary_ = rootBuildDir_ + "Source/AtomicPlayer/Application/AtomicPlayer.app/Contents/MacOS/AtomicPlayer";
+        playerAppFolder_ = rootBuildDir_ + "Source/AtomicPlayer/Application/AtomicPlayer.app/";
         editorBinary_ = rootBuildDir_ + "Source/AtomicEditor/AtomicEditor.app/Contents/MacOS/AtomicEditor";
         editorBinary_ = rootBuildDir_ + "Source/AtomicEditor/AtomicEditor.app/Contents/MacOS/AtomicEditor";
 #endif
 #endif
         
         

+ 6 - 0
Source/ToolCore/ToolEnvironment.h

@@ -52,6 +52,9 @@ public:
 
 
     const String& GetDevConfigFilename();
     const String& GetDevConfigFilename();
 
 
+    // OSX
+    const String& GetPlayerAppFolder() { return playerAppFolder_; }
+
     void Dump();
     void Dump();
 
 
 private:
 private:
@@ -68,6 +71,9 @@ private:
     // path to Atomic player binary used when running content from the editor or cli
     // path to Atomic player binary used when running content from the editor or cli
     String playerBinary_;
     String playerBinary_;
 
 
+    // path to Atomic player app (OSX)
+    String playerAppFolder_;
+
     // path to the AtomicTool command line binary
     // path to the AtomicTool command line binary
     String toolBinary_;
     String toolBinary_;
 
 

+ 4 - 0
Source/ToolCoreJS/ToolCoreJS.cpp

@@ -5,6 +5,7 @@
 #include <ToolCore/Assets/AssetDatabase.h>
 #include <ToolCore/Assets/AssetDatabase.h>
 #include <ToolCore/Project/Project.h>
 #include <ToolCore/Project/Project.h>
 #include <ToolCore/License/LicenseSystem.h>
 #include <ToolCore/License/LicenseSystem.h>
+#include <ToolCore/Build/BuildSystem.h>
 
 
 using namespace Atomic;
 using namespace Atomic;
 
 
@@ -119,6 +120,9 @@ void jsapi_init_toolcore(JSVM* vm)
     js_push_class_object_instance(ctx, vm->GetSubsystem<ToolSystem>(), "ToolSystem");
     js_push_class_object_instance(ctx, vm->GetSubsystem<ToolSystem>(), "ToolSystem");
     duk_put_prop_string(ctx, -2, "toolSystem");
     duk_put_prop_string(ctx, -2, "toolSystem");
 
 
+    js_push_class_object_instance(ctx, vm->GetSubsystem<BuildSystem>(), "BuildSystem");
+    duk_put_prop_string(ctx, -2, "buildSystem");
+
     duk_push_c_function(ctx, js_atomic_GetLicenseSystem, 0);
     duk_push_c_function(ctx, js_atomic_GetLicenseSystem, 0);
     duk_put_prop_string(ctx, -2, "getLicenseSystem");
     duk_put_prop_string(ctx, -2, "getLicenseSystem");