mirror of https://github.com/sbt/sbt.git
Set csrConfiguration too, in sbt-lm-coursier
sbt-lm-coursier uses its own coursierConfiguration, rather than csrConfiguration from sbt. Setting the latter just-in-case some other plugin, or users, rely on csrConfiguration.
This commit is contained in:
parent
d8ea3b91d5
commit
caa1123c1f
|
|
@ -62,6 +62,7 @@ object LmCoursierPlugin extends AutoPlugin {
|
|||
Def.task(sbt.hack.Foo.updateTask(lm).value)
|
||||
}.value
|
||||
) ++
|
||||
setCsrConfiguration ++
|
||||
inTask(updateClassifiers)(
|
||||
Seq(
|
||||
dependencyResolution := mkDependencyResolution.value,
|
||||
|
|
@ -86,6 +87,21 @@ object LmCoursierPlugin extends AutoPlugin {
|
|||
}
|
||||
}
|
||||
|
||||
private def setCsrConfiguration: Seq[Setting[_]] = {
|
||||
val csrConfigurationOpt = try {
|
||||
val key = sbt.Keys.asInstanceOf[{
|
||||
def csrConfiguration: TaskKey[CoursierConfiguration]
|
||||
}].csrConfiguration
|
||||
Some(key)
|
||||
} catch {
|
||||
case _: NoSuchMethodException =>
|
||||
None
|
||||
}
|
||||
|
||||
csrConfigurationOpt.toSeq.map { csrConfiguration =>
|
||||
csrConfiguration := coursierConfiguration.value
|
||||
}
|
||||
}
|
||||
|
||||
private def mkCoursierConfiguration(withClassifiers: Boolean = false, sbtClassifiers: Boolean = false): Def.Initialize[Task[CoursierConfiguration]] =
|
||||
Def.taskDyn {
|
||||
|
|
|
|||
Loading…
Reference in New Issue