Allow 2.5 snapshot requirement in version check (#29363)
This commit is contained in:
parent
996f424835
commit
1898216b0d
2 changed files with 11 additions and 9 deletions
|
|
@ -60,25 +60,27 @@ class AkkaVersionSpec extends AnyWordSpec with Matchers {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
"succeed if Akka version is SNAPSHOT" in {
|
"succeed if current Akka version is SNAPSHOT" in {
|
||||||
AkkaVersion.require("AkkaVersionSpec", "2.5.6", "2.5-SNAPSHOT")
|
AkkaVersion.require("AkkaVersionSpec", "2.5.6", "2.5-SNAPSHOT")
|
||||||
}
|
}
|
||||||
|
|
||||||
"succeed if Akka version is timestamped SNAPSHOT" in {
|
"succeed if current Akka version is timestamped SNAPSHOT" in {
|
||||||
AkkaVersion.require("AkkaVersionSpec", "2.5.6", "2.5-20180109-133700")
|
AkkaVersion.require("AkkaVersionSpec", "2.5.6", "2.5-20180109-133700")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"succeed if required Akka version is SNAPSHOT" in {
|
||||||
|
AkkaVersion.require("AkkaVersionSpec", "2.5-SNAPSHOT", "2.5-SNAPSHOT")
|
||||||
|
}
|
||||||
|
|
||||||
|
"succeed if required Akka version is timestamped SNAPSHOT" in {
|
||||||
|
AkkaVersion.require("AkkaVersionSpec", "2.5-20180109-133700", "2.5-20180109-133700")
|
||||||
|
}
|
||||||
|
|
||||||
"silently comply if current version is incomprehensible" in {
|
"silently comply if current version is incomprehensible" in {
|
||||||
// because we may want to release with weird numbers for some reason
|
// because we may want to release with weird numbers for some reason
|
||||||
AkkaVersion.require("nonsense", "2.5.6", "nonsense")
|
AkkaVersion.require("nonsense", "2.5.6", "nonsense")
|
||||||
}
|
}
|
||||||
|
|
||||||
"fail if fed incomprehensible requirement" in {
|
|
||||||
intercept[IllegalArgumentException] {
|
|
||||||
AkkaVersion.require("AkkaVersionSpec", "nonsense", "2.5.6")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ object AkkaVersion {
|
||||||
(requiredMinorStr == currentMinorStr && requiredPatchStr.toInt > currentPatch))
|
(requiredMinorStr == currentMinorStr && requiredPatchStr.toInt > currentPatch))
|
||||||
throw new UnsupportedAkkaVersion(
|
throw new UnsupportedAkkaVersion(
|
||||||
s"Current version of Akka is [$currentVersion], but $libraryName requires version [$requiredVersion]")
|
s"Current version of Akka is [$currentVersion], but $libraryName requires version [$requiredVersion]")
|
||||||
case _ => throw new IllegalArgumentException(s"Required version string is invalid: [$requiredVersion]")
|
case _ => // SNAPSHOT or unknown - you're on your own
|
||||||
}
|
}
|
||||||
|
|
||||||
case _ => // SNAPSHOT or unknown - you're on your own
|
case _ => // SNAPSHOT or unknown - you're on your own
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue