-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<Project> | ||
<UsingTask TaskName="Base64Decode" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll"> | ||
<ParameterGroup> | ||
<EncodedString ParameterType="System.String" Required="true" /> | ||
<DecodedString Output="true" ParameterType="System.String" /> | ||
</ParameterGroup> | ||
<Task> | ||
<Using Namespace="System" /> | ||
<Using Namespace="System.Text" /> | ||
<Code Type="Fragment" Language="cs"> | ||
<![CDATA[ | ||
DecodedString = Encoding.UTF8.GetString(Convert.FromBase64String(EncodedString)); | ||
]]> | ||
</Code> | ||
</Task> | ||
</UsingTask> | ||
|
||
<!-- This is the decode end of the base64-encoding that gets the release notes into `dotnet pack`. | ||
The problem is that we can't supply MsBuild properties that contain MsBuild metacharacters. | ||
(At least, I don't know how.) | ||
The release notes are liable to contain MsBuild property metacharacters, such as the comma; | ||
so just before we `dotnet pack`, we base64-encode it. --> | ||
<Target Name="DecodeReleaseNotes" BeforeTargets="GenerateNuspec"> | ||
<Base64Decode EncodedString="$(RELEASE_NOTES)"> | ||
<Output TaskParameter="DecodedString" PropertyName="DecodedReleaseNotes" /> | ||
</Base64Decode> | ||
<PropertyGroup> | ||
<PackageReleaseNotes>$(DecodedReleaseNotes)</PackageReleaseNotes> | ||
</PropertyGroup> | ||
</Target> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters