Skip to content

Commit de8f292

Browse files
committed
feat: handlebarsHelperFile
1 parent 8735074 commit de8f292

File tree

7 files changed

+21
-8
lines changed

7 files changed

+21
-8
lines changed

git-changelog-maven-plugin-example/CHANGELOG_ignoreCommitsOlderThan.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Changelog of Git Changelog Maven plugin.
44

55
## Unreleased
66
### No issue
7-
[maven-release-plugin] prepare for next development iteration *2021-12-03 17:28:29*
7+
[maven-release-plugin] prepare for next development iteration *2021-12-03 17:29:19*
88

99

1010

git-changelog-maven-plugin-example/CHANGELOG_inline.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Changelog of Git Changelog Maven plugin.
55
## Unreleased
66
### No issue
77

8-
[0d291b2d813076c](https://github.com/tomasbjerre/git-changelog-maven-plugin/commit/0d291b2d813076c) Tomas Bjerre *2021-12-03 17:28:29*
8+
[8735074a445bb4a](https://github.com/tomasbjerre/git-changelog-maven-plugin/commit/8735074a445bb4a) Tomas Bjerre *2021-12-03 17:29:19*
99

1010
[maven-release-plugin] prepare for next development iteration
1111

git-changelog-maven-plugin-example/CHANGELOG_jira.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Changelog for tomasbjerre git-changelog-maven-plugin.
88
**[maven-release-plugin] prepare for next development iteration**
99

1010

11-
[0d291b2d813076c](https://github.com/tomasbjerre/git-changelog-maven-plugin/commit/0d291b2d813076c) Tomas Bjerre *2021-12-03 17:28:29*
11+
[8735074a445bb4a](https://github.com/tomasbjerre/git-changelog-maven-plugin/commit/8735074a445bb4a) Tomas Bjerre *2021-12-03 17:29:19*
1212

1313

1414
## 1.81

git-changelog-maven-plugin-example/CHANGELOG_minimal.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Changelog for tomasbjerre git-changelog-maven-plugin.
88
**[maven-release-plugin] prepare for next development iteration**
99

1010

11-
[0d291b2d813076c](https://github.com/tomasbjerre/git-changelog-maven-plugin/commit/0d291b2d813076c) Tomas Bjerre *2021-12-03 17:28:29*
11+
[8735074a445bb4a](https://github.com/tomasbjerre/git-changelog-maven-plugin/commit/8735074a445bb4a) Tomas Bjerre *2021-12-03 17:29:19*
1212

1313

1414
## git-changelog-maven-plugin-1.81

git-changelog-maven-plugin-example/CHANGELOG_templatefile.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Changelog for tomasbjerre git-changelog-maven-plugin.
88
**[maven-release-plugin] prepare for next development iteration**
99

1010

11-
[0d291b2d813076c](https://github.com/tomasbjerre/git-changelog-maven-plugin/commit/0d291b2d813076c) Tomas Bjerre *2021-12-03 17:28:29*
11+
[8735074a445bb4a](https://github.com/tomasbjerre/git-changelog-maven-plugin/commit/8735074a445bb4a) Tomas Bjerre *2021-12-03 17:29:19*
1212

1313

1414
## 1.81

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
4444
<maven.compiler.target>1.8</maven.compiler.target>
4545
<maven.compiler.source>1.8</maven.compiler.source>
46-
<changelog-lib>1.162.0</changelog-lib>
46+
<changelog-lib>1.163.0</changelog-lib>
4747
</properties>
4848

4949
<dependencies>

src/main/java/se/bjurr/gitchangelog/plugin/GitChangelogMojo.java

+15-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
import static se.bjurr.gitchangelog.api.GitChangelogApi.gitChangelogApiBuilder;
55

66
import java.io.File;
7+
import java.nio.charset.StandardCharsets;
8+
import java.nio.file.Files;
9+
import java.nio.file.Paths;
710
import java.util.Date;
811
import java.util.HashMap;
912
import java.util.List;
@@ -151,6 +154,9 @@ public class GitChangelogMojo extends AbstractMojo {
151154
@Parameter(property = "javascriptHelper", required = false)
152155
private String javascriptHelper;
153156

157+
@Parameter(property = "handlebarsHelperFile", required = false)
158+
private String handlebarsHelperFile;
159+
154160
@Override
155161
public void execute() throws MojoExecutionException {
156162
if (this.skip != null && this.skip == true) {
@@ -169,6 +175,13 @@ public void execute() throws MojoExecutionException {
169175
.withHandlebarsHelper(this.javascriptHelper);
170176
}
171177

178+
if (this.isSupplied(this.handlebarsHelperFile)) {
179+
final byte[] content = Files.readAllBytes(Paths.get(this.handlebarsHelperFile));
180+
final String contentString = new String(content, StandardCharsets.UTF_8);
181+
builder //
182+
.withHandlebarsHelper(contentString);
183+
}
184+
172185
if (this.isSupplied(this.settingsFile)) {
173186
builder.withSettings(new File(this.settingsFile).toURI().toURL());
174187
}
@@ -192,10 +205,10 @@ public void execute() throws MojoExecutionException {
192205
builder.withTemplateContent(this.templateContent);
193206
}
194207
if (this.isSupplied(this.templateBaseDir)) {
195-
builder.withTemplateBaseDir(templateBaseDir);
208+
builder.withTemplateBaseDir(this.templateBaseDir);
196209
}
197210
if (this.isSupplied(this.templateSuffix)) {
198-
builder.withTemplateSuffix(templateSuffix);
211+
builder.withTemplateSuffix(this.templateSuffix);
199212
}
200213
if (this.isSupplied(this.fromCommit)) {
201214
builder.withFromCommit(this.fromCommit);

0 commit comments

Comments
 (0)