Skip to content

Commit 3661bd2

Browse files
committed
Tweaks.
1 parent fbc23a8 commit 3661bd2

File tree

4 files changed

+196
-201
lines changed

4 files changed

+196
-201
lines changed

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,6 @@ To access packages, source code, and/or view a list of changes for all
175175
components in a release see:
176176
[Releases](https://github.com/open-telemetry/opentelemetry-dotnet/releases).
177177

178-
## Changelog
179-
For detailed changes and version history, see the [Changelog](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/CHANGELOG.md).
180-
181-
182-
183178
Nightly builds from this repo are published to [MyGet](https://www.myget.org),
184179
and can be installed using the
185180
`https://www.myget.org/F/opentelemetry/api/v3/index.json` source.

build/Common.prod.props

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
2626
<PackagePrimaryLicenseFile>$(RepoRoot)\LICENSE.TXT</PackagePrimaryLicenseFile>
2727
<PackageThirdPartyNoticesFile>$(RepoRoot)\THIRD-PARTY-NOTICES.TXT</PackageThirdPartyNoticesFile>
28+
<PackageReadmeFile>README.md</PackageReadmeFile>
29+
<PackageReleaseNotes>RELEASENOTES.md</PackageReleaseNotes>
2830
</PropertyGroup>
2931

3032
<PropertyGroup Label="SourceLinkProperties">
@@ -57,7 +59,7 @@
5759
<None Include=".publicApi\**\PublicAPI.*.txt" />
5860
</ItemGroup>
5961

60-
<Target Name="AssemblyVersionTarget" AfterTargets="MinVer" Condition="'$(MinVerVersion)'!='' AND '$(BuildNumber)' != ''">
62+
<Target Name="AssemblyVersionTarget" AfterTargets="MinVer" Condition="'$(MinVerVersion)' != '' AND '$(BuildNumber)' != ''">
6163
<!-- Note: $(BuildNumber) is typically only set for builds initiated by the
6264
publish workflow. The goal here is to set the assembly FileVersion and
6365
resolve ExposeExperimentalFeatures based on the version MinVer resolved from
@@ -87,6 +89,54 @@
8789
<Error Text="Cannot perform package validation without a baseline package version." />
8890
</Target>
8991

92+
<Target Name="IncludeReadmeAndReleaseNotesInPackages" BeforeTargets="_GetTargetFrameworksOutput">
93+
<!-- Note: This target runs during pack to convert relative links in
94+
markdowns into github permalinks which will work when rendered on Nuget. -->
95+
96+
<Exec
97+
Command="git rev-parse HEAD"
98+
ConsoleToMsBuild="True"
99+
IgnoreExitCode="True"
100+
StandardOutputImportance="low">
101+
<Output PropertyName="GitCommitConsoleOutput" TaskParameter="ConsoleOutput"/>
102+
<Output PropertyName="GitCommitExitCode" TaskParameter="ExitCode"/>
103+
</Exec>
104+
105+
<Exec
106+
Command="git remote get-url origin"
107+
ConsoleToMsBuild="True"
108+
IgnoreExitCode="True"
109+
StandardOutputImportance="low">
110+
<Output PropertyName="GitOriginConsoleOutput" TaskParameter="ConsoleOutput"/>
111+
<Output PropertyName="GitOriginExitCode" TaskParameter="ExitCode"/>
112+
</Exec>
113+
114+
<PropertyGroup>
115+
<GitHubPermalinkUrl>$(GitOriginConsoleOutput.Replace('.git',''))/blob/$(GitCommitConsoleOutput)</GitHubPermalinkUrl>
116+
</PropertyGroup>
117+
118+
<Message Importance="high" Text="**GitInformationDebug** GitCommitConsoleOutput: $(GitCommitConsoleOutput), GitCommitExitCode: $(GitCommitExitCode), GitOriginConsoleOutput: $(GitOriginConsoleOutput), GitOriginExitCode: $(GitOriginExitCode), GitHubPermalinkUrl: $(GitHubPermalinkUrl)" />
119+
120+
<ItemGroup>
121+
<PackageMarkdownFiles Include="README.md" />
122+
<PackageMarkdownFiles Include="$(RepoRoot)\RELEASENOTES.md" />
123+
</ItemGroup>
124+
125+
<ItemGroup>
126+
<PackageMarkdownFiles Update="@(PackageMarkdownFiles)" Path="$([MSBuild]::ValueOrDefault('%(FullPath)','').Replace('$(RepoRoot)', '').Replace('%(FileName)%(Extension)', ''))" />
127+
</ItemGroup>
128+
129+
<WriteLinesToFile
130+
File="$(BaseIntermediateOutputPath)%(PackageMarkdownFiles.Filename)%(PackageMarkdownFiles.Extension)"
131+
Lines="$([System.Text.RegularExpressions.Regex]::Replace($([System.IO.File]::ReadAllText(%(PackageMarkdownFiles.FullPath))), '\[([^]]+?)\]\(\.(.+?)\)', '[$1]($(GitHubPermalinkUrl)%(PackageMarkdownFiles.Path).$2)'))"
132+
Overwrite="true"
133+
Encoding="UTF-8"/>
134+
135+
<ItemGroup>
136+
<Content Include="$(BaseIntermediateOutputPath)*.md" PackagePath="/" />
137+
</ItemGroup>
138+
</Target>
139+
90140
<Target Name="ResolveExposeExperimentalFeatures" BeforeTargets="CoreCompile" DependsOnTargets="AssemblyVersionTarget">
91141
<!-- Note: This runs for all builds. The goal here is to set the
92142
EXPOSE_EXPERIMENTAL_FEATURES compiler constant if

src/OpenTelemetry/OpenTelemetry.csproj

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,4 @@
2626
<Compile Include="$(RepoRoot)\src\Shared\ThreadSafeRandom.cs" Link="Includes\ThreadSafeRandom.cs" />
2727
</ItemGroup>
2828

29-
<PropertyGroup>
30-
<PackageReadmeFile>README.md</PackageReadmeFile>
31-
<PackageReleaseNotes>RELEASENOTES.md</PackageReleaseNotes>
32-
</PropertyGroup>
33-
34-
3529
</Project>

0 commit comments

Comments
 (0)