-
Notifications
You must be signed in to change notification settings - Fork 154
/
Copy pathbuild.sbt
146 lines (134 loc) · 5.06 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
//
// build.sbt
// Figaro SBT build script
//
// Created By: Josh Serrin ([email protected]), Mike Reposa ([email protected])
// Creation Date: Jan 17, 2014
//
// Copyright 2017 Avrom J. Pfeffer and Charles River Analytics, Inc.
// See http://www.cra.com or email [email protected] for information.
//
// See http://www.github.com/p2t2/figaro for a copy of the software license.
//
//
// Additional Updates from our community
//
// Martin Mauch Dec 18, 2013
// Dragisa Krsmanovic May 24, 2014
// Paul Philips May 23, 2017
//
import sbt._
import Keys._
import sbt.Package.ManifestAttributes
import com.typesafe.sbteclipse.core.EclipsePlugin._
import sbtassembly.Plugin._
import AssemblyKeys._
import scoverage.ScoverageSbtPlugin._
name := "figaro-root"
lazy val figaroSettings = Seq(
organization := "com.cra.figaro",
description := "Figaro: a language for probablistic programming",
version := "5.0.0.0",
scalaVersion := "2.12.2",
crossScalaVersions := Seq(scalaVersion.value, "2.11.8"),
crossPaths := true,
publishMavenStyle := true,
retrieveManaged := true,
pomExtra :=
<url>http://www.github.com/p2t2/figaro</url>
<developers>
<developer>
<name>Avrom J. Pfeffer</name>
<email>[email protected]</email>
<organization>Charles River Analytics, Inc.</organization>
<organizationUrl>http://www.cra.com</organizationUrl>
</developer>
</developers>
<licenses>
<license>
<name>Figaro License</name>
<url>https://github.com/p2t2/figaro/blob/master/LICENSE</url>
</license>
</licenses>
<scm>
<connection>scm:git:[email protected]:p2t2/figaro.git</connection>
<developerConnection>scm:git:[email protected]:p2t2/figaro.git</developerConnection>
<url>[email protected]:p2t2/figaro.git</url>
</scm>
)
// lazy val scalaMajorMinor = "2.12"
// Read exisiting Figaro MANIFEST.MF from file
lazy val figaroManifest = Using.fileInputStream(file("Figaro/META-INF/MANIFEST.MF")) {
in => new java.util.jar.Manifest(in)
}
// Read exisiting FigaroExamples MANIFEST.MF from file
lazy val examplesManifest = Using.fileInputStream(file("FigaroExamples/META-INF/MANIFEST.MF")) {
in => new java.util.jar.Manifest(in)
}
lazy val root = Project("root", file("."))
.settings(figaroSettings)
.settings(publishLocal := {})
.settings(publish := {})
.dependsOn(figaro, examples)
.aggregate(figaro, examples)
lazy val figaro = Project("Figaro", file("Figaro"))
.settings(figaroSettings)
.settings (scalacOptions ++= Seq(
"-feature",
"-language:existentials",
"-deprecation",
"-language:postfixOps"
))
.settings(packageOptions := Seq(Package.JarManifest(figaroManifest)))
.settings(libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"asm" % "asm" % "3.3.1",
"org.apache.commons" % "commons-math3" % "3.3",
// "org.apache.commons" % "commons-math3" % "3.6.1",
"net.sf.jsci" % "jsci" % "1.2",
"com.typesafe.akka" %% "akka-actor" % "2.4.18",
"org.scalanlp" %% "breeze" % "0.13.1",
"io.argonaut" %% "argonaut" % "6.2",
"org.prefuse" % "prefuse" % "beta-20071021",
"org.scala-lang.modules" %% "scala-swing" % "2.0.0",
"com.storm-enroute" %% "scalameter" % "0.8.2" % "provided",
"org.scalatest" %% "scalatest" % "3.0.3" % "provided, test"
))
// Enable forking
.settings(fork := true)
// Increase max memory for JVM
.settings(javaOptions += "-Xmx6G")
// test settings
.settings(parallelExecution in Test := false)
.settings(testOptions in Test += Tests.Argument("-oD"))
.configs(detTest)
.settings(inConfig(detTest)(Defaults.testTasks): _*)
.settings(testOptions in detTest := Seq(Tests.Argument("-l", "com.cra.figaro.test.nonDeterministic")))
.configs(nonDetTest)
.settings(inConfig(nonDetTest)(Defaults.testTasks): _*)
.settings(testOptions in nonDetTest := Seq(Tests.Argument("-n", "com.cra.figaro.test.nonDeterministic")))
// sbt-assembly settings
.settings(assemblySettings: _*)
.settings(test in assembly := {})
// .settings(jarName in assembly := "figaro_" + scalaMajorMinor + "-" + version.value + "-fat.jar")
.settings(jarName in assembly := "figaro_" + scalaBinaryVersion.value + "-" + version.value + "-fat.jar")
.settings(assemblyOption in assembly ~= { _.copy(includeScala = false) })
.settings(excludedJars in assembly := {
val cp = (fullClasspath in assembly).value
cp filter {_.data.getName == "arpack_combined_all-0.1-javadoc.jar"}
})
// ScalaMeter settings
.settings(testFrameworks += new TestFramework("org.scalameter.ScalaMeterFramework"))
.settings(logBuffered := false)
lazy val examples = Project("FigaroExamples", file("FigaroExamples"))
.dependsOn(figaro)
.settings(figaroSettings)
.settings (scalacOptions ++= Seq(
"-feature",
"-language:existentials",
"-deprecation",
"-language:postfixOps"
))
.settings(packageOptions := Seq(Package.JarManifest(examplesManifest)))
lazy val detTest = config("det") extend(Test)
lazy val nonDetTest = config("nonDet") extend(Test)