Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove netstandard1.x dependencies in source-build #5885

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
<PropertyGroup>
<!-- Default MSBuild version -->
<MicrosoftBuildVersion Condition="'$(MicrosoftBuildVersion)' == ''">17.10.4</MicrosoftBuildVersion>
<!-- The last package version of MSBuild that works with netcoreapp3.1 or netstandard2.0 is 16.8.0. Our assemblies are still compiled against MSBuild assembly version 15.1.0.0 which will work with all versions -->
<MicrosoftBuildVersion Condition="'$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'netstandard2.0'">16.8.0</MicrosoftBuildVersion>
<!-- The last package version of MSBuild that works with net5.0 is 16.11.0. Our assemblies are still compiled against MSBuild assembly version 15.1.0.0 which will work with all versions -->
<MicrosoftBuildVersion Condition="'$(TargetFramework)' == 'netcoreapp5.0'">16.11.0</MicrosoftBuildVersion>
</PropertyGroup>
Expand All @@ -30,7 +28,7 @@
<SystemSecurityCryptographyPkcsVersion Condition="'$(SystemSecurityCryptographyPkcsVersion)' == ''">6.0.4</SystemSecurityCryptographyPkcsVersion>
<!-- System.Security.Cryptography.Xml is a dependency of Microsoft.Build.Tasks.Core. This property can be probably removed when MSBuild is updated to a newer version. -->
<SystemSecurityCryptographyXmlVersion Condition="'$(SystemSecurityCryptographyXmlVersion)' == ''">6.0.1</SystemSecurityCryptographyXmlVersion>
<SystemSecurityCryptographyXmlVersion Condition="'$(MicrosoftBuildVersion)' == '16.8.0' Or '$(MicrosoftBuildVersion)' == '16.11.0'">4.7.1</SystemSecurityCryptographyXmlVersion>
<SystemSecurityCryptographyXmlVersion Condition="'$(MicrosoftBuildVersion)' == '16.11.0'">4.7.1</SystemSecurityCryptographyXmlVersion>
</PropertyGroup>

<ItemGroup>
Expand All @@ -48,7 +46,7 @@
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.3.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.Features" Version="4.3.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.3.1" />
<PackageVersion Include="Microsoft.CSharp" Version="$(SystemPackagesVersion)" />
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
<PackageVersion Include="Microsoft.DataAI.NuGetRecommender.Contracts" Version="2.1.0" />
<PackageVersion Include="Microsoft.DotNet.Build.Tasks.Feed" Version="6.0.0-beta.20528.5" />
<PackageVersion Include="Microsoft.DotNet.Maestro.Tasks" Version="1.1.0-beta.21378.2" />
Expand Down
Empty file modified build.sh
100644 → 100755
Empty file.
3 changes: 2 additions & 1 deletion build/docs.proj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'README.md'))\build\common.props" />

<PropertyGroup>
<MarkdownAssemblyPath>$(ArtifactsDirectory)doc.tasks\bin\$(Configuration)\$(NetStandardVersion)\doc.tasks.dll</MarkdownAssemblyPath>
<MarkdownAssemblyPath Condition="'$(MSBuildRuntimeType)' == 'Core'">$(ArtifactsDirectory)doc.tasks\bin\$(Configuration)\$(NETCoreTargetFramework)\doc.tasks.dll</MarkdownAssemblyPath>
<MarkdownAssemblyPath Condition="'$(MSBuildRuntimeType)' != 'Core'">$(ArtifactsDirectory)doc.tasks\bin\$(Configuration)\$(NETFXTargetFramework)\doc.tasks.dll</MarkdownAssemblyPath>
<DocTaskPath>$(RepositoryRootDirectory)\tools-local\doc.tasks\doc.tasks.csproj</DocTaskPath>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(TargetFrameworksLibrary)</TargetFrameworks>
<TargetFrameworks>$(TargetFrameworksExe)</TargetFrameworks>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<AssemblyName>NuGet.Build.Tasks.Pack</AssemblyName>
<RootNamespace>$(AssemblyName)</RootNamespace>
Expand Down Expand Up @@ -41,7 +41,7 @@
<None Include="$(BuildCommonDirectory)NOTICES.txt" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' != '$(NETFXTargetFramework)' ">
<ItemGroup Condition=" '$(TargetFramework)' == '$(NETCoreTargetFramework)' ">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use TFI instead?

<PackageReference Include="Microsoft.Build.Framework" ExcludeAssets="runtime" GeneratePathProperty="true" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rainersigwald is it recommended to reference the MSBuild packages on all frameworks or just on the ones where references aren't available? Asking as in L35-L36, msbuild references are used from the .NET Framework installation when targeting netfx.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .NET Framework references are the "most compatible" option, but . . . do we really support modern Pack-in-MSBuild in Visual Studio 2010? That doesn't seem required.

I would lean toward "reference the packages at the explicit lowest-supported-version for the netfx output".

<PackageReference Include="Microsoft.Build.Tasks.Core" ExcludeAssets="runtime" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.Build.Utilities.Core" ExcludeAssets="runtime" GeneratePathProperty="true" />
Expand Down Expand Up @@ -127,9 +127,9 @@
$(PathToBuiltNuGetPack) ^
@(BuildArtifacts, ' ')</IlmergeCommand>
<IlmergeCommand Condition=" '$(TargetFramework)' != '$(NETFXTargetFramework)' ">$(IlmergeCommand) ^
/lib:$(PkgMicrosoft_Build_Utilities_Core)\lib\netstandard2.0 ^
/lib:$(PkgMicrosoft_Build_Tasks_Core)\lib\netstandard2.0 ^
/lib:$(PkgMicrosoft_Build_Framework)\lib\netstandard2.0
/lib:$(PkgMicrosoft_Build_Utilities_Core)\lib\net8.0 ^
/lib:$(PkgMicrosoft_Build_Tasks_Core)\lib\net8.0 ^
/lib:$(PkgMicrosoft_Build_Framework)\lib\net8.0
</IlmergeCommand>

</PropertyGroup>
Expand Down Expand Up @@ -214,8 +214,8 @@
<PropertyGroup>
<!-- Build from source can't use ILMerge and XPLat builds don't run the ILmerge targets. -->
<ILMergeSubpath Condition="'$(DotNetBuildSourceOnly)' != 'true' and '$(IsXPlat)' != 'true'">ilmerge\</ILMergeSubpath>
<PackagePathDir Condition="'$(TargetFramework)' == '$(NETFXTargetFramework)'">Desktop/</PackagePathDir>
<PackagePathDir Condition="'$(TargetFramework)' == '$(NetStandardVersion)'">CoreCLR/</PackagePathDir>
<PackagePathDir Condition="'$(TargetFramework)' == '$(NETFXTargetFramework)'">netframework/</PackagePathDir>
<PackagePathDir Condition="'$(TargetFramework)' == '$(NETCoreTargetFramework)'">net/</PackagePathDir>
</PropertyGroup>
<ItemGroup>
<TfmSpecificPackageFile Include="$(OutputPath)\$(ILMergeSubpath)NuGet.Build.Tasks.Pack.dll" Condition="'$(DotNetBuildSourceOnly)' != 'true'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Copyright (c) .NET Foundation. All rights reserved.

<!-- Load NuGet.Build.Tasks.Pack.dll, this can be overridden to use a different version with $(NuGetPackTaskAssemblyFile) -->
<PropertyGroup Condition="$(NuGetPackTaskAssemblyFile) == ''">
<NuGetPackTaskAssemblyFile Condition="'$(MSBuildRuntimeType)' == 'Core'">..\CoreCLR\NuGet.Build.Tasks.Pack.dll</NuGetPackTaskAssemblyFile>
<NuGetPackTaskAssemblyFile Condition="'$(MSBuildRuntimeType)' != 'Core'">..\Desktop\NuGet.Build.Tasks.Pack.dll</NuGetPackTaskAssemblyFile>
<NuGetPackTaskAssemblyFile Condition="'$(MSBuildRuntimeType)' == 'Core'">..\net\NuGet.Build.Tasks.Pack.dll</NuGetPackTaskAssemblyFile>
<NuGetPackTaskAssemblyFile Condition="'$(MSBuildRuntimeType)' != 'Core'">..\netframework\NuGet.Build.Tasks.Pack.dll</NuGetPackTaskAssemblyFile>
</PropertyGroup>

<!-- Tasks -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@

<ItemGroup>
<PackageReference Include="Microsoft.Web.Xdt" />
<PackageReference Include="Microsoft.CSharp" />
<PackageReference Include="Microsoft.CSharp" Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard'" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == '$(NETFXTargetFramework)' ">
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="Microsoft.Build" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Net.Http" />
</ItemGroup>
Expand Down
3 changes: 1 addition & 2 deletions tools-local/doc.tasks/doc.tasks.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>$(NetStandardVersion)</TargetFramework>
<TargetFrameworks />
<TargetFrameworks>$(TargetFrameworksExe)</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build.Framework" />
Expand Down
Loading