-
Notifications
You must be signed in to change notification settings - Fork 30
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
#142 and #94: Plugin based commandlet feature and PluginBasedCommandlet #153
Conversation
…nction, such that user can configure plugins in their home directory as well
…nction, such that user can configure plugins in their home directory as well
cli/src/main/java/com/devonfw/tools/ide/tool/ide/IdeToolCommandlet.java
Outdated
Show resolved
Hide resolved
cli/src/main/java/com/devonfw/tools/ide/tool/PluginBasedCommandlet.java
Outdated
Show resolved
Hide resolved
cli/src/main/java/com/devonfw/tools/ide/tool/PluginBasedCommandlet.java
Outdated
Show resolved
Hide resolved
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.
@diiinesh I am aware this is still in draft. However, due to a question I was asked to answer in this PR I already looked at your code.
You did a good job and are very close to the final result. 👍
IMHO you can address my review comments and then take this PR out of draft mode and move it to the review so it can get merged.
…uginBasedCommandlet, also changed method of getting home directory
Pull Request Test Coverage Report for Build 7222434854
💛 - Coveralls |
…and uninstallPlugin, changed PluginBasedCommandlet.java to abstract class
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.
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import java.util.*; |
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.
your IDE settings are outdated/incorrect. Star-Imports are discouraged. According to our IDE settings this should also be auto-configured correctly for Intellij (maybe ask @jan-vcapgemini if it is not working for you) and for Eclipse it was correct from the beginning.
/** | ||
* Test of {@link EnvironmentCommandlet} run. | ||
*/ | ||
@Test | ||
public void testRun() { | ||
|
||
// arrange | ||
String path = "workspaces/foo-test/my-git-repo"; | ||
IdeTestContext context = newContext("basic", path, false); | ||
EnvironmentCommandlet env = context.getCommandletManager().getCommandlet(EnvironmentCommandlet.class); | ||
// act | ||
env.run(); | ||
// assert | ||
assertLogMessage(context, IdeLogLevel.INFO, "MVN_VERSION=3.9.*"); | ||
assertLogMessage(context, IdeLogLevel.INFO, "SOME=some-${UNDEFINED}"); | ||
assertLogMessage(context, IdeLogLevel.INFO, "BAR=bar-some-${UNDEFINED}"); | ||
assertLogMessage(context, IdeLogLevel.INFO, "IDE_TOOLS=mvn,eclipse"); | ||
assertLogMessage(context, IdeLogLevel.INFO, "ECLIPSE_VERSION=2023-03"); | ||
assertLogMessage(context, IdeLogLevel.INFO, "FOO=foo-bar-some-${UNDEFINED}"); | ||
assertLogMessage(context, IdeLogLevel.INFO, "JAVA_VERSION=17*"); | ||
assertLogMessage(context, IdeLogLevel.INFO, "INTELLIJ_EDITION=ultimate"); | ||
assertLogMessage(context, IdeLogLevel.INFO, "DOCKER_EDITION=docker"); | ||
} | ||
/** | ||
* Test of {@link EnvironmentCommandlet} does not require home. | ||
*/ |
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.
your commit is removing and reverting a lot of things that seems to be undesired.
I already reverted some things in the browser but that is rather tedious.
IMHO you did something wrong with git here to lose/revert changes that had made by others as improvements.
See also entire removal of ConextCommandletTest.java
what is IMHO a mistake.
I already reverted the removal of the coverall stuff added by Moritz.
@Test | ||
public void testGetPluginsMap() { | ||
|
||
|
||
|
||
|
||
|
||
} |
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.
does not seem to be complete.
Why is a @test annotation inside a Commandlet? This does not make sense.
Either this is a test so it may extend Assertions
or other test-classes or it is a commandlet but not a test.
<plugin> | ||
<groupId>org.jacoco</groupId> | ||
<artifactId>jacoco-maven-plugin</artifactId> | ||
<version>0.8.11</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>prepare-agent</goal> | ||
</goals> | ||
</execution> | ||
<execution> | ||
<id>report</id> | ||
<phase>prepare-package</phase> | ||
<goals> | ||
<goal>report</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> |
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.
was added by Moritz on purpose. Do not remove.
assertThat(help.isIdeHomeRequired()).isFalse(); | ||
assertThat(help.isIdeHomeRequired()).isEqualTo(false); |
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 was also an improvement that you are reverting.
@@ -10,7 +10,6 @@ image:https://img.shields.io/github/license/devonfw/IDEasy.svg?label=License["Ap | |||
image:https://img.shields.io/maven-central/v/com.devonfw.tools.ide/ide-cli.svg?label=Maven%20Central["Maven Central",link=https://search.maven.org/search?q=g:com.devonfw.tools.ide] | |||
image:https://github.com/devonfw/IDEasy/actions/workflows/build.yml/badge.svg["Build Status",link="https://github.com/devonfw/IDEasy/actions/workflows/build.yml"] | |||
image:https://github.com/devonfw/IDEasy/actions/workflows/update-urls.yml/badge.svg["Update URLS Status",link="https://github.com/devonfw/IDEasy/actions/workflows/update-urls.yml"] | |||
image:https://coveralls.io/repos/github/devonfw/IDEasy/badge.svg?branch=main["Coverage Status",link="https://coveralls.io/github/devonfw/IDEasy?branch=main"] |
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.
please keep this badge added by Moritz for the coverage.
To avoid double effort, I will close this PR and we concentrate on PR #141 that includes the changes of this PR and already fixed some of the problems. |
fixes #142:
fixes #94