Skip to content

Commit 09cc00a

Browse files
authored
Add a flag to enable NuGet.org README.md display (Azure#21157)
1 parent 69e5271 commit 09cc00a

File tree

4 files changed

+34
-5
lines changed

4 files changed

+34
-5
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- Install VS 2019 (Community or higher) and make sure you have the latest updates (https://www.visualstudio.com/).
1010
- Need at least .NET Framework 4.6.1 and 4.7 development tools
1111
- Install the **.NET Core cross-platform development** workloads in VisualStudio
12-
- Install **.NET Core 5.0.200 SDK** for your specific platform. (or a higher version within the 5.0.*** band) (https://dotnet.microsoft.com/download/dotnet-core/5.0)
12+
- Install **.NET Core 5.0.301 SDK** for your specific platform. (or a higher version within the 5.0.*** band) (https://dotnet.microsoft.com/download/dotnet-core/5.0)
1313
- Install the latest version of git (https://git-scm.com/downloads)
1414
- Install [PowerShell](https://docs.microsoft.com/powershell/scripting/install/installing-powershell), version 6 or higher, if you plan to make public API changes or are working with generated code snippets.
1515
- Install [NodeJS](https://nodejs.org/) (14.x.x) if you plan to use [C# code generation](https://github.com/Azure/autorest.csharp).

eng/Directory.Build.Common.targets

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
3+
<Import Project="Versioning.targets" />
4+
25
<Target Name="ValidateTargetFrameworks" BeforeTargets="Build">
36
<ItemGroup>
47
<RequiredTargetFrameworks Include="$(RequiredTargetFrameworks)" />
@@ -43,6 +46,32 @@
4346
<Exec ConsoleToMSBuild="true" Command="$(PowerShellExe) -NoProfile -NonInteractive -executionpolicy Unrestricted -File $(CodeChecksScriptPath) -ProjectDirectory $(MSBuildProjectDirectory)"/>
4447
</Target>
4548

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+
4675
<!-- This allows us to build .NET Framework targets on non-windows
4776
TODO: Move the NETFramework reference assemblies to a feed other then the roslyn feed.
4877
-->
@@ -68,7 +97,6 @@
6897
<ItemGroup Condition="'$(IsTestProject)' != 'true'">
6998
<None Include="$(PackageIconPath)" Pack="true" PackagePath=""/>
7099
<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=""/>
72100
</ItemGroup>
73101

74102
<!-- Add App.config to enable server GC in net461 perf and stress projects -->
@@ -103,8 +131,6 @@
103131

104132
<Import Project="$(DefaultReferenceTargets)" Condition="Exists('$(DefaultReferenceTargets)') And '$(ImportDefaultReferences)'=='true'" />
105133

106-
<Import Project="Versioning.targets" />
107-
108134
<Import Project="ApiListing.targets" />
109135

110136
<Import Project="CodeCoverage.targets" />

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"Microsoft.Build.Traversal": "1.0.45"
44
},
55
"sdk": {
6-
"version": "5.0.200",
6+
"version": "5.0.301",
77
"rollForward": "feature"
88
}
99
}

sdk/template/Azure.Template/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Release History
22

3+
## 1.0.3-beta.19 (2020-09-24)
4+
- Test Submit-PR
5+
36
## 1.0.3-beta.18 (2020-09-24)
47
- Test Submit-PR
58

0 commit comments

Comments
 (0)