Apply code review feedback
This commit is contained in:
parent
06c1cc5990
commit
cc9e942ede
10 changed files with 33 additions and 15 deletions
|
@ -13,11 +13,19 @@ namespace ConsoleApplication
|
||||||
{
|
{
|
||||||
Console.WriteLine("Hello Portable World!");
|
Console.WriteLine("Hello Portable World!");
|
||||||
|
|
||||||
var coreAssembly = typeof(object).GetTypeInfo().Assembly;
|
var depsFile = new FileInfo(GetDataFromAppDomain("FX_DEPS_FILE"));
|
||||||
string coreFolder = Path.GetDirectoryName(coreAssembly.Location);
|
string frameworkVersion = depsFile.Directory.Name;
|
||||||
string frameworkVersion = Path.GetFileName(coreFolder);
|
|
||||||
|
|
||||||
Console.WriteLine($"I'm running on shared framework version {frameworkVersion}!");
|
Console.WriteLine($"I'm running on shared framework version {frameworkVersion}!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string GetDataFromAppDomain(string propertyName)
|
||||||
|
{
|
||||||
|
var appDomainType = typeof(object).GetTypeInfo().Assembly?.GetType("System.AppDomain");
|
||||||
|
var currentDomain = appDomainType?.GetProperty("CurrentDomain")?.GetValue(null);
|
||||||
|
var deps = appDomainType?.GetMethod("GetData")?.Invoke(currentDomain, new[] { propertyName });
|
||||||
|
|
||||||
|
return deps as string;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,6 @@ namespace Microsoft.DotNet.Cli.Utils
|
||||||
{
|
{
|
||||||
public interface IPackagedCommandSpecFactory
|
public interface IPackagedCommandSpecFactory
|
||||||
{
|
{
|
||||||
// Code review TODO: Is it OK to make breaking changes to the CLI Utils API surface?
|
|
||||||
|
|
||||||
CommandSpec CreateCommandSpecFromLibrary(
|
CommandSpec CreateCommandSpecFromLibrary(
|
||||||
LockFileTargetLibrary toolLibrary,
|
LockFileTargetLibrary toolLibrary,
|
||||||
string commandName,
|
string commandName,
|
||||||
|
|
|
@ -41,7 +41,7 @@ namespace Microsoft.DotNet.Cli.Utils
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
arguments.Add("--fx-version");
|
arguments.Add("--fx-version");
|
||||||
arguments.Add(new Muxer().SharedFxVersion);
|
arguments.Add(muxer.SharedFxVersion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
using Microsoft.DotNet.Tools.Common;
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||||
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
|
||||||
|
using Microsoft.DotNet.Tools.Common;
|
||||||
using NuGet.Packaging;
|
using NuGet.Packaging;
|
||||||
using NuGet.ProjectModel;
|
using NuGet.ProjectModel;
|
||||||
using System;
|
using System;
|
||||||
|
|
|
@ -13,7 +13,7 @@ namespace Microsoft.DotNet.Cli.Utils
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal class ForwardingAppImplementation
|
internal class ForwardingAppImplementation
|
||||||
{
|
{
|
||||||
private const string s_hostExe = "dotnet";
|
private const string HostExe = "dotnet";
|
||||||
|
|
||||||
private readonly string _forwardApplicationPath;
|
private readonly string _forwardApplicationPath;
|
||||||
private readonly IEnumerable<string> _argsToForward;
|
private readonly IEnumerable<string> _argsToForward;
|
||||||
|
@ -102,7 +102,7 @@ namespace Microsoft.DotNet.Cli.Utils
|
||||||
|
|
||||||
private string GetHostExeName()
|
private string GetHostExeName()
|
||||||
{
|
{
|
||||||
return $"{s_hostExe}{FileNameSuffixes.CurrentPlatform.Exe}";
|
return $"{HostExe}{FileNameSuffixes.CurrentPlatform.Exe}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
using System;
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||||
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
using Microsoft.DotNet.Cli.Utils;
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||||
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
|
||||||
|
using Microsoft.DotNet.Cli.Utils;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
@ -8,7 +11,7 @@ namespace Microsoft.DotNet.Cli
|
||||||
{
|
{
|
||||||
public class ForwardingApp
|
public class ForwardingApp
|
||||||
{
|
{
|
||||||
ForwardingAppImplementation _implementation;
|
private ForwardingAppImplementation _implementation;
|
||||||
|
|
||||||
public ForwardingApp(
|
public ForwardingApp(
|
||||||
string forwardApplicationPath,
|
string forwardApplicationPath,
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace Microsoft.DotNet.Tools.MSBuild
|
||||||
|
|
||||||
private MSBuildForwardingAppWithoutLogging _forwardingAppWithoutLogging;
|
private MSBuildForwardingAppWithoutLogging _forwardingAppWithoutLogging;
|
||||||
|
|
||||||
static IEnumerable<string> ConcatTelemetryLogger(IEnumerable<string> argsToForward)
|
private static IEnumerable<string> ConcatTelemetryLogger(IEnumerable<string> argsToForward)
|
||||||
{
|
{
|
||||||
if (Telemetry.CurrentSessionId != null)
|
if (Telemetry.CurrentSessionId != null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -462,7 +462,7 @@ namespace Microsoft.DotNet.Tests
|
||||||
{
|
{
|
||||||
// When using the product, the ToolDepsJsonGeneratorProject property is used to get this path, but for testing
|
// When using the product, the ToolDepsJsonGeneratorProject property is used to get this path, but for testing
|
||||||
// we'll hard code the path inside the SDK since we don't have a project to evaluate here
|
// we'll hard code the path inside the SDK since we don't have a project to evaluate here
|
||||||
return Path.Combine(new RepoDirectoriesProvider().Stage2Sdk, @"Sdks\Microsoft.NET.Sdk\build\GenerateDeps\GenerateDeps.proj");
|
return Path.Combine(new RepoDirectoriesProvider().Stage2Sdk, "Sdks", "Microsoft.NET.Sdk", "build", "GenerateDeps", "GenerateDeps.proj");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
using Microsoft.DotNet.Tools.Test.Utilities;
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||||
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
|
||||||
|
using Microsoft.DotNet.Tools.Test.Utilities;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
Loading…
Reference in a new issue