forked from enso-org/developer-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Set up the interpreter project. * Reformat build.sbt * Fix style guide
- Loading branch information
1 parent
c23209b
commit 6864549
Showing
5 changed files
with
90 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,92 @@ | ||
version := "1.0" | ||
// Global Configuration | ||
organization := "org.enso" | ||
scalaVersion := "2.12.8" | ||
|
||
// Compiler Options | ||
scalacOptions ++= Seq( | ||
"-deprecation", | ||
"-feature", | ||
"-unchecked", | ||
"-Xlint" | ||
) | ||
|
||
// Benchmark Configuration | ||
lazy val Benchmark = config("bench") extend Test | ||
lazy val bench = taskKey[Unit]("Run Benchmarks") | ||
lazy val bench = taskKey[Unit]("Run Benchmarks") | ||
|
||
// Global Project | ||
lazy val enso = (project in file(".")) | ||
.aggregate(syntax, pkg) | ||
.settings(version := "0.1") | ||
.aggregate( | ||
syntax, | ||
pkg, | ||
interpreter | ||
) | ||
|
||
// Sub-Projects | ||
lazy val syntax = (project in file("syntax")) | ||
.configs(Benchmark) | ||
.settings( | ||
inConfig(Benchmark)(Defaults.testSettings), | ||
name := "syntax", | ||
organization := "org.enso", | ||
scalaVersion := "2.12.8", | ||
scalacOptions ++= Seq("-deprecation", "-unchecked", "-feature", "-Xlint"), | ||
publishArtifact := false, | ||
mainClass in (Compile, run) := Some("org.enso.syntax.Main"), | ||
version := "0.1" | ||
) | ||
.settings( | ||
libraryDependencies ++= Seq( | ||
"com.storm-enroute" %% "scalameter" % "0.17" % "bench", | ||
"org.typelevel" %% "cats-core" % "1.6.0", | ||
"org.scalatest" %% "scalatest" % "3.0.5" % Test, | ||
"com.lihaoyi" %% "pprint" % "0.5.3" | ||
"org.typelevel" %% "cats-core" % "1.6.0", | ||
"org.scalatest" %% "scalatest" % "3.0.5" % Test, | ||
"com.lihaoyi" %% "pprint" % "0.5.3" | ||
), | ||
resolvers ++= Seq( | ||
"Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots", | ||
"Sonatype OSS Releases" at "https://oss.sonatype.org/content/repositories/releases" | ||
), | ||
"Sonatype OSS Snapshots" at | ||
"https://oss.sonatype.org/content/repositories/snapshots", | ||
"Sonatype OSS Releases" at | ||
"https://oss.sonatype.org/content/repositories/releases" | ||
) | ||
) | ||
.settings(SbtJFlexPlugin.jflexSettings) | ||
.configs(Test) | ||
.settings( | ||
testFrameworks += new TestFramework("org.scalameter.ScalaMeterFramework"), | ||
parallelExecution in Benchmark := false, | ||
logBuffered := false | ||
) | ||
.settings(SbtJFlexPlugin.jflexSettings) | ||
.settings(mainClass in (Compile, run) := Some("org.enso.syntax.Main")) | ||
.settings(bench := { | ||
(test in Benchmark).value | ||
}) | ||
.configs(Benchmark) | ||
.settings( | ||
inConfig(Benchmark)(Defaults.testSettings), | ||
bench := (test in Benchmark).value, | ||
parallelExecution in Benchmark := false | ||
) | ||
|
||
lazy val pkg = (project in file("pkg")) | ||
.settings( | ||
mainClass in (Compile, run) := Some("org.enso.pkg.Main"), | ||
version := "0.1" | ||
) | ||
.settings( | ||
libraryDependencies ++= Seq("circe-core", "circe-generic", "circe-yaml") | ||
.map("io.circe" %% _ % "0.10.0"), | ||
libraryDependencies += "commons-io" % "commons-io" % "2.6" | ||
) | ||
|
||
lazy val interpreter = (project in file("interpreter")) | ||
.settings( | ||
mainClass in (Compile, run) := Some("org.enso.interpreter.Main"), | ||
version := "0.1" | ||
) | ||
.settings( | ||
libraryDependencies ++= Seq( | ||
"com.chuusai" %% "shapeless" % "2.3.3", | ||
"com.storm-enroute" %% "scalameter" % "0.17" % "bench", | ||
"org.graalvm.sdk" % "graal-sdk" % "19.0.0", | ||
"org.scalacheck" %% "scalacheck" % "1.14.0" % Test, | ||
"org.scalatest" %% "scalatest" % "3.2.0-SNAP10" % Test, | ||
"org.typelevel" %% "cats-core" % "2.0.0-M4" | ||
) | ||
) | ||
.dependsOn(syntax) | ||
.configs(Test) | ||
.configs(Benchmark) | ||
.settings( | ||
inConfig(Benchmark)(Defaults.testSettings), | ||
bench := (test in Benchmark).value, | ||
parallelExecution in Benchmark := false | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.enso.interpreter | ||
|
||
import org.scalameter.Bench | ||
|
||
object MainBenchmark extends Bench.OfflineReport {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.enso.interpreter | ||
|
||
object Main { | ||
|
||
def main(args: Array[String]): Unit = { | ||
println(x = "Hello, Enso!") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.enso.interpreter | ||
|
||
import org.scalatest.FlatSpec | ||
import org.scalatest.Matchers | ||
|
||
class MainSpec extends FlatSpec with Matchers {} |