From 8023ec22d26bdfc4249f03a6b7fc66b5a50e9550 Mon Sep 17 00:00:00 2001 From: Senthil Date: Mon, 7 Dec 2015 19:20:00 -0800 Subject: [PATCH] Fix project.json dependencies and System.Private.CoreLib reference --- .../ILCompilerInvoker.cs | 11 ++--------- .../project.json | 5 ++--- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/Microsoft.DotNet.Tools.Compiler.Native/ILCompilerInvoker.cs b/src/Microsoft.DotNet.Tools.Compiler.Native/ILCompilerInvoker.cs index 93cd5bb0a..7f862181d 100644 --- a/src/Microsoft.DotNet.Tools.Compiler.Native/ILCompilerInvoker.cs +++ b/src/Microsoft.DotNet.Tools.Compiler.Native/ILCompilerInvoker.cs @@ -20,14 +20,6 @@ namespace Microsoft.DotNet.Tools.Compiler.Native { NativeIntermediateMode.ryujit, ".obj" } }; - private static readonly Dictionary OSCoreLibNameMap = new Dictionary() - { - {OSMode.Windows, "System.Private.CoreLib.dll" }, - {OSMode.Linux, "System.Private.Corelib.dll" }, - {OSMode.Mac, "System.Private.Corelib.dll" }, - }; - - private string ArgStr { get; set; } private NativeCompileSettings config; @@ -54,7 +46,8 @@ namespace Microsoft.DotNet.Tools.Compiler.Native argsList.Add($"\"{inputFilePath}\""); // System.Private.CoreLib Reference - var coreLibPath = Path.Combine(config.IlcPath, OSCoreLibNameMap[config.OS]); + String[] coreLibs = new String[] { "System.Private.CoreLib.dll", "System.Private.Corelib.dll" }; + var coreLibPath = Path.Combine(config.IlcPath, Array.Find(coreLibs, lib => File.Exists(Path.Combine(config.IlcPath, lib)))); argsList.Add($"-r \"{coreLibPath}\""); // Dependency References diff --git a/src/Microsoft.DotNet.Tools.Compiler.Native/project.json b/src/Microsoft.DotNet.Tools.Compiler.Native/project.json index 9bb5144c4..d1d11e431 100644 --- a/src/Microsoft.DotNet.Tools.Compiler.Native/project.json +++ b/src/Microsoft.DotNet.Tools.Compiler.Native/project.json @@ -23,9 +23,8 @@ "type": "build", "version": "1.0.0-*" }, - "Microsoft.DotNet.ILCompiler": "1.0.2-*", - "Microsoft.DotNet.ObjectWriter": "1.0.2-*", - "Microsoft.DotNet.RyuJit": "1.0.0-*", + "Microsoft.DotNet.ILCompiler": "1.0.3-*", + "Microsoft.DotNet.ILCompiler.SDK": "1.0.3-*", "Microsoft.DotNet.Compiler.Common": "1.0.0-*" }, "frameworks": {