build.sbt 1.77 KB
Newer Older
Kunshan Wang's avatar
Kunshan Wang committed
1
enablePlugins(Antlr4Plugin)
2 3 4

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

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

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

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

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

15
    version := "2.2.0",
16

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

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

Kunshan Wang's avatar
Kunshan Wang committed
21
    scalaVersion := "2.12.3",
22

23
    libraryDependencies ++= Seq(
24
        "org.antlr" % "antlr4" % "4.7",
Kunshan Wang's avatar
Kunshan Wang committed
25
        "com.typesafe.scala-logging" %% "scala-logging" % "3.7.2",
26
        "ch.qos.logback" % "logback-classic" % "1.2.3",
27 28
        "com.github.jnr" % "jnr-ffi" % "2.1.6",
        "com.github.jnr" % "jffi" % "1.2.16" classifier "native",
29 30
        "com.github.jnr" % "jnr-posix" % "3.0.41",
        "org.scalatest" %% "scalatest" % "3.0.3" % "test",
31 32
        "junit" % "junit" % "4.12" % "test"
    ),
33

34 35
    scalacOptions += "-language:implicitConversions",

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

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

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

42
    antlr4GenListener in Antlr4 := false,
43

44
    antlr4GenVisitor in Antlr4 := false,
45

46 47
    antlr4Version in Antlr4 := "4.7",

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

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

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

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