ajoberstar / reckon

Infer a project's version from your Git repository.
Apache License 2.0
185 stars 28 forks source link

ReckonTagCreate skipped always, snapshotFromProp #126

Closed nickheniser closed 4 years ago

nickheniser commented 4 years ago

I have a new repository with no existing tags. I have added reckon:

plugins {
    id 'org.ajoberstar.reckon' version '0.11.0'
}

reckon {
    scopeFromProp()
    snapshotFromProp()
}

//ensure we don't create tags on broken builds
reckonTagCreate.dependsOn check

When trying to create a tag, the build succeeds, but no tag is every created. The error message isn't helpful.

> .\gradlew.bat reckonTagPush -Preckon.scope=minor --info
...
Selected primary task 'reckonTagPush' from project :
Reckoned version: 0.1.0-SNAPSHOT
...
> Task :check UP-TO-DATE
Skipping task ':check' as it has no actions.
:check (Thread[Execution worker for ':',5,main]) completed. Took 0.0 secs.
:reckonTagCreate (Thread[Execution worker for ':',5,main]) started.

> Task :reckonTagCreate SKIPPED
Skipping task ':reckonTagCreate' as task onlyIf is false.
:reckonTagCreate (Thread[Execution worker for ':',5,main]) completed. Took 0.001 secs.
:reckonTagPush (Thread[Execution worker for ':',5,main]) started.

> Task :reckonTagPush SKIPPED
Skipping task ':reckonTagPush' as task onlyIf is false.
:reckonTagPush (Thread[Execution worker for ':',5,main]) completed. Took 0.0 secs.
Closing Git repo: C:\code\OfflineDataConsumer\.git

git status shows a clean repo:

> git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

so does running from grgit via a status block:

task status {
  doLast {
    println grgit.status()
  }
}
> .\gradlew.bat status

> Task :status
org.ajoberstar.grgit.Status(staged:org.ajoberstar.grgit.Status$Changes(added:[], modified:[], removed:[], allChanges:[]), unstaged:org.ajoberstar.grgit.Status$Changes(added:[], modified:[], removed:[], allChanges:[]), conflicts:[], clean:true)
nickheniser commented 4 years ago

I realized this is because I was trying to create a tag from an 'insignificant version' (relevant code: creatingTag, Version)

I guess I was expecting some error message instead of successful gradle completion.