-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.sbt
139 lines (133 loc) · 4.68 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
import scala.sys.process.Process
lazy val commonSettings = Seq(
organization := "com.criteo",
version := "0.4.14",
scalaVersion := "2.12.4",
crossScalaVersions := Seq("2.11.8", "2.12.4"),
scalacOptions := Seq("-deprecation"),
credentials += Credentials(
"Sonatype Nexus Repository Manager",
"oss.sonatype.org",
"criteo-oss",
sys.env.getOrElse("SONATYPE_PASSWORD", "")
),
publishTo := Some(
if (isSnapshot.value)
Opts.resolver.sonatypeSnapshots
else
Opts.resolver.sonatypeStaging
),
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/slab</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>
<developer>
<name>Guillaume Bort</name>
<email>g.bort@criteo.com</email>
<url>https://github.com/guillaumebort</url>
<organization>Criteo</organization>
<organizationUrl>http://www.criteo.com</organizationUrl>
</developer>
<developer>
<name>Justin Coffey</name>
<email>j.coffey@criteo.com</email>
<url>https://github.com/jqcoffey</url>
<organization>Criteo</organization>
<organizationUrl>http://www.criteo.com</organizationUrl>
</developer>
<developer>
<name>Vincent Guerci</name>
<email>v.guerci@criteo.com</email>
<url>https://github.com/vguerci</url>
<organization>Criteo</organization>
<organizationUrl>http://www.criteo.com</organizationUrl>
</developer>
<developer>
<name>Jean-Baptiste Catté</name>
<email>jb.catte@criteo.com</email>
<url>https://github.com/jbkt</url>
<organization>Criteo</organization>
<organizationUrl>http://www.criteo.com</organizationUrl>
</developer>
<developer>
<name>Tudor Mihordea</name>
<email>t.mihordea@criteo.com</email>
<url>https://github.com/tmihordea</url>
<organization>Criteo</organization>
<organizationUrl>http://www.criteo.com</organizationUrl>
</developer>
<developer>
<name>Cristian Rotundu</name>
<email>c.rotundu@criteo.com</email>
<url>https://github.com/crotundu</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.slf4j" % "slf4j-api" % "1.7.25",
"org.json4s" %% "json4s-native" % "3.4.2",
"com.criteo.lolhttp" %% "lolhttp" % "0.13.0",
"com.github.cb372" %% "scalacache-core" % "0.22.0",
"com.github.cb372" %% "scalacache-caffeine" % "0.22.0",
"com.chuusai" %% "shapeless" % "2.3.3",
"org.scalatest" %% "scalatest" % "3.0.1" % Test,
"org.mockito" % "mockito-core" % "2.7.0" % Test
),
// Disable parallel execution until it stops causing deadlocks with Mockito
parallelExecution in Test := false
)
lazy val example = (project in file("example"))
.settings(commonSettings: _*)
.settings(
skip in publish := true,
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.6"),
scalacOptions := Seq(
"-P:socco:out:examples",
"-P:socco:package_scala:http://www.scala-lang.org/api/current/",
"-P:socco:package_lol.http:https://criteo.github.io/lolhttp/api/",
"-P:socco:package_com.criteo.slab:https://criteo.github.io/slab/api/"
)
)
}.getOrElse(Nil): _*
)
.dependsOn(root)
lazy val buildWebapp = taskKey[Unit]("build webapp")
buildWebapp := {
Process(s"npm run build -- -p --env.out=${crossTarget.value}/classes") !
}
packageBin in Compile := ((packageBin in Compile) dependsOn buildWebapp).value