Skip to content

Commit

Permalink
Fixed #103
Browse files Browse the repository at this point in the history
Made the input directory more correct. This fixes the Gradle warnings. Inspired on the PR #145
  • Loading branch information
mockitoguy committed Jan 24, 2024
1 parent c6b8eaf commit 6b10cbb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/main/java/org/shipkit/changelog/GenerateChangelogTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,22 @@ public void setOutputFile(File outputFile) {
this.outputFile = outputFile;
}

@InputDirectory
@Internal
public File getWorkingDir() {
return workingDir;
}

@InputDirectory
@PathSensitive(PathSensitivity.RELATIVE)
public File getGitDir() {
if (workingDir == null) {
return null;
}
else {
return new File(workingDir, ".git");
}
}

public void setWorkingDir(File workingDir) {
this.workingDir = workingDir;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ class ChangelogPluginTest extends Specification {
project.plugins.apply(ChangelogPlugin)

then:
project.tasks.generateChangelog
GenerateChangelogTask t = project.tasks.generateChangelog
t.gitDir

when:
t.workingDir = null

then:
!t.gitDir
}
}

0 comments on commit 6b10cbb

Please sign in to comment.