Skip to content

[Component Request] Add support for dart pub global packages #10182

Open
@C0Florent

Description

@C0Florent

Summary

I am using Ansible to set up a Mac for building Flutter apps for iOS. One of the many tools I need to install is melos, which I would typically install using pub (Dart's package manager).

pub supports global installs for executable packages such as melos by running dart pub global activate on the CLI.

Surprisingly, ansible does not have a proper integration with this, so I have to rely on builtin.cmd for the moment, which always reports the changed state.

I think a simple integration of pub global installs could be useful to have, and could probably be rather simple to implement by taking inspiration on the many other package managers already wrapped in ansible components.

Issue Type

Feature Idea

Component Name

pub_global (does not exist yet)

Additional Information

An example could look like the following:

# Runs `dart pub global activate melos ^7.0.0-dev`
- name: Install melos
  community.general.pub_global:
    name: melos
    versionSpec: ^7.0.0-dev
    state: activated

# This one should run `dart pub global activate --source git https://github.com/invertase/melos.git --git-path packages/melos --overwrite`
- name: Install from git
  community.general.pub_global:
    git:
      source: https://github.com/invertase/melos.git
      path: packages/melos
    state: activated
    overwrite: true

# Also add support for all other CLI options

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureThis issue/PR relates to a feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions