2021-11-23 11:51:17 +03:00
|
|
|
import LibraryManifestGenerator.BundledLibrary
|
2019-09-10 19:53:23 +03:00
|
|
|
import org.enso.build.BenchTasks._
|
|
|
|
import org.enso.build.WithDebugCommand
|
2022-09-20 18:50:27 +03:00
|
|
|
import org.apache.commons.io.FileUtils
|
2020-08-10 13:14:39 +03:00
|
|
|
import sbt.Keys.{libraryDependencies, scalacOptions}
|
2020-03-20 11:01:03 +03:00
|
|
|
import sbt.addCompilerPlugin
|
2022-05-11 13:12:18 +03:00
|
|
|
import sbt.complete.DefaultParsers._
|
|
|
|
import sbt.complete.Parser
|
2022-09-20 18:50:27 +03:00
|
|
|
import sbt.nio.file.FileTreeView
|
2022-11-23 17:30:48 +03:00
|
|
|
import sbt.internal.util.ManagedLogger
|
2022-10-24 12:55:18 +03:00
|
|
|
import src.main.scala.licenses.{
|
|
|
|
DistributionDescription,
|
|
|
|
SBTDistributionComponent
|
|
|
|
}
|
2020-03-24 13:28:03 +03:00
|
|
|
|
2021-02-22 16:32:55 +03:00
|
|
|
import java.io.File
|
2022-05-11 13:12:18 +03:00
|
|
|
|
2020-04-30 22:30:55 +03:00
|
|
|
// ============================================================================
|
|
|
|
// === Global Configuration ===================================================
|
|
|
|
// ============================================================================
|
2019-06-07 14:49:47 +03:00
|
|
|
|
2022-09-13 12:51:08 +03:00
|
|
|
val scalacVersion = "2.13.8"
|
2023-02-14 18:51:17 +03:00
|
|
|
val graalVersion = "22.3.1"
|
2022-09-13 12:51:08 +03:00
|
|
|
val javaVersion = "11"
|
2022-02-07 17:14:32 +03:00
|
|
|
val defaultDevEnsoVersion = "0.0.0-dev"
|
|
|
|
val ensoVersion = sys.env.getOrElse(
|
|
|
|
"ENSO_VERSION",
|
|
|
|
defaultDevEnsoVersion
|
|
|
|
) // Note [Engine And Launcher Version]
|
|
|
|
val currentEdition = sys.env.getOrElse(
|
|
|
|
"ENSO_EDITION",
|
|
|
|
defaultDevEnsoVersion
|
|
|
|
) // Note [Default Editions]
|
|
|
|
|
|
|
|
// Note [Stdlib Version]
|
|
|
|
val stdLibVersion = defaultDevEnsoVersion
|
|
|
|
val targetStdlibVersion = ensoVersion
|
2020-08-07 12:18:09 +03:00
|
|
|
|
|
|
|
/* Note [Engine And Launcher Version]
|
|
|
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
* Currently both Engine and Launcher versions are tied to each other - each new
|
|
|
|
* releases contains the Engine and the Launcher and thus the version number is
|
2021-01-05 17:14:08 +03:00
|
|
|
* shared. If the version numbers ever diverge, make sure to update the build
|
2020-08-07 12:18:09 +03:00
|
|
|
* scripts at .github/workflows accordingly.
|
|
|
|
*/
|
|
|
|
|
2021-07-08 16:38:20 +03:00
|
|
|
/* Note [Default Editions]
|
|
|
|
* ~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
* Currently, the default edition to use is inferred based on the engine
|
|
|
|
* version. Each Enso version has an associated default edition name and the
|
|
|
|
* `currentEdition` field specifies the default edition name for the upcoming
|
|
|
|
* release.
|
|
|
|
*
|
|
|
|
* Thus the `library-manager` needs to depend on the `version-output` to get
|
|
|
|
* this defaults from the build metadata.
|
|
|
|
*
|
|
|
|
* In the future we may automate generating this edition number when cutting a
|
|
|
|
* release.
|
|
|
|
*/
|
|
|
|
|
2022-02-07 17:14:32 +03:00
|
|
|
/* Note [Stdlib Version]
|
|
|
|
* ~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
* The `stdlibVersion` variable stores the version at which standard library is
|
|
|
|
* stored within the source tree, which is currently set to a constant of
|
|
|
|
* `0.0.0-dev`.
|
|
|
|
*
|
|
|
|
* When distributions are built, the library versions are updated to match the
|
|
|
|
* current Enso version.
|
|
|
|
*/
|
|
|
|
|
2021-05-14 15:08:39 +03:00
|
|
|
ThisBuild / organization := "org.enso"
|
|
|
|
ThisBuild / scalaVersion := scalacVersion
|
2020-10-09 17:19:58 +03:00
|
|
|
|
2022-07-01 04:58:14 +03:00
|
|
|
/* Tag limiting the concurrent access to tools/simple-library-server in tests.
|
|
|
|
*/
|
|
|
|
val simpleLibraryServerTag = Tags.Tag("simple-library-server")
|
|
|
|
Global / concurrentRestrictions += Tags.limit(simpleLibraryServerTag, 1)
|
|
|
|
|
2020-10-09 17:19:58 +03:00
|
|
|
lazy val gatherLicenses =
|
|
|
|
taskKey[Unit]("Gathers licensing information for relevant dependencies")
|
2020-10-22 17:12:28 +03:00
|
|
|
gatherLicenses := {
|
2021-02-22 16:32:55 +03:00
|
|
|
val _ = GatherLicenses.run.value
|
2020-10-22 17:12:28 +03:00
|
|
|
}
|
2020-10-19 11:50:12 +03:00
|
|
|
lazy val verifyLicensePackages =
|
|
|
|
taskKey[Unit](
|
|
|
|
"Verifies if the license package has been generated, " +
|
|
|
|
"has no warnings and is up-to-date with dependencies."
|
|
|
|
)
|
|
|
|
verifyLicensePackages := GatherLicenses.verifyReports.value
|
2020-12-09 16:58:11 +03:00
|
|
|
lazy val verifyGeneratedPackage =
|
|
|
|
inputKey[Unit](
|
|
|
|
"Verifies if the license package in a generated distribution is " +
|
|
|
|
"up-to-date with the one from the report."
|
|
|
|
)
|
|
|
|
verifyGeneratedPackage := GatherLicenses.verifyGeneratedPackage.evaluated
|
|
|
|
|
2021-07-08 16:38:20 +03:00
|
|
|
def makeStdLibDistribution(
|
|
|
|
name: String,
|
|
|
|
components: Seq[SBTDistributionComponent]
|
|
|
|
): DistributionDescription =
|
|
|
|
Distribution(
|
|
|
|
name,
|
|
|
|
file(s"distribution/lib/Standard/$name/$stdLibVersion/THIRD-PARTY"),
|
|
|
|
components
|
|
|
|
)
|
|
|
|
|
2020-10-09 17:19:58 +03:00
|
|
|
GatherLicenses.distributions := Seq(
|
2020-10-22 17:12:28 +03:00
|
|
|
Distribution(
|
|
|
|
"launcher",
|
|
|
|
file("distribution/launcher/THIRD-PARTY"),
|
|
|
|
Distribution.sbtProjects(launcher)
|
|
|
|
),
|
|
|
|
Distribution(
|
|
|
|
"engine",
|
|
|
|
file("distribution/engine/THIRD-PARTY"),
|
|
|
|
Distribution.sbtProjects(
|
|
|
|
runtime,
|
|
|
|
`engine-runner`,
|
|
|
|
`language-server`
|
2020-10-09 17:19:58 +03:00
|
|
|
)
|
2020-10-22 17:12:28 +03:00
|
|
|
),
|
2020-12-09 16:58:11 +03:00
|
|
|
Distribution(
|
|
|
|
"project-manager",
|
|
|
|
file("distribution/project-manager/THIRD-PARTY"),
|
|
|
|
Distribution.sbtProjects(`project-manager`)
|
|
|
|
),
|
2021-07-08 16:38:20 +03:00
|
|
|
makeStdLibDistribution("Base", Distribution.sbtProjects(`std-base`)),
|
2021-09-03 22:41:12 +03:00
|
|
|
makeStdLibDistribution(
|
|
|
|
"Google_Api",
|
|
|
|
Distribution.sbtProjects(`std-google-api`)
|
|
|
|
),
|
2021-07-08 16:38:20 +03:00
|
|
|
makeStdLibDistribution("Table", Distribution.sbtProjects(`std-table`)),
|
|
|
|
makeStdLibDistribution("Database", Distribution.sbtProjects(`std-database`)),
|
|
|
|
makeStdLibDistribution("Image", Distribution.sbtProjects(`std-image`))
|
2020-10-22 17:12:28 +03:00
|
|
|
)
|
2021-07-08 16:38:20 +03:00
|
|
|
|
2020-10-09 17:19:58 +03:00
|
|
|
GatherLicenses.licenseConfigurations := Set("compile")
|
|
|
|
GatherLicenses.configurationRoot := file("tools/legal-review")
|
|
|
|
|
|
|
|
lazy val openLegalReviewReport =
|
|
|
|
taskKey[Unit](
|
|
|
|
"Gathers licensing information for relevant dependencies and opens the " +
|
|
|
|
"report in review mode in the browser."
|
|
|
|
)
|
|
|
|
openLegalReviewReport := {
|
2020-10-22 17:12:28 +03:00
|
|
|
val _ = gatherLicenses.value
|
2020-10-09 17:19:58 +03:00
|
|
|
GatherLicenses.runReportServer()
|
|
|
|
}
|
2019-09-12 17:47:25 +03:00
|
|
|
|
2020-10-19 11:50:12 +03:00
|
|
|
lazy val analyzeDependency = inputKey[Unit]("...")
|
|
|
|
analyzeDependency := GatherLicenses.analyzeDependency.evaluated
|
|
|
|
|
2021-01-15 18:26:51 +03:00
|
|
|
val packageBuilder = new DistributionPackage.Builder(
|
|
|
|
ensoVersion = ensoVersion,
|
|
|
|
graalVersion = graalVersion,
|
|
|
|
graalJavaVersion = javaVersion,
|
|
|
|
artifactRoot = file("built-distribution")
|
|
|
|
)
|
|
|
|
|
2019-10-29 17:32:50 +03:00
|
|
|
Global / onChangedBuildSource := ReloadOnSourceChanges
|
2022-06-01 16:50:46 +03:00
|
|
|
Global / excludeLintKeys += logManager
|
2019-10-29 17:32:50 +03:00
|
|
|
|
2020-04-30 22:30:55 +03:00
|
|
|
// ============================================================================
|
|
|
|
// === Compiler Options =======================================================
|
|
|
|
// ============================================================================
|
2019-09-12 17:47:25 +03:00
|
|
|
|
2021-05-14 15:08:39 +03:00
|
|
|
ThisBuild / javacOptions ++= Seq(
|
2022-07-01 04:58:14 +03:00
|
|
|
"-encoding", // Provide explicit encoding (the next line)
|
|
|
|
"UTF-8", // Specify character encoding used by Java source files
|
|
|
|
"-deprecation", // Shows a description of each use or override of a deprecated member or class
|
|
|
|
"-g", // Include debugging information
|
|
|
|
"-Xlint:unchecked" // Enable additional warnings
|
2020-10-22 17:12:28 +03:00
|
|
|
)
|
2019-11-05 02:22:49 +03:00
|
|
|
|
2021-05-14 15:08:39 +03:00
|
|
|
ThisBuild / scalacOptions ++= Seq(
|
2020-10-22 17:12:28 +03:00
|
|
|
"-deprecation", // Emit warning and location for usages of deprecated APIs.
|
|
|
|
"-encoding", // Provide explicit encoding (the next line)
|
|
|
|
"utf-8", // Specify character encoding used by Scala source files.
|
|
|
|
"-explaintypes", // Explain type errors in more detail.
|
|
|
|
"-feature", // Emit warning and location for usages of features that should be imported explicitly.
|
|
|
|
"-language:existentials", // Existential types (besides wildcard types) can be written and inferred
|
|
|
|
"-language:experimental.macros", // Allow macro definition (besides implementation and application)
|
|
|
|
"-language:higherKinds", // Allow higher-kinded types
|
|
|
|
"-language:implicitConversions", // Allow definition of implicit functions called views
|
|
|
|
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
|
2021-05-20 16:03:14 +03:00
|
|
|
"-Vimplicits", // Prints implicit resolution chains when no implicit can be found.
|
|
|
|
"-Vtype-diffs", // Prints type errors as coloured diffs between types.
|
2020-10-22 17:12:28 +03:00
|
|
|
"-Xcheckinit", // Wrap field accessors to throw an exception on uninitialized access.
|
2021-05-20 16:03:14 +03:00
|
|
|
"-Xfatal-warnings", // Make warnings fatal so they don't make it onto main (use @nowarn for local suppression)
|
2020-10-22 17:12:28 +03:00
|
|
|
"-Xlint:adapted-args", // Warn if an argument list is modified to match the receiver.
|
|
|
|
"-Xlint:constant", // Evaluation of a constant arithmetic expression results in an error.
|
|
|
|
"-Xlint:delayedinit-select", // Selecting member of DelayedInit.
|
|
|
|
"-Xlint:doc-detached", // A Scaladoc comment appears to be detached from its element.
|
|
|
|
"-Xlint:inaccessible", // Warn about inaccessible types in method signatures.
|
|
|
|
"-Xlint:infer-any", // Warn when a type argument is inferred to be `Any`.
|
|
|
|
"-Xlint:missing-interpolator", // A string literal appears to be missing an interpolator id.
|
|
|
|
"-Xlint:nullary-unit", // Warn when nullary methods return Unit.
|
|
|
|
"-Xlint:option-implicit", // Option.apply used implicit view.
|
|
|
|
"-Xlint:package-object-classes", // Class or object defined in package object.
|
|
|
|
"-Xlint:poly-implicit-overload", // Parameterized overloaded implicit methods are not visible as view bounds.
|
|
|
|
"-Xlint:private-shadow", // A private field (or class parameter) shadows a superclass field.
|
|
|
|
"-Xlint:stars-align", // Pattern sequence wildcard must align with sequence component.
|
|
|
|
"-Xlint:type-parameter-shadow", // A local type parameter shadows a type already in scope.
|
|
|
|
"-Xmacro-settings:-logging@org.enso", // Disable the debug logging globally.
|
|
|
|
"-Ywarn-dead-code", // Warn when dead code is identified.
|
|
|
|
"-Ywarn-extra-implicit", // Warn when more than one implicit parameter section is defined.
|
|
|
|
"-Ywarn-numeric-widen", // Warn when numerics are widened.
|
|
|
|
"-Ywarn-unused:implicits", // Warn if an implicit parameter is unused.
|
2021-05-20 16:03:14 +03:00
|
|
|
"-Ywarn-unused:imports", // Warn if an import selector is not referenced.
|
2020-10-22 17:12:28 +03:00
|
|
|
"-Ywarn-unused:locals", // Warn if a local definition is unused.
|
|
|
|
"-Ywarn-unused:params", // Warn if a value parameter is unused.
|
2021-05-20 16:03:14 +03:00
|
|
|
"-Ywarn-unused:patvars", // Warn if a variable bound in a pattern is unused.
|
|
|
|
"-Ywarn-unused:privates" // Warn if a private member is unused.
|
2020-10-22 17:12:28 +03:00
|
|
|
)
|
2020-04-30 22:30:55 +03:00
|
|
|
|
2022-10-07 05:36:07 +03:00
|
|
|
ThisBuild / Test / testOptions ++=
|
|
|
|
Seq(Tests.Argument("-oI")) ++
|
|
|
|
sys.env
|
|
|
|
.get("ENSO_TEST_JUNIT_DIR")
|
|
|
|
.map { junitDir =>
|
|
|
|
Tests.Argument(TestFrameworks.ScalaTest, "-u", junitDir)
|
|
|
|
}
|
2022-07-12 15:58:41 +03:00
|
|
|
|
2021-05-14 15:08:39 +03:00
|
|
|
Compile / console / scalacOptions ~= (_ filterNot (_ == "-Xfatal-warnings"))
|
2020-05-06 21:00:03 +03:00
|
|
|
|
2020-04-30 22:30:55 +03:00
|
|
|
// ============================================================================
|
|
|
|
// === Benchmark Configuration ================================================
|
|
|
|
// ============================================================================
|
2019-07-11 14:23:00 +03:00
|
|
|
|
2019-09-10 19:53:23 +03:00
|
|
|
lazy val Benchmark = config("bench") extend sbt.Test
|
|
|
|
|
|
|
|
// Native Image Generation
|
2020-12-09 16:58:11 +03:00
|
|
|
lazy val rebuildNativeImage = taskKey[Unit]("Force to rebuild native image")
|
2019-08-28 18:40:08 +03:00
|
|
|
lazy val buildNativeImage =
|
2020-12-09 16:58:11 +03:00
|
|
|
taskKey[Unit]("Ensure that the Native Image is built.")
|
2019-06-07 14:49:47 +03:00
|
|
|
|
2020-07-01 14:21:13 +03:00
|
|
|
// Bootstrap task
|
|
|
|
lazy val bootstrap =
|
|
|
|
taskKey[Unit]("Prepares Truffle JARs that are required by the sbt JVM")
|
|
|
|
bootstrap := {}
|
|
|
|
|
2020-04-30 22:30:55 +03:00
|
|
|
// ============================================================================
|
|
|
|
// === Global Project =========================================================
|
|
|
|
// ============================================================================
|
2019-09-12 17:47:25 +03:00
|
|
|
|
2019-06-13 12:49:04 +03:00
|
|
|
lazy val enso = (project in file("."))
|
2019-06-14 18:26:49 +03:00
|
|
|
.settings(version := "0.1")
|
2019-11-08 20:32:48 +03:00
|
|
|
.aggregate(
|
2020-06-29 17:36:44 +03:00
|
|
|
`interpreter-dsl`,
|
|
|
|
`json-rpc-server-test`,
|
|
|
|
`json-rpc-server`,
|
2020-04-24 19:33:27 +03:00
|
|
|
`language-server`,
|
|
|
|
`polyglot-api`,
|
2020-04-14 19:00:51 +03:00
|
|
|
`project-manager`,
|
2023-03-15 18:43:51 +03:00
|
|
|
`syntax-definition`,
|
2022-09-20 18:50:27 +03:00
|
|
|
`syntax-rust-definition`,
|
2020-04-24 19:33:27 +03:00
|
|
|
`text-buffer`,
|
2020-01-24 21:56:52 +03:00
|
|
|
graph,
|
2023-03-15 18:43:51 +03:00
|
|
|
logger,
|
2020-04-24 19:33:27 +03:00
|
|
|
pkg,
|
2020-07-22 20:28:03 +03:00
|
|
|
cli,
|
2021-07-17 17:49:51 +03:00
|
|
|
`task-progress-notifications`,
|
2022-05-10 15:44:05 +03:00
|
|
|
`profiling-utils`,
|
2021-05-12 18:31:53 +03:00
|
|
|
`logging-utils`,
|
2020-10-02 19:17:21 +03:00
|
|
|
`logging-service`,
|
2021-07-22 09:24:06 +03:00
|
|
|
`logging-truffle-connector`,
|
|
|
|
`locking-test-helper`,
|
2020-10-02 19:17:21 +03:00
|
|
|
`akka-native`,
|
2020-07-10 13:57:42 +03:00
|
|
|
`version-output`,
|
2020-10-09 17:19:58 +03:00
|
|
|
`engine-runner`,
|
2020-04-24 19:33:27 +03:00
|
|
|
runtime,
|
2020-06-29 17:36:44 +03:00
|
|
|
searcher,
|
2020-07-10 13:57:42 +03:00
|
|
|
launcher,
|
2021-07-22 09:24:06 +03:00
|
|
|
downloader,
|
2022-06-13 17:09:08 +03:00
|
|
|
`runtime-language-epb`,
|
|
|
|
`runtime-instrument-id-execution`,
|
|
|
|
`runtime-instrument-repl-debugger`,
|
|
|
|
`runtime-instrument-runtime-server`,
|
|
|
|
`runtime-with-instruments`,
|
2023-01-03 17:36:26 +03:00
|
|
|
`runtime-with-polyglot`,
|
2020-10-30 14:31:31 +03:00
|
|
|
`runtime-version-manager`,
|
|
|
|
`runtime-version-manager-test`,
|
2021-07-13 14:08:00 +03:00
|
|
|
editions,
|
|
|
|
`distribution-manager`,
|
2021-07-22 09:24:06 +03:00
|
|
|
`edition-updater`,
|
2021-08-12 17:55:23 +03:00
|
|
|
`edition-uploader`,
|
2021-07-13 14:08:00 +03:00
|
|
|
`library-manager`,
|
2021-08-09 17:00:04 +03:00
|
|
|
`library-manager-test`,
|
2021-08-27 15:01:13 +03:00
|
|
|
`connected-lock-manager`,
|
2023-03-15 18:43:51 +03:00
|
|
|
syntax,
|
2022-05-25 12:26:50 +03:00
|
|
|
testkit,
|
|
|
|
`std-base`,
|
|
|
|
`std-database`,
|
|
|
|
`std-google-api`,
|
|
|
|
`std-image`,
|
2022-11-18 14:27:27 +03:00
|
|
|
`std-table`,
|
2023-02-17 16:38:26 +03:00
|
|
|
`simple-httpbin`,
|
|
|
|
`enso-test-java-helpers`
|
2019-11-08 20:32:48 +03:00
|
|
|
)
|
2019-09-12 17:47:25 +03:00
|
|
|
.settings(Global / concurrentRestrictions += Tags.exclusive(Exclusive))
|
2021-01-15 18:26:51 +03:00
|
|
|
.settings(
|
|
|
|
commands ++= Seq(packageBuilder.makePackages, packageBuilder.makeBundles)
|
|
|
|
)
|
2019-09-12 17:47:25 +03:00
|
|
|
|
2020-04-30 22:30:55 +03:00
|
|
|
// ============================================================================
|
|
|
|
// === Dependency Versions ====================================================
|
|
|
|
// ============================================================================
|
2019-09-12 17:47:25 +03:00
|
|
|
|
2020-04-30 22:30:55 +03:00
|
|
|
/* Note [Dependency Versions]
|
|
|
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
* Please maintain the following section in alphabetical order for the bundles
|
|
|
|
* of dependencies. Additionally, please keep the 'Other' subsection in
|
|
|
|
* alphabetical order.
|
|
|
|
*
|
|
|
|
* Furthermore, please keep the following in mind:
|
|
|
|
* - Wherever possible, we should use the same version of a dependency
|
|
|
|
* throughout the project.
|
|
|
|
* - If you need to include a new dependency, please define its version in this
|
|
|
|
* section.
|
|
|
|
* - If that version is not the latest, please include a note explaining why
|
|
|
|
* this is the case.
|
|
|
|
* - If, for some reason, you need to use a dependency version other than the
|
|
|
|
* global one, please include a note explaining why this is the case, and the
|
|
|
|
* circumstances under which the dependency could be upgraded to use the
|
|
|
|
* global version
|
|
|
|
*/
|
2020-04-24 19:33:27 +03:00
|
|
|
|
2020-04-30 22:30:55 +03:00
|
|
|
// === Akka ===================================================================
|
2020-02-13 17:33:39 +03:00
|
|
|
|
2020-07-03 15:02:27 +03:00
|
|
|
def akkaPkg(name: String) = akkaURL %% s"akka-$name" % akkaVersion
|
|
|
|
def akkaHTTPPkg(name: String) = akkaURL %% s"akka-$name" % akkaHTTPVersion
|
2020-04-30 22:30:55 +03:00
|
|
|
val akkaURL = "com.typesafe.akka"
|
2022-08-08 22:32:55 +03:00
|
|
|
val akkaVersion = "2.6.19"
|
|
|
|
val akkaHTTPVersion = "10.2.9"
|
2020-04-30 22:30:55 +03:00
|
|
|
val akkaMockSchedulerVersion = "0.5.5"
|
2022-08-08 22:32:55 +03:00
|
|
|
val logbackClassicVersion = "1.2.11"
|
2020-04-30 22:30:55 +03:00
|
|
|
val akkaActor = akkaPkg("actor")
|
|
|
|
val akkaStream = akkaPkg("stream")
|
|
|
|
val akkaTyped = akkaPkg("actor-typed")
|
|
|
|
val akkaTestkit = akkaPkg("testkit")
|
|
|
|
val akkaSLF4J = akkaPkg("slf4j")
|
|
|
|
val akkaTestkitTyped = akkaPkg("actor-testkit-typed") % Test
|
|
|
|
val akkaHttp = akkaHTTPPkg("http")
|
|
|
|
val akkaSpray = akkaHTTPPkg("http-spray-json")
|
2020-07-03 15:02:27 +03:00
|
|
|
val akkaTest = Seq(
|
|
|
|
"ch.qos.logback" % "logback-classic" % logbackClassicVersion % Test
|
|
|
|
)
|
2020-04-30 22:30:55 +03:00
|
|
|
val akka =
|
2020-07-01 14:21:13 +03:00
|
|
|
Seq(
|
|
|
|
akkaActor,
|
|
|
|
akkaStream,
|
|
|
|
akkaHttp,
|
|
|
|
akkaSpray,
|
|
|
|
akkaTyped
|
2020-11-16 20:49:59 +03:00
|
|
|
)
|
2020-04-30 22:30:55 +03:00
|
|
|
|
|
|
|
// === Cats ===================================================================
|
|
|
|
|
2022-08-08 22:32:55 +03:00
|
|
|
val catsVersion = "2.8.0"
|
2021-12-31 17:50:32 +03:00
|
|
|
val kittensVersion = "2.3.2"
|
2019-09-12 17:47:25 +03:00
|
|
|
val cats = {
|
|
|
|
Seq(
|
2020-02-13 17:33:39 +03:00
|
|
|
"org.typelevel" %% "cats-core" % catsVersion,
|
|
|
|
"org.typelevel" %% "cats-effect" % catsVersion,
|
|
|
|
"org.typelevel" %% "cats-free" % catsVersion,
|
|
|
|
"org.typelevel" %% "cats-macros" % catsVersion,
|
2020-04-30 22:30:55 +03:00
|
|
|
"org.typelevel" %% "kittens" % kittensVersion
|
2019-06-14 18:26:49 +03:00
|
|
|
)
|
2019-09-12 17:47:25 +03:00
|
|
|
}
|
|
|
|
|
2020-04-30 22:30:55 +03:00
|
|
|
// === Circe ==================================================================
|
2019-09-12 17:47:25 +03:00
|
|
|
|
2022-08-08 22:32:55 +03:00
|
|
|
val circeVersion = "0.14.2"
|
2021-12-31 17:50:32 +03:00
|
|
|
val circeYamlVersion = "0.14.1"
|
|
|
|
val enumeratumCirceVersion = "1.7.0"
|
2022-08-08 22:32:55 +03:00
|
|
|
val circeGenericExtrasVersion = "0.14.2"
|
2019-11-18 16:12:16 +03:00
|
|
|
val circe = Seq("circe-core", "circe-generic", "circe-parser")
|
|
|
|
.map("io.circe" %% _ % circeVersion)
|
2019-09-12 17:47:25 +03:00
|
|
|
|
2020-04-30 22:30:55 +03:00
|
|
|
// === Commons ================================================================
|
|
|
|
|
|
|
|
val commonsCollectionsVersion = "4.4"
|
2021-12-31 17:50:32 +03:00
|
|
|
val commonsLangVersion = "3.12.0"
|
|
|
|
val commonsIoVersion = "2.11.0"
|
2020-04-30 22:30:55 +03:00
|
|
|
val commonsTextVersion = "1.8"
|
|
|
|
val commonsMathVersion = "3.6.1"
|
2021-12-31 17:50:32 +03:00
|
|
|
val commonsCompressVersion = "1.21"
|
|
|
|
val commonsCliVersion = "1.5.0"
|
2020-04-30 22:30:55 +03:00
|
|
|
val commons = Seq(
|
|
|
|
"org.apache.commons" % "commons-collections4" % commonsCollectionsVersion,
|
|
|
|
"org.apache.commons" % "commons-lang3" % commonsLangVersion,
|
|
|
|
"commons-io" % "commons-io" % commonsIoVersion,
|
|
|
|
"org.apache.commons" % "commons-text" % commonsTextVersion,
|
|
|
|
"org.apache.commons" % "commons-math3" % commonsMathVersion,
|
|
|
|
"commons-cli" % "commons-cli" % commonsCliVersion
|
|
|
|
)
|
|
|
|
|
|
|
|
// === Jackson ================================================================
|
2019-09-12 17:47:25 +03:00
|
|
|
|
2022-08-08 22:32:55 +03:00
|
|
|
val jacksonVersion = "2.13.3"
|
2020-04-30 22:30:55 +03:00
|
|
|
val jackson = Seq(
|
|
|
|
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-cbor" % jacksonVersion,
|
|
|
|
"com.fasterxml.jackson.core" % "jackson-databind" % jacksonVersion,
|
2020-06-24 20:02:42 +03:00
|
|
|
"com.fasterxml.jackson.module" %% "jackson-module-scala" % jacksonVersion
|
2020-04-30 22:30:55 +03:00
|
|
|
)
|
|
|
|
|
2020-07-01 14:21:13 +03:00
|
|
|
// === JAXB ================================================================
|
|
|
|
|
2022-08-08 22:32:55 +03:00
|
|
|
val jaxbVersion = "4.0.0"
|
2020-07-01 14:21:13 +03:00
|
|
|
val jaxb = Seq(
|
|
|
|
"jakarta.xml.bind" % "jakarta.xml.bind-api" % jaxbVersion % Benchmark,
|
|
|
|
"com.sun.xml.bind" % "jaxb-impl" % jaxbVersion % Benchmark
|
|
|
|
)
|
|
|
|
|
2020-04-30 22:30:55 +03:00
|
|
|
// === JMH ====================================================================
|
2019-09-12 17:47:25 +03:00
|
|
|
|
2022-08-08 22:32:55 +03:00
|
|
|
val jmhVersion = "1.35"
|
2019-09-12 17:47:25 +03:00
|
|
|
val jmh = Seq(
|
2020-04-30 22:30:55 +03:00
|
|
|
"org.openjdk.jmh" % "jmh-core" % jmhVersion % Benchmark,
|
|
|
|
"org.openjdk.jmh" % "jmh-generator-annprocess" % jmhVersion % Benchmark
|
2019-09-12 17:47:25 +03:00
|
|
|
)
|
2019-06-07 14:49:47 +03:00
|
|
|
|
2020-04-30 22:30:55 +03:00
|
|
|
// === Monocle ================================================================
|
2019-11-18 14:18:16 +03:00
|
|
|
|
2021-12-31 17:50:32 +03:00
|
|
|
val monocleVersion = "2.1.0"
|
2020-04-30 22:30:55 +03:00
|
|
|
val monocle = {
|
|
|
|
Seq(
|
|
|
|
"com.github.julien-truffaut" %% "monocle-core" % monocleVersion,
|
|
|
|
"com.github.julien-truffaut" %% "monocle-macro" % monocleVersion,
|
|
|
|
"com.github.julien-truffaut" %% "monocle-law" % monocleVersion % "test"
|
|
|
|
)
|
|
|
|
}
|
2019-09-12 17:47:25 +03:00
|
|
|
|
2020-04-30 22:30:55 +03:00
|
|
|
// === Scala Compiler =========================================================
|
|
|
|
|
|
|
|
val scalaCompiler = Seq(
|
|
|
|
"org.scala-lang" % "scala-reflect" % scalacVersion,
|
|
|
|
"org.scala-lang" % "scala-compiler" % scalacVersion
|
|
|
|
)
|
|
|
|
|
2020-10-09 17:19:58 +03:00
|
|
|
// === std-lib ================================================================
|
|
|
|
|
2022-08-08 22:32:55 +03:00
|
|
|
val icuVersion = "71.1"
|
2020-10-09 17:19:58 +03:00
|
|
|
|
2020-04-30 22:30:55 +03:00
|
|
|
// === ZIO ====================================================================
|
|
|
|
|
2021-12-31 17:50:32 +03:00
|
|
|
val zioVersion = "1.0.12"
|
|
|
|
val zioInteropCatsVersion = "3.2.9.0"
|
2020-04-30 22:30:55 +03:00
|
|
|
val zio = Seq(
|
|
|
|
"dev.zio" %% "zio" % zioVersion,
|
|
|
|
"dev.zio" %% "zio-interop-cats" % zioInteropCatsVersion
|
|
|
|
)
|
|
|
|
|
|
|
|
// === Other ==================================================================
|
|
|
|
|
2021-12-31 17:50:32 +03:00
|
|
|
val bcpkixJdk15Version = "1.70"
|
2020-08-10 13:14:39 +03:00
|
|
|
val bumpVersion = "0.1.3"
|
2022-08-08 22:32:55 +03:00
|
|
|
val declineVersion = "2.3.0"
|
2020-08-07 12:18:09 +03:00
|
|
|
val directoryWatcherVersion = "0.9.10"
|
|
|
|
val flatbuffersVersion = "1.12.0"
|
2022-08-08 22:32:55 +03:00
|
|
|
val guavaVersion = "31.1-jre"
|
2021-12-31 17:50:32 +03:00
|
|
|
val jlineVersion = "3.21.0"
|
2022-11-14 20:32:39 +03:00
|
|
|
val jgitVersion = "6.3.0.202209071007-r"
|
|
|
|
val diffsonVersion = "4.1.1"
|
2021-12-31 17:50:32 +03:00
|
|
|
val kindProjectorVersion = "0.13.2"
|
2022-08-08 22:32:55 +03:00
|
|
|
val mockitoScalaVersion = "1.17.12"
|
2020-08-07 12:18:09 +03:00
|
|
|
val newtypeVersion = "0.4.4"
|
2022-08-08 22:32:55 +03:00
|
|
|
val pprintVersion = "0.7.3"
|
2021-12-31 17:50:32 +03:00
|
|
|
val pureconfigVersion = "0.17.1"
|
2022-08-08 22:32:55 +03:00
|
|
|
val scalacheckVersion = "1.16.0"
|
2021-12-31 17:50:32 +03:00
|
|
|
val scalacticVersion = "3.3.0-SNAP3"
|
|
|
|
val scalaLoggingVersion = "3.9.4"
|
2020-08-07 12:18:09 +03:00
|
|
|
val scalameterVersion = "0.19"
|
2021-12-31 17:50:32 +03:00
|
|
|
val scalatestVersion = "3.3.0-SNAP3"
|
2020-08-07 12:18:09 +03:00
|
|
|
val shapelessVersion = "2.4.0-M1"
|
2022-08-08 22:32:55 +03:00
|
|
|
val slf4jVersion = "1.7.36"
|
2021-12-31 17:50:32 +03:00
|
|
|
val slickVersion = "3.3.3"
|
|
|
|
val sqliteVersion = "3.36.0.3"
|
2022-08-08 22:32:55 +03:00
|
|
|
val tikaVersion = "2.4.1"
|
|
|
|
val typesafeConfigVersion = "1.4.2"
|
|
|
|
val junitVersion = "4.13.2"
|
|
|
|
val netbeansApiVersion = "RELEASE140"
|
2020-04-30 22:30:55 +03:00
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// === Internal Libraries =====================================================
|
|
|
|
// ============================================================================
|
|
|
|
|
2023-03-15 18:43:51 +03:00
|
|
|
lazy val logger = (project in file("lib/scala/logger"))
|
2019-06-07 14:39:30 +03:00
|
|
|
.settings(
|
2023-01-31 11:40:04 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2019-09-12 17:47:25 +03:00
|
|
|
version := "0.1",
|
2020-04-30 22:30:55 +03:00
|
|
|
libraryDependencies ++= scalaCompiler
|
2019-06-14 18:26:49 +03:00
|
|
|
)
|
2019-09-12 17:47:25 +03:00
|
|
|
|
2023-03-15 18:43:51 +03:00
|
|
|
lazy val `syntax-definition` =
|
|
|
|
(project in file("lib/scala/syntax/definition"))
|
|
|
|
.dependsOn(logger)
|
|
|
|
.settings(
|
|
|
|
scalacOptions ++= Seq("-Ypatmat-exhaust-depth", "off"),
|
|
|
|
libraryDependencies ++= monocle ++ scalaCompiler ++ Seq(
|
|
|
|
"org.typelevel" %% "cats-core" % catsVersion,
|
|
|
|
"org.typelevel" %% "kittens" % kittensVersion
|
|
|
|
)
|
2020-10-22 17:12:28 +03:00
|
|
|
)
|
2019-09-12 17:47:25 +03:00
|
|
|
|
2023-03-15 18:43:51 +03:00
|
|
|
lazy val syntax = (project in file("lib/scala/syntax/specialization"))
|
|
|
|
.dependsOn(`syntax-definition`)
|
2019-06-14 18:26:49 +03:00
|
|
|
.settings(
|
2020-10-15 17:52:26 +03:00
|
|
|
commands += WithDebugCommand.withDebug,
|
2019-11-26 16:02:50 +03:00
|
|
|
testFrameworks := Nil,
|
2020-04-14 19:00:51 +03:00
|
|
|
scalacOptions ++= Seq("-Ypatmat-exhaust-depth", "off"),
|
2021-05-14 15:08:39 +03:00
|
|
|
Compile / run / mainClass := Some("org.enso.syntax.text.Main"),
|
2019-09-12 17:47:25 +03:00
|
|
|
version := "0.1",
|
|
|
|
logBuffered := false,
|
2019-11-26 16:02:50 +03:00
|
|
|
libraryDependencies ++= Seq(
|
2023-03-15 18:43:51 +03:00
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
|
|
|
|
"com.lihaoyi" %% "pprint" % pprintVersion,
|
|
|
|
"io.circe" %% "circe-core" % circeVersion,
|
|
|
|
"io.circe" %% "circe-generic" % circeVersion,
|
|
|
|
"io.circe" %% "circe-parser" % circeVersion
|
2020-10-22 17:12:28 +03:00
|
|
|
),
|
2020-07-01 14:21:13 +03:00
|
|
|
(Compile / compile) := (Compile / compile)
|
2020-10-22 17:12:28 +03:00
|
|
|
.dependsOn(RecompileParser.run(`syntax-definition`))
|
|
|
|
.value
|
2019-06-14 18:26:49 +03:00
|
|
|
)
|
2021-05-17 19:44:21 +03:00
|
|
|
|
2020-04-20 15:33:51 +03:00
|
|
|
lazy val `text-buffer` = project
|
2020-07-03 16:42:45 +03:00
|
|
|
.in(file("lib/scala/text-buffer"))
|
2020-04-20 15:33:51 +03:00
|
|
|
.configs(Test)
|
|
|
|
.settings(
|
2023-01-31 11:40:04 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2020-04-20 15:33:51 +03:00
|
|
|
libraryDependencies ++= Seq(
|
2020-11-10 14:50:37 +03:00
|
|
|
"org.typelevel" %% "cats-core" % catsVersion,
|
|
|
|
"org.bouncycastle" % "bcpkix-jdk15on" % bcpkixJdk15Version,
|
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
|
|
|
|
"org.scalacheck" %% "scalacheck" % scalacheckVersion % Test
|
2020-10-22 17:12:28 +03:00
|
|
|
)
|
2020-04-20 15:33:51 +03:00
|
|
|
)
|
|
|
|
|
2022-11-09 18:26:25 +03:00
|
|
|
lazy val rustParserTargetDirectory =
|
|
|
|
SettingKey[File]("target directory for the Rust parser")
|
|
|
|
|
|
|
|
(`syntax-rust-definition` / rustParserTargetDirectory) := {
|
|
|
|
// setting "debug" for release, because it isn't yet safely integrated into
|
|
|
|
// the parser definition
|
|
|
|
val versionName = if (BuildInfo.isReleaseMode) "debug" else "debug"
|
|
|
|
target.value / "rust" / versionName
|
|
|
|
}
|
|
|
|
|
2022-10-24 12:55:18 +03:00
|
|
|
val generateRustParserLib =
|
|
|
|
TaskKey[Seq[File]]("generateRustParserLib", "Generates parser native library")
|
2022-09-20 18:50:27 +03:00
|
|
|
`syntax-rust-definition` / generateRustParserLib := {
|
2023-02-08 13:46:40 +03:00
|
|
|
val log = state.value.log
|
2022-11-09 18:26:25 +03:00
|
|
|
val libGlob =
|
|
|
|
(`syntax-rust-definition` / rustParserTargetDirectory).value.toGlob / "libenso_parser.so"
|
|
|
|
|
2022-10-24 12:55:18 +03:00
|
|
|
val allLibs = FileTreeView.default.list(Seq(libGlob)).map(_._1)
|
|
|
|
if (
|
|
|
|
sys.env.get("CI").isDefined ||
|
|
|
|
allLibs.isEmpty ||
|
|
|
|
(`syntax-rust-definition` / generateRustParserLib).inputFileChanges.hasChanges
|
|
|
|
) {
|
2022-11-02 20:13:53 +03:00
|
|
|
val os = System.getProperty("os.name")
|
2023-02-08 13:46:40 +03:00
|
|
|
val baseArguments = Seq(
|
2022-11-09 18:26:25 +03:00
|
|
|
"build",
|
|
|
|
"-p",
|
|
|
|
"enso-parser-jni",
|
|
|
|
"-Z",
|
|
|
|
"unstable-options",
|
|
|
|
"--out-dir",
|
|
|
|
(`syntax-rust-definition` / rustParserTargetDirectory).value.toString
|
|
|
|
)
|
2023-02-08 13:46:40 +03:00
|
|
|
val adjustedArguments = baseArguments ++
|
2022-11-09 18:26:25 +03:00
|
|
|
(if (BuildInfo.isReleaseMode)
|
|
|
|
Seq("--release")
|
|
|
|
else Seq())
|
2023-02-08 13:46:40 +03:00
|
|
|
Cargo.run(adjustedArguments, log)
|
2022-10-24 12:55:18 +03:00
|
|
|
}
|
|
|
|
FileTreeView.default.list(Seq(libGlob)).map(_._1.toFile)
|
2022-09-20 18:50:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
`syntax-rust-definition` / generateRustParserLib / fileInputs +=
|
2022-10-24 12:55:18 +03:00
|
|
|
(`syntax-rust-definition` / baseDirectory).value.toGlob / "jni" / "src" / "*.rs"
|
2022-09-20 18:50:27 +03:00
|
|
|
|
2022-10-24 12:55:18 +03:00
|
|
|
val generateParserJavaSources = TaskKey[Seq[File]](
|
|
|
|
"generateParserJavaSources",
|
|
|
|
"Generates Java sources for Rust parser"
|
|
|
|
)
|
2022-09-20 18:50:27 +03:00
|
|
|
`syntax-rust-definition` / generateParserJavaSources := {
|
2022-10-06 03:49:41 +03:00
|
|
|
generateRustParser(
|
|
|
|
(`syntax-rust-definition` / Compile / sourceManaged).value,
|
2023-02-08 13:46:40 +03:00
|
|
|
(`syntax-rust-definition` / generateParserJavaSources).inputFileChanges,
|
|
|
|
state.value.log
|
2022-10-24 12:55:18 +03:00
|
|
|
)
|
2022-09-20 18:50:27 +03:00
|
|
|
}
|
|
|
|
`syntax-rust-definition` / generateParserJavaSources / fileInputs +=
|
2022-10-24 12:55:18 +03:00
|
|
|
(`syntax-rust-definition` / baseDirectory).value.toGlob / "generate-java" / "src" / ** / "*.rs"
|
2022-10-15 10:06:20 +03:00
|
|
|
`syntax-rust-definition` / generateParserJavaSources / fileInputs +=
|
|
|
|
(`syntax-rust-definition` / baseDirectory).value.toGlob / "src" / ** / "*.rs"
|
2022-09-20 18:50:27 +03:00
|
|
|
|
2023-02-17 16:38:26 +03:00
|
|
|
def generateRustParser(
|
|
|
|
base: File,
|
|
|
|
changes: sbt.nio.FileChanges,
|
|
|
|
log: ManagedLogger
|
|
|
|
): Seq[File] = {
|
2022-09-20 18:50:27 +03:00
|
|
|
import scala.jdk.CollectionConverters._
|
|
|
|
import java.nio.file.Paths
|
|
|
|
|
|
|
|
val syntaxPkgs = Paths.get("org", "enso", "syntax2").toString
|
2022-10-24 12:55:18 +03:00
|
|
|
val fullPkg = Paths.get(base.toString, syntaxPkgs).toFile
|
2022-09-20 18:50:27 +03:00
|
|
|
if (!fullPkg.exists()) {
|
|
|
|
fullPkg.mkdirs()
|
|
|
|
}
|
|
|
|
if (changes.hasChanges) {
|
2023-02-08 13:46:40 +03:00
|
|
|
val args = Seq(
|
2022-10-24 12:55:18 +03:00
|
|
|
"run",
|
|
|
|
"-p",
|
|
|
|
"enso-parser-generate-java",
|
|
|
|
"--bin",
|
|
|
|
"enso-parser-generate-java",
|
|
|
|
fullPkg.toString
|
2023-02-08 13:46:40 +03:00
|
|
|
)
|
|
|
|
Cargo.run(args, log)
|
2022-09-20 18:50:27 +03:00
|
|
|
}
|
|
|
|
FileUtils.listFiles(fullPkg, Array("scala", "java"), true).asScala.toSeq
|
|
|
|
}
|
|
|
|
|
|
|
|
lazy val `syntax-rust-definition` = project
|
|
|
|
.in(file("lib/rust/parser"))
|
|
|
|
.configs(Test)
|
|
|
|
.settings(
|
|
|
|
Compile / sourceGenerators += generateParserJavaSources,
|
|
|
|
Compile / resourceGenerators += generateRustParserLib,
|
|
|
|
Compile / javaSource := baseDirectory.value / "generate-java" / "java",
|
2022-10-24 12:55:18 +03:00
|
|
|
frgaalJavaCompilerSetting
|
2022-09-20 18:50:27 +03:00
|
|
|
)
|
|
|
|
|
2020-07-03 16:42:45 +03:00
|
|
|
lazy val graph = (project in file("lib/scala/graph/"))
|
2023-03-15 18:43:51 +03:00
|
|
|
.dependsOn(logger)
|
2019-11-26 16:02:50 +03:00
|
|
|
.configs(Test)
|
|
|
|
.settings(
|
2023-01-31 11:40:04 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2019-11-26 16:02:50 +03:00
|
|
|
version := "0.1",
|
2022-08-08 22:32:55 +03:00
|
|
|
resolvers ++= (
|
|
|
|
Resolver.sonatypeOssRepos("releases") ++
|
|
|
|
Resolver.sonatypeOssRepos("snapshots")
|
2020-10-22 17:12:28 +03:00
|
|
|
),
|
2020-02-13 17:33:39 +03:00
|
|
|
scalacOptions += "-Ymacro-annotations",
|
2020-04-30 22:30:55 +03:00
|
|
|
libraryDependencies ++= scalaCompiler ++ Seq(
|
2020-10-22 17:12:28 +03:00
|
|
|
"com.chuusai" %% "shapeless" % shapelessVersion,
|
|
|
|
"io.estatico" %% "newtype" % newtypeVersion,
|
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
|
|
|
|
"org.scalacheck" %% "scalacheck" % scalacheckVersion % Test,
|
|
|
|
"com.github.julien-truffaut" %% "monocle-core" % monocleVersion,
|
|
|
|
"org.apache.commons" % "commons-lang3" % commonsLangVersion
|
|
|
|
),
|
2020-04-30 22:30:55 +03:00
|
|
|
addCompilerPlugin(
|
|
|
|
"org.typelevel" %% "kind-projector" % kindProjectorVersion cross CrossVersion.full
|
2021-05-20 16:03:14 +03:00
|
|
|
)
|
2019-11-26 16:02:50 +03:00
|
|
|
)
|
|
|
|
|
2020-07-03 16:42:45 +03:00
|
|
|
lazy val pkg = (project in file("lib/scala/pkg"))
|
2019-06-13 12:49:04 +03:00
|
|
|
.settings(
|
2021-05-14 15:08:39 +03:00
|
|
|
Compile / run / mainClass := Some("org.enso.pkg.Main"),
|
2019-09-12 17:47:25 +03:00
|
|
|
version := "0.1",
|
2019-11-18 16:12:16 +03:00
|
|
|
libraryDependencies ++= circe ++ Seq(
|
2020-10-22 17:12:28 +03:00
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
|
|
|
|
"io.circe" %% "circe-yaml" % circeYamlVersion, // separate from other circe deps because its independent project with its own versioning
|
|
|
|
"commons-io" % "commons-io" % commonsIoVersion
|
|
|
|
)
|
2019-06-13 12:49:04 +03:00
|
|
|
)
|
2021-06-18 17:39:45 +03:00
|
|
|
.dependsOn(editions)
|
2020-07-10 13:57:42 +03:00
|
|
|
|
2020-10-02 19:17:21 +03:00
|
|
|
lazy val `akka-native` = project
|
|
|
|
.in(file("lib/scala/akka-native"))
|
|
|
|
.configs(Test)
|
|
|
|
.settings(
|
2023-01-31 11:40:04 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2020-10-02 19:17:21 +03:00
|
|
|
version := "0.1",
|
|
|
|
libraryDependencies ++= Seq(
|
2020-10-22 17:12:28 +03:00
|
|
|
akkaActor
|
|
|
|
),
|
2020-10-02 19:17:21 +03:00
|
|
|
// Note [Native Image Workaround for GraalVM 20.2]
|
|
|
|
libraryDependencies += "org.graalvm.nativeimage" % "svm" % graalVersion % "provided"
|
|
|
|
)
|
|
|
|
|
2022-05-10 15:44:05 +03:00
|
|
|
lazy val `profiling-utils` = project
|
|
|
|
.in(file("lib/scala/profiling-utils"))
|
|
|
|
.configs(Test)
|
|
|
|
.settings(
|
2023-01-31 11:40:04 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2022-05-10 15:44:05 +03:00
|
|
|
version := "0.1",
|
|
|
|
libraryDependencies ++= Seq(
|
2022-08-08 22:32:55 +03:00
|
|
|
"org.netbeans.api" % "org-netbeans-modules-sampler" % netbeansApiVersion
|
2022-05-10 15:44:05 +03:00
|
|
|
exclude ("org.netbeans.api", "org-openide-loaders")
|
|
|
|
exclude ("org.netbeans.api", "org-openide-nodes")
|
2022-09-13 12:51:08 +03:00
|
|
|
exclude ("org.netbeans.api", "org-netbeans-api-progress-nb")
|
|
|
|
exclude ("org.netbeans.api", "org-netbeans-api-progress")
|
|
|
|
exclude ("org.netbeans.api", "org-openide-util-lookup")
|
|
|
|
exclude ("org.netbeans.api", "org-openide-util")
|
|
|
|
exclude ("org.netbeans.api", "org-openide-dialogs")
|
2022-05-10 15:44:05 +03:00
|
|
|
exclude ("org.netbeans.api", "org-openide-filesystems")
|
|
|
|
exclude ("org.netbeans.api", "org-openide-util-ui")
|
|
|
|
exclude ("org.netbeans.api", "org-openide-awt")
|
|
|
|
exclude ("org.netbeans.api", "org-openide-modules")
|
|
|
|
exclude ("org.netbeans.api", "org-netbeans-api-annotations-common")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2021-05-12 18:31:53 +03:00
|
|
|
lazy val `logging-utils` = project
|
|
|
|
.in(file("lib/scala/logging-utils"))
|
|
|
|
.configs(Test)
|
|
|
|
.settings(
|
2023-01-31 11:40:04 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2021-05-12 18:31:53 +03:00
|
|
|
version := "0.1",
|
|
|
|
libraryDependencies ++= Seq(
|
2021-05-18 11:23:13 +03:00
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion % Test
|
2021-05-12 18:31:53 +03:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2020-10-02 19:17:21 +03:00
|
|
|
lazy val `logging-service` = project
|
|
|
|
.in(file("lib/scala/logging-service"))
|
|
|
|
.configs(Test)
|
|
|
|
.settings(
|
2023-02-20 14:27:16 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2020-10-02 19:17:21 +03:00
|
|
|
version := "0.1",
|
|
|
|
libraryDependencies ++= Seq(
|
2020-10-22 17:12:28 +03:00
|
|
|
"org.slf4j" % "slf4j-api" % slf4jVersion,
|
2021-05-19 11:02:32 +03:00
|
|
|
"com.typesafe" % "config" % typesafeConfigVersion,
|
2020-10-22 17:12:28 +03:00
|
|
|
"com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion,
|
|
|
|
akkaStream,
|
|
|
|
akkaHttp,
|
2023-03-15 18:43:51 +03:00
|
|
|
"io.circe" %% "circe-core" % circeVersion,
|
|
|
|
"io.circe" %% "circe-parser" % circeVersion,
|
2023-03-11 03:15:58 +03:00
|
|
|
"junit" % "junit" % junitVersion % Test,
|
|
|
|
"com.novocode" % "junit-interface" % "0.11" % Test exclude ("junit", "junit-dep"),
|
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
|
|
|
|
"org.graalvm.nativeimage" % "svm" % graalVersion % "provided"
|
2020-10-22 17:12:28 +03:00
|
|
|
)
|
2020-10-02 19:17:21 +03:00
|
|
|
)
|
|
|
|
.settings(
|
|
|
|
if (Platform.isWindows)
|
|
|
|
(Compile / unmanagedSourceDirectories) += (Compile / sourceDirectory).value / "java-windows"
|
|
|
|
else
|
|
|
|
(Compile / unmanagedSourceDirectories) += (Compile / sourceDirectory).value / "java-unix"
|
|
|
|
)
|
|
|
|
.dependsOn(`akka-native`)
|
2021-05-12 18:31:53 +03:00
|
|
|
.dependsOn(`logging-utils`)
|
2020-10-02 19:17:21 +03:00
|
|
|
|
2021-07-06 01:27:14 +03:00
|
|
|
lazy val `logging-truffle-connector` = project
|
|
|
|
.in(file("lib/scala/logging-truffle-connector"))
|
|
|
|
.settings(
|
2023-01-31 11:40:04 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2021-07-06 01:27:14 +03:00
|
|
|
version := "0.1",
|
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"org.slf4j" % "slf4j-api" % slf4jVersion,
|
|
|
|
"org.graalvm.truffle" % "truffle-api" % graalVersion % "provided"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.dependsOn(`logging-utils`)
|
|
|
|
.dependsOn(`polyglot-api`)
|
|
|
|
|
2020-07-22 20:28:03 +03:00
|
|
|
lazy val cli = project
|
|
|
|
.in(file("lib/scala/cli"))
|
|
|
|
.configs(Test)
|
|
|
|
.settings(
|
2023-01-31 11:40:04 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2020-07-22 20:28:03 +03:00
|
|
|
version := "0.1",
|
2021-07-22 09:24:06 +03:00
|
|
|
libraryDependencies ++= circe ++ Seq(
|
|
|
|
"com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion,
|
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
|
|
|
|
"org.typelevel" %% "cats-core" % catsVersion
|
2020-10-22 17:12:28 +03:00
|
|
|
),
|
2021-05-14 15:08:39 +03:00
|
|
|
Test / parallelExecution := false
|
2020-07-22 20:28:03 +03:00
|
|
|
)
|
|
|
|
|
2021-07-17 17:49:51 +03:00
|
|
|
lazy val `task-progress-notifications` = project
|
|
|
|
.in(file("lib/scala/task-progress-notifications"))
|
|
|
|
.configs(Test)
|
|
|
|
.settings(
|
|
|
|
version := "0.1",
|
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"com.beachape" %% "enumeratum-circe" % enumeratumCirceVersion,
|
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion % Test
|
|
|
|
),
|
|
|
|
Test / parallelExecution := false
|
|
|
|
)
|
|
|
|
.dependsOn(cli)
|
|
|
|
.dependsOn(`json-rpc-server`)
|
|
|
|
|
2020-07-10 13:57:42 +03:00
|
|
|
lazy val `version-output` = (project in file("lib/scala/version-output"))
|
|
|
|
.settings(
|
|
|
|
version := "0.1"
|
|
|
|
)
|
|
|
|
.settings(
|
2023-01-31 11:40:04 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2020-07-10 13:57:42 +03:00
|
|
|
Compile / sourceGenerators += Def.task {
|
2020-10-22 17:12:28 +03:00
|
|
|
val file = (Compile / sourceManaged).value / "buildinfo" / "Info.scala"
|
|
|
|
BuildInfo
|
|
|
|
.writeBuildInfoFile(
|
2022-02-15 18:34:33 +03:00
|
|
|
file = file,
|
|
|
|
log = state.value.log,
|
|
|
|
defaultDevEnsoVersion = defaultDevEnsoVersion,
|
|
|
|
ensoVersion = ensoVersion,
|
|
|
|
scalacVersion = scalacVersion,
|
|
|
|
graalVersion = graalVersion,
|
|
|
|
currentEdition = currentEdition
|
2020-10-22 17:12:28 +03:00
|
|
|
)
|
|
|
|
}.taskValue
|
2020-07-10 13:57:42 +03:00
|
|
|
)
|
2019-06-14 18:26:49 +03:00
|
|
|
|
2020-07-03 16:42:45 +03:00
|
|
|
lazy val `project-manager` = (project in file("lib/scala/project-manager"))
|
2019-11-18 14:18:16 +03:00
|
|
|
.settings(
|
2020-03-31 16:51:05 +03:00
|
|
|
(Compile / mainClass) := Some("org.enso.projectmanager.boot.ProjectManager")
|
2019-11-18 14:18:16 +03:00
|
|
|
)
|
|
|
|
.settings(
|
2023-01-31 11:40:04 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2020-03-31 16:51:05 +03:00
|
|
|
(Compile / run / fork) := true,
|
|
|
|
(Test / fork) := true,
|
|
|
|
(Compile / run / connectInput) := true,
|
2020-12-02 18:56:47 +03:00
|
|
|
libraryDependencies ++= akka ++ Seq(akkaTestkit % Test),
|
2020-03-18 13:41:55 +03:00
|
|
|
libraryDependencies ++= circe,
|
|
|
|
libraryDependencies ++= Seq(
|
2020-10-22 17:12:28 +03:00
|
|
|
"com.typesafe" % "config" % typesafeConfigVersion,
|
|
|
|
"com.github.pureconfig" %% "pureconfig" % pureconfigVersion,
|
|
|
|
"com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion,
|
|
|
|
"dev.zio" %% "zio" % zioVersion,
|
|
|
|
"dev.zio" %% "zio-interop-cats" % zioInteropCatsVersion,
|
|
|
|
"commons-cli" % "commons-cli" % commonsCliVersion,
|
|
|
|
"commons-io" % "commons-io" % commonsIoVersion,
|
2020-12-02 18:56:47 +03:00
|
|
|
"org.apache.commons" % "commons-lang3" % commonsLangVersion,
|
2020-10-22 17:12:28 +03:00
|
|
|
"com.beachape" %% "enumeratum-circe" % enumeratumCirceVersion,
|
|
|
|
"com.miguno.akka" %% "akka-mock-scheduler" % akkaMockSchedulerVersion % Test,
|
|
|
|
"org.mockito" %% "mockito-scala" % mockitoScalaVersion % Test
|
|
|
|
),
|
2020-03-24 15:03:43 +03:00
|
|
|
addCompilerPlugin(
|
2020-04-30 22:30:55 +03:00
|
|
|
"org.typelevel" %% "kind-projector" % kindProjectorVersion cross CrossVersion.full
|
2020-03-18 13:41:55 +03:00
|
|
|
)
|
2019-11-18 14:18:16 +03:00
|
|
|
)
|
2020-05-15 14:05:44 +03:00
|
|
|
.settings(
|
2021-05-14 15:08:39 +03:00
|
|
|
assembly / assemblyJarName := "project-manager.jar",
|
|
|
|
assembly / test := {},
|
|
|
|
assembly / assemblyOutputPath := file("project-manager.jar"),
|
|
|
|
assembly / assemblyMergeStrategy := {
|
2020-05-15 14:05:44 +03:00
|
|
|
case PathList("META-INF", file, xs @ _*) if file.endsWith(".DSA") =>
|
|
|
|
MergeStrategy.discard
|
|
|
|
case PathList("META-INF", file, xs @ _*) if file.endsWith(".SF") =>
|
|
|
|
MergeStrategy.discard
|
|
|
|
case PathList("META-INF", "MANIFEST.MF", xs @ _*) =>
|
|
|
|
MergeStrategy.discard
|
|
|
|
case "application.conf" => MergeStrategy.concat
|
|
|
|
case "reference.conf" => MergeStrategy.concat
|
|
|
|
case _ => MergeStrategy.first
|
|
|
|
},
|
2020-12-09 16:58:11 +03:00
|
|
|
(Test / test) := (Test / test).dependsOn(`engine-runner` / assembly).value,
|
|
|
|
rebuildNativeImage := NativeImage
|
|
|
|
.buildNativeImage(
|
|
|
|
"project-manager",
|
2021-05-20 16:03:14 +03:00
|
|
|
staticOnLinux = true,
|
|
|
|
initializeAtRuntime = Seq("scala.util.Random")
|
2020-12-09 16:58:11 +03:00
|
|
|
)
|
2021-01-14 13:46:01 +03:00
|
|
|
.dependsOn(VerifyReflectionSetup.run)
|
2022-11-23 17:30:48 +03:00
|
|
|
.dependsOn(installNativeImage)
|
2020-12-09 16:58:11 +03:00
|
|
|
.dependsOn(assembly)
|
|
|
|
.value,
|
|
|
|
buildNativeImage := NativeImage
|
|
|
|
.incrementalNativeImageBuild(
|
|
|
|
rebuildNativeImage,
|
|
|
|
"project-manager"
|
|
|
|
)
|
|
|
|
.value
|
2020-05-15 14:05:44 +03:00
|
|
|
)
|
2020-12-09 16:58:11 +03:00
|
|
|
.dependsOn(`akka-native`)
|
2020-07-10 13:57:42 +03:00
|
|
|
.dependsOn(`version-output`)
|
2021-06-18 17:39:45 +03:00
|
|
|
.dependsOn(editions)
|
2021-08-12 17:55:23 +03:00
|
|
|
.dependsOn(`edition-updater`)
|
2021-06-18 17:39:45 +03:00
|
|
|
.dependsOn(cli)
|
2021-07-17 17:49:51 +03:00
|
|
|
.dependsOn(`task-progress-notifications`)
|
2020-12-02 18:56:47 +03:00
|
|
|
.dependsOn(`polyglot-api`)
|
2020-11-16 20:49:59 +03:00
|
|
|
.dependsOn(`runtime-version-manager`)
|
2021-06-18 17:39:45 +03:00
|
|
|
.dependsOn(`library-manager`)
|
|
|
|
.dependsOn(pkg)
|
2020-03-18 13:41:55 +03:00
|
|
|
.dependsOn(`json-rpc-server`)
|
|
|
|
.dependsOn(`json-rpc-server-test` % Test)
|
2020-07-14 14:44:40 +03:00
|
|
|
.dependsOn(testkit % Test)
|
2020-11-16 20:49:59 +03:00
|
|
|
.dependsOn(`runtime-version-manager-test` % Test)
|
2019-11-18 14:18:16 +03:00
|
|
|
|
2020-06-16 12:00:47 +03:00
|
|
|
/* Note [Classpath Separation]
|
|
|
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
* Projects using the language runtime do not depend on it directly, but instead
|
|
|
|
* the language runtime is put on the Truffle classpath, rather than the
|
|
|
|
* standard classpath. This is the recommended way of handling this and we
|
|
|
|
* strive to use such structure everywhere.
|
|
|
|
* See
|
|
|
|
* https://www.graalvm.org/docs/graalvm-as-a-platform/implement-language#graalvm
|
|
|
|
*
|
|
|
|
* Currently the only exception to this are the tests of the runtime project
|
|
|
|
* which have classpath separation disabled, because they need direct access to
|
|
|
|
* the runtime's instruments.
|
|
|
|
*
|
|
|
|
* To ensure correct handling of dependencies by sbt, the classpath appended to
|
|
|
|
* Java options, should be based on `(runtime / Compile / fullClasspath).value`
|
|
|
|
* wherever possible. Using a key from the runtime project enables sbt to see
|
|
|
|
* the dependency.
|
|
|
|
*
|
|
|
|
* Assembly tasks that build JAR files which need `runtime.jar` to run should
|
|
|
|
* also add a dependency on `runtime / assembly`.
|
|
|
|
*/
|
|
|
|
|
2020-04-14 19:00:51 +03:00
|
|
|
lazy val `json-rpc-server` = project
|
2020-07-03 16:42:45 +03:00
|
|
|
.in(file("lib/scala/json-rpc-server"))
|
2020-04-14 19:00:51 +03:00
|
|
|
.settings(
|
2023-01-31 11:40:04 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2020-11-16 20:49:59 +03:00
|
|
|
libraryDependencies ++= akka ++ akkaTest,
|
2020-04-14 19:00:51 +03:00
|
|
|
libraryDependencies ++= circe,
|
|
|
|
libraryDependencies ++= Seq(
|
2022-05-24 16:01:26 +03:00
|
|
|
"io.circe" %% "circe-literal" % circeVersion,
|
|
|
|
"com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion,
|
|
|
|
akkaTestkit % Test,
|
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion % Test
|
2020-10-22 17:12:28 +03:00
|
|
|
)
|
2020-04-14 19:00:51 +03:00
|
|
|
)
|
2019-11-05 17:12:33 +03:00
|
|
|
|
2020-04-14 19:00:51 +03:00
|
|
|
lazy val `json-rpc-server-test` = project
|
2020-07-03 16:42:45 +03:00
|
|
|
.in(file("lib/scala/json-rpc-server-test"))
|
2020-04-14 19:00:51 +03:00
|
|
|
.settings(
|
|
|
|
libraryDependencies ++= akka,
|
|
|
|
libraryDependencies ++= circe,
|
|
|
|
libraryDependencies ++= Seq(
|
2020-10-22 17:12:28 +03:00
|
|
|
"io.circe" %% "circe-literal" % circeVersion,
|
|
|
|
akkaTestkit,
|
2022-11-14 20:32:39 +03:00
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion,
|
|
|
|
"org.gnieh" %% "diffson-circe" % diffsonVersion
|
2020-10-22 17:12:28 +03:00
|
|
|
)
|
2020-04-14 19:00:51 +03:00
|
|
|
)
|
|
|
|
.dependsOn(`json-rpc-server`)
|
2019-08-08 14:50:29 +03:00
|
|
|
|
2020-07-14 14:44:40 +03:00
|
|
|
lazy val testkit = project
|
|
|
|
.in(file("lib/scala/testkit"))
|
|
|
|
.settings(
|
2023-01-31 11:40:04 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2020-07-14 14:44:40 +03:00
|
|
|
libraryDependencies ++= Seq(
|
2020-10-22 17:12:28 +03:00
|
|
|
"org.apache.commons" % "commons-lang3" % commonsLangVersion,
|
2021-07-22 09:24:06 +03:00
|
|
|
"commons-io" % "commons-io" % commonsIoVersion,
|
2020-10-22 17:12:28 +03:00
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion
|
|
|
|
)
|
2020-07-14 14:44:40 +03:00
|
|
|
)
|
|
|
|
|
2020-06-23 11:26:05 +03:00
|
|
|
lazy val searcher = project
|
2020-07-03 16:42:45 +03:00
|
|
|
.in(file("lib/scala/searcher"))
|
2020-06-23 11:26:05 +03:00
|
|
|
.configs(Test)
|
|
|
|
.settings(
|
2023-01-31 11:40:04 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2020-07-06 16:55:21 +03:00
|
|
|
libraryDependencies ++= jmh ++ Seq(
|
2020-10-22 17:12:28 +03:00
|
|
|
"com.typesafe.slick" %% "slick" % slickVersion,
|
|
|
|
"org.xerial" % "sqlite-jdbc" % sqliteVersion,
|
|
|
|
"ch.qos.logback" % "logback-classic" % logbackClassicVersion % Test,
|
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion % Test
|
|
|
|
)
|
2020-06-23 11:26:05 +03:00
|
|
|
)
|
2020-07-06 16:55:21 +03:00
|
|
|
.configs(Benchmark)
|
|
|
|
.settings(
|
|
|
|
inConfig(Benchmark)(Defaults.testSettings),
|
2021-05-14 15:08:39 +03:00
|
|
|
Benchmark / fork := true
|
2020-07-06 16:55:21 +03:00
|
|
|
)
|
2020-07-14 14:44:40 +03:00
|
|
|
.dependsOn(testkit % Test)
|
2020-07-20 11:00:49 +03:00
|
|
|
.dependsOn(`polyglot-api`)
|
2020-06-23 11:26:05 +03:00
|
|
|
|
2020-07-03 16:42:45 +03:00
|
|
|
lazy val `interpreter-dsl` = (project in file("lib/scala/interpreter-dsl"))
|
|
|
|
.settings(
|
|
|
|
version := "0.1",
|
2022-05-12 11:42:00 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2022-05-30 22:30:37 +03:00
|
|
|
Compile / javacOptions := ((Compile / javacOptions).value ++
|
2022-07-01 04:58:14 +03:00
|
|
|
// Only run ServiceProvider processor and ignore those defined in META-INF, thus
|
|
|
|
// fixing incremental compilation setup
|
|
|
|
Seq(
|
|
|
|
"-processor",
|
|
|
|
"org.netbeans.modules.openide.util.ServiceProviderProcessor"
|
|
|
|
)),
|
Move Builtin Types and Methods to stdlib (#3363)
This PR replaces hard-coded `@Builtin_Method` and `@Builtin_Type` nodes in Builtins with an automated solution
that a) collects metadata from such annotations b) generates `BuiltinTypes` c) registers builtin methods with corresponding
constructors.
The main differences are:
1) The owner of the builtin method does not necessarily have to be a builtin type
2) You can now mix regular methods and builtin ones in stdlib
3) No need to keep track of builtin methods and types in various places and register them by hand (a source of many typos or omissions as it found during the process of this PR)
Related to #181497846
Benchmarks also execute within the margin of error.
### Important Notes
The PR got a bit large over time as I was moving various builtin types and finding various corner cases.
Most of the changes however are rather simple c&p from Builtins.enso to the corresponding stdlib module.
Here is the list of the most crucial updates:
- `engine/runtime/src/main/java/org/enso/interpreter/runtime/builtin/Builtins.java` - the core of the changes. We no longer register individual builtin constructors and their methods by hand. Instead, the information about those is read from 2 metadata files generated by annotation processors. When the builtin method is encountered in stdlib, we do not ignore the method. Instead we lookup it up in the list of registered functions (see `getBuiltinFunction` and `IrToTruffle`)
- `engine/runtime/src/main/java/org/enso/interpreter/runtime/callable/atom/AtomConstructor.java` has now information whether it corresponds to the builtin type or not.
- `engine/runtime/src/main/scala/org/enso/compiler/codegen/RuntimeStubsGenerator.scala` - when runtime stubs generator encounters a builtin type, based on the @Builtin_Type annotation, it looks up an existing constructor for it and registers it in the provided scope, rather than creating a new one. The scope of the constructor is also changed to the one coming from stdlib, while ensuring that synthetic methods (for fields) also get assigned correctly
- `engine/runtime/src/main/scala/org/enso/compiler/codegen/IrToTruffle.scala` - when a builtin method is encountered in stdlib we don't generate a new function node for it, instead we look it up in the list of registered builtin methods. Note that Integer and Number present a bit of a challenge because they list a whole bunch of methods that don't have a corresponding method (instead delegating to small/big integer implementations).
During the translation new atom constructors get initialized but we don't want to do it for builtins which have gone through the process earlier, hence the exception
- `lib/scala/interpreter-dsl/src/main/java/org/enso/interpreter/dsl/MethodProcessor.java` - @Builtin_Method processor not only generates the actual code fpr nodes but also collects and writes the info about them (name, class, params) to a metadata file that is read during builtins initialization
- `lib/scala/interpreter-dsl/src/main/java/org/enso/interpreter/dsl/MethodProcessor.java` - @Builtin_Method processor no longer generates only (root) nodes but also collects and writes the info about them (name, class, params) to a metadata file that is read during builtins initialization
- `lib/scala/interpreter-dsl/src/main/java/org/enso/interpreter/dsl/TypeProcessor.java` - Similar to MethodProcessor but handles @Builtin_Type annotations. It doesn't, **yet**, generate any builtin objects. It also collects the names, as present in stdlib, if any, so that we can generate the names automatically (see generated `types/ConstantsGen.java`)
- `engine/runtime/src/main/java/org/enso/interpreter/node/expression/builtin` - various classes annotated with @BuiltinType to ensure that the atom constructor is always properly registered for the builitn. Note that in order to support types fields in those, annotation takes optional `params` parameter (comma separated).
- `engine/runtime/src/bench/scala/org/enso/interpreter/bench/fixtures/semantic/AtomFixtures.scala` - drop manual creation of test list which seemed to be a relict of the old design
2022-05-05 21:18:06 +03:00
|
|
|
libraryDependencies ++= Seq(
|
2022-05-13 18:38:52 +03:00
|
|
|
"org.apache.commons" % "commons-lang3" % commonsLangVersion,
|
2022-08-08 22:32:55 +03:00
|
|
|
"org.netbeans.api" % "org-openide-util-lookup" % netbeansApiVersion,
|
2022-07-01 04:58:14 +03:00
|
|
|
"com.google.guava" % "guava" % guavaVersion exclude ("com.google.code.findbugs", "jsr305")
|
Move Builtin Types and Methods to stdlib (#3363)
This PR replaces hard-coded `@Builtin_Method` and `@Builtin_Type` nodes in Builtins with an automated solution
that a) collects metadata from such annotations b) generates `BuiltinTypes` c) registers builtin methods with corresponding
constructors.
The main differences are:
1) The owner of the builtin method does not necessarily have to be a builtin type
2) You can now mix regular methods and builtin ones in stdlib
3) No need to keep track of builtin methods and types in various places and register them by hand (a source of many typos or omissions as it found during the process of this PR)
Related to #181497846
Benchmarks also execute within the margin of error.
### Important Notes
The PR got a bit large over time as I was moving various builtin types and finding various corner cases.
Most of the changes however are rather simple c&p from Builtins.enso to the corresponding stdlib module.
Here is the list of the most crucial updates:
- `engine/runtime/src/main/java/org/enso/interpreter/runtime/builtin/Builtins.java` - the core of the changes. We no longer register individual builtin constructors and their methods by hand. Instead, the information about those is read from 2 metadata files generated by annotation processors. When the builtin method is encountered in stdlib, we do not ignore the method. Instead we lookup it up in the list of registered functions (see `getBuiltinFunction` and `IrToTruffle`)
- `engine/runtime/src/main/java/org/enso/interpreter/runtime/callable/atom/AtomConstructor.java` has now information whether it corresponds to the builtin type or not.
- `engine/runtime/src/main/scala/org/enso/compiler/codegen/RuntimeStubsGenerator.scala` - when runtime stubs generator encounters a builtin type, based on the @Builtin_Type annotation, it looks up an existing constructor for it and registers it in the provided scope, rather than creating a new one. The scope of the constructor is also changed to the one coming from stdlib, while ensuring that synthetic methods (for fields) also get assigned correctly
- `engine/runtime/src/main/scala/org/enso/compiler/codegen/IrToTruffle.scala` - when a builtin method is encountered in stdlib we don't generate a new function node for it, instead we look it up in the list of registered builtin methods. Note that Integer and Number present a bit of a challenge because they list a whole bunch of methods that don't have a corresponding method (instead delegating to small/big integer implementations).
During the translation new atom constructors get initialized but we don't want to do it for builtins which have gone through the process earlier, hence the exception
- `lib/scala/interpreter-dsl/src/main/java/org/enso/interpreter/dsl/MethodProcessor.java` - @Builtin_Method processor not only generates the actual code fpr nodes but also collects and writes the info about them (name, class, params) to a metadata file that is read during builtins initialization
- `lib/scala/interpreter-dsl/src/main/java/org/enso/interpreter/dsl/MethodProcessor.java` - @Builtin_Method processor no longer generates only (root) nodes but also collects and writes the info about them (name, class, params) to a metadata file that is read during builtins initialization
- `lib/scala/interpreter-dsl/src/main/java/org/enso/interpreter/dsl/TypeProcessor.java` - Similar to MethodProcessor but handles @Builtin_Type annotations. It doesn't, **yet**, generate any builtin objects. It also collects the names, as present in stdlib, if any, so that we can generate the names automatically (see generated `types/ConstantsGen.java`)
- `engine/runtime/src/main/java/org/enso/interpreter/node/expression/builtin` - various classes annotated with @BuiltinType to ensure that the atom constructor is always properly registered for the builitn. Note that in order to support types fields in those, annotation takes optional `params` parameter (comma separated).
- `engine/runtime/src/bench/scala/org/enso/interpreter/bench/fixtures/semantic/AtomFixtures.scala` - drop manual creation of test list which seemed to be a relict of the old design
2022-05-05 21:18:06 +03:00
|
|
|
)
|
2020-07-03 16:42:45 +03:00
|
|
|
)
|
|
|
|
|
2020-04-30 22:30:55 +03:00
|
|
|
// ============================================================================
|
|
|
|
// === Sub-Projects ===========================================================
|
|
|
|
// ============================================================================
|
2020-04-14 19:00:51 +03:00
|
|
|
|
2023-02-17 16:38:26 +03:00
|
|
|
val truffleRunOptionsNoAssert =
|
|
|
|
if (java.lang.Boolean.getBoolean("bench.compileOnly")) {
|
|
|
|
Seq(
|
|
|
|
"-Dpolyglot.engine.IterativePartialEscape=true",
|
|
|
|
"-Dpolyglot.engine.BackgroundCompilation=false",
|
|
|
|
"-Dbench.compileOnly=true"
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
Seq(
|
|
|
|
"-Dpolyglot.engine.IterativePartialEscape=true",
|
|
|
|
"-Dpolyglot.engine.BackgroundCompilation=false"
|
|
|
|
)
|
|
|
|
}
|
2023-01-27 00:41:35 +03:00
|
|
|
val truffleRunOptions = "-ea" +: truffleRunOptionsNoAssert
|
|
|
|
|
|
|
|
val truffleRunOptionsNoAssertSettings = Seq(
|
|
|
|
fork := true,
|
|
|
|
javaOptions ++= truffleRunOptionsNoAssert
|
|
|
|
)
|
2022-08-11 10:21:44 +03:00
|
|
|
|
2020-04-14 19:00:51 +03:00
|
|
|
val truffleRunOptionsSettings = Seq(
|
|
|
|
fork := true,
|
|
|
|
javaOptions ++= truffleRunOptions
|
|
|
|
)
|
|
|
|
|
|
|
|
lazy val `polyglot-api` = project
|
2020-02-13 17:33:39 +03:00
|
|
|
.in(file("engine/polyglot-api"))
|
|
|
|
.settings(
|
2023-01-27 00:41:35 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2020-02-13 17:33:39 +03:00
|
|
|
Test / fork := true,
|
2021-09-18 15:48:13 +03:00
|
|
|
commands += WithDebugCommand.withDebug,
|
2021-07-08 16:38:20 +03:00
|
|
|
Test / envVars ++= distributionEnvironmentOverrides,
|
2020-06-16 12:00:47 +03:00
|
|
|
Test / javaOptions ++= {
|
|
|
|
// Note [Classpath Separation]
|
|
|
|
val runtimeClasspath =
|
|
|
|
(LocalProject("runtime") / Compile / fullClasspath).value
|
|
|
|
.map(_.data)
|
|
|
|
.mkString(File.pathSeparator)
|
|
|
|
Seq(s"-Dtruffle.class.path.append=$runtimeClasspath")
|
|
|
|
},
|
2020-02-13 17:33:39 +03:00
|
|
|
libraryDependencies ++= Seq(
|
2020-10-22 17:12:28 +03:00
|
|
|
"org.graalvm.sdk" % "polyglot-tck" % graalVersion % "provided",
|
2023-01-03 17:36:26 +03:00
|
|
|
"org.graalvm.truffle" % "truffle-api" % graalVersion % "provided",
|
2020-10-22 17:12:28 +03:00
|
|
|
"com.google.flatbuffers" % "flatbuffers-java" % flatbuffersVersion,
|
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
|
|
|
|
"org.scalacheck" %% "scalacheck" % scalacheckVersion % Test
|
|
|
|
),
|
2020-04-30 22:30:55 +03:00
|
|
|
libraryDependencies ++= jackson,
|
2020-06-05 11:48:16 +03:00
|
|
|
GenerateFlatbuffers.flatcVersion := flatbuffersVersion,
|
2021-05-14 15:08:39 +03:00
|
|
|
Compile / sourceGenerators += GenerateFlatbuffers.task
|
2020-01-31 19:58:35 +03:00
|
|
|
)
|
2020-02-13 17:33:39 +03:00
|
|
|
.dependsOn(pkg)
|
2020-04-20 15:33:51 +03:00
|
|
|
.dependsOn(`text-buffer`)
|
2021-05-18 11:23:13 +03:00
|
|
|
.dependsOn(`logging-utils`)
|
2021-06-18 17:39:45 +03:00
|
|
|
.dependsOn(testkit % Test)
|
2020-02-13 17:33:39 +03:00
|
|
|
|
2020-04-14 19:00:51 +03:00
|
|
|
lazy val `language-server` = (project in file("engine/language-server"))
|
2020-02-13 17:33:39 +03:00
|
|
|
.settings(
|
2023-01-31 11:40:04 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2020-12-02 18:56:47 +03:00
|
|
|
libraryDependencies ++= akka ++ circe ++ Seq(
|
2020-10-22 17:12:28 +03:00
|
|
|
"com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion,
|
|
|
|
"io.circe" %% "circe-generic-extras" % circeGenericExtrasVersion,
|
|
|
|
"io.circe" %% "circe-literal" % circeVersion,
|
|
|
|
"dev.zio" %% "zio" % zioVersion,
|
|
|
|
"io.methvin" % "directory-watcher" % directoryWatcherVersion,
|
|
|
|
"com.beachape" %% "enumeratum-circe" % enumeratumCirceVersion,
|
|
|
|
"com.google.flatbuffers" % "flatbuffers-java" % flatbuffersVersion,
|
|
|
|
"commons-io" % "commons-io" % commonsIoVersion,
|
|
|
|
akkaTestkit % Test,
|
2020-12-16 19:05:37 +03:00
|
|
|
"com.typesafe.akka" %% "akka-http-testkit" % akkaHTTPVersion % Test,
|
2020-10-22 17:12:28 +03:00
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
|
|
|
|
"org.scalacheck" %% "scalacheck" % scalacheckVersion % Test,
|
2022-11-14 20:32:39 +03:00
|
|
|
"org.graalvm.sdk" % "polyglot-tck" % graalVersion % "provided",
|
2023-02-17 16:38:26 +03:00
|
|
|
"org.eclipse.jgit" % "org.eclipse.jgit" % jgitVersion
|
2020-10-22 17:12:28 +03:00
|
|
|
),
|
2021-05-14 15:08:39 +03:00
|
|
|
Test / testOptions += Tests
|
2020-10-22 17:12:28 +03:00
|
|
|
.Argument(TestFrameworks.ScalaCheck, "-minSuccessfulTests", "1000"),
|
2021-07-17 17:49:51 +03:00
|
|
|
Test / envVars ++= distributionEnvironmentOverrides,
|
2020-06-05 11:48:16 +03:00
|
|
|
GenerateFlatbuffers.flatcVersion := flatbuffersVersion,
|
2021-05-14 15:08:39 +03:00
|
|
|
Compile / sourceGenerators += GenerateFlatbuffers.task
|
2020-02-28 16:17:48 +03:00
|
|
|
)
|
|
|
|
.configs(Benchmark)
|
|
|
|
.settings(
|
2023-01-27 00:41:35 +03:00
|
|
|
inConfig(Compile)(truffleRunOptionsSettings),
|
2020-02-28 16:17:48 +03:00
|
|
|
inConfig(Benchmark)(Defaults.testSettings),
|
2021-05-14 15:08:39 +03:00
|
|
|
bench := (Benchmark / test).value,
|
2020-04-30 22:30:55 +03:00
|
|
|
libraryDependencies += "com.storm-enroute" %% "scalameter" % scalameterVersion % "bench",
|
2020-02-28 16:17:48 +03:00
|
|
|
testFrameworks ++= List(
|
2020-10-22 17:12:28 +03:00
|
|
|
new TestFramework("org.scalameter.ScalaMeterFramework")
|
|
|
|
)
|
2020-02-13 17:33:39 +03:00
|
|
|
)
|
2021-11-23 11:51:17 +03:00
|
|
|
.settings(
|
|
|
|
// These settings are needed by language-server tests that create a runtime context.
|
|
|
|
Test / fork := true,
|
|
|
|
Test / javaOptions ++= {
|
|
|
|
// Note [Classpath Separation]
|
|
|
|
val runtimeClasspath =
|
|
|
|
(LocalProject("runtime") / Compile / fullClasspath).value
|
|
|
|
.map(_.data)
|
|
|
|
.mkString(File.pathSeparator)
|
|
|
|
Seq(
|
|
|
|
s"-Dtruffle.class.path.append=$runtimeClasspath",
|
|
|
|
s"-Duser.dir=${file(".").getCanonicalPath}"
|
|
|
|
)
|
|
|
|
},
|
|
|
|
Test / compile := (Test / compile)
|
|
|
|
.dependsOn(LocalProject("enso") / updateLibraryManifests)
|
|
|
|
.value,
|
|
|
|
Test / envVars ++= Map(
|
|
|
|
"ENSO_EDITION_PATH" -> file("distribution/editions").getCanonicalPath
|
|
|
|
)
|
|
|
|
)
|
2020-03-18 13:41:55 +03:00
|
|
|
.dependsOn(`json-rpc-server-test` % Test)
|
2021-05-27 18:13:52 +03:00
|
|
|
.dependsOn(`json-rpc-server`)
|
2021-07-17 17:49:51 +03:00
|
|
|
.dependsOn(`task-progress-notifications`)
|
|
|
|
.dependsOn(`library-manager`)
|
2021-08-27 15:01:13 +03:00
|
|
|
.dependsOn(`connected-lock-manager`)
|
2021-08-12 17:55:23 +03:00
|
|
|
.dependsOn(`edition-updater`)
|
2021-05-27 18:13:52 +03:00
|
|
|
.dependsOn(`logging-service`)
|
|
|
|
.dependsOn(`polyglot-api`)
|
2020-06-26 19:52:42 +03:00
|
|
|
.dependsOn(`searcher`)
|
2021-05-27 18:13:52 +03:00
|
|
|
.dependsOn(`text-buffer`)
|
|
|
|
.dependsOn(`version-output`)
|
|
|
|
.dependsOn(pkg)
|
2022-05-10 15:44:05 +03:00
|
|
|
.dependsOn(`profiling-utils`)
|
2020-07-14 14:44:40 +03:00
|
|
|
.dependsOn(testkit % Test)
|
2021-08-09 17:00:04 +03:00
|
|
|
.dependsOn(`library-manager-test` % Test)
|
2021-07-17 17:49:51 +03:00
|
|
|
.dependsOn(`runtime-version-manager-test` % Test)
|
2020-01-31 19:58:35 +03:00
|
|
|
|
2021-02-22 16:32:55 +03:00
|
|
|
lazy val cleanInstruments = taskKey[Unit](
|
|
|
|
"Cleans fragile class files to force a full recompilation and preserve" +
|
|
|
|
"consistency of instrumentation configuration."
|
|
|
|
)
|
2021-07-08 16:38:20 +03:00
|
|
|
|
|
|
|
/** Overrides for the environment variables related to the distribution, so that
|
|
|
|
* a local installation does not interfere with runtime tests.
|
|
|
|
*/
|
|
|
|
val distributionEnvironmentOverrides = {
|
|
|
|
val fakeDir = file("target/fake_dir").getAbsolutePath
|
|
|
|
Map(
|
|
|
|
"ENSO_DATA_DIRECTORY" -> fakeDir,
|
|
|
|
"ENSO_CONFIG_DIRECTORY" -> fakeDir,
|
|
|
|
"ENSO_RUNTIME_DIRECTORY" -> file("target/run").getAbsolutePath,
|
|
|
|
"ENSO_LOG_DIRECTORY" -> file("target/logs").getAbsolutePath,
|
|
|
|
"ENSO_HOME" -> fakeDir,
|
|
|
|
"ENSO_EDITION_PATH" -> "",
|
|
|
|
"ENSO_LIBRARY_PATH" -> "",
|
|
|
|
"ENSO_AUXILIARY_LIBRARY_CACHES" -> ""
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-07-19 12:28:31 +03:00
|
|
|
val frgaalSourceLevel = "19"
|
2022-05-13 18:38:52 +03:00
|
|
|
|
2022-05-11 14:21:01 +03:00
|
|
|
/** A setting to replace javac with Frgaal compiler, allowing to use latest Java features in the code
|
|
|
|
* and still compile down to JDK 11
|
|
|
|
*/
|
|
|
|
lazy val frgaalJavaCompilerSetting = Seq(
|
2022-05-13 18:38:52 +03:00
|
|
|
Compile / compile / compilers := FrgaalJavaCompiler.compilers(
|
|
|
|
(Compile / dependencyClasspath).value,
|
|
|
|
compilers.value,
|
|
|
|
javaVersion
|
|
|
|
),
|
2022-05-11 14:21:01 +03:00
|
|
|
// This dependency is needed only so that developers don't download Frgaal manually.
|
|
|
|
// Sadly it cannot be placed under plugins either because meta dependencies are not easily
|
|
|
|
// accessible from the non-meta build definition.
|
2022-05-13 18:38:52 +03:00
|
|
|
libraryDependencies += FrgaalJavaCompiler.frgaal,
|
|
|
|
// Ensure that our tooling uses the right Java version for checking the code.
|
2022-07-01 04:58:14 +03:00
|
|
|
Compile / javacOptions ++= Seq(
|
|
|
|
"-source",
|
|
|
|
frgaalSourceLevel,
|
|
|
|
"--enable-preview"
|
|
|
|
)
|
2022-05-11 14:21:01 +03:00
|
|
|
)
|
|
|
|
|
2022-06-13 17:09:08 +03:00
|
|
|
lazy val instrumentationSettings = frgaalJavaCompilerSetting ++ Seq(
|
|
|
|
version := ensoVersion,
|
|
|
|
commands += WithDebugCommand.withDebug,
|
2022-07-01 04:58:14 +03:00
|
|
|
Compile / logManager :=
|
|
|
|
sbt.internal.util.CustomLogManager
|
|
|
|
.excludeMsg("Could not determine source for class ", Level.Warn),
|
|
|
|
Compile / javacOptions --= Seq(
|
|
|
|
"-source",
|
|
|
|
frgaalSourceLevel,
|
|
|
|
"--enable-preview"
|
|
|
|
),
|
2022-06-13 17:09:08 +03:00
|
|
|
libraryDependencies ++= Seq(
|
2022-07-01 04:58:14 +03:00
|
|
|
"org.graalvm.truffle" % "truffle-api" % graalVersion % "provided",
|
|
|
|
"org.graalvm.truffle" % "truffle-dsl-processor" % graalVersion % "provided"
|
2022-06-13 17:09:08 +03:00
|
|
|
),
|
|
|
|
(Compile / javacOptions) ++= Seq(
|
|
|
|
"-s",
|
|
|
|
(Compile / sourceManaged).value.getAbsolutePath,
|
2022-07-01 04:58:14 +03:00
|
|
|
"-Xlint:unchecked"
|
|
|
|
)
|
2022-06-13 17:09:08 +03:00
|
|
|
)
|
|
|
|
|
2022-07-01 04:58:14 +03:00
|
|
|
lazy val `runtime-language-epb` =
|
|
|
|
(project in file("engine/runtime-language-epb"))
|
|
|
|
.settings(
|
|
|
|
inConfig(Compile)(truffleRunOptionsSettings),
|
|
|
|
instrumentationSettings
|
|
|
|
)
|
2022-06-13 17:09:08 +03:00
|
|
|
|
2023-02-17 16:38:26 +03:00
|
|
|
/** Runs gu (GraalVM updater) command with given `args`.
|
|
|
|
* For example `runGu(Seq("install", "js"))`.
|
|
|
|
* @param logger Logger for the `gu` command.
|
|
|
|
* @param args Arguments for the `gu` command.
|
|
|
|
*/
|
2022-11-23 17:30:48 +03:00
|
|
|
def runGu(logger: ManagedLogger, args: Seq[String]): String = {
|
|
|
|
val javaHome = new File(
|
|
|
|
System.getProperty("java.home")
|
|
|
|
)
|
|
|
|
val os = {
|
|
|
|
if (Platform.isLinux) DistributionPackage.OS.Linux
|
|
|
|
else if (Platform.isMacOS) DistributionPackage.OS.MacOS
|
|
|
|
else if (Platform.isWindows) DistributionPackage.OS.Windows
|
|
|
|
else throw new RuntimeException("Unknown platform")
|
|
|
|
}
|
|
|
|
packageBuilder.gu(
|
|
|
|
logger,
|
|
|
|
os,
|
|
|
|
javaHome,
|
2023-02-17 16:38:26 +03:00
|
|
|
args: _*
|
2022-11-23 17:30:48 +03:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
def installedGuComponents(logger: ManagedLogger): Seq[String] = {
|
|
|
|
val componentList = runGu(
|
|
|
|
logger,
|
|
|
|
Seq("list")
|
|
|
|
)
|
2023-02-17 16:38:26 +03:00
|
|
|
val components = componentList.linesIterator
|
2022-11-23 17:30:48 +03:00
|
|
|
.drop(2)
|
|
|
|
.map { line =>
|
|
|
|
line
|
|
|
|
.split(" ")
|
|
|
|
.head
|
|
|
|
}
|
|
|
|
.toList
|
|
|
|
logger.debug(s"Installed GU components = $components")
|
|
|
|
if (!components.contains("graalvm")) {
|
|
|
|
throw new RuntimeException(s"graalvm components is not in $components")
|
|
|
|
}
|
|
|
|
components
|
|
|
|
}
|
|
|
|
|
|
|
|
lazy val installGraalJs = taskKey[Unit]("Install graaljs GraalVM component")
|
|
|
|
ThisBuild / installGraalJs := {
|
|
|
|
val logger = streams.value.log
|
|
|
|
if (!installedGuComponents(logger).contains("js")) {
|
|
|
|
logger.info("Installing js GraalVM component")
|
|
|
|
runGu(
|
|
|
|
logger,
|
|
|
|
Seq("install", "js")
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-17 16:38:26 +03:00
|
|
|
lazy val installNativeImage =
|
|
|
|
taskKey[Unit]("Install native-image GraalVM component")
|
2022-11-23 17:30:48 +03:00
|
|
|
ThisBuild / installNativeImage := {
|
|
|
|
val logger = streams.value.log
|
|
|
|
if (!installedGuComponents(logger).contains("native-image")) {
|
|
|
|
logger.info("Installing native-image GraalVM component")
|
|
|
|
runGu(
|
|
|
|
logger,
|
|
|
|
Seq("install", "native-image")
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ThisBuild / installNativeImage := {
|
|
|
|
(ThisBuild / installNativeImage).result.value
|
|
|
|
}
|
|
|
|
|
2019-11-08 20:32:48 +03:00
|
|
|
lazy val runtime = (project in file("engine/runtime"))
|
2019-11-19 18:16:58 +03:00
|
|
|
.configs(Benchmark)
|
2019-06-14 18:26:49 +03:00
|
|
|
.settings(
|
2022-05-11 14:21:01 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2022-07-01 04:58:14 +03:00
|
|
|
Compile / logManager :=
|
|
|
|
sbt.internal.util.CustomLogManager.excludeMsg(
|
|
|
|
"Could not determine source for class ",
|
|
|
|
Level.Warn
|
|
|
|
),
|
2020-05-15 11:07:58 +03:00
|
|
|
version := ensoVersion,
|
2019-09-12 17:47:25 +03:00
|
|
|
commands += WithDebugCommand.withDebug,
|
2019-11-05 17:12:33 +03:00
|
|
|
inConfig(Compile)(truffleRunOptionsSettings),
|
2019-11-19 18:16:58 +03:00
|
|
|
inConfig(Benchmark)(Defaults.testSettings),
|
2022-07-01 04:58:14 +03:00
|
|
|
Benchmark / javacOptions --= Seq(
|
|
|
|
"-source",
|
|
|
|
frgaalSourceLevel,
|
|
|
|
"--enable-preview"
|
|
|
|
),
|
2021-05-14 15:08:39 +03:00
|
|
|
Test / parallelExecution := false,
|
|
|
|
Test / logBuffered := false,
|
2022-05-13 18:38:52 +03:00
|
|
|
Test / testOptions += Tests.Argument(
|
|
|
|
"-oD"
|
|
|
|
), // show timings for individual tests
|
2020-02-13 17:33:39 +03:00
|
|
|
scalacOptions += "-Ymacro-annotations",
|
2020-03-20 11:01:03 +03:00
|
|
|
scalacOptions ++= Seq("-Ypatmat-exhaust-depth", "off"),
|
2021-08-26 13:52:35 +03:00
|
|
|
libraryDependencies ++= jmh ++ jaxb ++ circe ++ Seq(
|
2022-08-12 16:18:58 +03:00
|
|
|
"com.ibm.icu" % "icu4j" % icuVersion,
|
2020-10-22 17:12:28 +03:00
|
|
|
"com.chuusai" %% "shapeless" % shapelessVersion,
|
|
|
|
"org.apache.commons" % "commons-lang3" % commonsLangVersion,
|
|
|
|
"org.apache.tika" % "tika-core" % tikaVersion,
|
|
|
|
"org.graalvm.sdk" % "graal-sdk" % graalVersion % "provided",
|
|
|
|
"org.graalvm.sdk" % "polyglot-tck" % graalVersion % "provided",
|
|
|
|
"org.graalvm.truffle" % "truffle-api" % graalVersion % "provided",
|
|
|
|
"org.graalvm.truffle" % "truffle-dsl-processor" % graalVersion % "provided",
|
|
|
|
"org.graalvm.truffle" % "truffle-tck" % graalVersion % "provided",
|
|
|
|
"org.graalvm.truffle" % "truffle-tck-common" % graalVersion % "provided",
|
|
|
|
"org.scalacheck" %% "scalacheck" % scalacheckVersion % Test,
|
|
|
|
"org.scalactic" %% "scalactic" % scalacticVersion % Test,
|
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
|
|
|
|
"org.graalvm.truffle" % "truffle-api" % graalVersion % Benchmark,
|
|
|
|
"org.typelevel" %% "cats-core" % catsVersion,
|
2022-08-08 22:32:55 +03:00
|
|
|
"junit" % "junit" % junitVersion % Test,
|
2022-05-13 18:38:52 +03:00
|
|
|
"com.novocode" % "junit-interface" % "0.11" % Test exclude ("junit", "junit-dep")
|
2020-10-22 17:12:28 +03:00
|
|
|
),
|
2020-07-01 14:21:13 +03:00
|
|
|
Compile / compile / compileInputs := (Compile / compile / compileInputs)
|
2020-10-22 17:12:28 +03:00
|
|
|
.dependsOn(CopyTruffleJAR.preCompileTask)
|
|
|
|
.value,
|
2020-06-16 12:00:47 +03:00
|
|
|
// Note [Classpath Separation]
|
|
|
|
Test / javaOptions ++= Seq(
|
2020-10-22 17:12:28 +03:00
|
|
|
"-Dgraalvm.locatorDisabled=true",
|
|
|
|
s"--upgrade-module-path=${file("engine/runtime/build-cache/truffle-api.jar").absolutePath}"
|
|
|
|
),
|
2021-07-08 16:38:20 +03:00
|
|
|
Test / fork := true,
|
2022-05-13 18:38:52 +03:00
|
|
|
Test / envVars ++= distributionEnvironmentOverrides ++ Map(
|
|
|
|
"ENSO_TEST_DISABLE_IR_CACHE" -> "false"
|
|
|
|
),
|
2020-07-01 14:21:13 +03:00
|
|
|
bootstrap := CopyTruffleJAR.bootstrapJARs.value,
|
|
|
|
Global / onLoad := EnvironmentCheck.addVersionCheck(
|
2020-10-22 17:12:28 +03:00
|
|
|
graalVersion,
|
|
|
|
javaVersion
|
|
|
|
)((Global / onLoad).value)
|
2019-06-14 18:26:49 +03:00
|
|
|
)
|
2019-07-11 14:23:00 +03:00
|
|
|
.settings(
|
|
|
|
(Compile / javacOptions) ++= Seq(
|
2020-10-22 17:12:28 +03:00
|
|
|
"-s",
|
2022-05-12 11:42:00 +03:00
|
|
|
(Compile / sourceManaged).value.getAbsolutePath,
|
|
|
|
"-Xlint:unchecked"
|
2021-05-20 16:03:14 +03:00
|
|
|
)
|
2019-07-11 14:23:00 +03:00
|
|
|
)
|
|
|
|
.settings(
|
|
|
|
(Compile / compile) := (Compile / compile)
|
2020-10-22 17:12:28 +03:00
|
|
|
.dependsOn(Def.task { (Compile / sourceManaged).value.mkdirs })
|
2022-11-23 17:30:48 +03:00
|
|
|
.dependsOn(installGraalJs)
|
2020-10-22 17:12:28 +03:00
|
|
|
.value
|
2019-07-11 14:23:00 +03:00
|
|
|
)
|
2020-09-30 14:33:57 +03:00
|
|
|
.settings(
|
2020-10-19 11:50:12 +03:00
|
|
|
(Runtime / compile) := (Runtime / compile)
|
2021-06-24 13:42:24 +03:00
|
|
|
.dependsOn(`std-base` / Compile / packageBin)
|
2023-02-17 16:38:26 +03:00
|
|
|
.dependsOn(`enso-test-java-helpers` / Compile / packageBin)
|
2021-06-24 13:42:24 +03:00
|
|
|
.dependsOn(`std-image` / Compile / packageBin)
|
|
|
|
.dependsOn(`std-database` / Compile / packageBin)
|
2021-09-03 22:41:12 +03:00
|
|
|
.dependsOn(`std-google-api` / Compile / packageBin)
|
2021-06-24 13:42:24 +03:00
|
|
|
.dependsOn(`std-table` / Compile / packageBin)
|
2020-10-22 17:12:28 +03:00
|
|
|
.value
|
2020-09-30 14:33:57 +03:00
|
|
|
)
|
2019-06-14 18:26:49 +03:00
|
|
|
.settings(
|
2021-05-14 15:08:39 +03:00
|
|
|
bench := (Benchmark / test).tag(Exclusive).value,
|
2019-08-08 14:50:29 +03:00
|
|
|
benchOnly := Def.inputTaskDyn {
|
2020-10-22 17:12:28 +03:00
|
|
|
import complete.Parsers.spaceDelimited
|
|
|
|
val name = spaceDelimited("<name>").parsed match {
|
|
|
|
case List(name) => name
|
|
|
|
case _ => throw new IllegalArgumentException("Expected one argument.")
|
|
|
|
}
|
|
|
|
Def.task {
|
2021-05-14 15:08:39 +03:00
|
|
|
(Benchmark / testOnly).toTask(" -- -z " + name).value
|
2020-10-22 17:12:28 +03:00
|
|
|
}
|
|
|
|
}.evaluated,
|
2021-05-14 15:08:39 +03:00
|
|
|
Benchmark / parallelExecution := false
|
2019-06-14 18:26:49 +03:00
|
|
|
)
|
2023-03-11 12:27:26 +03:00
|
|
|
.dependsOn(`common-polyglot-core-utils`)
|
2022-06-13 17:09:08 +03:00
|
|
|
.dependsOn(`runtime-language-epb`)
|
2021-08-26 13:52:35 +03:00
|
|
|
.dependsOn(`edition-updater`)
|
2020-06-24 20:02:42 +03:00
|
|
|
.dependsOn(`interpreter-dsl`)
|
2021-08-26 13:52:35 +03:00
|
|
|
.dependsOn(`library-manager`)
|
|
|
|
.dependsOn(`logging-truffle-connector`)
|
|
|
|
.dependsOn(`logging-utils`)
|
2020-04-14 19:00:51 +03:00
|
|
|
.dependsOn(`polyglot-api`)
|
2020-04-20 15:33:51 +03:00
|
|
|
.dependsOn(`text-buffer`)
|
2021-08-26 13:52:35 +03:00
|
|
|
.dependsOn(graph)
|
|
|
|
.dependsOn(pkg)
|
2021-08-27 15:01:13 +03:00
|
|
|
.dependsOn(`edition-updater`)
|
|
|
|
.dependsOn(`connected-lock-manager`)
|
2023-03-15 18:43:51 +03:00
|
|
|
.dependsOn(syntax)
|
2022-09-20 18:50:27 +03:00
|
|
|
.dependsOn(`syntax-rust-definition`)
|
2020-10-19 11:50:12 +03:00
|
|
|
.dependsOn(testkit % Test)
|
2019-11-18 16:36:03 +03:00
|
|
|
|
2022-07-01 04:58:14 +03:00
|
|
|
lazy val `runtime-instrument-id-execution` =
|
|
|
|
(project in file("engine/runtime-instrument-id-execution"))
|
|
|
|
.settings(
|
|
|
|
inConfig(Compile)(truffleRunOptionsSettings),
|
|
|
|
instrumentationSettings
|
|
|
|
)
|
|
|
|
.dependsOn(runtime)
|
2022-06-13 17:09:08 +03:00
|
|
|
|
2022-07-01 04:58:14 +03:00
|
|
|
lazy val `runtime-instrument-repl-debugger` =
|
|
|
|
(project in file("engine/runtime-instrument-repl-debugger"))
|
|
|
|
.settings(
|
|
|
|
inConfig(Compile)(truffleRunOptionsSettings),
|
|
|
|
instrumentationSettings
|
|
|
|
)
|
|
|
|
.dependsOn(runtime)
|
2022-06-13 17:09:08 +03:00
|
|
|
|
2022-07-01 04:58:14 +03:00
|
|
|
lazy val `runtime-instrument-runtime-server` =
|
|
|
|
(project in file("engine/runtime-instrument-runtime-server"))
|
|
|
|
.settings(
|
|
|
|
inConfig(Compile)(truffleRunOptionsSettings),
|
|
|
|
instrumentationSettings
|
|
|
|
)
|
|
|
|
.dependsOn(runtime)
|
2022-06-13 17:09:08 +03:00
|
|
|
|
2022-07-01 04:58:14 +03:00
|
|
|
lazy val `runtime-with-instruments` =
|
|
|
|
(project in file("engine/runtime-with-instruments"))
|
|
|
|
.configs(Benchmark)
|
|
|
|
.settings(
|
|
|
|
frgaalJavaCompilerSetting,
|
|
|
|
inConfig(Compile)(truffleRunOptionsSettings),
|
|
|
|
inConfig(Benchmark)(Defaults.testSettings),
|
|
|
|
commands += WithDebugCommand.withDebug,
|
|
|
|
Benchmark / javacOptions --= Seq(
|
|
|
|
"-source",
|
|
|
|
frgaalSourceLevel,
|
|
|
|
"--enable-preview"
|
|
|
|
),
|
|
|
|
Test / javaOptions ++= Seq(
|
|
|
|
"-Dgraalvm.locatorDisabled=true",
|
|
|
|
s"--upgrade-module-path=${file("engine/runtime/build-cache/truffle-api.jar").absolutePath}"
|
|
|
|
),
|
|
|
|
Test / fork := true,
|
|
|
|
Test / envVars ++= distributionEnvironmentOverrides ++ Map(
|
|
|
|
"ENSO_TEST_DISABLE_IR_CACHE" -> "false"
|
|
|
|
),
|
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
|
|
|
|
"org.graalvm.truffle" % "truffle-api" % graalVersion % Test,
|
|
|
|
"org.graalvm.truffle" % "truffle-dsl-processor" % graalVersion % Test
|
|
|
|
),
|
|
|
|
// Note [Unmanaged Classpath]
|
|
|
|
Test / unmanagedClasspath += (baseDirectory.value / ".." / ".." / "app" / "gui" / "view" / "graph-editor" / "src" / "builtin" / "visualization" / "native" / "inc"),
|
|
|
|
assembly / assemblyJarName := "runtime.jar",
|
|
|
|
assembly / test := {},
|
|
|
|
assembly / assemblyOutputPath := file("runtime.jar"),
|
|
|
|
assembly / assemblyMergeStrategy := {
|
|
|
|
case PathList("META-INF", file, xs @ _*) if file.endsWith(".DSA") =>
|
|
|
|
MergeStrategy.discard
|
|
|
|
case PathList("META-INF", file, xs @ _*) if file.endsWith(".SF") =>
|
|
|
|
MergeStrategy.discard
|
|
|
|
case PathList("META-INF", "MANIFEST.MF", xs @ _*) =>
|
|
|
|
MergeStrategy.discard
|
|
|
|
case PathList("META-INF", "services", xs @ _*) =>
|
|
|
|
MergeStrategy.concat
|
|
|
|
case _ => MergeStrategy.first
|
|
|
|
}
|
|
|
|
)
|
|
|
|
.dependsOn(runtime % "compile->compile;test->test;runtime->runtime")
|
|
|
|
.dependsOn(`runtime-instrument-id-execution`)
|
|
|
|
.dependsOn(`runtime-instrument-repl-debugger`)
|
|
|
|
.dependsOn(`runtime-instrument-runtime-server`)
|
2022-06-13 17:09:08 +03:00
|
|
|
|
2023-01-03 17:36:26 +03:00
|
|
|
/* runtime-with-polyglot
|
|
|
|
* ~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
* A project that allows loading polyglot languages by not disabling
|
|
|
|
* the GraalVM locator explicitly with `-Dgraalvm.locatorDisabled=true` like the
|
|
|
|
* `runtime-with-instruments` project does. It means that the test classes and
|
|
|
|
* runtime classes are loaded using different classloaders, and the test code
|
|
|
|
* cannot access the `EnsoContext`.
|
|
|
|
*/
|
|
|
|
|
|
|
|
lazy val `runtime-with-polyglot` =
|
|
|
|
(project in file("engine/runtime-with-polyglot"))
|
|
|
|
.configs(Benchmark)
|
|
|
|
.settings(
|
|
|
|
frgaalJavaCompilerSetting,
|
2023-01-27 00:41:35 +03:00
|
|
|
inConfig(Compile)(truffleRunOptionsNoAssertSettings),
|
2023-01-03 17:36:26 +03:00
|
|
|
inConfig(Benchmark)(Defaults.testSettings),
|
|
|
|
commands += WithDebugCommand.withDebug,
|
|
|
|
Benchmark / javacOptions --= Seq(
|
|
|
|
"-source",
|
|
|
|
frgaalSourceLevel,
|
|
|
|
"--enable-preview"
|
|
|
|
),
|
|
|
|
Test / javaOptions ++= {
|
|
|
|
// Note [Classpath Separation]
|
|
|
|
val runtimeClasspath =
|
|
|
|
(LocalProject("runtime") / Compile / fullClasspath).value
|
|
|
|
val runtimeInstrumentsClasspath =
|
2023-02-17 16:38:26 +03:00
|
|
|
(LocalProject(
|
|
|
|
"runtime-with-instruments"
|
|
|
|
) / Compile / fullClasspath).value
|
2023-01-03 17:36:26 +03:00
|
|
|
val appendClasspath =
|
|
|
|
(runtimeClasspath ++ runtimeInstrumentsClasspath)
|
|
|
|
.map(_.data)
|
|
|
|
.mkString(File.pathSeparator)
|
|
|
|
Seq(
|
|
|
|
s"-Dtruffle.class.path.append=$appendClasspath"
|
|
|
|
)
|
|
|
|
},
|
|
|
|
Test / fork := true,
|
|
|
|
Test / envVars ++= distributionEnvironmentOverrides ++ Map(
|
|
|
|
"ENSO_TEST_DISABLE_IR_CACHE" -> "false"
|
|
|
|
),
|
|
|
|
libraryDependencies ++= Seq(
|
2023-02-17 16:38:26 +03:00
|
|
|
"org.graalvm.sdk" % "graal-sdk" % graalVersion % "provided",
|
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion % Test
|
2023-01-03 17:36:26 +03:00
|
|
|
)
|
|
|
|
)
|
|
|
|
.dependsOn(runtime % "compile->compile;test->test;runtime->runtime")
|
|
|
|
.dependsOn(`runtime-with-instruments`)
|
|
|
|
|
2020-01-31 19:58:35 +03:00
|
|
|
/* Note [Unmanaged Classpath]
|
|
|
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
* As the definition of the core primitives in `core_definition` is achieved
|
|
|
|
* entirely using the graph macros, this means that the IDE experience for those
|
|
|
|
* using these primitives is very poor.
|
|
|
|
*
|
|
|
|
* To get around this, we want to treat the core definition as a .jar dependency
|
|
|
|
* to force the IDE to depend on bytecode for its diagnostics, rather than the
|
|
|
|
* source code (as this means it sees the macros expanded). A standard workflow
|
|
|
|
* with local publishing would not recompile the definition automatically on
|
|
|
|
* changes, so the `unmanagedClasspath` route allows us to get automatic
|
|
|
|
* recompilation but still convince the IDE that it is a .jar dependency.
|
|
|
|
*/
|
|
|
|
|
2020-10-09 17:19:58 +03:00
|
|
|
lazy val `engine-runner` = project
|
2020-01-17 18:35:44 +03:00
|
|
|
.in(file("engine/runner"))
|
2019-11-18 16:36:03 +03:00
|
|
|
.settings(
|
2023-01-31 11:40:04 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2020-06-16 12:00:47 +03:00
|
|
|
javaOptions ++= {
|
|
|
|
// Note [Classpath Separation]
|
|
|
|
val runtimeClasspath =
|
|
|
|
(runtime / Compile / fullClasspath).value
|
|
|
|
.map(_.data)
|
|
|
|
.mkString(File.pathSeparator)
|
|
|
|
Seq(s"-Dtruffle.class.path.append=$runtimeClasspath")
|
|
|
|
},
|
2021-05-14 15:08:39 +03:00
|
|
|
Compile / run / mainClass := Some("org.enso.runner.Main"),
|
|
|
|
assembly / mainClass := (Compile / run / mainClass).value,
|
|
|
|
assembly / assemblyJarName := "runner.jar",
|
|
|
|
assembly / test := {},
|
|
|
|
assembly / assemblyOutputPath := file("runner.jar"),
|
|
|
|
assembly / assemblyMergeStrategy := {
|
2020-03-06 17:17:46 +03:00
|
|
|
case PathList("META-INF", file, xs @ _*) if file.endsWith(".DSA") =>
|
|
|
|
MergeStrategy.discard
|
|
|
|
case PathList("META-INF", file, xs @ _*) if file.endsWith(".SF") =>
|
|
|
|
MergeStrategy.discard
|
|
|
|
case PathList("META-INF", "MANIFEST.MF", xs @ _*) =>
|
|
|
|
MergeStrategy.discard
|
|
|
|
case "application.conf" =>
|
|
|
|
MergeStrategy.concat
|
|
|
|
case "reference.conf" =>
|
|
|
|
MergeStrategy.concat
|
|
|
|
case x =>
|
|
|
|
MergeStrategy.first
|
|
|
|
},
|
2020-03-06 16:40:29 +03:00
|
|
|
commands += WithDebugCommand.withDebug,
|
2019-11-18 16:36:03 +03:00
|
|
|
inConfig(Compile)(truffleRunOptionsSettings),
|
|
|
|
libraryDependencies ++= Seq(
|
2020-10-22 17:12:28 +03:00
|
|
|
"org.graalvm.sdk" % "polyglot-tck" % graalVersion % "provided",
|
|
|
|
"org.graalvm.truffle" % "truffle-api" % graalVersion % "provided",
|
|
|
|
"commons-cli" % "commons-cli" % commonsCliVersion,
|
|
|
|
"com.monovore" %% "decline" % declineVersion,
|
|
|
|
"org.jline" % "jline" % jlineVersion,
|
|
|
|
"org.typelevel" %% "cats-core" % catsVersion
|
|
|
|
),
|
2021-05-14 15:08:39 +03:00
|
|
|
run / connectInput := true
|
2019-11-18 16:36:03 +03:00
|
|
|
)
|
2020-03-09 16:44:40 +03:00
|
|
|
.settings(
|
2020-06-16 12:00:47 +03:00
|
|
|
assembly := assembly
|
2022-06-13 17:09:08 +03:00
|
|
|
.dependsOn(`runtime-with-instruments` / assembly)
|
2022-10-24 12:55:18 +03:00
|
|
|
.value,
|
2022-09-22 17:45:10 +03:00
|
|
|
rebuildNativeImage := NativeImage
|
|
|
|
.buildNativeImage(
|
|
|
|
"runner",
|
2022-12-01 09:43:13 +03:00
|
|
|
staticOnLinux = false,
|
2022-09-22 17:45:10 +03:00
|
|
|
additionalOptions = Seq(
|
|
|
|
"-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog",
|
|
|
|
"-H:IncludeResources=.*Main.enso$",
|
|
|
|
"--macro:truffle",
|
|
|
|
"--language:js",
|
|
|
|
// "-g",
|
|
|
|
// "-H:+DashboardAll",
|
|
|
|
// "-H:DashboardDump=runner.bgv"
|
|
|
|
"-Dnic=nic"
|
|
|
|
),
|
|
|
|
mainClass = Option("org.enso.runner.Main"),
|
2022-10-24 12:55:18 +03:00
|
|
|
cp = Option("runtime.jar"),
|
2022-09-22 17:45:10 +03:00
|
|
|
initializeAtRuntime = Seq(
|
|
|
|
// Note [WSLoggerManager Shutdown Hook]
|
|
|
|
"org.enso.loggingservice.WSLoggerManager$",
|
2022-12-01 09:43:13 +03:00
|
|
|
"io.methvin.watchservice.jna.CarbonAPI",
|
|
|
|
"org.enso.syntax2.Parser"
|
2022-09-22 17:45:10 +03:00
|
|
|
)
|
|
|
|
)
|
2022-11-23 17:30:48 +03:00
|
|
|
.dependsOn(installNativeImage)
|
2022-09-22 17:45:10 +03:00
|
|
|
.dependsOn(assembly)
|
|
|
|
.value,
|
|
|
|
buildNativeImage := NativeImage
|
|
|
|
.incrementalNativeImageBuild(
|
|
|
|
rebuildNativeImage,
|
|
|
|
"runner"
|
|
|
|
)
|
|
|
|
.value
|
|
|
|
)
|
2022-11-23 17:30:48 +03:00
|
|
|
.dependsOn(`version-output`)
|
|
|
|
.dependsOn(pkg)
|
|
|
|
.dependsOn(cli)
|
|
|
|
.dependsOn(`library-manager`)
|
|
|
|
.dependsOn(`language-server`)
|
|
|
|
.dependsOn(`polyglot-api`)
|
|
|
|
.dependsOn(`logging-service`)
|
2022-09-22 17:45:10 +03:00
|
|
|
|
2020-07-10 13:57:42 +03:00
|
|
|
lazy val launcher = project
|
|
|
|
.in(file("engine/launcher"))
|
|
|
|
.configs(Test)
|
|
|
|
.settings(
|
2020-08-10 13:14:39 +03:00
|
|
|
resolvers += Resolver.bintrayRepo("gn0s1s", "releases"),
|
2020-07-10 13:57:42 +03:00
|
|
|
libraryDependencies ++= Seq(
|
2020-10-22 17:12:28 +03:00
|
|
|
"com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion,
|
|
|
|
"org.typelevel" %% "cats-core" % catsVersion,
|
|
|
|
"nl.gn0s1s" %% "bump" % bumpVersion,
|
|
|
|
"org.apache.commons" % "commons-compress" % commonsCompressVersion,
|
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
|
|
|
|
akkaSLF4J
|
|
|
|
)
|
2020-07-10 13:57:42 +03:00
|
|
|
)
|
|
|
|
.settings(
|
2020-12-09 16:58:11 +03:00
|
|
|
rebuildNativeImage := NativeImage
|
2020-10-22 17:12:28 +03:00
|
|
|
.buildNativeImage(
|
|
|
|
"enso",
|
|
|
|
staticOnLinux = true,
|
2020-12-09 16:58:11 +03:00
|
|
|
additionalOptions = Seq(
|
2020-10-22 17:12:28 +03:00
|
|
|
"-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog",
|
2020-12-09 16:58:11 +03:00
|
|
|
"-H:IncludeResources=.*Main.enso$"
|
|
|
|
),
|
|
|
|
initializeAtRuntime = Seq(
|
|
|
|
// Note [WSLoggerManager Shutdown Hook]
|
|
|
|
"org.enso.loggingservice.WSLoggerManager$"
|
2020-08-10 13:14:39 +03:00
|
|
|
)
|
2020-10-22 17:12:28 +03:00
|
|
|
)
|
2022-11-23 17:30:48 +03:00
|
|
|
.dependsOn(installNativeImage)
|
2020-12-09 16:58:11 +03:00
|
|
|
.dependsOn(assembly)
|
2021-01-14 13:46:01 +03:00
|
|
|
.dependsOn(VerifyReflectionSetup.run)
|
2020-12-09 16:58:11 +03:00
|
|
|
.value,
|
|
|
|
buildNativeImage := NativeImage
|
|
|
|
.incrementalNativeImageBuild(
|
|
|
|
rebuildNativeImage,
|
|
|
|
"enso"
|
|
|
|
)
|
2020-10-22 17:12:28 +03:00
|
|
|
.value,
|
2021-05-14 15:08:39 +03:00
|
|
|
assembly / test := {},
|
2022-05-10 15:44:05 +03:00
|
|
|
assembly / assemblyOutputPath := file("launcher.jar"),
|
|
|
|
assembly / assemblyMergeStrategy := {
|
|
|
|
case PathList("META-INF", file, xs @ _*) if file.endsWith(".DSA") =>
|
|
|
|
MergeStrategy.discard
|
|
|
|
case PathList("META-INF", file, xs @ _*) if file.endsWith(".SF") =>
|
|
|
|
MergeStrategy.discard
|
|
|
|
case PathList("META-INF", "MANIFEST.MF", xs @ _*) =>
|
|
|
|
MergeStrategy.discard
|
|
|
|
case "application.conf" => MergeStrategy.concat
|
|
|
|
case "reference.conf" => MergeStrategy.concat
|
|
|
|
case x =>
|
|
|
|
MergeStrategy.first
|
|
|
|
}
|
2020-07-10 13:57:42 +03:00
|
|
|
)
|
2020-07-22 20:28:03 +03:00
|
|
|
.settings(
|
|
|
|
(Test / test) := (Test / test)
|
2020-12-09 16:58:11 +03:00
|
|
|
.dependsOn(buildNativeImage)
|
2021-12-27 19:56:35 +03:00
|
|
|
.dependsOn(LauncherShimsForTest.prepare())
|
2020-10-22 17:12:28 +03:00
|
|
|
.value,
|
2021-05-14 15:08:39 +03:00
|
|
|
Test / parallelExecution := false
|
2020-07-22 20:28:03 +03:00
|
|
|
)
|
|
|
|
.dependsOn(cli)
|
2020-10-30 14:31:31 +03:00
|
|
|
.dependsOn(`runtime-version-manager`)
|
2020-07-10 13:57:42 +03:00
|
|
|
.dependsOn(`version-output`)
|
|
|
|
.dependsOn(pkg)
|
2020-10-02 19:17:21 +03:00
|
|
|
.dependsOn(`logging-service`)
|
2021-06-18 17:39:45 +03:00
|
|
|
.dependsOn(`distribution-manager` % Test)
|
2020-10-30 14:31:31 +03:00
|
|
|
.dependsOn(`runtime-version-manager-test` % Test)
|
|
|
|
|
2021-06-18 17:39:45 +03:00
|
|
|
lazy val `distribution-manager` = project
|
|
|
|
.in(file("lib/scala/distribution-manager"))
|
|
|
|
.configs(Test)
|
|
|
|
.settings(
|
2023-01-31 11:40:04 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2021-06-18 17:39:45 +03:00
|
|
|
resolvers += Resolver.bintrayRepo("gn0s1s", "releases"),
|
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion,
|
|
|
|
"io.circe" %% "circe-yaml" % circeYamlVersion,
|
|
|
|
"commons-io" % "commons-io" % commonsIoVersion,
|
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion % Test
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.dependsOn(editions)
|
2021-07-22 09:24:06 +03:00
|
|
|
.dependsOn(cli)
|
2021-06-18 17:39:45 +03:00
|
|
|
.dependsOn(pkg)
|
|
|
|
.dependsOn(`logging-utils`)
|
|
|
|
|
|
|
|
lazy val editions = project
|
|
|
|
.in(file("lib/scala/editions"))
|
|
|
|
.configs(Test)
|
|
|
|
.settings(
|
2023-01-31 11:40:04 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2021-06-18 17:39:45 +03:00
|
|
|
resolvers += Resolver.bintrayRepo("gn0s1s", "releases"),
|
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion,
|
|
|
|
"nl.gn0s1s" %% "bump" % bumpVersion,
|
|
|
|
"io.circe" %% "circe-yaml" % circeYamlVersion,
|
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion % Test
|
|
|
|
)
|
|
|
|
)
|
2021-08-09 17:00:04 +03:00
|
|
|
.settings(
|
|
|
|
(Compile / compile) := (Compile / compile)
|
|
|
|
.dependsOn(
|
|
|
|
Def.task {
|
|
|
|
Editions.writeEditionConfig(
|
2022-02-07 17:14:32 +03:00
|
|
|
editionsRoot = file("distribution") / "editions",
|
2021-08-13 19:14:20 +03:00
|
|
|
ensoVersion = ensoVersion,
|
|
|
|
editionName = currentEdition,
|
|
|
|
libraryVersion = stdLibVersion,
|
|
|
|
log = streams.value.log
|
2021-08-09 17:00:04 +03:00
|
|
|
)
|
|
|
|
}
|
|
|
|
)
|
|
|
|
.value,
|
|
|
|
cleanFiles += baseDirectory.value / ".." / ".." / "distribution" / "editions"
|
|
|
|
)
|
2021-06-22 14:35:15 +03:00
|
|
|
.dependsOn(testkit % Test)
|
2021-06-18 17:39:45 +03:00
|
|
|
|
2021-07-22 09:24:06 +03:00
|
|
|
lazy val downloader = (project in file("lib/scala/downloader"))
|
|
|
|
.settings(
|
2023-01-31 11:40:04 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2021-07-22 09:24:06 +03:00
|
|
|
version := "0.1",
|
|
|
|
libraryDependencies ++= circe ++ Seq(
|
|
|
|
"com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion,
|
|
|
|
"commons-io" % "commons-io" % commonsIoVersion,
|
|
|
|
"org.apache.commons" % "commons-compress" % commonsCompressVersion,
|
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
|
|
|
|
akkaActor,
|
|
|
|
akkaStream,
|
|
|
|
akkaHttp,
|
|
|
|
akkaSLF4J
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.dependsOn(cli)
|
|
|
|
|
|
|
|
lazy val `edition-updater` = project
|
|
|
|
.in(file("lib/scala/edition-updater"))
|
|
|
|
.configs(Test)
|
|
|
|
.settings(
|
2023-01-31 11:40:04 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2022-07-01 04:58:14 +03:00
|
|
|
Test / test := (Test / test).tag(simpleLibraryServerTag).value,
|
2021-07-22 09:24:06 +03:00
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion,
|
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion % Test
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.dependsOn(editions)
|
|
|
|
.dependsOn(downloader)
|
2021-08-12 17:55:23 +03:00
|
|
|
.dependsOn(`distribution-manager`)
|
|
|
|
.dependsOn(`library-manager-test` % Test)
|
|
|
|
|
|
|
|
lazy val `edition-uploader` = project
|
|
|
|
.in(file("lib/scala/edition-uploader"))
|
2023-01-31 11:40:04 +03:00
|
|
|
.settings(
|
|
|
|
frgaalJavaCompilerSetting
|
|
|
|
)
|
2021-08-12 17:55:23 +03:00
|
|
|
.dependsOn(editions)
|
|
|
|
.dependsOn(`version-output`)
|
2021-07-22 09:24:06 +03:00
|
|
|
|
2021-06-18 17:39:45 +03:00
|
|
|
lazy val `library-manager` = project
|
|
|
|
.in(file("lib/scala/library-manager"))
|
|
|
|
.configs(Test)
|
|
|
|
.settings(
|
2023-01-31 11:40:04 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2021-06-18 17:39:45 +03:00
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion,
|
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion % Test
|
|
|
|
)
|
|
|
|
)
|
2021-07-08 16:38:20 +03:00
|
|
|
.dependsOn(`version-output`) // Note [Default Editions]
|
2021-06-18 17:39:45 +03:00
|
|
|
.dependsOn(editions)
|
|
|
|
.dependsOn(cli)
|
|
|
|
.dependsOn(`distribution-manager`)
|
2021-07-22 09:24:06 +03:00
|
|
|
.dependsOn(downloader)
|
2021-06-18 17:39:45 +03:00
|
|
|
.dependsOn(testkit % Test)
|
2021-07-22 09:24:06 +03:00
|
|
|
.dependsOn(`logging-service` % Test)
|
2021-06-18 17:39:45 +03:00
|
|
|
|
2021-08-09 17:00:04 +03:00
|
|
|
lazy val `library-manager-test` = project
|
|
|
|
.in(file("lib/scala/library-manager-test"))
|
|
|
|
.configs(Test)
|
|
|
|
.settings(
|
2023-01-31 11:40:04 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2022-07-01 04:58:14 +03:00
|
|
|
Test / test := (Test / test).tag(simpleLibraryServerTag).value,
|
2021-08-09 17:00:04 +03:00
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion,
|
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion % Test
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.dependsOn(`library-manager`)
|
|
|
|
.dependsOn(testkit)
|
|
|
|
.dependsOn(`logging-service`)
|
|
|
|
|
2021-08-27 15:01:13 +03:00
|
|
|
lazy val `connected-lock-manager` = project
|
|
|
|
.in(file("lib/scala/connected-lock-manager"))
|
|
|
|
.configs(Test)
|
|
|
|
.settings(
|
2023-01-31 11:40:04 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2021-08-27 15:01:13 +03:00
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion,
|
|
|
|
akkaActor,
|
|
|
|
akkaTestkit % Test,
|
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion % Test
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.dependsOn(`distribution-manager`)
|
|
|
|
.dependsOn(`polyglot-api`)
|
|
|
|
.dependsOn(testkit % Test)
|
|
|
|
|
2020-10-30 14:31:31 +03:00
|
|
|
lazy val `runtime-version-manager` = project
|
|
|
|
.in(file("lib/scala/runtime-version-manager"))
|
|
|
|
.configs(Test)
|
|
|
|
.settings(
|
2023-01-31 11:40:04 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2020-10-30 14:31:31 +03:00
|
|
|
resolvers += Resolver.bintrayRepo("gn0s1s", "releases"),
|
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion,
|
|
|
|
"org.typelevel" %% "cats-core" % catsVersion,
|
|
|
|
"nl.gn0s1s" %% "bump" % bumpVersion,
|
|
|
|
"org.apache.commons" % "commons-compress" % commonsCompressVersion,
|
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
|
2020-12-15 11:49:58 +03:00
|
|
|
akkaHttp
|
2020-10-30 14:31:31 +03:00
|
|
|
)
|
|
|
|
)
|
|
|
|
.dependsOn(pkg)
|
2021-07-22 09:24:06 +03:00
|
|
|
.dependsOn(downloader)
|
2020-10-30 14:31:31 +03:00
|
|
|
.dependsOn(`logging-service`)
|
|
|
|
.dependsOn(cli)
|
|
|
|
.dependsOn(`version-output`)
|
2021-08-12 17:55:23 +03:00
|
|
|
.dependsOn(`edition-updater`)
|
2021-06-18 17:39:45 +03:00
|
|
|
.dependsOn(`distribution-manager`)
|
2020-10-30 14:31:31 +03:00
|
|
|
|
|
|
|
lazy val `runtime-version-manager-test` = project
|
|
|
|
.in(file("lib/scala/runtime-version-manager-test"))
|
|
|
|
.configs(Test)
|
|
|
|
.settings(
|
2023-01-31 11:40:04 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2020-10-30 14:31:31 +03:00
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion,
|
|
|
|
"org.scalatest" %% "scalatest" % scalatestVersion,
|
|
|
|
"commons-io" % "commons-io" % commonsIoVersion
|
|
|
|
)
|
|
|
|
)
|
2021-05-14 15:08:39 +03:00
|
|
|
.settings(Test / parallelExecution := false)
|
2020-11-06 15:53:45 +03:00
|
|
|
.settings(
|
|
|
|
(Test / test) := (Test / test)
|
|
|
|
.dependsOn(`locking-test-helper` / assembly)
|
|
|
|
.value
|
|
|
|
)
|
2020-10-30 14:31:31 +03:00
|
|
|
.dependsOn(`runtime-version-manager`)
|
|
|
|
.dependsOn(`logging-service`)
|
2020-11-06 15:53:45 +03:00
|
|
|
.dependsOn(testkit)
|
2021-06-18 17:39:45 +03:00
|
|
|
.dependsOn(cli)
|
|
|
|
.dependsOn(`distribution-manager`)
|
2020-11-06 15:53:45 +03:00
|
|
|
|
|
|
|
lazy val `locking-test-helper` = project
|
|
|
|
.in(file("lib/scala/locking-test-helper"))
|
|
|
|
.settings(
|
2023-01-31 11:40:04 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2021-05-14 15:08:39 +03:00
|
|
|
assembly / test := {},
|
|
|
|
assembly / assemblyOutputPath := file("locking-test-helper.jar")
|
2020-11-06 15:53:45 +03:00
|
|
|
)
|
2020-08-10 13:14:39 +03:00
|
|
|
|
2021-07-08 16:38:20 +03:00
|
|
|
val `std-lib-root` = file("distribution/lib/Standard/")
|
|
|
|
def stdLibComponentRoot(name: String): File =
|
|
|
|
`std-lib-root` / name / stdLibVersion
|
|
|
|
val `base-polyglot-root` = stdLibComponentRoot("Base") / "polyglot" / "java"
|
|
|
|
val `table-polyglot-root` = stdLibComponentRoot("Table") / "polyglot" / "java"
|
|
|
|
val `image-polyglot-root` = stdLibComponentRoot("Image") / "polyglot" / "java"
|
2021-09-03 22:41:12 +03:00
|
|
|
val `google-api-polyglot-root` =
|
|
|
|
stdLibComponentRoot("Google_Api") / "polyglot" / "java"
|
2021-07-08 16:38:20 +03:00
|
|
|
val `database-polyglot-root` =
|
|
|
|
stdLibComponentRoot("Database") / "polyglot" / "java"
|
2021-06-24 13:42:24 +03:00
|
|
|
|
|
|
|
lazy val `std-base` = project
|
|
|
|
.in(file("std-bits") / "base")
|
|
|
|
.settings(
|
2022-05-11 14:21:01 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2021-06-24 13:42:24 +03:00
|
|
|
autoScalaLibrary := false,
|
|
|
|
Compile / packageBin / artifactPath :=
|
|
|
|
`base-polyglot-root` / "std-base.jar",
|
|
|
|
libraryDependencies ++= Seq(
|
2022-10-24 12:55:18 +03:00
|
|
|
"org.graalvm.truffle" % "truffle-api" % graalVersion % "provided",
|
|
|
|
"org.netbeans.api" % "org-openide-util-lookup" % netbeansApiVersion % "provided"
|
2021-06-24 13:42:24 +03:00
|
|
|
),
|
|
|
|
Compile / packageBin := Def.task {
|
|
|
|
val result = (Compile / packageBin).value
|
2023-03-11 12:27:26 +03:00
|
|
|
val _ensureCoreIsCompiled =
|
|
|
|
(`common-polyglot-core-utils` / Compile / packageBin).value
|
2021-06-24 13:42:24 +03:00
|
|
|
val _ = StdBits
|
|
|
|
.copyDependencies(
|
|
|
|
`base-polyglot-root`,
|
2023-03-11 12:27:26 +03:00
|
|
|
Seq("std-base.jar", "common-polyglot-core-utils.jar"),
|
2021-06-24 13:42:24 +03:00
|
|
|
ignoreScalaLibrary = true
|
|
|
|
)
|
|
|
|
.value
|
|
|
|
result
|
|
|
|
}.value
|
|
|
|
)
|
2023-03-11 12:27:26 +03:00
|
|
|
.dependsOn(`common-polyglot-core-utils`)
|
|
|
|
|
|
|
|
lazy val `common-polyglot-core-utils` = project
|
|
|
|
.in(file("lib/scala/common-polyglot-core-utils"))
|
|
|
|
.settings(
|
|
|
|
frgaalJavaCompilerSetting,
|
|
|
|
autoScalaLibrary := false,
|
|
|
|
Compile / packageBin / artifactPath :=
|
|
|
|
`base-polyglot-root` / "common-polyglot-core-utils.jar",
|
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"com.ibm.icu" % "icu4j" % icuVersion,
|
|
|
|
"org.graalvm.truffle" % "truffle-api" % graalVersion % "provided"
|
|
|
|
)
|
|
|
|
)
|
2021-06-24 13:42:24 +03:00
|
|
|
|
2023-02-17 16:38:26 +03:00
|
|
|
lazy val `enso-test-java-helpers` = project
|
|
|
|
.in(file("test/Tests/polyglot-sources/enso-test-java-helpers"))
|
|
|
|
.settings(
|
|
|
|
frgaalJavaCompilerSetting,
|
|
|
|
autoScalaLibrary := false,
|
|
|
|
Compile / packageBin / artifactPath :=
|
|
|
|
file("test/Tests/polyglot/java/helpers.jar"),
|
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"org.graalvm.truffle" % "truffle-api" % graalVersion % "provided"
|
2023-03-07 05:25:13 +03:00
|
|
|
),
|
|
|
|
Compile / packageBin := Def.task {
|
|
|
|
val result = (Compile / packageBin).value
|
|
|
|
val primaryLocation = (Compile / packageBin / artifactPath).value
|
|
|
|
val secondaryLocations = Seq(
|
|
|
|
file("test/Table_Tests/polyglot/java/helpers.jar")
|
|
|
|
)
|
|
|
|
secondaryLocations.foreach { target =>
|
|
|
|
IO.copyFile(primaryLocation, target)
|
|
|
|
}
|
|
|
|
result
|
|
|
|
}.value
|
2023-02-17 16:38:26 +03:00
|
|
|
)
|
|
|
|
|
2021-06-24 13:42:24 +03:00
|
|
|
lazy val `std-table` = project
|
|
|
|
.in(file("std-bits") / "table")
|
2022-11-08 18:57:59 +03:00
|
|
|
.enablePlugins(Antlr4Plugin)
|
2021-06-24 13:42:24 +03:00
|
|
|
.settings(
|
2022-05-11 14:21:01 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2021-06-24 13:42:24 +03:00
|
|
|
autoScalaLibrary := false,
|
|
|
|
Compile / packageBin / artifactPath :=
|
|
|
|
`table-polyglot-root` / "std-table.jar",
|
2022-11-08 18:57:59 +03:00
|
|
|
Antlr4 / antlr4PackageName := Some("org.enso.table.expressions"),
|
|
|
|
Antlr4 / antlr4Version := "4.10.1",
|
|
|
|
Antlr4 / antlr4GenVisitor := true,
|
|
|
|
Antlr4 / antlr4TreatWarningsAsErrors := true,
|
|
|
|
Compile / managedSourceDirectories += {
|
|
|
|
(Antlr4 / sourceManaged).value / "main" / "antlr4"
|
|
|
|
},
|
2021-06-24 13:42:24 +03:00
|
|
|
libraryDependencies ++= Seq(
|
2022-10-24 12:55:18 +03:00
|
|
|
"org.graalvm.truffle" % "truffle-api" % graalVersion % "provided",
|
|
|
|
"org.netbeans.api" % "org-openide-util-lookup" % netbeansApiVersion % "provided",
|
|
|
|
"com.univocity" % "univocity-parsers" % "2.9.1",
|
|
|
|
"org.apache.poi" % "poi-ooxml" % "5.2.2",
|
2022-11-08 18:57:59 +03:00
|
|
|
"org.apache.xmlbeans" % "xmlbeans" % "5.1.0",
|
|
|
|
"org.antlr" % "antlr4-runtime" % "4.10.1"
|
2021-06-24 13:42:24 +03:00
|
|
|
),
|
|
|
|
Compile / packageBin := Def.task {
|
|
|
|
val result = (Compile / packageBin).value
|
|
|
|
val _ = StdBits
|
|
|
|
.copyDependencies(
|
|
|
|
`table-polyglot-root`,
|
2023-03-11 12:27:26 +03:00
|
|
|
Seq("std-table.jar"),
|
2022-10-14 21:08:08 +03:00
|
|
|
ignoreScalaLibrary = true
|
2021-06-24 13:42:24 +03:00
|
|
|
)
|
|
|
|
.value
|
|
|
|
result
|
|
|
|
}.value
|
|
|
|
)
|
2022-09-07 15:28:41 +03:00
|
|
|
.dependsOn(`std-base` % "provided")
|
2021-06-24 13:42:24 +03:00
|
|
|
|
|
|
|
lazy val `std-image` = project
|
|
|
|
.in(file("std-bits") / "image")
|
|
|
|
.settings(
|
2022-05-11 14:21:01 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2021-06-24 13:42:24 +03:00
|
|
|
autoScalaLibrary := false,
|
|
|
|
Compile / packageBin / artifactPath :=
|
|
|
|
`image-polyglot-root` / "std-image.jar",
|
|
|
|
libraryDependencies ++= Seq(
|
2023-02-16 18:15:49 +03:00
|
|
|
"org.netbeans.api" % "org-openide-util-lookup" % netbeansApiVersion % "provided",
|
2023-03-07 05:25:13 +03:00
|
|
|
"org.openpnp" % "opencv" % "4.5.1-2"
|
2021-06-24 13:42:24 +03:00
|
|
|
),
|
|
|
|
Compile / packageBin := Def.task {
|
|
|
|
val result = (Compile / packageBin).value
|
|
|
|
val _ = StdBits
|
|
|
|
.copyDependencies(
|
|
|
|
`image-polyglot-root`,
|
2023-03-11 12:27:26 +03:00
|
|
|
Seq("std-image.jar"),
|
2021-06-24 13:42:24 +03:00
|
|
|
ignoreScalaLibrary = true
|
|
|
|
)
|
|
|
|
.value
|
|
|
|
result
|
|
|
|
}.value
|
|
|
|
)
|
2023-02-16 18:15:49 +03:00
|
|
|
.dependsOn(`std-base` % "provided")
|
2020-10-09 17:19:58 +03:00
|
|
|
|
2021-09-03 22:41:12 +03:00
|
|
|
lazy val `std-google-api` = project
|
|
|
|
.in(file("std-bits") / "google-api")
|
|
|
|
.settings(
|
2022-05-11 14:21:01 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2021-09-03 22:41:12 +03:00
|
|
|
autoScalaLibrary := false,
|
|
|
|
Compile / packageBin / artifactPath :=
|
2022-01-13 18:17:19 +03:00
|
|
|
`google-api-polyglot-root` / "std-google-api.jar",
|
2021-09-03 22:41:12 +03:00
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"com.google.api-client" % "google-api-client" % "1.32.1",
|
|
|
|
"com.google.apis" % "google-api-services-sheets" % "v4-rev612-1.25.0"
|
|
|
|
),
|
|
|
|
Compile / packageBin := Def.task {
|
|
|
|
val result = (Compile / packageBin).value
|
|
|
|
val _ = StdBits
|
|
|
|
.copyDependencies(
|
|
|
|
`google-api-polyglot-root`,
|
2023-03-11 12:27:26 +03:00
|
|
|
Seq("std-google-api.jar"),
|
2021-09-03 22:41:12 +03:00
|
|
|
ignoreScalaLibrary = true
|
|
|
|
)
|
|
|
|
.value
|
|
|
|
result
|
|
|
|
}.value
|
|
|
|
)
|
|
|
|
|
2021-06-24 13:42:24 +03:00
|
|
|
lazy val `std-database` = project
|
|
|
|
.in(file("std-bits") / "database")
|
2020-10-09 17:19:58 +03:00
|
|
|
.settings(
|
2022-05-11 14:21:01 +03:00
|
|
|
frgaalJavaCompilerSetting,
|
2020-10-09 17:19:58 +03:00
|
|
|
autoScalaLibrary := false,
|
|
|
|
Compile / packageBin / artifactPath :=
|
2021-06-24 13:42:24 +03:00
|
|
|
`database-polyglot-root` / "std-database.jar",
|
2020-10-09 17:19:58 +03:00
|
|
|
libraryDependencies ++= Seq(
|
2023-02-16 18:15:49 +03:00
|
|
|
"org.netbeans.api" % "org-openide-util-lookup" % netbeansApiVersion % "provided",
|
|
|
|
"org.xerial" % "sqlite-jdbc" % "3.36.0.3",
|
|
|
|
"org.postgresql" % "postgresql" % "42.4.0",
|
|
|
|
"com.amazon.redshift" % "redshift-jdbc42" % "2.1.0.9",
|
|
|
|
"com.amazonaws" % "aws-java-sdk-core" % "1.12.273",
|
|
|
|
"com.amazonaws" % "aws-java-sdk-redshift" % "1.12.273",
|
|
|
|
"com.amazonaws" % "aws-java-sdk-sts" % "1.12.273"
|
2020-10-22 17:12:28 +03:00
|
|
|
),
|
2020-10-09 17:19:58 +03:00
|
|
|
Compile / packageBin := Def.task {
|
2020-10-22 17:12:28 +03:00
|
|
|
val result = (Compile / packageBin).value
|
2021-02-22 16:32:55 +03:00
|
|
|
val _ = StdBits
|
2020-10-22 17:12:28 +03:00
|
|
|
.copyDependencies(
|
2021-06-24 13:42:24 +03:00
|
|
|
`database-polyglot-root`,
|
2023-03-11 12:27:26 +03:00
|
|
|
Seq("std-database.jar"),
|
2022-07-11 21:39:16 +03:00
|
|
|
ignoreScalaLibrary = true
|
2020-10-22 17:12:28 +03:00
|
|
|
)
|
|
|
|
.value
|
|
|
|
result
|
|
|
|
}.value
|
2020-10-09 17:19:58 +03:00
|
|
|
)
|
2023-02-16 18:15:49 +03:00
|
|
|
.dependsOn(`std-base` % "provided")
|
2020-10-09 17:19:58 +03:00
|
|
|
|
2020-08-28 14:03:09 +03:00
|
|
|
/* Note [Native Image Workaround for GraalVM 20.2]
|
|
|
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
* In GraalVM 20.2 the Native Image build of even simple Scala programs has
|
|
|
|
* started to fail on a call to `Statics.releaseFence`. It has been reported as
|
|
|
|
* a bug in the GraalVM repository: https://github.com/oracle/graal/issues/2770
|
|
|
|
*
|
|
|
|
* A proposed workaround for this bug is to substitute the original function
|
|
|
|
* with a different implementation that does not use the problematic
|
|
|
|
* MethodHandle. This is implemented in class
|
|
|
|
* `org.enso.launcher.workarounds.ReplacementStatics` using
|
|
|
|
* `org.enso.launcher.workarounds.Unsafe` which gives access to
|
|
|
|
* `sun.misc.Unsafe` which contains a low-level function corresponding to the
|
|
|
|
* required "release fence".
|
|
|
|
*
|
|
|
|
* To allow for that substitution, the launcher code requires annotations from
|
|
|
|
* the `svm` module and that is why this additional dependency is needed as long
|
|
|
|
* as that workaround is in-place. The dependency is marked as "provided"
|
|
|
|
* because it is included within the native-image build.
|
|
|
|
*/
|
2020-10-02 19:17:21 +03:00
|
|
|
|
|
|
|
/* Note [WSLoggerManager Shutdown Hook]
|
|
|
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
* As the WSLoggerManager registers a shutdown hook when its initialized to
|
|
|
|
* ensure that logs are not lost in case of logging service initialization
|
|
|
|
* failure, it has to be initialized at runtime, as otherwise if the
|
|
|
|
* initialization was done at build time, the shutdown hook would actually also
|
|
|
|
* run at build time and have no effect at runtime.
|
|
|
|
*/
|
2020-12-09 16:58:11 +03:00
|
|
|
|
|
|
|
lazy val engineDistributionRoot =
|
|
|
|
settingKey[File]("Root of built engine distribution")
|
|
|
|
lazy val launcherDistributionRoot =
|
|
|
|
settingKey[File]("Root of built launcher distribution")
|
|
|
|
lazy val projectManagerDistributionRoot =
|
|
|
|
settingKey[File]("Root of built project manager distribution")
|
|
|
|
|
2021-01-15 18:26:51 +03:00
|
|
|
engineDistributionRoot :=
|
|
|
|
packageBuilder.localArtifact("engine") / s"enso-$ensoVersion"
|
|
|
|
launcherDistributionRoot := packageBuilder.localArtifact("launcher") / "enso"
|
|
|
|
projectManagerDistributionRoot :=
|
|
|
|
packageBuilder.localArtifact("project-manager") / "enso"
|
2020-12-09 16:58:11 +03:00
|
|
|
|
|
|
|
lazy val buildEngineDistribution =
|
|
|
|
taskKey[Unit]("Builds the engine distribution")
|
|
|
|
buildEngineDistribution := {
|
2021-11-23 11:51:17 +03:00
|
|
|
val _ = (`engine-runner` / assembly).value
|
|
|
|
updateLibraryManifests.value
|
2020-12-09 16:58:11 +03:00
|
|
|
val root = engineDistributionRoot.value
|
|
|
|
val log = streams.value.log
|
|
|
|
val cacheFactory = streams.value.cacheStoreFactory
|
|
|
|
DistributionPackage.createEnginePackage(
|
2022-02-07 17:14:32 +03:00
|
|
|
distributionRoot = root,
|
|
|
|
cacheFactory = cacheFactory,
|
|
|
|
log = log,
|
|
|
|
graalVersion = graalVersion,
|
|
|
|
javaVersion = javaVersion,
|
|
|
|
ensoVersion = ensoVersion,
|
|
|
|
editionName = currentEdition,
|
|
|
|
sourceStdlibVersion = stdLibVersion,
|
2022-11-09 18:26:25 +03:00
|
|
|
targetStdlibVersion = targetStdlibVersion,
|
|
|
|
targetDir = (`syntax-rust-definition` / rustParserTargetDirectory).value
|
2020-12-09 16:58:11 +03:00
|
|
|
)
|
|
|
|
log.info(s"Engine package created at $root")
|
|
|
|
}
|
|
|
|
|
2023-03-07 05:25:13 +03:00
|
|
|
lazy val runEngineDistribution =
|
|
|
|
inputKey[Unit]("Run the engine distribution with arguments")
|
2023-02-17 00:37:12 +03:00
|
|
|
runEngineDistribution := {
|
|
|
|
buildEngineDistribution.value
|
|
|
|
val args: Seq[String] = spaceDelimited("<arg>").parsed
|
2023-03-07 05:25:13 +03:00
|
|
|
DistributionPackage.runEnginePackage(
|
|
|
|
engineDistributionRoot.value,
|
|
|
|
args,
|
|
|
|
streams.value.log
|
|
|
|
)
|
2023-02-17 00:37:12 +03:00
|
|
|
}
|
|
|
|
|
2022-10-24 12:55:18 +03:00
|
|
|
val stdBitsProjects =
|
|
|
|
List("Base", "Database", "Google_Api", "Image", "Table", "All")
|
2022-05-13 18:38:52 +03:00
|
|
|
val allStdBits: Parser[String] =
|
|
|
|
stdBitsProjects.map(v => v: Parser[String]).reduce(_ | _)
|
2022-05-11 13:12:18 +03:00
|
|
|
|
2022-11-18 14:27:27 +03:00
|
|
|
lazy val `simple-httpbin` = project
|
|
|
|
.in(file("tools") / "simple-httpbin")
|
|
|
|
.settings(
|
|
|
|
frgaalJavaCompilerSetting,
|
|
|
|
Compile / javacOptions ++= Seq("-XDignore.symbol.file", "-Xlint:all"),
|
|
|
|
libraryDependencies ++= Seq(
|
|
|
|
"org.apache.commons" % "commons-text" % commonsTextVersion
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.configs(Test)
|
|
|
|
|
2022-05-13 18:38:52 +03:00
|
|
|
lazy val buildStdLib =
|
|
|
|
inputKey[Unit]("Build an individual standard library package")
|
2022-05-11 13:12:18 +03:00
|
|
|
buildStdLib := Def.inputTaskDyn {
|
|
|
|
val cmd: String = allStdBits.parsed
|
2022-05-13 18:38:52 +03:00
|
|
|
val root: File = engineDistributionRoot.value
|
2022-05-11 13:12:18 +03:00
|
|
|
// Ensure that a complete distribution was built at least once.
|
2022-11-23 14:40:59 +03:00
|
|
|
// Because of `if` in the sbt task definition and usage of `streams.value` one has to
|
|
|
|
// delegate to another task definition (sbt restriction).
|
2022-05-11 13:12:18 +03:00
|
|
|
if ((root / "manifest.yaml").exists) {
|
|
|
|
pkgStdLibInternal.toTask(cmd)
|
|
|
|
} else buildEngineDistribution
|
|
|
|
}.evaluated
|
|
|
|
|
|
|
|
lazy val pkgStdLibInternal = inputKey[Unit]("Use `buildStdLib`")
|
2022-10-11 02:11:04 +03:00
|
|
|
pkgStdLibInternal := Def.inputTask {
|
2022-05-11 13:12:18 +03:00
|
|
|
val cmd = allStdBits.parsed
|
|
|
|
val root = engineDistributionRoot.value
|
|
|
|
val log: sbt.Logger = streams.value.log
|
|
|
|
val cacheFactory = streams.value.cacheStoreFactory
|
|
|
|
cmd match {
|
2022-05-13 18:38:52 +03:00
|
|
|
case "Base" =>
|
2022-05-11 13:12:18 +03:00
|
|
|
(`std-base` / Compile / packageBin).value
|
2022-05-13 18:38:52 +03:00
|
|
|
case "Database" =>
|
2022-05-11 13:12:18 +03:00
|
|
|
(`std-database` / Compile / packageBin).value
|
|
|
|
case "Google_Api" =>
|
|
|
|
(`std-google-api` / Compile / packageBin).value
|
2022-05-13 18:38:52 +03:00
|
|
|
case "Image" =>
|
2022-05-11 13:12:18 +03:00
|
|
|
(`std-image` / Compile / packageBin).value
|
2022-05-13 18:38:52 +03:00
|
|
|
case "Table" =>
|
2022-05-11 13:12:18 +03:00
|
|
|
(`std-table` / Compile / packageBin).value
|
2023-02-17 16:38:26 +03:00
|
|
|
case "TestHelpers" =>
|
|
|
|
(`enso-test-java-helpers` / Compile / packageBin).value
|
2022-10-11 02:11:04 +03:00
|
|
|
case "All" =>
|
|
|
|
(`std-base` / Compile / packageBin).value
|
2023-02-17 16:38:26 +03:00
|
|
|
(`enso-test-java-helpers` / Compile / packageBin).value
|
2022-10-11 02:11:04 +03:00
|
|
|
(`std-table` / Compile / packageBin).value
|
|
|
|
(`std-database` / Compile / packageBin).value
|
|
|
|
(`std-image` / Compile / packageBin).value
|
|
|
|
(`std-google-api` / Compile / packageBin).value
|
2022-05-13 18:38:52 +03:00
|
|
|
case _ =>
|
2022-05-11 13:12:18 +03:00
|
|
|
}
|
2022-10-24 12:55:18 +03:00
|
|
|
val libs =
|
|
|
|
if (cmd != "All") Seq(cmd)
|
|
|
|
else {
|
|
|
|
val prefix = "Standard."
|
|
|
|
Editions.standardLibraries
|
|
|
|
.filter(_.startsWith(prefix))
|
|
|
|
.map(_.stripPrefix(prefix))
|
|
|
|
}
|
2022-10-11 02:11:04 +03:00
|
|
|
libs.foreach { lib =>
|
|
|
|
StdBits.buildStdLibPackage(
|
|
|
|
lib,
|
|
|
|
root,
|
|
|
|
cacheFactory,
|
|
|
|
log,
|
|
|
|
defaultDevEnsoVersion
|
|
|
|
)
|
|
|
|
}
|
2022-05-11 13:12:18 +03:00
|
|
|
}.evaluated
|
|
|
|
|
2020-12-09 16:58:11 +03:00
|
|
|
lazy val buildLauncherDistribution =
|
|
|
|
taskKey[Unit]("Builds the launcher distribution")
|
|
|
|
buildLauncherDistribution := {
|
|
|
|
val _ = (launcher / buildNativeImage).value
|
|
|
|
val root = launcherDistributionRoot.value
|
|
|
|
val log = streams.value.log
|
|
|
|
val cacheFactory = streams.value.cacheStoreFactory
|
|
|
|
DistributionPackage.createLauncherPackage(root, cacheFactory)
|
|
|
|
log.info(s"Launcher package created at $root")
|
|
|
|
}
|
|
|
|
|
|
|
|
lazy val buildProjectManagerDistribution =
|
|
|
|
taskKey[Unit]("Builds the project manager distribution")
|
|
|
|
buildProjectManagerDistribution := {
|
|
|
|
val _ = (`project-manager` / buildNativeImage).value
|
|
|
|
val root = projectManagerDistributionRoot.value
|
|
|
|
val log = streams.value.log
|
|
|
|
val cacheFactory = streams.value.cacheStoreFactory
|
|
|
|
DistributionPackage.createProjectManagerPackage(root, cacheFactory)
|
|
|
|
log.info(s"Project Manager package created at $root")
|
|
|
|
}
|
2021-04-07 17:19:23 +03:00
|
|
|
|
|
|
|
lazy val buildGraalDistribution =
|
|
|
|
taskKey[Unit]("Builds the GraalVM distribution")
|
|
|
|
buildGraalDistribution := {
|
|
|
|
val log = streams.value.log
|
|
|
|
val distOs = "DIST_OS"
|
|
|
|
val osName = "os.name"
|
|
|
|
val distName = sys.env.get(distOs).getOrElse {
|
|
|
|
val name = sys.props(osName).takeWhile(!_.isWhitespace)
|
|
|
|
if (sys.env.contains("CI")) {
|
|
|
|
log.warn(
|
|
|
|
s"$distOs env var is empty. Fallback to system property $osName=$name."
|
|
|
|
)
|
|
|
|
}
|
|
|
|
name
|
|
|
|
}
|
|
|
|
val os = DistributionPackage.OS(distName).getOrElse {
|
|
|
|
throw new RuntimeException(s"Failed to determine OS: $distName.")
|
|
|
|
}
|
|
|
|
packageBuilder.createGraalPackage(
|
|
|
|
log,
|
|
|
|
os,
|
|
|
|
DistributionPackage.Architecture.X64
|
|
|
|
)
|
|
|
|
}
|
2021-11-23 11:51:17 +03:00
|
|
|
|
|
|
|
lazy val updateLibraryManifests =
|
|
|
|
taskKey[Unit](
|
|
|
|
"Recomputes dependencies to update manifests bundled with libraries."
|
|
|
|
)
|
|
|
|
updateLibraryManifests := {
|
|
|
|
val _ = (`engine-runner` / assembly).value
|
|
|
|
val log = streams.value.log
|
|
|
|
val cacheFactory = streams.value.cacheStoreFactory
|
|
|
|
val libraries = Editions.standardLibraries.map(libName =>
|
|
|
|
BundledLibrary(libName, stdLibVersion)
|
|
|
|
)
|
|
|
|
|
|
|
|
LibraryManifestGenerator.generateManifests(
|
|
|
|
libraries,
|
|
|
|
file("distribution"),
|
|
|
|
log,
|
|
|
|
cacheFactory
|
|
|
|
)
|
|
|
|
}
|