mirror of https://github.com/sbt/sbt.git
Move to dependencyResolutionTask to Defaults
This commit is contained in:
parent
81d7edb6c6
commit
5b96bcae06
|
|
@ -12,6 +12,7 @@ import java.net.{ URI, URL, URLClassLoader }
|
||||||
import java.util.Optional
|
import java.util.Optional
|
||||||
import java.util.concurrent.{ Callable, TimeUnit }
|
import java.util.concurrent.{ Callable, TimeUnit }
|
||||||
|
|
||||||
|
import lmcoursier.CoursierDependencyResolution
|
||||||
import lmcoursier.definitions.{ Configuration => CConfiguration }
|
import lmcoursier.definitions.{ Configuration => CConfiguration }
|
||||||
import org.apache.ivy.core.module.descriptor.ModuleDescriptor
|
import org.apache.ivy.core.module.descriptor.ModuleDescriptor
|
||||||
import org.apache.ivy.core.module.id.ModuleRevisionId
|
import org.apache.ivy.core.module.id.ModuleRevisionId
|
||||||
|
|
@ -1910,6 +1911,19 @@ object Defaults extends BuildCommon {
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def dependencyResolutionTask: Def.Initialize[Task[DependencyResolution]] =
|
||||||
|
Def.taskDyn {
|
||||||
|
if (useCoursier.value) {
|
||||||
|
Def.task { CoursierDependencyResolution(csrConfiguration.value) }
|
||||||
|
} else
|
||||||
|
Def.task {
|
||||||
|
IvyDependencyResolution(
|
||||||
|
ivyConfiguration.value,
|
||||||
|
CustomHttp.okhttpClient.value
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
object Classpaths {
|
object Classpaths {
|
||||||
import Defaults._
|
import Defaults._
|
||||||
|
|
@ -2232,7 +2246,7 @@ object Classpaths {
|
||||||
)
|
)
|
||||||
else None
|
else None
|
||||||
},
|
},
|
||||||
dependencyResolution := LibraryManagement.dependencyResolutionTask.value,
|
dependencyResolution := dependencyResolutionTask.value,
|
||||||
publisher := IvyPublisher(ivyConfiguration.value, CustomHttp.okhttpClient.value),
|
publisher := IvyPublisher(ivyConfiguration.value, CustomHttp.okhttpClient.value),
|
||||||
ivyConfiguration := mkIvyConfiguration.value,
|
ivyConfiguration := mkIvyConfiguration.value,
|
||||||
ivyConfigurations := {
|
ivyConfigurations := {
|
||||||
|
|
@ -2399,7 +2413,7 @@ object Classpaths {
|
||||||
transitiveClassifiers.value.toVector
|
transitiveClassifiers.value.toVector
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
dependencyResolution := LibraryManagement.dependencyResolutionTask.value,
|
dependencyResolution := dependencyResolutionTask.value,
|
||||||
csrConfiguration := LMCoursier.updateClassifierConfigurationTask.value,
|
csrConfiguration := LMCoursier.updateClassifierConfigurationTask.value,
|
||||||
updateClassifiers in TaskGlobal := (Def.task {
|
updateClassifiers in TaskGlobal := (Def.task {
|
||||||
val s = streams.value
|
val s = streams.value
|
||||||
|
|
@ -2602,7 +2616,7 @@ object Classpaths {
|
||||||
).withScalaOrganization(scalaOrganization.value)
|
).withScalaOrganization(scalaOrganization.value)
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
dependencyResolution := LibraryManagement.dependencyResolutionTask.value,
|
dependencyResolution := dependencyResolutionTask.value,
|
||||||
csrConfiguration := LMCoursier.updateSbtClassifierConfigurationTask.value,
|
csrConfiguration := LMCoursier.updateSbtClassifierConfigurationTask.value,
|
||||||
updateSbtClassifiers in TaskGlobal := (Def.task {
|
updateSbtClassifiers in TaskGlobal := (Def.task {
|
||||||
val lm = dependencyResolution.value
|
val lm = dependencyResolution.value
|
||||||
|
|
@ -2645,7 +2659,7 @@ object Classpaths {
|
||||||
) ++
|
) ++
|
||||||
inTask(scalaCompilerBridgeScope)(
|
inTask(scalaCompilerBridgeScope)(
|
||||||
Seq(
|
Seq(
|
||||||
dependencyResolution := LibraryManagement.dependencyResolutionTask.value,
|
dependencyResolution := dependencyResolutionTask.value,
|
||||||
csrConfiguration := LMCoursier.scalaCompilerBridgeConfigurationTask.value,
|
csrConfiguration := LMCoursier.scalaCompilerBridgeConfigurationTask.value,
|
||||||
csrResolvers := CoursierRepositoriesTasks.coursierResolversTask.value,
|
csrResolvers := CoursierRepositoriesTasks.coursierResolversTask.value,
|
||||||
externalResolvers := scalaCompilerBridgeResolvers.value,
|
externalResolvers := scalaCompilerBridgeResolvers.value,
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,10 @@
|
||||||
package sbt
|
package sbt
|
||||||
package internal
|
package internal
|
||||||
|
|
||||||
import lmcoursier.CoursierDependencyResolution
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import sbt.internal.librarymanagement._
|
import sbt.internal.librarymanagement._
|
||||||
import sbt.internal.util.{ ConsoleAppender, LogOption }
|
import sbt.internal.util.{ ConsoleAppender, LogOption }
|
||||||
import sbt.librarymanagement._
|
import sbt.librarymanagement._
|
||||||
import sbt.librarymanagement.ivy.IvyDependencyResolution
|
|
||||||
import sbt.librarymanagement.syntax._
|
import sbt.librarymanagement.syntax._
|
||||||
import sbt.util.{ CacheStore, CacheStoreFactory, Logger, Tracked }
|
import sbt.util.{ CacheStore, CacheStoreFactory, Logger, Tracked }
|
||||||
import sbt.io.IO
|
import sbt.io.IO
|
||||||
|
|
@ -47,19 +45,6 @@ private[sbt] object LibraryManagement {
|
||||||
coursierOpt.orElse(notIvyOpt).getOrElse(true)
|
coursierOpt.orElse(notIvyOpt).getOrElse(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
def dependencyResolutionTask: Def.Initialize[Task[DependencyResolution]] =
|
|
||||||
Def.taskDyn {
|
|
||||||
if (Keys.useCoursier.value) {
|
|
||||||
Def.task { CoursierDependencyResolution(Keys.csrConfiguration.value) }
|
|
||||||
} else
|
|
||||||
Def.task {
|
|
||||||
IvyDependencyResolution(
|
|
||||||
Keys.ivyConfiguration.value,
|
|
||||||
CustomHttp.okhttpClient.value
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def cachedUpdate(
|
def cachedUpdate(
|
||||||
lm: DependencyResolution,
|
lm: DependencyResolution,
|
||||||
module: ModuleDescriptor,
|
module: ModuleDescriptor,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue