Skip to content

Changes to rules are not picked up without cleaning #3

Description

@avonengel

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions