11import sbt .project
22import ModuleMdocPlugin .autoImport .mdocScalacOptions
33
4- val prjName = " scope"
5- val org = " com.github.geirolz"
4+ val prjName = " scope"
5+ val org = " com.github.geirolz"
6+ lazy val scala213 = " 2.13.8"
7+ lazy val scala31 = " 3.1.3"
8+ lazy val supportedScalaVersions = List (scala213, scala31)
69
710// ## global project to no publish ##
811val copyReadMe = taskKey[Unit ](" Copy generated README to main folder." )
@@ -31,12 +34,10 @@ lazy val scope: Project = project
3134 name := prjName,
3235 description := " A functional and type safe models layer separator" ,
3336 organization := org,
34-
35- // docs
36- copyReadMe := IO .copyFile(file(" docs/compiled/README.md" ), file(" README.md" )),
37- (Compile / compile) := (Compile / compile)
38- .dependsOn(copyReadMe.toTask.dependsOn((docs / mdoc).toTask(" " )))
39- .value
37+ crossScalaVersions := Nil
38+ )
39+ .settings(
40+ copyReadMe := IO .copyFile(file(" docs/compiled/README.md" ), file(" README.md" ))
4041 )
4142 .aggregate(core, docs, generic)
4243
@@ -105,20 +106,19 @@ def buildModule(prjModuleName: String, toPublish: Boolean, folder: String): Proj
105106}
106107
107108// =============================== SETTINGS ===============================
108- lazy val allSettings = baseSettings
109-
110- lazy val noPublishSettings = Seq (
109+ lazy val noPublishSettings : Seq [Def .Setting [_]] = Seq (
111110 publish := {},
112111 publishLocal := {},
113112 publishArtifact := false ,
114113 publish / skip := true
115114)
116115
117- lazy val baseSettings = Seq (
116+ lazy val baseSettings : Seq [ Def . Setting [_]] = Seq (
118117 // scala
119- crossScalaVersions := List ( " 2.13.8 " , " 3.1.3 " ) ,
120- scalaVersion := crossScalaVersions.value .head,
118+ crossScalaVersions := supportedScalaVersions ,
119+ scalaVersion := supportedScalaVersions .head,
121120 scalacOptions ++= scalacSettings(scalaVersion.value),
121+ versionScheme := Some (" early-semver" ),
122122 // dependencies
123123 resolvers ++= ProjectResolvers .all,
124124 libraryDependencies ++= ProjectDependencies .common ++ {
@@ -142,7 +142,8 @@ def scalacSettings(scalaVersion: String): Seq[String] =
142142 " -language:existentials" , // Existential types (besides wildcard types) can be written and inferred
143143 " -language:experimental.macros" , // Allow macro definition (besides implementation and application)
144144 " -language:higherKinds" , // Allow higher-kinded types
145- " -language:implicitConversions" // Allow definition of implicit functions called views
145+ " -language:implicitConversions" , // Allow definition of implicit functions called views
146+ " -language:dynamics"
146147 ) ++ {
147148 CrossVersion .partialVersion(scalaVersion) match {
148149 case Some ((3 , _)) =>
@@ -194,3 +195,4 @@ def scalacSettings(scalaVersion: String): Seq[String] =
194195
195196// =============================== ALIASES ===============================
196197addCommandAlias(" check" , " ;clean;test" )
198+ addCommandAlias(" generate-docs" , " mdoc;copyReadMe;" )
0 commit comments