Browse Source

Got most of the scala frameworks updated

Mike Smith 10 years ago
parent
commit
dc514dd039
36 changed files with 104 additions and 472 deletions
  1. 1 3
      frameworks/Scala/finagle/bash_profile.sh
  2. 0 33
      frameworks/Scala/finagle/setup.py
  3. 5 0
      frameworks/Scala/finagle/setup.sh
  4. 3 0
      frameworks/Scala/lift-stateless/bash_profile.sh
  5. 1 0
      frameworks/Scala/lift-stateless/install.sh
  6. 0 35
      frameworks/Scala/lift-stateless/setup.py
  7. 7 0
      frameworks/Scala/lift-stateless/setup.sh
  8. 3 0
      frameworks/Scala/plain/bash_profile.sh
  9. 1 0
      frameworks/Scala/plain/install.sh
  10. 0 1
      frameworks/Scala/plain/sbt
  11. BIN
      frameworks/Scala/plain/sbt-launch.jar
  12. 0 55
      frameworks/Scala/plain/sbt.bat
  13. 0 37
      frameworks/Scala/plain/setup.py
  14. 7 0
      frameworks/Scala/plain/setup.sh
  15. 3 0
      frameworks/Scala/play-activate-mysql/bash_profile.sh
  16. 1 1
      frameworks/Scala/play-activate-mysql/install.sh
  17. 0 43
      frameworks/Scala/play-activate-mysql/setup.py
  18. 12 0
      frameworks/Scala/play-activate-mysql/setup.sh
  19. 3 0
      frameworks/Scala/play-scala-mongodb/bash_profile.sh
  20. 12 0
      frameworks/Scala/play-scala-mongodb/setup.sh
  21. 2 0
      frameworks/Scala/scalatra/bash_profile.sh
  22. 1 1
      frameworks/Scala/scalatra/install.sh
  23. 0 37
      frameworks/Scala/scalatra/setup.py
  24. 9 0
      frameworks/Scala/scalatra/setup.sh
  25. 3 0
      frameworks/Scala/scruffy/bash_profile.sh
  26. 0 35
      frameworks/Scala/scruffy/setup.py
  27. 7 0
      frameworks/Scala/scruffy/setup.sh
  28. 3 0
      frameworks/Scala/spray/bash_profile.sh
  29. 1 1
      frameworks/Scala/spray/install.sh
  30. 0 30
      frameworks/Scala/spray/setup.py
  31. 5 0
      frameworks/Scala/spray/setup.sh
  32. 3 0
      frameworks/Scala/unfiltered/bash_profile.sh
  33. 1 0
      frameworks/Scala/unfiltered/install.sh
  34. 0 159
      frameworks/Scala/unfiltered/sbt-launch-lib.bash
  35. 9 0
      frameworks/Scala/unfiltered/setup_unfiltered.sh
  36. 1 1
      frameworks/Scala/unfiltered/src/main/scala/Plans.scala

+ 1 - 3
frameworks/Scala/finagle/bash_profile.sh

@@ -1,5 +1,3 @@
 #!/bin/bash
 
-export SBT_HOME=${IROOT}/sbt
-
-export PATH="$SBT_HOME/bin:$PATH"
+export SBT_HOME=${IROOT}/sbt

+ 0 - 33
frameworks/Scala/finagle/setup.py

@@ -1,33 +0,0 @@
-
-import subprocess
-import sys
-import time
-import os
-
-def start(args, logfile, errfile):
-
-    if os.name == 'nt':
-      subprocess.check_call("..\\sbt\\sbt.bat update compile", shell=True, cwd="finagle", stderr=errfile, stdout=logfile)
-      subprocess.Popen("..\\sbt\\sbt.bat -Ddb.host=" + args.database_host + " run", cwd="finagle", shell=True, stderr=errfile, stdout=logfile)
-    else:
-      subprocess.check_call("sbt update compile", shell=True, cwd="finagle", stderr=errfile, stdout=logfile)
-      subprocess.Popen("sbt -Ddb.host=" + args.database_host + " run", cwd="finagle", shell=True, stderr=errfile, stdout=logfile)
-
-    return 0
-
-
-def stop(logfile, errfile):
-  if os.name == 'nt':
-    subprocess.check_call("wmic process where \"CommandLine LIKE '%\\\\sbt\\\\sbt%'\" call terminate", stderr=errfile, stdout=logfile)
-  else:
-    p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
-    out, err = p.communicate()
-    for line in out.splitlines():
-      if 'sbt' in line:
-        try:
-          pid = int(line.split(None, 2)[1])
-          os.kill(pid, 15)
-        except OSError:
-          pass
-  
-  return 0

+ 5 - 0
frameworks/Scala/finagle/setup.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+${SBT_HOME}/bin/sbt update compile
+
+${SBT_HOME}/bin/sbt -Ddb.host=${DBHOST} run &

+ 3 - 0
frameworks/Scala/lift-stateless/bash_profile.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+export SBT_HOME=${IROOT}/sbt

+ 1 - 0
frameworks/Scala/lift-stateless/install.sh

@@ -1,2 +1,3 @@
 #!/bin/bash
 
+fw_depends java sbt

+ 0 - 35
frameworks/Scala/lift-stateless/setup.py

@@ -1,35 +0,0 @@
-
-import subprocess
-import sys
-import setup_util
-import os
-import time
-
-def start(args, logfile, errfile):
-  setup_util.replace_text("lift-stateless/src/main/scala/Main.scala", "> \".*:3306", "> \"" + args.database_host + ":3306")
-
-  if os.name == 'nt':
-    subprocess.check_call('"..\\sbt\\sbt.bat" update assembly', shell=True, cwd="lift-stateless", stderr=errfile, stdout=logfile)
-    subprocess.Popen(".\\run.bat", shell=True, cwd="lift-stateless", stderr=errfile, stdout=logfile)  
-  else:
-    subprocess.check_call("$FWROOT/sbt/sbt update assembly", shell=True, cwd="lift-stateless", stderr=errfile, stdout=logfile)
-    subprocess.Popen("./run", shell=True, cwd="lift-stateless", stderr=errfile, stdout=logfile)
-  return 0
-def stop(logfile, errfile):
-  if os.name == 'nt':
-    subprocess.check_call("wmic process where \"CommandLine LIKE '%lift-stateless-assembly%'\" call terminate", stderr=errfile, stdout=logfile)
-  else:
-    p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
-    out, err = p.communicate()
-    for line in out.splitlines():
-      if 'lift-stateless-assembly' in line and 'java' in line:
-        pid = int(line.split(None, 2)[1])
-        os.kill(pid, 15)
-
-  # Takes up so much disk space
-  if os.name == 'nt':
-    subprocess.check_call("del /f /s /q target", shell=True, cwd="lift-stateless", stderr=errfile, stdout=logfile)
-  else:
-    subprocess.check_call("rm -rf target", shell=True, cwd="lift-stateless", stderr=errfile, stdout=logfile)
-    
-  return 0

+ 7 - 0
frameworks/Scala/lift-stateless/setup.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+sed -i 's|> ".*:3306|> ":'"${DBHOST}"'3306|g' src/main/scala/Main.scala
+
+${SBT_HOME}/bin/sbt update assembly
+
+./run &

+ 3 - 0
frameworks/Scala/plain/bash_profile.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+export SBT_HOME=${IROOT}/sbt

+ 1 - 0
frameworks/Scala/plain/install.sh

@@ -1,2 +1,3 @@
 #!/bin/bash
 
+fw_depends java sbt

+ 0 - 1
frameworks/Scala/plain/sbt

@@ -1 +0,0 @@
-java -server -Xnoclassgc -XX:MaxPermSize=1g -XX:ReservedCodeCacheSize=384m -Xmx8g -Xss8m -Xmn4g -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=384M -Dsbt.global.base=project/.sbtboot -Dsbt.boot.directory=project/.boot -Dsbt.ivy.home=project/.ivy -jar `dirname $0`/sbt-launch.jar "$@"

BIN
frameworks/Scala/plain/sbt-launch.jar


+ 0 - 55
frameworks/Scala/plain/sbt.bat

@@ -1,55 +0,0 @@
-@REM SBT launcher script
-@REM 
-@REM Envioronment:
-@REM JAVA_HOME - location of a JDK home dir (mandatory)
-@REM SBT_OPTS  - JVM options (optional)
-@REM Configuration:
-@REM sbtconfig.txt found in the SBT_HOME.
-
-@REM   ZOMG! We need delayed expansion to build up CFG_OPTS later 
-@setlocal enabledelayedexpansion
-
-@echo off
-set SBT_HOME=%~dp0
-set SBT_OPTS=-Xmx3g -Xms2g -Xmn1g -Xss8M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=384M
-set ERROR_CODE=0
-
-rem FIRST we load the config file of extra options.
-set FN=%SBT_HOME%\..\conf\sbtconfig.txt
-set CFG_OPTS=
-FOR /F "tokens=* eol=# usebackq delims=" %%i IN ("%FN%") DO (
-  set DO_NOT_REUSE_ME=%%i
-  rem ZOMG (Part #2) WE use !! here to delay the expansion of
-  rem CFG_OPTS, otherwise it remains "" for this loop.
-  set CFG_OPTS=!CFG_OPTS! !DO_NOT_REUSE_ME!
-)
-
-rem We use the value of the JAVACMD environment variable if defined
-set _JAVACMD=%JAVACMD%
-
-if "%_JAVACMD%"=="" (
-  if not "%JAVA_HOME%"=="" (
-    if exist "%JAVA_HOME%\bin\java.exe" set "_JAVACMD=%JAVA_HOME%\bin\java.exe"
-  )
-)
-
-if "%_JAVACMD%"=="" set _JAVACMD=java
-
-rem We use the value of the JAVA_OPTS environment variable if defined, rather than the config.
-set _JAVA_OPTS=%JAVA_OPTS%
-if "%_JAVA_OPTS%"=="" set _JAVA_OPTS=%CFG_OPTS%
-
-:run
-
-"%_JAVACMD%" %_JAVA_OPTS% %SBT_OPTS% -cp "%SBT_HOME%sbt-launch.jar" xsbt.boot.Boot %*
-if ERRORLEVEL 1 goto error
-goto end
-
-:error
-set ERROR_CODE=1
-
-:end
-
-@endlocal
-
-exit /B %ERROR_CODE%

+ 0 - 37
frameworks/Scala/plain/setup.py

@@ -1,37 +0,0 @@
-import setup_util
-import subprocess
-import sys
-import time
-import os
-
-def start(args, logfile, errfile):
-  setup_util.replace_text("plain/src/main/resources/application.conf", "127.0.0.1", args.database_host)
-  if os.name == 'nt':
-    subprocess.check_call(".\sbt.bat assembly && del /f /s /q target\scala-2.10\cache", shell=True, cwd="plain", stderr=errfile, stdout=logfile)
-  else:
-    subprocess.check_call("./sbt assembly && rm -rf target/scala-2.10/cache", shell=True, cwd="plain", stderr=errfile, stdout=logfile)
-
-  subprocess.Popen("java -jar target/scala-2.10/plain-benchmark-assembly-1.0.1.jar", cwd="plain", shell=True, stderr=errfile, stdout=logfile)
-  return 0
-
-def stop(logfile, errfile):
-  if os.name == 'nt':
-    subprocess.call("taskkill /f /im *plain-benchmark* > NUL", shell=True, stderr=errfile, stdout=logfile)
-  else:
-    p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
-    out, err = p.communicate()
-    for line in out.splitlines():
-      if 'plain-benchmark' in line:
-        try:
-          pid = int(line.split(None, 2)[1])
-          os.kill(pid, 15)
-        except OSError:
-          return 1
-
-  # Takes up so much disk space
-  if os.name == 'nt':
-    subprocess.check_call("del /f /s /q target && del /f /s /q project", shell=True, cwd="plain", stderr=errfile, stdout=logfile)
-  else:
-    subprocess.check_call("rm -rf target && rm -rf project/.ivy && rm -rf project/.boot", shell=True, cwd="plain", stderr=errfile, stdout=logfile)
-  
-  return 0

+ 7 - 0
frameworks/Scala/plain/setup.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+sed -i 's|127.0.0.1|'"${DBHOST}"'|g' src/main/resources/application.conf
+
+${SBT_HOME}/bin/sbt assembly && rm -rf target/scala-2.10/cache
+
+java -jar target/scala-2.10/plain-benchmark-assembly-1.0.1.jar &

+ 3 - 0
frameworks/Scala/play-activate-mysql/bash_profile.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+export PLAY2_HOME=${IROOT}/play-2.2.0

+ 1 - 1
frameworks/Scala/play-activate-mysql/install.sh

@@ -1,3 +1,3 @@
 #!/bin/bash
 
-fw_depends java maven
+fw_depends java maven play2

+ 0 - 43
frameworks/Scala/play-activate-mysql/setup.py

@@ -1,43 +0,0 @@
-
-import subprocess
-import sys
-import setup_util
-import os
-from zipfile import ZipFile
-
-def start(args, logfile, errfile):
-  setup_util.replace_text("play-activate-mysql/conf/application.conf", "jdbc:mysql:\/\/.*:3306", "jdbc:mysql://" + args.database_host + ":3306")
-
-  subprocess.check_call("play clean dist", shell=True, cwd="play-activate-mysql", stderr=errfile, stdout=logfile)
-
-  if os.name == 'nt':
-    ZipFile("./play-activate-mysql/target/universal/play-activate-mysql-1.0-SNAPSHOT.zip").extractall("./play-activate-mysql/target/universal")
-    with open("./play-activate-mysql/target/universal/play-activate-mysql-1.0-SNAPSHOT/bin/play-activate-mysql.bat", "w+") as f:
-      f.write("java %1 -cp \"./lib/*;\" play.core.server.NettyServer .")
-    subprocess.Popen("play-activate-mysql.bat", shell=True, cwd="play-activate-mysql/target/universal/play-activate-mysql-1.0-SNAPSHOT/bin", stderr=errfile, stdout=logfile)
-  else:
-    subprocess.check_call("unzip play-activate-mysql-1.0-SNAPSHOT.zip", shell=True, cwd="play-activate-mysql/target/universal", stderr=errfile, stdout=logfile)
-    subprocess.check_call("chmod +x play-activate-mysql", shell=True, cwd="play-activate-mysql/target/universal/play-activate-mysql-1.0-SNAPSHOT/bin", stderr=errfile, stdout=logfile)
-    subprocess.Popen("./play-activate-mysql", shell=True, cwd="play-activate-mysql/target/universal/play-activate-mysql-1.0-SNAPSHOT/bin", stderr=errfile, stdout=logfile)
-
-  return 0
-def stop(logfile, errfile):
-  try:
-    with open("./play-activate-mysql/target/universal/play-activate-mysql-1.0-SNAPSHOT/RUNNING_PID") as f:
-      pid = int(f.read())
-      os.kill(pid,15)
-  except Exception:
-    return 1
-
-  try:
-    os.remove("play-activate-mysql/target/universal/play-activate-mysql-1.0-SNAPSHOT/RUNNING_PID")
-  except OSError:
-    return 1
-
-  # Takes up so much disk space
-  if os.name == 'nt':
-    subprocess.check_call("del /f /s /q target", shell=True, cwd="play-activate-mysql", stderr=errfile, stdout=logfile)
-  else:
-    subprocess.check_call("rm -rf target", shell=True, cwd="play-activate-mysql", stderr=errfile, stdout=logfile)
-
-  return 0

+ 12 - 0
frameworks/Scala/play-activate-mysql/setup.sh

@@ -0,0 +1,12 @@
+#!/bin/bash
+
+sed -i 's|jdbc:mysql://.*:3306|jdbc:mysql://'"${DBHOST}"':3306|g' conf/application.conf
+
+${PLAY2_HOME}/play clean dist
+
+cd target/universal
+unzip play-activate-mysql-1.0-SNAPSHOT.zip
+cd play-activate-mysql-1.0-SNAPSHOT/bin
+chmod +x play-activate-mysql
+
+./play-activate-mysql &

+ 3 - 0
frameworks/Scala/play-scala-mongodb/bash_profile.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+export PLAY2_HOME=${IROOT}/play-2.2.0

+ 12 - 0
frameworks/Scala/play-scala-mongodb/setup.sh

@@ -0,0 +1,12 @@
+#!/bin/bash
+
+sed -i 's|jdbc:mysql://.*:3306|jdbc:mysql://'"${DBHOST}"':3306|g' conf/application.conf
+
+${PLAY2_HOME}/play clean dist
+
+cd target/universal
+unzip play-scala-mongodb-1.0-SNAPSHOT.zip
+cd play-scala-mongodb-1.0-SNAPSHOT/bin
+chmod +x play-scala-mongodb
+
+./play-scala-mongodb &

+ 2 - 0
frameworks/Scala/scalatra/bash_profile.sh

@@ -1,2 +1,4 @@
 export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
 export RESIN_HOME=${IROOT}/resin-4.0.41
+
+export SBT_HOME=${IROOT}/sbt

+ 1 - 1
frameworks/Scala/scalatra/install.sh

@@ -1,3 +1,3 @@
 #!/bin/bash
 
-fw_depends resin
+fw_depends resin sbt

+ 0 - 37
frameworks/Scala/scalatra/setup.py

@@ -1,37 +0,0 @@
-
-import subprocess
-import sys
-import setup_util
-import os
-import glob
-
-def start(args, logfile, errfile):
-  setup_util.replace_text("scalatra/src/main/webapp/WEB-INF/resin-web.xml", "mysql:\/\/.*:3306", "mysql://" + args.database_host + ":3306")
-
-  try:
-    if os.name == 'nt':
-      subprocess.check_call('"..\\sbt\\sbt.bat" clean package', shell=True, cwd="scalatra", stderr=errfile, stdout=logfile)
-      subprocess.check_call('rmdir /S /Q "%RESIN_HOME%\\webapps\\"', shell=True, stderr=errfile, stdout=logfile)
-      subprocess.check_call('mkdir "%RESIN_HOME%\\webapps\\"', shell=True, stderr=errfile, stdout=logfile)
-      
-      # 'copy' on windows doesn't like the wildcard war file selector
-      warFile = glob.glob("scalatra\\target\\scala-2.10\\scalatra*.war")[0]
-      subprocess.check_call('copy "{0}" "%RESIN_HOME%\\webapps\\scalatra.war"'.format(warFile), shell=True, stderr=errfile, stdout=logfile)
-      subprocess.check_call('"%RESIN_HOME%\\bin\\start.bat"', shell=True, stderr=errfile, stdout=logfile)
-    else:
-      subprocess.check_call("../sbt/sbt clean package", shell=True, cwd="scalatra", stderr=errfile, stdout=logfile)
-      subprocess.check_call("rm -rf $RESIN_HOME/webapps/*", shell=True, stderr=errfile, stdout=logfile)
-      subprocess.check_call("cp scalatra/target/scala-2.10/scalatra*.war $RESIN_HOME/webapps/scalatra.war", shell=True, stderr=errfile, stdout=logfile)
-      subprocess.check_call("$RESIN_HOME/bin/resinctl start", shell=True, stderr=errfile, stdout=logfile)
-    return 0
-  except subprocess.CalledProcessError:
-    return 1
-def stop(logfile, errfile):
-  try:
-    if os.name == 'nt':
-      subprocess.check_call('"%RESIN_HOME%\\bin\\stop.bat"', shell=True, stderr=errfile, stdout=logfile)
-    else:
-      subprocess.check_call("$RESIN_HOME/bin/resinctl shutdown", shell=True, stderr=errfile, stdout=logfile)
-    return 0
-  except subprocess.CalledProcessError:
-    return 1

+ 9 - 0
frameworks/Scala/scalatra/setup.sh

@@ -0,0 +1,9 @@
+#!/bin/bash
+
+sed -i 's|mysql://.*:3306|mysql://'"${DBHOST}"':3306|g' src/main/webapp/WEB-INF/resin-web.xml
+
+${SBT_HOME}/bin/sbt clean package
+
+rm -rf $RESIN_HOME/webapps/*
+cp target/scala-2.10/scalatra*.war $RESIN_HOME/webapps/scalatra.war
+$RESIN_HOME/bin/resinctl start

+ 3 - 0
frameworks/Scala/scruffy/bash_profile.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+export SBT_HOME=${IROOT}/sbt

+ 0 - 35
frameworks/Scala/scruffy/setup.py

@@ -1,35 +0,0 @@
-import setup_util
-import subprocess
-import sys
-import time
-import os
-
-def start(args, logfile, errfile):
-  setup_util.replace_text('scruffy/src/main/scala/scruffy/examples/Test2Endpoint.scala', 'database_host', args.database_host)
-  if os.name == 'nt':
-    subprocess.check_call('"..\\sbt\\sbt.bat" assembly', shell=True, cwd="scruffy", stderr=errfile, stdout=logfile)
-  else:
-    subprocess.check_call(args.iroot + "/sbt/bin/sbt assembly", shell=True, cwd="scruffy", stderr=errfile, stdout=logfile)
-    
-  subprocess.Popen("java -jar target/scala-2.11/scruffy-benchmark-assembly-1.0.1.jar -Dhostname=" + args.database_host,
-                    cwd="scruffy",
-                    shell=True,
-                    stderr=errfile,
-                    stdout=logfile)
-  return 0
-
-def stop(logfile, errfile):
-  if os.name == 'nt':
-    subprocess.check_call("wmic process where \"CommandLine LIKE '%scruffy-benchmark%'\" call terminate", stderr=errfile, stdout=logfile)
-  else:
-    p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
-    out, err = p.communicate()
-    for line in out.splitlines():
-      if 'scruffy-benchmark' in line:
-        try:
-          pid = int(line.split(None, 2)[1])
-          os.kill(pid, 15)
-        except OSError:
-          pass
-  
-  return 0

+ 7 - 0
frameworks/Scala/scruffy/setup.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+sed -i 's|database_host|'"${DBHOST}"'|g' src/main/scala/scruffy/examples/Test2Endpoint.scala
+
+$SBT_HOME/bin/sbt assembly
+
+java -jar target/scala-2.11/scruffy-benchmark-assembly-1.0.1.jar -Dhostname=${DBHOST} &

+ 3 - 0
frameworks/Scala/spray/bash_profile.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+export SBT_HOME=${IROOT}/sbt

+ 1 - 1
frameworks/Scala/spray/install.sh

@@ -1,3 +1,3 @@
 #!/bin/bash
 
-fw_depends scala
+fw_depends java scala sbt

+ 0 - 30
frameworks/Scala/spray/setup.py

@@ -1,30 +0,0 @@
-
-import subprocess
-import sys
-import time
-import os
-
-def start(args, logfile, errfile):
-  if os.name == 'nt':
-    subprocess.check_call('"..\\sbt\\sbt.bat" assembly', shell=True, cwd="spray", stderr=errfile, stdout=logfile)
-  else:
-    subprocess.check_call("$FWROOT/sbt/sbt assembly", shell=True, cwd="spray", stderr=errfile, stdout=logfile)
-    
-  subprocess.Popen("java -jar target/scala-2.10/spray-benchmark-assembly-1.0.jar", cwd="spray", shell=True, stderr=errfile, stdout=logfile)  
-  return 0
-
-def stop(logfile, errfile):
-  if os.name == 'nt':
-    subprocess.check_call("wmic process where \"CommandLine LIKE '%spray-benchmark%'\" call terminate", stderr=errfile, stdout=logfile)
-  else:
-    p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
-    out, err = p.communicate()
-    for line in out.splitlines():
-      if 'spray-benchmark' in line:
-        try:
-          pid = int(line.split(None, 2)[1])
-          os.kill(pid, 15)
-        except OSError:
-          pass
-  
-  return 0

+ 5 - 0
frameworks/Scala/spray/setup.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+${SBT_HOME}/bin/sbt assembly
+
+java -jar target/scala-2.10/spray-benchmark-assembly-1.0.jar &

+ 3 - 0
frameworks/Scala/unfiltered/bash_profile.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+export SBT_HOME=${IROOT}/sbt

+ 1 - 0
frameworks/Scala/unfiltered/install.sh

@@ -1,2 +1,3 @@
 #!/bin/bash
 
+fw_depends java scala sbt

+ 0 - 159
frameworks/Scala/unfiltered/sbt-launch-lib.bash

@@ -1,159 +0,0 @@
-#!/usr/bin/env bash
-#
-
-# A library to simplify using the SBT launcher from other packages.
-# Note: This should be used by tools like giter8/conscript etc.
-
-# TODO - Should we merge the main SBT script with this library?
-
-if test -z "$HOME"; then
-  declare -r script_dir="$(dirname $script_path)"
-else
-  declare -r script_dir="$HOME/.sbt"
-fi
-
-declare -a residual_args
-declare -a java_args
-declare -a scalac_args
-declare -a sbt_commands
-declare java_cmd=java
-
-echoerr () {
-  echo 1>&2 "$@"
-}
-vlog () {
-  [[ $verbose || $debug ]] && echoerr "$@"
-}
-dlog () {
-  [[ $debug ]] && echoerr "$@"
-}
-
-jar_file () {
-  echo "$(dirname $(realpath $0))/sbt-launch.jar"
-}
-
-acquire_sbt_jar () {
-  sbt_jar="$(jar_file)"
-
-  if [[ ! -f "$sbt_jar" ]]; then
-    echoerr "Could not find launcher jar: $sbt_jar"
-    exit 2
-  fi
-}
-
-execRunner () {
-  # print the arguments one to a line, quoting any containing spaces
-  [[ $verbose || $debug ]] && echo "# Executing command line:" && {
-    for arg; do
-      if printf "%s\n" "$arg" | grep -q ' '; then
-        printf "\"%s\"\n" "$arg"
-      else
-        printf "%s\n" "$arg"
-      fi
-    done
-    echo ""
-  }
-
-  exec "$@"
-}
-
-addJava () {
-  dlog "[addJava] arg = '$1'"
-  java_args=( "${java_args[@]}" "$1" )
-}
-addSbt () {
-  dlog "[addSbt] arg = '$1'"
-  sbt_commands=( "${sbt_commands[@]}" "$1" )
-}
-addResidual () {
-  dlog "[residual] arg = '$1'"
-  residual_args=( "${residual_args[@]}" "$1" )
-}
-addDebugger () {
-  addJava "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$1"
-}
-
-# a ham-fisted attempt to move some memory settings in concert
-# so they need not be dicked around with individually.
-get_mem_opts () {
-  local mem=${1:-1536}
-  local perm=$(( $mem / 4 ))
-  (( $perm > 256 )) || perm=256
-  (( $perm < 1024 )) || perm=1024
-  local codecache=$(( $perm / 2 ))
-
-  echo "-Xms${mem}m -Xmx${mem}m -XX:MaxPermSize=${perm}m -XX:ReservedCodeCacheSize=${codecache}m"
-}
-
-require_arg () {
-  local type="$1"
-  local opt="$2"
-  local arg="$3"
-  if [[ -z "$arg" ]] || [[ "${arg:0:1}" == "-" ]]; then
-    die "$opt requires <$type> argument"
-  fi
-}
-
-is_function_defined() {
-  declare -f "$1" > /dev/null
-}
-
-process_args () {
-  while [[ $# -gt 0 ]]; do
-    case "$1" in
-       -h|-help) usage; exit 1 ;;
-    -v|-verbose) verbose=1 && shift ;;
-      -d|-debug) debug=1 && shift ;;
-
-           -ivy) require_arg path "$1" "$2" && addJava "-Dsbt.ivy.home=$2" && shift 2 ;;
-           -mem) require_arg integer "$1" "$2" && sbt_mem="$2" && shift 2 ;;
-     -jvm-debug) require_arg port "$1" "$2" && addDebugger $2 && shift 2 ;;
-         -batch) exec </dev/null && shift ;;
-
-       -sbt-jar) require_arg path "$1" "$2" && sbt_jar="$2" && shift 2 ;;
-   -sbt-version) require_arg version "$1" "$2" && sbt_version="$2" && shift 2 ;;
-     -java-home) require_arg path "$1" "$2" && java_cmd="$2/bin/java" && shift 2 ;;
-
-            -D*) addJava "$1" && shift ;;
-            -J*) addJava "${1:2}" && shift ;;
-              *) addResidual "$1" && shift ;;
-    esac
-  done
-  
-  is_function_defined process_my_args && {
-    myargs=("${residual_args[@]}")
-    residual_args=()
-    process_my_args "${myargs[@]}"
-  }
-}
-
-run() {
-  # no jar? download it.
-  [[ -f "$sbt_jar" ]] || acquire_sbt_jar "$sbt_version" || {
-    # still no jar? uh-oh.
-    echo "Download failed. Obtain the sbt-launch.jar manually and place it at $sbt_jar"
-    exit 1
-  }
-
-  # process the combined args, then reset "$@" to the residuals
-  process_args "$@"
-  set -- "${residual_args[@]}"
-  argumentCount=$#
-
-  # run sbt
-  execRunner "$java_cmd" \
-    ${SBT_OPTS:-$default_sbt_opts} \
-    $(get_mem_opts $sbt_mem) \
-    ${java_opts} \
-    ${java_args[@]} \
-    -jar "$sbt_jar" \
-    "${sbt_commands[@]}" \
-    "${residual_args[@]}"
-}
-
-runAlternateBoot() {
-  local bootpropsfile="$1"
-  shift
-  addJava "-Dsbt.boot.properties=$bootpropsfile"
-  run $@
-}

+ 9 - 0
frameworks/Scala/unfiltered/setup_unfiltered.sh

@@ -0,0 +1,9 @@
+#!/bin/bash
+
+sed -i 's|jdbc:mysql://.*:3306|jdbc:mysql://'"${DBHOST}"':3306|g' src/main/resources/application.conf
+sed -i 's|maxThreads = .*|maxThreads = '"${MAX_THREADS}"'|g' src/main/resources/application.conf
+
+$SBT_HOME/bin/sbt assembly
+
+cd target/scala-2.10
+java -jar bench-assembly-1.0.0.jar &

+ 1 - 1
frameworks/Scala/unfiltered/src/main/scala/Plans.scala

@@ -25,7 +25,7 @@ object Plans extends cycle.Plan
   val db = DatabaseAccess.databases("db.default")
 
   def intent = {
-    case GET(Path("/json")) => JsonContent ~> ResponseString(compact(render("message" -> "Hello world")))
+    case GET(Path("/json")) => JsonContent ~> ResponseString(compact(render("message" -> "Hello, World!")))
     case GET(Path("/db") & Params(params)) =>
       val random = ThreadLocalRandom.current()
       val queries = params.get("queries").flatMap(_.headOption).getOrElse("1").toInt