@@ -4,37 +4,31 @@ val supportedScalaVersions = List(scala212, scala213)
44
55val logbackVersion = " 1.2.3"
66val scalaCollectionCompatibilityVersion = " 2.3.2"
7- val scoptVersion = " 4.0.1"
7+ val scoptVersion = " 4.0.0"
8+ val sdbVersion = " 4.4.10"
89val slf4jVersion = " 1.7.30"
910val utestVersion = " 0.7.7"
1011
11- val checkTasks = List (
12- " scalafmtCheckAll" ,
13- " scalastyle" ,
14- " versionPolicyCheck" ,
15- " githubWorkflowCheck" ,
16- " mdocCheck" ,
17- " evicted" ,
18- " undeclaredCompileDependenciesTest" ,
19- " unusedCompileDependenciesTest" ,
20- " dependencyCheckAggregate" ,
21- " test" ,
22- " scripted"
23- )
24-
2512addCommandAlias(
26- " check " ,
13+ " devCheck " ,
2714 supportedScalaVersions.flatMap { version =>
28- s " ++ $version" :: checkTasks.filterNot(_ == " scripted " && version == scala213)
29- }.mkString(" ; " )
15+ s " ++ $version" :: " githubWorkflowCheck " :: " check " :: ( if ( version == scala213) Nil else List ( " scripted " ) )
16+ }.mkString(" ;" )
3017)
3118
3219addCommandAlias(
33- " mdocCheck " ,
20+ " check " ,
3421 List (
35- """ set docs / mdocExtraArguments += "--check"""" ,
36- " docs / mdoc"
37- ).mkString(" ; " )
22+ " scalafmtCheckAll" ,
23+ " scalastyle" ,
24+ " versionPolicyCheck" ,
25+ " docs/mdoc --check" ,
26+ " evicted" ,
27+ " undeclaredCompileDependenciesTest" ,
28+ " unusedCompileDependenciesTest" ,
29+ " dependencyCheckAggregate" ,
30+ " test"
31+ ).mkString(" ;" )
3832)
3933
4034val isScala213 = settingKey[Boolean ](" Checks if the current Scala version is 2.13" )
@@ -58,19 +52,7 @@ inThisBuild(
5852 organization := " nz.co.bottech" ,
5953 organizationName := " BotTech" ,
6054 githubWorkflowBuild := List (
61- WorkflowStep .Sbt (List (" scalafmtCheckAll" , " scalastyle" ), name = Some (" Check formatting and style" )),
62- WorkflowStep .Sbt (List (" versionPolicyCheck" ), name = Some (" Check version adheres to the policy" )),
63- WorkflowStep .Sbt (List (" mdocCheck" ), name = Some (" Check documentation has been generated" )),
64- WorkflowStep .Sbt (
65- List (
66- " evicted" ,
67- " undeclaredCompileDependenciesTest" ,
68- " unusedCompileDependenciesTest" ,
69- " dependencyCheckAggregate"
70- ),
71- name = Some (" Check dependencies" )
72- ),
73- WorkflowStep .Sbt (List (" test" ), name = Some (" Build and test" )),
55+ WorkflowStep .Sbt (List (" check" ), name = Some (" Build, test and check libraries" )),
7456 WorkflowStep .Sbt (
7557 List (" scripted" ),
7658 name = Some (" Build and test sbt plugin" ),
@@ -126,10 +108,8 @@ val metaProjectSettings = List(
126108 publish / skip := true
127109)
128110
129- val libraryProjectSettings = commonProjectSettings
130-
131111lazy val root = (project in file(" ." ))
132- .aggregate(cli, core, docs, sbtProject)
112+ .aggregate(cli, core, docs, example, sbtProject)
133113 .settings(metaProjectSettings)
134114 .settings(
135115 crossScalaVersions := supportedScalaVersions,
@@ -141,7 +121,7 @@ lazy val root = (project in file("."))
141121 )
142122
143123lazy val core = project
144- .settings(libraryProjectSettings )
124+ .settings(commonProjectSettings )
145125 .settings(
146126 libraryDependencies ++= collectionsCompatibilityDependency.value,
147127 libraryDependencies ++= List (
@@ -154,7 +134,7 @@ lazy val core = project
154134 ),
155135 name := s " ${(LocalRootProject / name).value}" ,
156136 semanticdbEnabled := true ,
157- semanticdbVersion := " 4.4.10 " ,
137+ semanticdbVersion := sdbVersion ,
158138 testFrameworks += new TestFramework (" utest.runner.Framework" ),
159139 Test / managedSourceDirectories += (Test / semanticdbTargetRoot).value,
160140 Test / fullClasspath += (Test / semanticdbTargetRoot).value
@@ -163,7 +143,7 @@ lazy val core = project
163143lazy val cli = project
164144 .dependsOn(core)
165145 .enablePlugins(BuildInfoPlugin )
166- .settings(libraryProjectSettings )
146+ .settings(commonProjectSettings )
167147 .settings(
168148 buildInfoKeys := Seq [BuildInfoKey ](version),
169149 buildInfoPackage := s " ${organization.value}. ${(LocalRootProject / name).value}" ,
@@ -183,10 +163,9 @@ lazy val sbtProject = (project in file("sbt"))
183163 .settings(commonProjectSettings)
184164 .settings(
185165 libraryDependencies ++= {
186- // Don't add dependencies when the rest of the build is cross building with Scala 2.13
187- // otherwise it will cause a whole lot of resolution failures.
188- if ((core / isScala213).value) Nil
189- else
166+ // Only add dependencies when the build is building with a Scala version that is
167+ // sbt compatible otherwise it will cause a whole lot of resolution failures.
168+ if (spspCanBuild.value)
190169 collectionsCompatibilityDependency.value ++ List (
191170 " org.scala-sbt" %% " collections" % sbtVersion.value,
192171 " org.scala-sbt" %% " command" % sbtVersion.value,
@@ -202,6 +181,7 @@ lazy val sbtProject = (project in file("sbt"))
202181 " org.scala-sbt" %% " util-logging" % sbtVersion.value,
203182 " org.scala-sbt" %% " util-position" % sbtVersion.value
204183 )
184+ else Nil
205185 },
206186 name := s " sbt- ${(LocalRootProject / name).value}" ,
207187 scriptedBufferLog := false ,
@@ -230,6 +210,15 @@ lazy val docs = (project in file("doc-templates"))
230210 unusedCompileDependenciesFilter -= moduleFilter(" org.scalameta" , " mdoc*" )
231211 )
232212
213+ lazy val example = project
214+ .settings(commonProjectSettings)
215+ .settings(
216+ semanticdbEnabled := true ,
217+ semanticdbIncludeInJar := true ,
218+ semanticdbVersion := sdbVersion,
219+ versionPolicyFirstVersion := Some (" 0.1.13" ),
220+ )
221+
233222def isScala213Setting : Def .Initialize [Boolean ] = Def .setting {
234223 CrossVersion .partialVersion(scalaVersion.value) match {
235224 case Some ((2 , n)) if n == 13 => true
0 commit comments