Skip to content
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

Automate versioning for build process #1131

Merged
merged 6 commits into from
Apr 22, 2024
Merged

Automate versioning for build process #1131

merged 6 commits into from
Apr 22, 2024

Conversation

jtmccr1
Copy link
Contributor

@jtmccr1 jtmccr1 commented Mar 16, 2022

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?

@jtmccr1 jtmccr1 requested review from msuchard and rambaut March 16, 2022 11:39
@jtmccr1
Copy link
Contributor Author

jtmccr1 commented Mar 21, 2022

I got rid of the tag behavior- that was too much. Now it just reports the commit the jar file was built from and whether or not the working tree is dirty. This solves the problem of having to hardcode in the commit hash which can only be done after the commit has been made. It does not affect how the versioning is handled.

@jtmccr1 jtmccr1 marked this pull request as ready for review March 21, 2022 12:44
@rambaut rambaut merged commit 8011836 into master Apr 22, 2024
1 check failed
@rambaut rambaut deleted the auto_version branch April 22, 2024 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants