This repository has been archived by the owner on Feb 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
80 lines (67 loc) · 2.6 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//TODO (user/cgccuser): clean this file up
// enablePlugins(ScalaJSPlugin)
// The VyxalS version
val vyxalVersion = "0.1.0"
//The version of Scala we use
val scalaversion = "3.1.1"
ThisBuild / scalaVersion := scalaversion
//Automatically reload SBT when build.sbt changes
Global / onChangedBuildSource := ReloadOnSourceChanges
Test / testOptions += Tests.Argument("-oN")
/*
Use ("com.foo" % "bar.baz" % version).cross(CrossVersion.for3Use2_13)
if needed
Use compile to just compile when testing on your computer
Use vyxalJVM/run to actually run the JVMMain class
Use fastOptJS to quickly link JS, and fullOptJS when releasing
Use vyxalJS/run to run the JSMain class (you will need Node.JS for this)
Both fastOptJS and fullOptJS output lib/scalajs-<version>.js
*/
import org.scalajs.linker.interface.OutputPatterns
lazy val root = project
.in(file("."))
.aggregate(vyxal.js, vyxal.jvm)
.settings(
publish := {},
publishLocal := {}
)
lazy val vyxal = crossProject(JSPlatform, JVMPlatform)
.in(file("."))
.settings(
name := "vyxal",
version := vyxalVersion,
libraryDependencies ++= Seq(
"org.scalatest" %%% "scalatest" % "3.2.10" % Test,
("org.typelevel" %%% "spire" % "0.17.0").cross(CrossVersion.for3Use2_13)
),
scalacOptions ++= Seq(
"-deprecation", // Emit warning and location for usages of deprecated APIs.
"-encoding",
"utf-8", // Specify character encoding used by source files.
// "-explain-types", // Explain type errors in more detail.
"-feature", // Emit warning and location for usages of features that should be imported explicitly.
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
// Above options from https://tpolecat.github.io/2017/04/25/scalac-flags.html
"-language:implicitConversions",
// "-explain",
"-print-lines",
"-Ycheck-all-patmat"
)
)
.jvmSettings(
// Add JVM-specific settings here
Compile / mainClass := Some("vyxal.JVMMain")
)
// .jsConfigure { project => project.enablePlugins(ScalaJSBundlerPlugin) }
.jsSettings(
// Add JS-specific settings here
// Compile / mainClass := Some("vyxal.Main"),
// scalaJSUseMainModuleInitializer := true,
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "2.2.0"
),
Compile / fastOptJS / artifactPath := baseDirectory.value / "lib" / s"scalajs-$vyxalVersion.js",
Compile / fullOptJS / artifactPath := baseDirectory.value / "lib" / s"scalajs-$vyxalVersion.js"
)
val genElements = taskKey[Unit]("genElements")
genElements := GenElements.run()