Code Monkey home page Code Monkey logo

gradle-gitflow's People

Contributors

amkay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gradle-gitflow's Issues

The plugin gradle-gitflow does not support non-version tags

Given:
A git repository that is having tags that are not related to a version.

$ git tag
0.1.0
1.2.3
simpletag

When:
Resolving the current version

Then:

Caused by: Unexpected character 'LETTER(p)' at position '0', expecting '[DIGIT]'
        at com.github.zafarkhaja.semver.VersionParser.consumeNextCharacter(VersionParser.java:516)
        at com.github.zafarkhaja.semver.VersionParser.digits(VersionParser.java:448)
        at com.github.zafarkhaja.semver.VersionParser.numericIdentifier(VersionParser.java:408)
        at com.github.zafarkhaja.semver.VersionParser.parseVersionCore(VersionParser.java:285)
        at com.github.zafarkhaja.semver.VersionParser.parseValidSemVer(VersionParser.java:255)
        at com.github.zafarkhaja.semver.VersionParser.parseValidSemVer(VersionParser.java:195)
        at com.github.zafarkhaja.semver.Version.valueOf(Version.java:265)
        at com.github.zafarkhaja.semver.Version$valueOf.call(Unknown Source)
        at com.github.amkay.gradle.gitflow.version.NearestVersionLocator$_locate_closure1.doCall(NearestVersionLocator.groovy:101)
        at com.github.amkay.gradle.gitflow.version.NearestVersionLocator.locate(NearestVersionLocator.groovy:100)
        at com.github.amkay.gradle.gitflow.version.NearestVersionLocator$locate.call(Unknown Source)
        at com.github.amkay.gradle.gitflow.strategy.BranchDevelopStrategy.doInfer(BranchDevelopStrategy.groovy:44)
        at com.github.amkay.gradle.gitflow.strategy.AbstractStrategy.infer(AbstractStrategy.groovy:58)
        at com.github.amkay.gradle.gitflow.strategy.Strategy$infer$0.call(Unknown Source)
        at com.github.amkay.gradle.gitflow.version.DelayedVersionWithType.infer(DelayedVersionWithType.groovy:55)

Our need:
We need to be able to appose not-related version tags to commits

Proposed solution:

At line 101 of:
https://github.com/amkay/gradle-gitflow/blob/1dfd896193e9db2d283cc2aba030742203d4780a/src/main/groovy/com/github/amkay/gradle/gitflow/version/NearestVersionLocator.groovy

Handle the exception "ParseException" threw by the method "Version.valueOf" and go to the next tag.

NearestVersionLocator handles DEFAULT_VERSION_PREFIX as 1 character, but it is a string which can be longer than 1

We get
`Execution failed for task ':display_version'.

com.github.zafarkhaja.semver.UnexpectedCharacterException (no error message)`

when we use gitflow config
[gitflow "prefix"] feature = feature/ release = release/ hotfix = hotfix/ support = support/ versiontag = v_

This error occurs in NearestVersionLocator because in line
Version version = Version.valueOf(tag.name[ 0 ] == versionPrefix ? tag.name[ 1..-1 ] : tag.name)

implementation compares only first char of the tag name as versionPrefix. In my config I have prefix "v_" which is 2 is string wiht length 2.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.