Change ILToNative Path to ilcpath

This commit is contained in:
Bryan 2015-11-17 13:35:41 -08:00
parent 17232e836d
commit 3c0b0ce73c
4 changed files with 14 additions and 15 deletions

View file

@ -116,7 +116,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
public string IlcArgs { get; set; } public string IlcArgs { get; set; }
public List<string> LinkLibPaths { get; set; } public List<string> LinkLibPaths { get; set; }
public string AppDepSDKPath { get; set; } public string AppDepSDKPath { get; set; }
public string ILToNativePath { get; set; } public string IlcPath { get; set; }
public string RuntimeLibPath { get; set; } public string RuntimeLibPath { get; set; }
} }

View file

@ -12,7 +12,6 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
{ {
public class ILCompilerInvoker public class ILCompilerInvoker
{ {
//private readonly string ExecutableName = "ILToNative" + Constants.ExeSuffix;
private readonly string ExecutableName = "corerun" + Constants.ExeSuffix; private readonly string ExecutableName = "corerun" + Constants.ExeSuffix;
private readonly string ILCompiler = "ilc.exe"; private readonly string ILCompiler = "ilc.exe";
@ -41,7 +40,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
{ {
var argsList = new List<string>(); var argsList = new List<string>();
var managedPath = Path.Combine(config.ILToNativePath, ILCompiler); var managedPath = Path.Combine(config.IlcPath, ILCompiler);
argsList.Add(managedPath); argsList.Add(managedPath);
// Input File // Input File
@ -49,7 +48,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
argsList.Add(inputFilePath); argsList.Add(inputFilePath);
// System.Private.CoreLib Reference // System.Private.CoreLib Reference
var coreLibPath = Path.Combine(config.ILToNativePath, OSCoreLibNameMap[config.OS]); var coreLibPath = Path.Combine(config.IlcPath, OSCoreLibNameMap[config.OS]);
argsList.Add($"-r \"{coreLibPath}\""); argsList.Add($"-r \"{coreLibPath}\"");
// Dependency References // Dependency References
@ -79,7 +78,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
public int Invoke(NativeCompileSettings config) public int Invoke(NativeCompileSettings config)
{ {
var executablePath = Path.Combine(config.ILToNativePath, ExecutableName); var executablePath = Path.Combine(config.IlcPath, ExecutableName);
var result = Command.Create(executablePath, ArgStr) var result = Command.Create(executablePath, ArgStr)
.ForwardStdErr() .ForwardStdErr()

View file

@ -90,7 +90,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
.Execute(); .Execute();
// Needs System.Native.so in output // Needs System.Native.so in output
var sharedLibPath = Path.Combine(config.ILToNativePath, "System.Native.so"); var sharedLibPath = Path.Combine(config.IlcPath, "System.Native.so");
var outputSharedLibPath = Path.Combine(config.OutputDirectory, "System.Native.so"); var outputSharedLibPath = Path.Combine(config.OutputDirectory, "System.Native.so");
try try
{ {

View file

@ -95,7 +95,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
// Custom Extensibility Points to support CoreRT workflow TODO better descriptions // Custom Extensibility Points to support CoreRT workflow TODO better descriptions
var ilcArgs = app.Option("--ilcargs <CODEGEN>", "Use to specify custom arguments for the IL Compiler.", CommandOptionType.SingleValue); var ilcArgs = app.Option("--ilcargs <CODEGEN>", "Use to specify custom arguments for the IL Compiler.", CommandOptionType.SingleValue);
var iltonativePathArg = app.Option("--iltonative-path <ILTONATIVE>", "Use to plug in a custom built iltonative.exe", CommandOptionType.SingleValue); var ilcPathArg = app.Option("--ilcpath <ILC_PATH>", "Use to plug in a custom built ilc.exe", CommandOptionType.SingleValue);
var runtimeLibPathArg = app.Option("--runtimelib-path <LIB_PATH>", "Use to plug in custom runtime and bootstrapper libs.", CommandOptionType.SingleValue); var runtimeLibPathArg = app.Option("--runtimelib-path <LIB_PATH>", "Use to plug in custom runtime and bootstrapper libs.", CommandOptionType.SingleValue);
var linklibArg = app.Option("--linklib <LINKLIB>", "Use to link in additional static libs", CommandOptionType.MultipleValue); var linklibArg = app.Option("--linklib <LINKLIB>", "Use to link in additional static libs", CommandOptionType.MultipleValue);
@ -120,7 +120,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
NativeMode = modeArg.Value(), NativeMode = modeArg.Value(),
ReferencePaths = referencesArg.Values, ReferencePaths = referencesArg.Values,
IlcArgs = ilcArgs.Value(), IlcArgs = ilcArgs.Value(),
ILToNativePath = iltonativePathArg.Value(), IlcPath = ilcPathArg.Value(),
RuntimeLibPath = runtimeLibPathArg.Value(), RuntimeLibPath = runtimeLibPathArg.Value(),
LinkLibPaths = linklibArg.Values, LinkLibPaths = linklibArg.Values,
AppDepSDKPath = appdepSDKPathArg.Value(), AppDepSDKPath = appdepSDKPathArg.Value(),
@ -247,19 +247,19 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
config.ReferencePaths.Add(reference); config.ReferencePaths.Add(reference);
} }
// ILToNativePath // IlcPath
if (!string.IsNullOrEmpty(args.ILToNativePath)) if (!string.IsNullOrEmpty(args.IlcPath))
{ {
if (!Directory.Exists(args.ILToNativePath)) if (!Directory.Exists(args.IlcPath))
{ {
throw new Exception("ILToNative Directory does not exist."); throw new Exception("ILC Directory does not exist.");
} }
config.ILToNativePath = args.ILToNativePath; config.IlcPath = args.IlcPath;
} }
else else
{ {
config.ILToNativePath = GetDefaultILToNativePath(); config.IlcPath = GetDefaultIlcPath();
} }
// RuntimeLibPath // RuntimeLibPath
@ -340,7 +340,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
return dir; return dir;
} }
private static string GetDefaultILToNativePath() private static string GetDefaultIlcPath()
{ {
return AppContext.BaseDirectory; return AppContext.BaseDirectory;
} }