Browse Source

Mac build somewhat working from command line

Josh Engebretson 10 years ago
parent
commit
bc579da7d8

+ 19 - 0
Source/AtomicTool/AtomicTool.cpp

@@ -5,6 +5,7 @@
 #include <Atomic/Engine/Engine.h>
 #include <Atomic/Engine/Engine.h>
 
 
 #include <ToolCore/ToolSystem.h>
 #include <ToolCore/ToolSystem.h>
+#include <ToolCore/Build/BuildSystem.h>
 #include <ToolCore/License/LicenseSystem.h>
 #include <ToolCore/License/LicenseSystem.h>
 #include <ToolCore/Command/Command.h>
 #include <ToolCore/Command/Command.h>
 #include <ToolCore/Command/CommandParser.h>
 #include <ToolCore/Command/CommandParser.h>
@@ -84,8 +85,11 @@ void AtomicTool::Start()
 
 
     ToolSystem* tsystem = new ToolSystem(context_);
     ToolSystem* tsystem = new ToolSystem(context_);
     context_->RegisterSubsystem(tsystem);
     context_->RegisterSubsystem(tsystem);
+    tsystem->SetCLI();
     tsystem->SetDataPath(cliDataPath_);
     tsystem->SetDataPath(cliDataPath_);
 
 
+    BuildSystem* buildSystem = GetSubsystem<BuildSystem>();
+
     SharedPtr<CommandParser> parser(new CommandParser(context_));
     SharedPtr<CommandParser> parser(new CommandParser(context_));
 
 
     SharedPtr<Command> cmd(parser->Parse(arguments));
     SharedPtr<Command> cmd(parser->Parse(arguments));
@@ -127,6 +131,21 @@ void AtomicTool::Start()
             return;
             return;
         }
         }
 
 
+        // Set the build path
+        String buildFolder = projectDirectory + "/" + "Build";
+        buildSystem->SetBuildPath(buildFolder);
+
+        if (!fileSystem->DirExists(buildFolder))
+        {
+            fileSystem->CreateDir(buildFolder);
+
+            if (!fileSystem->DirExists(buildFolder))
+            {
+                ErrorExit(ToString("Failed to create build folder: %s", buildFolder.CString()));
+                return;
+            }
+        }
+
     }
     }
 
 
     // BEGIN LICENSE MANAGEMENT
     // BEGIN LICENSE MANAGEMENT

+ 2 - 0
Source/ToolCore/Build/BuildBase.h

@@ -29,6 +29,8 @@ public:
     // some platforms may want to do their own packaging of resources
     // some platforms may want to do their own packaging of resources
     virtual bool UseResourcePackager() { return true; }
     virtual bool UseResourcePackager() { return true; }
 
 
+    virtual String GetBuildSubfolder() = 0;
+
     // add in search order, first added is first searched
     // add in search order, first added is first searched
     // will warn on name conflicts
     // will warn on name conflicts
     void AddResourceDir(const String& dir);
     void AddResourceDir(const String& dir);

+ 12 - 21
Source/ToolCore/Build/BuildMac.cpp

@@ -24,19 +24,12 @@ BuildMac::~BuildMac()
 
 
 void BuildMac::Initialize()
 void BuildMac::Initialize()
 {
 {
-    ToolSystem* tools = GetSubsystem<ToolSystem>();
-    Project* project = tools->GetProject();
-
-    FileSystem* fileSystem = GetSubsystem<FileSystem>();
-
-#ifdef ATOMIC_PLATFORM_WINDOWS
-    String bundleResources = fileSystem->GetProgramDir();
-#else
-    String bundleResources = fileSystem->GetAppBundleResourceFolder();
-#endif
+    ToolSystem* tsystem = GetSubsystem<ToolSystem>();
+    Project* project = tsystem->GetProject();
 
 
+    String dataPath = tsystem->GetDataPath();
     String projectResources = project->GetResourcePath();
     String projectResources = project->GetResourcePath();
-    String coreDataFolder = bundleResources + "CoreData/";
+    String coreDataFolder = dataPath + "CoreData/";
 
 
     AddResourceDir(coreDataFolder);
     AddResourceDir(coreDataFolder);
     AddResourceDir(projectResources);
     AddResourceDir(projectResources);
@@ -47,7 +40,9 @@ void BuildMac::Initialize()
 
 
 void BuildMac::Build(const String& buildPath)
 void BuildMac::Build(const String& buildPath)
 {
 {
-    buildPath_ = buildPath + "/Mac-Build";
+    ToolSystem* tsystem = GetSubsystem<ToolSystem>();
+
+    buildPath_ = AddTrailingSlash(buildPath) + GetBuildSubfolder();
 
 
     Initialize();
     Initialize();
 
 
@@ -57,13 +52,9 @@ void BuildMac::Build(const String& buildPath)
     if (fileSystem->DirExists(buildPath_))
     if (fileSystem->DirExists(buildPath_))
         fileSystem->RemoveDir(buildPath_, true);
         fileSystem->RemoveDir(buildPath_, true);
 
 
- #ifdef ATOMIC_PLATFORM_WINDOWS
-    String buildSourceDir = fileSystem->GetProgramDir();
- #else
-    String buildSourceDir = fileSystem->GetAppBundleResourceFolder();
- #endif
+    String dataPath = tsystem->GetDataPath();
 
 
-    buildSourceDir += "Deployment/MacOS/AtomicPlayer.app";
+    String appSrcPath = dataPath + "Atomic/Deployment/MacOS/AtomicPlayer.app";
 
 
     fileSystem->CreateDir(buildPath_);
     fileSystem->CreateDir(buildPath_);
 
 
@@ -78,10 +69,10 @@ void BuildMac::Build(const String& buildPath)
     String resourcePackagePath = buildPath_ + "/Contents/Resources/AtomicResources.pak";
     String resourcePackagePath = buildPath_ + "/Contents/Resources/AtomicResources.pak";
     GenerateResourcePackage(resourcePackagePath);
     GenerateResourcePackage(resourcePackagePath);
 
 
-    fileSystem->Copy(buildSourceDir + "/Contents/Resources/Atomic.icns", buildPath_ + "/Contents/Resources/Atomic.icns");
+    fileSystem->Copy(appSrcPath + "/Contents/Resources/Atomic.icns", buildPath_ + "/Contents/Resources/Atomic.icns");
 
 
-    fileSystem->Copy(buildSourceDir + "/Contents/Info.plist", buildPath_ + "/Contents/Info.plist");
-    fileSystem->Copy(buildSourceDir + "/Contents/MacOS/AtomicPlayer", buildPath_ + "/Contents/MacOS/AtomicPlayer");
+    fileSystem->Copy(appSrcPath + "/Contents/Info.plist", buildPath_ + "/Contents/Info.plist");
+    fileSystem->Copy(appSrcPath + "/Contents/MacOS/AtomicPlayer", buildPath_ + "/Contents/MacOS/AtomicPlayer");
 
 
 #ifdef ATOMIC_PLATFORM_OSX
 #ifdef ATOMIC_PLATFORM_OSX
     Vector<String> args;
     Vector<String> args;

+ 2 - 0
Source/ToolCore/Build/BuildMac.h

@@ -20,6 +20,8 @@ public:
     BuildMac(Context* context, Project* project);
     BuildMac(Context* context, Project* project);
     virtual ~BuildMac();
     virtual ~BuildMac();
 
 
+    String GetBuildSubfolder() { return "Mac-Build"; }
+
     void Build(const String& buildPath);
     void Build(const String& buildPath);
 
 
 protected:
 protected:

+ 2 - 0
Source/ToolCore/Build/BuildSettings.cpp

@@ -2,6 +2,7 @@
 // Please see LICENSE.md in repository root for license information
 // Please see LICENSE.md in repository root for license information
 // https://github.com/AtomicGameEngine/AtomicGameEngine
 // https://github.com/AtomicGameEngine/AtomicGameEngine
 
 
+/*
 #include "AtomicEditor.h"
 #include "AtomicEditor.h"
 #include <Atomic/Core/CoreEvents.h>
 #include <Atomic/Core/CoreEvents.h>
 #include "AtomicEditor.h"
 #include "AtomicEditor.h"
@@ -199,4 +200,5 @@ void BuildSettings::Save(rapidjson::PrettyWriter<rapidjson::FileStream>& writer)
 }
 }
 
 
 }
 }
+*/
 
 

+ 3 - 0
Source/ToolCore/Build/BuildSettings.h

@@ -4,6 +4,7 @@
 
 
 #pragma once
 #pragma once
 
 
+/*
 #include <rapidjson/document.h>
 #include <rapidjson/document.h>
 #include <rapidjson/filestream.h>
 #include <rapidjson/filestream.h>
 #include <rapidjson/prettywriter.h>
 #include <rapidjson/prettywriter.h>
@@ -103,3 +104,5 @@ private:
 };
 };
 
 
 }
 }
+
+*/

+ 18 - 13
Source/ToolCore/Build/BuildSystem.cpp

@@ -8,6 +8,10 @@
 #include <Atomic/IO/FileSystem.h>
 #include <Atomic/IO/FileSystem.h>
 #include <Atomic/IO/Log.h>
 #include <Atomic/IO/Log.h>
 
 
+#include "../ToolSystem.h"
+#include "../Project/Project.h"
+#include "../Project/ProjectUserPrefs.h"
+
 #include "BuildSystem.h"
 #include "BuildSystem.h"
 #include "BuildWeb.h"
 #include "BuildWeb.h"
 
 
@@ -18,7 +22,7 @@ namespace ToolCore
 BuildSystem::BuildSystem(Context* context) :
 BuildSystem::BuildSystem(Context* context) :
     Object(context)
     Object(context)
 {
 {
-    buildSettings_ = new BuildSettings(context);
+
 }
 }
 
 
 BuildSystem::~BuildSystem()
 BuildSystem::~BuildSystem()
@@ -26,6 +30,19 @@ BuildSystem::~BuildSystem()
 
 
 }
 }
 
 
+bool BuildSystem::StartNextBuild()
+{
+    if (!queuedBuilds_.Size())
+        return false;
+
+    SharedPtr<BuildBase> build = queuedBuilds_.Front();
+    queuedBuilds_.PopFront();
+
+    build->Build(buildPath_);
+
+    return true;
+}
+
 void BuildSystem::QueueBuild(BuildBase* buildBase)
 void BuildSystem::QueueBuild(BuildBase* buildBase)
 {
 {
     queuedBuilds_.Push(SharedPtr<BuildBase>(buildBase));
     queuedBuilds_.Push(SharedPtr<BuildBase>(buildBase));
@@ -43,17 +60,5 @@ void BuildSystem::BuildComplete(PlatformID platform, const String &buildFolder,
 }
 }
 
 
 
 
-void BuildSystem::LoadBuildSettings(rapidjson::Value::Member* jobject)
-{
-    buildSettings_->Load(jobject);
-}
-
-void BuildSystem::SaveBuildSettings(rapidjson::PrettyWriter<rapidjson::FileStream>& writer)
-{
-    buildSettings_->Save(writer);
-}
-
-
-
 
 
 }
 }

+ 4 - 7
Source/ToolCore/Build/BuildSystem.h

@@ -5,7 +5,6 @@
 #pragma once
 #pragma once
 
 
 #include <Atomic/Core/Object.h>
 #include <Atomic/Core/Object.h>
-#include "BuildSettings.h"
 #include "BuildBase.h"
 #include "BuildBase.h"
 
 
 #include "../Platform/Platform.h"
 #include "../Platform/Platform.h"
@@ -25,21 +24,19 @@ public:
     /// Destruct.
     /// Destruct.
     virtual ~BuildSystem();
     virtual ~BuildSystem();
 
 
-    BuildSettings* GetBuildSettings() { return buildSettings_; }
+    void SetBuildPath(const String& path) { buildPath_ = path; }
 
 
     void QueueBuild(BuildBase* buildBase);
     void QueueBuild(BuildBase* buildBase);
 
 
-    void LoadBuildSettings(rapidjson::Value::Member* jobject);
-    void SaveBuildSettings(rapidjson::PrettyWriter<rapidjson::FileStream>& writer);
+    bool StartNextBuild();
 
 
-    void ClearBuildCompleteUI();
     void BuildComplete(PlatformID platform, const String& buildFolder, bool success = true, bool fail3D = false);
     void BuildComplete(PlatformID platform, const String& buildFolder, bool success = true, bool fail3D = false);
 
 
 private:
 private:
 
 
-    List<SharedPtr<BuildBase>> queuedBuilds_;
+    String buildPath_;
 
 
-    SharedPtr<BuildSettings> buildSettings_;
+    List<SharedPtr<BuildBase>> queuedBuilds_;
     SharedPtr<BuildBase> currentBuild_;
     SharedPtr<BuildBase> currentBuild_;
 
 
 };
 };

+ 2 - 0
Source/ToolCore/Build/BuildWeb.h

@@ -22,6 +22,8 @@ public:
 
 
     void Build(const String& buildPath);
     void Build(const String& buildPath);
 
 
+    String GetBuildSubfolder() { return "Web-Build"; }
+
 protected:
 protected:
 
 
     void Initialize();
     void Initialize();

+ 13 - 2
Source/ToolCore/Command/BuildCmd.cpp

@@ -4,6 +4,7 @@
 #include <Atomic/IO/File.h>
 #include <Atomic/IO/File.h>
 
 
 #include "../ToolSystem.h"
 #include "../ToolSystem.h"
+#include "../Project/Project.h"
 #include "../Build/BuildSystem.h"
 #include "../Build/BuildSystem.h"
 
 
 #include "BuildCmd.h"
 #include "BuildCmd.h"
@@ -62,16 +63,26 @@ void BuildCmd::Run()
         return;
         return;
     }
     }
 
 
+    if (!project->ContainsPlatform(platform->GetPlatformID()))
+    {
+        Error(ToString("Project does not contain platform: %s", buildPlatform_.CString()));
+        return;
+    }
+
     // create the build
     // create the build
     BuildBase* buildBase = platform->NewBuild(project);
     BuildBase* buildBase = platform->NewBuild(project);
 
 
     // add it to the build system
     // add it to the build system
     BuildSystem* buildSystem = GetSubsystem<BuildSystem>();
     BuildSystem* buildSystem = GetSubsystem<BuildSystem>();
+
     buildSystem->QueueBuild(buildBase);
     buildSystem->QueueBuild(buildBase);
 
 
+    // TODO: parallel/serial builds
+    buildSystem->StartNextBuild();
+
     // clear the current platform
     // clear the current platform
-    tsystem->SetCurrentPlatform(PLATFORMID_UNDEFINED);
-    Finished();
+    //tsystem->SetCurrentPlatform(PLATFORMID_UNDEFINED);
+    //Finished();
 }
 }
 
 
 }
 }

+ 27 - 66
Source/ToolCore/Project/Project.cpp

@@ -12,6 +12,7 @@
 
 
 #include <Atomic/Resource/JSONFile.h>
 #include <Atomic/Resource/JSONFile.h>
 
 
+#include "../ToolSystem.h"
 #include "../Platform/Platform.h"
 #include "../Platform/Platform.h"
 
 
 #include "ProjectFile.h"
 #include "ProjectFile.h"
@@ -26,8 +27,10 @@ namespace ToolCore
 
 
 Project::Project(Context* context) :
 Project::Project(Context* context) :
     Object(context),
     Object(context),
+    loading_(false),
     dirty_(false)
     dirty_(false)
 {
 {
+    version_ = "1.0.0";
     userPrefs_ = new ProjectUserPrefs(context_);
     userPrefs_ = new ProjectUserPrefs(context_);
     buildSettings_ = new ProjectBuildSettings(context_);
     buildSettings_ = new ProjectBuildSettings(context_);
 }
 }
@@ -37,84 +40,33 @@ Project::~Project()
 
 
 }
 }
 
 
-void Project::LoadUserPrefs(const String& fullpath)
+void Project::SaveUserPrefs()
 {
 {
-    rapidjson::Document document;
 
 
-    File jsonFile(context_, fullpath);
-
-    if (!jsonFile.IsOpen())
-        return;
-
-    String json;
-    jsonFile.ReadText(json);
-
-    if (!json.Length())
-        return;
-
-    if (document.Parse<0>(json.CString()).HasParseError())
-    {
-        LOGERRORF("Could not parse Project JSON data from %s", fullpath.CString());
-        return;
-    }
-
-    const Value::Member* current_platform = document.FindMember("current_platform");
+}
 
 
-    /*
-    AEEditorPlatform platform = AE_PLATFORM_UNDEFINED;
-    if (current_platform && current_platform->value.IsString())
-    {
-        String splatform = current_platform->value.GetString();
-        if (splatform == "Windows")
-            platform = AE_PLATFORM_WINDOWS;
-        else if (splatform == "Mac")
-            platform = AE_PLATFORM_MAC;
-        else if (splatform == "HTML5")
-            platform = AE_PLATFORM_HTML5;
-        else if (splatform == "iOS")
-            platform = AE_PLATFORM_IOS;
-        else if (splatform == "Android")
-            platform = AE_PLATFORM_ANDROID;
-    }
-    if (platform == AE_PLATFORM_UNDEFINED)
-    {
-#ifdef ATOMIC_PLATFORM_OSX
-        platform = AE_PLATFORM_MAC;
-#else
-        platform = AE_PLATFORM_WINDOWS;
-#endif
-    }
-    */
+bool Project::LoadUserPrefs()
+{
+    ToolSystem* tsystem = GetSubsystem<ToolSystem>();
 
 
-    /*
-    const Value::Member* last_build_path = document.FindMember("last_build_path");
-    if (last_build_path && last_build_path->value.IsString())
+    // If we're in CLI mode, the Build folder is always relative to project
+    if (tsystem->IsCLI())
     {
     {
-        lastBuildPath_ = last_build_path->value.GetString();
+        String path = GetPath(projectFilePath_) + "Build";
+        userPrefs_->SetLastBuildPath(path);
     }
     }
-    */
-
-    // probably will want to move this, it will trigger a save (which is guarded with load_)
-    /*
-    Editor* editor = GetSubsystem<Editor>();
-    editor->RequestPlatformChange(platform);
-    */
 
 
+    return true;
 }
 }
 
 
-void Project::SaveUserPrefs(const String& fullpath)
+void Project::SaveBuildSettings()
 {
 {
 
 
 }
 }
 
 
-void Project::SaveBuildSettings(const String& path)
+bool Project::LoadBuildSettings()
 {
 {
-
-}
-
-bool Project::LoadBuildSettings(const String& path)
-{
-    return false;
+    return true;
 }
 }
 
 
 void Project::AddPlatform(PlatformID platformID)
 void Project::AddPlatform(PlatformID platformID)
@@ -122,7 +74,7 @@ void Project::AddPlatform(PlatformID platformID)
     if (ContainsPlatform(platformID))
     if (ContainsPlatform(platformID))
         return;
         return;
 
 
-    dirty_ = true;
+    SetDirty();
 
 
     platforms_.Push(platformID);
     platforms_.Push(platformID);
 
 
@@ -149,9 +101,18 @@ bool Project::ContainsPlatform(PlatformID platformID)
 
 
 bool Project::Load(const String& fullpath)
 bool Project::Load(const String& fullpath)
 {
 {
+    loading_ = true;
+
     projectFilePath_ = fullpath;
     projectFilePath_ = fullpath;
     SharedPtr<ProjectFile> pfile(new ProjectFile(context_));
     SharedPtr<ProjectFile> pfile(new ProjectFile(context_));
-    return pfile->Load(this);
+    bool result = pfile->Load(this);
+
+    loading_ = false;
+
+    LoadBuildSettings();
+    LoadUserPrefs();
+
+    return result;
 }
 }
 
 
 String Project::GetBuildSettingsFullPath()
 String Project::GetBuildSettingsFullPath()

+ 16 - 7
Source/ToolCore/Project/Project.h

@@ -40,30 +40,38 @@ public:
     const String& GetScriptsPath() { return scriptsPath_; }
     const String& GetScriptsPath() { return scriptsPath_; }
     const String& GetModulesPath() { return modulesPath_; }
     const String& GetModulesPath() { return modulesPath_; }
 
 
-    const String& GetProjectFilePath() { return projectFilePath_; }
-
     bool IsComponentsDirOrFile(const String& fullPath);
     bool IsComponentsDirOrFile(const String& fullPath);
     bool IsScriptsDirOrFile(const String& fullPath);
     bool IsScriptsDirOrFile(const String& fullPath);
     bool IsModulesDirOrFile(const String& fullPath);
     bool IsModulesDirOrFile(const String& fullPath);
 
 
-    void SaveBuildSettings(const String& path);
-    bool LoadBuildSettings(const String& path);
 
 
     void AddPlatform(PlatformID platformID);
     void AddPlatform(PlatformID platformID);
     bool ContainsPlatform(PlatformID platformID);
     bool ContainsPlatform(PlatformID platformID);
     void RemovePlatform(PlatformID platformID);
     void RemovePlatform(PlatformID platformID);
 
 
     bool IsDirty() { return dirty_; }
     bool IsDirty() { return dirty_; }
+    void SetDirty() { if (!loading_) dirty_ = true; }
 
 
-    ProjectBuildSettings* GetBuildSettings();
+    ProjectBuildSettings* GetBuildSettings() { return buildSettings_; }
+    ProjectUserPrefs* GetUserPrefs() { return userPrefs_; }
 
 
+    const String& GetProjectFilePath() { return projectFilePath_; }
     String GetUserPrefsFullPath();
     String GetUserPrefsFullPath();
     String GetBuildSettingsFullPath();
     String GetBuildSettingsFullPath();
 
 
+    const String& GetVersion() { return version_; }
+    void SetVersion(const String& version) { version_ = version; }
+
+    void SaveBuildSettings();
+    bool LoadBuildSettings();
+
+    void SaveUserPrefs();
+    bool LoadUserPrefs();
+
 private:
 private:
 
 
-    void LoadUserPrefs(const String& fullpath);
-    void SaveUserPrefs(const String& fullpath);
+
+    String version_;
 
 
     String projectFilePath_;
     String projectFilePath_;
     String resourcePath_;
     String resourcePath_;
@@ -72,6 +80,7 @@ private:
     String scriptsPath_;
     String scriptsPath_;
     String modulesPath_;
     String modulesPath_;
 
 
+    bool loading_;
     bool dirty_;
     bool dirty_;
 
 
     SharedPtr<ProjectUserPrefs> userPrefs_;
     SharedPtr<ProjectUserPrefs> userPrefs_;

+ 15 - 0
Source/ToolCore/Project/ProjectFile.cpp

@@ -32,8 +32,14 @@ void ProjectFile::Save(Project* project)
     SharedPtr<JSONFile> jsonFile(new JSONFile(context_));
     SharedPtr<JSONFile> jsonFile(new JSONFile(context_));
 
 
     JSONValue root = jsonFile->CreateRoot();
     JSONValue root = jsonFile->CreateRoot();
+
     root.SetInt("version", PROJECTFILE_VERSION);
     root.SetInt("version", PROJECTFILE_VERSION);
 
 
+    // project object
+
+    JSONValue jproject = root.CreateChild("project");
+    jproject.SetString("version", project_->GetVersion());
+
     // platforms
     // platforms
 
 
     JSONValue platforms = root.CreateChild("platforms", JSON_ARRAY);
     JSONValue platforms = root.CreateChild("platforms", JSON_ARRAY);
@@ -73,6 +79,15 @@ bool ProjectFile::Load(Project* project)
     if (version != PROJECTFILE_VERSION)
     if (version != PROJECTFILE_VERSION)
         return false;
         return false;
 
 
+    // project object
+    JSONValue jproject = root.GetChild("project");
+
+    if (jproject.IsObject())
+    {
+        String pversion = jproject.GetString("version");
+        project_->SetVersion(pversion);
+    }
+
     JSONValue platforms = root.GetChild("platforms");
     JSONValue platforms = root.GetChild("platforms");
     if (!platforms.IsArray())
     if (!platforms.IsArray())
         return false;
         return false;

+ 1 - 1
Source/ToolCore/Project/ProjectUserPrefs.cpp

@@ -6,7 +6,7 @@ namespace ToolCore
 
 
 ProjectUserPrefs::ProjectUserPrefs(Context* context) : Object(context)
 ProjectUserPrefs::ProjectUserPrefs(Context* context) : Object(context)
 {
 {
-
+    defaultPlatform_ = PLATFORMID_UNDEFINED;
 }
 }
 
 
 ProjectUserPrefs::~ProjectUserPrefs()
 ProjectUserPrefs::~ProjectUserPrefs()

+ 6 - 1
Source/ToolCore/Project/ProjectUserPrefs.h

@@ -5,6 +5,8 @@
 
 
 using namespace Atomic;
 using namespace Atomic;
 
 
+#include "../Platform/Platform.h"
+
 namespace ToolCore
 namespace ToolCore
 {
 {
 
 
@@ -18,11 +20,14 @@ public:
     /// Destruct.
     /// Destruct.
     virtual ~ProjectUserPrefs();
     virtual ~ProjectUserPrefs();
 
 
+    // platform used when not specified
+    PlatformID GetDefaultPlatform();
+
     const String& GetLastBuildPath() { return lastBuildPath_; }
     const String& GetLastBuildPath() { return lastBuildPath_; }
     void SetLastBuildPath(const String& path) { lastBuildPath_ = path; }
     void SetLastBuildPath(const String& path) { lastBuildPath_ = path; }
 
 
 private:
 private:
-
+    PlatformID defaultPlatform_;
     String lastBuildPath_;
     String lastBuildPath_;
 
 
 };
 };

+ 2 - 1
Source/ToolCore/ToolSystem.cpp

@@ -16,7 +16,8 @@
 namespace ToolCore
 namespace ToolCore
 {
 {
 
 
-ToolSystem::ToolSystem(Context* context) : Object(context)
+ToolSystem::ToolSystem(Context* context) : Object(context),
+    cli_(false)
 {
 {
 
 
     context_->RegisterSubsystem(new CurlManager(context_));
     context_->RegisterSubsystem(new CurlManager(context_));

+ 5 - 0
Source/ToolCore/ToolSystem.h

@@ -36,6 +36,9 @@ public:
     void SetCurrentPlatform(PlatformID platform);
     void SetCurrentPlatform(PlatformID platform);
     Platform* GetCurrentPlatform();
     Platform* GetCurrentPlatform();
 
 
+    void SetCLI() { cli_ = true; }
+    bool IsCLI() { return cli_; }
+
 private:
 private:
 
 
     /// Full path to data files
     /// Full path to data files
@@ -48,6 +51,8 @@ private:
 
 
     SharedPtr<Project> project_;
     SharedPtr<Project> project_;
 
 
+    bool cli_;
+
 };
 };
 
 
 }
 }