【问题标题】:Is it possible to get pubspec.yaml version in runtime?是否可以在运行时获取 pubspec.yaml 版本?
【发布时间】:2015-08-01 04:36:03
【问题描述】:

假设我们有 pubspec.yaml 之类的:

name: myApp
version: x.y.z

我可以在运行时的 main 函数中获得高于 x.y.z 的版本吗?

【问题讨论】:

    标签: dart dart-pub


    【解决方案1】:

    目前没有通用的方法。请参阅https://github.com/google/grinder.dart/blob/19a6d13866de8f4a3b295074a3487eaa77b7a2f8/lib/src/cli.dart#L17,了解它在 Grinder 包中是如何完成的。有计划改进这一点。例如看这个讨论https://groups.google.com/a/dartlang.org/forum/m/#!topic/core-dev/8WrVpjD6tt8

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-10-10
      • 1970-01-01
      • 2020-04-15
      • 1970-01-01
      • 2021-08-21
      • 1970-01-01
      • 2012-02-21
      相关资源
      最近更新 更多