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
Plugins: Add status bar on download #18695
Plugins: Add status bar on download #18695
Conversation
Looks great so far @spinscale! |
@Override | ||
public int read() throws IOException { | ||
int read = in.read(); | ||
checkProgress(read == -1 ? -1 : 1); |
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.
Why is the ternary needed since checkProgress handles -1?
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.
in.read()
returns the next byte of data and not the length of the data being read, like the other to read()
methods
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.
Ah of course. Ignore my brain fart.
@spinscale I left some comments. |
incorporated your review comments, thx for the review! |
/** Prints message to the terminal at {@code verbosity} level, without a newline. */ | ||
public final void print(Verbosity verbosity, String msg) { | ||
if (this.verbosity.ordinal() >= verbosity.ordinal()) { | ||
getWriter().print(msg); |
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.
I think println should be rewritten to use this?
public final void println(Verbosity verbosity, String msg) {
print(verbosity, msg + lineSeparator);
}
I left a couple more comments. LGTM otherwise. |
I checked it on a windows box and it gives the following results:
Not as nice as on Linux but still working though. :) |
Tested on windows:
Works well! |
510f5ff
to
1d18d5c
Compare
As some plugins are becoming big now, it is hard for the user to know, if the plugin is being downloaded or just nothing happens. This commit adds a progress bar during download, which can be disabled by using the `-q` parameter. In addition this updates to jimfs 1.1, which allows us to test the batch mode, as adding security policies are now supported due to having jimfs:// protocol support in URL stream handlers.
1d18d5c
to
50bafb5
Compare
As some plugins are becoming biggish now, it is hard for the user to know, if the plugin
is being downloaded or just nothing happens. I also had some cases running on a VM where I did not know if the networking was broken or still downloading, while testing.
This commit adds a progress bar during download, which can be disabled by using the
-q
parameter - it is pretty much unstyled right now, but at least shows an indicator that things are happening.
In addition this updates to jimfs 1.1, which allows us to test the batch mode, as adding
security policies are now supported due to having jimfs:// protocol support in URL stream
handlers.
TODO: Update docs
TODO: Test on windows (only tested under osx/linux so far)
This is how it looks like right now