Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added module docs for selective execution #4616

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lefou
Copy link
Member

@lefou lefou commented Feb 24, 2025

The hope is, to have some meaningfull mill inspect selective output, but it seems, inspect does not output the Scaladoc for modules yet.

Fixed some typos along the way.

The hope is, to have some meaningfull `mill inspect selective` output, but it seems, inspect does not output the Scaladoc for modules yet.

Fixed some typos along the way.
@lihaoyi
Copy link
Member

lihaoyi commented Feb 25, 2025

The scaladoc inspect thing should be fixed in #4576

@lihaoyi
Copy link
Member

lihaoyi commented Feb 25, 2025

At least for some modules; I didn't test it with the lazy val approach to defining modules so may need more tweaks

@lefou
Copy link
Member Author

lefou commented Feb 26, 2025

At least for some modules; I didn't test it with the lazy val approach to defining modules so may need more tweaks

Looking into it.

It works nicely with object, but not with lazy val.

[62/66] ============================== inspect selective ============================== 60s
selective(MainModule.scala:327)

Inherited Modules:
    mill.main.SelectiveExecutionModule
diff --git a/main/src/mill/main/MainModule.scala b/main/src/mill/main/MainModule.scala
index 8e6974e331e..26149d1d76d 100644
--- a/main/src/mill/main/MainModule.scala
+++ b/main/src/mill/main/MainModule.scala
@@ -324,7 +324,8 @@ trait MainModule extends BaseModule {
    *   prints out the tasks in `<selector>` that are affected by the code changes
    *   and would have run, without actually running them.
    */
-  lazy val selective: SelectiveExecutionModule = new SelectiveExecutionModule {}
+  object selective extends SelectiveExecutionModule
 
 }
============================== inspect selective ==============================
[1/1] inspect
selective(MainModule.scala:328)
    Commands related to selective execution, where Mill runs tasks selectively
    depending on what task inputs or implementations changed.
    
    Read more about it at: https://mill-build.org/mill/large/selective-execution.html
    
    Here are the essential commands:
    
    - `mill selective.prepare <selector>`:
    run on the codebase before the code change,
    stores a snapshot of task inputs and implementations
    
    - `mill selective.run <selector>`:
    run on the codebase after the code change,
    runs tasks in the given `<selector>` which are affected by the code changes
    that have happened since `selective.prepare` was run
    
    - `mill selective.resolve <selector>`:
    a dry-run version of `selective.run`,
    prints out the tasks in `<selector>`` that are affected by the code changes
    and would have run, without actually running them.

Inherited Modules:
    mill.main.SelectiveExecutionModule

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants