Factor default Ivy pattern

This commit is contained in:
Alexandre Archambault 2016-04-17 22:00:38 +02:00
parent 4f423e95d6
commit 00aaf8e1ac
No known key found for this signature in database
GPG Key ID: 14640A6839C263A9
2 changed files with 5 additions and 3 deletions

View File

@ -746,9 +746,7 @@ object Cache {
}
lazy val ivy2Local = IvyRepository(
ivy2HomeUri + "local/" +
"[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/" +
"[artifact](-[classifier]).[ext]",
ivy2HomeUri + "local/" + coursier.ivy.Pattern.default,
dropInfoAttributes = true
)

View File

@ -9,6 +9,10 @@ import java.util.regex.Pattern.quote
object Pattern {
val default =
"[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/" +
"[artifact](-[classifier]).[ext]"
val propertyRegex = (quote("${") + "[^" + quote("{[()]}") + "]*" + quote("}")).r
val optionalPartRegex = (quote("(") + "[^" + quote("{()}") + "]*" + quote(")")).r
val variableRegex = (quote("[") + "[^" + quote("{[()]}") + "]*" + quote("]")).r