Skip to content

Commit f6e7642

Browse files
committed
feat: prependToFile (refs #41)
1 parent d22ecc7 commit f6e7642

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

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-
[4bd2c1d8c72520d](https://github.com/tomasbjerre/git-changelog-maven-plugin/commit/4bd2c1d8c72520d) Tomas Bjerre *2022-03-26 05:53:09*
8+
[d22ecc7fee29b2d](https://github.com/tomasbjerre/git-changelog-maven-plugin/commit/d22ecc7fee29b2d) Tomas Bjerre *2022-03-26 05:53:50*
99

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

git-changelog-maven-plugin-example/pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
<goal>git-changelog</goal>
8484
</goals>
8585
<configuration>
86+
<prependToFile>false</prependToFile>
8687
<useIntegrations>true</useIntegrations>
8788
<gitHubEnabled>trye</gitHubEnabled>
8889
<gitHubIssuePattern>#([0-9]*)</gitHubIssuePattern>

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ public class GitChangelogMojo extends AbstractMojo {
172172
@Parameter(property = "useIntegrations", required = false)
173173
public Boolean useIntegrations;
174174

175+
@Parameter(property = "prependToFile", required = false)
176+
public Boolean prependToFile;
177+
175178
@Override
176179
public void execute() throws MojoExecutionException {
177180
if (this.skip != null && this.skip == true) {
@@ -338,7 +341,11 @@ public void execute() throws MojoExecutionException {
338341
}
339342

340343
if (this.file != null) {
341-
builder.toFile(this.file);
344+
if (this.prependToFile) {
345+
builder.prependToFile(this.file);
346+
} else {
347+
builder.toFile(this.file);
348+
}
342349
this.getLog().info("#");
343350
this.getLog().info("# Wrote: " + this.file);
344351
this.getLog().info("#");

0 commit comments

Comments
 (0)