diff --git a/.jvmopts b/.jvmopts new file mode 100644 index 00000000..9c7812d7 --- /dev/null +++ b/.jvmopts @@ -0,0 +1,3 @@ +-Xms1024M +-Xmx2048M +-Xss1M diff --git a/README.md b/README.md index 7a88cccb..75eca290 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ This can be achieved by running: - Setup Amiable configuration. A conf file is expected from Amiable. - The location of that file (as shown in `./sbt`) is: `$HOME/.gu/amiable.local.conf` + The location of that file is: `$HOME/.gu/amiable.local.conf` That file must contain all the configuration values that exist in `application.conf` For example the following values must be set: @@ -27,7 +27,10 @@ This can be achieved by running: In order to setup the auth parameters (eg. `serviceAccountCertPath`), please consult someone from the Dev Tools team. - - `./sbt run` open your browser at `https://amiable.local.dev-gutools.co.uk`! + - `sbt run` open your browser at `https://amiable.local.dev-gutools.co.uk`! + +### Debugging + To attach a debugger, use sbt's built-in flag: `sbt -jvm-debug 1056 run`. Then connect your IDE's remote debugger to port 1056. ### Common problems - If when running main you can an error "Could not find a suitable constructor..." it's something wrong with your diff --git a/build.sbt b/build.sbt index e79969e3..8af211c4 100644 --- a/build.sbt +++ b/build.sbt @@ -19,6 +19,10 @@ Universal / javaOptions ++= Seq( Test / javaOptions += "-Dconfig.file=conf/application.test.conf" +// For local development: load config from ~/.gu/amiable.local.conf. +// Uses Runtime scope so Play's dev server picks it up (same pattern as guardian/frontend). +Runtime / javaOptions += s"-Dconfig.file=${System.getProperty("user.home")}/.gu/amiable.local.conf" + routesGenerator := InjectedRoutesGenerator scalacOptions := Seq( diff --git a/sbt b/sbt deleted file mode 100755 index 3d3844f4..00000000 --- a/sbt +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -# Debug option -DEBUG_PARAMS="" -for arg in "$@" -do - if [ "$arg" == "--debug" ]; then - echo "setting java process as debuggable" - DEBUG_PARAMS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1056" - shift - fi -done - -java $DEBUG_PARAMS \ - -Xms1024M -Xmx2048M -Xss1M \ - -Dconfig.file=$HOME/.gu/amiable.local.conf \ - -jar sbt-launch.jar "$@" diff --git a/sbt-launch.jar b/sbt-launch.jar deleted file mode 100644 index c065b47b..00000000 Binary files a/sbt-launch.jar and /dev/null differ