Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Adam Dubiel
    @adamdubiel
    *or
    Trent
    @ProTrent
    Is there a way to get the string without '-SNAPSHOT' appended? I'm trying to add the version to a properties file that can be read by the application to indicate it's version
    Adam Dubiel
    @adamdubiel
    if you read through http://axion-release-plugin.readthedocs.io/en/latest/#basic-workflow you will see why it appends -SNAPSHOT
    basically you have release version only if you are on version tag
    Trent
    @ProTrent
    I see why it does it, I'm curious if there is an output without it.
    Adam Dubiel
    @adamdubiel
    meaning no changes since last release
    ah, ok :)
    Trent
    @ProTrent
    Like scmVersion.cleanVersion or scmVersion.baseVersion or something along those lines?
    What I'm really trying to do is set a version property in a JAR file or a properties file that I can use in the application to determine its current version. I'd prefer not to strip off '-SNAPSHOT' in the application.
    What would really be nice is to get some sort of 'subVersion' as well that indicated something along the lines of the git commit hash, a date string, or some other identification that indicated the current build SCM version.
    Adam Dubiel
    @adamdubiel
    yes, i see what you mean, but in my opinion -SNAPSHOT suffix is a part of version. version 0.1.0-SNAPSHOT is something else than 0.1.0, so why would you like to keep the -SNAPSHOT from application?
    as to the adding some hash/date/whatever - there is pretty rich api for decorating versions: http://axion-release-plugin.readthedocs.io/en/latest/configuration/version.html#decorating
    Trent
    @ProTrent
    I don't mind using it as the JAR file name. Think of it as an API version. Like this is Version 1.2.1 Build #160 or something like that.
    I'm just curious if you can spit out two variables, version (with snapshot) and baseVersion (without snapshot)
    The additional decoration data would be icing on the cake.
    Adam Dubiel
    @adamdubiel
    i'm afraid currently there is no way to get version without "-SNAPSHOT" as output of scmVersion.version
    Trent
    @ProTrent
    I admit, my Gradle skills aren't up to par at all, if this is something I can accomplish in Gradle without modifying this plugin, just point me in the right direction. Like some task that splits up your version to the three variables I need...
    Adam Dubiel
    @adamdubiel
    oh, if you will be fine with simple string splits it is easy, but there is nothing like this builtin
    Trent
    @ProTrent
    Ok, sounds good. I'll see what I can do on my own.
    I guess if I were making a feature request, I'd like to see this as an output of the scmVersion gradle properties:
    scmVersion: {
    version: 1.0.0-SNAPSHOT,
    baseVersion: 1.0.0,
    scmTag: b818b16 (or 1346 if SVN)
    }
    Adam Dubiel
    @adamdubiel
    no support for SVN now :) baseVersion would be easy, scm as well - there already is a scmPosition object (though it lacks commit #) used in decorations and serializing
    can you crate an issue for this?
    Trent
    @ProTrent
    What would be really neat would be two have two versions, one for API and another for Implementation:
    scmVersion: {
    version: 1.2.1-SNAPSHOT,
    baseVersion: 1.2.1,
    apiVersion: 1.0.0,
    implVersion: 1.2.1,
    scmTag: b818b16 (or 1346 if SVN)
    }
    Adam Dubiel
    @adamdubiel
    i don't really know where would the api version come from
    Trent
    @ProTrent
    I could. Is the scmPosition object exposed in Gradle, or only in the plugin?
    Adam Dubiel
    @adamdubiel
    only in the plugin, i would need to expose it in scmVersion as part of the task
    Trent
    @ProTrent
    It would be a new version altogether... You'd probably have to make two tags. It's what I'd really like, but may be beyond this projects scope.
    Sounds good. Well, I can create an issue if you think it's worth adding. I think exposing as much info as you can would be useful.
    Adam Dubiel
    @adamdubiel
    the API version is indeed beyond the scope - axion-release is configured per invocation of gradle and i'm afraid adding multi-tag support would make the configuration quite confusing
    not to say it would require some major changes
    but exposing more information sounds ok
    btw if you just want to have a workaround for now use: scmVersion.version.replaceAll(/-SNAPSHOT$/, ""), not the most elegant, but effective
    Trent
    @ProTrent
    Sounds good. I'll add an issue for the addition of the SCM Versioning then.
    Thanks
    Adam Dubiel
    @adamdubiel
    in the meantime i clarified use of ./gradlew publish: allegro/axion-release-plugin#168
    Trent
    @ProTrent
    Thanks, I appreciate that.
    Alright, I created an issue to add that as an output. Thanks for all of your help. If I was better at Groovy I'd probably look at making a pull request.
    Adam Dubiel
    @adamdubiel
    No problem, i will take care of this
    Trent
    @ProTrent
    Thanks!
    Adam Dubiel
    @adamdubiel
    @ProTrent i just release 1.5.0 with feature you requested
    Stefan Drzazga
    @sdrzazga
    Hello @adamdubiel .
    Question the page https://axion-release-plugin.readthedocs.io/en/latest/ shows in the upper right corner version 1.9.3 ... shouldn't it show currently 1.10.2 instead?
    Just wondering if it shows really the latest version for the documentation.
    Thanks in advance!
    Adam Dubiel
    @adamdubiel
    yes it is :) seems like auto build broke
    Rémi Cartier
    @RemiMTL_twitter
    Hi guys, quick question, when I run ./gradlew currentVersion on my project, there is no -SNAPSHOT attached to it. Would you know why ?
    Adam Dubiel
    @adamdubiel
    hi, might be that you are working on tag already?
    this is the only time when axion does not attach -SNAPSHOT
    Rémi Cartier
    @RemiMTL_twitter
    thank you, that's what I realized reading the doc and testing for myself, thanks for taking the time to answer
    geoHeil
    @geoHeil
    How can I add a git commit hash to the release name for snapshot builds when using axion-release-plugin?
    geoHeil
    @geoHeil
    Though, it looks like a versionCreator 'versionWithBranch' is good enough to start out with.
    Adam Dubiel
    @adamdubiel
    hi :) you can create own versionCreator, its just a closure. it has access to ScmPosition object which contains info like current commit hash. More in docs: https://axion-release-plugin.readthedocs.io/en/latest/configuration/version/#custom-version-creator
    geoHeil
    @geoHeil
    @adamdubiel thanks. Your default one seems to work fine, i.e. name the files with a branch name. However, when I upload them to Artifactory it does not change the module / artifact name and only a timestamp is recorded. I.e. the information about the branch originally present in the JAR is lost.