-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.csharp.writereleasenotes.msbuild
More file actions
58 lines (50 loc) · 2.85 KB
/
test.csharp.writereleasenotes.msbuild
File metadata and controls
58 lines (50 loc) · 2.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="11.0"
DefaultTargets="_Custom_WriteReleaseNotesForCurrentRelease"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
The full file path to the script that handles the custom formatting of the release notes for
the current release.
The script is expected be a custom implementation of the WriteReleaseNotes.msbuild script.
The script file can be called anything as long as it contains a target called:
'_Custom_WriteReleaseNotesForCurrentRelease'
The target should process an ItemGroup called 'ReleaseNoteIssues' containing the issue information. The each item in the item
group describes one issue in the following format:
<item include="ISSUE_NUMBER">
<Title>ISSUE_TITLE</Title>
<State>ISSUE_STATE</State>
<Body>ISSUE_BODY</Body>
<UserName>ISSUE_USERNAME</UserName>
<UserUrl>ISSUE_USERURL</UserUrl>
<Labels>ISSUE_LABELS</Labels>
</item>
Where:
ISSUE_NUMBER - The ID of the issue.
ISSUE_TITLE - The title of the issue.
ISSUE_STATE - The state of the issue, e.g. open, closed etc.
ISSUE_BODY - The description of the issue.
ISSUE_USERNAME - The name of the user to whom the issue is assigned.
ISSUE_USERURL - The URL for the user, if it exists.
ISSUE_LABELS - The labels / type for the issue.
-->
<Target Name="_Custom_WriteReleaseNotesForCurrentRelease">
<CreateProperty Value="$([System.IO.Path]::GetDirectoryName('$(FileReleaseNotesHtml)'))">
<Output TaskParameter="Value" PropertyName="DirToCreate" />
</CreateProperty>
<MakeDir Directories="$(DirToCreate)"
Condition="!Exists('$(DirToCreate)') AND '$(ShouldExecute)' == 'true' " />
<ItemGroup>
<ReleaseNoteHtmlLines Include="<html>" />
<ReleaseNoteHtmlLines Include="<body>" />
<ReleaseNoteHtmlLines Include=" <ul>" />
<ReleaseNoteHtmlLines Include="@(ReleaseNoteIssues->' <li><a href="%(Url)">[%(Identity)]</a> %(Title) (<a href="%(UserUrl)" > %(UserName)</a>)</li>', '
')" />
<ReleaseNoteHtmlLines Include=" </ul>" />
<ReleaseNoteHtmlLines Include="</body>" />
<ReleaseNoteHtmlLines Include="</html>" />
</ItemGroup>
<WriteLinesToFile File="$(FileReleaseNotesHtml)"
Lines="@(ReleaseNoteHtmlLines)"
Overwrite="true"
Condition=" '$(ShouldExecute)' == 'true' "/>
</Target>
</Project>