2021-12-22 15:21:37 +03:00
|
|
|
val dottyVersion = "3.1.0"
|
2021-04-06 19:01:25 +03:00
|
|
|
|
2021-04-29 14:16:25 +03:00
|
|
|
scalaVersion := dottyVersion
|
2021-02-17 16:30:45 +03:00
|
|
|
|
2021-04-14 14:15:27 +03:00
|
|
|
val baseAquaVersion = settingKey[String]("base aqua version")
|
2021-04-06 19:01:25 +03:00
|
|
|
|
2021-12-22 15:21:37 +03:00
|
|
|
val catsV = "2.7.0"
|
|
|
|
val catsParseV = "0.3.6"
|
2022-03-09 18:54:28 +03:00
|
|
|
val monocleV = "3.1.0"
|
2021-12-22 15:21:37 +03:00
|
|
|
val scalaTestV = "3.2.10"
|
2022-03-09 18:54:28 +03:00
|
|
|
val fs2V = "3.2.5"
|
|
|
|
val catsEffectV = "3.3.7"
|
2021-12-22 15:21:37 +03:00
|
|
|
val declineV = "2.2.0"
|
2021-10-21 16:47:04 +03:00
|
|
|
val circeVersion = "0.14.1"
|
2022-04-20 14:45:42 +03:00
|
|
|
val scribeV = "3.7.1"
|
2021-04-06 19:01:25 +03:00
|
|
|
|
2021-04-08 15:53:54 +03:00
|
|
|
name := "aqua-hll"
|
2021-04-06 19:01:25 +03:00
|
|
|
|
|
|
|
val commons = Seq(
|
2022-04-20 14:45:42 +03:00
|
|
|
baseAquaVersion := "0.7.2",
|
2021-09-13 13:29:35 +03:00
|
|
|
version := baseAquaVersion.value + "-" + sys.env.getOrElse("BUILD_NUMBER", "SNAPSHOT"),
|
2021-05-24 11:00:45 +03:00
|
|
|
scalaVersion := dottyVersion,
|
|
|
|
libraryDependencies ++= Seq(
|
2021-12-22 15:21:37 +03:00
|
|
|
"com.outr" %%% "scribe" % scribeV,
|
2021-08-11 19:53:36 +03:00
|
|
|
"org.scalatest" %%% "scalatest" % scalaTestV % Test
|
2021-05-24 11:00:45 +03:00
|
|
|
),
|
2021-08-06 13:33:58 +03:00
|
|
|
scalacOptions ++= {
|
|
|
|
Seq(
|
|
|
|
"-encoding",
|
|
|
|
"UTF-8",
|
|
|
|
"-feature",
|
|
|
|
"-language:implicitConversions",
|
|
|
|
"-unchecked",
|
|
|
|
"-Ykind-projector"
|
2022-01-13 10:32:59 +03:00
|
|
|
// "-Xfatal-warnings"
|
2021-08-06 13:33:58 +03:00
|
|
|
)
|
|
|
|
}
|
2021-04-06 19:01:25 +03:00
|
|
|
)
|
|
|
|
|
2021-04-13 16:02:36 +03:00
|
|
|
commons
|
|
|
|
|
2021-08-11 19:53:36 +03:00
|
|
|
lazy val cli = crossProject(JSPlatform, JVMPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
|
|
|
.in(file("cli"))
|
2021-04-06 19:01:25 +03:00
|
|
|
.settings(commons: _*)
|
2021-08-11 19:53:36 +03:00
|
|
|
.settings(
|
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"org.typelevel" %%% "cats-effect" % catsEffectV,
|
|
|
|
"com.monovore" %%% "decline" % declineV,
|
|
|
|
"com.monovore" %%% "decline-effect" % declineV,
|
|
|
|
"co.fs2" %%% "fs2-io" % fs2V
|
|
|
|
)
|
|
|
|
)
|
2021-09-23 13:45:27 +03:00
|
|
|
.dependsOn(compiler, `backend-air`, `backend-ts`)
|
2021-08-11 19:53:36 +03:00
|
|
|
|
|
|
|
lazy val cliJS = cli.js
|
|
|
|
.settings(
|
2021-10-13 11:10:10 +03:00
|
|
|
scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.ESModule)),
|
2021-08-11 19:53:36 +03:00
|
|
|
scalaJSUseMainModuleInitializer := true
|
|
|
|
)
|
|
|
|
|
|
|
|
lazy val cliJVM = cli.jvm
|
2021-04-06 19:01:25 +03:00
|
|
|
.settings(
|
2021-04-22 16:42:08 +03:00
|
|
|
Compile / run / mainClass := Some("aqua.AquaCli"),
|
|
|
|
assembly / mainClass := Some("aqua.AquaCli"),
|
2021-09-08 13:37:59 +03:00
|
|
|
assembly / assemblyJarName := "aqua-" + version.value + ".jar",
|
2021-04-06 19:01:25 +03:00
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2021-08-11 19:53:36 +03:00
|
|
|
lazy val types = crossProject(JVMPlatform, JSPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
2021-04-06 19:01:25 +03:00
|
|
|
.settings(commons)
|
|
|
|
.settings(
|
|
|
|
libraryDependencies ++= Seq(
|
2021-08-11 19:53:36 +03:00
|
|
|
"org.typelevel" %%% "cats-core" % catsV
|
2021-04-06 19:01:25 +03:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2021-08-11 19:53:36 +03:00
|
|
|
lazy val parser = crossProject(JVMPlatform, JSPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
2021-04-06 19:01:25 +03:00
|
|
|
.settings(commons: _*)
|
|
|
|
.settings(
|
|
|
|
libraryDependencies ++= Seq(
|
2021-08-31 13:05:26 +03:00
|
|
|
"org.typelevel" %%% "cats-parse" % catsParseV,
|
|
|
|
"org.typelevel" %%% "cats-free" % catsV
|
2021-04-06 19:01:25 +03:00
|
|
|
)
|
|
|
|
)
|
|
|
|
.dependsOn(types)
|
2021-02-01 16:17:46 +03:00
|
|
|
|
2021-08-11 19:53:36 +03:00
|
|
|
lazy val linker = crossProject(JVMPlatform, JSPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
2021-04-13 16:05:31 +03:00
|
|
|
.settings(commons: _*)
|
|
|
|
.dependsOn(parser)
|
|
|
|
|
2022-01-31 14:48:13 +03:00
|
|
|
lazy val tree = crossProject(JVMPlatform, JSPlatform)
|
2021-08-11 19:53:36 +03:00
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
2022-01-31 14:48:13 +03:00
|
|
|
.in(file("model/tree"))
|
2021-04-06 19:01:25 +03:00
|
|
|
.settings(commons: _*)
|
|
|
|
.settings(
|
|
|
|
libraryDependencies ++= Seq(
|
2021-08-11 19:53:36 +03:00
|
|
|
"org.typelevel" %%% "cats-free" % catsV
|
2021-04-06 19:01:25 +03:00
|
|
|
)
|
|
|
|
)
|
2022-01-31 14:48:13 +03:00
|
|
|
|
|
|
|
lazy val raw = crossProject(JVMPlatform, JSPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
|
|
|
.in(file("model/raw"))
|
|
|
|
.settings(commons: _*)
|
|
|
|
.dependsOn(types, tree)
|
2021-04-06 19:01:25 +03:00
|
|
|
|
2022-01-13 10:32:59 +03:00
|
|
|
lazy val model = crossProject(JVMPlatform, JSPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
|
|
|
.settings(commons: _*)
|
2022-01-31 14:48:13 +03:00
|
|
|
.dependsOn(types, tree, raw)
|
2022-01-13 10:32:59 +03:00
|
|
|
|
2022-01-31 14:48:13 +03:00
|
|
|
lazy val res = crossProject(JVMPlatform, JSPlatform)
|
2021-08-16 17:58:15 +03:00
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
2022-01-31 14:48:13 +03:00
|
|
|
.in(file("model/res"))
|
2021-08-16 17:58:15 +03:00
|
|
|
.settings(commons: _*)
|
2022-01-31 14:48:13 +03:00
|
|
|
.dependsOn(model)
|
2021-08-16 17:58:15 +03:00
|
|
|
|
2022-01-31 14:48:13 +03:00
|
|
|
lazy val inline = crossProject(JVMPlatform, JSPlatform)
|
2021-08-11 19:53:36 +03:00
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
2022-01-31 14:48:13 +03:00
|
|
|
.in(file("model/inline"))
|
|
|
|
.settings(commons: _*)
|
|
|
|
.dependsOn(raw, model)
|
|
|
|
|
|
|
|
lazy val transform = crossProject(JVMPlatform, JSPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
|
|
|
.in(file("model/transform"))
|
2021-06-18 17:01:31 +03:00
|
|
|
.settings(commons: _*)
|
2022-01-31 14:48:13 +03:00
|
|
|
.dependsOn(model, res, inline)
|
2021-06-18 17:01:31 +03:00
|
|
|
|
2021-08-11 19:53:36 +03:00
|
|
|
lazy val semantics = crossProject(JVMPlatform, JSPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
2021-04-06 19:01:25 +03:00
|
|
|
.settings(commons: _*)
|
2021-02-01 16:17:46 +03:00
|
|
|
.settings(
|
|
|
|
libraryDependencies ++= Seq(
|
2022-03-09 18:54:28 +03:00
|
|
|
"dev.optics" %%% "monocle-core" % monocleV,
|
|
|
|
"dev.optics" %%% "monocle-macro" % monocleV
|
2021-03-19 12:40:27 +03:00
|
|
|
)
|
2021-02-01 16:17:46 +03:00
|
|
|
)
|
2022-01-31 14:48:13 +03:00
|
|
|
.dependsOn(raw, parser)
|
2021-04-06 19:01:25 +03:00
|
|
|
|
2021-08-11 19:53:36 +03:00
|
|
|
lazy val compiler = crossProject(JVMPlatform, JSPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
2021-06-29 16:31:20 +03:00
|
|
|
.in(file("compiler"))
|
|
|
|
.settings(commons: _*)
|
2021-06-30 09:21:40 +03:00
|
|
|
.dependsOn(semantics, linker, backend)
|
2021-06-29 16:31:20 +03:00
|
|
|
|
2021-08-11 19:53:36 +03:00
|
|
|
lazy val backend = crossProject(JVMPlatform, JSPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
2021-06-25 10:25:27 +03:00
|
|
|
.in(file("backend"))
|
|
|
|
.settings(commons: _*)
|
2021-09-07 11:02:36 +03:00
|
|
|
.enablePlugins(BuildInfoPlugin)
|
|
|
|
.settings(
|
2021-11-04 19:22:57 +03:00
|
|
|
buildInfoKeys := Seq[BuildInfoKey](version),
|
2021-09-07 11:02:36 +03:00
|
|
|
buildInfoPackage := "aqua.backend"
|
|
|
|
)
|
2021-08-16 17:58:15 +03:00
|
|
|
.dependsOn(transform)
|
2021-06-25 10:25:27 +03:00
|
|
|
|
2021-08-11 19:53:36 +03:00
|
|
|
lazy val `backend-air` = crossProject(JVMPlatform, JSPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
2021-04-06 19:01:25 +03:00
|
|
|
.in(file("backend/air"))
|
|
|
|
.settings(commons: _*)
|
2021-06-25 10:25:27 +03:00
|
|
|
.dependsOn(backend)
|
2021-03-02 19:46:27 +03:00
|
|
|
|
2021-08-11 19:53:36 +03:00
|
|
|
lazy val `backend-ts` = crossProject(JVMPlatform, JSPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
2021-04-06 19:01:25 +03:00
|
|
|
.in(file("backend/ts"))
|
|
|
|
.settings(commons: _*)
|
2021-10-21 16:47:04 +03:00
|
|
|
.settings(
|
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"io.circe" %%% "circe-core",
|
|
|
|
"io.circe" %%% "circe-generic",
|
|
|
|
"io.circe" %%% "circe-parser"
|
|
|
|
).map(_ % circeVersion)
|
|
|
|
)
|
2021-04-06 19:01:25 +03:00
|
|
|
.dependsOn(`backend-air`)
|