Skip to content

Determine software version from symlink and recover missing .ide.software.version #2371

Description

@krystynaShatkovska

Feature idea

Follow-up to #2306. This issue is the foundation to rework how IDEasy determines a tool's installed edition and version: a single cached EditionAndVersion lookup via the computeInstalledEditionAndVersion() hook.

Today, edition and version are resolved by two somewhat independent mechanisms. We want to make the
(sym)link the primary source of truth and demote the .ide.software.version file to a fallback:

  1. Software installed via the repository. Resolve the version together with the edition from the (sym)link (i.e. the real path inside the software repository), in a single lookup. The .ide.software.version file should only be read as a fallback for devonfw-ide legacy compatibility, when no (sym)link could be found.

  2. Tools without a version file in the repo (e.g. Python). Add code that determines the version from the CLI (e.g. python --version) so a lost .ide.software.version file is auto-recovered instead of leaving the tool looking "uninstalled".

What we have now

  • LocalToolCommandlet.getInstalledVersion(Path) reads .ide.software.version (legacy fallback
    .devon.software.version). If the file is missing it logs a warning and returns null.So a deleted
    file makes the tool appear not installed.
  • LocalToolCommandlet.getInstalledEdition(Path) separately resolves the symlink (toRealPath) and
    derives the edition from the repository path, falling back to the configured edition for devonfw-ide
    installations.
  • These are currently two independent lookups. #2296: Refactor ToolCommandlet to determine InstalledEdition and Version in a Single Cached Lookup #2306 unifies them into one cached EditionAndVersion
    lookup, which is what makes point 1 possible.

Additional context

No response

Activity

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions