File tree Expand file tree Collapse file tree 2 files changed +10
-25
lines changed Expand file tree Collapse file tree 2 files changed +10
-25
lines changed Original file line number Diff line number Diff line change 11import scala .io .Source
22import scala .language .postfixOps
3- import scala .util .Try
4- import Helpers ._
3+ import sbt .io .Using
54
65val currentScalaVersion = " 2.13.6"
76
8- ThisBuild / scalaVersion := currentScalaVersion
9-
107inThisBuild(Seq (
8+ scalaVersion := currentScalaVersion,
9+ // Load version from the file so that Gradle/Shipkit and SBT use the same version
1110 version := sys.env
1211 .get(" PROJECT_VERSION" )
1312 .filter(_.trim.nonEmpty)
14- .toTry.recoverWith { case _ =>
15- withSource(Source .fromFile(baseDirectory.value / " version.properties" )) { source =>
16- source.getLines.collectFirst { case VersionRE (v) => v } get
13+ .orElse {
14+ lazy val VersionRE = """ ^version=(.+)$""" .r
15+ Using .file(Source .fromFile)(baseDirectory.value / " version.properties" ) {
16+ _.getLines.collectFirst { case VersionRE (v) => v }
1717 }
1818 }
1919 .map { _.replace(" .*" , " -SNAPSHOT" ) }
2020 .get
21- ))
21+ )
22+ )
2223
23- lazy val commonSettings : Seq [ Setting [_]] =
24+ lazy val commonSettings =
2425 Seq (
2526 organization := " org.mockito" ,
2627 // Load version from the file so that Gradle/Shipkit and SBT use the same version
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments