mirror of https://github.com/sbt/sbt.git
refactoring
This commit is contained in:
parent
83a311b4af
commit
21e5b7ce5b
|
|
@ -34,20 +34,7 @@ object DependencyGraphSettings {
|
||||||
import ModuleGraphProtocol._
|
import ModuleGraphProtocol._
|
||||||
|
|
||||||
def graphSettings = Seq(
|
def graphSettings = Seq(
|
||||||
ivyReportFunction <<= (sbtVersion, target, projectID, ivyModule, appConfiguration, streams) map { (sbtV, target, projectID, ivyModule, config, streams) ⇒
|
ivyReportFunction <<= ivyReportFunctionTask,
|
||||||
sbtV match {
|
|
||||||
case Version(0, min, fix, _) if min > 12 || (min == 12 && fix >= 3) ⇒
|
|
||||||
(c: String) ⇒ file("%s/resolution-cache/reports/%s-%s-%s.xml".format(target, projectID.organization, crossName(ivyModule), c))
|
|
||||||
case Version(0, min, fix, _) if min == 12 && fix >= 1 && fix < 3 ⇒
|
|
||||||
ivyModule.withModule(streams.log) { (i, moduleDesc, _) ⇒
|
|
||||||
val id = ResolveOptions.getDefaultResolveId(moduleDesc)
|
|
||||||
(c: String) ⇒ file("%s/resolution-cache/reports/%s/%s-resolved.xml" format (target, id, c))
|
|
||||||
}
|
|
||||||
case _ ⇒
|
|
||||||
val home = config.provider.scalaProvider.launcher.ivyHome
|
|
||||||
(c: String) ⇒ file("%s/cache/%s-%s-%s.xml" format (home, projectID.organization, crossName(ivyModule), c))
|
|
||||||
}
|
|
||||||
},
|
|
||||||
updateConfiguration in ignoreMissingUpdate <<= updateConfiguration(config ⇒ new UpdateConfiguration(config.retrieve, true, config.logging)),
|
updateConfiguration in ignoreMissingUpdate <<= updateConfiguration(config ⇒ new UpdateConfiguration(config.retrieve, true, config.logging)),
|
||||||
ignoreMissingUpdateT,
|
ignoreMissingUpdateT,
|
||||||
filterScalaLibrary in Global := true) ++ Seq(Compile, Test, Runtime, Provided, Optional).flatMap(ivyReportForConfig)
|
filterScalaLibrary in Global := true) ++ Seq(Compile, Test, Runtime, Provided, Optional).flatMap(ivyReportForConfig)
|
||||||
|
|
@ -107,6 +94,22 @@ object DependencyGraphSettings {
|
||||||
},
|
},
|
||||||
licenseInfo <<= (moduleGraph, streams) map showLicenseInfo))
|
licenseInfo <<= (moduleGraph, streams) map showLicenseInfo))
|
||||||
|
|
||||||
|
def ivyReportFunctionTask =
|
||||||
|
(sbtVersion, target, projectID, ivyModule, appConfiguration, streams) map { (sbtV, target, projectID, ivyModule, config, streams) ⇒
|
||||||
|
sbtV match {
|
||||||
|
case Version(0, min, fix, _) if min > 12 || (min == 12 && fix >= 3) ⇒
|
||||||
|
(c: String) ⇒ file("%s/resolution-cache/reports/%s-%s-%s.xml".format(target, projectID.organization, crossName(ivyModule), c))
|
||||||
|
case Version(0, min, fix, _) if min == 12 && fix >= 1 && fix < 3 ⇒
|
||||||
|
ivyModule.withModule(streams.log) { (i, moduleDesc, _) ⇒
|
||||||
|
val id = ResolveOptions.getDefaultResolveId(moduleDesc)
|
||||||
|
(c: String) ⇒ file("%s/resolution-cache/reports/%s/%s-resolved.xml" format (target, id, c))
|
||||||
|
}
|
||||||
|
case _ ⇒
|
||||||
|
val home = config.provider.scalaProvider.launcher.ivyHome
|
||||||
|
(c: String) ⇒ file("%s/cache/%s-%s-%s.xml" format (home, projectID.organization, crossName(ivyModule), c))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
def ivyReportGraph = ivyReport map (absoluteReportPath.andThen(IvyReport.fromReportFile))
|
def ivyReportGraph = ivyReport map (absoluteReportPath.andThen(IvyReport.fromReportFile))
|
||||||
def sbtUpdateReportGraph =
|
def sbtUpdateReportGraph =
|
||||||
(ignoreMissingUpdate, crossProjectId, configuration) map { (update, root, config) ⇒
|
(ignoreMissingUpdate, crossProjectId, configuration) map { (update, root, config) ⇒
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue