Adding missing files

This commit is contained in:
Bryan 2015-11-17 20:16:10 -08:00
parent 5db8ae5e6d
commit 56d4e15040
9 changed files with 199 additions and 0 deletions

View file

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
using System.IO;
using Microsoft.Dnx.Runtime.Common.CommandLine;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.Tools.Common;
namespace Microsoft.DotNet.Tools.Compiler.Native
{
internal class ArgValues
{
public string LogPath { get; set; }
public string InputManagedAssemblyPath { get; set; }
public string OutputDirectory { get; set; }
public string IntermediateDirectory { get; set; }
public string BuildType { get; set; }
public string Architecture { get; set; }
public string NativeMode { get; set; }
public List<string> ReferencePaths { get; set; }
public string IlcArgs { get; set; }
public List<string> LinkLibPaths { get; set; }
public string AppDepSDKPath { get; set; }
public string IlcPath { get; set; }
}
}

View file

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
using System.IO;
using Microsoft.Dnx.Runtime.Common.CommandLine;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.Tools.Common;
namespace Microsoft.DotNet.Tools.Compiler.Native
{
public static class DirectoryExtensions
{
internal static void CleanOrCreateDirectory(string path)
{
if (Directory.Exists(path))
{
try
{
Directory.Delete(path, recursive: true);
Directory.CreateDirectory(path);
}
catch (Exception e)
{
Console.WriteLine("Unable to remove directory: " + path);
Console.WriteLine(e.Message);
}
}
}
}
}

View file

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
using System.IO;
using Microsoft.Dnx.Runtime.Common.CommandLine;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.Tools.Common;
namespace Microsoft.DotNet.Tools.Compiler.Native
{
public static class EnumExtensions
{
internal static T Parse<T>(string value)
{
return (T)Enum.Parse(typeof(T), value, true);
}
}
}

View file

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
using System.IO;
using Microsoft.Dnx.Runtime.Common.CommandLine;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.Tools.Common;
namespace Microsoft.DotNet.Tools.Compiler.Native
{
static class RuntimeExtensions
{
internal static ArchitectureMode GetCurrentArchitecture()
{
#if NET451
return Environment.Is64BitProcess ? ArchitectureMode.x64 : ArchitectureMode.x86;
#else
return IntPtr.Size == 8 ? ArchitectureMode.x64 : ArchitectureMode.x86;
#endif
}
}
}

View file

@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
using System.IO;
using Microsoft.Dnx.Runtime.Common.CommandLine;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.Tools.Common;
namespace Microsoft.DotNet.Tools.Compiler.Native
{
static class RuntimeInformationExtensions
{
internal static OSMode GetCurrentOS()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return OSMode.Windows;
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
return OSMode.Mac;
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
return OSMode.Linux;
}
else
{
throw new Exception("Unrecognized OS. dotnet-compile-native is compatible with Windows, OSX, and Linux");
}
}
}
}

View file

@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
namespace Microsoft.DotNet.Tools.Compiler.Native
{
public enum ArchitectureMode
{
x86,
x64
}
}

View file

@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
namespace Microsoft.DotNet.Tools.Compiler.Native
{
public enum BuildConfiguration
{
debug,
release
}
}

View file

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
namespace Microsoft.DotNet.Tools.Compiler.Native
{
public enum NativeIntermediateMode
{
cpp,
ryujit,
custom
}
}

View file

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
namespace Microsoft.DotNet.Tools.Compiler.Native
{
public enum OSMode
{
Linux,
Windows,
Mac
}
}