Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 3 commits
  • 17 files changed
  • 0 commit comments
  • 2 contributors
View
75 build.sbt
@@ -2,16 +2,65 @@ organization := "hr.element.doit"
name := "doit-csv"
-version := "0.1.6-T1"
+version := "0.1.7"
// ### Build settings ###
-libraryDependencies += "org.scalatest" %% "scalatest" % "1.8" % "test"
+libraryDependencies += "org.scalatest" %% "scalatest" % "2.0.M5b" % "test"
-crossScalaVersions := Seq("2.9.2", "2.9.1-1", "2.9.1", "2.9.0-1", "2.9.0")
+crossScalaVersions := Seq("2.10.1-RC2", "2.9.3", "2.9.2", "2.9.1-1", "2.9.1", "2.9.0-1", "2.9.0")
scalaVersion <<= crossScalaVersions(_.head)
+scalacOptions <<= scalaVersion map { sV =>
+ val scala2_8 = Seq(
+ "-unchecked"
+ , "-deprecation"
+ , "-optimise"
+ , "-encoding", "UTF-8"
+ , "-Xcheckinit"
+ , "-Xfatal-warnings"
+ , "-Yclosure-elim"
+ , "-Ydead-code"
+ , "-Yinline"
+ )
+ //
+ val scala2_9 = Seq(
+ "-Xmax-classfile-name", "72"
+ )
+ //
+ val scala2_9_1 = Seq(
+ "-Yrepl-sync"
+ , "-Xlint"
+ , "-Xverify"
+ , "-Ywarn-all"
+ )
+ //
+ val scala2_10 = Seq(
+ "-feature"
+ , "-language:postfixOps"
+ , "-language:implicitConversions"
+ , "-language:existentials"
+ )
+ //
+ scala2_8 ++ (sV match {
+ case x if (x startsWith "2.10.") => scala2_9 ++ scala2_9_1 ++ scala2_10
+ case x if (x startsWith "2.9.") && x >= "2.9.1" => scala2_9 ++ scala2_9_1
+ case x if (x startsWith "2.9.") => scala2_9
+ case _ => Nil
+ })
+}
+
+javaHome := sys.env.get("JDK16_HOME").map(file(_))
+
+javacOptions := Seq(
+ "-deprecation"
+, "-encoding", "UTF-8"
+, "-Xlint:unchecked"
+, "-source", "1.6"
+, "-target", "1.6"
+)
+
scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "UTF-8", "-optimise")
unmanagedSourceDirectories in Compile <<= (scalaSource in Compile)(_ :: Nil)
@@ -20,13 +69,27 @@ unmanagedSourceDirectories in Test <<= (scalaSource in Test )(_ :: Nil)
// ### Publishing ###
-publishTo := Some("Element Releases" at "http://maven.element.hr/nexus/content/repositories/releases/")
+resolvers := Seq("Element Nexus" at "http://repo.element.hr/nexus/content/groups/public/")
-credentials += Credentials(Path.userHome / ".publish" / "element.credentials")
+externalResolvers <<= resolvers map { r =>
+ Resolver.withDefaultResolvers(r, mavenCentral = false)
+}
-publishArtifact in (Compile, packageDoc) := false
+publishTo <<= version { version => Some(
+ if (version endsWith "SNAPSHOT")
+ "Element Snapshots" at "http://repo.element.hr/nexus/content/repositories/snapshots/"
+ else
+ "Element Releases" at "http://repo.element.hr/nexus/content/repositories/releases/"
+)}
+
+credentials += Credentials(Path.userHome / ".config" / "doit-csv" / "nexus.config")
+publishArtifact in (Compile, packageDoc) := false
// ### Misc ###
initialCommands := "import hr.element.doit.csv._"
+
+seq(graphSettings: _*)
+
+seq(eclipseSettings: _*)
View
4 continuous-compilation.bat
@@ -0,0 +1,4 @@
+@echo off
+
+echo Entering continuous compilation loop ...
+call "%~dp0sbt.bat" --loop --no-jrebel %* ~compile
View
4 continuous-compilation.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+echo Entering continuous compilation loop ...
+`dirname $0`/sbt.sh --loop --no-jrebel "$@" ~compile
View
2 cross-publish.bat
@@ -1,4 +1,4 @@
@echo off
echo Will cross-publish project to the maven server
-call "%~dp0sbt.bat" %* +publish
+call "%~dp0sbt.bat" %* clean +compile +publish
View
2 cross-publish.sh
@@ -1,4 +1,4 @@
#!/bin/bash
echo Will cross-publish project to the maven server
-`dirname $0`/sbt.sh --no-jrebel "$@" clean +publish
+`dirname $0`/sbt.sh --no-jrebel "$@" clean +compile +publish
View
4 open-console.bat
@@ -0,0 +1,4 @@
+@echo off
+
+echo Firing up the Scala REPL ...
+call "%~dp0sbt.bat" %* console
View
4 open-console.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+echo Firing up the Scala REPL ...
+`dirname $0`/sbt.sh "$@" console
View
2 prepare-workspace.bat
@@ -2,4 +2,4 @@
echo Performing dependency update for all projects ...
echo Will also create Eclipse .project and .classpath files ...
-call "%~dp0\sbt.bat" --no-jrebel %* update eclipse
+call "%~dp0sbt.bat" --no-jrebel %* update eclipse
View
1 project/build.properties
@@ -0,0 +1 @@
+sbt.version=0.12.2
View
31 project/plugins.sbt
@@ -1,11 +1,26 @@
+resolvers := Seq(
+ "Element Nexus" at "http://repo.element.hr/nexus/content/groups/public/"
+, Resolver.url("Element Nexus (Ivy)",
+ url("http://repo.element.hr/nexus/content/groups/public/"))(Resolver.ivyStylePatterns)
+)
+
+externalResolvers <<= resolvers map { r =>
+ Resolver.withDefaultResolvers(r, mavenCentral = false)
+}
+
+// +------------------------------------------------------------------------------------+
+// | 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/) |
+// +------------------------------------------------------------------------------------+
+
+addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.1")
+
// +-------------------------------------------------------------------------------------+
-// | 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/) |
+// | Dependency graph SBT plugin (https://github.com/jrudolph/sbt-dependency-graph) |
+// | Lists all library dependencies in a nicely formatted way for easy inspection. |
// +-------------------------------------------------------------------------------------+
-resolvers += Classpaths.typesafeResolver
-
-addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.0-RC1")
+addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.7.0")
View
BIN project/strap/gruj_vs_sbt-launch-0.11.3.jar
Binary file not shown.
View
BIN project/strap/gruj_vs_sbt-launch-0.12.2.jar
Binary file not shown.
View
27 project/strap/sbt.boot.properties
@@ -0,0 +1,27 @@
+[scala]
+ version: ${sbt.scala.version-auto}
+
+[app]
+ org: ${sbt.organization-org.scala-sbt}
+ name: sbt
+ version: ${sbt.version-read(sbt.version)[0.12.2]}
+ class: ${sbt.main.class-sbt.xMain}
+ components: xsbti,extra
+ cross-versioned: ${sbt.cross.versioned-false}
+
+[repositories]
+ local
+ element-repo-maven: http://repo.element.hr/nexus/content/groups/public/
+ element-repo-ivy: http://repo.element.hr/nexus/content/groups/public/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext]
+
+[boot]
+ directory: ../../.sbt/doit-csv
+
+[ivy]
+ ivy-home: ../../.ivy2/doit-csv
+ checksums: ${sbt.checksums-sha1,md5}
+ override-build-repos: ${sbt.override.build.repos-false}
+ repository-config: ${sbt.repository.config-${sbt.global.base-${user.home}/.sbt}/repositories}
+
+[log]
+ level: info
View
4 sbt.bat
@@ -3,7 +3,7 @@ setlocal
pushd
cd "%~dp0"
-set JVM_PARAMS=-Xss2m -Xmx1g -XX:MaxPermSize=256m -XX:+CMSClassUnloadingEnabled
+set JVM_PARAMS=-Xss2m -Xmx712m -XX:MaxPermSize=256m -XX:+CMSClassUnloadingEnabled
set LIFT_RUN_MODE=-Drun.mode=development
set TRY_JREBEL=true
@@ -57,7 +57,7 @@ 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.3.jar
+set GRUJ_PATH=project\strap\gruj_vs_sbt-launch-0.12.2.jar
set RUN_CMD=java %JVM_PARAMS% -jar %GRUJ_PATH% %LOG_LEVEL% %SBT_PARAMS%
:RUN_LOOP
View
4 sbt.sh
@@ -2,7 +2,7 @@
cd `dirname $0`
## START JVM PARAMS
-JVM_PARAMS="-Xss2m -Xmx1g -XX:MaxPermSize=256m -XX:+CMSClassUnloadingEnabled"
+JVM_PARAMS="-Xss2m -Xmx712m -XX:MaxPermSize=256m -XX:+CMSClassUnloadingEnabled"
LIFT_RUN_MODE="-Drun.mode=development"
TRY_JREBEL=true
@@ -51,7 +51,7 @@ 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.3.jar"
+GRUJ_PATH="project/strap/gruj_vs_sbt-launch-0.12.2.jar"
RUN_CMD="java $JVM_PARAMS -jar $GRUJ_PATH $LOG_LEVEL $SBT_PARAMS"
LOOPING=true
View
1 src/main/scala/hr/element/doit/csv/CSVWriter.scala
@@ -43,6 +43,5 @@ class CSVWriter(val config: CSVConfig, writer: Writer) {
writer.write(config.newLine)
writer.flush()
}
- this
}
}
View
11 src/main/scala/hr/element/doit/csv/LineReader.scala
@@ -109,25 +109,26 @@ class LineReader(config: CSVConfig, reader: Reader) extends IndexedSeq[String] {
case (EndMode) => "End Mode"
case _ => "Stupid mode"
}
-
}
def loop(
mode: SmrMode,
curr: StringBuilder = new StringBuilder("")) {
val read = reader.read()
-//println( "loop: " + curr + " " + stringMode(mode)+" read :"+read.toChar+"| uc"+read+"|")
+
+ // println( "loop: " + curr + " " + stringMode(mode)+" read :"+read.toChar+"| uc"+read+"|")
+
if (read == -1) { // End Of File
if (mode == QuotedMode) sys.error("Malformated CSV, unexpected eof!")
else if (curr.nonEmpty)
res += (curr appendAll sliM.flush()).result()
else if (mode == NewWordMode)
res += ""
- else
- res
} else {
val returnResult = sliM.consume(read.toChar, mode)
- //println(returnResult.getClass())
+
+ // println(returnResult.getClass())
+
if (mode(returnResult) == Unexpected)
sys.error("Malformated CSV! " + stringMode(mode) + " with " + returnResult.getClass())
else {

No commit comments for this range

Something went wrong with that request. Please try again.