-
Notifications
You must be signed in to change notification settings - Fork 23
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
#180: commandlet to set tool edition #181
#180: commandlet to set tool edition #181
Conversation
Pull Request Test Coverage Report for Build 7668066283
💛 - Coveralls |
Maybe the |
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.
Thanks for your additions and the correction of set and list-version.
It would be nice if you could add some small unit tests for your commands too.
cli/src/main/java/com/devonfw/tools/ide/commandlet/EditionGetCommandlet.java
Outdated
Show resolved
Hide resolved
cli/src/main/java/com/devonfw/tools/ide/tool/LocalToolCommandlet.java
Outdated
Show resolved
Hide resolved
cli/src/main/java/com/devonfw/tools/ide/tool/ToolCommandlet.java
Outdated
Show resolved
Hide resolved
…mmandlet' of https://github.com/MattesMrzik/IDEasy into feature/devonfw#180-feature-to-set-tool-edition-with-commandlet
…ture/devonfw#180-feature-to-set-tool-edition-with-commandlet # Conflicts: # cli/src/main/java/com/devonfw/tools/ide/commandlet/CommandletManagerImpl.java # cli/src/main/java/com/devonfw/tools/ide/process/ProcessResult.java # cli/src/main/java/com/devonfw/tools/ide/tool/LocalToolCommandlet.java # cli/src/main/resources/nls/Ide.properties # cli/src/main/resources/nls/Ide_de.properties
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.
@MattesMrzik thanks for this great PR. This is really good work 👍
I left very few review comments that someone else from the team should take over.
Either we merge this PR as is and create a new issue for the improvements or somebody will adopt the PR - both fine for me. I therefore put it back to team-review that the team can decide how to proceed. If you prefer to create a new issue for the review suggestions, you can then link that issue in a comment and then pass this PR back to me in final review and I can resolve and merge.
ToolCommandlet commandlet = this.tool.getValue(); | ||
VersionIdentifier installedVersion = commandlet.getInstalledVersion(); | ||
if (installedVersion == null) { | ||
throw new CliException("Tool " + commandlet.getName() + " is not installed!", TOOL_NOT_INSTALLED); |
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.
IMHO it would make much more sense to print the configured edition instead of failing.
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.
Done, adjusted the unit test accordingly. See #194
String edition = toolPath.toRealPath().getParent().getFileName().toString(); | ||
if (!this.context.getUrls().getSortedEditions(getName()).contains(edition)) { | ||
this.context.warning("The determined edition \"{}\" of tool {} is not among the editions provided by IDEasy", | ||
edition, getName()); | ||
} | ||
return edition; |
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.
If the tool was installed via devonfw-ide
this warning will be printed and the printed edition will be software
.
IMHO this behavior does not really make sense.
In such case as fallback we could simply print the configured edition what is still better than printing software
.
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.
Done. See #194
Thanks again @MattesMrzik for this great work. This PR is replaced by #194 thanks to @salimbouch who took over your work to get it to the finishing line. |
Closes #180.
Implemented
set-edition
,get-edition
andlist-edition
commandlet.The
get-edition
assumes that the software of a tool is linked in<IDE_HOME>/software
to its source in_ide/software/default/<tool>/<edition>/<current version>
.Added a check when reinstalling tools that not only determines if the newly installed version is different from the current version, but also if the edition is different.