4
4
import static se .bjurr .gitchangelog .api .GitChangelogApi .gitChangelogApiBuilder ;
5
5
6
6
import java .io .File ;
7
+ import java .nio .charset .StandardCharsets ;
8
+ import java .nio .file .Files ;
9
+ import java .nio .file .Paths ;
7
10
import java .util .Date ;
8
11
import java .util .HashMap ;
9
12
import java .util .List ;
@@ -151,6 +154,9 @@ public class GitChangelogMojo extends AbstractMojo {
151
154
@ Parameter (property = "javascriptHelper" , required = false )
152
155
private String javascriptHelper ;
153
156
157
+ @ Parameter (property = "handlebarsHelperFile" , required = false )
158
+ private String handlebarsHelperFile ;
159
+
154
160
@ Override
155
161
public void execute () throws MojoExecutionException {
156
162
if (this .skip != null && this .skip == true ) {
@@ -169,6 +175,13 @@ public void execute() throws MojoExecutionException {
169
175
.withHandlebarsHelper (this .javascriptHelper );
170
176
}
171
177
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
+
172
185
if (this .isSupplied (this .settingsFile )) {
173
186
builder .withSettings (new File (this .settingsFile ).toURI ().toURL ());
174
187
}
@@ -192,10 +205,10 @@ public void execute() throws MojoExecutionException {
192
205
builder .withTemplateContent (this .templateContent );
193
206
}
194
207
if (this .isSupplied (this .templateBaseDir )) {
195
- builder .withTemplateBaseDir (templateBaseDir );
208
+ builder .withTemplateBaseDir (this . templateBaseDir );
196
209
}
197
210
if (this .isSupplied (this .templateSuffix )) {
198
- builder .withTemplateSuffix (templateSuffix );
211
+ builder .withTemplateSuffix (this . templateSuffix );
199
212
}
200
213
if (this .isSupplied (this .fromCommit )) {
201
214
builder .withFromCommit (this .fromCommit );
0 commit comments