未验证 提交 78005e5b 编写于 作者: J Jared Parsons 提交者: GitHub

Merge pull request #23494 from jaredpar/fix-dep

Move us to SDK 2.2.0 preview
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
Defining this target will disable the new SDK behavior of implicit transitive project
references. This is a fine feature in general but the current implementation breaks VSIX
construction by including a number of projects that should not be included.
https://github.com/dotnet/sdk/issues/1366
-->
<Target Name="IncludeTransitiveProjectReferences">
</Target>
</Project>
......@@ -91,6 +91,9 @@
<IbcMergePath>$(NuGetPackageRoot)\Microsoft.DotNet.IBCMerge\$(MicrosoftDotNetIBCMerge)\lib\net45\ibcmerge.exe</IbcMergePath>
<MSBuildTargetsFilePath>$(MSBuildToolsPath)\Microsoft.$(MSBuildTargetsLanguageName).targets</MSBuildTargetsFilePath>
<DisableTransitiveProjectReferences Condition="'$(RoslynProjectType)' == 'Vsix'">true</DisableTransitiveProjectReferences>
</PropertyGroup>
<!-- If the project hasn't configured a ruleset, set a default ruleset. -->
......@@ -289,7 +292,6 @@
<Import Project="GenerateAssemblyInfo.targets" Condition="'$(ProjectLanguage)' == 'CSharp' OR '$(ProjectLanguage)' == 'VB'" />
<Import Project="GenerateInternalsVisibleTo.targets" />
<Import Project="DisableTransitiveReferences.targets" Condition="'$(RoslynProjectType)' == 'Vsix' AND '$(RoslynSdkProject)' == 'true'" />
<ItemDefinitionGroup>
<VSIXSourceItem>
......@@ -474,8 +476,12 @@
<ShortSdkVersion Condition=" $(dotnetSdkVersion.IndexOf('-')) &lt;= 0 ">$(dotnetSdkVersion)</ShortSdkVersion>
</PropertyGroup>
<!-- The $(UsingMicrosoftNETSdk) property is set when we are using a 2.0 SDK or newer (non-legacy). This means
we can depend on global.json having enforced the minimum version we require for our build. If it's not
set though we need to error out and provide a link to get the correct SDK installed.
-->
<Error
Text="The $(ShortSdkVersion) SDK is required to build this repo"
Text="The $(ShortSdkVersion) SDK is required to build this repo. It can be install here https://dotnetcli.blob.core.windows.net/dotnet/Sdk/2.2.0-preview1-007622/dotnet-sdk-2.2.0-preview1-007622-win-x64.exe"
Condition="'$(UsingMicrosoftNETSdk)' == '' AND '$(RoslynSdkProject)' == 'true'" />
</Target>
......
......@@ -2,7 +2,8 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<dotnetSdkVersion>2.1.1-preview-007094</dotnetSdkVersion>
<dotnetRuntimeVersion>2.0.0</dotnetRuntimeVersion>
<dotnetSdkVersion>2.2.0-preview1-007622</dotnetSdkVersion>
<nugetExeVersion>4.3.0</nugetExeVersion>
</PropertyGroup>
</Project>
......@@ -135,8 +135,17 @@ function Ensure-NuGet() {
# Ensure the proper SDK in installed in our %PATH%. This is how MSBuild locates the
# SDK.
function Ensure-SdkInPathAndData() {
function Ensure-DotnetSdk() {
# Check to see if the specified dotnet installations meets our build requirements
function Test-DotnetDir([string]$dotnetDir, [string]$runtimeVersion, [string]$sdkVersion) {
$sdkPath = Join-Path $dotnetDir "sdk\$sdkVersion"
$runtimePath = Join-Path $dotnetDir "shared\Microsoft.NETCore.App\$runtimeVersion"
return (Test-Path $sdkPath) -and (Test-Path $runtimePath)
}
$sdkVersion = Get-ToolVersion "dotnetSdk"
$runtimeVersion = Get-ToolVersion "dotnetRuntime"
# Get the path to dotnet.exe. This is the first path on %PATH% that contains the
# dotnet.exe instance. Many SDK tools use this to locate items like the SDK.
......@@ -153,21 +162,15 @@ function Ensure-SdkInPathAndData() {
# First check that dotnet is already on the path with the correct SDK version
$dotnetDir = Get-DotnetDir
if ($dotnetDir -ne $null) {
$sdkPath = Join-Path $dotnetDir "sdk\$sdkVersion"
if (Test-Path $sdkPath) {
Write-Output (Join-Path $dotnetDir "dotnet.exe")
Write-Output $sdkPath
return
}
if (($dotnetDir -ne $null) -and (Test-DotnetDir $dotnetDir $runtimeVersion $sdkVersion)) {
return (Join-Path $dotnetDir "dotnet.exe")
}
# Ensure the downloaded dotnet of the appropriate version is located in the
# Binaries\Tools directory
$toolsDir = Join-Path $binariesDir "Tools"
$cliDir = Join-Path $toolsDir "dotnet"
$dotnetExe = Join-Path $cliDir "dotnet.exe"
if (-not (Test-Path $dotnetExe)) {
if (-not (Test-DotnetDir $cliDir $runtimeVersion $sdkVersion)) {
Write-Host "Downloading CLI $sdkVersion"
Create-Directory $cliDir
Create-Directory $toolsDir
......@@ -175,20 +178,10 @@ function Ensure-SdkInPathAndData() {
$webClient = New-Object -TypeName "System.Net.WebClient"
$webClient.DownloadFile("https://dot.net/v1/dotnet-install.ps1", $destFile)
Exec-Block { & $destFile -Version $sdkVersion -InstallDir $cliDir } | Out-Null
Exec-Block { & $destFile -Version $runtimeVersion -SharedRuntime -InstallDir $cliDir } | Out-Null
}
${env:PATH} = "$cliDir;${env:PATH}"
$sdkPath = Join-Path $cliDir "sdk\$sdkVersion"
Write-Output $dotnetExe
Write-Output $sdkPath
return
}
# Ensure the proper SDK in installed in our %PATH%. This is how MSBuild locates the
# SDK.
function Ensure-SdkInPath() {
$dotnet, $sdkDir = Ensure-SdkInPathAndData
return
return (Join-Path $cliDir "dotnet.exe")
}
# Ensure a basic tool used for building our Repo is installed and
......@@ -222,7 +215,7 @@ function Ensure-MSBuild([switch]$xcopy = $false) {
}
$p = Join-Path $msbuildDir "msbuild.exe"
Ensure-SdkInPath
$dotnetExe = Ensure-DotnetSdk
return $p
}
......
......@@ -601,7 +601,7 @@ try {
Process-Arguments
$msbuild, $msbuildDir = Ensure-MSBuildAndDir -msbuildDir $msbuildDir
$dotnet, $sdkDir = Ensure-SdkInPathAndData
$dotnet = Ensure-DotnetSdk
$buildConfiguration = if ($release) { "Release" } else { "Debug" }
$configDir = Join-Path $binariesDir $buildConfiguration
$bootstrapDir = ""
......
......@@ -12,7 +12,8 @@ install_dotnet () {
local THIS_DIR="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${THIS_DIR}"/build-utils.sh
local DOTNET_VERSION="$(get_tool_version dotnetSdk)"
local DOTNET_SDK_VERSION="$(get_tool_version dotnetSdk)"
local DOTNET_RUNTIME_VERSION="$(get_tool_version dotnetRuntime)"
local DOTNET_PATH="${THIS_DIR}"/../../Binaries/Tools/dotnet
# check if the correct `dotnet` is already on the PATH
......@@ -26,9 +27,12 @@ install_dotnet () {
if [[ ! -x "${DOTNET_PATH}/dotnet" || "$(${DOTNET_PATH}/dotnet --version)" != "${DOTNET_VERSION}" ]]
then
echo "Downloading and installing .NET CLI version ${DOTNET_VERSION} to ${DOTNET_PATH}"
echo "Downloading and installing .NET CLI version ${DOTNET_SDK_VERSION} to ${DOTNET_PATH}"
curl https://dot.net/v1/dotnet-install.sh | \
/usr/bin/env bash -s -- --version "${DOTNET_VERSION}" --install-dir "${DOTNET_PATH}"
/usr/bin/env bash -s -- --version "${DOTNET_SDK_VERSION}" --install-dir "${DOTNET_PATH}"
curl https://dot.net/v1/dotnet-install.sh | \
/usr/bin/env bash -s -- --version "${DOTNET_RUNTIME_VERSION}" --shared-runtime --install-dir "${DOTNET_PATH}"
else
echo "Skipping download of .NET CLI: Already installed at ${DOTNET_PATH}"
fi
......
......@@ -20,10 +20,10 @@ If a stack trace is displayed on .NET Framework older than 4.7.1 (e.g. by xUnit
## Developing with Visual Studio 2017
1. [Visual Studio 2017 Update 3](https://www.visualstudio.com/vs/)
- Ensure C#, VB, MSBuild and Visual Studio Extensibility are included in the selected work loads
1. [Visual Studio 2017 Update 4](https://www.visualstudio.com/vs/)
- Ensure C#, VB, MSBuild, .NET Core and Visual Studio Extensibility are included in the selected work loads
- Ensure Visual Studio is on Version "15.3" or greater
1. [.NET Core SDK 2.1](https://www.microsoft.com/net/download/core) (if you don't see the 2.1 SDK binaries there yet, the current previews are: [Windows x64 installer](https://dotnetcli.blob.core.windows.net/dotnet/Sdk/2.1.1-preview-007094/dotnet-sdk-2.1.1-preview-007094-win-x64.exe), [Windows x86 installer](https://dotnetcli.blob.core.windows.net/dotnet/Sdk/2.1.1-preview-007094/dotnet-sdk-2.1.1-preview-007094-win-x86.exe))
1. [.NET Core SDK 2.2](https://www.microsoft.com/net/download/core) (if you don't see the 2.2 SDK binaries there yet, the current previews are: [Windows x64 installer](https://dotnetcli.blob.core.windows.net/dotnet/Sdk/2.2.0-preview1-007622/dotnet-sdk-2.2.0-preview1-007622-win-x64.exe), [Windows x86 installer](https://dotnetcli.blob.core.windows.net/dotnet/Sdk/2.2.0-preview1-007622/dotnet-sdk-2.2.0-preview1-007622-win-x86.exe))
1. [PowerShell 3.0 or newer](https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-windows-powershell). If you are on Windows 10, you are fine; you'll only need to upgrade if you're on Windows 7. The download link is under the "upgrading existing Windows PowerShell" heading.
1. Run Restore.cmd
1. Open Roslyn.sln
......
{
"sdk": {
"version": "2.1.1-preview-007094"
"version": "2.2.0-preview1-007622"
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册