-
Notifications
You must be signed in to change notification settings - Fork 3
/
Parent.scala
241 lines (216 loc) · 7.6 KB
/
Parent.scala
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
package org.hammerlab.sbt.plugin
import java.io.File
import org.hammerlab.sbt.deps.Group
import org.hammerlab.sbt.plugin.Root.autoImport.parent
import org.hammerlab.sbt.{ ContainerPlugin, Lib, Libs, aliases }
import sbt.Keys._
import sbt._
import sbtbuildinfo.BuildInfoKeys._
import sbtbuildinfo._
import sbtcrossproject.{ CrossPlugin, CrossProject, CrossType, JVMPlatform, Platform }
import scalajscrossproject.JSPlatform
import sourcecode.Name
object Parent
extends ContainerPlugin(
Deps,
GitHub,
Maven,
CrossPlugin,
Spark,
Versions
)
{
import Group._
trait platform {
val js = JSPlatform
val jvm = JVMPlatform
}
def pkg(str: String) = str.replaceAll("-", "_")
object autoImport
extends hammerlab.deps.syntax
with platform {
def cross (implicit name: Name, crossType: CrossType = CrossType.Full): CrossProject = cross(jvm, js)(name, crossType)
def cross(platforms: Platform*)(implicit name: Name, crossType: CrossType): CrossProject =
CrossProject(
name.value,
new File(name.value)
)(
platforms: _*
)
.crossType(crossType)
.enablePlugins(BuildInfoPlugin)
.settings(
buildInfoPackage := Seq(pkg(organization.value), "build").mkString("."),
buildInfoObject := pkg(name.value),
(unmanagedResourceDirectories in sbt.Test) +=
crossType
.sharedSrcDir(
baseDirectory.value,
"test"
)
.map {
_.getParentFile / "resources"
},
buildInfoKeys :=
Seq[BuildInfoKey](
Keys.name,
version,
scalaVersion,
sbtVersion,
BuildInfoKey
.map(resourceDirectories in sbt.Test) {
case ("test_resourceDirectories", v) ⇒
"resourceDirectories" → v.map(_.toString)
}
)
)
val resourceDirs = settingKey[Seq[String]]("resourceDirectories mapped as Strings, for use in scala.js projects' BuildInfo object")
object platform extends platform
implicit class CrossProjectXOps(val cp: CrossProject) extends AnyVal {
def x(implicit name: Name) =
parent(
cp
.componentProjects
.map {
p ⇒ p: ProjectReference
}
: _ *
)
.in(
cp
.projects(JVMPlatform)
.base
.getParentFile
)
}
val kryo = aliases. kryo
val hadoop = aliases.hadoop
val slf4j = aliases. slf4j
// TODO: move these to a non-plugin library, for re-use
val args4j = Lib( "args4j" ^ "args4j" ^ "2.33" )
val autowire = Lib( "com.lihaoyi" ^^ "autowire" ^ "0.2.6" )
val boopickle = Lib( "io.suzaku" ^^ "boopickle" ^ "1.3.0" )
val breeze = Lib( "org.scalanlp" ^^ "breeze" ^ "0.13.2" )
val case_app = Lib("com.github.alexarchambault" ^^ "case-app" ^ "2.0.0-M5" )
val guava = Lib( "com.google.guava" ^ "guava" ^ "19.0" )
val junit = Lib( "junit" ^ "junit" ^ "4.12" )
val kittens = Lib( "org.typelevel" ^^ "kittens" ^ "1.2.0" )
val magnolia = Lib( "com.propensive" ^^ "magnolia" ^ "0.10.0" )
val parquet_avro = Lib( "org.apache.parquet" ^ "parquet-avro" ^ "1.8.1" )
val purecsv = Lib( "com.github.melrief" ^^ "purecsv" ^ "0.1.1" )
val scalatags = Lib( "com.lihaoyi" ^^ "scalatags" ^ "0.6.7" )
val scalautils = Lib( "org.scalautils" ^^ "scalautils" ^ "2.1.5" )
val seqdoop_hadoop_bam = Lib( ("org.seqdoop" ^ "hadoop-bam" ^ "7.9.0") - hadoop )
val shapeless = Lib( "com.chuusai" ^^ "shapeless" ^ "2.3.3" )
val snappy = Lib( "org.xerial.snappy" ^ "snappy-java" ^ "1.1.7.2" )
val sourcecode = Lib( "com.lihaoyi" ^^ "sourcecode" ^ "0.1.5" )
val spire = Lib( "org.typelevel" ^^ "spire" ^ "0.15.0" )
val sttp = Lib( "com.softwaremill.sttp" ^^ "core" ^ "1.3.9" )
val htsjdk = Lib( ("com.github.samtools" ^ "htsjdk" ^ "2.9.1") - snappy ) // out of sort-order bc depends on snappy
object akka
extends Libs(
"com.typesafe.akka" ^^ "akka" ^ "2.5.20"
) {
val actor = lib
val stream = lib
object http
extends Libs(
"com.typesafe.akka" ^^ "akka-http" ^ "10.1.7"
) {
val base = lib(_base)
val core = lib
}
}
object bdg {
val artifactFn = (prefix: String, name: String) ⇒ s"$prefix-$name-spark2"
object adam
extends Libs(
"org.bdgenomics.adam" ^^ "adam" ^ "0.24.0",
artifactFn
) {
val core = lib
}
val formats = Lib("org.bdgenomics.bdg-formats" ^ "bdg-formats" ^ "0.10.1")
object quinine extends Libs(("org.bdgenomics.quinine" ^^ "quinine" ^ "0.0.2") - adam.core) {
val core = lib
}
object utils
extends Libs(
"org.bdgenomics.utils" ^^ "utils" ^ "0.2.14",
artifactFn
)
{
val cli = lib
val intervalrdd = lib
val io = lib
val metrics = lib
val misc = lib
}
}
object cats
extends Libs(
"org.typelevel" ^^ "cats" ^ "1.5.0"
) {
val core = lib
val free = lib
val macros = lib
val kernel = lib
val laws = lib
val effect = {
val dep = "org.typelevel" ^^ "cats-effect" ^ "1.1.0"
libs += dep
dep
}
}
object commons {
val io = Lib( "commons-io" ^ "commons-io" ^ "2.5")
val math = Lib("org.apache.commons" ^ "commons-math3" ^ "3.6.1")
}
object circe
extends Libs(
"io.circe" ^^ "circe" ^ "0.9.3"
) {
val core = lib
val literal = lib
val parser = lib
object generic extends Libs("io.circe" ^^ "circe-generic" ^ "0.9.3") {
val core = lib(_base)
val extras = lib
}
}
object fs2
extends Libs(
"co.fs2" ^^ "fs2" ^ "1.0.0"
) {
val core = lib
val io = lib
val `reactive-streams` = lib
}
object http4s
extends Libs(
"org.http4s" ^^ "http4s" ^ "0.19.0"
) {
val `blaze-server` = lib
val `blaze-client` = lib
val circe = lib
val dsl = lib
}
object slinky
extends Libs(
"me.shadaj" ^^ "slinky" ^ "0.5.1"
) {
val core = lib
val web = lib
val native = lib
val hot = lib
val `scalajsreact-interop` = lib
import sbt._
import Keys._
override def settings: SettingsDefinition = scalacOptions += "-P:scalajs:sjsDefinedByDefault"
}
object slogging extends Libs("biz.enef" ^^ "slogging" ^ "0.6.1") {
val core = lib(_base)
val slf4j = aliases.slf4j.slogging
}
}
}