forked from BayesianLogic/blog
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
107 lines (65 loc) · 3.36 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
import com.typesafe.sbt.SbtNativePackager._
import NativePackagerKeys._
import NativePackagerHelper._
name := "blog"
version := "0.9"
javacOptions ++= Seq("-source", "1.6")
//scalaVersion := "2.10.3"
compileOrder := CompileOrder.JavaThenScala
artifactName := { (sv: ScalaVersion, module: ModuleID, artifact: Artifact) =>
artifact.name + "-" + module.revision + "." + artifact.extension
}
mainClass in (Compile) := Some("blog.Main")
sources in (Compile, doc) ~= (_ filter (_.getName endsWith ".___")) // do not generate java doc, since it creates problem // TODO in the future, remove this line and fix documentation issue
libraryDependencies += "gov.nist.math" % "jama" % "1.0.3"
libraryDependencies += "com.google.code.gson" % "gson" % "2.2.4"
// this one is not required during compilation or running
libraryDependencies += "de.jflex" % "jflex" % "1.6.0"
libraryDependencies += "org.apache.commons" % "commons-math3" % "3.0" % "test"
libraryDependencies += "junit" % "junit" % "4.11" % "test"
parallelExecution in Test := false // disable parallel test
// enable sbt to use junit
libraryDependencies += "com.novocode" % "junit-interface" % "0.10" % "test"
EclipseKeys.eclipseOutput := Some("target/eclipse")
EclipseKeys.withSource := true
lazy val html = taskKey[Unit]("Generate html documentation")
html := {
val s: TaskStreams = streams.value
s.log.info("Generating html documentation")
"""pelican docs/content -o target/pelican -s docs/pelicanconf.py""" !
}
lazy val ghpages = taskKey[Unit]("Push updated html docs to github pages")
ghpages := {
html.value
(packageBin in Universal).value
(packageBin in Debian).value
"""docs/update_ghpages.sh""" !
}
lazy val parser = taskKey[Unit]("Generating parser files")
lazy val lexer = taskKey[Unit]("Generating lexer files")
lexer := {
val cpfiles = (fullClasspath in Test).value.files
println(cpfiles)
val cpString = cpfiles.map(_.getAbsolutePath).mkString(System.getProperty("path.separator"))
"""java -cp "%s" jflex.Main -d src/main/java/blog/parse src/parser/BLOGLexer.flex""".format(cpString) !
}
parser := {
val cpString = unmanagedBase.value.getName() + "/java-cup-11b.jar"
"""java -cp %s java_cup.Main -locations -destdir src/main/java/blog/parse -symbols BLOGTokenConstants -parser BLOGParser src/parser/BLOGParser.cup""".format(cpString) !
}
// the following are packaging settings
packageArchetype.java_application // native package
packageSummary in Linux := "BLOG Probabilistic Programming Language Inference Engine and Tools"
packageSummary in Windows := "BLOG Probabilistic Programming Language Inference Engine and Tools"
packageDescription := "BLOG Probabilistic Programming Language"
maintainer in Windows := "UC Berkeley RUGS"
maintainer in Debian := "UC Berkeley RUGS"
debianPackageDependencies in Debian ++= Seq("java2-runtime", "bash (>= 2.05a-11)")
debianPackageRecommends in Debian += "scala"
mappings in Universal ++= directory("example")
mappings in Universal ++= directory("target/pelican") map {case (f, s) => (f, s.replaceFirst("pelican", "docs"))}
mappings in Universal += file("iblog") -> "bin/iblog"
mappings in Universal += file("dblog") -> "bin/dblog"
mappings in Universal += file("bloglint") -> "bin/bloglint"
mappings in Universal += file("bloglint.bat") -> "bin/bloglint.bat"
mappings in Universal += file("src/main/scala/iblog.scala") -> "bin/iblog.scala"