-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #255 from eed3si9n/wip/reproduce_dynverAssertTagVe…
…rsion_null Fix dynverAssertTagVersion
- Loading branch information
Showing
6 changed files
with
63 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,14 +14,20 @@ lazy val scalacOptions212 = Seq( | |
) | ||
|
||
inThisBuild(List( | ||
scalaVersion := scala2_12, | ||
organization := "com.github.sbt", | ||
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0")), | ||
description := "An sbt plugin to dynamically set your version from git", | ||
developers := List(Developer("dwijnand", "Dale Wijnand", "dale wijnand gmail com", url("https://dwijnand.com"))), | ||
startYear := Some(2016), | ||
homepage := scmInfo.value map (_.browseUrl), | ||
scmInfo := Some(ScmInfo(url("https://github.com/sbt/sbt-dynver"), "scm:git:[email protected]:sbt/sbt-dynver.git")), | ||
scalaVersion := scala2_12, | ||
organization := "com.github.sbt", | ||
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0")), | ||
description := "An sbt plugin to dynamically set your version from git", | ||
developers := List(Developer("dwijnand", "Dale Wijnand", "dale wijnand gmail com", url("https://dwijnand.com"))), | ||
startYear := Some(2016), | ||
homepage := scmInfo.value map (_.browseUrl), | ||
scmInfo := Some(ScmInfo(url("https://github.com/sbt/sbt-dynver"), "scm:git:[email protected]:sbt/sbt-dynver.git")), | ||
dynverSonatypeSnapshots := true, | ||
version := { | ||
val orig = version.value | ||
if (orig.endsWith("-SNAPSHOT")) "5.0.1-SNAPSHOT" | ||
else orig | ||
}, | ||
|
||
scalacOptions ++= Seq( | ||
"-encoding", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
sbtdynver/src/sbt-test/dynver/assert-tag-version-ok/build.sbt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import scala.sys.process.stringToProcess | ||
import scala.sys.process.ProcessLogger | ||
|
||
TaskKey[Unit]("gitInitSetup") := { | ||
implicit def log2log(log: Logger): ProcessLogger = sbtLoggerToScalaSysProcessLogger(log) | ||
"git init".!!(streams.value.log) | ||
"git config user.email [email protected]".!!(streams.value.log) | ||
"git config user.name dynver".!!(streams.value.log) | ||
} | ||
|
||
TaskKey[Unit]("gitAdd") := { | ||
implicit def log2log(log: Logger): ProcessLogger = sbtLoggerToScalaSysProcessLogger(log) | ||
"git add .".!!(streams.value.log) | ||
} | ||
TaskKey[Unit]("gitCommit") := { | ||
implicit def log2log(log: Logger): ProcessLogger = sbtLoggerToScalaSysProcessLogger(log) | ||
"git commit -am1".!!(streams.value.log) | ||
} | ||
TaskKey[Unit]("gitTag") := { | ||
implicit def log2log(log: Logger): ProcessLogger = sbtLoggerToScalaSysProcessLogger(log) | ||
"git tag -a v1.0.0 -m1.0.0".!!(streams.value.log) | ||
} | ||
def sbtLoggerToScalaSysProcessLogger(log: Logger): ProcessLogger = | ||
new ProcessLogger { | ||
def buffer[T](f: => T): T = f | ||
def err(s: => String): Unit = log info s | ||
def out(s: => String): Unit = log error s | ||
} |
4 changes: 4 additions & 0 deletions
4
sbtdynver/src/sbt-test/dynver/assert-tag-version-ok/changes/build.sbt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Global / onLoad := (Global / onLoad).value.andThen { s => | ||
dynverAssertTagVersion.value | ||
s | ||
} |
5 changes: 5 additions & 0 deletions
5
sbtdynver/src/sbt-test/dynver/assert-tag-version-ok/project/plugins.sbt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
sys.props.get("plugin.version") match { | ||
case Some(x) => addSbtPlugin("com.github.sbt" % "sbt-dynver" % x) | ||
case _ => sys.error("""|The system property 'plugin.version' is not defined. | ||
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
> gitInitSetup | ||
> gitAdd | ||
> gitCommit | ||
> gitTag | ||
$ copy-file changes/build.sbt build.sbt | ||
> reload | ||
> about |