Skip to content

Commit

Permalink
[release/9.0-rc1] Fix condition for adding package readmes (#106592)
Browse files Browse the repository at this point in the history
* Fix condition for adding package readmes

Fixes #106585

The EnableDefualtPackageReadmeFile property needs to be defined before packaging.targets is imported.

* Update workloads.csproj

---------

Co-authored-by: Viktor Hofer <[email protected]>
  • Loading branch information
github-actions[bot] and ViktorHofer authored Aug 19, 2024
1 parent a73a65b commit 2a9d9bc
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions eng/packaging.targets
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<PackageDesignerMarkerFile>$(MSBuildThisFileDirectory)useSharedDesignerContext.txt</PackageDesignerMarkerFile>

<!-- PackageReadmeFile specifies the package readme file name in the package. PackageReadmeFilePath points to the package readme file on disk. -->
<EnableDefaultPackageReadmeFile Condition="'$(EnableDefaultPackageReadmeFile)' == '' and '$(IsShipping)' == 'true'">true</EnableDefaultPackageReadmeFile>
<PackageReadmeFile Condition="'$(PackageReadmeFile)' == '' and '$(EnableDefaultPackageReadmeFile)' == 'true'">PACKAGE.md</PackageReadmeFile>
<PackageReadmeFilePath Condition="'$(PackageReadmeFilePath)' == '' and '$(EnableDefaultPackageReadmeFile)' == 'true'">PACKAGE.md</PackageReadmeFilePath>
<BeforePack>$(BeforePack);ValidatePackageReadmeExists</BeforePack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<SharedFrameworkName>$(MicrosoftNetCoreAppFrameworkName)</SharedFrameworkName>
<IsShipping Condition="'$(PgoInstrument)' != ''">false</IsShipping>
<SharedFrameworkFriendlyName>.NET Runtime</SharedFrameworkFriendlyName>
<EnableDefaultPackageReadmeFile>true</EnableDefaultPackageReadmeFile>
</PropertyGroup>

<!--
Expand Down
3 changes: 0 additions & 3 deletions src/libraries/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@
'$(IsTestProject)' != 'true' and
'$(IsTestSupportProject)' != 'true' and
'$(IsGeneratorProject)' != 'true'">true</SkipTargetingPackShimReferences>

<!-- Make libraries packages use and require a package readme file. -->
<EnableDefaultPackageReadmeFile Condition="'$(EnableDefaultPackageReadmeFile)' == '' and '$(IsShipping)' == 'true'">true</EnableDefaultPackageReadmeFile>
</PropertyGroup>

<Import Project="$(RepositoryEngineeringDir)codeOptimization.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
<NoWarn>$(NoWarn);NU5128</NoWarn>
<IsPackable>true</IsPackable>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<!-- TODO: Add package readme -->
<EnableDefaultPackageReadmeFile>false</EnableDefaultPackageReadmeFile>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<IsShipping>true</IsShipping>
<BuildingOutsideDiagnostics>false</BuildingOutsideDiagnostics>
<BuildingOutsideDiagnostics Condition="'$(GitHubRepositoryName)' != 'diagnostics'">true</BuildingOutsideDiagnostics>
<!-- TODO: Add package readme -->
<EnableDefaultPackageReadmeFile>false</EnableDefaultPackageReadmeFile>
</PropertyGroup>

<PropertyGroup Condition="$(BuildingOutsideDiagnostics)">
Expand Down
2 changes: 2 additions & 0 deletions src/tools/illink/src/ILLink.Tasks/ILLink.Tasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
<IncludeBuildOutput>false</IncludeBuildOutput>
<IncludeMultiTargetRoslynComponentTargets>false</IncludeMultiTargetRoslynComponentTargets>
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);AddBuildOutputToToolsPackage</TargetsForTfmSpecificContentInPackage>
<!-- TODO: Add package readme -->
<EnableDefaultPackageReadmeFile>false</EnableDefaultPackageReadmeFile>
</PropertyGroup>

<!-- Include the illink.runtimeconfig.pack.json file (which depends on the runtimeversion being built)
Expand Down
5 changes: 3 additions & 2 deletions src/workloads/workloads.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,9 @@
<MsiPackageProjects Include="%(Msis.PackageProject)" />
</ItemGroup>

<!-- We disable PackageValidation which runs because these projects import the repo's Directory.Build.props and Directory.Build.targets file. -->
<MSBuild Projects="@(MsiPackageProjects)" Properties="OutputPath=$(ArtifactsShippingPackagesDir);IncludeSymbols=false;EnablePackageValidation=false" Targets="restore;pack" />
<!-- Disable PackageValidation which runs because these projects import the repo's Directory.Build.props and Directory.Build.targets file.
Don't validate that the packages have a package readme file. -->
<MSBuild Projects="@(MsiPackageProjects)" Properties="OutputPath=$(ArtifactsShippingPackagesDir);IncludeSymbols=false;EnablePackageValidation=false;EnableDefaultPackageReadmeFile=false" Targets="Restore;Pack" />
</Target>

<!-- Target to create a single wixpack for signing -->
Expand Down

0 comments on commit 2a9d9bc

Please sign in to comment.