From ebdae96290085483d2b5aeaf56c0bdeaaffd95ea Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 31 Oct 2017 12:54:44 +0200 Subject: Change Tango.NET to Visual Studio --- Software/Tango.NET/Tango.Core/AssemblyHelper.cs | 21 ---- Software/Tango.NET/Tango.Core/PathHelper.cs | 32 ------ .../Tango.Core/Properties/AssemblyInfo.cs | 6 - Software/Tango.NET/Tango.Core/Tango.Core.csproj | 48 -------- .../Tango.Protobuf/Compilers/CSharpCompiler.cs | 18 --- .../Tango.NET/Tango.Protobuf/IProtoCompiler.cs | 38 ------- .../Tango.Protobuf/Properties/AssemblyInfo.cs | 6 - Software/Tango.NET/Tango.Protobuf/ProtoCompiler.cs | 124 --------------------- Software/Tango.NET/Tango.Protobuf/ProtoLanguage.cs | 36 ------ Software/Tango.NET/Tango.Protobuf/ProtoResult.cs | 51 --------- .../Tango.NET/Tango.Protobuf/Tango.Protobuf.csproj | 71 ------------ Software/Tango.NET/Tango.sln | 33 ------ Software/Tango.NET/Versioning/GlobalVersionInfo.cs | 13 --- 13 files changed, 497 deletions(-) delete mode 100644 Software/Tango.NET/Tango.Core/AssemblyHelper.cs delete mode 100644 Software/Tango.NET/Tango.Core/PathHelper.cs delete mode 100644 Software/Tango.NET/Tango.Core/Properties/AssemblyInfo.cs delete mode 100644 Software/Tango.NET/Tango.Core/Tango.Core.csproj delete mode 100644 Software/Tango.NET/Tango.Protobuf/Compilers/CSharpCompiler.cs delete mode 100644 Software/Tango.NET/Tango.Protobuf/IProtoCompiler.cs delete mode 100644 Software/Tango.NET/Tango.Protobuf/Properties/AssemblyInfo.cs delete mode 100644 Software/Tango.NET/Tango.Protobuf/ProtoCompiler.cs delete mode 100644 Software/Tango.NET/Tango.Protobuf/ProtoLanguage.cs delete mode 100644 Software/Tango.NET/Tango.Protobuf/ProtoResult.cs delete mode 100644 Software/Tango.NET/Tango.Protobuf/Tango.Protobuf.csproj delete mode 100644 Software/Tango.NET/Tango.sln delete mode 100644 Software/Tango.NET/Versioning/GlobalVersionInfo.cs (limited to 'Software/Tango.NET') diff --git a/Software/Tango.NET/Tango.Core/AssemblyHelper.cs b/Software/Tango.NET/Tango.Core/AssemblyHelper.cs deleted file mode 100644 index 5a78f9fe3..000000000 --- a/Software/Tango.NET/Tango.Core/AssemblyHelper.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.Core -{ - public static class AssemblyHelper - { - public static String GetCurrentAssemblyFolder() - { - string codeBase = Assembly.GetExecutingAssembly().CodeBase; - UriBuilder uri = new UriBuilder(codeBase); - string path = Uri.UnescapeDataString(uri.Path); - return Path.GetDirectoryName(path); - } - } -} diff --git a/Software/Tango.NET/Tango.Core/PathHelper.cs b/Software/Tango.NET/Tango.Core/PathHelper.cs deleted file mode 100644 index 08dbf1c16..000000000 --- a/Software/Tango.NET/Tango.Core/PathHelper.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.Core -{ - public static class PathHelper - { - public static String GetTempFolderPath() - { - String tempDirectory = Path.Combine(Path.GetTempPath(), "Twine", Path.GetRandomFileName()); - Directory.CreateDirectory(tempDirectory); - return tempDirectory; - } - - public static bool TryDeleteFolder(String path) - { - try - { - Directory.Delete(path, true); - return true; - } - catch - { - return false; - } - } - } -} diff --git a/Software/Tango.NET/Tango.Core/Properties/AssemblyInfo.cs b/Software/Tango.NET/Tango.Core/Properties/AssemblyInfo.cs deleted file mode 100644 index f76af4bb8..000000000 --- a/Software/Tango.NET/Tango.Core/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("Twine - Core Components")] -[assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Tango.NET/Tango.Core/Tango.Core.csproj b/Software/Tango.NET/Tango.Core/Tango.Core.csproj deleted file mode 100644 index 803d9e3e6..000000000 --- a/Software/Tango.NET/Tango.Core/Tango.Core.csproj +++ /dev/null @@ -1,48 +0,0 @@ - - - - - Debug - AnyCPU - {A34EE0F0-649D-41C8-8489-B6F1CC6924EE} - Library - Properties - Tango.Core - Tango.Core - v4.5 - 512 - - - true - full - false - ..\Build\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Software/Tango.NET/Tango.Protobuf/Compilers/CSharpCompiler.cs b/Software/Tango.NET/Tango.Protobuf/Compilers/CSharpCompiler.cs deleted file mode 100644 index 4f9e52a74..000000000 --- a/Software/Tango.NET/Tango.Protobuf/Compilers/CSharpCompiler.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.Protobuf.Compilers -{ - public class CSharpCompiler : ProtoCompiler - { - public override ProtoLanguage Language => ProtoLanguage.CSharp; - - protected override string GetProtoArguments() - { - return "--csharp_out"; - } - } -} diff --git a/Software/Tango.NET/Tango.Protobuf/IProtoCompiler.cs b/Software/Tango.NET/Tango.Protobuf/IProtoCompiler.cs deleted file mode 100644 index 3d7e05411..000000000 --- a/Software/Tango.NET/Tango.Protobuf/IProtoCompiler.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.Protobuf -{ - /// - /// Represents a protobuf messages compiler. - /// - public interface IProtoCompiler : IDisposable - { - /// - /// Compiles the specified .proto message file and saves the result at the specified output folder. - /// - /// .proto file to compile - /// A list of compiled results. - IEnumerable Compile(String inputFile); - - /// - /// Compiles the specified .proto message file asynchronously and saves the result at the specified output folder. - /// - /// .proto file to compile - /// A list of compiled results. - Task> CompileAsync(String inputFile); - - /// - /// Gets the compiler language. - /// - ProtoLanguage Language { get; } - - /// - /// Gets the proto imports folders. - /// - List ImportsFolders { get; } - } -} diff --git a/Software/Tango.NET/Tango.Protobuf/Properties/AssemblyInfo.cs b/Software/Tango.NET/Tango.Protobuf/Properties/AssemblyInfo.cs deleted file mode 100644 index 37ad6afb4..000000000 --- a/Software/Tango.NET/Tango.Protobuf/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("Twine - Protobuf Components")] -[assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Tango.NET/Tango.Protobuf/ProtoCompiler.cs b/Software/Tango.NET/Tango.Protobuf/ProtoCompiler.cs deleted file mode 100644 index eedebf63b..000000000 --- a/Software/Tango.NET/Tango.Protobuf/ProtoCompiler.cs +++ /dev/null @@ -1,124 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using Tango.Core; - -namespace Tango.Protobuf -{ - /// - /// Represents a protobuf compiler base class. - /// - /// - public abstract class ProtoCompiler : IProtoCompiler - { - private const String COMPILERS_FOLDER_NAME = "ProtoCompilers"; //Compilers folder name. - protected String _compilersPath; //Compilers folder path. - - /// - /// Gets the compiler language. - /// - public abstract ProtoLanguage Language { get; } - - /// - /// Gets the proto imports folders. - /// - public List ImportsFolders { get; private set; } - - /// - /// Initializes a new instance of the class. - /// - public ProtoCompiler() - { - _compilersPath = Path.Combine(AssemblyHelper.GetCurrentAssemblyFolder(), COMPILERS_FOLDER_NAME); - } - - /// - /// Compiles the specified .proto message file and saves the result at the specified output folder. - /// - /// .proto file to compile - /// - /// A list of compiled results. - /// - public virtual IEnumerable Compile(string inputFile) - { - String tmpPath = PathHelper.GetTempFolderPath(); - - String importsString = String.Empty; - - foreach (var path in ImportsFolders) - { - importsString = "--proto_path \"" + path + "\" "; - } - - Process p = new Process(); - p.StartInfo.FileName = Path.Combine(_compilersPath, GetProtoCompilerName()); - p.StartInfo.Arguments = String.Format( - "{0} {1}=\"{2}\" \"{3}\"", - importsString, - GetProtoArguments(), - tmpPath, - inputFile); - - p.StartInfo.CreateNoWindow = true; - p.StartInfo.UseShellExecute = false; - p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; - - p.Start(); - p.WaitForExit(5000); - - List results = new List(); - - foreach (var file in Directory.GetFiles(tmpPath)) - { - ProtoResult result = new ProtoResult(Path.GetFileName(file), File.ReadAllText(file), Language); - } - - PathHelper.TryDeleteFolder(tmpPath); - - return results; - } - - /// - /// Compiles the specified .proto message file asynchronously and saves the result at the specified output folder. - /// - /// .proto file to compile - /// - /// A list of compiled results. - /// - public async Task> CompileAsync(string inputFile) - { - return await new Task>(() => { return Compile(inputFile); }); - } - - /// - /// Gets the protobuf compiler CLI arguments (without input/output files!). - /// - /// - protected abstract String GetProtoArguments(); - - /// - /// Gets the protobuf compiler CLI file name (override when using a compiler other than the default 'protoc.exe'). - /// - /// - /// The compiler program must be located in the compilers folder. - /// - /// - protected virtual String GetProtoCompilerName() - { - return "protoc.exe"; - } - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// - public void Dispose() - { - //TODO: Dispose... - } - } -} diff --git a/Software/Tango.NET/Tango.Protobuf/ProtoLanguage.cs b/Software/Tango.NET/Tango.Protobuf/ProtoLanguage.cs deleted file mode 100644 index 0a53a3c01..000000000 --- a/Software/Tango.NET/Tango.Protobuf/ProtoLanguage.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.Protobuf -{ - /// - /// Represents an enumeration for available protobuf compiler languages. - /// - public enum ProtoLanguage - { - [Description("C#")] - CSharp, - [Description("Java")] - Java, - [Description("Java Nano")] - JavaNano, - [Description("C++")] - CPP, - [Description("C")] - C, - [Description("Embedded C")] - EmbeddedC, - [Description("JavaScript")] - JS, - [Description("Python")] - Python, - [Description("PHP")] - PHP, - [Description("Ruby")] - Ruby, - } -} diff --git a/Software/Tango.NET/Tango.Protobuf/ProtoResult.cs b/Software/Tango.NET/Tango.Protobuf/ProtoResult.cs deleted file mode 100644 index 5b35f9b5a..000000000 --- a/Software/Tango.NET/Tango.Protobuf/ProtoResult.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.Protobuf -{ - /// - /// Represents a single protobuf compile result. - /// - public class ProtoResult - { - /// - /// Gets the compiled language. - /// - public ProtoLanguage Language { get; private set; } - - /// - /// Gets the name of the file. - /// - /// Gets the file content. - /// - public String Content { get; private set; } - - /// - /// Initializes a new instance of the class. - /// - /// Name of the file. - /// The content. - /// The language. - public ProtoResult(String fileName, String content, ProtoLanguage language) - { - FileName = fileName; - Content = content; - Language = language; - } - - /// - /// Saves the result to the specified folder. - /// - /// The folder. - public void Save(String folder) - { - - } - } -} diff --git a/Software/Tango.NET/Tango.Protobuf/Tango.Protobuf.csproj b/Software/Tango.NET/Tango.Protobuf/Tango.Protobuf.csproj deleted file mode 100644 index 80caa9c98..000000000 --- a/Software/Tango.NET/Tango.Protobuf/Tango.Protobuf.csproj +++ /dev/null @@ -1,71 +0,0 @@ - - - - - Debug - AnyCPU - {40073806-914E-4E78-97AB-FA9639308EBE} - Library - Properties - Tango.Protobuf - Tango.Protobuf - v4.5 - 512 - - - true - full - false - ..\Build\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - Utils\protoc-1.0M4.jar - PreserveNewest - - - Utils\protoc-c.exe - PreserveNewest - - - Utils\protoc.exe - PreserveNewest - - - - - {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} - Tango.Core - - - - \ No newline at end of file diff --git a/Software/Tango.NET/Tango.sln b/Software/Tango.NET/Tango.sln deleted file mode 100644 index dbcaa7e2a..000000000 --- a/Software/Tango.NET/Tango.sln +++ /dev/null @@ -1,33 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.16 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.Protobuf", "Tango.Protobuf\Tango.Protobuf.csproj", "{40073806-914E-4E78-97AB-FA9639308EBE}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Versioning", "Versioning", "{E53A5748-F312-4A70-AB93-53249749D359}" - ProjectSection(SolutionItems) = preProject - Versioning\GlobalVersionInfo.cs = Versioning\GlobalVersionInfo.cs - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.Core", "Tango.Core\Tango.Core.csproj", "{A34EE0F0-649D-41C8-8489-B6F1CC6924EE}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {40073806-914E-4E78-97AB-FA9639308EBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {40073806-914E-4E78-97AB-FA9639308EBE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {40073806-914E-4E78-97AB-FA9639308EBE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {40073806-914E-4E78-97AB-FA9639308EBE}.Release|Any CPU.Build.0 = Release|Any CPU - {A34EE0F0-649D-41C8-8489-B6F1CC6924EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A34EE0F0-649D-41C8-8489-B6F1CC6924EE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A34EE0F0-649D-41C8-8489-B6F1CC6924EE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A34EE0F0-649D-41C8-8489-B6F1CC6924EE}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Software/Tango.NET/Versioning/GlobalVersionInfo.cs b/Software/Tango.NET/Versioning/GlobalVersionInfo.cs deleted file mode 100644 index a1208cae9..000000000 --- a/Software/Tango.NET/Versioning/GlobalVersionInfo.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - - -[assembly: AssemblyProduct("Tango")] - -[assembly: AssemblyCompany("Twine")] -[assembly: AssemblyCopyright("Copyright © Twine LTD 2017")] -[assembly: AssemblyTrademark("Twine LTD")] - -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] -- cgit v1.3.1