diff options
author | Viktor Hofer <viktor.hofer@microsoft.com> | 2021-08-11 13:50:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-11 13:50:46 +0300 |
commit | 85441ce69b81dfd5bf57b9d00ba525440b7bb25d (patch) | |
tree | cc61690fc004f48c81af08b204da05ff192e28f5 /eng/packaging.targets | |
parent | c0662e8129beaf93b8050d39a863cc6d16a0308c (diff) |
Make sure rid specific libs projs get packaged (#57193)
* Make sure rid specific libs projs get packaged
RID specific runtime.*.runtime.native.System.IO.Ports projects weren't
packaged because the GeneratePackageOnBuild property wasn't set to true
for them. The property was only true during an allconfigurations build.
As these projects are only built outside of an allconfigurations build,
the GeneratePackageOnBuild property needs to account for such as well.
Also updating the NoTargets Sdk to clean the rid specific package up.
Moving the GeneratePackageOnBuild logic into a props file and set it to
false during servicing (or runtimelab) so that devs can set the property
during servicing directly in the project file if a project should be
packaged.
* Remove the GeneratePackage property
That property was intended to enabled incremental servicing but with
now using the NuGet Pack task we can just make use of the publicl
available GeneratePackageOnBuild property.
* Fix IsPackable setting
Diffstat (limited to 'eng/packaging.targets')
-rw-r--r-- | eng/packaging.targets | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/eng/packaging.targets b/eng/packaging.targets index ecd2363fd2b..8b93352840b 100644 --- a/eng/packaging.targets +++ b/eng/packaging.targets @@ -5,6 +5,10 @@ <!-- Don't restore prebuilt packages during sourcebuild. --> <DisablePackageBaselineValidation Condition="'$(DotNetBuildFromSource)' == 'true'">true</DisablePackageBaselineValidation> <PackageValidationBaselineVersion Condition="'$(PackageValidationBaselineVersion)' == ''">$([MSBuild]::Subtract($(MajorVersion), 1)).0.0</PackageValidationBaselineVersion> + <!-- PackDependsOn is the right hook in a targets file if the NuGet.Build.Tasks.Pack nuget package is used, otherwise + BeforePack must be used. Setting both to ensure that we are always running before other targets. --> + <PackDependsOn>AddNETStandardCompatErrorFileForPackaging;IncludeAnalyzersInPackage;$(PackDependsOn)</PackDependsOn> + <BeforePack>AddNETStandardCompatErrorFileForPackaging;IncludeAnalyzersInPackage;$(BeforePack)</BeforePack> <SymbolPackageOutputPath>$(PackageOutputPath)</SymbolPackageOutputPath> <TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);AddRuntimeSpecificFilesToPackage</TargetsForTfmSpecificContentInPackage> <TargetsForTfmSpecificDebugSymbolsInPackage>$(TargetsForTfmSpecificDebugSymbolsInPackage);AddRuntimeSpecificSymbolToPackage</TargetsForTfmSpecificDebugSymbolsInPackage> @@ -12,8 +16,14 @@ <!-- 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> - <!-- Generate packages in the allconfigurations build. --> - <GeneratePackageOnBuild Condition="'$(BuildAllConfigurations)' == 'true'">true</GeneratePackageOnBuild> + <!-- Generate packages for rid specific projects or for allconfigurations during build. --> + <!-- A package isn't generated if in servicing or in runtimelab. Intended to be overridden at project level. --> + <IsRIDSpecificProject Condition="$(MSBuildProjectName.StartsWith('runtime.')) and + !$(MSBuildProjectName.StartsWith('runtime.native'))">true</IsRIDSpecificProject> + <GeneratePackageOnBuild Condition="('$(BuildAllConfigurations)' == 'true' or + '$(IsRIDSpecificProject)' == 'true') and + '$(PreReleaseVersionLabel)' != 'servicing' and + '$(GitHubRepositoryName)' != 'runtimelab'">true</GeneratePackageOnBuild> <!-- Search for the documentation file in the intellisense package and otherwise pick up the generated one. --> <LibIntellisenseDocumentationFilePath>$(XmlDocFileRoot)1033\$(AssemblyName).xml</LibIntellisenseDocumentationFilePath> <UseIntellisenseDocumentationFile Condition="'$(UseIntellisenseDocumentationFile)' == '' and Exists('$(LibIntellisenseDocumentationFilePath)')">true</UseIntellisenseDocumentationFile> |