From 79502e93b4a93a1edf00ad34d7be6b9b19f9105d Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Thu, 5 Oct 2017 13:30:51 -0700 Subject: Set up automatic versioning --- build.sbt | 6 ++++++ publish.sbt | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/build.sbt b/build.sbt index 5b9ea39..08efff3 100644 --- a/build.sbt +++ b/build.sbt @@ -1,3 +1,9 @@ +name := "tracing" +version in ThisBuild := { + import sys.process._ + ("git describe --always --dirty=-SNAPSHOT --match v[0-9].*" !!).tail.trim +} + scalaVersion := "2.12.3" libraryDependencies ++= Seq( diff --git a/publish.sbt b/publish.sbt index 31c76f1..ac75e3d 100644 --- a/publish.sbt +++ b/publish.sbt @@ -3,10 +3,12 @@ licenses in ThisBuild := Seq( ("Apache 2.0", url("https://www.apache.org/licenses/LICENSE-2.0"))) homepage in ThisBuild := Some(url("https://github.com/drivergroup/tracing")) publishMavenStyle in ThisBuild := true -publishTo in ThisBuild := { - val nexus = "https://oss.sonatype.org/" - Some("releases" at nexus + "service/local/staging/deploy/maven2") -} +publishTo := Some( + if (isSnapshot.value) + Opts.resolver.sonatypeSnapshots + else + Opts.resolver.sonatypeStaging +) scmInfo := Some( ScmInfo( -- cgit v1.2.3