Browse Source

Working on NET Project subsystem

Josh Engebretson 9 years ago
parent
commit
3279e48ae3

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

@@ -2,7 +2,7 @@
 	"name" : "ToolCore",
 	"sources" : ["Source/ToolCore", "Source/ToolCore/Project", "Source/ToolCore/Platform", "Source/ToolCore/Command",
 							 "Source/ToolCore/Import", "Source/ToolCore/Assets", "Source/ToolCore/License", "Source/ToolCore/Build",
-						 	 "Source/ToolCore/Subprocess"],
+						 	 "Source/ToolCore/Subprocess", "Source/ToolCore/NETTools"],
 	"classes" : ["ToolEnvironment", "ToolSystem", "ToolPrefs", "SubprocessSystem", "Subprocess",
 								"Project", "ProjectFile", "Platform", "PlatformMac", "PlatformWeb",
 							 "PlatformWindows", "PlatformAndroid", "PlatformIOS", "Command", "PlayCmd", "OpenAssetImporter",
@@ -11,6 +11,7 @@
 							 "TextureImporter", "SpriterImporter", "PEXImporter", "CSharpImporter", "NETAssemblyImporter",
 							 "LicenseSystem",
 						 	 "ProjectUserPrefs", "ProjectBuildSettings",
+							 "NETProjectSystem",
 						 	 "BuildBase", "BuildSystem", "BuildMac", "BuildWeb", "BuildWindows", "BuildAndroid", "BuildIOS",
 						 	 "ProjectBuildSettings", "MacBuildSettings", "WindowsBuildSettings", "WebBuildSettings", "AndroidBuildSettings", "IOSBuildSettings"],
 	"typescript_decl" : {

+ 3 - 1
Source/AtomicEditor/EditorMode/AEEditorNETService.cpp

@@ -25,7 +25,7 @@
 
 #include <AtomicNET/NETScript/NETScript.h>
 
-
+#include <ToolCore/NETTools/NETProjectSystem.h>
 #include <ToolCore/NETTools/AtomicNETService.h>
 #include "AEEditorNETService.h"
 
@@ -49,6 +49,8 @@ namespace AtomicEditor
     {
         RegisterNETScriptLibrary(context_);
 
+        context_->RegisterSubsystem(new NETProjectSystem(context_));
+
         netService_ = new AtomicNETService(context_);
 
         if (!netService_->Start())

+ 65 - 0
Source/ToolCore/NETTools/NETProjectSystem.cpp

@@ -0,0 +1,65 @@
+//
+// 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/Environment.h>
+
+#include <Atomic/IO/Log.h>
+#include <Atomic/IO/FileSystem.h>
+
+#include "NETProjectSystem.h"
+
+namespace ToolCore
+{
+
+    NETProjectSystem::NETProjectSystem(Context* context) :
+        Object(context)
+    {
+        Initialize();
+    }
+
+    NETProjectSystem::~NETProjectSystem()
+    {
+
+    }
+
+    void NETProjectSystem::Initialize()
+    
+    {
+#ifdef ATOMIC_PLATFORM_WINDOWS
+
+        FileSystem* fileSystem = GetSubsystem<FileSystem>();
+
+        // Query for Visual Studio 2015 path
+        String visualStudioPath_ = Poco::Environment::get("VS140COMNTOOLS").c_str();
+
+        if (visualStudioPath_.Length())
+        {
+            visualStudioPath_.Replace("Tools\\", "IDE\\devenv.exe");
+
+            if (!fileSystem->FileExists(visualStudioPath_))
+                visualStudioPath_.Clear();
+        }
+
+    }
+#endif
+
+}

+ 59 - 0
Source/ToolCore/NETTools/NETProjectSystem.h

@@ -0,0 +1,59 @@
+//
+// 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 <Atomic/Core/Object.h>
+
+using namespace Atomic;
+
+namespace ToolCore
+{
+    // AtomicProject.dll state (this shouldn't be in resources too)
+
+    enum NETProjectState
+    {
+        NETPROJECT_CLEAN,
+        NETPROJECT_DIRTY,
+        NETPROJECT_ERROR
+    };
+
+    class NETProjectSystem : public Object
+    {
+        OBJECT(NETProjectSystem)
+
+    public:
+
+        NETProjectSystem(Context* context);
+        virtual ~NETProjectSystem();
+
+        bool GetVisualStudioAvailable() const { return visualStudioPath_.Length() != 0; }
+
+    private:
+
+        void Initialize();
+
+        String visualStudioPath_;
+
+    };
+
+}