-
Notifications
You must be signed in to change notification settings - Fork 15
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
nextVersion and snapshotSuffix ignored when using new plugin syntax #3
Comments
Strange. You usage is more or less exactly how we use semver-git internally. You could try to apply semver-git with:
since that is how it is generally applied here, though it seems to me that your build file should work. |
Unfortunately, that still doesn't work. I'm going to try a barebones project and see what I can make happen. It's entirely possible that something else in our |
I'm able to reproduce it with the barebones config.
Put this in 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"
Some exploration to try:
My output:
As you can see, at the end, it's defaulting to bumping minor and I've also tried switching to the |
Hi Colin, The project.version is assigned by semver-git when the plugin is applied. This means that the related properties must to be set before that step. /Mikael |
I reversed the order so that the application of plugins {
id 'java'
id "com.cinnober.gradle.semver-git" version "2.2.2" // semantic versioning from git
}
ext {
nextVersion = "patch"
snapshotSuffix = "-dev-<count>-g<sha>"
}
apply plugin: "com.cinnober.gradle.semver-git"
apply plugin: 'java' My configuration is still having no effect. Thrashing a bit, I tried adding a |
I'm not sure what else I can change. @mbrannstrom @mojocinn, what version of Gradle are you using? |
OK, some progress: buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.cinnober.gradle:semver-git:2.2.2"
}
}
plugins {
id 'java'
// id "com.cinnober.gradle.semver-git" version "2.2.2" // semantic versioning from git
}
ext.nextVersion = "patch"
ext.snapshotSuffix = "-dev-<count>-g<sha>"
apply plugin: "com.cinnober.gradle.semver-git"
apply plugin: 'java' This works, and so does this: buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath group: 'com.cinnober.gradle', name: 'semver-git', version: '2.2.0'
}
}
plugins {
id 'java'
// id "com.cinnober.gradle.semver-git" version "2.2.2" // semantic versioning from git
}
ext.nextVersion = "patch"
ext.snapshotSuffix = "-dev-<count>-g<sha>"
apply plugin: "com.cinnober.gradle.semver-git"
apply plugin: 'java'
I can't remember exactly, but I think I found |
Probably the take-away from this is a modification to the README which states NOT to use the newer |
Temporary workaround/documentation of Nasdaq#3
The newer way It is an experimental feature, and I suggest always using the old |
Thanks for the insight. On Apr 12, 2016, 01:48, at 01:48, "Mikael Brännström" [email protected] wrote:
|
I just got bit by this again on a new project. Is there any way to detect that it's running, or perhaps output some debug logging to show what it's doing? I probably burned 30 minutes trying to figure out what was incorrectly configured because someone else did it this time. |
@colindean if you move the ext {} into your buildscript {} this should work If you want a simple debug, try task version doLast {task -> println "This is $task.project.name $task.project.version" } |
This is likely user error, as I'm still pretty new to Gradle.
My incredibly pared down
build.gradle
, untested in this context: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 contain99.9.10-dev-1-gd34db33f
or something similar. It instead prints something like this: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.
The text was updated successfully, but these errors were encountered: