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

#326: Improved UninstallCommandlet to uninstall multiple tools #334

Conversation

ndemirca
Copy link
Contributor

Closes: #326

@coveralls
Copy link
Collaborator

coveralls commented May 15, 2024

Pull Request Test Coverage Report for Build 9173412922

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.03%) to 59.404%

Files with Coverage Reduction New Missed Lines %
com/devonfw/tools/ide/common/Tag.java 2 96.26%
Totals Coverage Status
Change from base Build 9131466764: 0.03%
Covered Lines: 4615
Relevant Lines: 7487

💛 - Coveralls

@ndemirca ndemirca self-assigned this May 15, 2024
@ndemirca ndemirca marked this pull request as draft May 17, 2024 08:46
@ndemirca ndemirca marked this pull request as ready for review May 17, 2024 11:58
@ndemirca ndemirca requested a review from hohwille May 17, 2024 11:58
Copy link
Member

@hohwille hohwille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ndemirca thanks for your PR and the nice idea to support uninstalling multiple tools in one call. 👍
Please have a look at my review comments and see what you think.
IMHO the current approach is not really consistent. Most probably we have to rethink how to implement this properly:

  • Would we create a ToolListProperty?
  • Or would it be even smarter to change the general design of Property to allow some cardinality so every property can take any number of elements and by default the maximum is 1 and the minimum is 0 if not required and 1 if required? The cardinality could then be specified as an additional constructor argument to allow multiple parameters making StringListProperty pointless and removed (instead using StringProperty with any number of parameters).


/** The tool to uninstall. */
public final ToolProperty tool;
public class UninstallCommandlet extends LocalToolCommandlet {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inheriting from LocalToolCommandlet says that Uninstall is a tool that can be installed.
You can now do ide install uninstall and it will try to find a tool uninstall in ide-urls.
Also auto-completion will now suggest uninstall.
IMHO it is wrong to extend from LocalToolCommandlet here.

@@ -90,6 +90,11 @@
<artifactId>jansi</artifactId>
<version>${jansi.version}</version>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need byte-buddy now and what does it have to do with this story?

@@ -318,6 +318,9 @@ public final class Tag {
/** {@link #Tag} for encryption. */
public static final Tag ENCRYPTION = create("encryption", CRYPTO);

/** {@link #Tag} for uninstall. */
public static final Tag UNINSTALL = create("uninstall", ROOT, false, "remove");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also would question this tag. The idea of tags is to choose tools and plugins.
What else could/would be tagged with uninstall? Tagging xyz with xyz does not really add much value unless xyz is a category that groups multiple things beyond xyz.

@ndemirca ndemirca marked this pull request as draft May 21, 2024 10:49
@ndemirca ndemirca closed this May 22, 2024
@ndemirca ndemirca deleted the feature/326-Improve-Uninstall-For-Multiple-Tools branch May 22, 2024 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Uninstall multiple tools at the same time
3 participants