-
Notifications
You must be signed in to change notification settings - Fork 5k
Replace all remaining pkgprojs with NuGet Pack task #56712
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
Changes from all commits
c9cf047
d5bb915
bee162e
a4cc318
706767b
4312f8e
2866267
e18dd9f
2b2380b
7d4670a
2d1efbd
e14f1b1
c84de1e
985c5ba
47ea580
daef8c7
2b78770
e9a61f9
727eede
aa1b71a
a4dbdf8
140534a
28eec68
90a7a91
be0465f
a0e67ab
0e05341
267ed0b
0cc919a
825d26c
8e4d858
a591b4a
c6fb744
c5eceb8
1ee98b3
fd9fa9e
5136b7a
467b8d5
8972869
c3792b7
b6c8078
08d8116
1bf9641
2566496
11eaf7c
d22aab7
b169dd9
c0f6ea3
a9a88d5
ab10059
8e62254
67b4772
af64d81
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,55 @@ | ||
<Project InitialTargets="_OverridePackDependsOnForCsProjToPkgProj"> | ||
|
||
<PropertyGroup Condition="'$(IsPackable)' == 'true'"> | ||
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);AddRuntimeSpecificAssemblies;LibIntellisenseDocs</TargetsForTfmSpecificContentInPackage> | ||
<TargetsForTfmSpecificDebugSymbolsInPackage>$(TargetsForTfmSpecificDebugSymbolsInPackage);AddRuntimeDebugSymbolsWithTfm</TargetsForTfmSpecificDebugSymbolsInPackage> | ||
<EnablePackageValidation Condition="'$(IsSourceProject)' == 'true' and !Exists('$(PkgProjPath)')">true</EnablePackageValidation> | ||
<!-- Don't restore prebuilt packages during sourcebuild. --> | ||
<DisablePackageBaselineValidation Condition="'$(DotNetBuildFromSource)' == 'true'">true</DisablePackageBaselineValidation> | ||
<PackageValidationBaselineVersion Condition="'$(PackageValidationBaselineVersion)' == ''">$([MSBuild]::Subtract($(MajorVersion), 1)).0.0</PackageValidationBaselineVersion> | ||
<SymbolPackageOutputPath>$(PackageOutputPath)</SymbolPackageOutputPath> | ||
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);AddDocumentationFileToPackage;AddRuntimeSpecificFilesToPackage</TargetsForTfmSpecificContentInPackage> | ||
<TargetsForTfmSpecificDebugSymbolsInPackage>$(TargetsForTfmSpecificDebugSymbolsInPackage);AddRuntimeSpecificSymbolToPackage</TargetsForTfmSpecificDebugSymbolsInPackage> | ||
<IncludeBuildOutput Condition="'$(TargetsAnyOS)' != 'true' or '$(ExcludeFromPackage)' == 'true'">false</IncludeBuildOutput> | ||
<!-- Don't include target platform specific dependencies, since we use the target platform to represent RIDs instead --> | ||
<SuppressDependenciesWhenPacking Condition="'$(ExcludeFromPackage)' == 'true' or ('$(TargetsAnyOS)' != 'true' and $([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net5.0')))">true</SuppressDependenciesWhenPacking> | ||
<PackageDesignerMarkerFile>$(MSBuildThisFileDirectory)useSharedDesignerContext.txt</PackageDesignerMarkerFile> | ||
<PackageValidationBaselineVersion Condition="'$(PackageValidationBaselineVersion)' == ''">$([MSBuild]::Subtract($(MajorVersion), 1)).0.0</PackageValidationBaselineVersion> | ||
<BeforePack>IncludeAnalyzersInPackage;$(BeforePack)</BeforePack> | ||
<GenerateNuspecDependsOn>IncludeAnalyzersInPackage;$(GenerateNuspecDependsOn)</GenerateNuspecDependsOn> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Condition="'$(EnablePackageValidation)' == 'true'"> | ||
<PackageReference Include="Microsoft.DotNet.PackageValidation" Version="$(MicrosoftDotNetPackageValidationVersion)" PrivateAssets="all" IsImplicitlyDefined="true" /> | ||
<!-- TODO: Remove when the SDK is upgraded to RC1. --> | ||
<PackageDownload Include="$([MSBuild]::ValueOrDefault('$(PackageValidationBaselineName)', '$(PackageId)'))" | ||
Version="[$(PackageValidationBaselineVersion)]" | ||
Condition="'$(DisablePackageBaselineValidation)' != 'true' and '$(PackageValidationBaselinePath)' == '' and '$(PackageValidationBaselineVersion)' != ''" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(AddNETFrameworkAssemblyReferenceToPackage)' == 'true'"> | ||
<_FrameworkAssemblyReferences Include="$(MSBuildProjectName)" | ||
TargetFramework="net461" /> | ||
</ItemGroup> | ||
|
||
<Choose> | ||
<When Condition="'$(IsPackable)' == 'true' and | ||
('$(AddXamarinPlaceholderFilesToPackage)' == 'true' or '$(AddNETFrameworkPlaceholderFileToPackage)' == 'true')"> | ||
<PropertyGroup> | ||
<!-- Placeholders don't need a dependency group. --> | ||
<NoWarn>$(NoWarn);NU5128</NoWarn> | ||
</PropertyGroup> | ||
<ItemGroup Condition="'$(AddNETFrameworkPlaceholderFileToPackage)' == 'true'"> | ||
<None Include="$(PlaceholderFile)" PackagePath="lib/net461" Pack="true" /> | ||
<None Include="$(PlaceholderFile)" PackagePath="runtimes/win/lib/net461" Pack="true" Condition="$(TargetFrameworks.Contains('netstandard2.0-windows'))" /> | ||
</ItemGroup> | ||
<ItemGroup Condition="'$(AddXamarinPlaceholderFilesToPackage)' == 'true'"> | ||
<None Include="$(PlaceholderFile)" PackagePath="lib\MonoAndroid10" Pack="true" /> | ||
<None Include="$(PlaceholderFile)" PackagePath="lib\MonoTouch10" Pack="true" /> | ||
<None Include="$(PlaceholderFile)" PackagePath="lib\xamarinios10" Pack="true" /> | ||
<None Include="$(PlaceholderFile)" PackagePath="lib\xamarinmac20" Pack="true" /> | ||
<None Include="$(PlaceholderFile)" PackagePath="lib\xamarintvos10" Pack="true" /> | ||
<None Include="$(PlaceholderFile)" PackagePath="lib\xamarinwatchos10" Pack="true" /> | ||
</ItemGroup> | ||
</When> | ||
</Choose> | ||
|
||
<!-- There are some packages where we require only one ref for a specific framework to be present. In order to avoid problems with this package when targetting | ||
dektop with RAR we will make sure there are no exclude=compile references in the package. | ||
For more info, please check issues: | ||
|
@@ -22,7 +61,7 @@ | |
<Dependency> | ||
<Exclude></Exclude> | ||
</Dependency> | ||
</ItemGroup> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<Target Name="ValidateExcludeCompileDesktop" | ||
|
@@ -55,42 +94,62 @@ | |
Targets="Build" /> | ||
</Target> | ||
|
||
<Target Name="AddRuntimeSpecificAssemblies" | ||
DependsOnTargets="BuiltProjectOutputGroup;SatelliteDllsProjectOutputGroup;$(TargetsForTfmSpecificBuildOutput)" | ||
Condition="'$(TargetsAnyOS)' != 'true' and '$(ExcludeFromPackage)' == ''"> | ||
<Target Name="AddDocumentationFileToPackage" | ||
Condition="'$(ExcludeFromPackage)' != 'true'"> | ||
<PropertyGroup> | ||
<!-- Search for the documentation file in the intellisense package and otherwise pick up the generated one. --> | ||
<_documentationFileToPackage Condition="Exists('$(XmlDocFileRoot)1033\$(TargetName).xml')">$(XmlDocFileRoot)1033\$(TargetName).xml</_documentationFileToPackage> | ||
<_documentationFileToPackage Condition="'$(_documentationFileToPackage)' == '' and Exists('$(DocumentationFile)')">$(DocumentationFile)</_documentationFileToPackage> | ||
</PropertyGroup> | ||
<ItemGroup Condition="'$(_documentationFileToPackage)' != ''"> | ||
<!-- Place the documentation file into the lib or runtimes/lib folder depending on if the build is runtime agnostic or specific. --> | ||
<TfmSpecificPackageFile Include="$(_documentationFileToPackage)" | ||
PackagePath="$([MSBuild]::ValueOrDefault('$(BuildOutputTargetFolder)', 'lib'))/$(TargetFrameworkWithoutSuffix)" | ||
Condition="'$(TargetsAnyOS)' == 'true'" /> | ||
<TfmRuntimeSpecificPackageFile Include="$(_documentationFileToPackage)" | ||
Condition="'$(TargetsAnyOS)' != 'true'" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<Target Name="AddRuntimeSpecificFilesToPackage" | ||
DependsOnTargets="BuiltProjectOutputGroup; | ||
SatelliteDllsProjectOutputGroup; | ||
$(TargetsForTfmSpecificBuildOutput); | ||
AddDocumentationFileToPackage" | ||
Condition="'$(ExcludeFromPackage)' != 'true' and | ||
'$(TargetsAnyOS)' != 'true'"> | ||
<ItemGroup> | ||
<TfmSpecificPackageFile Include="@(SatelliteDllsProjectOutputGroupOutput); | ||
@(BuiltProjectOutputGroupOutput)"> | ||
<PackagePath>runtimes/$(_runtimeOS)/lib/$(TargetFrameworkWithoutSuffix)</PackagePath> | ||
</TfmSpecificPackageFile> | ||
<TfmRuntimeSpecificPackageFile Include="@(BuiltProjectOutputGroupOutput); | ||
@(SatelliteDllsProjectOutputGroupOutput)" /> | ||
<TfmSpecificPackageFile Include="@(TfmRuntimeSpecificPackageFile)" | ||
PackagePath="runtimes/$(PackageTargetRuntime)/lib/$(TargetFrameworkWithoutSuffix)" /> | ||
<!-- Copy runtime specific assemblies into the rid agnostic 'lib' folder if the ridless tfm doesn't exist on .NETFramework. | ||
The assumption holds that a ridless tfm doesn't follow a '-' charater. This is necessary to avoid NU5128. --> | ||
<TfmSpecificPackageFile Include="@(TfmRuntimeSpecificPackageFile)" | ||
ViktorHofer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
PackagePath="$([MSBuild]::ValueOrDefault('$(BuildOutputTargetFolder)', 'lib'))/$(TargetFrameworkWithoutSuffix)" | ||
Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' and !$([System.Text.RegularExpressions.Regex]::IsMatch('$(TargetFrameworks)', '$(TargetFrameworkWithoutSuffix)(?!-)'))" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<!-- Runtime independent symbols are automatically added by the pack task.--> | ||
<Target Name="AddRuntimeDebugSymbolsWithTfm" | ||
Condition="'$(IncludeSymbols)' == 'true' and '$(TargetsAnyOS)' != 'true' and '$(ExcludeFromPackage)' == ''"> | ||
<!-- Runtime agnostic symbols are automatically added by the pack task.--> | ||
<Target Name="AddRuntimeSpecificSymbolToPackage" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Potential for cleanup: I wonder if we need a separate target for this, or if we can just do it in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a different extension point "TargetsForTfmSpecificDebugSymbolsInPackage" than "TargetsForTfmSpecificContentInPackage" so IMO it makes sense to be a separate target. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could have a single target and include it in both lists, it'd only run once. Up to you what you think is more maintainable. Seemed to me like it might be nice to have symbol inclusion next to binary inclusion. |
||
Condition="'$(ExcludeFromPackage)' != 'true' and | ||
'$(TargetsAnyOS)' != 'true' and | ||
'$(IncludeSymbols)' == 'true'"> | ||
<PropertyGroup> | ||
<RuntimeSymbolPath>$([System.IO.Path]::GetDirectoryName($(TargetPath)))\$(TargetName).pdb</RuntimeSymbolPath> | ||
<RuntimeSymbolPath>$(TargetDir)$(TargetName).pdb</RuntimeSymbolPath> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Condition="Exists('$(RuntimeSymbolPath)')"> | ||
<TfmSpecificDebugSymbolsFile Include="$(RuntimeSymbolPath)"> | ||
<TargetPath>/runtimes/$(_runtimeOS)/lib/$(TargetFrameworkWithoutSuffix)/$(TargetName).pdb</TargetPath> | ||
<TargetFramework>$(TargetFrameworkWithoutSuffix)</TargetFramework> | ||
</TfmSpecificDebugSymbolsFile> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<Target Name="LibIntellisenseDocs" | ||
Condition="'$(IncludeBuildOutput)' == 'true'"> | ||
<PropertyGroup> | ||
<_intellisenseRootFolder>$(BuildOutputTargetFolder)</_intellisenseRootFolder> | ||
<_intellisenseRootFolder Condition="'$(_intellisenseRootFolder)' == ''">lib</_intellisenseRootFolder> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<TfmSpecificPackageFile Include="$(XmlDocFileRoot)1033\$(TargetName).xml" | ||
Condition="Exists('$(XmlDocFileRoot)1033\$(TargetName).xml')" | ||
PackagePath="$(_intellisenseRootFolder)/$(TargetFramework)" /> | ||
<TfmSpecificDebugSymbolsFile Include="$(RuntimeSymbolPath)" | ||
TargetPath="/runtimes/$(PackageTargetRuntime)/lib/$(TargetFrameworkWithoutSuffix)" | ||
TargetFramework="$(TargetFrameworkWithoutSuffix)" /> | ||
<!-- Copy runtime specific symbol into the rid agnostic 'lib' folder if the ridless tfm doesn't exist on .NETFramework. | ||
The assumption holds that a ridless tfm doesn't follow a '-' charater. This is necessary to avoid NU5128. --> | ||
<TfmSpecificDebugSymbolsFile Include="$(RuntimeSymbolPath)" | ||
TargetPath="/$([MSBuild]::ValueOrDefault('$(BuildOutputTargetFolder)', 'lib'))/$(TargetFrameworkWithoutSuffix)" | ||
TargetFramework="$(TargetFrameworkWithoutSuffix)" | ||
Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' and !$([System.Text.RegularExpressions.Regex]::IsMatch('$(TargetFrameworks)', '$(TargetFrameworkWithoutSuffix)(?!-)'))" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0"?> | ||
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | ||
<Suppression> | ||
<DiagnosticId>CP0001</DiagnosticId> | ||
<Left>lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll</Left> | ||
<Right>lib/netstandard2.1/Microsoft.Bcl.AsyncInterfaces.dll</Right> | ||
</Suppression> | ||
</Suppressions> |
Uh oh!
There was an error while loading. Please reload this page.