Adding missing files
This commit is contained in:
parent
5db8ae5e6d
commit
56d4e15040
9 changed files with 199 additions and 0 deletions
31
src/Microsoft.DotNet.Tools.Compiler.Native/ArgValues.cs
Normal file
31
src/Microsoft.DotNet.Tools.Compiler.Native/ArgValues.cs
Normal 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; }
|
||||
}
|
||||
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
23
src/Microsoft.DotNet.Tools.Compiler.Native/EnumExtensions.cs
Normal file
23
src/Microsoft.DotNet.Tools.Compiler.Native/EnumExtensions.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -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
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.DotNet.Tools.Compiler.Native
|
||||
{
|
||||
public enum ArchitectureMode
|
||||
{
|
||||
x86,
|
||||
x64
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.DotNet.Tools.Compiler.Native
|
||||
{
|
||||
public enum BuildConfiguration
|
||||
{
|
||||
debug,
|
||||
release
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.DotNet.Tools.Compiler.Native
|
||||
{
|
||||
public enum NativeIntermediateMode
|
||||
{
|
||||
cpp,
|
||||
ryujit,
|
||||
custom
|
||||
}
|
||||
}
|
12
src/Microsoft.DotNet.Tools.Compiler.Native/enums/OSMode.cs
Normal file
12
src/Microsoft.DotNet.Tools.Compiler.Native/enums/OSMode.cs
Normal file
|
@ -0,0 +1,12 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.DotNet.Tools.Compiler.Native
|
||||
{
|
||||
public enum OSMode
|
||||
{
|
||||
Linux,
|
||||
Windows,
|
||||
Mac
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue