scala-weather icon indicating copy to clipboard operation
scala-weather copied to clipboard

Create a custom SBT task to print the version

Open BenFradet opened this issue 6 years ago • 5 comments

would remove the need for this:

https://github.com/snowplow/scala-weather/blob/bfc3e3be447dbe0df9d167d402f8957f5bb34536/.travis/deploy.sh#L17

BenFradet avatar Jul 17 '18 10:07 BenFradet

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

oschrenk avatar Oct 01 '18 17:10 oschrenk

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)

BenFradet avatar Oct 02 '18 09:10 BenFradet

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 https://github.com/sbt/sbt/pull/4341

oschrenk avatar Oct 02 '18 17:10 oschrenk

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

oschrenk avatar Oct 02 '18 17:10 oschrenk

Thanks, useful info :+1:

BenFradet avatar Oct 03 '18 09:10 BenFradet