Open glucazeau opened 7 years ago
I see no reason to explicitly checkout the tag as the release version commit hash is the same. The tag just points to that commit hash. If the release build is performed you should be able to set the git commit hash of the latest commit and that should match the one from the hash. Or am I wrong?
Hello Hillkorn,
We actually put the Git hash into some properties file in our build, so it's injected in some code and shown on startup. Currently, we get the hash of the commit just before the release version commit.
That's why I suggested to build from the tag as I know it's how the Maven plugin works, but maybe it's just a change in our Gradle build file?
You're right that at build time of your project the commit is not done and therefore you can't know the hash. I don't have an idea for an easy way to achieve that. The easiest i can think of is to create another plugin that connects the tasks in a different order.
Would it be possible to actually build from the tag, not the branch? Basically like what the Maven plugin does if I'm right:
(prepare)
(perform)
We include the Git SHA-1 in our build info and we would like it to match the tag commit, and we'd prefer to build from the tag.
I would be glad to send a PR for Git, but I don't know Mercurial, and I think Subversion requires more work (like a checkout in a subdirectory).
Any thoughts on this?