generated from FunktionalIO/project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
148 lines (139 loc) · 6.01 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport.*
import sbt.*
import sbt.Keys.*
import scala.collection.Seq
import xerial.sbt.Sonatype.GitHubHosting
import xerial.sbt.Sonatype.sonatypeCentralHost
ThisBuild / tlBaseVersion := "0.0"
val scala3Version = "3.5.2"
ThisBuild / name := "mason"
ThisBuild / homepage := Some(url(s"https://github.com/FunktionalIO/${(ThisBuild / name).value}"))
ThisBuild / description := ""
ThisBuild / scalaVersion := scala3Version
ThisBuild / organization := "io.funktional"
ThisBuild / organizationName := "Funktional"
ThisBuild / organizationHomepage := Some(url("https://funktional.io"))
ThisBuild / startYear := Some(2024)
ThisBuild / licenses := Seq("EPL-2.0" -> url("https://opensource.org/licenses/EPL-2.0"))
ThisBuild / developers := List(
Developer(
id = "rlemaitre",
name = "Raphaël Lemaitre",
email = "[email protected]",
url = url("https://rlemaitre.com")
)
)
// Publication
ThisBuild / sonatypeCredentialHost := sonatypeCentralHost
ThisBuild / sonatypeProjectHosting := Some(GitHubHosting(
"FunktionalIO",
(ThisBuild / name).value,
))
ThisBuild / scmInfo := Some(
ScmInfo(
url(s"https://github.com/FunktionalIO/${(ThisBuild / name).value}"),
s"scm:git:[email protected]:FunktionalIO/${(ThisBuild / name).value}.git"
)
)
// Github actions
ThisBuild / githubWorkflowOSes := Seq("ubuntu-latest")
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("17"))
// Dependencies versions
val versions = new {
val munit = "1.0.3"
}
val sharedSettings = Seq(
organization := "io.funktional",
scalaVersion := "3.3.4",
libraryDependencies ++= Seq(
"org.scalameta" %%% "munit" % "1.0.2" % Test
),
// Headers
headerMappings := headerMappings.value + (HeaderFileType.scala -> HeaderCommentStyle.cppStyleLineComment),
headerLicense := Some(HeaderLicense.Custom(
"""|Copyright (c) 2024-2024 by Raphaël Lemaitre and Contributors
|This software is licensed under the Eclipse Public License v2.0 (EPL-2.0).
|For more information see LICENSE or https://opensource.org/license/epl-2-0
|""".stripMargin
))
)
lazy val common = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.in(file("modules/common"))
.settings(sharedSettings)
.settings(
name := s"${(ThisBuild / name).value}-common",
libraryDependencies ++= Seq(
"io.github.iltotore" %%% "iron" % "2.6.0",
"io.github.iltotore" %%% "iron-circe" % "2.6.0",
"com.softwaremill.sttp.tapir" %%% "tapir-core" % "1.11.10",
"com.softwaremill.sttp.tapir" %%% "tapir-json-circe" % "1.11.10",
"com.softwaremill.sttp.tapir" %%% "tapir-iron" % "1.11.10",
"com.softwaremill.sttp.shared" %%% "fs2" % "1.4.0",
"co.fs2" %%% "fs2-core" % "3.11.0"
)
)
lazy val backend = project
.in(file("modules/backend"))
.enablePlugins(BuildInfoPlugin)
.enablePlugins(SbtTwirl)
.enablePlugins(JavaAppPackaging)
.dependsOn(common.jvm)
.settings(sharedSettings)
.settings(
name := s"${(ThisBuild / name).value}-backend",
scalaVersion := scala3Version,
buildInfoKeys := Seq[BuildInfoKey](name, version, description),
buildInfoPackage := "mason.build",
buildInfoOptions := Seq(BuildInfoOption.Traits("pillars.BuildInfo")),
Compile / mainClass := Some("mason.Main"),
libraryDependencies ++= Seq(
"com.rlemaitre" %% "pillars-core" % "0.4.1",
"com.rlemaitre" %% "pillars-db-skunk" % "0.4.1",
"com.rlemaitre" %% "pillars-db-migration" % "0.4.1",
"com.rlemaitre" %% "pillars-flags" % "0.4.1",
"com.rlemaitre" %% "pillars-http-client" % "0.4.1",
"com.softwaremill.sttp.shared" %% "fs2" % "1.4.0",
"co.fs2" %% "fs2-core" % "3.11.0",
"co.fs2" %% "fs2-io" % "3.11.0",
"org.postgresql" % "postgresql" % "42.7.4",
"org.flywaydb" % "flyway-database-postgresql" % "11.0.1",
"org.scalameta" %% "munit" % versions.munit % Test,
"org.typelevel" %% "munit-cats-effect" % "2.0.0" % Test
),
libraryDependencySchemes += "io.circe" %% "circe-yaml" % VersionScheme.Always
)
lazy val frontend = project
.in(file("modules/frontend"))
.enablePlugins(ScalaJSPlugin, SbtVitePlugin)
.dependsOn(common.js)
.settings(sharedSettings)
.settings(
name := s"${(ThisBuild / name).value}-frontend",
scalaJSUseMainModuleInitializer := true,
viteOtherSources := Seq(
Location.FromProject(file("src/main/entrypoint")),
Location.FromProject(file("src/main/styles"))
),
scalaJSLinkerConfig ~= {
_.withModuleKind(ModuleKind.CommonJSModule)
// .withModuleSplitStyle(
// ModuleSplitStyle.SmallModulesFor(List("main"))
// )
},
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "2.8.0",
"com.raquo" %%% "laminar" % "17.1.0",
"io.github.iltotore" %%% "iron" % "2.6.0",
"io.github.iltotore" %%% "iron-circe" % "2.6.0"
)
)
lazy val root = project
.in(file("."))
.aggregate(backend)
.settings(sharedSettings)
.settings(
name := (ThisBuild / name).value,
publish / skip := true
)