-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0802653
commit 0c56bb1
Showing
11 changed files
with
126 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.11.12 | ||
0.12.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
plugin/src-mill0.10/io/kipp/mill/github/dependency/graph/Graph.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package io.kipp.mill.github.dependency.graph | ||
|
||
object Graph extends GraphModule { | ||
|
||
import Discover._ | ||
lazy val millDiscover: mill.define.Discover[this.type] = | ||
mill.define.Discover[this.type] | ||
} |
3 changes: 2 additions & 1 deletion
3
plugin/src-mill0.11/io/kipp/mill/github/dependency/graph/Discover.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
package io.kipp.mill.github.dependency.graph | ||
|
||
private[graph] object Discover { | ||
implicit def millEvaluatorTokenReader = | ||
implicit def millEvaluatorTokenReader | ||
: mainargs.TokensReader[mill.eval.Evaluator] = | ||
mill.main.TokenReaders.millEvaluatorTokenReader | ||
} |
12 changes: 12 additions & 0 deletions
12
plugin/src-mill0.11/io/kipp/mill/github/dependency/graph/Graph.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.kipp.mill.github.dependency.graph | ||
|
||
import scala.annotation.nowarn | ||
|
||
// In here for the Discover import | ||
@nowarn("msg=Unused import") | ||
object Graph extends GraphModule { | ||
|
||
import Discover._ | ||
lazy val millDiscover: mill.define.Discover[this.type] = | ||
mill.define.Discover[this.type] | ||
} |
7 changes: 7 additions & 0 deletions
7
plugin/src-mill0.12/io/kipp/mill/github/dependency/graph/Discover.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package io.kipp.mill.github.dependency.graph | ||
|
||
private[graph] object Discover { | ||
implicit def millEvaluatorTokenReader | ||
: mainargs.TokensReader[mill.eval.Evaluator] = | ||
mill.main.TokenReaders.millEvaluatorTokenReader | ||
} |
10 changes: 10 additions & 0 deletions
10
plugin/src-mill0.12/io/kipp/mill/github/dependency/graph/Graph.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package io.kipp.mill.github.dependency.graph | ||
|
||
import mill._ | ||
|
||
object Graph extends GraphModule { | ||
|
||
import Discover._ | ||
lazy val millDiscover: mill.define.Discover = | ||
mill.define.Discover[this.type] | ||
} |
56 changes: 56 additions & 0 deletions
56
plugin/src-mill0.12/io/kipp/mill/github/dependency/graph/Resolver.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package io.kipp.mill.github.dependency.graph | ||
|
||
import coursier.graph.DependencyTree | ||
import mill._ | ||
import mill.eval.Evaluator | ||
import mill.scalalib.JavaModule | ||
import mill.scalalib.Lib | ||
|
||
/** Utils to help find all your modules and resolve their dependencies. | ||
*/ | ||
object Resolver { | ||
|
||
/** Given an evaluator and your javaModules, use coursier to resolve all of | ||
* their dependencies into trees. | ||
* | ||
* @param evaluator Evaluator passed in from the command | ||
* @param javaModules All the JavaModules to resolve dependencies from | ||
* @return A collection of ModuleTrees | ||
*/ | ||
private[graph] def resolveModuleTrees( | ||
evaluator: Evaluator, | ||
javaModules: Seq[JavaModule] | ||
): Seq[ModuleTrees] = evaluator.evalOrThrow() { | ||
javaModules.map { javaModule => | ||
T.task { | ||
|
||
val deps = | ||
javaModule.transitiveCompileIvyDeps() ++ javaModule | ||
.transitiveIvyDeps() | ||
val repos = javaModule.repositoriesTask() | ||
val mapDeps = javaModule.mapDependencies() | ||
val custom = javaModule.resolutionCustomizer() | ||
|
||
val (dependencies, resolution) = | ||
Lib.resolveDependenciesMetadata( | ||
repositories = repos, | ||
deps = deps, | ||
mapDependencies = Some(mapDeps), | ||
customizer = custom, | ||
ctx = Some(T.log) | ||
) | ||
|
||
val trees = | ||
DependencyTree(resolution = resolution, roots = dependencies) | ||
|
||
ModuleTrees( | ||
javaModule, | ||
trees | ||
) | ||
} | ||
} | ||
} | ||
|
||
private[graph] def computeModules(ev: Evaluator) = | ||
ev.rootModule.millInternal.modules.collect { case j: JavaModule => j } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters