-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sbt
94 lines (86 loc) · 3.49 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
val Versions = new { // sbt doesn't like object definitions in build.sbt
val circe = "0.14.10"
val circeRefined = "0.15.1"
val disciplineMUnit = "2.0.0"
val fs2 = "3.11.0"
val kittens = "3.4.0"
val lucumaCore = "0.112.1"
val lucumaODBSchema = "0.17.3"
val munit = "1.0.3"
val munitCatsEffect = "2.0.0"
}
ThisBuild / tlBaseVersion := "0.110"
ThisBuild / tlCiReleaseBranches := Seq("main")
ThisBuild / crossScalaVersions := Seq("3.6.2")
ThisBuild / tlVersionIntroduced := Map("3" -> "0.29.0")
Global / onChangedBuildSource := ReloadOnSourceChanges
ThisBuild / ScalafixConfig / bspEnabled.withRank(KeyRanks.Invisible) := false
// Publish the package to npm, using the version from the git tag (won't be committed to the repo)
ThisBuild / githubWorkflowPublishPostamble += WorkflowStep.Run(
name = Some("Publish npm package"),
cond = Some("github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v')"),
commands = List(
"echo \"//registry.npmjs.org/:_authToken=${{ secrets.NPM_REPO_TOKEN }}\" > ~/.npmrc",
"npm version from-git --git-tag-version=false",
"npm publish --access public"
)
)
lazy val root = tlCrossRootProject.aggregate(model, testkit, lucumaSchemas, modelTests)
val model =
crossProject(JVMPlatform, JSPlatform)
.crossType(CrossType.Pure)
.in(file("model"))
.settings(
moduleName := "lucuma-schemas-model",
libraryDependencies ++= Seq(
"io.circe" %%% "circe-core" % Versions.circe,
"io.circe" %%% "circe-generic" % Versions.circe,
"io.circe" %%% "circe-refined" % Versions.circeRefined,
"org.typelevel" %%% "kittens" % Versions.kittens,
"edu.gemini" %%% "lucuma-core" % Versions.lucumaCore,
"edu.gemini" %%% "lucuma-odb-schema" % Versions.lucumaODBSchema
)
)
val testkit =
crossProject(JVMPlatform, JSPlatform)
.crossType(CrossType.Pure)
.in(file("testkit"))
.dependsOn(model)
.settings(
moduleName := "lucuma-schemas-testkit",
libraryDependencies ++= Seq(
"edu.gemini" %%% "lucuma-core-testkit" % Versions.lucumaCore
)
)
val modelTests =
crossProject(JVMPlatform, JSPlatform)
.crossType(CrossType.Pure)
.in(file("tests"))
.dependsOn(testkit)
.enablePlugins(NoPublishPlugin)
.settings(
libraryDependencies ++= Seq(
"org.typelevel" %%% "discipline-munit" % Versions.disciplineMUnit % Test,
"org.scalameta" %%% "munit" % Versions.munit % Test
)
)
val lucumaSchemas =
crossProject(JVMPlatform, JSPlatform)
.crossType(CrossType.Pure)
.in(file("lucuma-schemas"))
.dependsOn(model)
.settings(
moduleName := "lucuma-schemas",
libraryDependencies ++= Seq(
"co.fs2" %%% "fs2-io" % Versions.fs2 % Test,
"org.scalameta" %%% "munit" % Versions.munit % Test,
"org.typelevel" %%% "munit-cats-effect" % Versions.munitCatsEffect % Test
),
Compile / clueSourceDirectory := (ThisBuild / baseDirectory).value / "lucuma-schemas" / "src" / "clue",
// Include schema files in jar.
Compile / unmanagedResourceDirectories += (Compile / clueSourceDirectory).value / "resources"
)
.jsSettings(
Test / scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule))
)
.enablePlugins(CluePlugin)