mirror of https://github.com/sbt/sbt.git
Allow retrieving of non-standard git URIs
Non-standard git URIs are ones that do not start with 'git:' nor end with '.git'. An example of non-standard git URI is 'ssh://server/home/user/repo'. The mechanism for specifying a non-standard git URI is done by prefixing the whole URI with 'git:' to signify that it should be handled with the git resolver. For example, non-standard git URIs like 'git:ssh://server/user/repo' and 'git:https://server/user/repo' can now be used.
This commit is contained in:
parent
77626f5232
commit
972acc871a
|
|
@ -57,7 +57,9 @@ object RetrieveUnit
|
|||
|
||||
object Path
|
||||
{
|
||||
def unapply(uri: URI) = Option(uri.getPath)
|
||||
import RichURI.fromURI
|
||||
|
||||
def unapply(uri: URI) = Option(uri.withoutMarkerScheme.getPath)
|
||||
}
|
||||
}
|
||||
object EvaluateConfigurations
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ object Resolvers
|
|||
}
|
||||
}
|
||||
|
||||
val uri = info.uri
|
||||
val uri = info.uri.withoutMarkerScheme
|
||||
val staging = info.staging
|
||||
Some {
|
||||
() =>
|
||||
|
|
|
|||
|
|
@ -20,6 +20,19 @@ class RichURI(uri: URI)
|
|||
new URI(uri.getScheme, uri.getSchemeSpecificPart, null)
|
||||
else
|
||||
uri
|
||||
|
||||
def hasMarkerScheme = new URI(uri.getSchemeSpecificPart).getScheme ne null
|
||||
|
||||
def withoutMarkerScheme =
|
||||
{
|
||||
if (hasMarkerScheme)
|
||||
if (hasFragment)
|
||||
new URI(uri.getSchemeSpecificPart + "#" + uri.getFragment)
|
||||
else
|
||||
new URI(uri.getSchemeSpecificPart)
|
||||
else
|
||||
uri
|
||||
}
|
||||
}
|
||||
|
||||
object RichURI
|
||||
|
|
|
|||
Loading…
Reference in New Issue