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