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

Get previous version #138

Closed
dafelipe130 opened this issue May 17, 2016 · 5 comments
Closed

Get previous version #138

dafelipe130 opened this issue May 17, 2016 · 5 comments

Comments

@dafelipe130
Copy link

I've been trawling through the documentation for this but I can't seem to find something about it. Is it possible in the current iteration of the plugin preferably a task on its own?

@adamdubiel
Copy link
Collaborator

No, currently it is not possible. Do you need just the previous version, or in general list of all versions?

@dafelipe130
Copy link
Author

Just need the previous version. Just like when you get the incremented version when you call currentVersion with the effective incrementers applied, I'd like to get the previous version counterpart again with the effective incrementers applied.

E.g.
#gradlew cV
1.11.0-SNAPSHOT

#gradlew pV
1.10.0

@gschueler
Copy link
Contributor

I was able to get the previous version with this:


def getAxionVersion() {
    def ctx = pl.allegro.tech.build.axion.release.infrastructure.di.GradleAwareContext.create(project)
    def rules = ctx.rules
    scmVersion.versionService.currentVersion(
            rules.version,
            rules.tag,
            rules.nextVersion
    )
}

task previousVersion << {
    println "Previous version: ${axionVersion.previousVersion}"
}

@mockitoguy
Copy link

+1 to this use case. Previous version is very useful for automatically building the release notes.

This ticket has been filed 5 years ago. Is there a public API currently to expose the previous version?

@bgalek
Copy link
Member

bgalek commented Mar 24, 2021

@mockitoguy seems useful, do you want to implement this? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants