-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
54 lines (45 loc) · 2.02 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
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}
/* Build after:
* https://github.com/portable-scala/sbt-crossproject
* https://docs.scala-lang.org/overviews/contributors/index.html
*/
val nightly = "3.4.0-RC1-bin-20230901-89e8dba-NIGHTLY"
val latest = "3.4.0"
val stable = "3.3.3"
/* Set to 1 for publishing to exclude the demo/test files. */
val publishMe: Int = 0
ThisBuild / version := "0.6.1"
ThisBuild / scalaVersion := stable
val sharedSettings = Seq(
name := "leucine",
organization := "com.sense2act",
description := "Small x-platform actor framework.",
scalacOptions ++= Seq("-feature","-deprecation","-unchecked","-explain","-Wunused:all","-Wnonunit-statement","-Wvalue-discard"),
libraryDependencies ++= Seq("com.lihaoyi" %%% "utest" % "0.8.1" % Test).drop(publishMe),
testFrameworks += new TestFramework("s2a.control.LeucineFramework"),
Compile / excludeFilter := new FileFilter { def accept(f: File) = (publishMe==1) && (f.getPath.containsSlice("/demo/") || f.getPath.containsSlice("/test/")) },
)
val jvmSettings = Seq(
assembly / assemblyJarName := "main.jar"
)
val jsSettings = Seq(
scalaJSUseMainModuleInitializer := true,
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule) },
/* Remove test which cannot run on the JS-Emulated platform.*/
Test / testOptions := Seq(Tests.Filter(s => !s.endsWith("NJS")))
)
val nativeSettings = Seq(
/* The default mode is 'debug', to get smaller/faster code use: */
//nativeMode := "release-full"
/* This setting is a requirement for uTest on Native */
nativeLinkStubs := true,
/* Remove test which cannot run on the Native platform.*/
Test / testOptions := Seq(Tests.Filter(s => !s.endsWith("NN")))
)
lazy val leucine = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.crossType(CrossType.Full)
.in(file("."))
.settings(sharedSettings)
.jvmSettings(jvmSettings)
.jsSettings(jsSettings)
.nativeSettings(nativeSettings)