├── inject ├── sample │ ├── public │ │ ├── stylesheets │ │ │ └── main.css │ │ └── images │ │ │ └── favicon.png │ ├── project │ │ ├── build.properties │ │ ├── plugins.sbt │ │ └── Build.scala │ ├── app │ │ ├── views │ │ │ └── index.scala.html │ │ ├── service │ │ │ ├── Something.java │ │ │ └── MyService.java │ │ ├── controllers │ │ │ └── Application.java │ │ ├── Global.java │ │ └── module │ │ │ └── Dependencies.java │ └── conf │ │ ├── play.plugins │ │ ├── routes │ │ └── application.conf ├── project │ ├── build.properties │ └── Build.scala ├── sample_without_static_field │ ├── public │ │ ├── stylesheets │ │ │ └── main.css │ │ └── images │ │ │ └── favicon.png │ ├── project │ │ ├── build.properties │ │ ├── plugins.sbt │ │ └── Build.scala │ ├── app │ │ ├── views │ │ │ └── index.scala.html │ │ ├── service │ │ │ ├── Something.java │ │ │ └── MyService.java │ │ ├── Global.java │ │ ├── controllers │ │ │ └── Application.java │ │ └── module │ │ │ └── Dependencies.java │ └── conf │ │ ├── play.plugins │ │ ├── routes │ │ └── application.conf ├── src │ └── main │ │ └── java │ │ └── com │ │ ├── typesafe │ │ └── plugin │ │ │ └── inject │ │ │ ├── ManualInjectionPlugin.java │ │ │ ├── InjectPlugin.java │ │ │ └── Helper.java │ │ └── google │ │ └── inject │ │ └── mini │ │ └── MiniGuice.java └── README.md ├── dust ├── sample │ ├── build.sbt │ ├── project │ │ ├── build.properties │ │ ├── Build.scala │ │ └── plugins.sbt │ ├── app │ │ ├── assets │ │ │ └── example.tl │ │ ├── controllers │ │ │ └── Application.java │ │ └── views │ │ │ └── index.scala.html │ ├── public │ │ ├── images │ │ │ └── favicon.png │ │ └── javascripts │ │ │ ├── dust-core-0.3.0.min.js │ │ │ ├── dust-core-0.6.0.min.js │ │ │ └── dust-core-0.6.0.js │ └── conf │ │ ├── routes │ │ └── application.conf ├── project │ └── build.properties ├── src │ ├── main │ │ └── scala │ │ │ └── com │ │ │ └── typesafe │ │ │ └── plugin │ │ │ ├── DustKeys.scala │ │ │ ├── DustPlugin.scala │ │ │ └── DustTasks.scala │ └── test │ │ └── scala │ │ └── com │ │ └── typesafe │ │ └── plugin │ │ └── DustTasksTest.scala ├── build.sbt └── README.md ├── redis ├── project │ ├── build.properties │ └── plugins.sbt ├── version.sbt ├── src │ ├── main │ │ ├── resources │ │ │ └── reference.conf │ │ └── scala │ │ │ └── com │ │ │ └── typesafe │ │ │ └── play │ │ │ └── redis │ │ │ ├── SedisPoolProvider.scala │ │ │ ├── JedisPoolProvider.scala │ │ │ ├── RedisModule.scala │ │ │ └── RedisCacheApi.scala │ └── test │ │ └── scala │ │ └── com │ │ └── typesafe │ │ └── play │ │ └── redis │ │ └── RedisCacheApiSpec.scala ├── build.sbt └── README.md ├── sbtlogger ├── project │ └── build.properties ├── build.sbt ├── README.md └── src │ └── main │ └── scala │ └── com │ └── typesafe │ └── util │ └── Sbt.scala ├── util ├── project │ └── build.properties ├── build.sbt ├── README.md └── src │ └── main │ └── scala │ └── com │ └── typesafe │ └── plugin │ └── package.scala ├── sbtgoodies ├── project │ └── build.properties ├── sample │ ├── project │ │ ├── build.properties │ │ ├── plugins.sbt │ │ └── Build.scala │ └── conf │ │ ├── routes │ │ └── application.conf ├── src │ └── main │ │ └── scala │ │ └── com │ │ └── typesafe │ │ └── plugin │ │ ├── SbtGoodiesKeys.scala │ │ ├── SbtGoodiesPlugin.scala │ │ └── sbtGoodiesTasks.scala ├── build.sbt └── README.md ├── statsd ├── README.textile ├── project │ ├── build.properties │ └── plugins.sbt ├── .gitignore ├── sample │ └── sample-statsd │ │ ├── app │ │ ├── Global.scala │ │ └── controllers │ │ │ └── Application.scala │ │ ├── conf │ │ ├── application.conf │ │ └── routes │ │ └── test │ │ └── IntegrationTest.scala ├── src │ ├── main │ │ ├── scala │ │ │ └── play │ │ │ │ └── modules │ │ │ │ └── statsd │ │ │ │ └── api │ │ │ │ ├── Sugar.scala │ │ │ │ ├── StatsdFilter.scala │ │ │ │ ├── StatsdClientCake.scala │ │ │ │ └── StatsdClient.scala │ │ └── java │ │ │ └── play │ │ │ └── modules │ │ │ └── statsd │ │ │ ├── StatsdFilter.java │ │ │ └── Statsd.java │ └── test │ │ ├── java │ │ └── play │ │ │ └── modules │ │ │ └── statsd │ │ │ └── StatsdTest.java │ │ └── scala │ │ └── play │ │ └── modules │ │ └── statsd │ │ └── api │ │ └── StatsdSpec.scala ├── build.sbt └── documentation │ └── manual │ └── home.textile ├── mailer └── README.md ├── run-tests-travis.sh ├── .gitignore ├── .travis.yml ├── README.md └── guice └── README.md /inject/sample/public/stylesheets/main.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dust/sample/build.sbt: -------------------------------------------------------------------------------- 1 | name := "dust-sample" 2 | -------------------------------------------------------------------------------- /dust/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.12.0 2 | -------------------------------------------------------------------------------- /inject/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.11.3 -------------------------------------------------------------------------------- /redis/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.8 2 | -------------------------------------------------------------------------------- /sbtlogger/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.11.3 -------------------------------------------------------------------------------- /util/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.5 2 | -------------------------------------------------------------------------------- /sbtgoodies/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.12.0 2 | -------------------------------------------------------------------------------- /statsd/README.textile: -------------------------------------------------------------------------------- 1 | documentation/manual/home.textile -------------------------------------------------------------------------------- /statsd/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.5 2 | -------------------------------------------------------------------------------- /dust/sample/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.11.3 2 | -------------------------------------------------------------------------------- /inject/sample/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.11.3 2 | -------------------------------------------------------------------------------- /inject/sample_without_static_field/public/stylesheets/main.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /redis/version.sbt: -------------------------------------------------------------------------------- 1 | version in ThisBuild := "2.5.1-SNAPSHOT" 2 | -------------------------------------------------------------------------------- /sbtgoodies/sample/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.12.0 2 | -------------------------------------------------------------------------------- /dust/sample/app/assets/example.tl: -------------------------------------------------------------------------------- 1 | Hello {name}! You have {count} new messages. -------------------------------------------------------------------------------- /statsd/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | project/boot/ 3 | project/target/ 4 | logs/ 5 | -------------------------------------------------------------------------------- /inject/sample/app/views/index.scala.html: -------------------------------------------------------------------------------- 1 | @(message: String) 2 | 3 | @message 4 | -------------------------------------------------------------------------------- /inject/sample_without_static_field/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.11.3 2 | -------------------------------------------------------------------------------- /inject/sample/conf/play.plugins: -------------------------------------------------------------------------------- 1 | 1500:com.typesafe.plugin.inject.ManualInjectionPlugin 2 | -------------------------------------------------------------------------------- /mailer/README.md: -------------------------------------------------------------------------------- 1 | # This project has moved to https://github.com/playframework/play-mailer 2 | -------------------------------------------------------------------------------- /inject/sample_without_static_field/app/views/index.scala.html: -------------------------------------------------------------------------------- 1 | @(message: String) 2 | 3 | @message 4 | 5 | -------------------------------------------------------------------------------- /inject/sample_without_static_field/conf/play.plugins: -------------------------------------------------------------------------------- 1 | 1500:com.typesafe.plugin.inject.ManualInjectionPlugin 2 | -------------------------------------------------------------------------------- /dust/sample/public/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/playframework/play-plugins/HEAD/dust/sample/public/images/favicon.png -------------------------------------------------------------------------------- /inject/sample/app/service/Something.java: -------------------------------------------------------------------------------- 1 | package service; 2 | 3 | public interface Something { 4 | 5 | public String noWhat(); 6 | 7 | } -------------------------------------------------------------------------------- /inject/sample/public/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/playframework/play-plugins/HEAD/inject/sample/public/images/favicon.png -------------------------------------------------------------------------------- /inject/sample_without_static_field/app/service/Something.java: -------------------------------------------------------------------------------- 1 | package service; 2 | 3 | public interface Something { 4 | 5 | public String noWhat(); 6 | 7 | } -------------------------------------------------------------------------------- /inject/sample_without_static_field/public/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/playframework/play-plugins/HEAD/inject/sample_without_static_field/public/images/favicon.png -------------------------------------------------------------------------------- /statsd/sample/sample-statsd/app/Global.scala: -------------------------------------------------------------------------------- 1 | import play.api.mvc.WithFilters 2 | import play.modules.statsd.api.StatsdFilter 3 | 4 | object Global extends WithFilters(new StatsdFilter) 5 | -------------------------------------------------------------------------------- /redis/project/plugins.sbt: -------------------------------------------------------------------------------- 1 | addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.3") 2 | addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0") 3 | addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "0.5.0") 4 | -------------------------------------------------------------------------------- /run-tests-travis.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | if [ "$PROJECT" = "redis" ] 4 | then 5 | cd util && sbt +publish-local && cd ../$PROJECT && sbt test 6 | else 7 | cd util && sbt +publish-local && cd ../$PROJECT && sbt +test 8 | fi 9 | -------------------------------------------------------------------------------- /sbtgoodies/src/main/scala/com/typesafe/plugin/SbtGoodiesKeys.scala: -------------------------------------------------------------------------------- 1 | package com.typesafe.plugin 2 | 3 | import sbt._ 4 | 5 | trait SbtGoodiesKeys { 6 | val distUnzip = TaskKey[Unit]("dist-unzip", "unzip the standalone application package") 7 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | logs/ 3 | repository/ 4 | dist/ 5 | *.lock 6 | *.komodoproject 7 | .DS_Store 8 | project/boot/ 9 | framework/project/boot/ 10 | documentation/api 11 | workspace/ 12 | framework/sbt/boot 13 | .history 14 | .idea 15 | RUNNING_PID 16 | -------------------------------------------------------------------------------- /inject/sample/app/service/MyService.java: -------------------------------------------------------------------------------- 1 | package service; 2 | 3 | public abstract class MyService { 4 | 5 | protected Something s; 6 | 7 | public MyService(Something s) { 8 | this.s = s; 9 | } 10 | 11 | abstract public String demonstrate(); 12 | } -------------------------------------------------------------------------------- /statsd/sample/sample-statsd/conf/application.conf: -------------------------------------------------------------------------------- 1 | 2 | application.secret="h:ueBbICA:P37;UIGe5ib>VSN@14UAag/e6t>_AtZ[uiZ?Ae/]QTLN?vfSSyOv2" 3 | application.langs="en" 4 | 5 | statsd.enabled=true 6 | statsd.host=localhost 7 | statsd.port=8125 8 | statsd.stat.prefix=statsd-sample 9 | -------------------------------------------------------------------------------- /inject/sample_without_static_field/app/service/MyService.java: -------------------------------------------------------------------------------- 1 | package service; 2 | 3 | public abstract class MyService { 4 | 5 | protected Something s; 6 | 7 | public MyService(Something s) { 8 | this.s = s; 9 | } 10 | 11 | abstract public String demonstrate(); 12 | } -------------------------------------------------------------------------------- /sbtgoodies/sample/conf/routes: -------------------------------------------------------------------------------- 1 | # Routes 2 | # This file defines all application routes (Higher priority routes first) 3 | # ~~~~ 4 | 5 | # Map static resources from the /public folder to the /assets URL path 6 | GET /assets/*file controllers.Assets.at(path="/public", file) 7 | 8 | -------------------------------------------------------------------------------- /inject/sample/project/plugins.sbt: -------------------------------------------------------------------------------- 1 | // Comment to get more information during initialization 2 | logLevel := Level.Warn 3 | 4 | // The Typesafe repository 5 | resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" 6 | 7 | // Use the Play sbt plugin for Play projects 8 | addSbtPlugin("play" % "sbt-plugin" % "2.0.1") 9 | -------------------------------------------------------------------------------- /redis/src/main/resources/reference.conf: -------------------------------------------------------------------------------- 1 | play { 2 | 3 | modules { 4 | enabled += "com.typesafe.play.redis.RedisModule" 5 | } 6 | 7 | cache { 8 | # The name of the default cache to use in redis 9 | defaultCache = "play" 10 | 11 | redis { 12 | # The caches to bind 13 | bindCaches = [] 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /statsd/project/plugins.sbt: -------------------------------------------------------------------------------- 1 | // Comment to get more information during initialization 2 | // logLevel := Level.Warn 3 | 4 | // The Typesafe repository 5 | resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" 6 | 7 | // Use the Play sbt plugin for Play projects 8 | addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.0") 9 | -------------------------------------------------------------------------------- /inject/sample_without_static_field/project/plugins.sbt: -------------------------------------------------------------------------------- 1 | // Comment to get more information during initialization 2 | logLevel := Level.Warn 3 | 4 | // The Typesafe repository 5 | resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" 6 | 7 | // Use the Play sbt plugin for Play projects 8 | addSbtPlugin("play" % "sbt-plugin" % "2.0.1") 9 | -------------------------------------------------------------------------------- /inject/sample/conf/routes: -------------------------------------------------------------------------------- 1 | # Routes 2 | # This file defines all application routes (Higher priority routes first) 3 | # ~~~~ 4 | 5 | # Home page 6 | GET / controllers.Application.index() 7 | 8 | # Map static resources from the /public folder to the /assets URL path 9 | GET /assets/*file controllers.Assets.at(path="/public", file) 10 | -------------------------------------------------------------------------------- /sbtgoodies/src/main/scala/com/typesafe/plugin/SbtGoodiesPlugin.scala: -------------------------------------------------------------------------------- 1 | package com.typesafe.plugin 2 | 3 | import sbt._ 4 | import Keys._ 5 | 6 | object SbtGoodiesPlugin extends Plugin with SbtGoodiesTasks { 7 | 8 | val distUnzipSettings: Seq[Setting[_]] = Seq( 9 | distUnzip <<= distUnzipTask, 10 | distUnzip <<= distUnzip.dependsOn(PlayProject.dist) 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /inject/sample_without_static_field/conf/routes: -------------------------------------------------------------------------------- 1 | # Routes 2 | # This file defines all application routes (Higher priority routes first) 3 | # ~~~~ 4 | 5 | # Home page 6 | GET / module.Dependencies.application.index 7 | 8 | # Map static resources from the /public folder to the /assets URL path 9 | GET /assets/*file controllers.Assets.at(path="/public", file) 10 | -------------------------------------------------------------------------------- /inject/sample/app/controllers/Application.java: -------------------------------------------------------------------------------- 1 | package controllers; 2 | 3 | import play.*; 4 | import play.mvc.*; 5 | 6 | import views.html.*; 7 | 8 | import javax.inject.*; 9 | import service.*; 10 | 11 | public class Application extends Controller { 12 | 13 | @Inject MyService s; 14 | 15 | public static Result index() { 16 | return ok(index.render(s.demonstrate())); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /inject/sample/app/Global.java: -------------------------------------------------------------------------------- 1 | import play.*; 2 | import play.libs.*; 3 | 4 | import java.util.*; 5 | 6 | import service.MyService; 7 | import com.typesafe.plugin.inject.InjectPlugin; 8 | 9 | public class Global extends GlobalSettings { 10 | 11 | public void onStart(Application app) { 12 | Logger.warn("getting an instance from guice:"+ app.plugin(InjectPlugin.class).getInstance(MyService.class)); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /inject/sample_without_static_field/app/Global.java: -------------------------------------------------------------------------------- 1 | import play.*; 2 | import play.libs.*; 3 | 4 | import java.util.*; 5 | 6 | import service.MyService; 7 | import com.typesafe.plugin.inject.InjectPlugin; 8 | 9 | public class Global extends GlobalSettings { 10 | 11 | public void onStart(Application app) { 12 | Logger.warn("getting an instance from guice:"+ app.plugin(InjectPlugin.class).getInstance(MyService.class)); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /sbtgoodies/sample/project/plugins.sbt: -------------------------------------------------------------------------------- 1 | // Comment to get more information during initialization 2 | logLevel := Level.Warn 3 | 4 | // The Typesafe repository 5 | resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" 6 | 7 | // SbtGoodies plugin 8 | addSbtPlugin("com.typesafe" % "play-plugins-sbtgoodies" % "0.2") 9 | 10 | // Use the Play sbt plugin for Play projects 11 | addSbtPlugin("play" % "sbt-plugin" % "2.1-08072012") 12 | -------------------------------------------------------------------------------- /redis/src/main/scala/com/typesafe/play/redis/SedisPoolProvider.scala: -------------------------------------------------------------------------------- 1 | package com.typesafe.play.redis 2 | 3 | import javax.inject.{Inject, Provider, Singleton} 4 | 5 | import org.sedis.Pool 6 | import redis.clients.jedis.JedisPool 7 | 8 | @Singleton 9 | class SedisPoolProvider @Inject()(jedisPool: JedisPool) extends Provider[Pool] { 10 | lazy val get: Pool = { 11 | val sedisPool = { 12 | new Pool(jedisPool) 13 | } 14 | sedisPool 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /dust/sample/conf/routes: -------------------------------------------------------------------------------- 1 | # Routes 2 | # This file defines all application routes (Higher priority routes first) 3 | # ~~~~ 4 | 5 | # frame page 6 | GET / controllers.Application.frame() 7 | 8 | # JSON data 9 | GET /data controllers.Application.data() 10 | 11 | # Map static resources from the /public folder to the /assets URL path 12 | GET /assets/*file controllers.Assets.at(path="/public", file) 13 | 14 | -------------------------------------------------------------------------------- /dust/sample/project/Build.scala: -------------------------------------------------------------------------------- 1 | import sbt._ 2 | import Keys._ 3 | import PlayProject._ 4 | 5 | object ApplicationBuild extends Build { 6 | 7 | val appName = "play-plugins-dust-sample" 8 | val appVersion = "1.0-SNAPSHOT" 9 | 10 | val appDependencies = Seq( 11 | // Add your project dependencies here, 12 | ) 13 | 14 | val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings( 15 | 16 | ) 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /sbtgoodies/sample/project/Build.scala: -------------------------------------------------------------------------------- 1 | import sbt._ 2 | import Keys._ 3 | import PlayProject._ 4 | 5 | object ApplicationBuild extends Build { 6 | 7 | val appName = "play-plugins-sbtgoodies-sample" 8 | val appVersion = "1.0-SNAPSHOT" 9 | 10 | val appDependencies = Seq( 11 | // Add your project dependencies here, 12 | ) 13 | 14 | val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings( 15 | 16 | ) 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /inject/sample_without_static_field/app/controllers/Application.java: -------------------------------------------------------------------------------- 1 | package controllers; 2 | 3 | import play.*; 4 | import play.mvc.*; 5 | 6 | import views.html.*; 7 | 8 | import javax.inject.*; 9 | import service.*; 10 | 11 | public class Application extends Controller { 12 | 13 | private MyService s; 14 | 15 | @Inject public Application( MyService s) { 16 | this.s=s; 17 | } 18 | 19 | public Result index() { 20 | return ok(index.render(s.demonstrate())); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /dust/src/main/scala/com/typesafe/plugin/DustKeys.scala: -------------------------------------------------------------------------------- 1 | package com.typesafe.plugin 2 | 3 | import sbt._ 4 | 5 | trait DustKeys { 6 | lazy val dustFileRegexFrom = SettingKey[String]("play-dust-file-regex-from") 7 | lazy val dustFileRegexTo = SettingKey[String]("play-dust-file-regex-to") 8 | lazy val dustAssetsGlob = SettingKey[PathFinder]("play-dust-assets-glob") 9 | lazy val dustAssetsDir = SettingKey[File]("play-dust-assets-dir") 10 | lazy val dustFileEnding = SettingKey[String]("play-dust-file-ending") 11 | } -------------------------------------------------------------------------------- /inject/sample/project/Build.scala: -------------------------------------------------------------------------------- 1 | import sbt._ 2 | import Keys._ 3 | import PlayProject._ 4 | 5 | object ApplicationBuild extends Build { 6 | 7 | val appName = "j" 8 | val appVersion = "1.0-SNAPSHOT" 9 | 10 | val appDependencies = Seq( 11 | "com.typesafe" % "play-plugins-inject" % "2.0.2" 12 | 13 | ) 14 | 15 | val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings( 16 | // Add your own project settings here 17 | ) 18 | 19 | } 20 | -------------------------------------------------------------------------------- /dust/sample/app/controllers/Application.java: -------------------------------------------------------------------------------- 1 | package controllers; 2 | 3 | import org.codehaus.jackson.node.ObjectNode; 4 | 5 | import play.*; 6 | import play.mvc.*; 7 | import play.libs.*; 8 | import views.html.*; 9 | 10 | public class Application extends Controller { 11 | 12 | public static Result frame() { 13 | return ok(index.render()); 14 | } 15 | 16 | public static Result data() { 17 | ObjectNode json = Json.newObject(); 18 | 19 | json.put("name", "Json"); 20 | json.put("count", 1); 21 | 22 | return ok(json); 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /inject/sample_without_static_field/project/Build.scala: -------------------------------------------------------------------------------- 1 | import sbt._ 2 | import Keys._ 3 | import PlayProject._ 4 | 5 | object ApplicationBuild extends Build { 6 | 7 | val appName = "j" 8 | val appVersion = "1.0-SNAPSHOT" 9 | 10 | val appDependencies = Seq( 11 | "com.typesafe" % "play-plugins-inject" % "2.0.2" 12 | 13 | ) 14 | 15 | val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings( 16 | // Add your own project settings here 17 | ) 18 | 19 | } 20 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | jdk: 2 | - openjdk6 3 | - oraclejdk8 4 | language: scala 5 | env: 6 | - PROJECT=statsd 7 | - PROJECT=redis 8 | script: ./run-tests-travis.sh 9 | matrix: 10 | exclude: 11 | - jdk: openjdk6 12 | env: PROJECT=redis 13 | - jdk: oraclejdk8 14 | env: PROJECT=statsd 15 | services: 16 | - redis-server 17 | before_cache: 18 | - find $HOME/.ivy2 -name "ivydata-*.properties" -delete 19 | - find $HOME/.sbt -name "*.lock" -delete 20 | cache: 21 | directories: 22 | - $HOME/.ivy2/cache 23 | - $HOME/.sbt/boot/ 24 | sudo: false 25 | -------------------------------------------------------------------------------- /dust/sample/project/plugins.sbt: -------------------------------------------------------------------------------- 1 | // Comment to get more information during initialization 2 | logLevel := Level.Warn 3 | 4 | // The Typesafe repository 5 | resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" 6 | 7 | // The Typesafe SNAPSHOT repository 8 | resolvers += Resolver.url("Typesafe Ivy Snapshots Repository", url("http://repo.typesafe.com/typesafe/ivy-snapshots/"))(Resolver.ivyStylePatterns) 9 | 10 | // The Dust plugin 11 | addSbtPlugin("com.typesafe" % "play-plugins-dust" % "1.4.1") 12 | 13 | // Use the Play sbt plugin for Play projects 14 | -------------------------------------------------------------------------------- /inject/sample/app/module/Dependencies.java: -------------------------------------------------------------------------------- 1 | package module; 2 | 3 | import com.google.inject.Provides; 4 | import javax.inject.Singleton; 5 | import service.*; 6 | 7 | public class Dependencies { 8 | 9 | @Provides 10 | @Singleton 11 | public Something makeSomething() { 12 | return new Something() { 13 | public String noWhat() { 14 | return "yay"; 15 | } 16 | }; 17 | } 18 | 19 | @Provides 20 | @Singleton 21 | public MyService makeService(Something s) { 22 | return new MyService(s) { 23 | public String demonstrate() { return s.noWhat();} 24 | }; 25 | } 26 | 27 | 28 | } -------------------------------------------------------------------------------- /dust/src/main/scala/com/typesafe/plugin/DustPlugin.scala: -------------------------------------------------------------------------------- 1 | package com.typesafe.plugin 2 | 3 | import sbt._ 4 | import Keys._ 5 | import org.apache.commons.io.FilenameUtils 6 | 7 | object DustPlugin extends Plugin with DustTasks { 8 | 9 | override def settings: Seq[Setting[_]] = super.settings ++ Seq( 10 | dustAssetsDir <<= (sourceDirectory in Compile)(src => (src / "assets")), 11 | dustFileEnding := ".tl", 12 | dustAssetsGlob <<= (dustAssetsDir)(assetsDir => assetsDir ** "*.tl"), 13 | dustFileRegexFrom <<= (dustFileEnding)(fileEnding => fileEnding), 14 | dustFileRegexTo <<= (dustFileEnding)(fileEnding => FilenameUtils.removeExtension(fileEnding) + ".js"), 15 | resourceGenerators in Compile <+= DustCompiler) 16 | 17 | } -------------------------------------------------------------------------------- /dust/src/test/scala/com/typesafe/plugin/DustTasksTest.scala: -------------------------------------------------------------------------------- 1 | import org.specs2.mutable._ 2 | import com.typesafe.plugin._ 3 | 4 | class HelloWorldSpec extends Specification with DustTasks { 5 | "The Dust compiler" should { 6 | "resolve template names correctly on Unix" in { 7 | val file = "/var/projects/sample/app/assets/templates/foo.tl" 8 | val assetsDir = "/var/projects/sample/app/assets" 9 | templateName(file, assetsDir) must be_==("templates/foo") 10 | } 11 | "resolve template names correctly on Windows" in { 12 | val file = "C:\\projects\\sample\\app\\assets\\templates\\foo.tl" 13 | val assetsDir = "C:\\projects\\sample\\app\\assets" 14 | templateName(file, assetsDir) must be_==("templates/foo") 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /dust/sample/app/views/index.scala.html: -------------------------------------------------------------------------------- 1 | @() 2 | 3 | 4 | @import play._ 5 | 6 | 7 |
8 |
12 | * public class Global extends GlobalSettings {
13 | * public Class[] filters() {
14 | * return new Class[] {StatsdFilter.class};
15 | * }
16 | * }
17 | *
18 | */
19 | public class StatsdFilter implements EssentialFilter {
20 |
21 | // We have to keep a static reference since the Java GlobalSettings instantiates a new filter for every request,
22 | // and the filter holds a cache.
23 | private static final play.modules.statsd.api.StatsdFilter filter = new play.modules.statsd.api.StatsdFilter();
24 |
25 | @Override
26 | public EssentialAction apply(EssentialAction next) {
27 | return filter.apply(next);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/statsd/sample/sample-statsd/app/controllers/Application.scala:
--------------------------------------------------------------------------------
1 | package controllers
2 |
3 | import play.api.mvc._
4 | import play.api.libs.concurrent.Execution.Implicits._
5 | import scala.concurrent.Future
6 |
7 | object Application extends Controller {
8 | def index = Action {
9 | Thread.sleep(2)
10 | Ok
11 | }
12 |
13 | def singleParam(p: String) = Action {
14 | Thread.sleep(2)
15 | Ok
16 | }
17 |
18 | def twoParams(p1: String, p2: String) = Action {
19 | Thread.sleep(2)
20 | Ok
21 | }
22 |
23 | def async = Action.async {
24 | Future {
25 | Thread.sleep(2)
26 | Ok
27 | }
28 | }
29 |
30 | def syncFailure = Action {
31 | Thread.sleep(2)
32 | if (true) throw new RuntimeException
33 | Ok
34 | }
35 |
36 | def asyncFailure = Action.async {
37 | Future {
38 | Thread.sleep(2)
39 | if (true) throw new RuntimeException
40 | Ok
41 | }
42 | }
43 |
44 | def error = Action {
45 | Thread.sleep(2)
46 | ServiceUnavailable
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/sbtlogger/build.sbt:
--------------------------------------------------------------------------------
1 | import sbt.Defaults._
2 |
3 | sbtPlugin := true
4 |
5 | name := "play-plugins-logger"
6 |
7 | version := "0.2"
8 |
9 | organization := "com.typesafe"
10 |
11 | libraryDependencies <++= (scalaVersion, sbtVersion) {
12 | case (scalaVersion, sbtVersion) => Seq(
13 | sbtPluginExtra("play" % "sbt-plugin" % "2.0.2", sbtVersion, scalaVersion)
14 | )
15 | }
16 |
17 | libraryDependencies += "com.sun.jna" % "jna" % "3.0.9"
18 |
19 | publishMavenStyle := false
20 |
21 | resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"
22 |
23 | publishTo <<= (version) { version: String =>
24 | val typesafeIvyReleases = Resolver.url("Typesafe Ivy Releases Repository", url("http://repo.typesafe.com/typesafe/ivy-releases/"))(Resolver.ivyStylePatterns)
25 | val typesafeIvySnapshot = Resolver.url("Typesafe Ivy Snapshots Repository", url("http://repo.typesafe.com/typesafe/ivy-snapshots/"))(Resolver.ivyStylePatterns)
26 | val repo = if (version.trim.endsWith("SNAPSHOT")) typesafeIvySnapshot
27 | else typesafeIvyReleases
28 | Some(repo)
29 | }
30 |
--------------------------------------------------------------------------------
/inject/src/main/java/com/typesafe/plugin/inject/ManualInjectionPlugin.java:
--------------------------------------------------------------------------------
1 | package com.typesafe.plugin.inject;
2 | import play.*;
3 |
4 | public class ManualInjectionPlugin extends InjectPlugin {
5 |
6 | public ManualInjectionPlugin(Application app) {
7 | super(app);
8 | }
9 |
10 | public