Skip to content

Commit 3d1a20d

Browse files
committed
breaking: enabling lazy loading of all configuration
1 parent 7795e48 commit 3d1a20d

File tree

11 files changed

+403
-314
lines changed

11 files changed

+403
-314
lines changed

README.md

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@ plugin {
5151
5252
// Optional config if you want to configure the changelog
5353
task gitChangelogTask(type: se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask) {
54-
templateContent = """
54+
templateContent.set("""
5555
// Template here!
56-
""";
56+
""");
5757
}
5858
5959
// Optional config if you want to configure versioning
6060
task gitChangelogVersionTask(type: se.bjurr.gitchangelog.plugin.gradle.GitChangelogSemanticVersionTask) {
61-
suffixSnapshot = true;
62-
majorVersionPattern = "^[Bb]reaking"
63-
minorVersionPattern = "[Ff]eature"
64-
patchVersionPattern = "[Ff]ix"
61+
suffixSnapshot.set(true);
62+
majorVersionPattern.set("^[Bb]reaking")
63+
minorVersionPattern.set("[Ff]eature")
64+
patchVersionPattern.set("[Ff]ix")
6565
}
6666
```
6767

@@ -157,8 +157,8 @@ import com.github.jknack.handlebars.Helper;
157157
import com.github.jknack.handlebars.Options;
158158
159159
task gitChangelogTask(type: se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask) {
160-
file = new File("CHANGELOG.md");
161-
handlebarsHelpers = [
160+
file.set(new File("CHANGELOG.md"));
161+
handlebarsHelpers.set([
162162
new HelperParam("startsWith", new Helper<String>() {
163163
public Object apply(String from, Options options) throws IOException {
164164
def s = options.hash['s']
@@ -175,15 +175,15 @@ task gitChangelogTask(type: se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask
175175
return from.substring(0,number);
176176
}
177177
})
178-
]
179-
templateContent = """
178+
])
179+
templateContent.set("""
180180
{{#commits}}
181181
{{#startsWith messageTitle s='feat'}}
182182
Starts with feat: "{{messageTitle}}"
183183
first 10 letters of hash is: {{firstLetters hash number='10'}}
184184
{{/startsWith}}
185185
{{/commits}}
186-
""";
186+
""");
187187
}
188188
```
189189

@@ -192,22 +192,16 @@ task gitChangelogTask(type: se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask
192192
It can also be used to get the next semantic version based on commits.
193193

194194
```groovy
195-
classpath 'se.bjurr.gitchangelog:git-changelog-lib:1.+'
196-
197-
...
198-
199195
buildscript {
200196
repositories {
201197
mavenCentral()
202198
mavenLocal()
203199
}
204200
dependencies {
205-
...
206201
classpath 'se.bjurr.gitchangelog:git-changelog-lib:1.+'
207202
}
208203
}
209204
210-
211205
def nextVersion = se.bjurr.gitchangelog.api.GitChangelogApi.gitChangelogApiBuilder()
212206
.withSemanticMajorVersionPattern("^[Bb]reaking")
213207
.withSemanticMinorVersionPattern("[Ff]eature")

build.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
./gradlew publishToMavenLocal -Pversion=latest-SNAPSHOT || exit 1
3+
4+
cd git-changelog-gradle-plugin-example-kotlin
5+
./gradlew build
6+
cd -
7+
8+
cd git-changelog-gradle-plugin-example
9+
./gradlew build
10+
cd -

git-changelog-gradle-plugin-example-kotlin/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ buildscript {
77
}
88

99
dependencies {
10-
classpath("se.bjurr.gitchangelog:git-changelog-gradle-plugin:+")
10+
classpath("se.bjurr.gitchangelog:git-changelog-gradle-plugin:latest-SNAPSHOT")
1111
}
1212
}
1313

1414
apply(plugin = "se.bjurr.gitchangelog.git-changelog-gradle-plugin")
1515

1616
tasks.register<se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask>("generateGitChangelog") {
17-
fromRepo = file(".").toString();
18-
file = file("CHANGELOG_generateGitChangelog.md");
17+
fromRepo.set(file(".").toString());
18+
file.set(file("CHANGELOG_generateGitChangelog.md"));
1919
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pluginManagement {
2+
repositories {
3+
mavenLocal()
4+
mavenCentral()
5+
gradlePluginPortal()
6+
}
7+
}

0 commit comments

Comments
 (0)