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

Changes to rules are not picked up without cleaning #3

Open
avonengel opened this issue Sep 27, 2018 · 0 comments
Open

Changes to rules are not picked up without cleaning #3

avonengel opened this issue Sep 27, 2018 · 0 comments

Comments

@avonengel
Copy link

I just started to experiment with the plugin, and started with the following block:

gitVersion {
    rules {

        onBranch('master') {
            version = '1.0.0-master'
        }

        onBranch(~/release\/v(\d+\.\d+\.\d+)/) {
            version = matches[1]
            version.prereleaseTag = "-rc." + countCommitsSince(branchPoint('origin/develop'))
        }
    }
}

Running ./gradlew showGitVersion on branch release/v1.2.3:

$ ./gradlew cleanDetermineGitVersion showGitVersion

> Task :showGitVersion
1.2.3--rc.1

Note the duplicate --, due to my inserting it into the prereleaseTag manually.
I then removed that additional -, and reran showGitVersion:

$ ./gradlew showGitVersion

> Task :showGitVersion
1.2.3--rc.1

Browsing through your sources, I saw something about a cache, and ran ./gradlew cleanDetermineGitVersion showGitVersion:

$ ./gradlew cleanDetermineGitVersion showGitVersion

> Task :showGitVersion
1.2.3-rc.1

So it looks like changes to the branching rules are not picked up by Gradle's up-to-date checks. Probably because you tagged the rules container in DetermineGitVersion as @Internal instead of @Input.

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

1 participant