Skip to content

Commit

Permalink
Fix condition for adding package readmes (dotnet#106590)
Browse files Browse the repository at this point in the history
* Fix condition for adding package readmes 

Fixes dotnet#106585

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

* Enable package readme validation for everything in runtime
  • Loading branch information
ViktorHofer authored and mikelle-rogers committed Dec 4, 2024
1 parent dcc0328 commit f69aa07
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 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
5 changes: 1 addition & 4 deletions src/libraries/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,11 @@
<Import Project="$(RepositoryEngineeringDir)targetingpacks.targets" />

<PropertyGroup>
<!-- Libraries ref and source projects which don't bring in dependencies from outside the repository shouldn't reference compat shims. -->
<!-- Libraries ref and source projects which don't bring in dependencies from outside the repository shouldn't reference compat shims. -->
<SkipTargetingPackShimReferences Condition="'$(UseLocalTargetingRuntimePack)' == 'true' and
'$(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

0 comments on commit f69aa07

Please sign in to comment.