playframework/Play20 — pull request #594 by guillaumebort (2012-12-06 15:37:55+00:00)
Title: Allow to inject some configuration from the Build file to the application in DEV mode

As reported in https://play.lighthouseapp.com/projects/82401-play-20/tickets/794-for-discussion-expose-a-new-way-to-get-settings-from-the-build-system-to-a-running-play-app#ticket-794-2, using global Java system properties to override some settings is painful with multi-projects organization.

Let's introduce a new Build setting `devSettings: Seq[(String, String)]` to inject some configuration into the Play application at __Dev__ time. These values are seen as standard configuration values.

Here is the priority order:

- A global Java system property always override any value set in `application.conf`
- A value injected via `devSettings` always override both, the value set in `application.conf` or set via a global Java system property.

The special setting `config.file` can be used to specify another main application configuration file (the same way the global `-Dconfig.file=xxx` does it currently).

Here is a sample:

```scala
val main = play.Project(appName, appVersion, appDependencies).settings(

, devSettings += ("config.file" -> "conf/my.conf")
, devSettings += ("application.context" -> "/youhou")
, devSettings += ("application.version" -> appVersion)
, devSettings <+= (baseDirectory) { root => "application.root" -> root.getAbsolutePath }

)
```