This repository was archived by the owner on May 4, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Update mill to 0.12.4 #172
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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] | ||
| } |
This file contains hidden or 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
3 changes: 2 additions & 1 deletion
3
plugin/src-mill0.11/io/kipp/mill/github/dependency/graph/Discover.scala
This file contains hidden or 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 hidden or 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 hidden or 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 | ||
| } |
8 changes: 8 additions & 0 deletions
8
plugin/src-mill0.12/io/kipp/mill/github/dependency/graph/Graph.scala
This file contains hidden or 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 = | ||
| mill.define.Discover[this.type] | ||
| } |
62 changes: 62 additions & 0 deletions
62
plugin/src-mill0.12/io/kipp/mill/github/dependency/graph/Resolver.scala
This file contains hidden or 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,62 @@ | ||
| 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 => | ||
| Task.Anon { | ||
|
|
||
| val deps = | ||
| javaModule.transitiveCompileIvyDeps() ++ javaModule | ||
| .transitiveIvyDeps() | ||
| val repos = javaModule.repositoriesTask() | ||
| val mapDeps = javaModule.mapDependencies() | ||
| val custom = javaModule.resolutionCustomizer() | ||
|
|
||
| Lib | ||
| .resolveDependenciesMetadataSafe( | ||
| repositories = repos, | ||
| deps = deps, | ||
| mapDependencies = Some(mapDeps), | ||
| customizer = custom, | ||
| ctx = Some(T.log) | ||
| ) | ||
| .map { resolution => | ||
| val trees = | ||
| DependencyTree( | ||
| resolution = resolution, | ||
| roots = deps.map(_.dep).toSeq | ||
| ) | ||
|
|
||
| ModuleTrees( | ||
| javaModule, | ||
| trees | ||
| ) | ||
|
|
||
| } | ||
|
|
||
| } | ||
| } | ||
| } | ||
|
|
||
| private[graph] def computeModules(ev: Evaluator) = | ||
| ev.rootModule.millInternal.modules.collect { case j: JavaModule => j } | ||
| } |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So is this needed now for 0.12 versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this was the only way I found to make Mill / Coursier pick up the local dev repo.
In Mill 0.12+ there is a different way to integration-test Mill plugins, with which this hack/workaround would probably go away. But that doesn't work for 0.10 and 0.11, so I guess it's best to live with the workaround until usage of Mill < 0.12 dies out and one can completely switch to the new approach.