|
1 | 1 | <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
| 2 | + |
| 3 | + <Import Project="Versioning.targets" /> |
| 4 | + |
2 | 5 | <Target Name="ValidateTargetFrameworks" BeforeTargets="Build"> |
3 | 6 | <ItemGroup> |
4 | 7 | <RequiredTargetFrameworks Include="$(RequiredTargetFrameworks)" /> |
|
43 | 46 | <Exec ConsoleToMSBuild="true" Command="$(PowerShellExe) -NoProfile -NonInteractive -executionpolicy Unrestricted -File $(CodeChecksScriptPath) -ProjectDirectory $(MSBuildProjectDirectory)"/> |
44 | 47 | </Target> |
45 | 48 |
|
| 49 | + <PropertyGroup> |
| 50 | + <OriginalReadmeMdPath>$([MSBuild]::NormalizeDirectory($(MSBuildProjectDirectory)/../))README.md</OriginalReadmeMdPath> |
| 51 | + <ProcessedReadmeMdPath>$(IntermediateOutputPath)README.md</ProcessedReadmeMdPath> |
| 52 | + <EnableNuGetReadmeMd Condition="'$(HasReleaseVersion)' == 'false' and Exists('$(OriginalReadmeMdPath)')">true</EnableNuGetReadmeMd> |
| 53 | + <PackageReadmeFile Condition="'$(EnableNuGetReadmeMd)' == 'true'">README.md</PackageReadmeFile> |
| 54 | + </PropertyGroup> |
| 55 | + |
| 56 | + <ItemGroup> |
| 57 | + <None Condition="'$(EnableNuGetReadmeMd)' != 'true' and Exists('$(OriginalReadmeMdPath)')" Include="$(OriginalReadmeMdPath)" Pack="true" PackagePath="/"/> |
| 58 | + <None Condition="'$(EnableNuGetReadmeMd)' == 'true'" Include="$(ProcessedReadmeMdPath)" Pack="true" PackagePath="/"/> |
| 59 | + </ItemGroup> |
| 60 | + |
| 61 | + <!-- Process and pack README.md --> |
| 62 | + <Target Name="ProcessReadmeMd" BeforeTargets="GenerateNuspec" Condition="'$(EnableNuGetReadmeMd)' == 'true'" > |
| 63 | + <PropertyGroup> |
| 64 | + <_ReadmeMdLines>$([System.IO.File]::ReadAllText($(OriginalReadmeMdPath)))</_ReadmeMdLines> |
| 65 | + |
| 66 | + <!-- remove comments https://github.com/NuGet/NuGetGallery/issues/8627 --> |
| 67 | + <_ReadmeMdLines><![CDATA[$([System.Text.RegularExpressions.Regex]::Replace('$(_ReadmeMdLines)', '\<\!--.*?-->', ''))]]></_ReadmeMdLines> |
| 68 | + <!-- remove impressions image --> |
| 69 | + <_ReadmeMdLines><![CDATA[$([System.Text.RegularExpressions.Regex]::Replace('$(_ReadmeMdLines)', '\!\[Impressions\]\(.*?\)', ''))]]></_ReadmeMdLines> |
| 70 | + </PropertyGroup> |
| 71 | + |
| 72 | + <WriteLinesToFile File="$(ProcessedReadmeMdPath)" Lines="$(_ReadmeMdLines)" Overwrite="true" WriteOnlyWhenDifferent="true" /> |
| 73 | + </Target> |
| 74 | + |
46 | 75 | <!-- This allows us to build .NET Framework targets on non-windows |
47 | 76 | TODO: Move the NETFramework reference assemblies to a feed other then the roslyn feed. |
48 | 77 | --> |
|
68 | 97 | <ItemGroup Condition="'$(IsTestProject)' != 'true'"> |
69 | 98 | <None Include="$(PackageIconPath)" Pack="true" PackagePath=""/> |
70 | 99 | <None Condition="Exists('$(MSBuildProjectDirectory)/../CHANGELOG.md')" Include="$(MSBuildProjectDirectory)/../CHANGELOG.md" Pack="true" PackagePath=""/> |
71 | | - <None Condition="Exists('$(MSBuildProjectDirectory)/../README.md')" Include="$(MSBuildProjectDirectory)/../README.md" Pack="true" PackagePath=""/> |
72 | 100 | </ItemGroup> |
73 | 101 |
|
74 | 102 | <!-- Add App.config to enable server GC in net461 perf and stress projects --> |
|
103 | 131 |
|
104 | 132 | <Import Project="$(DefaultReferenceTargets)" Condition="Exists('$(DefaultReferenceTargets)') And '$(ImportDefaultReferences)'=='true'" /> |
105 | 133 |
|
106 | | - <Import Project="Versioning.targets" /> |
107 | | - |
108 | 134 | <Import Project="ApiListing.targets" /> |
109 | 135 |
|
110 | 136 | <Import Project="CodeCoverage.targets" /> |
|
0 commit comments