Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added compilation options, bumped version to 0.1.7

  • Loading branch information...
commit 8c1159c0aced114c33eee4bee5159406875e5a9f 1 parent 922e769
@melezov authored
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_2.9.2" % "1.8" % "test"
+libraryDependencies += "org.scalatest" %% "scalatest" % "2.0.M5b" % "test"
-crossScalaVersions := Seq("2.10.1-RC2", "2.10.1-RC1", "2.10.0", "2.9.3", "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://repo.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
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
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 {
Please sign in to comment.
Something went wrong with that request. Please try again.