-
-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow Mill CLI to select the meta-build frame it operates on (#2719)
Add a new CLI option `--meta-level` accepting an `Int`. Default is `0` and means the root project, `1` is the parent meta-build, if defined, or the built-in bootstrap module, and so on. **Example: Find version updates in the meta build** Here is some example output (applied to the mill repo): ``` $ mill --meta-level 1 mill.scalalib.Dependency/showUpdates [1657/1657] dev.run Found 3 dependency update for net.sourceforge.htmlcleaner:htmlcleaner : 2.25 -> 2.26 -> 2.27 -> 2.28 -> 2.29 com.lihaoyi:mill-contrib-buildinfo_2.13 : 0.11.2-6-261437 -> 0.11.2 com.github.lolgab:mill-mima_mill0.11_2.13 : 0.0.23 -> 0.0.24 ``` **Meta information about the build** I also added a new external module `mill.runner.MillBuild` to get some meta-information about the project, for now, the meta-module count or frame count. Here on a project with one meta-build: ``` $ mill show mill.runner.MillBuild/levelCount 3 ``` Pull request: #2719
- Loading branch information
Showing
10 changed files
with
240 additions
and
90 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package mill.runner | ||
|
||
import mill.T | ||
import mill.define.{Command, Discover, ExternalModule, Module} | ||
import mill.eval.Evaluator.AllBootstrapEvaluators | ||
|
||
trait MillBuild extends Module { | ||
|
||
/** | ||
* Count of the nested build-levels, the main project and all its nested meta-builds. | ||
* If you run this on a meta-build, the non-meta-builds are not included. | ||
*/ | ||
def levelCount(evaluators: AllBootstrapEvaluators): Command[Int] = T.command { | ||
evaluators.value.size | ||
} | ||
|
||
} | ||
|
||
object MillBuild extends ExternalModule with MillBuild { | ||
override lazy val millDiscover = Discover[this.type] | ||
} |
Oops, something went wrong.