mirror of https://github.com/sbt/sbt.git
Recover lost ssh-based repo API
Recover APIs I accidentally removed in
f2efa10af1.
This commit is contained in:
parent
d6f0924689
commit
084c94a93c
|
|
@ -514,6 +514,7 @@
|
||||||
"target": "Scala",
|
"target": "Scala",
|
||||||
"type": "interface",
|
"type": "interface",
|
||||||
"doc": "sbt interface for an Ivy ssh-based repository (ssh and sftp). Requires the Jsch library..",
|
"doc": "sbt interface for an Ivy ssh-based repository (ssh and sftp). Requires the Jsch library..",
|
||||||
|
"parents": "sbt.librarymanagement.SshBasedRepositoryExtra",
|
||||||
"fields": [
|
"fields": [
|
||||||
{ "name": "connection", "type": "sbt.librarymanagement.SshConnection" }
|
{ "name": "connection", "type": "sbt.librarymanagement.SshConnection" }
|
||||||
],
|
],
|
||||||
|
|
@ -524,6 +525,7 @@
|
||||||
"target": "Scala",
|
"target": "Scala",
|
||||||
"type": "record",
|
"type": "record",
|
||||||
"doc": "sbt interface for an Ivy repository over ssh. More convenient construction is done using Resolver.ssh.",
|
"doc": "sbt interface for an Ivy repository over ssh. More convenient construction is done using Resolver.ssh.",
|
||||||
|
"parents": "sbt.librarymanagement.SshRepositoryExtra",
|
||||||
"fields": [
|
"fields": [
|
||||||
{ "name": "publishPermissions", "type": "String?" }
|
{ "name": "publishPermissions", "type": "String?" }
|
||||||
],
|
],
|
||||||
|
|
@ -542,6 +544,7 @@
|
||||||
"target": "Scala",
|
"target": "Scala",
|
||||||
"type": "record",
|
"type": "record",
|
||||||
"doc": "sbt interface for an Ivy repository over sftp. More convenient construction is done using Resolver.sftp.",
|
"doc": "sbt interface for an Ivy repository over sftp. More convenient construction is done using Resolver.sftp.",
|
||||||
|
"parents": "sbt.librarymanagement.SftpRepositoryExtra",
|
||||||
"extra": [
|
"extra": [
|
||||||
"def this(name: String, connection: sbt.librarymanagement.SshConnection, patterns: sbt.librarymanagement.Patterns) = ",
|
"def this(name: String, connection: sbt.librarymanagement.SshConnection, patterns: sbt.librarymanagement.Patterns) = ",
|
||||||
" this(name, patterns, connection)"
|
" this(name, patterns, connection)"
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,48 @@ abstract class PatternsFunctions {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trait SshBasedRepositoryExtra {
|
||||||
|
/** The object representing the configured ssh connection for this repository. */
|
||||||
|
def connection: SshConnection
|
||||||
|
|
||||||
|
type RepositoryType <: SshBasedRepository
|
||||||
|
protected def copy(connection: SshConnection): RepositoryType
|
||||||
|
private def copy(authentication: SshAuthentication): RepositoryType =
|
||||||
|
copy(connection withAuthentication authentication)
|
||||||
|
|
||||||
|
/** Configures this to use the specified user name and password when connecting to the remote repository. */
|
||||||
|
def as(user: String, password: String): RepositoryType = as(user, Some(password))
|
||||||
|
def as(user: String): RepositoryType = as(user, None)
|
||||||
|
def as(user: String, password: Option[String]): RepositoryType = copy(PasswordAuthentication(user, password))
|
||||||
|
|
||||||
|
/** Configures this to use the specified keyfile and password for the keyfile when connecting to the remote repository. */
|
||||||
|
def as(user: String, keyfile: File): RepositoryType = as(user, keyfile, None)
|
||||||
|
def as(user: String, keyfile: File, password: String): RepositoryType = as(user, keyfile, Some(password))
|
||||||
|
|
||||||
|
def as(user: String, keyfile: File, password: Option[String]): RepositoryType =
|
||||||
|
copy(KeyFileAuthentication(user, keyfile, password))
|
||||||
|
}
|
||||||
|
|
||||||
|
trait SshRepositoryExtra extends SshBasedRepositoryExtra {
|
||||||
|
def name: String
|
||||||
|
def patterns: sbt.librarymanagement.Patterns
|
||||||
|
def publishPermissions: Option[String]
|
||||||
|
|
||||||
|
type RepositoryType = SshRepository
|
||||||
|
|
||||||
|
protected def copy(connection: SshConnection): SshRepository =
|
||||||
|
SshRepository(name, connection, patterns, publishPermissions)
|
||||||
|
}
|
||||||
|
|
||||||
|
trait SftpRepositoryExtra extends SshBasedRepositoryExtra {
|
||||||
|
def name: String
|
||||||
|
def patterns: sbt.librarymanagement.Patterns
|
||||||
|
|
||||||
|
type RepositoryType = SftpRepository
|
||||||
|
|
||||||
|
protected def copy(connection: SshConnection): SftpRepository = SftpRepository(name, connection, patterns)
|
||||||
|
}
|
||||||
|
|
||||||
/** A repository that conforms to sbt launcher's interface */
|
/** A repository that conforms to sbt launcher's interface */
|
||||||
private[sbt] class FakeRepository(resolver: DependencyResolver) extends xsbti.Repository {
|
private[sbt] class FakeRepository(resolver: DependencyResolver) extends xsbti.Repository {
|
||||||
def rawRepository = new RawRepository(resolver)
|
def rawRepository = new RawRepository(resolver)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue