Skip to content

Commit

Permalink
Merge pull request #611 from 3tty0n/bump-to-2.12
Browse files Browse the repository at this point in the history
Bump up Scala to 2.12 and sbt to 0.13.13
  • Loading branch information
dlwh committed Dec 28, 2016
2 parents 46b75d5 + f62dc65 commit 323f1c6
Show file tree
Hide file tree
Showing 10 changed files with 106 additions and 93 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
language: scala
scala:
- 2.10.3
- 2.10.6
- 2.11.8
- 2.12.1
jdk:
- oraclejdk7
- oraclejdk8
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq libatlas3gf-base libopenblas-base
Expand Down
22 changes: 11 additions & 11 deletions benchmark/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ name := "breeze-benchmark"
addCompilerPlugin("org.scalamacros" %% "paradise" % "2.1.0" cross CrossVersion.full)

libraryDependencies ++= Seq(
"org.apfloat" % "apfloat" % "1.6.3",
"org.jscience" % "jscience" % "4.3.1",
"org.apache.commons" % "commons-math3" % "3.2",
// thyme
"ichi.bench" % "thyme" % "0.1.0" from "http://plastic-idolatry.com/jars/thyme-0.1.0.jar",
// caliper stuff
"com.google.guava" % "guava" % "r09",
"com.google.code.java-allocation-instrumenter" % "java-allocation-instrumenter" % "2.0",
"com.google.code.caliper" % "caliper" % "1.0-SNAPSHOT" from "http://plastic-idolatry.com/jars/caliper-1.0-SNAPSHOT.jar",
"com.google.code.gson" % "gson" % "1.7.1"
)
"org.apfloat" % "apfloat" % "1.6.3",
"org.jscience" % "jscience" % "4.3.1",
"org.apache.commons" % "commons-math3" % "3.2",
// thyme
"ichi.bench" % "thyme" % "0.1.0" from "http://plastic-idolatry.com/jars/thyme-0.1.0.jar",
// caliper stuff
"com.google.guava" % "guava" % "r09",
"com.google.code.java-allocation-instrumenter" % "java-allocation-instrumenter" % "2.0",
"com.google.code.caliper" % "caliper" % "1.0-SNAPSHOT" from "http://plastic-idolatry.com/jars/caliper-1.0-SNAPSHOT.jar",
"com.google.code.gson" % "gson" % "1.7.1"
)

fork := true

Expand Down
10 changes: 5 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ Common.commonSettings

name := "breeze-parent"

lazy val root = project.in( file(".") )
.aggregate(math, natives, viz, macros).dependsOn(math, viz)
lazy val root = project.in(file("."))
.aggregate(math, natives, viz, macros).dependsOn(math, viz)

lazy val macros = project.in( file("macros"))
lazy val macros = project.in(file("macros"))

lazy val math = project.in( file("math")).dependsOn(macros)
lazy val math = project.in(file("math")).dependsOn(macros)

lazy val natives = project.in(file("natives")).dependsOn(math)

lazy val viz = project.in( file("viz")).dependsOn(math)
lazy val viz = project.in(file("viz")).dependsOn(math)

lazy val benchmark = project.in(file("benchmark")).dependsOn(math, natives)
addCompilerPlugin("org.scalamacros" %% "paradise" % "2.1.0" cross CrossVersion.full)
Expand Down
8 changes: 4 additions & 4 deletions macros/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ Common.commonSettings

name := "breeze-macros"



libraryDependencies <<= (scalaVersion, libraryDependencies) { (sv, deps) =>
libraryDependencies := {
val sv = scalaVersion.value
val deps = libraryDependencies.value
sv match {
case x if x.startsWith("2.10") =>
deps :+ ("org.scalamacros" %% "quasiquotes" % "2.1.0")
case _ => deps
}
}

libraryDependencies <+= (scalaVersion)("org.scala-lang" % "scala-reflect" % _)
libraryDependencies += "org.scala-lang" % "scala-reflect" % s"${scalaVersion.value}"

addCompilerPlugin("org.scalamacros" %% "paradise" % "2.1.0" cross CrossVersion.full)

39 changes: 27 additions & 12 deletions math/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ Common.commonSettings

addCompilerPlugin("org.scalamacros" %% "paradise" % "2.1.0" cross CrossVersion.full)


libraryDependencies ++= Seq(
"com.github.fommil.netlib" % "core" % "1.1.2",
"net.sourceforge.f2j" % "arpack_combined_all" % "0.1",
"net.sf.opencsv" % "opencsv" % "2.3",
"com.github.rwl" % "jtransforms" % "2.4.0",
"org.apache.commons" % "commons-math3" % "3.2",
"org.spire-math" %% "spire" % "0.12.0",
"org.spire-math" %% "spire" % "0.13.0",
"com.chuusai" %% "shapeless" % "2.3.2",
"org.slf4j" % "slf4j-api" % "1.7.5",
"org.scala-lang.modules" % "scala-xml_2.11" % "1.0.1" % "test",
"org.apache.logging.log4j" % "log4j-slf4j-impl" % "2.0-beta9" % "test",
"org.apache.logging.log4j" % "log4j-core" % "2.0-beta9" % "test",
"org.apache.logging.log4j" % "log4j-api" % "2.0-beta9" % "test"
)

libraryDependencies <<= (scalaVersion, libraryDependencies) { (sv, deps) =>
libraryDependencies := {
val sv = scalaVersion.value
val deps = libraryDependencies.value
sv match {
case x if x startsWith "2.10" =>
deps :+ compilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)
Expand All @@ -29,16 +29,31 @@ libraryDependencies <<= (scalaVersion, libraryDependencies) { (sv, deps) =>
}
}

libraryDependencies := {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, scalaMajor)) if scalaMajor >= 12 =>
libraryDependencies.value ++ Seq(
"org.scala-lang.modules" %% "scala-xml" % "1.0.6" % "test"
)
case Some((2, scalaMajor)) if scalaMajor >= 11 =>
libraryDependencies.value ++ Seq(
"org.scala-lang.modules" %% "scala-xml" % "1.0.6" % "test"
)
case _ =>
libraryDependencies.value ++ Seq()
}
}

// see https://github.com/typesafehub/scalalogging/issues/23
testOptions in Test += Tests.Setup(classLoader =>
try {
classLoader
.loadClass("org.slf4j.LoggerFactory")
.getMethod("getLogger", classLoader.loadClass("java.lang.String"))
.invoke(null, "ROOT")
} catch {
case e: Exception =>
}
try {
classLoader
.loadClass("org.slf4j.LoggerFactory")
.getMethod("getLogger", classLoader.loadClass("java.lang.String"))
.invoke(null, "ROOT")
} catch {
case _: Exception =>
}
)

//fork in Test := true
Expand Down
2 changes: 1 addition & 1 deletion natives/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ addCompilerPlugin("org.scalamacros" %% "paradise" % "2.1.0" cross CrossVersion.f

libraryDependencies ++= Seq(
"com.github.fommil.netlib" % "all" % "1.1.2" pomOnly()
)
)

// see https://github.com/typesafehub/scalalogging/issues/23
testOptions in Test += Tests.Setup(classLoader =>
Expand Down
57 changes: 29 additions & 28 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ import sbt.Keys._
import sbt._

object Common {
val crossScalaVersions = Seq("2.11.8", /*"2.12.0-RC1",*/ "2.10.6")
val crossScalaVersions = Seq("2.12.1", "2.11.8", "2.10.6")
val scalaVersion = crossScalaVersions.head

val commonSettings = Seq (
val commonSettings = Seq(
organization := "org.scalanlp",
Keys.scalaVersion := Common.scalaVersion,
Keys.crossScalaVersions := Common.crossScalaVersions,
Keys.crossScalaVersions := Common.crossScalaVersions,

scalacOptions ++= Seq("-deprecation","-language:_"),
scalacOptions ++= Seq("-deprecation", "-language:_"),

javacOptions ++= Seq("-target", "1.7", "-source","1.7"),
javacOptions ++= Seq("-target", "1.7", "-source", "1.7"),

credentials += Credentials(Path.userHome / ".ivy2" / ".credentials"),

libraryDependencies ++= Seq(
"junit" % "junit" % "4.12" % "test",
"org.scalacheck" %% "scalacheck" % "1.13.2" % "test",
"org.scalatest" %% "scalatest" % "3.0.0" % "test"
"org.scalacheck" %% "scalacheck" % "1.13.4" % "test",
"org.scalatest" %% "scalatest" % "3.0.1" % "test"
),

resolvers ++= Seq(
Expand All @@ -32,34 +32,35 @@ object Common {
testOptions in Test += Tests.Argument("-oDF"),

pomExtra :=
<url>http://scalanlp.org/</url>
<licenses>
<license>
<name>Apache 2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>git@github.com:scalanlp/breeze.git</url>
<connection>scm:git:git@github.com:scalanlp/breeze.git</connection>
</scm>
<developers>
<developer>
<id>dlwh</id>
<name>David Hall</name>
<url>http://www.dlwh.org/</url>
</developer>
</developers>,
<url>http://scalanlp.org/</url>
<licenses>
<license>
<name>Apache 2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>git@github.com:scalanlp/breeze.git</url>
<connection>scm:git:git@github.com:scalanlp/breeze.git</connection>
</scm>
<developers>
<developer>
<id>dlwh</id>
<name>David Hall</name>
<url>http://www.dlwh.org/</url>
</developer>
</developers>,
publishMavenStyle := true,

publishTo <<= isSnapshot { (yes: Boolean) =>
publishTo := {
val yes = isSnapshot.value
val nexus = "https://oss.sonatype.org/"
assert(yes)
if (yes)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},

publishArtifact in Test := false,
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.11
sbt.version=0.13.13
12 changes: 5 additions & 7 deletions version.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ git.gitUncommittedChanges := git.gitCurrentTags.value.isEmpty

val VersionRegex = "v([0-9]+.[0-9]+.[0-9]+)-?(.*)?".r

git.gitTagToVersionNumber := { v: String =>
v match {
case VersionRegex(v,"") => Some(v)
case VersionRegex(v,"SNAPSHOT") => Some(s"$v-SNAPSHOT")
case VersionRegex(v,s) => Some(s"$v-$s-SNAPSHOT")
case _ => None
}
git.gitTagToVersionNumber := {
case VersionRegex(v, "") => Some(v)
case VersionRegex(v, "SNAPSHOT") => Some(s"$v-SNAPSHOT")
case VersionRegex(v, s) => Some(s"$v-$s-SNAPSHOT")
case _ => None
}
41 changes: 19 additions & 22 deletions viz/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@ resolvers ++= Seq(
)

libraryDependencies ++= Seq(
"jfree" % "jcommon" % "1.0.16",
"jfree" % "jfreechart" % "1.0.13",
"org.apache.xmlgraphics" % "xmlgraphics-commons" % "1.3.1", // for eps gen
// "org.apache.xmlgraphics" % "batik-dom" % "1.7", // for svg gen
// "org.apache.xmlgraphics" % "batik-svggen" % "1.7", // for svg gen
"com.lowagie" % "itext" % "2.1.5" intransitive() // for pdf gen
"jfree" % "jcommon" % "1.0.16",
"jfree" % "jfreechart" % "1.0.13",
"org.apache.xmlgraphics" % "xmlgraphics-commons" % "1.3.1", // for eps gen
// "org.apache.xmlgraphics" % "batik-dom" % "1.7", // for svg gen
// "org.apache.xmlgraphics" % "batik-svggen" % "1.7", // for svg gen
"com.lowagie" % "itext" % "2.1.5" intransitive() // for pdf gen
)

scalaVersion := Common.scalaVersion

crossScalaVersions := Common.crossScalaVersions
crossScalaVersions := Common.crossScalaVersions

libraryDependencies <+= (scalaVersion)("org.scala-lang" % "scala-reflect" % _)
libraryDependencies += "org.scala-lang" % "scala-reflect" % s"${scalaVersion.value}"

credentials += Credentials(Path.userHome / ".ivy2" / ".credentials")

scalacOptions ++= Seq("-deprecation", "-language:_", "-optimize")

javaOptions += "-Xmx2g"

pomExtra := (
<url>http://scalanlp.org/</url>
pomExtra :=
<url>http://scalanlp.org/</url>
<licenses>
<license>
<name>Apache 2</name>
Expand All @@ -47,20 +47,17 @@ pomExtra := (
<name>David Hall</name>
<url>http://cs.berkeley.edu/~dlwh/</url>
</developer>
</developers>)
</developers>



pomIncludeRepository := { _ => false }
pomIncludeRepository := { _ => false }

publishMavenStyle := true


publishTo <<= version { (v: String) =>
val nexus = "https://oss.sonatype.org/"
if (v.trim.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (version.value.trim.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}

0 comments on commit 323f1c6

Please sign in to comment.