Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tagPrefix/vTagPrefix coherence #170

Merged
merged 1 commit into from
Jun 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.0.0")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.0")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.7.0")
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.6")
5 changes: 2 additions & 3 deletions src/main/scala/sbtdynver/DynVerPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ object DynVerPlugin extends AutoPlugin {
previousStableVersion := dynverGitPreviousStableVersion.value.previousVersion,

dynverInstance := {
val tagPrefix = dynverTagPrefix.value
val vTagPrefix = dynverVTagPrefix.value
val tagPrefix = dynverTagPrefix.?.value.getOrElse(if (vTagPrefix) "v" else "")
assert(vTagPrefix ^ tagPrefix != "v", s"Incoherence: dynverTagPrefix=$tagPrefix vs dynverVTagPrefix=$vTagPrefix")
DynVer(Some(buildBase.value), dynverSeparator.value, tagPrefix)
},
Expand All @@ -66,8 +66,7 @@ object DynVerPlugin extends AutoPlugin {
dynverSonatypeSnapshots := false,
dynverGitPreviousStableVersion := dynverInstance.value.getGitPreviousStableTag,
dynverSeparator := DynVer.separator,
dynverTagPrefix := DynVer.tagPrefix,
dynverVTagPrefix := dynverTagPrefix.value == "v",
dynverVTagPrefix := dynverTagPrefix.??(DynVer.tagPrefix).value == "v",

dynver := {
val dynver = dynverInstance.value
Expand Down
1 change: 1 addition & 0 deletions src/sbt-test/dynver/no-v-tag-prefix/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dynverVTagPrefix in ThisBuild := false
5 changes: 5 additions & 0 deletions src/sbt-test/dynver/no-v-tag-prefix/project/plugins.sbt
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.dwijnand" % "sbt-dynver" % x)
case _ => sys.error("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
}
1 change: 1 addition & 0 deletions src/sbt-test/dynver/no-v-tag-prefix/test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
> about