git-changelog-gradle-plugin icon indicating copy to clipboard operation
git-changelog-gradle-plugin copied to clipboard

No output file using gradle plugin version 1.71.4

Open svengre-transrail opened this issue 2 years ago • 4 comments

Hello. I am running

plugins { id 'se.bjurr.gitchangelog.git-changelog-gradle-plugin' version '1.71.4' }

In my build.gradle file with task:

task generateChangeLog(type: se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask) {

file = new File("CHANGELOG.md");

templateContent = file('changelog.mustache').getText('UTF-8'); }

Nothing fancy. For some reason the output file is nowhere to be seen when I run the task. The file appears when I use version 1.66 but that version does not seem to support the conventional commits Changlog template found at https://github.com/tomasbjerre/git-changelog-lib#Helpers.

Sorry for little to no information. Using gradle version 2.3 through intelliJ IDEA 2021.2 (Community Edition). Appreciate any help

svengre-transrail avatar Jan 05 '22 14:01 svengre-transrail

Perhaps the very old Gradle version. Or something wrong in the template. Have a look at the examples and try to find the issue: https://github.com/tomasbjerre/git-changelog-gradle-plugin/blob/master/git-changelog-gradle-plugin-example/build.gradle

tomasbjerre avatar Jan 05 '22 14:01 tomasbjerre

The file fails to appear no matter what is in the template for 1.71.4.

i.e. templateContent = """ #Hello World """

produces a markdown file with #Hello World and nothing else. 1.71.4 produces nothing.

Thank you for your response

svengre-transrail avatar Jan 05 '22 15:01 svengre-transrail

Hi, I just tried 1.71.8 and got the same behavior, but in fact, the file is well generated, but under the .gradle/daemon/7.3.3in my case. I've just adapted the task config like this:

task generateGitChangelogTemplateFromFile(type: GitChangelogTask) {
    fromRepo = file(".");
    file = new File("${projectDir}/CHANGELOG.md");
    templateContent = file('changelog.mustache').getText('UTF-8');
}

And I get the file generated under my project without issue.

ask4gilles avatar Jan 28 '22 12:01 ask4gilles

This also works instead of using new File()

task generateChangelog(type: GitChangelogTask) {
    fromRepo = file(".");
    prependToFile = false;
    file = file("CHANGELOG.md")
    templateContent = file('changelog.mustache').getText('UTF-8');
}

mklueh avatar May 13 '22 20:05 mklueh

The plugin should now default to CHANGELOG.md in the root dir: https://github.com/tomasbjerre/git-changelog-gradle-plugin/blob/b940964cbcb670fbbd53806bb153cfebe8613996/src/main/java/se/bjurr/gitchangelog/plugin/gradle/GitChangelogTask.java#L32

tomasbjerre avatar Dec 28 '22 18:12 tomasbjerre