Skip to content

Commit 7effe75

Browse files
authored
Update to MSBuild 16, .NET Core 3.0 Preview 2 SDK, and remove obsolete tasks and targets (#935)
Part of dotnet/aspnetcore#7005. Resolves #881 Due to the large amount of breaking changes between MSBuild 15 and 16 (VS 2017 and VS 2019), I've decided to remove tasks broken by the upgrade instead of port them to a higher version. Changes: * Remove tasks related to dependency flow (replaced by Arcade) * Remove tasks which push and pack NuGet packages (replaced by Azure Pipelines and pack tasks in Microsoft.NET.Sdk) * Remove tasks for enabling/disabling strong name verification in .NET Framework (this was added as a workaround for bad builds from corefx which haven't happened in a long time) * Remove tasks related to running KoreBuild inside a Docker container (replaced by the `dockerbuild.sh` script in aspnet/AspNetCore`) * Remove unzip/zip tasks - there is now a version built-in to MSBuild itself which should be used instead
1 parent e4e248e commit 7effe75

File tree

112 files changed

+39
-7315
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+39
-7315
lines changed

BuildTools.sln

+3-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio 15
3-
VisualStudioVersion = 15.0.27121.1
4-
MinimumVisualStudioVersion = 15.0.26730.03
2+
# Visual Studio Version 16
3+
VisualStudioVersion = 16.0.0.0
4+
MinimumVisualStudioVersion = 16.0.0.0
55
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A4F4353B-C3D2-40B0-909A-5B48A748EA76}"
66
EndProject
77
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "files", "files", "{BF3E9C90-F129-4CE6-8F3B-F96831E4429B}"
@@ -82,10 +82,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGetPackageVerifier", "NuG
8282
EndProject
8383
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KoreBuild.Tasks.Tests", "test\KoreBuild.Tasks.Tests\KoreBuild.Tasks.Tests.csproj", "{A3A81E93-0157-406F-A43C-C163F7F781A9}"
8484
EndProject
85-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{B16B5072-3A0B-4527-8AB5-1C73A51684F7}"
86-
EndProject
87-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KoreBuild.Console", "tools\KoreBuild.Console\KoreBuild.Console.csproj", "{02F548A6-B0E9-4F09-BC03-812FC3C8F0D2}"
88-
EndProject
8985
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApiCheckForwardDestination", "test\ApiCheckForwardDestination\ApiCheckForwardDestination.csproj", "{605F0478-A9D2-4A8A-BB38-9D5DC132FBB5}"
9086
EndProject
9187
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NuGetPackageVerifier.Tests", "test\NuGetPackageVerifier.Tests\NuGetPackageVerifier.Tests.csproj", "{439CC7A3-F6E6-46B8-B6A0-05E22E558FC2}"
@@ -148,10 +144,6 @@ Global
148144
{A3A81E93-0157-406F-A43C-C163F7F781A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
149145
{A3A81E93-0157-406F-A43C-C163F7F781A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
150146
{A3A81E93-0157-406F-A43C-C163F7F781A9}.Release|Any CPU.Build.0 = Release|Any CPU
151-
{02F548A6-B0E9-4F09-BC03-812FC3C8F0D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
152-
{02F548A6-B0E9-4F09-BC03-812FC3C8F0D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
153-
{02F548A6-B0E9-4F09-BC03-812FC3C8F0D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
154-
{02F548A6-B0E9-4F09-BC03-812FC3C8F0D2}.Release|Any CPU.Build.0 = Release|Any CPU
155147
{605F0478-A9D2-4A8A-BB38-9D5DC132FBB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
156148
{605F0478-A9D2-4A8A-BB38-9D5DC132FBB5}.Debug|Any CPU.Build.0 = Debug|Any CPU
157149
{605F0478-A9D2-4A8A-BB38-9D5DC132FBB5}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -179,7 +171,6 @@ Global
179171
{020ED083-4076-4711-A52B-2F89EA884F9B} = {BD3545FB-5520-43DF-B4F9-83BEA3A38ECA}
180172
{C0E43505-F8EB-4B7F-B84D-5961F9763945} = {BD3545FB-5520-43DF-B4F9-83BEA3A38ECA}
181173
{A3A81E93-0157-406F-A43C-C163F7F781A9} = {60A938B2-D95A-403C-AA7A-3683AD64DFA0}
182-
{02F548A6-B0E9-4F09-BC03-812FC3C8F0D2} = {B16B5072-3A0B-4527-8AB5-1C73A51684F7}
183174
{605F0478-A9D2-4A8A-BB38-9D5DC132FBB5} = {60A938B2-D95A-403C-AA7A-3683AD64DFA0}
184175
{439CC7A3-F6E6-46B8-B6A0-05E22E558FC2} = {60A938B2-D95A-403C-AA7A-3683AD64DFA0}
185176
EndGlobalSection

build/dependencies.props

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,27 @@
1010
<MonoCecilPackageVersion>0.10.0-beta6</MonoCecilPackageVersion>
1111
<MoqPackageVersion>4.7.99</MoqPackageVersion>
1212
<!-- This one is OK for console tools that bundle their own version of JSON.NET -->
13-
<NewtonsoftJsonPackageVersion>10.0.1</NewtonsoftJsonPackageVersion>
13+
<NewtonsoftJsonPackageVersion>12.0.1</NewtonsoftJsonPackageVersion>
1414
<NuGetPackagingPackageVersion>4.7.0-rtm.5148</NuGetPackagingPackageVersion>
1515
<NuGetProjectModelPackageVersion>4.7.0-rtm.5148</NuGetProjectModelPackageVersion>
1616
<VSWherePackageVersion>2.2.7</VSWherePackageVersion>
17-
<XunitPackageVersion>2.3.1</XunitPackageVersion>
18-
<XunitRunnerVisualStudioPackageVersion>2.3.1</XunitRunnerVisualStudioPackageVersion>
17+
<XunitPackageVersion>2.4.1</XunitPackageVersion>
18+
<XunitRunnerVisualStudioPackageVersion>2.4.1</XunitRunnerVisualStudioPackageVersion>
1919
</PropertyGroup>
2020

2121
<!--
22-
Attempt to keep these mostly aligned with https://github.com/dotnet/toolset/blob/master/build/DependencyVersions.props
22+
Attempt to keep these mostly aligned with https://github.com/dotnet/toolset/blob/master/env/Versions.props
2323
and with the version of MSBuild used by KoreBuild.
2424
MSBuild will prefer the assemblies that ship in the .NET Core SDK and MSbuild. The dependency versions here don't matter
2525
as long as the version we compile for is binary compatible with what the .NET Core SDK uses.
2626
-->
2727
<PropertyGroup>
28-
<MicrosoftBuildPackageVersion>15.9.19</MicrosoftBuildPackageVersion>
28+
<MicrosoftBuildPackageVersion>16.0.0-preview.383</MicrosoftBuildPackageVersion>
2929
<MicrosoftBuildFrameworkPackageVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildFrameworkPackageVersion>
3030
<MicrosoftBuildUtilitiesCorePackageVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildUtilitiesCorePackageVersion>
3131
<MicrosoftBuildTasksCorePackageVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildTasksCorePackageVersion>
3232
<Tooling_NewtonsoftJsonPackageVersion>9.0.1</Tooling_NewtonsoftJsonPackageVersion>
33-
<Tooling_NuGetBuildTasksPackageVersion>4.9.0-preview3.5473</Tooling_NuGetBuildTasksPackageVersion>
33+
<Tooling_NuGetBuildTasksPackageVersion>5.0.0-preview1.5663</Tooling_NuGetBuildTasksPackageVersion>
3434
</PropertyGroup>
3535

3636
<!-- These are set to flow into RepoTasks.csproj -->

build/repo.props

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
<ItemGroup>
1111
<KoreBuildModule Include="BuildTools.Tasks" />
12-
<KoreBuildModule Include="BundledPackages" />
1312
<KoreBuildModule Include="KoreBuild.Tasks" />
1413
<KoreBuildModule Include="NuGetPackageVerifier" />
1514
</ItemGroup>

build/repo.targets

-11
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,6 @@
4747
<Error Text="Missing property: KoreBuildChannel" Condition="'$(KoreBuildChannel)' == ''" />
4848
<Error Text="Missing property: Version" Condition="'$(Version)' == ''" />
4949

50-
<ItemGroup>
51-
<_ToolsProjects Include="$(RepositoryRoot)tools\KoreBuild.Console\KoreBuild.Console.csproj">
52-
<AdditionalProperties>PublishDir=$(_KoreBuildIntermediateDir)\tools\%(Identity)\</AdditionalProperties>
53-
</_ToolsProjects>
54-
</ItemGroup>
55-
56-
<MSBuild Targets="Publish"
57-
Projects="@(_ToolsProjects)"
58-
Properties="$(BuildProperties)"
59-
BuildInParallel="true" />
60-
6150
<ItemGroup>
6251
<Content Include="$(RepositoryRoot)files\KoreBuild\**\*" />
6352
<VersionFileLines Include="version:$(Version)" />

build/tasks/RepoTasks.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<Compile Include="..\..\modules\BuildTools.Tasks\GenerateSvgBadge.cs" />
1818
<Compile Include="..\..\modules\BuildTools.Tasks\RunBase.cs" />
1919
<Compile Include="..\..\modules\BuildTools.Tasks\RunDotNet.cs" />
20-
<Compile Include="..\..\modules\BuildTools.Tasks\ZipArchive.cs" />
2120
</ItemGroup>
2221

2322
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), version.props))\build\sdk.targets" />
File renamed without changes.

docs/Logging.md

-10
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,3 @@ KoreBuild produces log files to $(RepositoryRoot)/artifacts/logs. The following
88
Using `build.cmd -Verbose` will produce a binary log file to artifacts/logs/msbuild.binlog.
99

1010
See <http://msbuildlog.com> for details.
11-
12-
## TeamCity Logger
13-
14-
KoreBuild can produce log messages for TeamCity by using <https://github.com/JetBrains/TeamCity.MSBuild.Logger>.
15-
16-
To configure this,
17-
18-
1. Download the logger from JetBrains. https://github.com/JetBrains/TeamCity.MSBuild.Logger#download
19-
2. Install this on CI agents.
20-
3. Set the environment variable `KOREBUILD_TEAMCITY_LOGGER` to the file path of TeamCity.MSBuild.Logger.dll on CI agents.

docs/PackageReferenceManagement.md

-87
This file was deleted.

docs/Sdk.md

-31
This file was deleted.

files/KoreBuild/KoreBuild.Common.props

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ Default layout and configuration.
3737
<RepositoryRoot>$([MSBuild]::NormalizeDirectory('$(RepositoryRoot)'))</RepositoryRoot>
3838
<ArtifactsDir>$([MSBuild]::NormalizeDirectory('$(RepositoryRoot)'))artifacts\</ArtifactsDir>
3939
<BuildDir>$(ArtifactsDir)build\</BuildDir>
40-
<LogOutputDir>$(ArtifactsDir)logs\</LogOutputDir>
41-
<IntermediateDir>$([MSBuild]::NormalizeDirectory('$(RepositoryRoot)'))obj\</IntermediateDir>
40+
<LogOutputDir Condition="'$(LogOutputDir)' == ''">$(ArtifactsDir)logs\</LogOutputDir>
41+
<IntermediateDir Condition="'$(IntermediateDir)' == ''">$([MSBuild]::NormalizeDirectory('$(RepositoryRoot)'))obj\</IntermediateDir>
4242

4343
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(NUGET_PACKAGES)</NuGetPackageRoot>
4444
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' AND '$(USERPROFILE)' != '' ">$(USERPROFILE)\.nuget\packages\</NuGetPackageRoot>

files/KoreBuild/KoreBuild.sh

+2-21
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,8 @@ invoke_korebuild_command(){
7272
elif [ "$command" = "install-tools" ]; then
7373
__install_tools "$tools_source" "$dot_net_home"
7474
else
75-
__ensure_dotnet
76-
77-
kore_build_console_dll="$__korebuild_dir/tools/KoreBuild.Console.dll"
78-
79-
__exec dotnet "$kore_build_console_dll" "$command" \
80-
--tools-source "$tools_source" \
81-
--dotnet-home "$dot_net_home" \
82-
--repo-path "$repo_path" \
83-
"$@"
75+
__error "Unrecognized command '$command'"
76+
exit 1
8477
fi
8578
}
8679

@@ -129,18 +122,6 @@ __install_tools() {
129122

130123
# Set environment variables
131124
export PATH="$install_dir:$PATH"
132-
133-
# This is a workaround for https://github.com/Microsoft/msbuild/issues/2914.
134-
# Currently, the only way to configure the NuGetSdkResolver is with NuGet.config, which is not generally used in aspnet org projects.
135-
# This project is restored so that it pre-populates the NuGet cache with SDK packages.
136-
local restorerfile="$__korebuild_dir/modules/BundledPackages/BundledPackageRestorer.csproj"
137-
local restorerfilelock="$NUGET_PACKAGES/internal.aspnetcore.sdk/$(__get_korebuild_version)/korebuild.sentinel"
138-
if [[ -e "$restorerfile" ]] && [[ ! -e "$restorerfilelock" ]]; then
139-
mkdir -p "$(dirname $restorerfilelock)"
140-
touch "$restorerfilelock"
141-
__exec dotnet msbuild -t:restore -v:q "$restorerfile"
142-
fi
143-
# end workaround
144125
}
145126

146127
__show_version_info() {

files/KoreBuild/config/sdk.version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.100-preview-009750
1+
3.0.100-preview-010184

files/KoreBuild/scripts/KoreBuild.psm1

+8-14
Original file line numberDiff line numberDiff line change
@@ -221,18 +221,6 @@ function Install-Tools(
221221
else {
222222
Write-Host -ForegroundColor DarkGray ".NET Core SDK $version is already installed. Skipping installation."
223223
}
224-
225-
# This is a workaround for https://github.com/Microsoft/msbuild/issues/2914.
226-
# Currently, the only way to configure the NuGetSdkResolver is with NuGet.config, which is not generally used in aspnet org projects.
227-
# This project is restored so that it pre-populates the NuGet cache with SDK packages.
228-
$restorerfile = "$PSScriptRoot/../modules/BundledPackages/BundledPackageRestorer.csproj"
229-
$restorerfilelock="$env:NUGET_PACKAGES/internal.aspnetcore.sdk/$(Get-KoreBuildVersion)/korebuild.sentinel"
230-
if ((Test-Path $restorerfile) -and -not (Test-Path $restorerfilelock)) {
231-
New-Item -ItemType Directory $(Split-Path -Parent $restorerfilelock) -ErrorAction Ignore | Out-Null
232-
New-Item -ItemType File $restorerfilelock -ErrorAction Ignore | Out-Null
233-
__exec $global:dotnet msbuild '-t:restore' '-v:q' "$restorerfile"
234-
}
235-
# end workaround
236224
}
237225

238226
<#
@@ -492,8 +480,14 @@ function Get-MSBuildPath() {
492480
}
493481

494482
Write-Verbose "vswhere = $vswherePath $vswhereArgs"
495-
496-
$installations = & $vswherePath @vswhereArgs | Out-String | ConvertFrom-Json
483+
$vswhereOut = & $vswherePath @vswhereArgs | Out-String
484+
try {
485+
$installations = $vswhereOut | ConvertFrom-Json
486+
}
487+
catch {
488+
Write-Host -f Red "vswhere output = $vswhereOut"
489+
throw $_
490+
}
497491

498492
$latest = $null
499493
if ($installations) {

modules/BuildTools.Tasks/BuildTools.Tasks.props

-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44
<UsingTask TaskName="Microsoft.AspNetCore.BuildTools.$(_BuildTasksPrefix)GenerateFileFromTemplate" AssemblyFile="$(_BuildToolsAssembly)" />
55
<UsingTask TaskName="Microsoft.AspNetCore.BuildTools.$(_BuildTasksPrefix)GetAssemblyFileVersion" AssemblyFile="$(_BuildToolsAssembly)" />
66
<UsingTask TaskName="Microsoft.AspNetCore.BuildTools.$(_BuildTasksPrefix)GenerateSvgBadge" AssemblyFile="$(_BuildToolsAssembly)" />
7-
<UsingTask TaskName="Microsoft.AspNetCore.BuildTools.$(_BuildTasksPrefix)SetEnvironmentVariable" AssemblyFile="$(_BuildToolsAssembly)" />
8-
<UsingTask TaskName="Microsoft.AspNetCore.BuildTools.$(_BuildTasksPrefix)UpdatePackageSource" AssemblyFile="$(_BuildToolsAssembly)" />
9-
<UsingTask TaskName="Microsoft.AspNetCore.BuildTools.$(_BuildTasksPrefix)WaitForDebugger" AssemblyFile="$(_BuildToolsAssembly)" />
10-
<UsingTask TaskName="Microsoft.AspNetCore.BuildTools.$(_BuildTasksPrefix)ZipArchive" AssemblyFile="$(_BuildToolsAssembly)" />
11-
<UsingTask TaskName="Microsoft.AspNetCore.BuildTools.$(_BuildTasksPrefix)UnzipArchive" AssemblyFile="$(_BuildToolsAssembly)" />
127
<UsingTask TaskName="Microsoft.AspNetCore.BuildTools.$(_BuildTasksPrefix)Run" AssemblyFile="$(_BuildToolsAssembly)" />
138
<UsingTask TaskName="Microsoft.AspNetCore.BuildTools.$(_BuildTasksPrefix)RunDotNet" AssemblyFile="$(_BuildToolsAssembly)" />
149

modules/BuildTools.Tasks/SetEnvironmentVariable.cs

-41
This file was deleted.

0 commit comments

Comments
 (0)