From 297559146d505cf4a7457512aa7417b77f9120c8 Mon Sep 17 00:00:00 2001 From: leonrohne27 Date: Thu, 14 Nov 2024 11:20:54 +0100 Subject: [PATCH 01/10] #751: Moved postInstall() and changed toll installation message Moved the method postInstall from GlobalToolCommandlet to LocalToolCommandlet and changed the installation message so that the user is not getting confused --- .../java/com/devonfw/tools/ide/tool/GlobalToolCommandlet.java | 3 +-- .../java/com/devonfw/tools/ide/tool/LocalToolCommandlet.java | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/main/java/com/devonfw/tools/ide/tool/GlobalToolCommandlet.java b/cli/src/main/java/com/devonfw/tools/ide/tool/GlobalToolCommandlet.java index 8bcd676e5..bd5716a55 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/tool/GlobalToolCommandlet.java +++ b/cli/src/main/java/com/devonfw/tools/ide/tool/GlobalToolCommandlet.java @@ -147,12 +147,11 @@ public boolean install(boolean silent, EnvironmentContext environmentContext) { fileAccess.delete(tmpDir); } if (exitCode == 0) { - this.context.success("Successfully installed {} in version {}", this.tool, resolvedVersion); + this.context.success("Installation process for {} in version {} has started", this.tool, resolvedVersion); } else { this.context.warning("{} in version {} was not successfully installed", this.tool, resolvedVersion); return false; } - postInstall(); return true; } diff --git a/cli/src/main/java/com/devonfw/tools/ide/tool/LocalToolCommandlet.java b/cli/src/main/java/com/devonfw/tools/ide/tool/LocalToolCommandlet.java index 009ef5187..75434441a 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/tool/LocalToolCommandlet.java +++ b/cli/src/main/java/com/devonfw/tools/ide/tool/LocalToolCommandlet.java @@ -106,6 +106,7 @@ public final boolean install(boolean silent, EnvironmentContext environmentConte } else { step.success("Successfully installed {} in version {} replacing previous version {}", this.tool, resolvedVersion, installedVersion); } + postInstall(); return true; } catch (RuntimeException e) { step.error(e, true); From 69ca037427fd3359e6d6a0ea7a4c234904c33320 Mon Sep 17 00:00:00 2001 From: leonrohne27 Date: Fri, 15 Nov 2024 13:36:19 +0100 Subject: [PATCH 02/10] #758: added status commandlet Added a status commandlet that lets the user check his ide status --- .../ide/commandlet/CommandletManagerImpl.java | 1 + .../ide/commandlet/StatusCommandlet.java | 32 +++++++++++++++++++ cli/src/main/package/bin/ide | 1 + 3 files changed, 34 insertions(+) create mode 100644 cli/src/main/java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java diff --git a/cli/src/main/java/com/devonfw/tools/ide/commandlet/CommandletManagerImpl.java b/cli/src/main/java/com/devonfw/tools/ide/commandlet/CommandletManagerImpl.java index 2c4601735..10c4621fa 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/commandlet/CommandletManagerImpl.java +++ b/cli/src/main/java/com/devonfw/tools/ide/commandlet/CommandletManagerImpl.java @@ -75,6 +75,7 @@ public CommandletManagerImpl(IdeContext context) { add(new EditionSetCommandlet(context)); add(new EditionListCommandlet(context)); add(new VersionCommandlet(context)); + add(new StatusCommandlet(context)); add(new RepositoryCommandlet(context)); add(new UninstallCommandlet(context)); add(new UpdateCommandlet(context)); diff --git a/cli/src/main/java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java b/cli/src/main/java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java new file mode 100644 index 000000000..749509e33 --- /dev/null +++ b/cli/src/main/java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java @@ -0,0 +1,32 @@ +package com.devonfw.tools.ide.commandlet; + +import com.devonfw.tools.ide.context.IdeContext; +import com.devonfw.tools.ide.property.FlagProperty; +import com.devonfw.tools.ide.version.IdeVersion; + + +public class StatusCommandlet extends Commandlet { + + + /** + * The constructor. + * + * @param context the {@link IdeContext}. + */ + public StatusCommandlet(IdeContext context) { + + super(context); + addKeyword(new FlagProperty(getName(), true, "-s")); + } + + @Override + public String getName() { + + return "status"; + } + + @Override + public void run() { + this.context.info(IdeVersion.get()); + } +} diff --git a/cli/src/main/package/bin/ide b/cli/src/main/package/bin/ide index 3b7f1bdd1..ffffa9fcc 100644 --- a/cli/src/main/package/bin/ide +++ b/cli/src/main/package/bin/ide @@ -15,6 +15,7 @@ ide_env="$("${_IDEASY}" env --bash)" if [ $? = 0 ]; then eval "${ide_env}" if [ $# = 0 ]; then + java -cp "${IDE_HOME}/lib/*" com.devonfw.tools.ide.commandlet.StatusCommandlet "${WORKSPACE}" echo "IDE environment variables have been set for ${IDE_HOME} in workspace ${WORKSPACE}" fi fi From 27b0c13f6abd6aea49a952eb025421f726171794 Mon Sep 17 00:00:00 2001 From: leonrohne27 Date: Fri, 15 Nov 2024 13:46:30 +0100 Subject: [PATCH 03/10] #758: deleted version --- .../java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/cli/src/main/java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java b/cli/src/main/java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java index 749509e33..9efe28f23 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java +++ b/cli/src/main/java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java @@ -2,7 +2,6 @@ import com.devonfw.tools.ide.context.IdeContext; import com.devonfw.tools.ide.property.FlagProperty; -import com.devonfw.tools.ide.version.IdeVersion; public class StatusCommandlet extends Commandlet { @@ -27,6 +26,5 @@ public String getName() { @Override public void run() { - this.context.info(IdeVersion.get()); } } From 4e4a3f9cedf99f36fe933852a4087d8a7af24068 Mon Sep 17 00:00:00 2001 From: leonrohne27 Date: Fri, 15 Nov 2024 14:15:15 +0100 Subject: [PATCH 04/10] #758: Moved postInstall() and changed tool installation message --- .../java/com/devonfw/tools/ide/tool/GlobalToolCommandlet.java | 3 ++- .../java/com/devonfw/tools/ide/tool/LocalToolCommandlet.java | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/main/java/com/devonfw/tools/ide/tool/GlobalToolCommandlet.java b/cli/src/main/java/com/devonfw/tools/ide/tool/GlobalToolCommandlet.java index bd5716a55..8bcd676e5 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/tool/GlobalToolCommandlet.java +++ b/cli/src/main/java/com/devonfw/tools/ide/tool/GlobalToolCommandlet.java @@ -147,11 +147,12 @@ public boolean install(boolean silent, EnvironmentContext environmentContext) { fileAccess.delete(tmpDir); } if (exitCode == 0) { - this.context.success("Installation process for {} in version {} has started", this.tool, resolvedVersion); + this.context.success("Successfully installed {} in version {}", this.tool, resolvedVersion); } else { this.context.warning("{} in version {} was not successfully installed", this.tool, resolvedVersion); return false; } + postInstall(); return true; } diff --git a/cli/src/main/java/com/devonfw/tools/ide/tool/LocalToolCommandlet.java b/cli/src/main/java/com/devonfw/tools/ide/tool/LocalToolCommandlet.java index 75434441a..009ef5187 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/tool/LocalToolCommandlet.java +++ b/cli/src/main/java/com/devonfw/tools/ide/tool/LocalToolCommandlet.java @@ -106,7 +106,6 @@ public final boolean install(boolean silent, EnvironmentContext environmentConte } else { step.success("Successfully installed {} in version {} replacing previous version {}", this.tool, resolvedVersion, installedVersion); } - postInstall(); return true; } catch (RuntimeException e) { step.error(e, true); From 74fcc41707bd299bd5eafaf4bf81662955891886 Mon Sep 17 00:00:00 2001 From: leonrohne27 Date: Fri, 15 Nov 2024 15:10:36 +0100 Subject: [PATCH 05/10] #758 --- .../java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/main/java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java b/cli/src/main/java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java index 9efe28f23..4e71b7ec0 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java +++ b/cli/src/main/java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java @@ -15,7 +15,7 @@ public class StatusCommandlet extends Commandlet { public StatusCommandlet(IdeContext context) { super(context); - addKeyword(new FlagProperty(getName(), true, "-s")); + addKeyword(new FlagProperty(getName())); } @Override From 1b4cd56c2a68d49502e6f961502aec71819bf258 Mon Sep 17 00:00:00 2001 From: leonrohne27 Date: Fri, 15 Nov 2024 15:44:09 +0100 Subject: [PATCH 06/10] #758 --- .../com/devonfw/tools/ide/commandlet/StatusCommandlet.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cli/src/main/java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java b/cli/src/main/java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java index 4e71b7ec0..13491b6a9 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java +++ b/cli/src/main/java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java @@ -1,11 +1,12 @@ package com.devonfw.tools.ide.commandlet; import com.devonfw.tools.ide.context.IdeContext; -import com.devonfw.tools.ide.property.FlagProperty; +import com.devonfw.tools.ide.property.CommandletProperty; public class StatusCommandlet extends Commandlet { + public final CommandletProperty commandlet; /** * The constructor. @@ -15,7 +16,8 @@ public class StatusCommandlet extends Commandlet { public StatusCommandlet(IdeContext context) { super(context); - addKeyword(new FlagProperty(getName())); + addKeyword(getName()); + this.commandlet = add(new CommandletProperty("", false, "commandlet")); } @Override From 9962bbc2f059ef393fb609dde0787a4ae11a5dbd Mon Sep 17 00:00:00 2001 From: leonrohne27 Date: Fri, 15 Nov 2024 16:04:48 +0100 Subject: [PATCH 07/10] #758 --- cli/src/main/resources/nls/Help.properties | 2 ++ cli/src/main/resources/nls/Help_de.properties | 2 ++ 2 files changed, 4 insertions(+) diff --git a/cli/src/main/resources/nls/Help.properties b/cli/src/main/resources/nls/Help.properties index 0ebd40e67..79cb50913 100644 --- a/cli/src/main/resources/nls/Help.properties +++ b/cli/src/main/resources/nls/Help.properties @@ -95,6 +95,8 @@ cmd.shell.detail=The interactive shell offers console users a new user experienc cmd.sonar=Tool commandlet for SonarQube. cmd.sonar.detail=SonarQube is a platform for continuous inspection of code quality. Detailed documentation can be found at https://docs.sonarqube.org/ cmd.sonar.val.command=Action to perform (START|STOP|ANALYZE) +cmd.status=Checks your IDE-status +cmd.status.detail=To check your IDE-status, you need to run the following command: 'ide status'. cmd.terraform=Tool commandlet for Terraform. cmd.terraform.detail=Terraform is an infrastructure as code tool for managing cloud resources. Detailed documentation can be found at https://www.terraform.io/docs/index.html cmd.tomcat=Tool commandlet for Tomcat diff --git a/cli/src/main/resources/nls/Help_de.properties b/cli/src/main/resources/nls/Help_de.properties index efab2481a..4e6e292a7 100644 --- a/cli/src/main/resources/nls/Help_de.properties +++ b/cli/src/main/resources/nls/Help_de.properties @@ -95,6 +95,8 @@ cmd.shell.detail=Die integrierte Shell bietet Konsolenbenutzer*Innen eine neue B cmd.sonar=Werkzeug Kommando für SonarQube. cmd.sonar.detail=SonarQube ist eine Plattform für die kontinuierliche Code-Qualitätsprüfung. Detaillierte Dokumentation ist zu finden unter https://docs.sonarqube.org/ cmd.sonar.val.command=Auszuführende Aktion (START|STOP|ANALYZE) +cmd.status=Checkt deinen IDE-Status +cmd.status.detail=Um deinen IDE-Status zu checken, geben sie einfach 'ide status' in die Konsole ein. cmd.terraform=Werkzeug Kommando für Terraform. cmd.terraform.detail=Terraform ist ein Tool für Infrastructure as Code zur Verwaltung von Cloud-Ressourcen. Detaillierte Dokumentation ist zu finden unter https://www.terraform.io/docs/index.html cmd.tomcat=Werkzeug Kommando für Tomcat From 1c4ac12e3cdefbff7dbbc83c113e695790e22ed6 Mon Sep 17 00:00:00 2001 From: leonrohne27 Date: Mon, 18 Nov 2024 13:04:32 +0100 Subject: [PATCH 08/10] #758 --- cli/src/main/package/bin/ide | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/main/package/bin/ide b/cli/src/main/package/bin/ide index ffffa9fcc..58ee8a3d0 100644 --- a/cli/src/main/package/bin/ide +++ b/cli/src/main/package/bin/ide @@ -15,7 +15,7 @@ ide_env="$("${_IDEASY}" env --bash)" if [ $? = 0 ]; then eval "${ide_env}" if [ $# = 0 ]; then - java -cp "${IDE_HOME}/lib/*" com.devonfw.tools.ide.commandlet.StatusCommandlet "${WORKSPACE}" + ide status echo "IDE environment variables have been set for ${IDE_HOME} in workspace ${WORKSPACE}" fi fi From 90cc035493edcff6490a2cc40c5b3b299ec8ec2f Mon Sep 17 00:00:00 2001 From: leonrohne27 Date: Mon, 18 Nov 2024 13:13:30 +0100 Subject: [PATCH 09/10] Update cli/src/main/resources/nls/Help_de.properties Co-authored-by: jan-vcapgemini <59438728+jan-vcapgemini@users.noreply.github.com> --- cli/src/main/resources/nls/Help_de.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/main/resources/nls/Help_de.properties b/cli/src/main/resources/nls/Help_de.properties index 4e6e292a7..b64a7a7bb 100644 --- a/cli/src/main/resources/nls/Help_de.properties +++ b/cli/src/main/resources/nls/Help_de.properties @@ -95,7 +95,7 @@ cmd.shell.detail=Die integrierte Shell bietet Konsolenbenutzer*Innen eine neue B cmd.sonar=Werkzeug Kommando für SonarQube. cmd.sonar.detail=SonarQube ist eine Plattform für die kontinuierliche Code-Qualitätsprüfung. Detaillierte Dokumentation ist zu finden unter https://docs.sonarqube.org/ cmd.sonar.val.command=Auszuführende Aktion (START|STOP|ANALYZE) -cmd.status=Checkt deinen IDE-Status +cmd.status=Gibt einen Statusbericht über IDEasy aus cmd.status.detail=Um deinen IDE-Status zu checken, geben sie einfach 'ide status' in die Konsole ein. cmd.terraform=Werkzeug Kommando für Terraform. cmd.terraform.detail=Terraform ist ein Tool für Infrastructure as Code zur Verwaltung von Cloud-Ressourcen. Detaillierte Dokumentation ist zu finden unter https://www.terraform.io/docs/index.html From 3ae5e7b0add56d80b776795add474af220da475f Mon Sep 17 00:00:00 2001 From: leonrohne27 Date: Mon, 18 Nov 2024 13:35:59 +0100 Subject: [PATCH 10/10] #758: implemented requested changes added missing Javadoc to StatusCommandlet and updated help output --- .../devonfw/tools/ide/commandlet/StatusCommandlet.java | 8 +++----- cli/src/main/resources/nls/Help.properties | 4 ++-- cli/src/main/resources/nls/Help_de.properties | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/cli/src/main/java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java b/cli/src/main/java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java index 13491b6a9..0f2e5b59c 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java +++ b/cli/src/main/java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java @@ -1,13 +1,12 @@ package com.devonfw.tools.ide.commandlet; import com.devonfw.tools.ide.context.IdeContext; -import com.devonfw.tools.ide.property.CommandletProperty; - +/** + * {@link Commandlet} to print a status report about IDEasy. + */ public class StatusCommandlet extends Commandlet { - public final CommandletProperty commandlet; - /** * The constructor. * @@ -17,7 +16,6 @@ public StatusCommandlet(IdeContext context) { super(context); addKeyword(getName()); - this.commandlet = add(new CommandletProperty("", false, "commandlet")); } @Override diff --git a/cli/src/main/resources/nls/Help.properties b/cli/src/main/resources/nls/Help.properties index 79cb50913..a06b3b0a0 100644 --- a/cli/src/main/resources/nls/Help.properties +++ b/cli/src/main/resources/nls/Help.properties @@ -95,8 +95,8 @@ cmd.shell.detail=The interactive shell offers console users a new user experienc cmd.sonar=Tool commandlet for SonarQube. cmd.sonar.detail=SonarQube is a platform for continuous inspection of code quality. Detailed documentation can be found at https://docs.sonarqube.org/ cmd.sonar.val.command=Action to perform (START|STOP|ANALYZE) -cmd.status=Checks your IDE-status -cmd.status.detail=To check your IDE-status, you need to run the following command: 'ide status'. +cmd.status=Prints the status report about your IDEasy. +cmd.status.detail=To check your IDE-status (e.g. duplicated or legacy variables) as well as potential information about updates to settings you should apply\nwith ide update, run the following command: 'ide status'. cmd.terraform=Tool commandlet for Terraform. cmd.terraform.detail=Terraform is an infrastructure as code tool for managing cloud resources. Detailed documentation can be found at https://www.terraform.io/docs/index.html cmd.tomcat=Tool commandlet for Tomcat diff --git a/cli/src/main/resources/nls/Help_de.properties b/cli/src/main/resources/nls/Help_de.properties index 4e6e292a7..d20dabceb 100644 --- a/cli/src/main/resources/nls/Help_de.properties +++ b/cli/src/main/resources/nls/Help_de.properties @@ -96,7 +96,7 @@ cmd.sonar=Werkzeug Kommando für SonarQube. cmd.sonar.detail=SonarQube ist eine Plattform für die kontinuierliche Code-Qualitätsprüfung. Detaillierte Dokumentation ist zu finden unter https://docs.sonarqube.org/ cmd.sonar.val.command=Auszuführende Aktion (START|STOP|ANALYZE) cmd.status=Checkt deinen IDE-Status -cmd.status.detail=Um deinen IDE-Status zu checken, geben sie einfach 'ide status' in die Konsole ein. +cmd.status.detail=Um den Status Ihrer IDE zu überprüfen (z.B. doppelte oder veraltete Variablen) sowie potenzielle Informationen über Updates zu den Einstellungen,\ndie Sie mit dem Befehl 'ide update' anwenden sollten, führen Sie den folgenden Befehl aus: 'ide status'. cmd.terraform=Werkzeug Kommando für Terraform. cmd.terraform.detail=Terraform ist ein Tool für Infrastructure as Code zur Verwaltung von Cloud-Ressourcen. Detaillierte Dokumentation ist zu finden unter https://www.terraform.io/docs/index.html cmd.tomcat=Werkzeug Kommando für Tomcat