Skip to content

Commit e0af2b2

Browse files
committed
change: default Template.tt => Template.t4
1 parent 655b0ac commit e0af2b2

13 files changed

Lines changed: 1168 additions & 1163 deletions

File tree

ChangeLog.d/+.changed.1.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
default Template.tt => Template.t4
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
namespace NF.Tool.ReleaseNoteMaker.CLI.Impl
2-
{
3-
internal static class Const
4-
{
5-
public const string DEFAULT_CONFIG_FILENAME = "ReleaseNote.config.toml";
6-
public const string DEFAULT_TEMPLATE_T4_FILENAME = "Template.tt";
7-
public const string DEFAULT_TEMPLATE_LIQUID_FILENAME = "Template.liquid";
8-
public const string DEFAULT_NEWS_CONTENT = "Add your info here";
9-
public const string DEFAULT_EDIT_NEWS_CONTENT = @"
10-
11-
# Please write your news content. Lines starting with '#' will be ignored, and
12-
# an empty message aborts.
13-
";
14-
public const string DESCRIPTION_CONFIG = $"""
15-
Pass a custom config file at FILE_PATH.
16-
Default: {DEFAULT_CONFIG_FILENAME}
17-
""";
18-
}
19-
}
1+
namespace NF.Tool.ReleaseNoteMaker.CLI.Impl
2+
{
3+
internal static class Const
4+
{
5+
public const string DEFAULT_CONFIG_FILENAME = "ReleaseNote.config.toml";
6+
public const string DEFAULT_TEMPLATE_T4_FILENAME = "Template.t4";
7+
public const string DEFAULT_TEMPLATE_LIQUID_FILENAME = "Template.liquid";
8+
public const string DEFAULT_NEWS_CONTENT = "Add your info here";
9+
public const string DEFAULT_EDIT_NEWS_CONTENT = @"
10+
11+
# Please write your news content. Lines starting with '#' will be ignored, and
12+
# an empty message aborts.
13+
";
14+
public const string DESCRIPTION_CONFIG = $"""
15+
Pass a custom config file at FILE_PATH.
16+
Default: {DEFAULT_CONFIG_FILENAME}
17+
""";
18+
}
19+
}

NF.Tool.ReleaseNoteMaker/NF.Tool.ReleaseNoteMaker.CLI/NF.Tool.ReleaseNoteMaker.CLI.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
</ItemGroup>
2929

3030
<ItemGroup>
31-
<EmbeddedResource Include="res\Template.tt">
32-
<LogicalName>Template.tt</LogicalName>
31+
<EmbeddedResource Include="res\Template.t4">
32+
<LogicalName>Template.t4</LogicalName>
3333
</EmbeddedResource>
3434
<EmbeddedResource Include="res\Template.liquid">
3535
<LogicalName>Template.liquid</LogicalName>
@@ -41,7 +41,7 @@
4141
<LogicalName>CHANGELOG.md</LogicalName>
4242
</EmbeddedResource>
4343

44-
<!--<None Update="Template.tt" CopyToOutputDirectory="PreserveNewest" />-->
44+
<!--<None Update="Template.t4" CopyToOutputDirectory="PreserveNewest" />-->
4545
<None Remove="CHANGELOG.md" />
4646
<None Remove="ChangeLog.d/**/*" />
4747
</ItemGroup>

NF.Tool.ReleaseNoteMaker/NF.Tool.ReleaseNoteMaker.CLI/res/ReleaseNote.config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[ReleaseNote.Maker]
88
# Directory = "ChangeLog.d"
99
# OutputFileName = "CHANGELOG.md"
10-
# TemplateFilePath = "ChangeLog.d/Template.tt"
10+
# TemplateFilePath = "ChangeLog.d/Template.t4"
1111
# Name = ""
1212
# Version = ""
1313
# CsprojPath = ""

NF.Tool.ReleaseNoteMaker/NF.Tool.ReleaseNoteMaker.CLI/res/Template.tt renamed to NF.Tool.ReleaseNoteMaker/NF.Tool.ReleaseNoteMaker.CLI/res/Template.t4

Lines changed: 95 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,96 @@
1-
<#@ template debug="true" hostspecific="true" language="C#" #>
2-
<#@ import namespace="System" #>
3-
<#@ import namespace="System.Linq" #>
4-
<#@ import namespace="System.Collections.Generic" #>
5-
<#
6-
//System.Diagnostics.Debugger.Launch();
7-
//System.Diagnostics.Debugger.Break();
8-
9-
TemplateModel model = Host.GetTemplateModel();
10-
ReleaseNoteConfig config = Host.GetConfig();
11-
#>
12-
<#
13-
if (model.IsRenderTitle)
14-
{
15-
WriteLine($"## {model.ProjectData}");
16-
}
17-
#>
18-
19-
<#
20-
foreach (Section section in model.Sections)
21-
{
22-
if (!string.IsNullOrEmpty(section.DisplayName))
23-
{
24-
WriteLine($"\n### {section.DisplayName}\n");
25-
}
26-
27-
if (section.Categories.Count == 0)
28-
{
29-
WriteLine("No significant changes.\n");
30-
continue;
31-
}
32-
33-
foreach (Category category in section.Categories)
34-
{
35-
WriteLine($"#### {category.DisplayName}\n");
36-
37-
if (category.Contents.Count == 0)
38-
{
39-
WriteLine("No significant changes.\n");
40-
continue;
41-
}
42-
43-
foreach (Content content in category.Contents)
44-
{
45-
(string text, List<string> issues) = content;
46-
Write($"- {text}");
47-
if (issues.Count == 0)
48-
{
49-
WriteLine("");
50-
continue;
51-
}
52-
53-
if (text.Contains("\n - ") || text.Contains("\n * "))
54-
{
55-
Write("\n\n (");
56-
}
57-
else
58-
{
59-
if (!string.IsNullOrEmpty(text))
60-
{
61-
Write(" (");
62-
}
63-
}
64-
65-
for (int i = 0; i < issues.Count; i++)
66-
{
67-
string issue = issues[i];
68-
Write(issue.Split(": ", 2)[0]);
69-
if (i < issues.Count - 1)
70-
{
71-
Write(", ");
72-
}
73-
}
74-
75-
if (!string.IsNullOrEmpty(text))
76-
{
77-
Write(")");
78-
}
79-
WriteLine("");
80-
}
81-
82-
83-
List<string> categoryIssues = category.GetAllIssues();
84-
if (categoryIssues.Count > 0 && categoryIssues.First().Contains("]: "))
85-
{
86-
WriteLine("");
87-
foreach (string issue in categoryIssues)
88-
{
89-
WriteLine(issue);
90-
}
91-
}
92-
WriteLine("");
93-
94-
}
95-
}
1+
<#@ template debug="true" hostspecific="true" language="C#" #>
2+
<#@ import namespace="System" #>
3+
<#@ import namespace="System.Linq" #>
4+
<#@ import namespace="System.Collections.Generic" #>
5+
<#
6+
//System.Diagnostics.Debugger.Launch();
7+
//System.Diagnostics.Debugger.Break();
8+
9+
TemplateModel model = Host.GetTemplateModel();
10+
ReleaseNoteConfig config = Host.GetConfig();
11+
#>
12+
<#
13+
if (model.IsRenderTitle)
14+
{
15+
WriteLine($"## {model.ProjectData}");
16+
}
17+
#>
18+
19+
<#
20+
foreach (Section section in model.Sections)
21+
{
22+
if (!string.IsNullOrEmpty(section.DisplayName))
23+
{
24+
WriteLine($"\n### {section.DisplayName}\n");
25+
}
26+
27+
if (section.Categories.Count == 0)
28+
{
29+
WriteLine("No significant changes.\n");
30+
continue;
31+
}
32+
33+
foreach (Category category in section.Categories)
34+
{
35+
WriteLine($"#### {category.DisplayName}\n");
36+
37+
if (category.Contents.Count == 0)
38+
{
39+
WriteLine("No significant changes.\n");
40+
continue;
41+
}
42+
43+
foreach (Content content in category.Contents)
44+
{
45+
(string text, List<string> issues) = content;
46+
Write($"- {text}");
47+
if (issues.Count == 0)
48+
{
49+
WriteLine("");
50+
continue;
51+
}
52+
53+
if (text.Contains("\n - ") || text.Contains("\n * "))
54+
{
55+
Write("\n\n (");
56+
}
57+
else
58+
{
59+
if (!string.IsNullOrEmpty(text))
60+
{
61+
Write(" (");
62+
}
63+
}
64+
65+
for (int i = 0; i < issues.Count; i++)
66+
{
67+
string issue = issues[i];
68+
Write(issue.Split(": ", 2)[0]);
69+
if (i < issues.Count - 1)
70+
{
71+
Write(", ");
72+
}
73+
}
74+
75+
if (!string.IsNullOrEmpty(text))
76+
{
77+
Write(")");
78+
}
79+
WriteLine("");
80+
}
81+
82+
83+
List<string> categoryIssues = category.GetAllIssues();
84+
if (categoryIssues.Count > 0 && categoryIssues.First().Contains("]: "))
85+
{
86+
WriteLine("");
87+
foreach (string issue in categoryIssues)
88+
{
89+
WriteLine(issue);
90+
}
91+
}
92+
WriteLine("");
93+
94+
}
95+
}
9696
#>

0 commit comments

Comments
 (0)