Skip to content

Commit

Permalink
fix(GitChangelogGradlePlugin): Make tasks show up in "tasks"
Browse files Browse the repository at this point in the history
Previously, tasks were lacking a group / description, so they would only
show up with `gradlew tasks --all`.
  • Loading branch information
sschuberth committed Sep 20, 2023
1 parent 1d02179 commit 71b04a1
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ public class GitChangelogGradlePlugin implements Plugin<Project> {
public void apply(final Project target) {
target.getExtensions().create("gitChangelogPlugin", GitChangelogPluginExtension.class);

target.getTasks().register("gitChangelogSemanticVersion", GitChangelogSemanticVersionTask.class);
target.getTasks().register("gitChangelogSemanticVersion", GitChangelogSemanticVersionTask.class, task -> {
task.setDescription("Set version in gradle.properties from conventional commits.");
task.setGroup("Git Changelog");
});

target.getTasks().register("gitChangelog", GitChangelogTask.class, task ->
task.ignoreCommitsIfMessageMatches =
"^\\[maven-release-plugin\\].*|^\\[Gradle Release Plugin\\].*|^Merge.*|.*\\[GRADLE SCRIPT\\].*"
);
target.getTasks().register("gitChangelog", GitChangelogTask.class, task -> {
task.setDescription("Update CHANGELOG.md using conventional commits.");
task.setGroup("Git Changelog");
task.ignoreCommitsIfMessageMatches =
"^\\[maven-release-plugin\\].*|^\\[Gradle Release Plugin\\].*|^Merge.*|.*\\[GRADLE SCRIPT\\].*";
});
}
}

0 comments on commit 71b04a1

Please sign in to comment.