Skip to content
Browse files

First blood - needs an XSBT plugin for proper single compile pass usa…

…ge & testing.
  • Loading branch information...
0 parents commit 6b7c3a40075df1f3d562d5d4b976843d365375a0 Marko Elezovic committed
8 .gitignore
@@ -0,0 +1,8 @@
+.cache
+.classpath
+.project
+.settings
+
+target
+
+sbt-launch-*.jar
26 LICENSE
@@ -0,0 +1,26 @@
+Copyright (c) 2012, Element d.o.o.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+3. Neither the name of the Element d.o.o. nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
1 README
@@ -0,0 +1 @@
+Return type overloading for Scala.
5 prepare-workspace.bat
@@ -0,0 +1,5 @@
+@echo off
+
+echo Performing dependency update for all projects ...
+echo Will also create Eclipse .project and .classpath files ...
+call "%~dp0\sbt.bat" --no-jrebel %* update eclipse
5 prepare-workspace.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+echo Performing dependency update for all projects ...
+echo Will also create Eclipse .project and .classpath files ...
+`dirname $0`/sbt.sh --no-jrebel "$@" update eclipse
98 project/ProxyKwaiBuild.scala
@@ -0,0 +1,98 @@
+import sbt._
+import Keys._
+
+// ===========================================================================
+
+object BuildSettings {
+ val defaultSettings =
+ Defaults.defaultSettings ++
+ Resolvers.settings ++
+ Publishing.settings ++ Seq(
+ organization := "hr.element.proxykwai",
+
+ crossScalaVersions := Seq("2.9.1", "2.9.0-1", "2.9.0"),
+ scalaVersion <<= (crossScalaVersions) { versions => versions.head },
+
+ scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "UTF-8", "-optimise"), // , "-Yrepl-sync"
+ javacOptions := Seq("-deprecation", "-encoding", "UTF-8", "-source", "1.5", "-target", "1.5"),
+
+ unmanagedSourceDirectories in Compile <<= (scalaSource in Compile)( _ :: Nil),
+ unmanagedSourceDirectories in Test <<= (scalaSource in Test )( _ :: Nil)
+ )
+
+
+ val bsProxyKwai =
+ defaultSettings ++ Seq(
+ name := "ProxyKwai",
+ version := "0.0.1-SNAPSHOT",
+
+ unmanagedSourceDirectories in Compile <<= (javaSource in Compile)( _ :: Nil),
+ autoScalaLibrary := false,
+ crossPaths := false
+ )
+}
+
+// ---------------------------------------------------------------------------
+
+object Dependencies {
+ val jasmin = "net.sf.jasmin" % "jasmin" % "2.4"
+
+ val scalaTest = "org.scalatest" %% "scalatest" % "1.6.1" % "test"
+
+ val depsProxyKwai =
+ libraryDependencies := Seq(
+ jasmin,
+ scalaTest
+ )
+}
+
+// ---------------------------------------------------------------------------
+
+object ProxyKwaiBuild extends Build {
+ import Dependencies._
+ import BuildSettings._
+
+ lazy val proxyKwai = Project(
+ "ProxyKwai",
+ file("proxykwai"),
+ settings = bsProxyKwai :+ depsProxyKwai
+ )
+}
+
+
+// ===========================================================================
+
+object Repositories {
+ val ElementNexus = "Element Nexus" at "http://maven.element.hr/nexus/content/groups/public/"
+ val ElementReleases = "Element Releases" at "http://maven.element.hr/nexus/content/repositories/releases/"
+ val ElementSnapshots = "Element Snapshots" at "http://maven.element.hr/nexus/content/repositories/snapshots/"
+}
+
+// ---------------------------------------------------------------------------
+
+object Resolvers {
+ import Repositories._
+
+ val settings = Seq(
+ resolvers := Seq(ElementNexus, ElementReleases, ElementSnapshots),
+ externalResolvers <<= resolvers map { rs =>
+ Resolver.withDefaultResolvers(rs, mavenCentral = false, scalaTools = false)
+ }
+ )
+}
+
+// ---------------------------------------------------------------------------
+
+object Publishing {
+ import Repositories._
+
+ val settings = Seq(
+ publishTo <<= (version) { version => Some(
+ if (version.endsWith("SNAPSHOT")) ElementSnapshots else ElementReleases
+ )},
+ credentials += Credentials(Path.userHome / ".publish" / "element.credentials"),
+ publishArtifact in (Compile, packageDoc) := false
+ )
+}
+
+// ===========================================================================
22 project/plugins.sbt
@@ -0,0 +1,22 @@
+// +------------------------------------------------------------------------------------+
+// | SBT Eclipse (https://github.com/typesafehub/sbteclipse) |
+// | Creates .project and .classpath files for easy Eclipse project imports |
+// | |
+// | See also: Eclipse downloads (http://www.eclipse.org/downloads/) |
+// | See also: Scala IDE downloads (http://download.scala-ide.org/) |
+// +------------------------------------------------------------------------------------+
+
+resolvers += Classpaths.typesafeResolver
+
+addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.0.0-M3")
+
+// +------------------------------------------------------------------------------------+
+// | SBT Scalariform (https://github.com/typesafehub/sbtscalariform) |
+// | Performs source code formatting |
+// | |
+// | See also: Scalariform reference (http://mdr.github.com/scalariform/) |
+// +------------------------------------------------------------------------------------+
+
+resolvers += Classpaths.typesafeResolver
+
+addSbtPlugin("com.typesafe.sbtscalariform" % "sbtscalariform" % "0.3.0")
BIN project/strap/gruj_vs_sbt-launch-0.11.2.jar
Binary file not shown.
4 proxykwai/continuous-compilation.bat
@@ -0,0 +1,4 @@
+@echo off
+
+echo Entering continuous compilation loop ...
+call "%~dp0\sbt.bat" --loop --no-jrebel %* ~compile
4 proxykwai/continuous-compilation.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+echo Entering continuous compilation loop ...
+`dirname $0`/sbt.sh --loop --no-jrebel "$@" ~compile
4 proxykwai/open-console.bat
@@ -0,0 +1,4 @@
+@echo off
+
+echo Firing up the Scala REPL ...
+call "%~dp0\sbt.bat" %* console
4 proxykwai/open-console.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+echo Firing up the Scala REPL ...
+`dirname $0`/sbt.sh "$@" console
4 proxykwai/publish.bat
@@ -0,0 +1,4 @@
+@echo off
+
+echo Publishing the project ...
+call "%~dp0\sbt.bat" --no-jrebel %* publish
4 proxykwai/publish.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+echo Publishing the project ...
+`dirname $0`/sbt.sh --no-jrebel "$@" publish
7 proxykwai/sbt.bat
@@ -0,0 +1,7 @@
+@echo off
+setlocal
+
+set PROJECT=ProxyKwai
+
+if %1.==. set DEFAULT=shell
+call "%~dp0..\sbt.bat" "project %PROJECT%" %DEFAULT% %*
5 proxykwai/sbt.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+PROJECT=ProxyKwai
+
+$PROJECT_DIR/../sbt.sh "project $PROJECT" "$@"
16 proxykwai/src/main/java/hr/element/proxykwai/ProxyCall.java
@@ -0,0 +1,16 @@
+package hr.element.proxykwai;
+
+class ProxyCall {
+ final String sourceClass;
+ final String sourceMethod;
+ final Class<?> returnType;
+
+ ProxyCall(
+ final String sourceClass,
+ final String sourceMethod,
+ final Class<?> returnType) {
+ this.sourceClass = sourceClass;
+ this.sourceMethod = sourceMethod;
+ this.returnType = returnType;
+ }
+}
231 proxykwai/src/main/java/hr/element/proxykwai/ProxyKwai.java
@@ -0,0 +1,231 @@
+package hr.element.proxykwai;
+
+import java.io.*;
+import java.util.*;
+
+import java.lang.reflect.Method;
+
+import jasmin.ClassFile;
+
+public class ProxyKwai {
+ final String targetClass;
+ final String targetMethod;
+ final Class<?>[] arguments;
+
+ public ProxyKwai(
+ final String targetClass,
+ final String targetMethod,
+ final Class<?>[] arguments) {
+ this(
+ targetClass,
+ targetMethod,
+ arguments.clone(),
+ new ProxyCall[0]
+ );
+ }
+
+ final ProxyCall[] calls;
+
+ ProxyKwai(
+ final String targetClass,
+ final String targetMethod,
+ final Class<?>[] arguments,
+ final ProxyCall[] calls) {
+ this.targetClass = targetClass;
+ this.targetMethod = targetMethod;
+ this.arguments = arguments;
+ this.calls = calls;
+ }
+
+ public ProxyKwai addObjectProxy(
+ final String sourceClass,
+ final String sourceMethod,
+ final Class<?> returnType) {
+ final ProxyCall call =
+ new ProxyCall(
+ sourceClass,
+ sourceMethod,
+ returnType
+ );
+
+ final ProxyCall[] newCalls =
+ Arrays.copyOf(calls, calls.length + 1);
+ newCalls[calls.length] = call;
+
+ return new ProxyKwai(
+ targetClass,
+ targetMethod,
+ arguments,
+ newCalls
+ );
+ }
+
+ public ProxyKwai addObjectProxy(
+ final Class<?> sourceClass,
+ final String sourceMethod,
+ final Class<?> returnType) {
+ return addObjectProxy(
+ sourceClass.getName(),
+ sourceMethod,
+ returnType
+ );
+ }
+
+ public ProxyKwai addObjectProxy(
+ final Method sourceMethod) {
+ return addObjectProxy(
+ sourceMethod.getDeclaringClass(),
+ sourceMethod.getName(),
+ sourceMethod.getReturnType()
+ );
+ }
+
+ static String slashify(final String name) {
+ return name.replace('.', '/');
+ }
+
+ private String toJasmin() {
+ final String argStr =
+ getClassSymbolList(arguments);
+
+ final Formatter formatter =
+ new Formatter()
+ .format(".class public %s\n", targetClass)
+ .format(".super java/lang/Object\n");
+
+ for (final ProxyCall call: calls) {
+ formatter
+ .format(
+ "\n.method public static %s(%s)%s\n",
+ targetMethod,
+ argStr,
+ getClassSymbol(call.returnType)
+ ).format(
+ " .limit locals %d\n",
+ arguments.length
+ ).format(
+ " .limit stack %d\n\n",
+ arguments.length + 1
+ ).format(
+ " getstatic %1$s/MODULE$ L%1$s;\n",
+ slashify(call.sourceClass)
+ ).format(
+ " aload_0\n"
+ ).format(
+ " invokevirtual %s/%s(%s)%s\n",
+ slashify(call.sourceClass),
+ call.sourceMethod,
+ argStr,
+ getClassSymbol(call.returnType)
+ ).format(
+ " %sreturn\n",
+ getReturnType(call.returnType)
+ ).format(
+ ".end method\n"
+ );
+ }
+
+ System.out.println(formatter);
+
+ return formatter.toString();
+ }
+
+ public void export(final String classPath) {
+ final String body = toJasmin();
+
+ try {
+ final byte[] bA = assemble(body);
+
+ final File outFile =
+ new File(
+ String.format(
+ "%s/%s.class",
+ classPath,
+ slashify(targetClass)
+ )
+ );
+
+ outFile.getParentFile().mkdirs();
+
+ final FileOutputStream fOS = new FileOutputStream(outFile);
+ fOS.write(bA);
+ fOS.close();
+ }
+ catch (final Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ static byte[] assemble(final String body) throws Exception {
+ final ClassFile classFile = new ClassFile();
+ final BufferedReader bR =
+ new BufferedReader(new StringReader(body));
+
+ classFile.readJasmin(bR, "ProxyKwai.j", false);
+ bR.close();
+
+ final ByteArrayOutputStream bAOS =
+ new ByteArrayOutputStream();
+
+ classFile.write(bAOS);
+ bAOS.close();
+
+ return bAOS.toByteArray();
+ }
+
+ private static String getClassSymbolList(final Class<?>[] clazzes) {
+ final StringBuilder sB = new StringBuilder();
+
+ for (final Class<?> clazz : clazzes) {
+ sB.append(getClassSymbol(clazz));
+ }
+
+ return sB.toString();
+ }
+
+ private static String getClassSymbol(final Class<?> clazz) {
+ final String name = clazz.getName().toString();
+ final char uc0 = Character.toUpperCase(name.charAt(0));
+
+ if (clazz.isPrimitive()) {
+ return String.valueOf(
+ ('B' == uc0 && 'o' == name.charAt(1)) ? 'Z' :
+ ('L' == uc0) ? 'J' :
+ uc0
+ );
+ }
+
+ final String slashName =
+ slashify(name);
+
+ return '[' == uc0
+ ? slashName
+ : String.format("L%s;", slashName);
+ }
+
+ private static String getReturnType(final Class<?> clazz) {
+ final String classSymbol = getClassSymbol(clazz);
+ if (classSymbol.length() > 1) {
+ return "a";
+ }
+
+ final char lc0 = Character.toLowerCase(classSymbol.charAt(0));
+ switch (lc0) {
+ case 'b':
+ case 'c':
+ case 's':
+ case 'z':
+ return "i";
+
+ case 'j':
+ return "l";
+
+ case 'v':
+ return "";
+
+ default:
+ return String.valueOf(lc0);
+ }
+ }
+}
85 proxykwai/src/test/scala/hr/element/proxykwai/test/ProxyKwaiSpec.scala
@@ -0,0 +1,85 @@
+package hr.element.proxykwai
+package test
+
+import org.scalatest._
+
+object ProxyKwaiFeatureSpec extends FeatureSpec {
+
+ object TestParserPrimitives {
+ def parseBoolean(s: String) = s.toBoolean
+ def parseByte(s: String) = s.toByte
+ def parseShort(s: String) = s.toShort
+ def parseChar(s: String) = s.head
+ def parseInt(s: String) = s.toInt
+ def parseFloat(s: String) = s.toFloat
+ def parseDouble(s: String) = s.toDouble
+ def parseLong(s: String) = s.toLong
+ def parseUnit(s: String) = ()
+ }
+
+ object TestParserJavaBoxes {
+ def parseBoolean(s: String) = java.lang.Boolean.valueOf(s)
+ def parseByte(s: String) = java.lang.Byte.valueOf(s)
+ def parseShort(s: String) = java.lang.Short.valueOf(s)
+ def parseCharacter(s: String) = java.lang.Character.valueOf(s.head)
+ def parseInteger(s: String) = java.lang.Integer.valueOf(s)
+ def parseFloat(s: String) = java.lang.Float.valueOf(s)
+ def parseDouble(s: String) = java.lang.Double.valueOf(s)
+ def parseLong(s: String) = java.lang.Long.valueOf(s)
+ def parseVoid(s: String) = null: java.lang.Void
+ }
+
+ object TestParserClasses {
+ def parseString(s: String) = s
+ def parseCharArray(s: String) = s.toCharArray
+ def parseIntArray(s: String) = s.toCharArray.map(_.getNumericValue)
+ def parseBigInt(s: String) = BigInt(s)
+ def parseRegex(s: String) = s.r
+ def parseOption(s: String) = Option(s)
+ def parseStringList(s: String) = s.split(",").toList
+ }
+
+ val testParserProxyCompiler =
+ new ProxyKwai(
+ "hr.element.proxykwai.test.TestParserProxy",
+ "parse",
+ Array[Class[_]](classOf[String]))
+
+ .addObjectProxy(TestParserPrimitives.getClass, "parseBoolean", classOf[Boolean])
+ .addObjectProxy(TestParserPrimitives.getClass, "parseByte", classOf[Byte])
+ .addObjectProxy(TestParserPrimitives.getClass, "parseShort", classOf[Short])
+ .addObjectProxy(TestParserPrimitives.getClass, "parseChar", classOf[Char])
+ .addObjectProxy(TestParserPrimitives.getClass, "parseInt", classOf[Int])
+ .addObjectProxy(TestParserPrimitives.getClass, "parseLong", classOf[Long])
+ .addObjectProxy(TestParserPrimitives.getClass, "parseFloat", classOf[Float])
+ .addObjectProxy(TestParserPrimitives.getClass, "parseDouble", classOf[Double])
+ .addObjectProxy(TestParserPrimitives.getClass, "parseUnit", classOf[Unit])
+
+ .addObjectProxy(TestParserJavaBoxes.getClass, "parseBoolean", classOf[java.lang.Boolean])
+ .addObjectProxy(TestParserJavaBoxes.getClass, "parseByte", classOf[java.lang.Byte])
+ .addObjectProxy(TestParserJavaBoxes.getClass, "parseShort", classOf[java.lang.Short])
+ .addObjectProxy(TestParserJavaBoxes.getClass, "parseCharacter", classOf[java.lang.Character])
+ .addObjectProxy(TestParserJavaBoxes.getClass, "parseInteger", classOf[java.lang.Integer])
+ .addObjectProxy(TestParserJavaBoxes.getClass, "parseLong", classOf[java.lang.Long])
+ .addObjectProxy(TestParserJavaBoxes.getClass, "parseFloat", classOf[java.lang.Float])
+ .addObjectProxy(TestParserJavaBoxes.getClass, "parseDouble", classOf[java.lang.Double])
+ .addObjectProxy(TestParserJavaBoxes.getClass, "parseVoid", classOf[java.lang.Void])
+
+ .addObjectProxy(TestParserClasses.getClass, "parseString", classOf[String])
+ .addObjectProxy(TestParserClasses.getClass, "parseCharArray", classOf[Array[Char]])
+ .addObjectProxy(TestParserClasses.getClass, "parseIntArray", classOf[Array[Int]])
+ .addObjectProxy(TestParserClasses.getClass, "parseBigInt", classOf[BigInt])
+ .addObjectProxy(TestParserClasses.getClass, "parseRegex", classOf[scala.util.matching.Regex])
+ .addObjectProxy(TestParserClasses.getClass, "parseOption", classOf[Option[String]])
+
+ feature("Overloading via return types on scala singletons") {
+
+ scenario("Multiple singleton objects") {
+ testParserProxyCompiler.export("target/classes")
+
+ info(TestParser.parse("1234567"): Array[Char])
+ info(TestParser.parse("1234567"): Array[Char])
+ info(TestParser.parse("1234567"): Array[Int])
+ }
+ }
+}
4 proxykwai/test-loop.bat
@@ -0,0 +1,4 @@
+@echo off
+
+echo Entering continuous test loop ...
+call "%~dp0\sbt.bat" --loop --no-jrebel %* ~test
4 proxykwai/test-loop.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+echo Entering continuous test loop ...
+`dirname $0`/sbt.sh --loop --no-jrebel "$@" ~test
75 sbt.bat
@@ -0,0 +1,75 @@
+@echo off
+setlocal
+pushd
+cd "%~dp0"
+
+set JVM_PARAMS=-Xss2m -Xmx712m -XX:MaxPermSize=256m -XX:+CMSClassUnloadingEnabled
+
+set LIFT_RUN_MODE=-Drun.mode=development
+set TRY_JREBEL=true
+set LOG_LEVEL=
+set NO_PAUSE=false
+set DO_LOOP=false
+
+:PARSER_LOOP
+if "%~1"=="" goto :PARSER_END
+
+if "%~1"=="--prod" (
+ set LIFT_RUN_MODE=-Drun.mode=production
+ goto :PARSER_CONTINUE
+)
+
+if "%~1"=="--debug" (
+ set LOG_LEVEL="set logLevel:=Level.Debug"
+ goto :PARSER_CONTINUE
+)
+
+if "%~1"=="~lift" (
+ set SBT_PARAMS=%SBT_PARAMS% container:start ~compile container:stop
+ set JREBEL_PLUGINS=%JREBEL_PLUGINS% -Drebel.lift_plugin=true
+ goto :PARSER_CONTINUE
+)
+
+if "%~1"=="--no-jrebel" (
+ set TRY_JREBEL=false
+ goto :PARSER_CONTINUE
+)
+
+if "%~1"=="--loop" (
+ set DO_LOOP=true
+ goto :PARSER_CONTINUE
+)
+
+if "%~1"=="--no-pause" (
+ set NO_PAUSE=true
+ goto :PARSER_CONTINUE
+)
+
+set SBT_PARAMS=%SBT_PARAMS% %1
+
+:PARSER_CONTINUE
+shift
+goto :PARSER_LOOP
+:PARSER_END
+
+set JVM_PARAMS=%JVM_PARAMS% %LIFT_RUN_MODE%
+if %TRY_JREBEL%.==true. (
+ if exist "%JREBEL_HOME%\jrebel.jar" set JVM_PARAMS=%JVM_PARAMS% -noverify -javaagent:"%JREBEL_HOME%\jrebel.jar" %JREBEL_PLUGINS%
+)
+
+set GRUJ_PATH=project\strap\gruj_vs_sbt-launch-0.11.2.jar
+set RUN_CMD=java %JVM_PARAMS% -jar %GRUJ_PATH% %LOG_LEVEL% %SBT_PARAMS%
+
+:RUN_LOOP
+%RUN_CMD%
+
+if %DO_LOOP%.==true. (
+ if %NO_PAUSE%.==false. (
+ echo Press Enter to continue or Press CTRL+C to exit!
+ pause
+ )
+ goto :RUN_LOOP
+)
+
+popd
+endlocal
70 sbt.sh
@@ -0,0 +1,70 @@
+#!/bin/bash
+cd `dirname $0`
+
+## START JVM PARAMS
+JVM_PARAMS="-Xss2m -Xmx712m -XX:MaxPermSize=256m -XX:+CMSClassUnloadingEnabled"
+
+LIFT_RUN_MODE="-Drun.mode=development"
+TRY_JREBEL=true
+LOG_LEVEL=
+NO_PAUSE=false
+DO_LOOP=false
+
+while [ -n "$*" ]
+do
+ case "$1" in
+ "--debug")
+ echo "Setting debug mode"
+ LOG_LEVEL="\"set logLevel:=Level.Debug\""
+ ;;
+ "--prod")
+ echo "Set Lift mode to Production"
+ LIFT_RUN_MODE="-Drun.mode=production"
+ ;;
+ "~lift")
+ echo "Firing up Jetty ..."
+ SBT_PARAMS="$SBT_PARAMS container:start ~compile container:stop"
+ JREBEL_PLUGINS="$JREBEL_PLUGINS -Drebel.lift_plugin=true"
+ ;;
+ "--no-jrebel")
+ echo "Disabling JRebel for faster compilation"
+ TRY_JREBEL=false
+ ;;
+ "--loop")
+ echo "Will run SBT in loop mode"
+ DO_LOOP=true
+ ;;
+ "--no-pause")
+ echo "Will not pause in loop mode"
+ NO_PAUSE=true
+ ;;
+ *)
+ SBT_PARAMS="$SBT_PARAMS \"$1\""
+ ;;
+ esac
+ shift
+
+done
+
+JVM_PARAMS="$JVM_PARAMS $LIFT_RUN_MODE"
+if $TRY_JREBEL && [ -n "$JREBEL_HOME" ] && [ -f $JREBEL_HOME/jrebel.jar ]; then
+ JVM_PARAMS="$JVM_PARAMS -noverify -javaagent:$JREBEL_HOME/jrebel.jar $JREBEL_PLUGINS"
+fi
+
+GRUJ_PATH="project/strap/gruj_vs_sbt-launch-0.11.2.jar"
+RUN_CMD="java $JVM_PARAMS -jar $GRUJ_PATH $LOG_LEVEL $SBT_PARAMS"
+
+LOOPING=true
+while $LOOPING
+do
+ eval "$RUN_CMD"
+
+ if ! $DO_LOOP ; then
+ LOOPING=false
+ else
+ if ! $NO_PAUSE ; then
+ echo "Press Enter to continue or Press CTRL+C to exit!"
+ read
+ fi
+ fi
+done

0 comments on commit 6b7c3a4

Please sign in to comment.
Something went wrong with that request. Please try again.