Skip to content

GlobalToolCommandlet: determine the edition together with the version for native package manager installs (Linux/macOS) #2373

Description

@krystynaShatkovska

Task summary

Follow-up to #2306. With that refactoring GlobalToolCommandlet.computeInstalledEditionAndVersion() resolves an EditionAndVersion per OS. For the Linux native package manager case (see #2250 / #2258) only the version is determined by getNativePackageVersion(); as a pragmatic fix in #2306 the edition is set to the tool name (new EditionAndVersion(this.tool, version)).

So what is needed?

Come up with a consistent solution so the edition is determined properly as well:

  • Linux / NativePackage: extend the NativePackage concept so that the native package lookup also yields an edition, and refactor getNativePackageVersion() to return EditionAndVersion (e.g. getNativePackageEditionAndVersion()).
  • Windows: the existing concept already supports multiple editions via the getWindowsRegistryAppNames() map (edition name -> registry app name), so we need to align the other OSes with this model.
  • macOS: the in-progress macOS PR should support the same concept, so that with this story all OS paths finally come together.

In the end:
computeInstalledEditionAndVersion() in GlobalToolCommandlet returns a meaningful edition on all OSes (instead of the this.tool placeholder), using one consistent edition-resolution model.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions