forked from ThoughtWorksInc/DeepLearning.scala
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
94 lines (66 loc) · 3.02 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
parallelExecution in Global := false
sbt.dsl.dependsOn(DifferentiableBoolean,
DifferentiableDouble,
DifferentiableINDArray,
DifferentiableHList,
DifferentiableCoproduct,
DifferentiableSeq,
DifferentiableAny,
DifferentiableNothing)
lazy val Layer = project
lazy val Lift = project.dependsOn(Layer)
lazy val DifferentiableBoolean = project.dependsOn(Layer, BufferedLayer, Poly)
lazy val DifferentiableDouble =
project.dependsOn(Poly, DifferentiableBoolean, BufferedLayer, DifferentiableAny)
lazy val DifferentiableFloat =
project.dependsOn(Poly, DifferentiableBoolean, BufferedLayer, DifferentiableAny)
val DoubleRegex = """(?i:double)""".r
sourceGenerators in Compile in DifferentiableFloat += Def.task {
for {
doubleFile <- (unmanagedSources in Compile in DifferentiableDouble).value
relativeFile <- doubleFile.relativeTo((sourceDirectory in Compile in DifferentiableDouble).value)
} yield {
val doubleSource = IO.read(doubleFile, scala.io.Codec.UTF8.charSet)
val floatSource = DoubleRegex.replaceAllIn(doubleSource, { m =>
m.matched match {
case "Double" => "Float"
case "double" => "float"
}
})
val outputFile = (sourceManaged in Compile in DifferentiableFloat).value / relativeFile.getPath
IO.write(outputFile, floatSource, scala.io.Codec.UTF8.charSet)
outputFile
}
}.taskValue
lazy val DifferentiableInt =
project.dependsOn(Poly, DifferentiableDouble, DifferentiableBoolean, BufferedLayer, DifferentiableAny)
lazy val Poly = project.dependsOn(Lift)
lazy val DifferentiableAny = project.dependsOn(Lift)
lazy val DifferentiableNothing = project.dependsOn(Lift)
lazy val DifferentiableSeq = project.dependsOn(DifferentiableInt)
lazy val DifferentiableINDArray =
project.dependsOn(DifferentiableInt, DifferentiableDouble)
lazy val DifferentiableHList = project.dependsOn(Poly)
lazy val DifferentiableCoproduct = project.dependsOn(DifferentiableBoolean)
lazy val BufferedLayer = project.dependsOn(Layer)
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.0" % Test
addCompilerPlugin("com.thoughtworks.implicit-dependent-type" %% "implicit-dependent-type" % "1.0.0" % Test)
libraryDependencies += "com.thoughtworks.enableIf" %% "enableif" % "1.1.4" % Test
crossScalaVersions := Seq("2.10.6", "2.11.8", "2.12.1")
publishArtifact := false
lazy val unidoc = project
.enablePlugins(TravisUnidocTitle)
.settings(
UnidocKeys.unidocProjectFilter in ScalaUnidoc in UnidocKeys.unidoc := {
import Ordering.Implicits._
if (VersionNumber(scalaVersion.value).numbers >= Seq(2, 12)) {
inAnyProject -- inProjects(DifferentiableINDArray)
} else {
inAnyProject
}
},
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)
)
organization in ThisBuild := "com.thoughtworks.deeplearning"
fork in Test := true