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

Create a custom SBT task to print the version #84

Open
BenFradet opened this issue Jul 17, 2018 · 5 comments
Open

Create a custom SBT task to print the version #84

BenFradet opened this issue Jul 17, 2018 · 5 comments
Assignees

Comments

@BenFradet
Copy link
Contributor

would remove the need for this:

project_version=$(sbt version -Dsbt.log.noformat=true | perl -ne 'print "$1\n" if /(\d+\.\d+\.\d+[^\r\n]*)/' | head -n 1 | tr -d '\n')

@oschrenk
Copy link

oschrenk commented Oct 1, 2018

What is the problem with the line? If you want to get rid of perl you could use

sbt -no-colors 'inspect actual version' | grep Setting | cut -d '=' -f2

@BenFradet
Copy link
Contributor Author

I think I remember seeing a custom sbt task in another project that would just do this and that would let us do something like:

project_version=$(sbt myPrintVersion)

@oschrenk
Copy link

oschrenk commented Oct 2, 2018

You have to wait for the next sbt release then. They will introduce print which prints to stdout instead of using the logger (which you have to parse)

See sbt/sbt#4341

@oschrenk
Copy link

oschrenk commented Oct 2, 2018

Then you should be able to do sbt --error 'print version'.

@BenFradet
Copy link
Contributor Author

Thanks, useful info 👍

@BenFradet BenFradet modified the milestones: Backlog, 0.5.0 Feb 20, 2019
@BenFradet BenFradet self-assigned this Feb 20, 2019
@dilyand dilyand removed this from the 0.5.0 milestone Nov 27, 2019
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