Skip to content

nextVersion and snapshotSuffix ignored when using new plugin syntax #3

Description

@colindean

This is likely user error, as I'm still pretty new to Gradle.

My incredibly pared down build.gradle, untested in this context:

plugins {
  id 'scala'
  id "com.cinnober.gradle.semver-git" version "2.2.2" // semantic versioning from git
}
apply plugin: 'scala'
ext {
  nextVersion = "patch"
  snapshotSuffix = "-dev-<count>-g<sha>"
}
apply plugin: "com.cinnober.gradle.semver-git"
task printVersion << {
  println project.ext.properties.containsKey("nextVersion")
  println project.ext.properties.get("nextVersion")
  println project.ext.nextVersion
  println project.ext.snapshotSuffix
  println project.version
}

I have a tag I created with git tag -a 99.9.9 -m "Test tag for testing". I have one commit more on top of it.

I expect the output of ./gradlew printVersion to contain 99.9.10-dev-1-gd34db33f or something similar. It instead prints something like this:

:printVersion
true
patch
patch
-dev-<count>-g<sha>
99.10.0-SNAPSHOT

I pretty certain that I have ext in the right place, but it appears not to be effective. What do I need to change?

I'm on Gradle 2.10.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions