Skip to content

Commit

Permalink
Merge pull request #59 from JetBrains/insert_all_module_transitive_de…
Browse files Browse the repository at this point in the history
…pendencies

Insert all module transitive module dependencies #SCL-21158
  • Loading branch information
azdrojowa123 authored Oct 24, 2023
2 parents 36ed979 + 258c788 commit 8d25f0d
Show file tree
Hide file tree
Showing 8 changed files with 396 additions and 91 deletions.
6 changes: 4 additions & 2 deletions extractor/src/main/scala/org/jetbrains/sbt/Options.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ final case class Options(download: Boolean = false,
resolveClassifiers: Boolean = false,
resolveJavadocs: Boolean = false,
resolveSbtClassifiers: Boolean = false,
prettyPrint: Boolean = false)
prettyPrint: Boolean = false,
insertProjectTransitiveDependencies: Boolean = true)

object Options {

Expand All @@ -17,7 +18,8 @@ object Options {
resolveClassifiers = options.contains("resolveClassifiers"),
resolveJavadocs = options.contains("resolveJavadocs"),
resolveSbtClassifiers = options.contains("resolveSbtClassifiers"),
prettyPrint = options.contains("prettyPrint")
prettyPrint = options.contains("prettyPrint"),
insertProjectTransitiveDependencies = options.contains("insertProjectTransitiveDependencies")
)

def readFromSeq(options: Seq[String]): Options = Options(
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ object KeysExtractor {
}
}


/**
* Finds all named commands
* @return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,12 @@ package object extractors {
StructureKeys.localCachePath.value
)
}

def invert[K, V](map: Map[K, Seq[V]]): Map[V, Seq[K]] = {
val tuples: Seq[(V, K)] = for {
(key, values) <- map.toSeq
value <- values
} yield value -> key
tuples.groupBy(_._1).mapValues(_.map(_._2))
}
}
4 changes: 4 additions & 0 deletions extractor/src/main/scala/org/jetbrains/sbt/operations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ trait SbtStateOps {

def getOrElse(state: State, default: => T): T =
find(state).getOrElse(default)

def forAllProjects(state: State, projects: Seq[ProjectRef]): Seq[(ProjectRef, T)] =
projects.flatMap(p => key.in(p).find(state).map(it => (p, it)))

}

implicit class `enrich TaskKey`[T](key: TaskKey[T]) {
Expand Down
Loading

0 comments on commit 8d25f0d

Please sign in to comment.