-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sbt
55 lines (48 loc) · 1.8 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
import Dependencies._
// Find rt.jar. Kudos to:
// https://stackoverflow.com/a/31322970
val rtJar: String = System.getProperty("sun.boot.class.path")
.split(java.io.File.pathSeparator).collectFirst {
case str: String if str.endsWith(java.io.File.separator + "rt.jar") => str
}.get // Fail hard if not found
// Determine the Java version number, for linking Java API docs
val javaVersion: String = {
System.getProperty("java.specification.version").split("\\.").last
} // Fail hard if the version format is not 1.xx
lazy val root = (project in file(".")).
settings(
inThisBuild(List(
organization := "uk.ac.ic.doc.mrg",
organizationHomepage := Some(url("http://mrg.doc.ic.ac.uk")),
organizationName := "Mobility Reading Group",
scalaVersion := "2.12.7",
version := "0.1.0-SNAPSHOT"
)),
name := "mpstk",
description := "A toolkit to define protocols as Multiparty Session Types, and verify their properties",
libraryDependencies ++= Seq(
parserComb,
scalaTest % Test,
picoCLI,
log, logBack,
csv,
nuProcess
),
scalacOptions ++= Seq(
"-deprecation",
"-unchecked",
"-feature"
),
scalacOptions in (Compile, doc) += s"-doc-external-doc:${rtJar}#http://docs.oracle.com/javase/${javaVersion}/docs/api",
// Generate a CLASSPATH file in the target directory
sourceGenerators in Compile += Def.task {
val cp: Seq[File] = {
Seq((classDirectory in Compile).value) ++
(externalDependencyClasspath in Compile).value.files
}
val file = (target in Compile).value / "CLASSPATH"
val sep = System.getProperties().getProperty("path.separator")
IO.write(file, cp.map(_.toString).mkString(sep).getBytes)
Seq() // Do not return any new source file
}.taskValue
)