forked from epfl-lara/inox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
138 lines (105 loc) · 4.08 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
name := "inox"
version := "1.0-SNAPSHOT"
organization := "ch.epfl.lara"
scalaVersion := "2.11.8"
crossScalaVersions := Seq("2.11.8", "2.12.1")
scalacOptions ++= Seq(
"-deprecation",
"-unchecked",
"-feature"
)
val osName = if (Option(System.getProperty("os.name")).getOrElse("").toLowerCase contains "win") "win" else "unix"
val osArch = System.getProperty("sun.arch.data.model")
unmanagedJars in Compile += {
baseDirectory.value / "unmanaged" / s"scalaz3-$osName-$osArch-${scalaBinaryVersion.value}.jar"
}
resolvers ++= Seq(
"Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
"Sonatype OSS Releases" at "https://oss.sonatype.org/content/repositories/releases",
"uuverifiers" at "http://logicrunch.it.uu.se:4096/~wv/maven"
)
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.0.1" % "test;it",
"org.apache.commons" % "commons-lang3" % "3.4",
"com.regblanc" %% "scala-smtlib" % "0.2.1",
"uuverifiers" %% "princess" % "2016-12-26"
)
lazy val scriptName = settingKey[String]("Name of the generated 'inox' script")
scriptName := "inox"
lazy val scriptFile = taskKey[File]("Location of the generated 'inox' script (computed from 'scriptName')")
scriptFile := file(".") / scriptName.value
clean := {
clean.value
val file = scriptFile.value
if (file.exists && file.isFile) file.delete
}
lazy val script = taskKey[Unit]("Generate the inox Bash script")
script := {
val s = streams.value
val file = scriptFile.value
try {
val cps = (dependencyClasspath in Compile).value
val out = (classDirectory in Compile).value
val res = (resourceDirectory in Compile).value
if (file.exists) {
s.log.info("Regenerating '" + file.getName + "' script")
file.delete
} else {
s.log.info("Generating '" + file.getName + "' script")
}
val paths = res.getAbsolutePath +: out.getAbsolutePath +: cps.map(_.data.absolutePath)
val cp = paths.mkString(System.getProperty("path.separator"))
IO.write(file, s"""|#!/bin/bash --posix
|
|SCALACLASSPATH=$cp
|
|java -Xmx2G -Xms512M -Xss64M -classpath "$${SCALACLASSPATH}" -Dscala.usejavacp=true inox.Main $$@ 2>&1
|""".stripMargin)
file.setExecutable(true)
} catch {
case e: Throwable =>
s.log.error("There was an error while generating the script file: " + e.getLocalizedMessage)
}
}
Keys.fork in run := true
testOptions in Test := Seq(Tests.Argument("-oDF"))
// Note that we can't use IntegrationTest because it is already defined in sbt._
lazy val ItTest = config("it") extend (Test)
testOptions in ItTest := Seq(Tests.Argument("-oDF"))
lazy val root = (project in file("."))
.configs(ItTest)
.settings(Defaults.itSettings : _*)
.settings(inConfig(ItTest)(Defaults.testTasks ++ Seq(
logBuffered := false,
parallelExecution := false
)) : _*)
.settings(compile <<= (compile in Compile) dependsOn script)
publishMavenStyle := true
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value) Some("snapshots" at nexus + "content/repositories/snapshots")
else Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
publishArtifact in (Test, packageBin) := true
publishArtifact in (ItTest, packageBin) := true
addArtifact(artifact in (ItTest, packageBin), packageBin in ItTest)
pomIncludeRepository := { _ => false }
licenses := Seq("GNU General Public License, Version 3" -> url("http://www.gnu.org/licenses/gpl-3.0.html"))
homepage := Some(url("https://github.com/epfl-lara/inox"))
pomExtra := (
<scm>
<url>[email protected]:epfl-lara/inox.git</url>
<connection>scm:git:[email protected]:epfl-lara/inox.git</connection>
</scm>
<developers>
<developer>
<id>epfl-lara</id>
<name>EPFL Lab for Automated Reasoning and Analysis</name>
<url>http://lara.epfl.ch</url>
</developer>
<developer>
<id>samarion</id>
<name>Nicolas Voirol</name>
<url>https://github.com/samarion</url>
</developer>
</developers>)