Skip to content

Commit

Permalink
Merge f80090c into 188c36d
Browse files Browse the repository at this point in the history
  • Loading branch information
rpalcolea committed Sep 23, 2020
2 parents 188c36d + f80090c commit 7462153
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Expand Up @@ -1252,6 +1252,31 @@ class ReleasePluginIntegrationSpec extends GitVersioningIntegrationSpec {
result.standardOutput.contains('Pushing changes in [v0.1.0] to origin')
}

def 'Can create devSnapshot with scope patch if candidate for next minor is present'() {
git.tag.add(name: 'v3.1.2')
git.tag.add(name: 'v3.2.0-rc.1')
git.tag.add(name: 'v3.2.0-rc.2')

when:
def version = inferredVersionForTask('devSnapshot', '-Prelease.scope=patch')

then:
version == dev('3.1.3-dev.0+')
}

def 'Can create devSnapshot with scope patch if candidate for next minor is present - immutable snapshot'() {
replaceDevWithImmutableSnapshot()
git.tag.add(name: 'v3.1.2')
git.tag.add(name: 'v3.2.0-rc.1')
git.tag.add(name: 'v3.2.0-rc.2')

when:
def version = inferredVersionForTask('devSnapshot', '-Prelease.scope=patch')

then:
version.toString().startsWith("3.1.3-snapshot." + getUtcDateForComparison())
}

private void replaceDevWithImmutableSnapshot() {
new File(buildFile.parentFile, "gradle.properties").text = """
nebula.release.features.replaceDevWithImmutableSnapshot=true
Expand Down
Expand Up @@ -343,7 +343,8 @@ final class Strategies {
allowDirtyRepo: true,
preReleaseStrategy: all(PreRelease.STAGE_FLOAT, PreRelease.TIMESTAMP, PreRelease.SHOW_UNCOMMITTED),
buildMetadataStrategy: BuildMetadata.COMMIT_ABBREVIATED_ID,
createTag: false
createTag: false,
enforcePrecedence: false
)

/**
Expand Down

0 comments on commit 7462153

Please sign in to comment.