-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
118 lines (103 loc) · 3.32 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
Global / onChangedBuildSource := ReloadOnSourceChanges
ThisBuild / tlBaseVersion := "0.0"
ThisBuild / organization := "io.github.pierrenodet"
ThisBuild / organizationName := "Pierre Nodet"
ThisBuild / startYear := Some(2023)
ThisBuild / licenses := Seq(License.Apache2)
ThisBuild / developers := List(tlGitHubDev("pierrenodet", "Pierre Nodet"))
ThisBuild / tlSonatypeUseLegacyHost := false
val Scala3 = "3.3.0"
ThisBuild / scalaVersion := Scala3
val PrimaryJava = JavaSpec.temurin("8")
val LTSJava = JavaSpec.temurin("17")
val GraalVM = JavaSpec.graalvm("17")
ThisBuild / githubWorkflowJavaVersions := Seq(PrimaryJava, LTSJava, GraalVM)
lazy val root = tlCrossRootProject
.aggregate(core, benchmarks, examples)
ThisBuild / tlCiReleaseBranches := Seq.empty
ThisBuild / githubWorkflowAddedJobs +=
WorkflowJob(
"coverage",
"Generate Coverage Report",
githubWorkflowJobSetup.value.toList ++ List(
WorkflowStep.Sbt(
List("coverage", s"${root.jvm.id}/test", "coverageAggregate"),
name = Some("Generate Coverage Report")
),
WorkflowStep.Use(
UseRef.Public(
"codecov",
"codecov-action",
"v2"
)
)
),
javas = List(PrimaryJava),
scalas = List(Scala3)
)
ThisBuild / githubWorkflowAddedJobs +=
WorkflowJob(
"site",
"Generate Site",
githubWorkflowJobSetup.value.toList ++ List(
WorkflowStep.Sbt(
List(s"${core.jvm.id}/doc"),
name = Some("Generate site")
),
WorkflowStep.Use(
UseRef.Public("peaceiris", "actions-gh-pages", "v3.8.0"),
Map(
"github_token" -> s"$${{ secrets.GITHUB_TOKEN }}",
"publish_dir" -> {
val path = (ThisBuild / baseDirectory).value.toPath.toAbsolutePath
.relativize((core.jvm / Compile / doc / target).value.toPath)
(0 until path.getNameCount).map(path.getName).mkString("/")
},
"keep_files" -> "false"
),
name = Some("Publish site"),
cond = Some(
s"github.event_name != 'pull_request' && github.ref == 'refs/heads/main'"
)
)
),
scalas = List(Scala3),
javas = List(PrimaryJava)
)
lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.crossType(CrossType.Pure)
.in(file("core"))
.settings(
name := "matou",
libraryDependencies ++= Seq(
"org.scalameta" %%% "munit" % "1.0.0-M8" % Test,
"org.scalameta" %%% "munit-scalacheck" % "1.0.0-M8" % Test
)
)
.settings(docs.settings)
lazy val benchmarks: Project = project
.in(file("benchmarks"))
.settings(
moduleName := "matou-benchmarks",
libraryDependencies ++= Seq(
"dev.ludovic.netlib" % "blas" % "3.0.3"
)
)
.settings(
Jmh / compile := (Jmh / compile).dependsOn(Test / compile).value,
Jmh / run := (Jmh / run).dependsOn(Jmh / compile).evaluated
)
.enablePlugins(JmhPlugin, NoPublishPlugin)
.dependsOn(core.jvm)
ThisBuild / resolvers += "jitpack" at "https://jitpack.io"
ThisBuild / fork / run := true
lazy val examples: Project = project
.in(file("examples"))
.settings(
moduleName := "matou-examples",
libraryDependencies ++= Seq(
"com.github.micycle1" % "processing-core-4" % "4.1.1"
)
)
.enablePlugins(NoPublishPlugin)
.dependsOn(core.jvm)