-
-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Print out CLI help message when inspecting commands (#2522)
Fixes #2198 There's a bit of duplication if a user both adds `@mainargs.arg(doc = "...")` scala annotation as well as a `@param foo` scaladoc annotation, but that's an inherent issue with mainargs and not something we aim to fix here. We render the mainargs CLI help message the same way it's done in mainargs. There isn't a nice helper that renders the whole thing at once, so i have to piece it together from various helpers, but it's not too complex and works out ok. Tested via additions to `integration.feature[docannotations].local.test`, and manually ```bash $ ./mill -i dev.run example/basic/1-simple-scala -i inspect run # command with 1 arg run(JavaModule.scala:720) Runs this modules code in a subprocess and waits for it to finish args <str>... Inputs: finalMainClass runClasspath forkArgs forkEnv forkWorkingDir runUseArgsFile $ ./mill -i dev.run example/basic/1-simple-scala -i inspect compile # not a command compile(ScalaModule.scala:211) Compiles the current module to generate compiled classfiles/bytecode. When you override this, you probably also want to override [[bspCompileClassesPath]]. Inputs: scalaVersion upstreamCompileOutput allSourceFiles compileClasspath javacOptions scalaOrganization allScalacOptions scalaCompilerClasspath scalacPluginClasspath zincReportCachedProblems $ ./mill -i dev.run example/basic/1-simple-scala -i inspect console # command with no args console(ScalaModule.scala:369) Opens up a Scala console with your module and all dependencies present, for you to test and operate your code interactively. Inputs: scalaVersion runClasspath scalaCompilerClasspath forkArgs forkEnv forkWorkingDir $ ./mill -i dev.run example/basic/1-simple-scala -i inspect ivyDepsTree # command with lots of args ivyDepsTree(JavaModule.scala:688) Command to print the transitive dependency tree to STDOUT. --inverse Invert the tree representation, so that the root is on the bottom val inverse (will be forced when used with whatDependsOn) --whatDependsOn <str> Possible list of modules (org:artifact) to target in the tree in order to see where a dependency stems from. --withCompile Include the compile-time only dependencies (`compileIvyDeps`, provided scope) into the tree. --withRuntime Include the runtime dependencies (`runIvyDeps`, runtime scope) into the tree. Inputs: transitiveIvyDeps scalaVersion scalaVersion scalaOrganization scalaVersion ``` I also removed the `numOverrides` field on `mill.define.Discover`, since it's unused since #1600 landed a while back
- Loading branch information
Showing
5 changed files
with
155 additions
and
44 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