How to find out which Play version I'm using?

Solution 1:

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

Solution 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: enter image description here

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