@@ -2,7 +2,6 @@ lazy val root = (project in file("."))
2
2
.settings(
3
3
name := " scala-http-client" ,
4
4
organization := " io.moia" ,
5
- version := " 1.3.1" ,
6
5
licenses += (" Apache-2.0" , url(" http://www.apache.org/licenses/LICENSE-2.0" )),
7
6
scmInfo := Some (ScmInfo (url(" https://github.com/moia-dev/scala-http-client" ), " scm:git@github.com:moia-dev/scala-http-client.git" )),
8
7
homepage := Some (url(" https://github.com/moia-dev/scala-http-client" )),
@@ -24,6 +23,11 @@ lazy val root = (project in file("."))
24
23
Defaults .itSettings,
25
24
scalacOptions in IntegrationTest := (scalacOptions in Compile ).value.filterNot(_ == " -Ywarn-dead-code" )
26
25
)
26
+ .settings(sbtGitSettings)
27
+ .enablePlugins(
28
+ GitVersioning ,
29
+ GitBranchPrompt
30
+ )
27
31
28
32
val akkaVersion = " 2.6.4"
29
33
val akkaHttpVersion = " 10.1.11"
@@ -93,3 +97,17 @@ lazy val sonatypeSettings = {
93
97
credentials += Credentials (Path .userHome / " .sbt" / " sonatype_credential" )
94
98
)
95
99
}
100
+
101
+ lazy val sbtVersionRegex = " v([0-9]+.[0-9]+.[0-9]+)-?(.*)?" .r
102
+
103
+ lazy val sbtGitSettings = Seq (
104
+ git.useGitDescribe := true ,
105
+ git.baseVersion := " 0.0.0" ,
106
+ git.uncommittedSignifier := None ,
107
+ git.gitTagToVersionNumber := {
108
+ case sbtVersionRegex(v, " " ) => Some (v)
109
+ case sbtVersionRegex(v, " SNAPSHOT" ) => Some (s " $v-SNAPSHOT " )
110
+ case sbtVersionRegex(v, s) => Some (s " $v- $s-SNAPSHOT " )
111
+ case _ => None
112
+ }
113
+ )
0 commit comments