Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolved #221 corrects release notes #222

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,34 @@ class ReleasePluginIntegrationSpec extends GitVersioningIntegrationSpec {
new File(projectDir, "build/libs/${moduleName}-0.1.0.jar").exists()
}

def 'prefixNameWithV is false tag strategy works as expected with build message finding previous tag version'() {
buildFile << '''\
release {
tagStrategy {
prefixNameWithV = false
}
}
'''.stripIndent()
git.add(patterns: ['build.gradle'] as Set)
git.commit(message: 'setting tag strategy')

git.tag.add(name: '0.2.0')

new File(projectDir, 'test.txt').text = 'test'
git.add(patterns: ['test.txt'])
git.commit(message: 'Add file')

when:
runTasksSuccessfully('final')

then:
new File(projectDir, "build/libs/${moduleName}-0.3.0.jar").exists()
Tag tag = originGit.tag.list().find { it.name.contains("0.3.0") }
tag.shortMessage.contains("Release of 0.3.0")
tag.fullMessage.contains("Add file")
!tag.fullMessage.contains("setting tag strategy")
}

def 'use last tag with custom tag strategy'() {
buildFile << '''\
release {
Expand Down
2 changes: 1 addition & 1 deletion src/main/groovy/nebula/plugin/release/ReleasePlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class ReleasePlugin implements Plugin<Project> {
builder << "Release of ${version.version}\n\n"

if (version.previousVersion) {
String previousVersion = "v${version.previousVersion}^{commit}"
String previousVersion = "${project.release.tagStrategy.toTagString(version.previousVersion)}^{commit}"
List excludes = []
if (tagExists(grgit, previousVersion)) {
excludes << previousVersion
Expand Down