搜索插件、代码仓与 APP 分类

插件详情v2.16.0

cli_pkg

用于发布 Dart CLI 包的 Grinder 任务。

macOSWindowsLinux
近 30 天下载
7.6万
喜欢数
23
Pub 分数
110

安装插件

flutter pub add cli_pkg

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

cli_pkg 是一个 Dart 包,旨在简化命令行界面(CLI)包的发布流程。它提供了 Grinder 任务,可自动化常见的发布工作流,如版本管理、测试和生成发布说明。由 sass-lang.com 开发并托管在 GitHub 上,支持 macOS、Windows 和 Linux,非常适合维护跨平台 CLI 工具的开发者。该包与 Flutter 和 Dart 生态系统无缝集成,在包发布过程中减少了手动操作步骤。

适合场景

  • 自动化 CLI 包发布
  • 管理 CLI 项目的版本控制
  • 生成发布说明
  • 跨平台 CLI 开发
  • 优化CI/CD流水线

主要特点

  • 预定义的 Grinder 任务
  • 版本升级自动化
  • 发布说明生成
  • 跨平台支持
  • 与 Dart pub 的集成

适合对象

  • Dart CLI 工具维护者
  • 开源包发布者
  • CI/CD 流水线集成商
  • 使用 Grinder 的开发人员
  • 管理频繁发布的工作团队

使用建议

  • 需要磨床设置
  • 仅限 CLI 包工作流
  • 依赖 GitHub 进行发布工作流
  • 不适用于非CLI包
  • 需要手动配置以实现自定义发布逻辑

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Dart CLI Packager

This package provides a set of Grinder tasks that make it easy to release a Dart command-line application on many different release channels, to Dart users and non-Dart users alike. It also integrates with Travis CI to make it easy to automatically deploy packages.

To use this package, import package:cli_pkg/cli_pkg.dart and call pkg.addAllTasks() before calling grind():

import 'package:cli_pkg/cli_pkg.dart' as pkg;
import 'package:grinder/grinder.dart';

void main(List<String> args) {
  pkg.addAllTasks();
  grind(args);
}

The following sets of tasks are provided, each of which can also be enabled individually:

It's strongly recommended that this package be imported with the prefix pkg.

Configuration

This package is highly configurable, using ConfigVariable fields defined at the top level of the library. By default, it infers as much configuration as possible from the package's pubspec, but almost all properties can be overridden in the main() method:

import 'package:cli_pkg/cli_pkg.dart' as pkg;
import 'package:grinder/grinder.dart';

void main(List<String> args) {
  pkg.name.value = "bot-name";
  pkg.humanName.value = "My App";

  pkg.addAllTasks();
  grind(args);
}

ConfigVariables whose values are expensive to compute or that might fail under some circumstances can also be set to callback functions, which are called lazily when the variables are used by the Grinder tasks:

import 'package:cli_pkg/cli_pkg.dart' as pkg;
import 'package:grinder/grinder.dart';

void main(List<String> args) {
  pkg.githubReleaseNotes.fn = () => File.read("RELNOTES.md");

  pkg.addAllTasks();
  grind(args);
}

Each task describes exactly which configuration variables it uses. Configuration that just applies to one set of tasks is always prefixed with a corresponding name. For example, pkg.jsFlags applies to JavaScript compilation.

所属分类

依赖

依赖清单 25 项

源码仓库

使用此插件的项目