Skip to content

Commit adc959a

Browse files
committed
Documentation #3
1 parent 75c3bb6 commit adc959a

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Here is and example that will generate a CHANGELOG.md. There is also a running e
4242
```
4343

4444

45-
This setup has a settings file, changelog.json, like this:
45+
This setup has a settings file, changelog.json, [documented here](https://github.com/tomasbjerre/git-changelog/blob/master/src/main/java/se/bjurr/gitchangelog/internal/settings/Settings.java). May look something like this:
4646

4747
```
4848
{

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

+11-7
Original file line numberDiff line numberDiff line change
@@ -52,34 +52,34 @@ public void execute() throws MojoExecutionException {
5252
.withSettings(new File(settingsFile).toURI().toURL()) //
5353
.withToRef(toRef);
5454

55-
if (!isNullOrEmpty(templateFile)) {
55+
if (isSupplied(templateFile)) {
5656
builder //
5757
.withTemplatePath(templateFile);
5858
}
59-
if (!isNullOrEmpty(templateContent)) {
59+
if (isSupplied(templateContent)) {
6060
builder //
6161
.withTemplateContent(templateContent);
6262
}
63-
if (!isNullOrEmpty(fromCommit)) {
63+
if (isSupplied(fromCommit)) {
6464
builder //
6565
.withFromCommit(fromCommit);
6666
}
67-
if (!isNullOrEmpty(fromRef)) {
67+
if (isSupplied(fromRef)) {
6868
builder //
6969
.withFromRef(fromRef);
7070
}
71-
if (!isNullOrEmpty(toCommit)) {
71+
if (isSupplied(toCommit)) {
7272
builder //
7373
.withToCommit(toCommit);
7474
}
7575

76-
if (!isNullOrEmpty(filePath)) {
76+
if (isSupplied(filePath)) {
7777
builder //
7878
.toFile(filePath);
7979
getLog().info("Git Changelog written to " + filePath);
8080
}
8181

82-
if (!isNullOrEmpty(mediaWikiUrl)) {
82+
if (isSupplied(mediaWikiUrl)) {
8383
builder//
8484
.toMediaWiki(//
8585
mediaWikiUsername,//
@@ -92,4 +92,8 @@ public void execute() throws MojoExecutionException {
9292
getLog().error("GitChangelog", e);
9393
}
9494
}
95+
96+
private boolean isSupplied(String parameter) {
97+
return !isNullOrEmpty(parameter);
98+
}
9599
}

0 commit comments

Comments
 (0)