Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 832
joslinm Avatar asked Oct 16 '14 16:10

joslinm


2 Answers

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

like image 173
James Davies Avatar answered Oct 08 '22 08:10

James Davies


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 
like image 40
Ashutosh Jindal Avatar answered Oct 08 '22 08:10

Ashutosh Jindal