diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2017-10-31 12:54:44 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2017-10-31 12:54:44 +0200 |
| commit | ebdae96290085483d2b5aeaf56c0bdeaaffd95ea (patch) | |
| tree | 010fdf909fdad9152ad2befe9f1a42fa721f9f0d /Software/Tango.NET | |
| parent | 4fbe47ccac2bdcae52aafa07d6a80176e9606bd9 (diff) | |
| download | Tango-ebdae96290085483d2b5aeaf56c0bdeaaffd95ea.tar.gz Tango-ebdae96290085483d2b5aeaf56c0bdeaaffd95ea.zip | |
Change Tango.NET to Visual Studio
Diffstat (limited to 'Software/Tango.NET')
| -rw-r--r-- | Software/Tango.NET/Tango.Core/AssemblyHelper.cs | 21 | ||||
| -rw-r--r-- | Software/Tango.NET/Tango.Core/PathHelper.cs | 32 | ||||
| -rw-r--r-- | Software/Tango.NET/Tango.Core/Properties/AssemblyInfo.cs | 6 | ||||
| -rw-r--r-- | Software/Tango.NET/Tango.Core/Tango.Core.csproj | 48 | ||||
| -rw-r--r-- | Software/Tango.NET/Tango.Protobuf/Compilers/CSharpCompiler.cs | 18 | ||||
| -rw-r--r-- | Software/Tango.NET/Tango.Protobuf/IProtoCompiler.cs | 38 | ||||
| -rw-r--r-- | Software/Tango.NET/Tango.Protobuf/Properties/AssemblyInfo.cs | 6 | ||||
| -rw-r--r-- | Software/Tango.NET/Tango.Protobuf/ProtoCompiler.cs | 124 | ||||
| -rw-r--r-- | Software/Tango.NET/Tango.Protobuf/ProtoLanguage.cs | 36 | ||||
| -rw-r--r-- | Software/Tango.NET/Tango.Protobuf/ProtoResult.cs | 51 | ||||
| -rw-r--r-- | Software/Tango.NET/Tango.Protobuf/Tango.Protobuf.csproj | 71 | ||||
| -rw-r--r-- | Software/Tango.NET/Tango.sln | 33 | ||||
| -rw-r--r-- | Software/Tango.NET/Versioning/GlobalVersionInfo.cs | 13 |
13 files changed, 0 insertions, 497 deletions
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 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProjectGuid>{A34EE0F0-649D-41C8-8489-B6F1CC6924EE}</ProjectGuid> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>Tango.Core</RootNamespace> - <AssemblyName>Tango.Core</AssemblyName> - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> - <FileAlignment>512</FileAlignment> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>..\Build\Debug\</OutputPath> - <DefineConstants>DEBUG;TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <ItemGroup> - <Reference Include="System" /> - <Reference Include="System.Core" /> - <Reference Include="System.Xml.Linq" /> - <Reference Include="System.Data.DataSetExtensions" /> - <Reference Include="Microsoft.CSharp" /> - <Reference Include="System.Data" /> - <Reference Include="System.Net.Http" /> - <Reference Include="System.Xml" /> - </ItemGroup> - <ItemGroup> - <Compile Include="AssemblyHelper.cs" /> - <Compile Include="PathHelper.cs" /> - <Compile Include="Properties\AssemblyInfo.cs" /> - </ItemGroup> - <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -</Project>
\ 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 -{ - /// <summary> - /// Represents a protobuf messages compiler. - /// </summary> - public interface IProtoCompiler : IDisposable - { - /// <summary> - /// Compiles the specified .proto message file and saves the result at the specified output folder. - /// </summary> - /// <param name="inputFile">.proto file to compile</param> - /// <returns>A list of compiled results.</returns> - IEnumerable<ProtoResult> Compile(String inputFile); - - /// <summary> - /// Compiles the specified .proto message file asynchronously and saves the result at the specified output folder. - /// </summary> - /// <param name="inputFile">.proto file to compile</param> - /// <returns>A list of compiled results.</returns> - Task<IEnumerable<ProtoResult>> CompileAsync(String inputFile); - - /// <summary> - /// Gets the compiler language. - /// </summary> - ProtoLanguage Language { get; } - - /// <summary> - /// Gets the proto imports folders. - /// </summary> - List<String> 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 -{ - /// <summary> - /// Represents a protobuf compiler base class. - /// </summary> - /// <seealso cref="Tango.Protobuf.IProtoCompiler" /> - public abstract class ProtoCompiler : IProtoCompiler - { - private const String COMPILERS_FOLDER_NAME = "ProtoCompilers"; //Compilers folder name. - protected String _compilersPath; //Compilers folder path. - - /// <summary> - /// Gets the compiler language. - /// </summary> - public abstract ProtoLanguage Language { get; } - - /// <summary> - /// Gets the proto imports folders. - /// </summary> - public List<String> ImportsFolders { get; private set; } - - /// <summary> - /// Initializes a new instance of the <see cref="ProtoCompiler"/> class. - /// </summary> - public ProtoCompiler() - { - _compilersPath = Path.Combine(AssemblyHelper.GetCurrentAssemblyFolder(), COMPILERS_FOLDER_NAME); - } - - /// <summary> - /// Compiles the specified .proto message file and saves the result at the specified output folder. - /// </summary> - /// <param name="inputFile">.proto file to compile</param> - /// <returns> - /// A list of compiled results. - /// </returns> - public virtual IEnumerable<ProtoResult> 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<ProtoResult> results = new List<ProtoResult>(); - - foreach (var file in Directory.GetFiles(tmpPath)) - { - ProtoResult result = new ProtoResult(Path.GetFileName(file), File.ReadAllText(file), Language); - } - - PathHelper.TryDeleteFolder(tmpPath); - - return results; - } - - /// <summary> - /// Compiles the specified .proto message file asynchronously and saves the result at the specified output folder. - /// </summary> - /// <param name="inputFile">.proto file to compile</param> - /// <returns> - /// A list of compiled results. - /// </returns> - public async Task<IEnumerable<ProtoResult>> CompileAsync(string inputFile) - { - return await new Task<IEnumerable<ProtoResult>>(() => { return Compile(inputFile); }); - } - - /// <summary> - /// Gets the protobuf compiler CLI arguments (without input/output files!). - /// </summary> - /// <returns></returns> - protected abstract String GetProtoArguments(); - - /// <summary> - /// Gets the protobuf compiler CLI file name (override when using a compiler other than the default 'protoc.exe'). - /// </summary> - /// <remarks> - /// The compiler program must be located in the compilers folder. - /// </remarks> - /// <returns></returns> - protected virtual String GetProtoCompilerName() - { - return "protoc.exe"; - } - - /// <summary> - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// </summary> - 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 -{ - /// <summary> - /// Represents an enumeration for available protobuf compiler languages. - /// </summary> - 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 -{ - /// <summary> - /// Represents a single protobuf compile result. - /// </summary> - public class ProtoResult - { - /// <summary> - /// Gets the compiled language. - /// </summary> - public ProtoLanguage Language { get; private set; } - - /// <summary> - /// Gets the name of the file. - /// </summary - public String FileName { get; private set; } - - /// <summary> - /// Gets the file content. - /// </summary> - public String Content { get; private set; } - - /// <summary> - /// Initializes a new instance of the <see cref="ProtoResult"/> class. - /// </summary> - /// <param name="fileName">Name of the file.</param> - /// <param name="content">The content.</param> - /// <param name="language">The language.</param> - public ProtoResult(String fileName, String content, ProtoLanguage language) - { - FileName = fileName; - Content = content; - Language = language; - } - - /// <summary> - /// Saves the result to the specified folder. - /// </summary> - /// <param name="folder">The folder.</param> - 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 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProjectGuid>{40073806-914E-4E78-97AB-FA9639308EBE}</ProjectGuid> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>Tango.Protobuf</RootNamespace> - <AssemblyName>Tango.Protobuf</AssemblyName> - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> - <FileAlignment>512</FileAlignment> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>..\Build\Debug\</OutputPath> - <DefineConstants>DEBUG;TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <ItemGroup> - <Reference Include="System" /> - <Reference Include="System.Core" /> - <Reference Include="System.Xml.Linq" /> - <Reference Include="System.Data.DataSetExtensions" /> - <Reference Include="Microsoft.CSharp" /> - <Reference Include="System.Data" /> - <Reference Include="System.Net.Http" /> - <Reference Include="System.Xml" /> - </ItemGroup> - <ItemGroup> - <Compile Include="Compilers\CSharpCompiler.cs" /> - <Compile Include="ProtoCompiler.cs" /> - <Compile Include="IProtoCompiler.cs" /> - <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="ProtoLanguage.cs" /> - <Compile Include="ProtoResult.cs" /> - </ItemGroup> - <ItemGroup> - <Content Include="..\..\External Repositories\Protobuf\protoc-1.0M4.jar"> - <Link>Utils\protoc-1.0M4.jar</Link> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="..\..\External Repositories\Protobuf\protoc-c.exe"> - <Link>Utils\protoc-c.exe</Link> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="..\..\External Repositories\Protobuf\protoc.exe"> - <Link>Utils\protoc.exe</Link> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\Tango.Core\Tango.Core.csproj"> - <Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project> - <Name>Tango.Core</Name> - </ProjectReference> - </ItemGroup> - <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -</Project>
\ 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")] |
