Skip to content

#2252: add uninstall support for globally installed tools on macOS - #2376

Open
Ali-Shariati-Najafabadi wants to merge 2 commits into
devonfw:mainfrom
Ali-Shariati-Najafabadi:feature/2252-macos-global-tool-uninstall
Open

#2252: add uninstall support for globally installed tools on macOS#2376
Ali-Shariati-Najafabadi wants to merge 2 commits into
devonfw:mainfrom
Ali-Shariati-Najafabadi:feature/2252-macos-global-tool-uninstall

Conversation

@Ali-Shariati-Najafabadi

@Ali-Shariati-Najafabadi Ali-Shariati-Najafabadi commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

This PR fixes #2252

Implemented changes:

  • On macOS, GlobalToolCommandlet.uninstall() now tries, in order: uninstall via Homebrew (formula/cask) using the existing NativePackageManager package-manager infrastructure, then removing a known *.app bundle from the Applications folder, and only if both fail, logs actionable manual-uninstall guidance instead of the previous generic error.
  • Added NativePackageManager.BREW / BREW_CASK so Homebrew reuses the same tested install/uninstall command derivation as the Linux package managers (APT/YUM/ZYPPER/DNF).
  • Fixed the shared package manager command builder to only prepend sudo for package managers that need it (Homebrew must never run as root).
  • Wired up Docker and PgAdmin (the two existing GlobalToolCommandlets) with their Homebrew cask name and known macOS .app bundle name, mirroring the existing getWindowsRegistryAppName() pattern.

Testing instructions

  1. mvn -Dtest=GlobalToolCommandletTest,NativePackageManagerTest,NativePackageTest,UninstallCommandletTest test in the cli module.
  2. Or run the full cli module test suite with mvn test.

Checklist for this PR

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary»
  • PR top-level comment summaries what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you or there is no issue
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc unless issue is labelled with internal
  • You have not changed any dependency in pom.xml files or otherwise if runtime dependencies changed, you have updated our LICENSE.asciidoc
  • You have formulated clear instructions on how to test your contribution under "Testing instructions"

…acOS

Try Homebrew (formula/cask) via the existing NativePackageManager
infrastructure, then fall back to removing a known *.app bundle from
the Applications folder, and finally give actionable manual-uninstall
guidance instead of the previous generic error.
@github-project-automation github-project-automation Bot moved this to 🆕 New in IDEasy board Aug 26, 2026
@Ali-Shariati-Najafabadi Ali-Shariati-Najafabadi added enhancement New feature or request macOS specific for Apple MacOS uninstall uninstall tools or IDEasy itself ready-to-implement labels Aug 26, 2026
@Ali-Shariati-Najafabadi Ali-Shariati-Najafabadi moved this from 🆕 New to 🏗 In progress in IDEasy board Aug 26, 2026
@hohwille hohwille moved this from 🏗 In progress to Team Review in IDEasy board Aug 27, 2026
@laim2003
laim2003 self-requested a review August 27, 2026 08:47
@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 33055744033

Coverage increased (+0.1%) to 73.837%

Details

  • Coverage increased (+0.1%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 93 coverage regressions across 5 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

93 previously-covered lines in 5 files lost coverage.

File Lines Losing Coverage Coverage
com/devonfw/tools/ide/tool/GlobalToolCommandlet.java 55 28.94%
com/devonfw/tools/ide/tool/pgadmin/PgAdmin.java 16 6.06%
com/devonfw/tools/ide/tool/NativePackageManager.java 12 79.39%
com/devonfw/tools/ide/tool/docker/Docker.java 9 53.33%
com/devonfw/tools/ide/version/VersionSegment.java 1 91.86%

Coverage Stats

Coverage Status
Relevant Lines: 18271
Covered Lines: 14096
Line Coverage: 77.15%
Relevant Branches: 8102
Covered Branches: 5377
Branch Coverage: 66.37%
Branches in Coverage %: Yes
Coverage Strength: 3.29 hits per line

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request macOS specific for Apple MacOS uninstall uninstall tools or IDEasy itself

Projects

Status: Team Review

Development

Successfully merging this pull request may close these issues.

Provide uninstall support for globally installed tools (macOS)

4 participants