Kinda silly question, but I used Activator to get started with the play framework, and now need to see what version I'm using. 2.3 came out with support for docker, but when I put
dockerExposedPorts in Docker := Seq(9000, 9443)
in my build.sbt, it complains it doesn't know what dockerExposedPorts is, so I'm thinking I might be running 2.2.
Type playVersion within the activator console.
Alternatively you can look in project/plugins.sbt for the line
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.2") In this example, the play version is 2.3.2
I use the following to list and highlight all play versions in a play project. Works for a multi-module project as well.
The following was tested on macOS Sierra using the default BSD find that it comes with and GNU grep installed via brew install grep. The latter is required since the following command requires a grep that supports Perl regex (which BSD grep does not).
You can check if the grep on your PATH has Perl-regex support by doing this (should show that the -P option is available):
$ ggrep --help | grep -i Perl -P, --perl-regexp PATTERN is a Perl regular expression (ggrep is the GNU grep installed via Homebrew)
And now, on to the actual command (note the ggrep in the command):
$ find . -name "plugins.sbt" -exec ggrep -PHin --color=always 'com.typesafe.play.*sbt-plugin.*%\s*"\K.*?(?=")' {} \; which outputs: 
Quick notes about the grep options (extracted from grep help):
-P, --perl-regexp PATTERN is a Perl regular expression -i, --ignore-case ignore case distinctions -n, --line-number print line number with output lines -H, --with-filename print file name with output lines
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With