Add Ant task to output info about the current commit
ahelwer opened this issue · comments
Description
I would like to add an Ant task which emits info about the current commit into Ant properties.
Motivation
For rolling releases, it is desirable to extract properties from the current commit so they can be embedded in the build version that is displayed to the user (example: 1.8.0-alpha (rev: abcdef) 19 July 2024
). While the Ant exec
task could be used to run git and parse its output, it is desirable to take a dependency on JGit instead of whatever version of git is installed and on the system path (if any). It would thus be desirable to add an Ant task exposing this functionality that is closely tied to JGit itself.
Alternatives considered
Currently we use one of the many unmaintained JGit wrapper Ant tasks floating around github (this one, specifically). However, it does not expose the info we want - in our case, the commit time which is desired so we can embed the time in the build and users can enjoy the benefits of knowing how old their version of our app is without sacrificing build reproducibility by taking the build time from the system clock. Various other wrappers were evaluated but they are all similarly unmaintained.
Additional context
I am willing to implement this feature. If I write it, is it likely to be merged?
You are welcome to implement this ant task in org.eclipse.jgit.ant.
Find the contributor guide here.