Skip to content

Commit

Permalink
Merged in revert-pr-180 (pull request #182)
Browse files Browse the repository at this point in the history
Revert "Modernised build.sbt so that ArithExpr is expressed as an actual dependency (pull request #180)"

Approved-by: Michel Steuwer <michel.steuwer@glasgow.ac.uk>
Approved-by: Federico Pizzuti <pizzutifederico27@gmail.com>
  • Loading branch information
b-hagedorn committed May 28, 2018
2 parents 4733791 + 0e6a7be commit bfb55f0
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 84 deletions.
129 changes: 80 additions & 49 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,55 +1,25 @@
name := "Lift"

lazy val root = (project in file("."))
.settings(
name := "lift",
organization := "org.lift-project",
version := "1.0",
scalaVersion := "2.11.8",

// Check Java version
initialize := {
val _ = initialize.value // run the previous initialization
val minVersion = 8
val current = sys.props("java.specification.version")
val regex = raw"1\.(\d+)".r
assert(current match {
case regex(v) if v.toInt >= minVersion => true
case _ => false
}, s"Unsupported JDK: java.specification.version $current. Require at least JDK version 1.$minVersion.")
},

// when compile also update submodules and compile the executor
compile := ((compile in Compile) dependsOn (updateSubmodules, compileExecutor)).value,
// Executor path
javaOptions += "-Djava.library.path=" + baseDirectory(_ / "src/main/resources/lib/").value,

scalacOptions ++= Seq("-Xmax-classfile-name", "100", "-unchecked", "-deprecation", "-feature"),
scalacOptions in (Compile, doc) := Seq("-implicits", "-diagrams"),

// Source locations (defaults would be: src/main/scala and test/main/java)
scalaSource in Compile := baseDirectory(_ / "src/main").value,
scalaSource in Test := baseDirectory(_ / "src/test").value,
javaSource in Compile := baseDirectory(_ / "src/main").value,
javaSource in Test := baseDirectory(_ / "src/test").value,

// dependencies specified in project/Dependencies.scala
libraryDependencies ++= Dependencies.libraryDependencies,

testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "-v", "-a"),

ScoverageSbtPlugin.ScoverageKeys.coverageExcludedPackages := "<empty>;benchmarks.*;.*Test.*;junit.*;.*interop.*;.*arithmetic.*;.*testing.*",

fork := true
)
.dependsOn(
RootProject(file("lib/ArithExpr")),
RootProject(file("lib/Profiler")))

// implicit dependency on the compiler plugin due to macros in profiler
val paradiseVersion = "2.1.0"
addCompilerPlugin("org.scalamacros" % "paradise" % paradiseVersion cross CrossVersion.full)
version := "1.0"

scalaVersion := "2.11.8"

// Check Java version
initialize := {
val _ = initialize.value // run the previous initialization
val minVersion = 8
val current = sys.props("java.specification.version")
val regex = raw"1\.(\d+)".r
assert(current match {
case regex(v) if v.toInt >= minVersion => true
case _ => false
}, s"Unsupported JDK: java.specification.version $current. Require at least JDK version 1.$minVersion.")
}

compile <<= (compile in Compile) dependsOn (updateSubmodules, compileExecutor)

lazy val updateSubmodules = taskKey[Unit]("Update the submodules")

updateSubmodules := {
import scala.language.postfixOps
import scala.sys.process._
Expand All @@ -58,10 +28,71 @@ updateSubmodules := {
}

lazy val compileExecutor = taskKey[Unit]("Builds the Executor.")

compileExecutor := {
import scala.language.postfixOps
import scala.sys.process._
//noinspection PostfixMethodCall
"echo y" #| "./buildExecutor.sh" !
}

scalacOptions ++= Seq("-Xmax-classfile-name", "100", "-unchecked", "-deprecation", "-feature")

// Executor path
javaOptions += "-Djava.library.path=" + baseDirectory(_ / "src/main/resources/lib/").value

// Main sources
scalaSource in Compile <<= baseDirectory(_ / "src/main")
javaSource in Compile <<= baseDirectory(_ / "src/main")

// Test sources
scalaSource in Test <<= baseDirectory(_ / "src/test")
javaSource in Test <<= baseDirectory(_ / "src/test")

// Scala libraries
libraryDependencies += "org.scala-lang" % "scala-reflect" % "2.11.8"
libraryDependencies += "org.scala-lang" % "scala-compiler" % "2.11.8"
libraryDependencies += "org.scala-lang" % "scala-library" % "2.11.8"
libraryDependencies += "com.typesafe.play" %% "play-json" % "2.3.10"

libraryDependencies += "org.scala-lang.modules" % "scala-xml_2.11" % "1.0.4"

libraryDependencies += "jline" % "jline" % "2.12.1"

// JUnit
libraryDependencies += "junit" % "junit" % "4.11"
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test"

// ScalaCheck
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.13.0" % "test"

// TODO: Pick one for argument parsing
libraryDependencies += "commons-cli" % "commons-cli" % "1.3.1"
libraryDependencies += "org.clapper" %% "argot" % "1.0.3"

// Logging
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.1.7"
libraryDependencies += "com.typesafe.scala-logging" %% "scala-logging" % "3.4.0"

// Time utilities
libraryDependencies += "com.github.nscala-time" %% "nscala-time" % "2.16.0"

lazy val profiler = RootProject(file("lib/Profiler"))

lazy val root = (project in file(".")).aggregate(profiler).dependsOn(profiler)

val paradiseVersion = "2.1.0"

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


scalacOptions in (Compile,doc) := Seq("-implicits", "-diagrams")

// Build ArithExpr
unmanagedSourceDirectories in Compile += baseDirectory.value / "lib/ArithExpr/src/main/"

ScoverageSbtPlugin.ScoverageKeys.coverageExcludedPackages := "<empty>;benchmarks.*;.*Test.*;junit.*;.*interop.*;.*arithmetic.*;.*testing.*"

testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "-v", "-a")

fork := true
2 changes: 1 addition & 1 deletion lib/ArithExpr
17 changes: 9 additions & 8 deletions lib/Profiler/build.sbt
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
lazy val root = (project in file("."))
.settings(
name := "Profiler",
organization := "org.lift-project",
version := "1.0",
scalaVersion := "2.11.8",
name := "Profiler"

libraryDependencies += "org.scala-lang" % "scala-compiler" % "2.11.8"
)
version := "1.0"

scalaVersion := "2.11.8"

libraryDependencies ++= Seq(
"org.scala-lang" % "scala-compiler" % "2.11.8"
)

val paradiseVersion = "2.1.0"

addCompilerPlugin("org.scalamacros" % "paradise" % paradiseVersion cross CrossVersion.full)
26 changes: 0 additions & 26 deletions project/Dependencies.scala

This file was deleted.

0 comments on commit bfb55f0

Please sign in to comment.