How to include play filters, cache in build.gradle

I am trying to migrate our https://github.com/megamsys/megam_gateway.git > playframework 2.4 from sbt to gradle.

We use play filters, and cache. Any idea how i can include them in the build.gradle ?
Here is my build.gradle file https://github.com/megamsys/megam_gateway/blob/0.9/build.gradle
Any pointers would be welcome. I don’t find info in the doc as well.

ram@ramwork:megam_gateway|0.9 *%]$ gradle assemble
:compilePlayBinaryRoutes UP-TO-DATE
:compilePlayBinaryTwirlTemplates UP-TO-DATE
:compilePlayBinaryScala/home/ram/code/megam/scala/megam_gateway/app/Global.scala:32: object filters is not a member of package play
import play.filters.gzip.{ GzipFilter }
            ^
/home/ram/code/megam/scala/megam_gateway/app/Global.scala:43: not found: type GzipFilter
object Global extends WithFilters(new GzipFilter(shouldGzip = (request, response) =>
                                      ^
/home/ram/code/megam/scala/megam_gateway/app/Global.scala:43: not found: value shouldGzip
object Global extends WithFilters(new GzipFilter(shouldGzip = (request, response) =>
                                                 ^
/home/ram/code/megam/scala/megam_gateway/app/controllers/Application.scala:30: object cache is not a member of package play.api
import play.api.cache._
                ^
/home/ram/code/megam/scala/megam_gateway/app/models/cache/InMemoryCache.scala:21: object cache is not a member of package play.api
import play.api.cache._

You can include the required dependencies like this:

def playVersion = '2.4.3'
def scalaVersion = '2.11'

model {
    components {
        play {
            platform play: playVersion, scala: scalaVersion
        }
    }
}

dependencies {
    ['play-cache', 'filters-helpers'].each { playModule ->
        play "com.typesafe.play:${playModule}_$scalaVersion:$playVersion"
    }
}

I hope this helps.

Super cool. That worked :+1: . Trying to see how other requirements would fit in.
Build is very fast. Testing, like application.conf load and such.

  1. We have other packages (https://github.com/megamsy/scaliak.git, https://github.com/megamsy/megam_common) which needs to be published in bin-tray.

  2. We also build debian packages using sbt-native-packager. We’ll play around with gradle dist, plugins or use a workaroun to just build Rake scripts using our https://github.com/megamsys/packager to build deb packages.