2023-01-30 07:10:32 +00:00
|
|
|
val dottyVersion = "3.2.2"
|
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
|
|
|
|
2023-04-18 08:45:18 +00:00
|
|
|
val aquaVersion = "0.10.5"
|
2021-04-06 16:01:25 +00:00
|
|
|
|
2022-08-01 19:20:45 +00:00
|
|
|
val catsV = "2.8.0"
|
|
|
|
val catsParseV = "0.3.8"
|
2022-03-09 15:54:28 +00:00
|
|
|
val monocleV = "3.1.0"
|
2023-01-18 06:12:02 +00:00
|
|
|
val scalaTestV = "3.2.15"
|
2023-02-13 20:33:24 +00:00
|
|
|
val fs2V = "3.6.1"
|
2023-05-02 10:42:03 +00:00
|
|
|
val catsEffectV = "3.6-1f95fd7"
|
2022-08-01 19:20:45 +00:00
|
|
|
val declineV = "2.3.0"
|
|
|
|
val circeVersion = "0.14.2"
|
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(
|
2023-01-18 11:36:03 +00:00
|
|
|
version := {
|
|
|
|
val aquaSnapshot = sys.env.getOrElse("SNAPSHOT", "")
|
|
|
|
if (aquaSnapshot.isEmpty()) aquaVersion else aquaVersion + "-" + aquaSnapshot,
|
|
|
|
},
|
|
|
|
scalaVersion := dottyVersion,
|
2021-05-24 08:00:45 +00:00
|
|
|
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)
|
2022-12-28 08:30:42 +00:00
|
|
|
.in(file("cli/cli"))
|
2023-03-07 10:46:20 +00:00
|
|
|
.enablePlugins(GraalVMNativeImagePlugin)
|
2021-04-06 16:01:25 +00:00
|
|
|
.settings(commons: _*)
|
2021-08-11 16:53:36 +00:00
|
|
|
.settings(
|
2023-03-07 10:46:20 +00:00
|
|
|
Compile / mainClass := Some("aqua.AquaCli"),
|
|
|
|
graalVMNativeImageOptions ++= Seq(
|
|
|
|
"--no-fallback",
|
|
|
|
"--diagnostics-mode",
|
|
|
|
"--initialize-at-build-time",
|
|
|
|
"--initialize-at-run-time=scala.util.Random$",
|
|
|
|
"-H:-DeleteLocalSymbols",
|
|
|
|
"-H:+PreserveFramePointer",
|
|
|
|
"-H:+ReportExceptionStackTraces",
|
|
|
|
"-H:+DashboardHeap",
|
|
|
|
"-H:+DashboardCode",
|
|
|
|
"-H:+DashboardPointsTo",
|
|
|
|
"-H:+DashboardAll"
|
|
|
|
) ++ sys.env.get("COMPILE_STATIC").filter(_.trim.toLowerCase() == "true").map(_ => Seq("--static")).getOrElse(Seq.empty),
|
2021-08-11 16:53:36 +00:00
|
|
|
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-12-28 08:30:42 +00:00
|
|
|
.dependsOn(compiler, `backend-air`, `backend-ts`, io, definitions, logging, constants, `aqua-run`)
|
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
|
2022-12-28 08:30:42 +00:00
|
|
|
).dependsOn(`js-exports`, `js-imports`)
|
2021-08-11 16:53:36 +00:00
|
|
|
|
|
|
|
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-12-28 08:30:42 +00:00
|
|
|
lazy val `aqua-run` = crossProject(JSPlatform, JVMPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
|
|
|
.in(file("aqua-run"))
|
|
|
|
.settings(commons: _*)
|
|
|
|
.dependsOn(compiler, `backend-air`, `backend-ts`, io, definitions, logging, constants)
|
|
|
|
|
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)
|
|
|
|
|
2022-12-28 08:30:42 +00:00
|
|
|
lazy val ioJS = io.js.dependsOn(`js-imports`)
|
|
|
|
|
2022-05-17 12:05:25 +00:00
|
|
|
lazy val `language-server-api` = project
|
2022-12-28 08:30:42 +00:00
|
|
|
.in(file("language-server/language-server-api"))
|
2022-05-17 12:05:25 +00:00
|
|
|
.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)
|
|
|
|
|
2022-12-28 08:30:42 +00:00
|
|
|
lazy val `js-exports` = project
|
|
|
|
.in(file("js/js-exports"))
|
|
|
|
.enablePlugins(ScalaJSPlugin)
|
|
|
|
.settings(commons: _*)
|
|
|
|
.dependsOn(`backend`.js, definitions.js)
|
|
|
|
|
|
|
|
lazy val `js-imports` = project
|
|
|
|
.in(file("js/js-imports"))
|
|
|
|
.enablePlugins(ScalaJSPlugin)
|
|
|
|
.settings(commons: _*)
|
|
|
|
.dependsOn(`js-exports`, transform.js)
|
|
|
|
|
|
|
|
lazy val `aqua-api` = project
|
|
|
|
.in(file("api/aqua-api"))
|
|
|
|
.enablePlugins(ScalaJSPlugin)
|
|
|
|
.settings(commons: _*)
|
|
|
|
.settings(
|
|
|
|
scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule)),
|
|
|
|
scalaJSUseMainModuleInitializer := true,
|
|
|
|
Test / test := {}
|
|
|
|
)
|
|
|
|
.dependsOn(`js-exports`, `aqua-run`.js, `backend-api`.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: _*)
|
2022-05-24 14:05:26 +00:00
|
|
|
.dependsOn(semantics, linker, backend, transform % Test)
|
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"
|
|
|
|
)
|
2022-12-28 08:30:42 +00:00
|
|
|
.dependsOn(res, definitions)
|
|
|
|
|
|
|
|
lazy val definitions = crossProject(JVMPlatform, JSPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
|
|
|
.in(file("backend/definitions"))
|
|
|
|
.settings(commons: _*)
|
|
|
|
.settings(
|
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"io.circe" %%% "circe-core",
|
|
|
|
"io.circe" %%% "circe-generic",
|
|
|
|
"io.circe" %%% "circe-parser"
|
|
|
|
).map(_ % circeVersion)
|
|
|
|
).dependsOn(res, types)
|
|
|
|
|
|
|
|
lazy val logging = crossProject(JVMPlatform, JSPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
|
|
|
.in(file("utils/logging"))
|
|
|
|
.settings(commons: _*)
|
|
|
|
.settings(
|
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"org.typelevel" %%% "cats-core" % catsV
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
lazy val constants = crossProject(JVMPlatform, JSPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
|
|
|
.in(file("utils/constants"))
|
|
|
|
.settings(commons: _*)
|
|
|
|
.settings(
|
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"org.typelevel" %%% "cats-core" % catsV
|
|
|
|
)
|
|
|
|
).dependsOn(parser, raw)
|
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: _*)
|
2022-05-24 14:05:26 +00:00
|
|
|
.dependsOn(backend, transform)
|
2021-03-02 16:46:27 +00:00
|
|
|
|
2022-12-28 08:30:42 +00:00
|
|
|
lazy val `backend-api` = crossProject(JVMPlatform, JSPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
|
|
|
.in(file("backend/api"))
|
|
|
|
.settings(commons: _*)
|
|
|
|
.dependsOn(backend, transform, `backend-air`)
|
|
|
|
|
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)
|
|
|
|
)
|
2022-12-28 08:30:42 +00:00
|
|
|
.dependsOn(`backend-air`, definitions)
|