diff --git a/README.md b/README.md index d5905d63..df362f96 100644 --- a/README.md +++ b/README.md @@ -208,10 +208,10 @@ release { failOnUnversionedFiles = true failOnUpdateNeeded = true revertOnFail = true - preCommitText = '' - preTagCommitMessage = '[Gradle Release Plugin] - pre tag commit: ' - tagCommitMessage = '[Gradle Release Plugin] - creating tag: ' - newVersionCommitMessage = '[Gradle Release Plugin] - new version commit: ' + preCommitText = '[Gradle Release Plugin]' + preTagCommitMessage = 'pre tag commit: ' + tagCommitMessage = 'creating tag: ' + newVersionCommitMessage = 'new version commit: ' tagTemplate = '${version}' versionPropertyFile = 'gradle.properties' versionProperties = [] diff --git a/src/main/groovy/net/researchgate/release/ReleaseExtension.groovy b/src/main/groovy/net/researchgate/release/ReleaseExtension.groovy index 44a75259..835a6422 100644 --- a/src/main/groovy/net/researchgate/release/ReleaseExtension.groovy +++ b/src/main/groovy/net/researchgate/release/ReleaseExtension.groovy @@ -49,16 +49,16 @@ class ReleaseExtension { final Property pushReleaseVersionBranch = project.objects.property(String.class) @Input - final Property preCommitText = project.objects.property(String.class).convention('') + final Property preCommitText = project.objects.property(String.class).convention('[Gradle Release Plugin]') @Input - final Property preTagCommitMessage = project.objects.property(String.class).convention('[Gradle Release Plugin] - pre tag commit: ') + final Property preTagCommitMessage = project.objects.property(String.class).convention('pre tag commit: ') @Input - final Property tagCommitMessage = project.objects.property(String.class).convention('[Gradle Release Plugin] - creating tag: ') + final Property tagCommitMessage = project.objects.property(String.class).convention('creating tag: ') @Input - final Property newVersionCommitMessage = project.objects.property(String.class).convention('[Gradle Release Plugin] - new version commit: ') + final Property newVersionCommitMessage = project.objects.property(String.class).convention('new version commit: ') @Input final Property snapshotSuffix = project.objects.property(String.class).convention('-SNAPSHOT') diff --git a/src/main/groovy/net/researchgate/release/tasks/CommitNewVersion.groovy b/src/main/groovy/net/researchgate/release/tasks/CommitNewVersion.groovy index d6f489c6..faab79d5 100644 --- a/src/main/groovy/net/researchgate/release/tasks/CommitNewVersion.groovy +++ b/src/main/groovy/net/researchgate/release/tasks/CommitNewVersion.groovy @@ -14,7 +14,7 @@ class CommitNewVersion extends BaseReleaseTask { def commitNewVersion() { String message = extension.newVersionCommitMessage.get() + " '${tagName()}'." if (extension.preCommitText.get()) { - message = "${extension.preCommitText.get()} ${message}" + message = "${extension.preCommitText.get()} - ${message}" } getScmAdapter().commit(message) } diff --git a/src/main/groovy/net/researchgate/release/tasks/CreateReleaseTag.groovy b/src/main/groovy/net/researchgate/release/tasks/CreateReleaseTag.groovy index 48107eaa..41806f20 100644 --- a/src/main/groovy/net/researchgate/release/tasks/CreateReleaseTag.groovy +++ b/src/main/groovy/net/researchgate/release/tasks/CreateReleaseTag.groovy @@ -12,9 +12,9 @@ class CreateReleaseTag extends BaseReleaseTask { @TaskAction void createReleaseTag() { - def message = extension.tagCommitMessage.get() + " '${tagName()}'." + String message = extension.tagCommitMessage.get() + " '${tagName()}'." if (extension.preCommitText.get()) { - message = "${extension.preCommitText.get()} ${message}" + message = "${extension.preCommitText.get()} - ${message}" } scmAdapter.createReleaseTag(message) } diff --git a/src/main/groovy/net/researchgate/release/tasks/PreTagCommit.groovy b/src/main/groovy/net/researchgate/release/tasks/PreTagCommit.groovy index af4b77aa..26c18a77 100644 --- a/src/main/groovy/net/researchgate/release/tasks/PreTagCommit.groovy +++ b/src/main/groovy/net/researchgate/release/tasks/PreTagCommit.groovy @@ -22,8 +22,8 @@ class PreTagCommit extends BaseReleaseTask { if (projectAttributes.usesSnapshot || projectAttributes.versionModified || projectAttributes.propertiesFileCreated) { // should only be committed if the project was using a snapshot version. String message = extension.preTagCommitMessage.get() + " '${tagName()}'." - if (extension.preCommitText) { - message = "${extension.preCommitText.get()} ${message}" + if (extension.preCommitText.get()) { + message = "${extension.preCommitText.get()} - ${message}" } if (projectAttributes.propertiesFileCreated) { scmAdapter.add(findPropertiesFile(project)) diff --git a/src/test/groovy/net/researchgate/release/GitReleasePluginTests.groovy b/src/test/groovy/net/researchgate/release/GitReleasePluginTests.groovy index 275a60c0..32b868be 100644 --- a/src/test/groovy/net/researchgate/release/GitReleasePluginTests.groovy +++ b/src/test/groovy/net/researchgate/release/GitReleasePluginTests.groovy @@ -130,7 +130,8 @@ class GitReleasePluginTests extends Specification { executor.exec(['git', 'checkout', 'myBranch'], failOnStderr: false, directory: remoteRepo, env: [:]) executor.exec(['git', 'reset', '--hard', 'HEAD'], failOnStderr: false, directory: remoteRepo, env: [:]) then: - newestCommit.contains("Signed-off-by: Unit Test ") +// newestCommit.contains("Signed-off-by: Unit Test ") + newestCommit.contains("[Gradle Release Plugin] - new version commit: '1.1'") } def 'accept empty string to ignore requireBranch'() {