rename to DependencyResolutionInterface

This commit is contained in:
Eugene Yokota 2017-07-12 08:33:18 -04:00
parent 358b750dde
commit 0c28db9d21
5 changed files with 16 additions and 15 deletions

View File

@ -15,9 +15,9 @@ log: sbt.internal.util.ManagedLogger = sbt.internal.util.ManagedLogger@c439b0f
scala> val lm = {
import sbt.librarymanagement.ivy._
val ivyConfig = InlineIvyConfiguration().withLog(log)
IvyLibraryManagement(ivyConfig)
IvyDependencyResolution(ivyConfig)
}
lm: sbt.librarymanagement.LibraryManagement = sbt.librarymanagement.ivy.IvyLibraryManagement@11c07acb
lm: sbt.librarymanagement.DependencyResolution = sbt.librarymanagement.DependencyResolution@6a9b40f8
scala> val module = "commons-io" % "commons-io" % "2.5"
module: sbt.librarymanagement.ModuleID = commons-io:commons-io:2.5

View File

@ -8,7 +8,7 @@ import sbt.librarymanagement.syntax._
/**
* Library management API to resolve dependencies.
*/
class LibraryManagement private[sbt] (lmEngine: LibraryManagementInterface) {
class DependencyResolution private[sbt] (lmEngine: DependencyResolutionInterface) {
import sbt.internal.librarymanagement.InternalDefaults._
import sbt.internal.librarymanagement.UpdateClassifiersUtil._
@ -217,7 +217,7 @@ class LibraryManagement private[sbt] (lmEngine: LibraryManagementInterface) {
}).mkString(", ")
}
object LibraryManagement {
def apply(lmEngine: LibraryManagementInterface): LibraryManagement =
new LibraryManagement(lmEngine)
object DependencyResolution {
def apply(lmEngine: DependencyResolutionInterface): DependencyResolution =
new DependencyResolution(lmEngine)
}

View File

@ -4,9 +4,9 @@ import java.io.File
import sbt.util.Logger
/**
* Interface for library management intended for library management engine authors.
* Interface for dependency resolution intended for engine authors.
*/
abstract class LibraryManagementInterface {
trait DependencyResolutionInterface {
/**
* Builds a ModuleDescriptor that describes a subproject with dependencies.
@ -35,7 +35,7 @@ abstract class LibraryManagementInterface {
/**
* Interface for publishing modules.
*/
abstract class PublisherInterface {
trait PublisherInterface {
/**
* Builds a ModuleDescriptor that describes a subproject with dependencies.

View File

@ -5,7 +5,8 @@ package ivy
import sbt.internal.librarymanagement._
import sbt.util.Logger
class IvyLibraryManagement private[sbt] (val ivySbt: IvySbt) extends LibraryManagementInterface {
class IvyDependencyResolution private[sbt] (val ivySbt: IvySbt)
extends DependencyResolutionInterface {
type Module = ivySbt.Module
override def moduleDescriptor(moduleSetting: ModuleDescriptorConfiguration): ModuleDescriptor = {
@ -24,7 +25,7 @@ class IvyLibraryManagement private[sbt] (val ivySbt: IvySbt) extends LibraryMana
}
}
object IvyLibraryManagement {
def apply(ivyConfiguration: IvyConfiguration): LibraryManagement =
LibraryManagement(new IvyLibraryManagement(new IvySbt(ivyConfiguration)))
object IvyDependencyResolution {
def apply(ivyConfiguration: IvyConfiguration): DependencyResolution =
DependencyResolution(new IvyDependencyResolution(new IvySbt(ivyConfiguration)))
}

View File

@ -18,8 +18,8 @@ trait BaseIvySpecification extends UnitSpec {
ModuleID("com.example", "foo", "0.1.0").withConfigurations(Some("compile"))
lazy val log = ConsoleLogger()
def lmEngine(uo: UpdateOptions = UpdateOptions()): LibraryManagement =
IvyLibraryManagement(mkIvyConfiguration(uo))
def lmEngine(uo: UpdateOptions = UpdateOptions()): DependencyResolution =
IvyDependencyResolution(mkIvyConfiguration(uo))
def configurations = Vector(Compile, Test, Runtime)
def module(moduleId: ModuleID,