build.sbt 1.71 KB
Newer Older
1 2 3

lazy val genSrc = taskKey[List[File]]("generate sources")

4
genSrc := (sourceGenerators in Compile) { _.join.map(_.flatten.toList) }.value
5

6
lazy val makeClasspathFile = taskKey[Unit]("write the run-time classpath to target/jars.txt as colon-separated list")
7

8 9 10
lazy val root = (project in file(".")).
  settings(
    organization := "org.microvm",
11

12
    name := "mu-impl-ref2",
13

14
    version := "2.2.0",
15

16
    description := "The second reference implementation of Mu, the micro virtual machine",
17

18
    licenses := Seq("CC BY-SA 4.0" -> url("https://creativecommons.org/licenses/by-sa/4.0/legalcode")),
Kunshan Wang's avatar
Kunshan Wang committed
19

20
    scalaVersion := "2.11.11",
21

22
    libraryDependencies ++= Seq(
23
        "org.antlr" % "antlr4" % "4.7",
24
        "com.typesafe.scala-logging" %% "scala-logging" % "3.5.0",
25 26 27 28 29
        "ch.qos.logback" % "logback-classic" % "1.2.3",
        "com.github.jnr" % "jnr-ffi" % "2.1.5",
        "com.github.jnr" % "jffi" % "1.2.15" classifier "native",
        "com.github.jnr" % "jnr-posix" % "3.0.41",
        "org.scalatest" %% "scalatest" % "3.0.3" % "test",
30 31
        "junit" % "junit" % "4.12" % "test"
    ),
32

33
    testOptions in Test += Tests.Argument("-oF"), // print full stack trace when testing
34

35
    parallelExecution in Test := false,  // disable parallel tests because the refimpl2 is not thread-safe
36

37
    antlr4Settings,
38

39
    antlr4PackageName in Antlr4 := Some("uvm.ir.textinput.gen"),
40

41
    antlr4GenListener in Antlr4 := false,
42

43
    antlr4GenVisitor in Antlr4 := false,
44

45 46
    antlr4Version in Antlr4 := "4.7",

47 48
    makeClasspathFile := {
      val cp = (fullClasspath in Runtime).value.files 
Kunshan Wang's avatar
Kunshan Wang committed
49

50
      println("fullClasspath: \n" + cp.mkString("\n"))
51

52
      val cpStr = cp.mkString(":")
53

54 55 56
      IO.write(new java.io.File("classpath.txt"), cpStr)
    }
  )