2023-09-18 07:53:25 +00:00
|
|
|
import BundleJS.*
|
|
|
|
|
2023-10-23 14:20:47 +00:00
|
|
|
val aquaVersion = "0.12.4"
|
2021-04-06 16:01:25 +00:00
|
|
|
|
2023-09-11 12:13:48 +00:00
|
|
|
val scalaV = "3.3.1"
|
2023-08-21 10:45:12 +00:00
|
|
|
val catsV = "2.10.0"
|
2023-07-04 16:13:49 +00:00
|
|
|
val catsParseV = "0.3.10"
|
2022-03-09 15:54:28 +00:00
|
|
|
val monocleV = "3.1.0"
|
2023-09-11 12:30:26 +00:00
|
|
|
val scalaTestV = "3.2.17"
|
2023-09-19 15:01:42 +00:00
|
|
|
val sourcecodeV = "0.3.0"
|
2023-09-18 11:22:01 +00:00
|
|
|
val fs2V = "3.9.2"
|
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,
|
|
|
|
},
|
2023-06-15 14:01:26 +00:00
|
|
|
scalaVersion := scalaV,
|
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
|
|
|
|
|
2022-12-28 08:30:42 +00:00
|
|
|
lazy val `aqua-run` = crossProject(JSPlatform, JVMPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
|
|
|
.in(file("aqua-run"))
|
2023-07-18 17:18:33 +00:00
|
|
|
.settings(commons)
|
2022-12-28 08:30:42 +00:00
|
|
|
.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)
|
2023-07-18 17:18:33 +00:00
|
|
|
.settings(commons)
|
2022-05-17 12:05:25 +00:00
|
|
|
.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`)
|
|
|
|
|
2023-05-03 13:24:19 +00:00
|
|
|
lazy val `language-server-api` = crossProject(JSPlatform, JVMPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
2022-12-28 08:30:42 +00:00
|
|
|
.in(file("language-server/language-server-api"))
|
2023-07-18 17:18:33 +00:00
|
|
|
.settings(commons)
|
2022-05-17 12:05:25 +00:00
|
|
|
.settings(
|
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"org.typelevel" %%% "cats-effect" % catsEffectV,
|
|
|
|
"co.fs2" %%% "fs2-io" % fs2V
|
|
|
|
)
|
|
|
|
)
|
2023-05-03 13:24:19 +00:00
|
|
|
.dependsOn(compiler, io)
|
|
|
|
|
|
|
|
lazy val `language-server-apiJS` = `language-server-api`.js
|
|
|
|
.settings(
|
|
|
|
scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule)),
|
|
|
|
scalaJSUseMainModuleInitializer := true
|
|
|
|
)
|
2023-09-18 07:53:25 +00:00
|
|
|
.settings(addBundleJS("../../language-server-npm/aqua-lsp-api.js"))
|
2023-05-03 13:24:19 +00:00
|
|
|
.enablePlugins(ScalaJSPlugin)
|
|
|
|
.dependsOn(`js-exports`, `js-imports`)
|
2022-05-17 12:05:25 +00:00
|
|
|
|
2022-12-28 08:30:42 +00:00
|
|
|
lazy val `js-exports` = project
|
|
|
|
.in(file("js/js-exports"))
|
|
|
|
.enablePlugins(ScalaJSPlugin)
|
2023-07-18 17:18:33 +00:00
|
|
|
.settings(commons)
|
2022-12-28 08:30:42 +00:00
|
|
|
.dependsOn(`backend`.js, definitions.js)
|
|
|
|
|
|
|
|
lazy val `js-imports` = project
|
|
|
|
.in(file("js/js-imports"))
|
|
|
|
.enablePlugins(ScalaJSPlugin)
|
2023-07-18 17:18:33 +00:00
|
|
|
.settings(commons)
|
2022-12-28 08:30:42 +00:00
|
|
|
.dependsOn(`js-exports`, transform.js)
|
|
|
|
|
2023-06-07 12:07:14 +00:00
|
|
|
lazy val `aqua-api` = crossProject(JSPlatform, JVMPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
2023-06-22 11:59:56 +00:00
|
|
|
.in(file("api/api"))
|
2023-07-18 17:18:33 +00:00
|
|
|
.settings(commons)
|
2023-06-07 12:07:14 +00:00
|
|
|
.dependsOn(`aqua-run`, `backend-api`)
|
|
|
|
|
|
|
|
lazy val `aqua-apiJS` = `aqua-api`.js
|
2022-12-28 08:30:42 +00:00
|
|
|
.settings(
|
2023-09-15 13:42:04 +00:00
|
|
|
scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.ESModule)),
|
|
|
|
scalaJSUseMainModuleInitializer := true,
|
|
|
|
Test / test := {}
|
2022-12-28 08:30:42 +00:00
|
|
|
)
|
2023-09-18 07:53:25 +00:00
|
|
|
.settings(addBundleJS("../../api-npm/aqua-api.js"))
|
2023-06-07 12:07:14 +00:00
|
|
|
.enablePlugins(ScalaJSPlugin)
|
|
|
|
.dependsOn(`js-exports`)
|
2022-12-28 08:30:42 +00:00
|
|
|
|
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)
|
2023-07-18 17:18:33 +00:00
|
|
|
.settings(commons)
|
2021-04-06 16:01:25 +00:00
|
|
|
.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
|
|
|
)
|
|
|
|
)
|
2023-08-17 06:30:02 +00:00
|
|
|
.dependsOn(types, helpers)
|
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)
|
2023-07-18 17:18:33 +00:00
|
|
|
.settings(commons)
|
2021-04-13 13:05:31 +00:00
|
|
|
.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"))
|
2023-07-18 17:18:33 +00:00
|
|
|
.settings(commons)
|
2021-04-06 16:01:25 +00:00
|
|
|
.settings(
|
|
|
|
libraryDependencies ++= Seq(
|
2021-08-11 16:53:36 +00:00
|
|
|
"org.typelevel" %%% "cats-free" % catsV
|
2021-04-06 16:01:25 +00:00
|
|
|
)
|
|
|
|
)
|
2023-08-17 06:30:02 +00:00
|
|
|
.dependsOn(helpers)
|
2022-01-31 11:48:13 +00:00
|
|
|
|
|
|
|
lazy val raw = crossProject(JVMPlatform, JSPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
|
|
|
.in(file("model/raw"))
|
2023-07-18 17:18:33 +00:00
|
|
|
.settings(commons)
|
2022-01-31 11:48:13 +00:00
|
|
|
.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)
|
2023-07-18 17:18:33 +00:00
|
|
|
.settings(commons)
|
2023-09-19 15:01:42 +00:00
|
|
|
.dependsOn(types, tree, raw, helpers, errors)
|
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"))
|
2023-07-18 17:18:33 +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"))
|
2023-07-18 17:18:33 +00:00
|
|
|
.settings(commons)
|
2022-01-31 11:48:13 +00:00
|
|
|
.dependsOn(raw, model)
|
|
|
|
|
|
|
|
lazy val transform = crossProject(JVMPlatform, JSPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
|
|
|
.in(file("model/transform"))
|
2023-07-18 17:18:33 +00:00
|
|
|
.settings(commons)
|
2023-07-06 09:44:37 +00:00
|
|
|
.dependsOn(model, res, inline, res % "test->test")
|
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)
|
2023-07-18 17:18:33 +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
|
|
|
)
|
2023-09-19 15:01:42 +00:00
|
|
|
.dependsOn(raw, parser, errors)
|
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"))
|
2023-07-18 17:18:33 +00:00
|
|
|
.settings(commons)
|
2023-07-12 13:18:47 +00:00
|
|
|
.dependsOn(semantics, linker, backend, transform % "test->test", res % "test->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"))
|
2023-07-18 17:18:33 +00:00
|
|
|
.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"))
|
2023-07-18 17:18:33 +00:00
|
|
|
.settings(commons)
|
2022-12-28 08:30:42 +00:00
|
|
|
.settings(
|
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"io.circe" %%% "circe-core",
|
|
|
|
"io.circe" %%% "circe-generic",
|
|
|
|
"io.circe" %%% "circe-parser"
|
|
|
|
).map(_ % circeVersion)
|
2023-05-03 13:24:19 +00:00
|
|
|
)
|
|
|
|
.dependsOn(res, types)
|
2022-12-28 08:30:42 +00:00
|
|
|
|
|
|
|
lazy val logging = crossProject(JVMPlatform, JSPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
|
|
|
.in(file("utils/logging"))
|
2023-07-18 17:18:33 +00:00
|
|
|
.settings(commons)
|
2022-12-28 08:30:42 +00:00
|
|
|
.settings(
|
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"org.typelevel" %%% "cats-core" % catsV
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
lazy val constants = crossProject(JVMPlatform, JSPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
|
|
|
.in(file("utils/constants"))
|
2023-07-18 17:18:33 +00:00
|
|
|
.settings(commons)
|
2022-12-28 08:30:42 +00:00
|
|
|
.settings(
|
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"org.typelevel" %%% "cats-core" % catsV
|
|
|
|
)
|
2023-05-03 13:24:19 +00:00
|
|
|
)
|
|
|
|
.dependsOn(parser, raw)
|
2021-06-25 07:25:27 +00:00
|
|
|
|
2023-08-17 06:30:02 +00:00
|
|
|
lazy val helpers = crossProject(JVMPlatform, JSPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
|
|
|
.in(file("utils/helpers"))
|
|
|
|
.settings(commons)
|
|
|
|
.settings(
|
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"org.typelevel" %%% "cats-core" % catsV,
|
|
|
|
"org.typelevel" %%% "cats-free" % catsV
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2023-09-19 15:01:42 +00:00
|
|
|
lazy val errors = crossProject(JVMPlatform, JSPlatform)
|
|
|
|
.withoutSuffixFor(JVMPlatform)
|
|
|
|
.crossType(CrossType.Pure)
|
|
|
|
.in(file("utils/errors"))
|
|
|
|
.settings(commons)
|
|
|
|
.settings(
|
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"com.lihaoyi" %%% "sourcecode" % sourcecodeV
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
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"))
|
2023-07-18 17:18:33 +00:00
|
|
|
.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"))
|
2023-07-18 17:18:33 +00:00
|
|
|
.settings(commons)
|
2022-12-28 08:30:42 +00:00
|
|
|
.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"))
|
2023-07-18 17:18:33 +00:00
|
|
|
.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)
|