Skip to content

Commit 9830d10

Browse files
committed
isSnapshot may be false for manually overriden versions
When using `sbt -Dscala.version=2.X.Y` to test out packages, newer version of sbt-git have been setting `isSnapshot` to false if there isn't a tag associated with the current commit of scala/scala-dist. This makes it hard to test out changes in this repo as we get diffs like: ``` $ rpm -qip /home/ubuntu/code/scala-dist-baseline/target/scala-2.13.6.rpm Name : scala Version : 2.13.6 Release : 1 Architecture: noarch Install Date: (not installed) Group : Development/Languages Size : 649267584 License : BSD Signature : (none) Source RPM : scala-2.13.6-1.src.rpm ``` ``` $ rpm -qip /home/ubuntu/code/scala-dist/target/scala-2.13.6.rpm Name : scala Version : 2.13.6 Release : SNAPSHOT Architecture: noarch Install Date: (not installed) Group : Development/Languages Size : 649267584 License : BSD Signature : (none) Source RPM : scala-2.13.6-SNAPSHOT.src.rpm ... ```
1 parent 83451fd commit 9830d10

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

build.sbt

+7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ useJGit
88
// For testing, the version may be overridden with -Dproject.version=...
99
versionWithGit
1010

11+
isSnapshot := {
12+
git.overrideVersion(git.versionProperty.value) match {
13+
case Some(v) => v.endsWith("-SNAPSHOT") || git.gitUncommittedChanges.value
14+
case _ => isSnapshot.value // defined in SbtGit.scala
15+
}
16+
}
17+
1118
Versioning.settings
1219

1320
// necessary since sbt 0.13.12 for some dark and mysterious reason

0 commit comments

Comments
 (0)