-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sbt
132 lines (114 loc) · 3.89 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
import de.heikoseeberger.sbtheader.License
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
import sbtcrossproject.CrossPlugin.autoImport.crossProject
name := "crypto"
scalacOptions in Compile ++= Seq("-Ypartial-unification", "-Xdisable-assertions")
javaOptions in Test ++= Seq("-ea")
skip in publish := true // Skip root project
val scalaV = scalaVersion := "2.12.9"
val commons = Seq(
scalaV,
version := "0.1.0",
fork in Test := true,
parallelExecution in Test := false,
organization := "one.fluence",
organizationName := "Fluence Labs Limited",
organizationHomepage := Some(new URL("https://fluence.one")),
startYear := Some(2017),
licenses += ("AGPL-V3", new URL("http://www.gnu.org/licenses/agpl-3.0.en.html")),
headerLicense := Some(License.AGPLv3("2017", organizationName.value)),
bintrayOrganization := Some("fluencelabs"),
publishMavenStyle := true,
scalafmtOnCompile := true,
bintrayRepository := "releases",
resolvers ++= Seq(Resolver.bintrayRepo("fluencelabs", "releases"), Resolver.sonatypeRepo("releases"))
)
commons
val CatsV = "2.0.0"
val CirceV = "0.12.1"
val SloggingV = "0.6.1"
val ScalatestV = "3.0.+"
val bouncyCastle = "org.bouncycastle" % "bcprov-jdk15on" % "1.61"
enablePlugins(AutomateHeaderPlugin)
lazy val `crypto-core` = crossProject(JVMPlatform, JSPlatform)
.withoutSuffixFor(JVMPlatform)
.crossType(FluenceCrossType)
.in(file("core"))
.settings(
commons,
libraryDependencies ++= Seq(
"org.scodec" %%% "scodec-core" % "1.11.3",
"org.typelevel" %%% "cats-core" % CatsV,
"org.scalatest" %%% "scalatest" % ScalatestV % Test
)
)
.jsSettings(
fork in Test := false
)
.enablePlugins(AutomateHeaderPlugin)
lazy val `crypto-core-js` = `crypto-core`.js
lazy val `crypto-core-jvm` = `crypto-core`.jvm
lazy val `crypto-hashsign` = crossProject(JVMPlatform, JSPlatform)
.withoutSuffixFor(JVMPlatform)
.crossType(FluenceCrossType)
.in(file("hashsign"))
.settings(
commons,
libraryDependencies ++= Seq(
"org.scalatest" %%% "scalatest" % ScalatestV % Test
)
)
.jvmSettings(
libraryDependencies ++= Seq(
//JVM-specific provider for cryptography
bouncyCastle
)
)
.jsSettings(
libraryDependencies += "io.scalajs" %%% "nodejs" % "0.4.2",
npmDependencies in Compile ++= Seq(
"elliptic" -> "6.4.1",
"supercop.js" -> "2.0.1",
"hash.js" -> "1.1.7"
),
scalaJSModuleKind in Test := ModuleKind.CommonJSModule,
//all JavaScript dependencies will be concatenated to a single file *-jsdeps.js
skip in packageJSDependencies := false,
fork in Test := false
)
.enablePlugins(AutomateHeaderPlugin)
.dependsOn(`crypto-core`)
lazy val `crypto-hashsign-js` = `crypto-hashsign`.js
.enablePlugins(ScalaJSBundlerPlugin)
lazy val `crypto-hashsign-jvm` = `crypto-hashsign`.jvm
lazy val `crypto-cipher` = crossProject(JVMPlatform, JSPlatform)
.withoutSuffixFor(JVMPlatform)
.crossType(FluenceCrossType)
.in(file("cipher"))
.settings(
commons,
libraryDependencies ++= Seq(
"biz.enef" %%% "slogging" % SloggingV % Test,
"org.scalatest" %%% "scalatest" % ScalatestV % Test
)
)
.jvmSettings(
libraryDependencies ++= Seq(
//JVM-specific provider for cryptography
bouncyCastle
)
)
.jsSettings(
npmDependencies in Compile ++= Seq(
"crypto-js" -> "3.1.9-1"
),
//all JavaScript dependencies will be concatenated to a single file *-jsdeps.js
skip in packageJSDependencies := false,
fork in Test := false,
scalaJSModuleKind := ModuleKind.CommonJSModule
)
.enablePlugins(AutomateHeaderPlugin)
.dependsOn(`crypto-hashsign`)
lazy val `crypto-cipher-js` = `crypto-cipher`.js
.enablePlugins(ScalaJSBundlerPlugin)
lazy val `crypto-cipher-jvm` = `crypto-cipher`.jvm