-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sbt
169 lines (151 loc) · 4.55 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
import ReleaseTransformations._
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}
import scala.scalanative.build._
name := "minart"
ThisBuild / organization := "eu.joaocosta"
ThisBuild / publishTo := sonatypePublishToBundle.value
ThisBuild / scalaVersion := "3.3.4"
ThisBuild / licenses := Seq("MIT License" -> url("http://opensource.org/licenses/MIT"))
ThisBuild / homepage := Some(url("https://github.com/JD557/minart"))
ThisBuild / scmInfo := Some(
ScmInfo(
url("https://github.com/JD557/minart"),
"scm:git@github.com:JD557/minart.git"
)
)
ThisBuild / versionScheme := Some("semver-spec")
ThisBuild / autoAPIMappings := true
ThisBuild / scalacOptions ++= Seq(
"-encoding",
"utf8",
"-deprecation",
"-feature",
"-unchecked",
"-language:higherKinds",
"-Wunused:implicits",
"-Wunused:explicits",
"-Wunused:imports",
"-Wunused:locals",
"-Wunused:params",
"-Wunused:privates"
// "-Xfatal-warnings"
)
ThisBuild / scalafmtOnCompile := true
ThisBuild / semanticdbEnabled := true
ThisBuild / semanticdbVersion := scalafixSemanticdb.revision
ThisBuild / scalafixOnCompile := true
ThisBuild / resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
Global / concurrentRestrictions += Tags.limit(
NativeTags.Link,
1
) // See https://github.com/scala-native/scala-native/issues/2024
val siteSettings = Seq(
Compile / doc / scalacOptions ++= Seq("-siteroot", "docs")
)
def docSettings(projectName: String) = Seq(
Compile / doc / scalacOptions ++= Seq(
"-project",
projectName,
"-project-version",
version.value,
"-social-links:" +
"github::https://github.com/JD557/Minart"
)
)
val sharedSettings = Seq()
val testSettings = Seq(
libraryDependencies ++= Seq(
"org.scalameta" %%% "munit" % "1.0.2" % Test // Bootlegged
),
testFrameworks += new TestFramework("munit.Framework")
)
val publishSettings = Seq(
publishMavenStyle := true,
Test / publishArtifact := false,
pomIncludeRepository := { _ => false }
)
val jsSettings = Seq(
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "2.8.0"
)
)
val nativeSettings = Seq(
Compile / nativeConfig ~= {
_.withMode(Mode.releaseFull)
.withLinkStubs(true)
.withLTO(LTO.thin)
},
Test / nativeConfig ~= {
_.withMode(Mode.debug)
.withLinkStubs(true)
.withLTO(LTO.none)
.withEmbedResources(true)
}
)
lazy val root =
crossProject(JVMPlatform, JSPlatform, NativePlatform)
.in(file("."))
.settings(name := "minart")
.settings(sharedSettings)
.settings(publishSettings)
.jsSettings(jsSettings)
.nativeSettings(nativeSettings)
.dependsOn(core, backend, image, sound)
.aggregate(core, backend, image, sound)
lazy val core =
crossProject(JVMPlatform, JSPlatform, NativePlatform)
.settings(name := "minart-core")
.settings(sharedSettings)
.settings(testSettings)
.settings(publishSettings)
.settings(docSettings("Minart"))
.settings(siteSettings)
.jsSettings(jsSettings)
.nativeSettings(nativeSettings)
lazy val backend =
crossProject(JVMPlatform, JSPlatform, NativePlatform)
.dependsOn(core)
.settings(name := "minart-backend")
.settings(sharedSettings)
.settings(testSettings)
.settings(publishSettings)
.settings(docSettings("Minart Backend"))
.jsSettings(jsSettings)
.nativeSettings(nativeSettings)
lazy val image =
crossProject(JVMPlatform, JSPlatform, NativePlatform)
.dependsOn(core, backend % "test")
.settings(name := "minart-image")
.settings(sharedSettings)
.settings(testSettings)
.settings(publishSettings)
.settings(docSettings("Minart Image"))
.jsSettings(jsSettings)
.nativeSettings(nativeSettings)
lazy val sound =
crossProject(JVMPlatform, JSPlatform, NativePlatform)
.dependsOn(core, backend % "test")
.settings(name := "minart-sound")
.settings(sharedSettings)
.settings(testSettings)
.settings(publishSettings)
.settings(docSettings("Minart Sound"))
.jsSettings(jsSettings)
.nativeSettings(nativeSettings)
releaseCrossBuild := true
releaseTagComment := s"Release ${(ThisBuild / version).value}"
releaseCommitMessage := s"Set version to ${(ThisBuild / version).value}"
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("publishSigned"),
releaseStepCommand("sonatypeBundleRelease"),
setNextVersion,
commitNextVersion,
pushChanges
)