Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4116 from jroper/3473-conf-dir
Sorted out conf directory
- Loading branch information
Showing
12 changed files
with
150 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
framework/src/sbt-plugin/src/sbt-test/play-sbt-plugin/distribution/app/Global.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import play.api._ | ||
|
||
object Global extends GlobalSettings { | ||
|
||
override def onStart(app: Application): Unit = { | ||
// If the app lasts for more than 10 seconds, shut it down, so that the scripted tests don't leak, | ||
// but be sure that we don't call System.exit while shutting down, as this will create a deadlock | ||
val thread = new Thread() { | ||
override def run() = { | ||
try { | ||
Thread.sleep(10000) | ||
// We won't reach here if the app shuts down normally, because an exception will be thrown | ||
println("Forcibly terminating JVM that hasn't been shut down") | ||
System.exit(1) | ||
} catch { | ||
case _: Throwable => | ||
} | ||
} | ||
} | ||
thread.setDaemon(true) | ||
thread.start() | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
framework/src/sbt-plugin/src/sbt-test/play-sbt-plugin/distribution/conf/alternate.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
play.crypto.secret=";1[WE]JmK;XMCxV=S2P6kYl?A<^YcKYW3aui[SmusaQlkjq97A`M8l_S:iV?OmDh" | ||
play.i18n.langs = [ "en" ] | ||
some.config="bar" |
57 changes: 1 addition & 56 deletions
57
framework/src/sbt-plugin/src/sbt-test/play-sbt-plugin/distribution/conf/application.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,3 @@ | ||
# This is the main configuration file for the application. | ||
# ~~~~~ | ||
|
||
# Secret key | ||
# ~~~~~ | ||
# The secret key is used to secure cryptographics functions. | ||
# If you deploy your application to several instances be sure to use the same key! | ||
play.crypto.secret=";1[WE]JmK;XMCxV=S2P6kYl?A<^YcKYW3aui[SmusaQlkjq97A`M8l_S:iV?OmDh" | ||
|
||
# The application languages | ||
# ~~~~~ | ||
play.i18n.langs = [ "en" ] | ||
|
||
# Global object class | ||
# ~~~~~ | ||
# Define the Global object class for this application. | ||
# Default to Global in the root package. | ||
# application.global=Global | ||
|
||
# Router | ||
# ~~~~~ | ||
# Define the Router object to use for this application. | ||
# This router will be looked up first when the application is starting up, | ||
# so make sure this is the entry point. | ||
# Furthermore, it's assumed your route file is named properly. | ||
# So for an application router like `my.application.Router`, | ||
# you may need to define a router file `conf/my.application.routes`. | ||
# Default to Routes in the root package (and conf/routes) | ||
# application.router=my.application.Routes | ||
|
||
# Database configuration | ||
# ~~~~~ | ||
# You can declare as many datasources as you want. | ||
# By convention, the default datasource is named `default` | ||
# | ||
# db.default.driver=org.h2.Driver | ||
# db.default.url="jdbc:h2:mem:play" | ||
# db.default.user=sa | ||
# db.default.password="" | ||
|
||
# Evolutions | ||
# ~~~~~ | ||
# You can disable evolutions if needed | ||
# play.modules.evolutions.enabled=false | ||
|
||
# Logger | ||
# ~~~~~ | ||
# You can also configure logback (http://logback.qos.ch/), by providing a logger.xml file in the conf directory . | ||
|
||
# Root logger: | ||
logger.root=ERROR | ||
|
||
# Logger used by the framework: | ||
logger.play=INFO | ||
|
||
# Logger provided to your application: | ||
logger.application=DEBUG | ||
|
||
some.config="foo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 23 additions & 8 deletions
31
framework/src/sbt-plugin/src/sbt-test/play-sbt-plugin/distribution/test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,27 @@ | ||
# Build the distribution and ensure that the files we expect are indeed there | ||
> dist-and-unzip | ||
$ exists target/dist/README | ||
$ exists target/dist/SomeFile.txt | ||
$ exists target/dist/SomeFolder/SomeOtherFile.txt | ||
> stage | ||
$ exists target/universal/stage/README | ||
$ exists target/universal/stage/SomeFile.txt | ||
$ exists target/universal/stage/SomeFolder/SomeOtherFile.txt | ||
|
||
> check-start-script | ||
$ exists target/dist/conf/application.conf | ||
-$ exists target/dist/conf/routes | ||
$ exists target/dist/lib | ||
$ exists target/dist/share/doc/api | ||
$ exists target/universal/stage/conf/application.conf | ||
$ exists target/universal/stage/lib | ||
$ exists target/universal/stage/share/doc/api | ||
|
||
# Run it to make sure everything works | ||
> start --no-exit-sbt | ||
> check-config foo | ||
> stop --no-exit-sbt | ||
|
||
# Change the configuration in the conf directory, make sure it takes effect | ||
$ copy-file conf/alternate.conf target/universal/stage/conf/application.conf | ||
> start --no-exit-sbt | ||
> check-config bar | ||
> stop --no-exit-sbt | ||
|
||
# Turn off externalize resources, rebuild, make sure the conf directory is not created or on the classpath | ||
> set PlayKeys.externalizeResources := false | ||
> stage | ||
-$ exists target/dist/conf/application.conf | ||
> check-start-script no-conf |