forked from criteo/slab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
85 lines (78 loc) · 2.58 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
lazy val commonSettings = Seq(
organization := "com.criteo",
version := "0.2.1",
scalaVersion := "2.12.1",
crossScalaVersions := Seq("2.11.8", "2.12.1"),
credentials += Credentials(
"Sonatype Nexus Repository Manager",
"oss.sonatype.org",
"criteo-oss",
sys.env.getOrElse("SONATYPE_PASSWORD", "")
),
pgpPassphrase := sys.env.get("SONATYPE_PASSWORD").map(_.toArray),
pgpSecretRing := file(".travis/secring.gpg"),
pgpPublicRing := file(".travis/pubring.gpg"),
pomExtra in Global := {
<url>https://github.com/criteo/lolhttp</url>
<licenses>
<license>
<name>Apache 2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<scm>
<connection>scm:git:github.com/criteo/slab.git</connection>
<developerConnection>scm:git:git@github.com:criteo/slab.git</developerConnection>
<url>github.com/criteo/slab</url>
</scm>
<developers>
<developer>
<name>Sheng Ran</name>
<email>s.ran@criteo.com</email>
<url>https://github.com/jedirandy</url>
<organization>Criteo</organization>
<organizationUrl>http://www.criteo.com</organizationUrl>
</developer>
</developers>
}
)
lazy val root = (project in file("."))
.settings(commonSettings: _*)
.settings(
name := "slab",
libraryDependencies ++= Seq(
"org.json4s" %% "json4s-native" % "3.4.2",
"org.scalatest" %% "scalatest" % "3.0.1" % Test,
"org.mockito" % "mockito-core" % "2.7.0" % Test,
"org.slf4j" % "slf4j-api" % "1.7.25",
"com.criteo.lolhttp" %% "lolhttp" % "0.3.2",
"io.netty" % "netty-codec-http2" % "4.1.9.Final"
)
)
lazy val example = (project in file("example"))
.settings(commonSettings: _*)
.settings(
libraryDependencies ++= Seq(
"org.slf4j" % "slf4j-simple" % "1.7.25"
)
)
.settings(
Option(System.getenv().get("GENERATE_EXAMPLE_DOC")).map { _ =>
Seq(
autoCompilerPlugins := true,
addCompilerPlugin("com.criteo.socco" %% "socco-plugin" % "0.1.1"),
scalacOptions := Seq(
"-P:socco:out:examples",
"-P:socco:package_scala.concurrent:http://www.scala-lang.org/api/current/"
)
)
}.getOrElse(Nil): _*
)
.dependsOn(root)
lazy val buildWebapp = taskKey[Unit]("build webapp")
buildWebapp := {
"npm install" !
"npm run build -- -p --env.out=target/scala-2.11/classes" !
"npm run build -- -p --env.out=target/scala-2.12/classes" !
}
packageBin in Compile <<= (packageBin in Compile) dependsOn buildWebapp