-
Notifications
You must be signed in to change notification settings - Fork 3.5k
mix help app:APP: Compile current Mix project (if any) #14958
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
Conversation
lib/mix/lib/mix/tasks/help.ex
Outdated
|
|
||
| if Mix.Project.get() do | ||
| Mix.Task.run("compile") | ||
| end |
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.
But then if the project doesn't compile, we can't get help. I would do this:
if app != "" and Atom.to_string(Mix.Project.config[:app]) == app do
Mix.Task.run("compile")
end
Also, we can probably add a test for this feature.
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.
this would not solve:
It also helps with projects with depenendencies when they haven't been
compiled yet:req$ mix deps.get && mix help app:finch # mix deps.compile haven't been run yet
Application finch does not exist or is not loaded
but dunno how big of a deal it is in practice, I suppose we can always guide users towards that with error messages or something. So yeah, I will move forward with this, thank you!
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.
@wojtekmach what if we change the rescue branch of Mix.ensure_application! to call Mix.Task.run("compile")? So we compile only when we cannot find the app?
lib/mix/lib/mix/tasks/help.ex
Outdated
|
|
||
| Mix.ensure_application!(app) |
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.
| Mix.ensure_application!(app) |
Prior to this patch, it was impossible to get help for the current app:
nimble_csv$ mix help app:nimble_csv
Application nimble_csv does not exist or is not loaded
It also helps with projects with depenendencies when they haven't been
compiled yet:
req$ mix deps.get && mix help app:finch # mix deps.compile haven't been run yet
Application finch does not exist or is not loaded
Now it works:
nimble_csv$ mix help app:nimble_csv
Compiling 1 file (.ex)
Generated nimble_csv app
# NimbleCSV
NimbleCSV is a small and fast parsing and dumping library.
# NimbleCSV.RFC4180
A CSV parser that uses comma as separator and double-quotes as escape according
to RFC4180.
# NimbleCSV.Spreadsheet
A parser with spreadsheet friendly settings.
The task continues to work as expected outside of a Mix project:
/tmp$ mix help app:nimble_csv
Application nimble_csv does not exist or is not loaded
/tmp$ mix help app:public_key
# :public_key
API module for public-key infrastructure.
7400398 to
e34dcd8
Compare
|
💚 💙 💜 💛 ❤️ |
Prior to this patch, it was impossible to get help for the current app:
nimble_csv$ mix help app:nimble_csv
Application nimble_csv does not exist or is not loaded
It also helps with projects with depenendencies when they haven't been
compiled yet:
req$ mix deps.get && mix help app:finch # mix deps.compile haven't been run yet
Application finch does not exist or is not loaded
Now it works:
nimble_csv$ mix help app:nimble_csv
Compiling 1 file (.ex)
Generated nimble_csv app
# NimbleCSV
NimbleCSV is a small and fast parsing and dumping library.
# NimbleCSV.RFC4180
A CSV parser that uses comma as separator and double-quotes as escape according
to RFC4180.
# NimbleCSV.Spreadsheet
A parser with spreadsheet friendly settings.
Prior to this patch, it was impossible to get help for the current app:
It also helps with projects with depenendencies when they haven't been
compiled yet:
Now it works:
The task continues to work as expected outside of a Mix project: