-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.sbt
165 lines (151 loc) · 5.52 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
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
ThisBuild / scalaVersion := "3.2.2"
ThisBuild / organization := "com.fiatjaf"
ThisBuild / homepage := Some(url("https://github.com/fiatjaf/soma"))
ThisBuild / licenses += License.MIT
ThisBuild / developers := List(tlGitHubDev("fiatjaf", "fiatjaf"))
ThisBuild / version := "0.2.0-SNAPSHOT"
ThisBuild / tlSonatypeUseLegacyHost := false
Global / onChangedBuildSource := ReloadOnSourceChanges
val defaultMiner = sys.props.getOrElse("defaultMiner", default = "")
val defaultNodePort = sys.props.getOrElse("defaultNodePort", default = "9036")
val defaultTxExplorerUrl = sys.props.getOrElse("defaultTxExplorerUrl", default = "https://mempool.space/tx/")
lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.crossType(CrossType.Pure)
.settings(
name := "soma-core",
libraryDependencies ++= Seq(
"com.fiatjaf" %%% "scoin" % "0.7.1-SNAPSHOT",
"com.lihaoyi" %%% "utest" % "0.8.0" % Test
),
testFrameworks += new TestFramework("utest.runner.Framework")
)
.in(file("core"))
lazy val miner = project
.settings(
name := "soma-miner",
libraryDependencies ++= Seq(
"com.lihaoyi" %%% "upickle" % "1.6.0",
"com.lihaoyi" %%% "ujson" % "1.6.0",
"com.fiatjaf" %%% "nlog" % "0.1.0",
"com.fiatjaf" %%% "sn-unixsocket" % "0.2.0",
"com.github.lolgab" %%% "httpclient" % "0.0.1",
"com.github.lolgab" %%% "native-loop-core" % "0.2.1",
"com.softwaremill.quicklens" %%% "quicklens" % "1.9.0"
),
nativeConfig := {
val conf = nativeConfig.value
if (sys.env.get("SN_LINK").contains("static"))
conf
.withLinkingOptions(
conf.linkingOptions ++ Seq(
"-static",
"-lsecp256k1",
"-luv",
)
)
else conf
}
)
.dependsOn(core.native)
.enablePlugins(ScalaNativePlugin)
.in(file("miner"))
lazy val node = project
.settings(
name := "soma-node",
scalaJSUseMainModuleInitializer := true,
libraryDependencies ++= Seq(
"com.lihaoyi" %%% "upickle" % "1.6.0",
"org.scala-js" %%% "scala-js-macrotask-executor" % "1.0.0",
"com.softwaremill.sttp.client3" %%% "core" % "3.7.4"
),
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.ESModule) },
)
.dependsOn(core.js)
.enablePlugins(ScalaJSPlugin)
.in(file("node"))
lazy val sw = project
.settings(
name := "soma-cli-wallet",
libraryDependencies ++= Seq(
"io.circe" %%% "circe-core" % "0.14.3",
"io.circe" %%% "circe-generic" % "0.14.3",
"io.circe" %%% "circe-parser" % "0.14.3",
"org.typelevel" %%% "cats-effect" % "3.4.7",
"co.fs2" %%% "fs2-core" % "3.6.1",
"co.fs2" %%% "fs2-io" % "3.6.1",
"com.monovore" %%% "decline" % "2.4.1"
),
)
.dependsOn(core.native)
.enablePlugins(ScalaNativePlugin)
.in(file("sw"))
lazy val swWeb = project
.settings(
name := "soma-web-wallet",
scalaJSUseMainModuleInitializer := true,
libraryDependencies ++= Seq(
"com.armanbilge" %%% "calico" % "0.2.0-RC2",
"io.circe" %%% "circe-core" % "0.14.3",
"io.circe" %%% "circe-generic" % "0.14.3",
"io.circe" %%% "circe-parser" % "0.14.3",
),
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule) }
)
.dependsOn(core.js)
.enablePlugins(ScalaJSPlugin, EsbuildPlugin)
.in(file("sw-web-interface"))
lazy val wallet = project
.settings(
name := "soma-wallet",
scalaJSUseMainModuleInitializer := true,
libraryDependencies ++= Seq(
"io.circe" %%% "circe-core" % "0.14.3",
"io.circe" %%% "circe-generic" % "0.14.3",
"io.circe" %%% "circe-parser" % "0.14.3",
"org.scala-js" %%% "scala-js-macrotask-executor" % "1.1.0",
"com.softwaremill.sttp.client3" %%% "core" % "3.8.0",
"com.raquo" %%% "laminar" % "0.14.5",
// use these until everybody updates to scala-3.2.0
"org.typelevel" %%% "cats-core" % "2.9-826466b-SNAPSHOT",
),
Compile / npmDependencies ++= Seq(
"kjua" -> "0.9.0"
),
esbuildOptions ++= Seq(
"--target=es2020",
s"""--define:NODE_PORT="${defaultNodePort}"""",
s"""--define:TX_EXPLORER_URL="${defaultTxExplorerUrl}"""",
s"""--define:DEFAULT_MINER="${defaultMiner}""""
),
esPackageManager := Yarn,
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule) },
resolvers += "s01" at "https://s01.oss.sonatype.org/content/repositories/snapshots/"
)
.dependsOn(core.js)
.enablePlugins(EsbuildPlugin, ScalaJSPlugin)
.in(file("wallet"))
lazy val explorer = project
.settings(
name := "soma-explorer",
scalaJSUseMainModuleInitializer := true,
libraryDependencies ++= Seq(
"io.circe" %%% "circe-core" % "0.14.3",
"io.circe" %%% "circe-generic" % "0.14.3",
"io.circe" %%% "circe-parser" % "0.14.3",
"org.scala-js" %%% "scala-js-macrotask-executor" % "1.1.0",
"com.softwaremill.sttp.client3" %%% "core" % "3.8.0",
"com.raquo" %%% "laminar" % "0.14.5",
// use these until everybody updates to scala-3.2.0
"org.typelevel" %%% "cats-core" % "2.9-826466b-SNAPSHOT",
),
esbuildOptions ++= Seq(
s"""--define:NODE_PORT="${defaultNodePort}"""",
s"""--define:TX_EXPLORER_URL="${defaultTxExplorerUrl}""""
),
esPackageManager := Yarn,
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule) },
resolvers += "s01" at "https://s01.oss.sonatype.org/content/repositories/snapshots/"
)
.dependsOn(core.js)
.enablePlugins(EsbuildPlugin, ScalaJSPlugin)
.in(file("explorer"))