@@ -3,19 +3,22 @@ organization := "com.github.sbt"
33homepage := Some (url(" https://github.com/sbt/sbt-native-packager" ))
44
55Global / onChangedBuildSource := ReloadOnSourceChanges
6- Global / scalaVersion := " 2.12.20"
76
87// crossBuildingSettings
8+ lazy val scala212 = " 2.12.20"
9+ lazy val scala3 = " 3.6.2"
10+ Global / scalaVersion := scala3
11+ crossScalaVersions := Seq (scala3, scala212)
912(pluginCrossBuild / sbtVersion) := {
1013 scalaBinaryVersion.value match {
11- case " 2.12" => " 1.1.6 "
12- case _ => " 2.0.0-M2 "
14+ case " 2.12" => " 1.5.8 "
15+ case _ => " 2.0.0-M3 "
1316 }
1417}
1518scriptedSbt := {
1619 scalaBinaryVersion.value match {
17- case " 2.12" => " 1.10.5 "
18- case _ => " 2.0.0-M2 "
20+ case " 2.12" => " 1.10.7 "
21+ case _ => " 2.0.0-M3 "
1922 }
2023}
2124
@@ -48,8 +51,7 @@ libraryDependencies ++= {
4851// scala version depended libraries
4952libraryDependencies ++= {
5053 scalaBinaryVersion.value match {
51- case " 2.10" => Nil
52- case _ =>
54+ case " 2.12" =>
5355 Seq (
5456 // Do NOT upgrade these dependencies to 2.x or newer! sbt-native-packager is a sbt-plugin
5557 // and gets published with Scala 2.12, therefore we need to stay at the same major version
@@ -58,6 +60,8 @@ libraryDependencies ++= {
5860 " org.scala-lang.modules" %% " scala-parser-combinators" % " 1.1.2" , // Do not upgrade beyond 1.x
5961 " org.scala-lang.modules" %% " scala-xml" % " 2.2.0"
6062 )
63+ case _ =>
64+ Nil
6165 }
6266}
6367
@@ -79,11 +83,11 @@ mimaPreviousArtifacts := {
7983 val m = " com.typesafe.sbt" %% moduleName.value % " 1.3.15"
8084 val sbtBinV = (pluginCrossBuild / sbtBinaryVersion).value
8185 val scalaBinV = (update / scalaBinaryVersion).value
82- if ( scalaBinV == " 2.10 " ) {
83- println( s " Skip MiMa check for SBT binary version ${sbtBinV} as scala ${scalaBinV} is not supported " )
84- Set .empty
85- } else
86- Set ( Defaults .sbtPluginExtra(m cross CrossVersion .disabled, sbtBinV, scalaBinV))
86+ scalaBinV match {
87+ case " 2.12 " =>
88+ Set ( Defaults .sbtPluginExtra(m cross CrossVersion .disabled, sbtBinV, scalaBinV))
89+ case _ => Set .empty
90+ }
8791}
8892
8993// Release configuration
@@ -108,7 +112,8 @@ developers := List(
108112addCommandAlias(" scalafmtFormatAll" , " ; ^scalafmtAll ; scalafmtSbt" )
109113// ci commands
110114addCommandAlias(" validateFormatting" , " ; scalafmtCheckAll ; scalafmtSbtCheck" )
111- addCommandAlias(" validate" , " ; clean ; update ; validateFormatting ; test ; mimaReportBinaryIssues" )
115+ // Ignore mimaReportBinaryIssues
116+ addCommandAlias(" validate" , " ; clean ; update ; validateFormatting ; test" )
112117
113118// List all scripted test separately to schedule them in different travis-ci jobs.
114119// Travis-CI has hard timeouts for jobs, so we run them in smaller jobs as the scripted
@@ -136,3 +141,19 @@ addCommandAlias("validateWindows", "; testOnly * -- -n windows ; scripted univer
136141addCommandAlias(" validateJlink" , " scripted jlink/*" )
137142
138143addCommandAlias(" ci-release" , " release with-defaults" )
144+
145+ // So that publishLocal doesn't continuously create new versions
146+ def versionFmt (out : sbtdynver.GitDescribeOutput ): String = {
147+ val snapshotSuffix =
148+ if (out.isSnapshot()) " -SNAPSHOT"
149+ else " "
150+ out.ref.dropPrefix + snapshotSuffix
151+ }
152+
153+ def fallbackVersion (d : java.util.Date ): String = s " HEAD- ${sbtdynver.DynVer timestamp d}"
154+
155+ ThisBuild / version := dynverGitDescribeOutput.value.mkVersion(versionFmt, fallbackVersion(dynverCurrentDate.value))
156+ ThisBuild / dynver := {
157+ val d = new java.util.Date
158+ sbtdynver.DynVer .getGitDescribeOutput(d).mkVersion(versionFmt, fallbackVersion(d))
159+ }
0 commit comments