Skip to content
This repository has been archived by the owner on Apr 8, 2021. It is now read-only.

Commit

Permalink
Broken attempt so far: in ignoreMissingUpdate, don't download jar fil…
Browse files Browse the repository at this point in the history
…es, fixes #130
  • Loading branch information
jrudolph committed Sep 15, 2018
1 parent 49ad75a commit ddd90b8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,10 @@ object DependencyGraphSbtCompat {
def withMissingOk(missingOk: Boolean): UpdateConfiguration =
updateConfig.copy(missingOk = missingOk)
}

implicit class RichInlineConfiguration(val i: InlineConfiguration) extends AnyVal {
def withDependencies(newDependencies: Vector[ModuleID]): InlineConfiguration =
i.copy(dependencies = newDependencies)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ trait DependencyGraphKeys {
val ivyReport = TaskKey[File](
"ivy-report",
"A task which returns the location of the ivy report file for a given configuration (default `compile`).")
val ignoreMissingUpdate = Keys.update in ivyReport
val filterScalaLibrary = SettingKey[Boolean](
"filter-scala-library",
"Specifies if scala dependency should be filtered in dependency-* output")
Expand All @@ -104,6 +103,7 @@ trait DependencyGraphKeys {
"dependency-license-info",
"Aggregates and shows information about the licenses of dependencies")

val ignoreMissingUpdate = TaskKey[UpdateReport]("dependencyUpdate", "Specialized update task for sbt-dependency-graph")
// internal
private[graph] val moduleGraphStore = TaskKey[ModuleGraph]("module-graph-store", "The stored module-graph from the last run")
val whatDependsOn = InputKey[String]("what-depends-on", "Shows information about what depends on the given module")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,18 @@ object DependencyGraphSettings {

def baseSettings = Seq(
ivyReportFunction := ivyReportFunctionTask.value,
updateConfiguration in ignoreMissingUpdate := updateConfiguration.value.withMissingOk(true),

// create our own version of `update` that will
// * not fail on missing artifacts
// * not actually download any jar files but only poms
updateConfiguration in ignoreMissingUpdate := updateConfiguration.value.withMissingOk(true),
moduleSettings in ignoreMissingUpdate := {
moduleSettings.value match {
case i: InlineConfiguration i.withDependencies(i.dependencies.map(_.pomOnly()).toVector)
case x x
}
},
ivyModule in ignoreMissingUpdate := { val is = ivySbt.value; new is.Module((moduleSettings in ignoreMissingUpdate).value) },
ignoreMissingUpdate :=
// inTask will make sure the new definition will pick up `updateConfiguration in ignoreMissingUpdate`
SbtAccess.inTask(ignoreMissingUpdate, Classpaths.updateTask).value,
Expand Down

0 comments on commit ddd90b8

Please sign in to comment.