Automate versioning for build process #1131
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
During development I often jump between branches and jar files. This pull request aims to make that process more robust by automatically storing the last tag (including version), current commit, and status (dirty or clean) in the jar file. This is done by running a few git commands during the ant build and then inserting their output into a version.txt file that is included in the jar. BeastVersion parses this file and provides access to the relevant data.
The catch is that this parses the version from the tag name, so tags need to follow a conventional format. All of the tags back version 1.8.2 follow the format v([\d.]+)[^\\d.].* where the group captures the version number. If this is too restrictive we could keep the current hard coded version numbering in BeastVersion and use this behavior to report only the commit and status.
It looks like this might not play nicely (yet) with the continuous integration system.
Is this useful to anyone else?