forked from com-lihaoyi/utest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
94 lines (86 loc) · 3.53 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
import com.typesafe.sbt.pgp.PgpKeys._
import org.scalajs.core.tools.sem.CheckedBehavior
name in ThisBuild := "utest"
organization in ThisBuild := "com.lihaoyi"
version in ThisBuild := "0.4.7-SNAPSHOT"
scalaVersion in ThisBuild := "2.12.2"
crossScalaVersions in ThisBuild := Seq("2.10.6", "2.11.11", "2.12.2")
updateOptions in ThisBuild := (updateOptions in ThisBuild).value.withCachedResolution(true)
incOptions in ThisBuild := (incOptions in ThisBuild).value.withNameHashing(true).withLogRecompileOnMacro(false)
triggeredMessage in ThisBuild := Watched.clearWhenTriggered
lazy val utest = crossProject
.settings(
scalacOptions := Seq("-Ywarn-dead-code"),
scalacOptions in Test -= "-Ywarn-dead-code",
libraryDependencies ++= macroDependencies(scalaVersion.value),
scalacOptions ++= Seq(scalaVersion.value match {
case x if x.startsWith("2.12.") => "-target:jvm-1.8"
case _ => "-target:jvm-1.6"
}),
unmanagedSourceDirectories in Compile += {
val v = if (scalaVersion.value startsWith "2.10.") "scala-2.10" else "scala-2.11"
baseDirectory.value/".."/"shared"/"src"/"main"/v
},
// libraryDependencies += "com.lihaoyi" %% "acyclic" % "0.1.4" % "provided",
// autoCompilerPlugins := true,
// addCompilerPlugin("com.lihaoyi" %% "acyclic" % "0.1.4"),
testFrameworks += new TestFramework("test.utest.CustomFramework"),
// Sonatype2
publishArtifact in Test := false,
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")
},
pomExtra :=
<url>https://github.com/lihaoyi/utest</url>
<licenses>
<license>
<name>MIT license</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
</license>
</licenses>
<scm>
<url>git://github.com/lihaoyi/utest.git</url>
<connection>scm:git://github.com/lihaoyi/utest.git</connection>
</scm>
<developers>
<developer>
<id>lihaoyi</id>
<name>Li Haoyi</name>
<url>https://github.com/lihaoyi</url>
</developer>
</developers>
)
.jsSettings(
libraryDependencies += "org.scala-js" %% "scalajs-test-interface" % scalaJSVersion
// scalaJSSemantics in Test ~= (_.withAsInstanceOfs(CheckedBehavior.Compliant))
)
.jvmSettings(
// fork in Test := true,
libraryDependencies ++= Seq(
"org.scala-sbt" % "test-interface" % "1.0",
"org.scala-js" %% "scalajs-stubs" % scalaJSVersion % "provided"
),
resolvers += Resolver.sonatypeRepo("snapshots")
)
def macroDependencies(version: String) =
("org.scala-lang" % "scala-reflect" % version) +:
(if (version startsWith "2.10.")
Seq(compilerPlugin("org.scalamacros" % s"paradise" % "2.1.0" cross CrossVersion.full),
"org.scalamacros" %% s"quasiquotes" % "2.1.0")
else
Seq())
lazy val utestJS = utest.js
lazy val utestJVM = utest.jvm
lazy val root = project.in(file("."))
.aggregate(utestJS, utestJVM)
.settings(
publishTo := Some(Resolver.file("Unused transient repository", target.value / "fakepublish")),
publishArtifact := false,
publishLocal := (),
publishLocalSigned := (), // doesn't work
publishSigned := (), // doesn't work
packagedArtifacts := Map.empty) // doesn't work - https://github.com/sbt/sbt-pgp/issues/42