-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sbt
96 lines (89 loc) · 4.48 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
val paradise_version = "2.1.0"
val scala_version = "2.12.10"
lazy val Slow = config("slow").extend(Test)
val bldSettings = Defaults.coreDefaultSettings ++ Seq(
organization := "edu.stanford.ppl",
version := "0.1",
publishArtifact in (Compile, packageDoc) := false,
scalaVersion := scala_version,
scalaSource in Compile := baseDirectory(_ / "src").value,
scalaSource in Test := baseDirectory(_ / "test").value,
resourceDirectory in Compile := baseDirectory(_ / "resources").value,
logBuffered in Test := false,
libraryDependencies += "org.scala-lang" % "scala-reflect" % scala_version,
libraryDependencies += "org.scalatest" % "scalatest_2.12" % "3.0.5" % "test",
libraryDependencies += "com.github.pureconfig" %% "pureconfig" % "0.7.0",
libraryDependencies += "io.spray" %% "spray-json" % "1.3.4",
libraryDependencies += "com.lihaoyi" %% "sourcecode" % "0.1.9", // Scala-JVM,
/*libraryDependencies += "com.thoughtworks.xstream" % "xstream" % "1.4.3",*/
//libraryDependencies += "io.suzaku" %% "boopickle" % "1.3.0",
retrieveManaged := true,
//javaOptions += "-Xmx1G", // java heap size ignored unless fork in run := true
//javaOptions += "-Xms1G", // java stack size
scalacOptions += "-feature",
scalacOptions += "-unchecked",
scalacOptions += "-deprecation",
scalacOptions += "-language:experimental.macros", // Globally enable macros
scalacOptions += "-language:implicitConversions", // Globally enable implicit conversions
scalacOptions += "-language:reflectiveCalls",
testOptions in Test += Tests.Argument("-l", "Slow"),
testOptions in Slow -= Tests.Argument("-l", "Slow"),
testOptions in Slow += Tests.Argument("-n", "Slow"),
autoAPIMappings := true,
scalacOptions in (Compile, doc) ++= Seq(
"-doc-root-content",
baseDirectory.value+"/root-doc.txt",
"-diagrams",
"-diagrams-debug",
"-doc-title", name.value
),
isSnapshot := true,
parallelExecution in Test := true,
cancelable in Global := true,
concurrentRestrictions in Global := (Tags.limitAll(1) :: Nil),
addCompilerPlugin("org.scalamacros" % "paradise" % paradise_version cross CrossVersion.full)
)
lazy val prism = Project("prism", file("prism/"))
.configs(Slow)
.settings(
bldSettings,
inConfig(Slow)(Defaults.testTasks)
)
lazy val spade = Project("spade", file("spade/"))
.dependsOn(prism % "compile->compile;test->test")
.settings(bldSettings)
.settings(
scalaSource in Compile := baseDirectory(_ / "src/core").value,
unmanagedSourceDirectories in Compile += baseDirectory(_ / "src/param2").value,
unmanagedSourceDirectories in Compile += baseDirectory(_ / "src/pass").value,
unmanagedSourceDirectories in Compile += baseDirectory(_ / "src/codegen/dot/NetworkDotGen.scala").value,
unmanagedSourceDirectories in Compile += baseDirectory(_ / "src/codegen/ParamIRPrinter.scala").value,
unmanagedSourceDirectories in Compile += baseDirectory(_ / "src/node").value
)
/*.settings(*/
/*unmanagedSourceDirectories in Compile += baseDirectory(_ / "src/param3").value,*/
/*libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.8.1",*/
/*libraryDependencies += "com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf",*/
/*libraryDependencies += "com.thesamet.scalapb" %% "scalapb-json4s" % "0.7.0",*/
/*PB.targets in Compile := Seq(*/
/*scalapb.gen() -> (sourceManaged in Compile).value*/
/*),*/
/*PB.protoSources in Compile := Seq(baseDirectory(_ / "src/param3/proto/").value)*/
/*)*/
lazy val pir = Project("pir", file("pir/"))
.dependsOn(prism % "compile->compile;test->test")
.dependsOn(spade % "compile->compile")
.settings(bldSettings).settings(
scalaSource in Compile := baseDirectory(_ / "src/core").value,
unmanagedSourceDirectories in Compile += baseDirectory(_ / "src/util/").value,
unmanagedSourceDirectories in Compile += baseDirectory(_ / "src/pass/").value,
unmanagedSourceDirectories in Compile += baseDirectory(_ / "src/codegen/").value,
unmanagedSourceDirectories in Compile += baseDirectory(_ / "src/mapper/").value,
unmanagedSourceDirectories in Compile += baseDirectory(_ / "src/node").value
)
// sbt command alias
addCommandAlias("make", "compile")
addCommandAlias("publishAll", "; project prism; publishLocal; project spade; publishLocal; project pir; publishLocal")
addCommandAlias("pir", "; project pir; runMain pir.pload")
addCommandAlias("psh", "; project pir; runMain pir.psh")
addCommandAlias("spade", "; project spade; runMain spade.Plasticine --out=out/plasticine")