瀏覽代碼

Merge pull request #1069 from JimMarlowe/JM-DEPLOY-LINUX

Deployment for linux platform
JoshEngebretson 9 年之前
父節點
當前提交
f134f4d687

二進制
Resources/EditorData/AtomicEditor/editor/skin/logo_linux.png


+ 8 - 0
Resources/EditorData/AtomicEditor/editor/skin/skin.tb.txt

@@ -131,6 +131,9 @@ elements
 	LogoMac
 		bitmap logo_mac.png
 
+	LogoLinux
+		bitmap logo_linux.png
+
 	LogoWindows-Small
 		bitmap logo_windows.png
 		width 48
@@ -161,6 +164,11 @@ elements
 		width 48
 		height 48
 
+	LogoLinux-Small
+		bitmap logo_linux.png
+		width 48
+		height 48
+
 	Module2D-Small
 		bitmap module_2d.png
 		width 48

二進制
Resources/EditorData/AtomicEditor/editor/skin_light/logo_linux.png


+ 8 - 0
Resources/EditorData/AtomicEditor/editor/skin_light/skin.tb.txt

@@ -131,6 +131,9 @@ elements
 	LogoMac
 		bitmap logo_mac.png
 
+	LogoLinux
+		bitmap logo_linux.png
+
 	LogoWindows-Small
 		bitmap logo_windows.png
 		width 48
@@ -161,6 +164,11 @@ elements
 		width 48
 		height 48
 
+	LogoLinux-Small
+		bitmap logo_linux.png
+		width 48
+		height 48
+
 	Module2D-Small
 		bitmap module_2d.png
 		width 48

+ 22 - 0
Resources/EditorData/AtomicEditor/editor/ui/buildsettings_linux.tb.txt

@@ -0,0 +1,22 @@
+TBLayout: axis: y, distribution: gravity, position: left
+	TBSeparator: gravity: left right, skin: AESeparator
+	TBLayout: distribution: gravity
+		TBTextField: text: "App Name:"
+		TBLayout: gravity: left right, distribution-position: right bottom
+			TBEditField: id: app_name, autofocus: 1
+				lp: min-width: 220
+	TBLayout: distribution: gravity
+		TBTextField: text: "App Identifier:"
+		TBLayout: gravity: left right, distribution-position: right bottom
+			TBEditField: id: app_identifier, autofocus: 0
+				lp: min-width: 220
+	TBLayout: distribution: gravity
+		TBTextField: text: "Company Name:"
+		TBLayout: gravity: left right, distribution-position: right bottom
+			TBEditField: id: company_name, autofocus: 0
+				lp: min-width: 220
+	TBLayout: distribution: gravity
+		TBTextField: text: "Product Name:"
+		TBLayout: gravity: left right, distribution-position: right bottom
+			TBEditField: id: product_name, autofocus: 0
+				lp: min-width: 220

+ 10 - 2
Script/AtomicEditor/ui/modal/build/BuildSettingsWindow.ts

@@ -30,6 +30,7 @@ import MacSettingsWidget = require("./platforms/MacSettingsWidget");
 import AndroidSettingsWidget = require("./platforms/AndroidSettingsWidget");
 import IOSSettingsWidget = require("./platforms/IOSSettingsWidget");
 import WebSettingsWidget = require("./platforms/WebSettingsWidget");
+import LinuxSettingsWidget = require("./platforms/LinuxSettingsWidget");
 
 export interface BuildSettingsWidget {
 
@@ -58,14 +59,16 @@ export class BuildSettingsWindow extends ModalWindow {
         platformSource.addItem(new Atomic.UISelectItem("Android", "AndroidBuildSettings", "LogoAndroid"));
         platformSource.addItem(new Atomic.UISelectItem("iOS", "iOSBuildSettings", "LogoIOS"));
         platformSource.addItem(new Atomic.UISelectItem("WebGL", "WebGLBuildSettings", "LogoHTML5"));
+        platformSource.addItem(new Atomic.UISelectItem("Linux", "LinuxBuildSettings", "LogoLinux"));
 
         platformSelect.setSource(platformSource);
 
         var lp = new Atomic.UILayoutParams();
 
+        var myh = 74 * platformSource.getItemCount(); // 74 pixels per platform icon
         lp.minWidth = 160;
-        lp.minHeight = 370;
-        lp.maxHeight = 370;
+        lp.minHeight = myh;
+        lp.maxHeight = myh;
 
         platformSelect.layoutParams = lp;
         platformSelect.gravity = Atomic.UI_GRAVITY_ALL;
@@ -77,6 +80,7 @@ export class BuildSettingsWindow extends ModalWindow {
         this.addPlatformWidget("ANDROID", new AndroidSettingsWidget(), "LogoAndroid", 2);
         this.addPlatformWidget("IOS", new IOSSettingsWidget(), "LogoIOS", 3);
         this.addPlatformWidget("WEB", new WebSettingsWidget(), "LogoHTML5", 4);
+        this.addPlatformWidget("LINUX", new LinuxSettingsWidget(), "LogoLinux", 5);
 
         var currentPlatform = ToolCore.toolSystem.currentPlatform;
         this.setDisplayPlatform(currentPlatform);
@@ -188,6 +192,10 @@ export class BuildSettingsWindow extends ModalWindow {
                 this.setDisplayPlatform(toolSystem.getPlatformByName("WEB"));
                 return true;
             }
+            if (ev.refid == "LinuxBuildSettings") {
+                this.setDisplayPlatform(toolSystem.getPlatformByName("LINUX"));
+                return true;
+            }
 
         }
 

+ 2 - 0
Script/AtomicEditor/ui/modal/build/BuildWindow.ts

@@ -31,6 +31,7 @@ import MacSettingsWidget = require("./platforms/MacSettingsWidget");
 import AndroidSettingsWidget = require("./platforms/AndroidSettingsWidget");
 import IOSSettingsWidget = require("./platforms/IOSSettingsWidget");
 import WebSettingsWidget = require("./platforms/WebSettingsWidget");
+import LinuxSettingsWidget = require("./platforms/LinuxSettingsWidget");
 
 class BuildWindow extends ModalWindow {
 
@@ -54,6 +55,7 @@ class BuildWindow extends ModalWindow {
             case "ANDROID": this.platformIndicator.skinBg = "LogoAndroid"; break;
             case "IOS": this.platformIndicator.skinBg = "LogoIOS"; break;
             case "WEB": this.platformIndicator.skinBg = "LogoHTML5"; break;
+            case "LINUX": this.platformIndicator.skinBg = "LogoLinux"; break;
 
         }
 

+ 71 - 0
Script/AtomicEditor/ui/modal/build/platforms/LinuxSettingsWidget.ts

@@ -0,0 +1,71 @@
+//
+// Copyright (c) 2014-2016 THUNDERBEAST GAMES LLC
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+import BuildSettingsWindow = require("../BuildSettingsWindow");
+
+class LinuxSettingsWidget extends Atomic.UIWidget implements BuildSettingsWindow.BuildSettingsWidget {
+
+  constructor() {
+
+      super();
+
+      this.load("AtomicEditor/editor/ui/buildsettings_linux.tb.txt");
+
+      this.settings = ToolCore.toolSystem.project.buildSettings.linuxBuildSettings;
+
+      this.appNameEdit = <Atomic.UIEditField>this.getWidget("app_name");
+      this.packageNameEdit = <Atomic.UIEditField>this.getWidget("app_identifier");
+      this.productNameEdit = <Atomic.UIEditField>this.getWidget("product_name");
+      this.companyNameEdit = <Atomic.UIEditField>this.getWidget("company_name");
+
+      this.refreshWidgets();
+
+    }
+
+    refreshWidgets() {
+
+        this.appNameEdit.text = this.settings.appName;
+        this.packageNameEdit.text = this.settings.packageName;
+        this.productNameEdit.text = this.settings.productName;
+        this.companyNameEdit.text = this.settings.companyName;
+    }
+
+    storeValues() {
+
+        this.settings.appName = this.appNameEdit.text;
+        this.settings.packageName = this.packageNameEdit.text;
+        this.settings.productName = this.productNameEdit.text;
+        this.settings.companyName = this.companyNameEdit.text;
+
+    }
+
+    appNameEdit: Atomic.UIEditField;
+    packageNameEdit: Atomic.UIEditField;
+    productNameEdit: Atomic.UIEditField;
+    companyNameEdit: Atomic.UIEditField;
+
+    settings: ToolCore.LinuxBuildSettings;
+
+
+}
+
+export = LinuxSettingsWidget;

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

@@ -5,15 +5,15 @@
 						 	 "Source/ToolCore/Subprocess", "Source/ToolCore/NETTools"],
 	"classes" : ["ToolEnvironment", "ToolSystem", "ToolPrefs", "SubprocessSystem", "Subprocess",
 								"Project", "ProjectFile", "Platform", "PlatformMac", "PlatformWeb",
-							 "PlatformWindows", "PlatformAndroid", "PlatformIOS", "Command", "PlayCmd", "OpenAssetImporter",
+							 "PlatformWindows", "PlatformAndroid", "PlatformIOS", "PlatformLinux", "Command", "PlayCmd", "OpenAssetImporter",
 							 "Asset", "AssetDatabase", "AssetImporter", "AudioImporter", "ModelImporter", "MaterialImporter", "AnimationImportInfo",
 							 "PrefabImporter", "JavascriptImporter", "JSONImporter",
 							 "TextureImporter", "SpriterImporter", "PEXImporter", "CSharpImporter", "NETAssemblyImporter",
 							 "LicenseSystem",
 						 	 "ProjectUserPrefs", "ProjectBuildSettings",
 							 "NETProjectSystem",
-						 	 "BuildBase", "BuildSystem", "BuildMac", "BuildWeb", "BuildWindows", "BuildAndroid", "BuildIOS",
-						 	 "ProjectBuildSettings", "MacBuildSettings", "WindowsBuildSettings", "WebBuildSettings", "AndroidBuildSettings", "IOSBuildSettings"],
+						 	 "BuildBase", "BuildSystem", "BuildMac", "BuildWeb", "BuildWindows", "BuildAndroid", "BuildIOS", "BuildLinux",
+						 	 "ProjectBuildSettings", "MacBuildSettings", "WindowsBuildSettings", "WebBuildSettings", "AndroidBuildSettings", "IOSBuildSettings", "LinuxBuildSettings"],
 	"typescript_decl" : {
 
 		"ModelImporter" : [

+ 7 - 0
Script/ToolCore/build/BuildSettings.ts

@@ -71,4 +71,11 @@ class IOSBuildSettings {
     appIDPrefix: string;
 }
 
+class LinuxBuildSettings {
+    appName: string;
+    packageName: string;
+    companyName: string;
+    productName: string;
+}
+
 export = BuildSettings;

+ 178 - 0
Source/ToolCore/Build/BuildLinux.cpp

@@ -0,0 +1,178 @@
+//
+// Copyright (c) 2014-2016 THUNDERBEAST GAMES LLC
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+#include <Poco/File.h>
+#include <Atomic/Core/StringUtils.h>
+#include <Atomic/IO/Log.h>
+#include <Atomic/IO/FileSystem.h>
+#include <Atomic/Resource/ResourceCache.h>
+
+#include "../ToolSystem.h"
+#include "../ToolEnvironment.h"
+#include "../Project/Project.h"
+#include "../Project/ProjectSettings.h"
+#include "../Assets/AssetDatabase.h"
+
+#include "BuildLinux.h"
+#include "BuildSystem.h"
+#include "BuildEvents.h"
+
+namespace ToolCore
+{
+
+BuildLinux::BuildLinux(Context * context, Project *project) : BuildBase(context, project, PLATFORMID_LINUX)
+{
+
+}
+
+BuildLinux::~BuildLinux()
+{
+
+}
+
+void BuildLinux::Initialize()
+{
+    ToolSystem* tsystem = GetSubsystem<ToolSystem>();
+    Project* project = tsystem->GetProject();
+
+    Vector<String> defaultResourcePaths;
+    GetDefaultResourcePaths(defaultResourcePaths);
+    
+    for (unsigned i = 0; i < defaultResourcePaths.Size(); i++)
+    {
+        AddResourceDir(defaultResourcePaths[i]);
+    }
+    BuildDefaultResourceEntries();
+    
+    // Include the project resources and cache separately
+    AddProjectResourceDir(project->GetResourcePath());
+    AssetDatabase* db = GetSubsystem<AssetDatabase>();
+    String cachePath = db->GetCachePath();
+    AddProjectResourceDir(cachePath);
+
+    BuildProjectResourceEntries();
+}
+
+bool BuildLinux::CheckIncludeResourceFile(const String& resourceDir, const String& fileName)
+{
+    // #623 BEGIN TODO: Skip files that have a converted version in the cache
+    AssetDatabase* db = GetSubsystem<AssetDatabase>();
+    String cachePath = db->GetCachePath();
+    if (resourceDir != cachePath)
+    {
+        String ext = GetExtension(fileName);
+        if (ext == ".jpg" || ext == ".png" || ext == ".tga")
+        {
+            FileSystem* fileSystem = GetSubsystem<FileSystem>();
+            String compressedPath = cachePath + "DDS/" + fileName + ".dds";
+            if (fileSystem->FileExists(compressedPath))
+                return false;
+        }
+    }
+    // #623 END TODO
+    
+    return BuildBase::CheckIncludeResourceFile(resourceDir, fileName);
+}
+
+void BuildLinux::BuildNative(const String& buildPath)
+{
+    BuildLog("Building Linux Application");
+
+    ToolEnvironment* tenv = GetSubsystem<ToolEnvironment>();
+
+    String playerBinary = tenv->GetPlayerBinary();
+
+    if (!BuildCopyFile(playerBinary, buildPath_ + "/AtomicPlayer"))
+        return;
+    
+    // to perpetuate the execute bits on the executable
+    String copiedFile = buildPath_ + "/AtomicPlayer";
+    Poco::File deploy(copiedFile.CString());
+    if (deploy.exists())
+        deploy.setExecutable(true);
+}
+
+
+void BuildLinux::Build(const String& buildPath)
+{
+    BuildSystem* buildSystem = GetSubsystem<BuildSystem>();
+    FileSystem* fileSystem = GetSubsystem<FileSystem>();
+    ToolEnvironment* tenv = GetSubsystem<ToolEnvironment>();
+    ToolSystem* tsystem = GetSubsystem<ToolSystem>();
+    Project* project = tsystem->GetProject();
+
+    buildPath_ = AddTrailingSlash(buildPath);
+
+    if (!resourcesOnly_)
+        buildPath_ += GetBuildSubfolder();
+        
+    BuildLog("Starting Linux Deployment");
+
+    Initialize();
+
+    if (!resourcesOnly_ && !BuildClean(buildPath_))
+        return;
+
+    String rootSourceDir = tenv->GetRootSourceDir();        
+
+    if (!BuildCreateDirectory(buildPath_))
+        return;
+
+    if (!resourcesOnly_ && !BuildCreateDirectory(buildPath_ + "/AtomicPlayer_Resources"))
+        return;
+
+    String resourcePackagePath = buildPath_ + "/AtomicPlayer_Resources/AtomicResources" + PAK_EXTENSION;
+
+    if (resourcesOnly_)
+    {
+        resourcePackagePath = buildPath_ + "/AtomicResources" + PAK_EXTENSION;
+    }
+
+    GenerateResourcePackage(resourcePackagePath);
+
+    if (buildFailed_)
+        return;
+
+    if (resourcesOnly_)
+        return;
+
+    if (!BuildCreateDirectory(buildPath_ + "/Settings"))
+        return;
+
+    String engineJSON(GetSettingsDirectory() + "/Engine.json");
+
+    if (fileSystem->FileExists(engineJSON))
+    {
+        if (!BuildCopyFile(engineJSON, buildPath_ + "/Settings/Engine.json"))
+            return;
+    }
+
+    // TODO: only builds non-managed projects
+    BuildNative(buildPath);
+    
+    BuildLog("Linux Deployment Complete");
+
+    buildSystem->BuildComplete(PLATFORMID_LINUX, buildPath_);
+
+}
+
+}

+ 56 - 0
Source/ToolCore/Build/BuildLinux.h

@@ -0,0 +1,56 @@
+//
+// Copyright (c) 2014-2016 THUNDERBEAST GAMES LLC
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+#pragma once
+
+#include "BuildBase.h"
+
+namespace ToolCore
+{
+
+class Project;
+
+class BuildLinux : public BuildBase
+{
+    ATOMIC_OBJECT(BuildLinux, BuildBase);
+
+public:
+
+    BuildLinux(Context* context, Project* project);
+    virtual ~BuildLinux();
+
+    String GetBuildSubfolder() { return "Linux-Build"; }
+
+    void Build(const String& buildPath);
+
+protected:
+
+    void Initialize();
+    virtual bool CheckIncludeResourceFile(const String& resourceDir, const String& fileName);
+
+private:
+
+    void BuildNative(const String& buildPath);
+
+};
+
+}

+ 2 - 1
Source/ToolCore/Platform/Platform.h

@@ -39,7 +39,8 @@ enum PlatformID
     PLATFORMID_MAC,
     PLATFORMID_ANDROID,
     PLATFORMID_IOS,
-    PLATFORMID_WEB
+    PLATFORMID_WEB,
+    PLATFORMID_LINUX
 };
 
 class Platform : public Object

+ 45 - 0
Source/ToolCore/Platform/PlatformLinux.cpp

@@ -0,0 +1,45 @@
+//
+// Copyright (c) 2014-2016 THUNDERBEAST GAMES LLC
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+#include "../Project/Project.h"
+#include "../Build/BuildLinux.h"
+#include "PlatformLinux.h"
+
+namespace ToolCore
+{
+
+PlatformLinux::PlatformLinux(Context* context) : Platform(context)
+{
+
+}
+
+PlatformLinux::~PlatformLinux()
+{
+
+}
+
+BuildBase* PlatformLinux::NewBuild(Project *project)
+{
+    return new BuildLinux(context_, project);
+}
+
+}

+ 48 - 0
Source/ToolCore/Platform/PlatformLinux.h

@@ -0,0 +1,48 @@
+//
+// Copyright (c) 2014-2016 THUNDERBEAST GAMES LLC
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+#pragma once
+
+#include "Platform.h"
+
+namespace ToolCore
+{
+
+class PlatformLinux : public Platform
+{
+    ATOMIC_OBJECT(PlatformLinux, Platform);
+
+public:
+
+    PlatformLinux(Context* context);
+    virtual ~PlatformLinux();
+
+    String GetName() { return "LINUX"; }
+    PlatformID GetPlatformID() { return PLATFORMID_LINUX; }
+
+    BuildBase* NewBuild(Project* project);
+
+    virtual bool GetLicense() { return true; }
+
+};
+
+}

+ 33 - 1
Source/ToolCore/Project/ProjectBuildSettings.cpp

@@ -182,12 +182,42 @@ void IOSBuildSettings::Read(JSONValue& parent)
 
 }
 
+
+void LinuxBuildSettings::Write(JSONValue& parent)
+{
+    JSONValue json;
+
+    json.Set("appName", appName_);
+    json.Set("packageName", packageName_);
+    json.Set("companyName", companyName_);
+    json.Set("productName", productName_);
+
+    parent.Set("LinuxBuildSettings", json);
+
+}
+
+void LinuxBuildSettings::Read(JSONValue& parent)
+{
+    JSONValue json = parent.Get("LinuxBuildSettings");
+
+    if (!json.IsObject())
+        return;
+
+    appName_ = json.Get("appName").GetString();
+    packageName_ = json.Get("packageName").GetString();
+    companyName_ = json.Get("companyName").GetString();
+    productName_ = json.Get("productName").GetString();
+
+}
+
+
 ProjectBuildSettings::ProjectBuildSettings(Context* context) : Object(context),
     macBuildSettings_(new MacBuildSettings()),
     windowsBuildSettings_(new WindowsBuildSettings()),
     webBuildSettings_(new WebBuildSettings()),
     androidBuildSettings_(new AndroidBuildSettings()),
-    iosBuildSettings_(new IOSBuildSettings())
+    iosBuildSettings_(new IOSBuildSettings()),
+    linuxBuildSettings_(new LinuxBuildSettings())
 {
 
 }
@@ -219,6 +249,7 @@ bool ProjectBuildSettings::Load(const String& path)
     webBuildSettings_->Read(root);
     androidBuildSettings_->Read(root);
     iosBuildSettings_->Read(root);
+    linuxBuildSettings_->Read(root);
 
     return true;
 }
@@ -236,6 +267,7 @@ void ProjectBuildSettings::Save(const String& path)
     webBuildSettings_->Write(root);
     androidBuildSettings_->Write(root);
     iosBuildSettings_->Write(root);
+    linuxBuildSettings_->Write(root);
 
     jsonFile->Save(*file, String("   "));
 

+ 32 - 0
Source/ToolCore/Project/ProjectBuildSettings.h

@@ -199,6 +199,36 @@ private:
     String appidPrefix_;
 };
 
+class LinuxBuildSettings : public RefCounted
+{
+    ATOMIC_REFCOUNTED(LinuxBuildSettings)
+
+public:
+
+    LinuxBuildSettings() {}
+
+    const String& GetAppName() const { return appName_; }
+    const String& GetPackageName() const { return packageName_; }
+    const String& GetCompanyName() const { return companyName_; }
+    const String& GetProductName() const { return productName_; }
+
+    void SetAppName(const String& name) { appName_ = name; }
+    void SetPackageName(const String& packageName) { packageName_ = packageName; }
+    void SetCompanyName(const String& companyName) { companyName_ = companyName; }
+    void SetProductName(const String& productName) { productName_ = productName; }
+
+    void Write(JSONValue& parent);
+    void Read(JSONValue& parent);
+
+private:
+
+    String appName_;
+    String packageName_;
+    String companyName_;
+    String productName_;
+};
+
+
 class ProjectBuildSettings : public Object
 {
     ATOMIC_OBJECT(ProjectBuildSettings, Object);
@@ -214,6 +244,7 @@ public:
     WebBuildSettings* GetWebBuildSettings() { return webBuildSettings_; }
     AndroidBuildSettings* GetAndroidBuildSettings() { return androidBuildSettings_; }
     IOSBuildSettings* GetIOSBuildSettings() { return iosBuildSettings_; }
+    LinuxBuildSettings* GetLinuxBuildSettings() { return linuxBuildSettings_; }
 
     bool Load(const String& path);
     void Save(const String& path);
@@ -225,6 +256,7 @@ private:
     SharedPtr<WebBuildSettings> webBuildSettings_;
     SharedPtr<AndroidBuildSettings> androidBuildSettings_;
     SharedPtr<IOSBuildSettings> iosBuildSettings_;
+    SharedPtr<LinuxBuildSettings> linuxBuildSettings_;
 
 };
 

+ 5 - 0
Source/ToolCore/Project/ProjectSettings.cpp

@@ -47,6 +47,11 @@ namespace ToolCore
         return platforms_.Contains("web");
     }
 
+    bool ProjectSettings::GetSupportsLinux() const
+    {
+        return platforms_.Contains("linux");
+    }
+
     bool ProjectSettings::GetSupportsPlatform(const String& platform) const
     {
         return platforms_.Contains(platform);

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

@@ -85,6 +85,7 @@ namespace ToolCore
         bool GetSupportsAndroid() const;
         bool GetSupportsIOS() const;
         bool GetSupportsWeb() const;
+        bool GetSupportsLinux() const;
 
         void AddSupportedPlatform(const String& platform);
 

+ 3 - 4
Source/ToolCore/ToolEnvironment.cpp

@@ -57,17 +57,16 @@ bool ToolEnvironment::InitFromPackage()
 #ifdef ATOMIC_PLATFORM_WINDOWS
     editorBinary_ = fileSystem->GetProgramDir() + "AtomicEditor.exe";
     String resourcesDir = fileSystem->GetProgramDir() + "Resources/";
+    playerBinary_ = resourcesDir + "ToolData/Deployment/Windows/x64/AtomicPlayer.exe";
 #elif ATOMIC_PLATFORM_LINUX
     editorBinary_ = fileSystem->GetProgramDir() + "AtomicEditor";
     String resourcesDir = fileSystem->GetProgramDir() + "Resources/";
+    playerBinary_ = resourcesDir + "ToolData/Deployment/Linux/AtomicPlayer";
 #else
     editorBinary_ = fileSystem->GetProgramDir() + "AtomicEditor";
     String resourcesDir = GetPath(RemoveTrailingSlash(fileSystem->GetProgramDir())) + "Resources/";
-#endif
-
-    //TODO: move this to deployment stuff
     playerAppFolder_ = resourcesDir + "ToolData/Deployment/MacOS/AtomicPlayer.app/";
-    playerBinary_ = resourcesDir + "ToolData/Deployment/Windows/x64/AtomicPlayer.exe";
+#endif
 
     resourceCoreDataDir_ = resourcesDir + "CoreData";
     resourcePlayerDataDir_ = resourcesDir + "PlayerData";

+ 2 - 0
Source/ToolCore/ToolSystem.cpp

@@ -30,6 +30,7 @@
 #include "Platform/PlatformWindows.h"
 #include "Platform/PlatformAndroid.h"
 #include "Platform/PlatformIOS.h"
+#include "Platform/PlatformLinux.h"
 
 #include "Assets/AssetDatabase.h"
 #include "Net/CurlManager.h"
@@ -64,6 +65,7 @@ ToolSystem::ToolSystem(Context* context) : Object(context),
     RegisterPlatform(new PlatformWindows(context));
     RegisterPlatform(new PlatformIOS(context));
     RegisterPlatform(new PlatformAndroid(context));
+    RegisterPlatform(new PlatformLinux(context));
 
     SubscribeToEvent(E_UPDATE, ATOMIC_HANDLER(ToolSystem, HandleUpdate));
 }