Skip to content

option to output build version #85

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

Open
ailrst opened this issue Sep 26, 2023 · 3 comments
Open

option to output build version #85

ailrst opened this issue Sep 26, 2023 · 3 comments
Assignees

Comments

@ailrst
Copy link
Contributor

ailrst commented Sep 26, 2023

It would be nice (e.g. for godbolt) to have basil be able to output its own version, ideally at this stage this could just be the commit sha it was built from.

@l-kent
Copy link
Contributor

l-kent commented Sep 27, 2023

Yeah, I don't think we'd need more than just the commit SHA for now

@ziggyfish
Copy link
Contributor

ziggyfish commented Oct 9, 2023

This is generally done through git tags, generally when you create a new tag for a commit. Most build systems (including this one), will give the git version or tag during the build process through environment variables. These environment variables can then be picked up by sbt ( sys.env.get("NAME_OF_ENV_VAR") ) and compiled into the package, accessable by ( version = getClass.getPackage.getImplementationVersion ) .

Hopefully that helps.

@ailrst
Copy link
Contributor Author

ailrst commented Nov 7, 2023

The plan is to add an sbt action to write the current git tag to a version file, and have that set to the version in scala that is output from the program. It is possibly also useful to have a 'test build' sbt action which derives a new version from the current git commit.

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

No branches or pull requests

3 participants