未验证 提交 28b9c72d 编写于 作者: A Anirudh Agnihotry 提交者: GitHub

Add Infra for porting lib only packages to use dotnet pack instead of pkgprojs (#51765)

* add infra and move projects to use dotnet pack

* adddress feedback

* address feedback

* donot include buildoutput from netfx during sourcebuild

* some more feedback points

* add  SuppressDependenciesWhenPacking as well

* Apply suggestions from code review
Co-authored-by: NViktor Hofer <viktor.hofer@microsoft.com>

* Update src/libraries/Directory.Build.targets
Co-authored-by: NViktor Hofer <viktor.hofer@microsoft.com>

* remove warn

* Update src/libraries/Directory.Build.targets
Co-authored-by: NViktor Hofer <viktor.hofer@microsoft.com>

* donot set includebuild output in outerbuild
Co-authored-by: NViktor Hofer <viktor.hofer@microsoft.com>
上级 e8aa0610
......@@ -230,9 +230,11 @@
<RepositoryUrl>https://github.com/dotnet/$(GitHubRepositoryName)</RepositoryUrl>
<PackageProjectUrl>https://dot.net</PackageProjectUrl>
<Owners>microsoft,dotnetframework</Owners>
<IncludeSymbols>true</IncludeSymbols>
<RuntimeIdGraphDefinitionFile>$([MSBuild]::NormalizePath('$(LibrariesProjectRoot)', 'Microsoft.NETCore.Platforms', 'src', 'runtime.json'))</RuntimeIdGraphDefinitionFile>
<LicenseFile>$(MSBuildThisFileDirectory)LICENSE.TXT</LicenseFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Copyright>$(CopyrightNetFoundation)</Copyright>
<PackageThirdPartyNoticesFile>$(MSBuildThisFileDirectory)THIRD-PARTY-NOTICES.TXT</PackageThirdPartyNoticesFile>
<PackageReleaseNotes>https://go.microsoft.com/fwlink/?LinkID=799421</PackageReleaseNotes>
......
......@@ -27,6 +27,7 @@
</PropertyGroup>
<PropertyGroup>
<NuSpecOutputPath Condition="'$(NuSpecOutputPath)' == ''">$([MSBuild]::NormalizeDirectory('$(ArtifactsPackagesDir)', 'specs'))</NuSpecOutputPath>
<PkgProjPath>$(MSBuildProjectDirectory)\..\pkg\$(MSBuildProjectName).pkgproj</PkgProjPath>
</PropertyGroup>
......
......@@ -12,6 +12,7 @@
<Import Project="..\..\Directory.Build.targets" />
<PropertyGroup>
<TargetsForTfmSpecificContentInPackage Condition="'$(IsPackable)' == 'true'">$(TargetsForTfmSpecificContentInPackage);LibIntellisenseDocs</TargetsForTfmSpecificContentInPackage>
<SymbolPackageOutputPath>$(PackageOutputPath)</SymbolPackageOutputPath>
<NoWarn Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' or '$(TargetFrameworkIdentifier)' == '.NETStandard' or ('$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionLessThan($(TargetFrameworkVersion), '3.0')))">$(NoWarn);nullable</NoWarn>
<NoWarn Condition="'$(GeneratePlatformNotSupportedAssembly)' == 'true' or '$(GeneratePlatformNotSupportedAssemblyMessage)' != ''">$(NoWarn);nullable;CA1052</NoWarn>
......@@ -229,6 +230,11 @@
<ExcludeFromPackage Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '$(NetCoreAppCurrent)')) and '$(ExcludeCurrentNetCoreAppFromPackage)' == 'true'">true</ExcludeFromPackage>
</PropertyGroup>
<PropertyGroup Condition="'$(IsCrossTargetingBuild)' != 'true' and '$(DotnetBuildFromSource)' == 'true' and '$(IsPackable)' == 'true' and !$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '$(NetCoreAppCurrent)')) and '$(TargetFrameworkIdentifier)' != '.NETStandard' and '$(TargetFrameworkVersion)' != 'v2.0'">
<IncludeBuildOutput>false</IncludeBuildOutput>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
</PropertyGroup>
<!-- If a project is downlevel from net5.0 but uses the platform support attributes, then we include the
System.Runtime.Versioning*Platform* annotation attribute classes in the project as internal.
......@@ -272,4 +278,21 @@
</ItemGroup>
</When>
</Choose>
<Target Name="LibIntellisenseDocs" Condition="'$(IncludeBuildOutput)' == 'true'">
<ItemGroup>
<TfmSpecificPackageFile Include="$(XmlDocFileRoot)1033\$(TargetName).xml"
Condition="Exists('$(XmlDocFileRoot)1033\$(TargetName).xml')"
PackagePath="lib/$(TargetFramework)" />
</ItemGroup>
</Target>
<!-- TODO: Remove this after https://github.com/NuGet/NuGet.Client/pull/3980 is merged.-->
<Target Name="RemoveXmlFilesFromBuildOutput" BeforeTargets="GenerateNuspec">
<PropertyGroup>
<AllowedOutputExtensionsInPackageBuildOutputFolder>.dll;.exe;.winmd;.json;.pri;</AllowedOutputExtensionsInPackageBuildOutputFolder>
<AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder>.pdb;.mdb;$(AllowedOutputExtensionsInPackageBuildOutputFolder)</AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder>
</PropertyGroup>
</Target>
</Project>
<Project>
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<PackageDescription>Environment variables configuration provider implementation for Microsoft.Extensions.Configuration.</PackageDescription>
<IsAspNetCoreApp>true</IsAspNetCoreApp>
</PropertyGroup>
</Project>
\ No newline at end of file
<Project DefaultTargets="Build">
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
<ItemGroup>
<ProjectReference Include="..\src\Microsoft.Extensions.Configuration.EnvironmentVariables.csproj">
<SupportedFramework>net461;netcoreapp2.0;uap10.0.16299;$(AllXamarinFrameworks)</SupportedFramework>
</ProjectReference>
</ItemGroup>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
</Project>
\ No newline at end of file
......@@ -2,7 +2,9 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<IsPackable>true</IsPackable>
<EnableDefaultItems>true</EnableDefaultItems>
<PackageDescription>Environment variables configuration provider implementation for Microsoft.Extensions.Configuration.</PackageDescription>
</PropertyGroup>
<ItemGroup>
......
......@@ -9,6 +9,7 @@
<IsSourceProject>false</IsSourceProject>
<IsPackable>true</IsPackable>
<IncludeBuildOutput>false</IncludeBuildOutput>
<IncludeSymbols>false</IncludeSymbols>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
<NoWarn>$(NoWarn);NU5128</NoWarn> <!-- No Dependencies-->
<PackageDescription>Provides runtime information required to resolve target framework, platform, and runtime specific implementations of .NETCore packages.</PackageDescription>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册