Merge pull request #4295 from eerhardt/MergePreview2
Merge rel/1.0.0-preview2 into rel/1.0.0
This commit is contained in:
commit
0b37ad5d52
20 changed files with 218 additions and 60 deletions
|
@ -202,7 +202,7 @@
|
||||||
|
|
||||||
<!-- Generate .version file -->
|
<!-- Generate .version file -->
|
||||||
<WriteLinesToFile File="$(SdkOutputDirectory)/.version"
|
<WriteLinesToFile File="$(SdkOutputDirectory)/.version"
|
||||||
Lines="$(CommitHash);$(SdkVersion)"
|
Lines="$(CommitHash);$(SdkVersion);$(Rid)"
|
||||||
Overwrite="true" />
|
Overwrite="true" />
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -1,23 +1,24 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<Include xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
<Include xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||||
|
|
||||||
<!-- These values were generated by running 'heat payload' against the CRTs downloaded from the fwlinks -->
|
<!-- These values were generated by running 'heat payload' against the CRTs downloaded from the download center links(DLC) -->
|
||||||
|
<!-- The DLC links are owned by the .Net Core team (contact leecow@microsoft.com) and CRTs that they point to should never be changed -->
|
||||||
|
|
||||||
<?define Crt_CertificatePublicKey="52868DFCA6E3AF2632389E6C1EE7D0468D3797D0"?>
|
<?define Crt_CertificatePublicKey="371DD003A37769487A2A89A5A9DDB3026451B906"?>
|
||||||
<?define Crt_CertificateThumbprint="3BDA323E552DB1FDE5F4FBEE75D6D5B2B187EEDC"?>
|
<?define Crt_CertificateThumbprint="98ED99A67886D020C564923B7DF25E9AC019DF26"?>
|
||||||
<?define Crt_Description="Microsoft Visual C++ 2015 Redistributable ($(var.Platform)) - 14.0.23506"?>
|
<?define Crt_Description="Microsoft Visual C++ 2015 Redistributable ($(var.Platform)) - 14.0.24215"?>
|
||||||
<?define Crt_ProductName="Microsoft Visual C++ 2015 Redistributable ($(var.Platform)) - 14.0.23506"?>
|
<?define Crt_ProductName="Microsoft Visual C++ 2015 Redistributable ($(var.Platform)) - 14.0.24215"?>
|
||||||
<?define Crt_Version="14.0.23506.0"?>
|
<?define Crt_Version="14.0.24215.1"?>
|
||||||
<?define Crt_VersionRegistyKeyValue="v14.0.23506.00"?>
|
<?define Crt_VersionRegistyKeyValue="v14.0.24215.01"?>
|
||||||
|
|
||||||
<?if $(var.Platform)=x86?>
|
<?if $(var.Platform)=x86?>
|
||||||
<?define Crt_DownloadUrl="http://go.microsoft.com/fwlink/?LinkID=615459&clcid=0x409"?>
|
<?define Crt_DownloadUrl="https://download.microsoft.com/download/1/F/0/1F01DD22-748C-41A7-89DE-54D64355CDA6/vc_redist.x86.exe"?>
|
||||||
<?define Crt_Hash="17B381D3ADB22F00E4AB47CBD91CE0A5B1CCBC70"?>
|
<?define Crt_Hash="72211BD2E7DFC91EA7C8FAC549C49C0543BA791B"?>
|
||||||
<?define Crt_Size="13977352"?>
|
<?define Crt_Size="14456872"?>
|
||||||
<?elseif $(var.Platform)=x64?>
|
<?elseif $(var.Platform)=x64?>
|
||||||
<?define Crt_DownloadUrl="http://go.microsoft.com/fwlink/?LinkID=615460&clcid=0x409"?>
|
<?define Crt_DownloadUrl="https://download.microsoft.com/download/1/F/0/1F01DD22-748C-41A7-89DE-54D64355CDA6/vc_redist.x64.exe"?>
|
||||||
<?define Crt_Hash="9A19A51D1F40CD5CD5ECB6E4E4F978F18DA8212A"?>
|
<?define Crt_Hash="10B1683EA3FF5F36F225769244BF7E7813D54AD0"?>
|
||||||
<?define Crt_Size="14773216"?>
|
<?define Crt_Size="15301888"?>
|
||||||
<?else?>
|
<?else?>
|
||||||
<?error Invalid Platform ($(var.Platform))?>
|
<?error Invalid Platform ($(var.Platform))?>
|
||||||
<?endif?>
|
<?endif?>
|
||||||
|
|
|
@ -80,7 +80,7 @@ namespace Microsoft.DotNet.Cli.Utils
|
||||||
var projectContext = ProjectContext.Create(
|
var projectContext = ProjectContext.Create(
|
||||||
projectRootPath,
|
projectRootPath,
|
||||||
framework,
|
framework,
|
||||||
RuntimeEnvironmentRidExtensions.GetAllCandidateRuntimeIdentifiers());
|
DotnetRuntimeIdentifiers.InferCurrentRuntimeIdentifiers());
|
||||||
|
|
||||||
if (projectContext.RuntimeIdentifier == null)
|
if (projectContext.RuntimeIdentifier == null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -142,7 +142,7 @@ namespace Microsoft.DotNet.Cli.Utils
|
||||||
return ProjectContext.Create(
|
return ProjectContext.Create(
|
||||||
projectRootPath,
|
projectRootPath,
|
||||||
framework,
|
framework,
|
||||||
RuntimeEnvironmentRidExtensions.GetAllCandidateRuntimeIdentifiers());
|
DotnetRuntimeIdentifiers.InferCurrentRuntimeIdentifiers());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,9 +20,6 @@ namespace Microsoft.DotNet.Cli.Utils
|
||||||
private static readonly CommandResolutionStrategy s_commandResolutionStrategy =
|
private static readonly CommandResolutionStrategy s_commandResolutionStrategy =
|
||||||
CommandResolutionStrategy.ProjectToolsPackage;
|
CommandResolutionStrategy.ProjectToolsPackage;
|
||||||
|
|
||||||
private static readonly string s_currentRuntimeIdentifier = RuntimeEnvironmentRidExtensions.GetLegacyRestoreRuntimeIdentifier();
|
|
||||||
|
|
||||||
|
|
||||||
private List<string> _allowedCommandExtensions;
|
private List<string> _allowedCommandExtensions;
|
||||||
private IPackagedCommandSpecFactory _packagedCommandSpecFactory;
|
private IPackagedCommandSpecFactory _packagedCommandSpecFactory;
|
||||||
|
|
||||||
|
|
|
@ -12,11 +12,19 @@ namespace Microsoft.DotNet.Cli.Utils
|
||||||
{
|
{
|
||||||
private static string SdkRootFolder => Path.Combine(typeof(DotnetFiles).GetTypeInfo().Assembly.Location, "..");
|
private static string SdkRootFolder => Path.Combine(typeof(DotnetFiles).GetTypeInfo().Assembly.Location, "..");
|
||||||
|
|
||||||
|
private static Lazy<DotnetVersionFile> s_versionFileObject =
|
||||||
|
new Lazy<DotnetVersionFile>(() => new DotnetVersionFile(VersionFile));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The CLI ships with a .version file that stores the commit information and CLI version
|
/// The CLI ships with a .version file that stores the commit information and CLI version
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string VersionFile => Path.GetFullPath(Path.Combine(SdkRootFolder, ".version"));
|
public static string VersionFile => Path.GetFullPath(Path.Combine(SdkRootFolder, ".version"));
|
||||||
|
|
||||||
|
internal static DotnetVersionFile VersionFileObject
|
||||||
|
{
|
||||||
|
get { return s_versionFileObject.Value; }
|
||||||
|
}
|
||||||
|
|
||||||
public static string NuGetPackagesArchive =>
|
public static string NuGetPackagesArchive =>
|
||||||
Path.GetFullPath(Path.Combine(SdkRootFolder, "nuGetPackagesArchive.lzma"));
|
Path.GetFullPath(Path.Combine(SdkRootFolder, "nuGetPackagesArchive.lzma"));
|
||||||
|
|
||||||
|
|
35
src/Microsoft.DotNet.Cli.Utils/DotnetRuntimeIdentifiers.cs
Normal file
35
src/Microsoft.DotNet.Cli.Utils/DotnetRuntimeIdentifiers.cs
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
// 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.Collections.Generic;
|
||||||
|
using Microsoft.DotNet.InternalAbstractions;
|
||||||
|
|
||||||
|
namespace Microsoft.DotNet.Cli.Utils
|
||||||
|
{
|
||||||
|
internal static class DotnetRuntimeIdentifiers
|
||||||
|
{
|
||||||
|
public static IEnumerable<string> InferCurrentRuntimeIdentifiers()
|
||||||
|
{
|
||||||
|
IEnumerable<string> fallbackIdentifiers = null;
|
||||||
|
|
||||||
|
// If the machine's RID isn't supported by the shared framework (i.e. the CLI
|
||||||
|
// is being used on a newer version of an OS), add the RID that the CLI was built
|
||||||
|
// with as a fallback. The RID the CLI was built with will have the correct
|
||||||
|
// runtime.* NuGet packages available.
|
||||||
|
// For example, when a user is using osx.10.12, but we only support osx.10.10 and
|
||||||
|
// osx.10.11, the project.json "runtimes" section cannot contain osx.10.12, since
|
||||||
|
// that RID isn't contained in the runtime graph - users will get a restore error.
|
||||||
|
FrameworkDependencyFile fxDepsFile = new FrameworkDependencyFile();
|
||||||
|
if (!fxDepsFile.SupportsCurrentRuntime())
|
||||||
|
{
|
||||||
|
string buildRid = DotnetFiles.VersionFileObject.BuildRid;
|
||||||
|
if (!string.IsNullOrEmpty(buildRid))
|
||||||
|
{
|
||||||
|
fallbackIdentifiers = new string[] { buildRid };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return RuntimeEnvironmentRidExtensions.GetAllCandidateRuntimeIdentifiers(fallbackIdentifiers);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
61
src/Microsoft.DotNet.Cli.Utils/DotnetVersionFile.cs
Normal file
61
src/Microsoft.DotNet.Cli.Utils/DotnetVersionFile.cs
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
// 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.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace Microsoft.DotNet.Cli.Utils
|
||||||
|
{
|
||||||
|
internal class DotnetVersionFile
|
||||||
|
{
|
||||||
|
public bool Exists { get; set; }
|
||||||
|
|
||||||
|
public string CommitSha { get; set; }
|
||||||
|
|
||||||
|
public string BuildNumber { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The runtime identifier (rid) that this CLI was built for.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This is different than RuntimeEnvironment.GetRuntimeIdentifier() because the
|
||||||
|
/// BuildRid is a RID that is guaranteed to exist and works on the current machine. The
|
||||||
|
/// RuntimeEnvironment.GetRuntimeIdentifier() may be for a new version of the OS that
|
||||||
|
/// doesn't have full support yet.
|
||||||
|
/// </remarks>
|
||||||
|
public string BuildRid { get; set; }
|
||||||
|
|
||||||
|
public DotnetVersionFile(string versionFilePath)
|
||||||
|
{
|
||||||
|
Exists = File.Exists(versionFilePath);
|
||||||
|
|
||||||
|
if (Exists)
|
||||||
|
{
|
||||||
|
IEnumerable<string> lines = File.ReadLines(versionFilePath);
|
||||||
|
|
||||||
|
int index = 0;
|
||||||
|
foreach (string line in lines)
|
||||||
|
{
|
||||||
|
if (index == 0)
|
||||||
|
{
|
||||||
|
CommitSha = line.Substring(0, 10);
|
||||||
|
}
|
||||||
|
else if (index == 1)
|
||||||
|
{
|
||||||
|
BuildNumber = line;
|
||||||
|
}
|
||||||
|
else if (index == 2)
|
||||||
|
{
|
||||||
|
BuildRid = line;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
45
src/Microsoft.DotNet.Cli.Utils/FrameworkDependencyFile.cs
Normal file
45
src/Microsoft.DotNet.Cli.Utils/FrameworkDependencyFile.cs
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
// 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.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using Microsoft.DotNet.PlatformAbstractions;
|
||||||
|
using Microsoft.Extensions.DependencyModel;
|
||||||
|
|
||||||
|
namespace Microsoft.DotNet.Cli.Utils
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents the .deps.json file in the shared framework
|
||||||
|
/// that the CLI is running against.
|
||||||
|
/// </summary>
|
||||||
|
internal class FrameworkDependencyFile
|
||||||
|
{
|
||||||
|
private readonly string _depsFilePath;
|
||||||
|
|
||||||
|
public FrameworkDependencyFile()
|
||||||
|
{
|
||||||
|
_depsFilePath = Muxer.GetDataFromAppDomain("FX_DEPS_FILE");
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool SupportsCurrentRuntime()
|
||||||
|
{
|
||||||
|
return IsRuntimeSupported(RuntimeEnvironment.GetRuntimeIdentifier());
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsRuntimeSupported(string runtimeIdentifier)
|
||||||
|
{
|
||||||
|
DependencyContext fxDependencyContext = CreateDependencyContext();
|
||||||
|
|
||||||
|
return fxDependencyContext.RuntimeGraph.Any(g => g.Runtime == runtimeIdentifier);
|
||||||
|
}
|
||||||
|
|
||||||
|
private DependencyContext CreateDependencyContext()
|
||||||
|
{
|
||||||
|
using (Stream depsFileStream = File.OpenRead(_depsFilePath))
|
||||||
|
using (DependencyContextJsonReader reader = new DependencyContextJsonReader())
|
||||||
|
{
|
||||||
|
return reader.Read(depsFileStream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,4 +2,6 @@ using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
[assembly: AssemblyMetadataAttribute("Serviceable", "True")]
|
[assembly: AssemblyMetadataAttribute("Serviceable", "True")]
|
||||||
|
[assembly: InternalsVisibleTo("dotnet, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||||
|
[assembly: InternalsVisibleTo("Microsoft.DotNet.Tools.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||||
[assembly: InternalsVisibleTo("Microsoft.DotNet.Cli.Utils.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
[assembly: InternalsVisibleTo("Microsoft.DotNet.Cli.Utils.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<ProjectGuid>e5ed47ef-bf25-4da9-a7fe-290c642cbf0f</ProjectGuid>
|
<ProjectGuid>e5ed47ef-bf25-4da9-a7fe-290c642cbf0f</ProjectGuid>
|
||||||
<RootNamespace>Microsoft.DotNet.Configurer</RootNamespace>
|
<RootNamespace>Microsoft.DotNet.Configurer</RootNamespace>
|
||||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
|
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
|
||||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin</OutputPath>
|
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin</OutputPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
|
@ -13,20 +13,6 @@ namespace Microsoft.DotNet.InternalAbstractions
|
||||||
// We should clean this up. Filed #619 to track.
|
// We should clean this up. Filed #619 to track.
|
||||||
public static class RuntimeEnvironmentRidExtensions
|
public static class RuntimeEnvironmentRidExtensions
|
||||||
{
|
{
|
||||||
// Work around NuGet/Home#1941
|
|
||||||
public static IEnumerable<string> GetOverrideRestoreRuntimeIdentifiers()
|
|
||||||
{
|
|
||||||
if (RuntimeEnvironment.OperatingSystemPlatform != Platform.Windows)
|
|
||||||
{
|
|
||||||
yield return RuntimeEnvironment.GetRuntimeIdentifier();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
yield return "win7-x86";
|
|
||||||
yield return "win7-x64";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Gets the identfier that is used for restore by default (this is different from the actual RID, but only on Windows)
|
// Gets the identfier that is used for restore by default (this is different from the actual RID, but only on Windows)
|
||||||
public static string GetLegacyRestoreRuntimeIdentifier()
|
public static string GetLegacyRestoreRuntimeIdentifier()
|
||||||
{
|
{
|
||||||
|
@ -43,36 +29,56 @@ namespace Microsoft.DotNet.InternalAbstractions
|
||||||
|
|
||||||
public static IEnumerable<string> GetAllCandidateRuntimeIdentifiers()
|
public static IEnumerable<string> GetAllCandidateRuntimeIdentifiers()
|
||||||
{
|
{
|
||||||
|
return GetAllCandidateRuntimeIdentifiers(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IEnumerable<string> GetAllCandidateRuntimeIdentifiers(IEnumerable<string> fallbackIdentifiers = null)
|
||||||
|
{
|
||||||
|
List<string> result = new List<string>();
|
||||||
|
|
||||||
if (RuntimeEnvironment.OperatingSystemPlatform != Platform.Windows)
|
if (RuntimeEnvironment.OperatingSystemPlatform != Platform.Windows)
|
||||||
{
|
{
|
||||||
yield return RuntimeEnvironment.GetRuntimeIdentifier();
|
result.Add(RuntimeEnvironment.GetRuntimeIdentifier());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var arch = RuntimeEnvironment.RuntimeArchitecture.ToLowerInvariant();
|
var arch = RuntimeEnvironment.RuntimeArchitecture.ToLowerInvariant();
|
||||||
if (RuntimeEnvironment.OperatingSystemVersion.StartsWith("6.1", StringComparison.Ordinal))
|
if (RuntimeEnvironment.OperatingSystemVersion.StartsWith("6.1", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
yield return "win7-" + arch;
|
result.Add("win7-" + arch);
|
||||||
}
|
}
|
||||||
else if (RuntimeEnvironment.OperatingSystemVersion.StartsWith("6.2", StringComparison.Ordinal))
|
else if (RuntimeEnvironment.OperatingSystemVersion.StartsWith("6.2", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
yield return "win8-" + arch;
|
result.Add("win8-" + arch);
|
||||||
yield return "win7-" + arch;
|
result.Add("win7-" + arch);
|
||||||
}
|
}
|
||||||
else if (RuntimeEnvironment.OperatingSystemVersion.StartsWith("6.3", StringComparison.Ordinal))
|
else if (RuntimeEnvironment.OperatingSystemVersion.StartsWith("6.3", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
yield return "win81-" + arch;
|
result.Add("win81-" + arch);
|
||||||
yield return "win8-" + arch;
|
result.Add("win8-" + arch);
|
||||||
yield return "win7-" + arch;
|
result.Add("win7-" + arch);
|
||||||
}
|
}
|
||||||
else if (RuntimeEnvironment.OperatingSystemVersion.StartsWith("10.0", StringComparison.Ordinal))
|
else if (RuntimeEnvironment.OperatingSystemVersion.StartsWith("10.0", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
yield return "win10-" + arch;
|
result.Add("win10-" + arch);
|
||||||
yield return "win81-" + arch;
|
result.Add("win81-" + arch);
|
||||||
yield return "win8-" + arch;
|
result.Add("win8-" + arch);
|
||||||
yield return "win7-" + arch;
|
result.Add("win7-" + arch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fallbackIdentifiers != null)
|
||||||
|
{
|
||||||
|
foreach (string fallbackIdentifier in fallbackIdentifiers)
|
||||||
|
{
|
||||||
|
if (!result.Contains(fallbackIdentifier))
|
||||||
|
{
|
||||||
|
result.Add(fallbackIdentifier);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Microsoft.DotNet.Cli.Utils;
|
using Microsoft.DotNet.Cli.Utils;
|
||||||
using Microsoft.DotNet.InternalAbstractions;
|
|
||||||
using Microsoft.DotNet.ProjectModel;
|
using Microsoft.DotNet.ProjectModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NuGet.Frameworks;
|
using NuGet.Frameworks;
|
||||||
|
@ -28,7 +27,7 @@ namespace Microsoft.DotNet.Tools.Test
|
||||||
var projectPath = GetProjectPath(dotnetTestParams.ProjectOrAssemblyPath);
|
var projectPath = GetProjectPath(dotnetTestParams.ProjectOrAssemblyPath);
|
||||||
var runtimeIdentifiers = !string.IsNullOrEmpty(dotnetTestParams.Runtime)
|
var runtimeIdentifiers = !string.IsNullOrEmpty(dotnetTestParams.Runtime)
|
||||||
? new[] {dotnetTestParams.Runtime}
|
? new[] {dotnetTestParams.Runtime}
|
||||||
: RuntimeEnvironmentRidExtensions.GetAllCandidateRuntimeIdentifiers();
|
: DotnetRuntimeIdentifiers.InferCurrentRuntimeIdentifiers();
|
||||||
var exitCode = 0;
|
var exitCode = 0;
|
||||||
|
|
||||||
// Create a workspace
|
// Create a workspace
|
||||||
|
|
|
@ -238,7 +238,8 @@ namespace Microsoft.DotNet.Cli
|
||||||
{
|
{
|
||||||
HelpCommand.PrintVersionHeader();
|
HelpCommand.PrintVersionHeader();
|
||||||
|
|
||||||
var commitSha = GetCommitSha() ?? "N/A";
|
DotnetVersionFile versionFile = DotnetFiles.VersionFileObject;
|
||||||
|
var commitSha = versionFile.CommitSha ?? "N/A";
|
||||||
Reporter.Output.WriteLine();
|
Reporter.Output.WriteLine();
|
||||||
Reporter.Output.WriteLine("Product Information:");
|
Reporter.Output.WriteLine("Product Information:");
|
||||||
Reporter.Output.WriteLine($" Version: {Product.Version}");
|
Reporter.Output.WriteLine($" Version: {Product.Version}");
|
||||||
|
@ -248,7 +249,7 @@ namespace Microsoft.DotNet.Cli
|
||||||
Reporter.Output.WriteLine($" OS Name: {RuntimeEnvironment.OperatingSystem}");
|
Reporter.Output.WriteLine($" OS Name: {RuntimeEnvironment.OperatingSystem}");
|
||||||
Reporter.Output.WriteLine($" OS Version: {RuntimeEnvironment.OperatingSystemVersion}");
|
Reporter.Output.WriteLine($" OS Version: {RuntimeEnvironment.OperatingSystemVersion}");
|
||||||
Reporter.Output.WriteLine($" OS Platform: {RuntimeEnvironment.OperatingSystemPlatform}");
|
Reporter.Output.WriteLine($" OS Platform: {RuntimeEnvironment.OperatingSystemPlatform}");
|
||||||
Reporter.Output.WriteLine($" RID: {RuntimeEnvironment.GetRuntimeIdentifier()}");
|
Reporter.Output.WriteLine($" RID: {GetDisplayRid(versionFile)}");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool IsArg(string candidate, string longName)
|
private static bool IsArg(string candidate, string longName)
|
||||||
|
@ -261,16 +262,17 @@ namespace Microsoft.DotNet.Cli
|
||||||
return (shortName != null && candidate.Equals("-" + shortName)) || (longName != null && candidate.Equals("--" + longName));
|
return (shortName != null && candidate.Equals("-" + shortName)) || (longName != null && candidate.Equals("--" + longName));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string GetCommitSha()
|
private static string GetDisplayRid(DotnetVersionFile versionFile)
|
||||||
{
|
{
|
||||||
var versionFile = DotnetFiles.VersionFile;
|
FrameworkDependencyFile fxDepsFile = new FrameworkDependencyFile();
|
||||||
|
|
||||||
if (File.Exists(versionFile))
|
string currentRid = RuntimeEnvironment.GetRuntimeIdentifier();
|
||||||
{
|
|
||||||
return File.ReadLines(versionFile).FirstOrDefault()?.Substring(0, 10);
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
// if the current RID isn't supported by the shared framework, display the RID the CLI was
|
||||||
|
// built with instead, so the user knows which RID they should put in their "runtimes" section.
|
||||||
|
return fxDepsFile.IsRuntimeSupported(currentRid) ?
|
||||||
|
currentRid :
|
||||||
|
versionFile.BuildRid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,4 +2,4 @@ using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
[assembly: AssemblyMetadataAttribute("Serviceable", "True")]
|
[assembly: AssemblyMetadataAttribute("Serviceable", "True")]
|
||||||
[assembly: InternalsVisibleTo("dotnet.Tests")]
|
[assembly: InternalsVisibleTo("dotnet.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
|
||||||
|
|
|
@ -131,7 +131,7 @@ namespace Microsoft.DotNet.Tools.Compiler
|
||||||
var rids = new List<string>();
|
var rids = new List<string>();
|
||||||
if (string.IsNullOrEmpty(RuntimeValue))
|
if (string.IsNullOrEmpty(RuntimeValue))
|
||||||
{
|
{
|
||||||
return RuntimeEnvironmentRidExtensions.GetAllCandidateRuntimeIdentifiers();
|
return DotnetRuntimeIdentifiers.InferCurrentRuntimeIdentifiers();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -414,7 +414,7 @@ namespace Microsoft.DotNet.Tools.Publish
|
||||||
contexts.Where(c => Equals(c.TargetFramework, framework));
|
contexts.Where(c => Equals(c.TargetFramework, framework));
|
||||||
|
|
||||||
var rids = string.IsNullOrEmpty(runtime) ?
|
var rids = string.IsNullOrEmpty(runtime) ?
|
||||||
RuntimeEnvironmentRidExtensions.GetAllCandidateRuntimeIdentifiers() :
|
DotnetRuntimeIdentifiers.InferCurrentRuntimeIdentifiers() :
|
||||||
new[] { runtime };
|
new[] { runtime };
|
||||||
|
|
||||||
return contexts.Select(c => Workspace.GetRuntimeContext(c, rids));
|
return contexts.Select(c => Workspace.GetRuntimeContext(c, rids));
|
||||||
|
|
|
@ -83,7 +83,7 @@ namespace Microsoft.DotNet.Tools.Run
|
||||||
.EnsureValid(Project)
|
.EnsureValid(Project)
|
||||||
.FrameworkOnlyContexts;
|
.FrameworkOnlyContexts;
|
||||||
|
|
||||||
var rids = RuntimeEnvironmentRidExtensions.GetAllCandidateRuntimeIdentifiers();
|
var rids = DotnetRuntimeIdentifiers.InferCurrentRuntimeIdentifiers();
|
||||||
|
|
||||||
ProjectContext frameworkContext;
|
ProjectContext frameworkContext;
|
||||||
if (Framework == null)
|
if (Framework == null)
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
"version": "1.0.0-preview3-*",
|
"version": "1.0.0-preview3-*",
|
||||||
"buildOptions": {
|
"buildOptions": {
|
||||||
"emitEntryPoint": true,
|
"emitEntryPoint": true,
|
||||||
|
"keyFile": "../../tools/Key.snk",
|
||||||
"embed": {
|
"embed": {
|
||||||
"include": [
|
"include": [
|
||||||
"commands/dotnet-new/CSharp_Console.zip",
|
"commands/dotnet-new/CSharp_Console.zip",
|
||||||
|
|
|
@ -43,6 +43,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"buildOptions": {
|
"buildOptions": {
|
||||||
|
"keyFile": "../../tools/Key.snk",
|
||||||
"copyToOutput": {
|
"copyToOutput": {
|
||||||
"include": [
|
"include": [
|
||||||
"../../TestAssets/TestProjects/AppWithDependencyOnToolWithOutputName/**/*",
|
"../../TestAssets/TestProjects/AppWithDependencyOnToolWithOutputName/**/*",
|
||||||
|
|
Loading…
Reference in a new issue