tomaszkubacki
tomaszkubacki

Reputation: 3262

Is it possible to get pubspec.yaml version in runtime?

Assuming we have pubspec.yaml like:

name: myApp
version: x.y.z

Can I get above x.y.z version in main function in runtime ?

Upvotes: 3

Views: 356

Answers (1)

Günter Zöchbauer
Günter Zöchbauer

Reputation: 657456

Currently there is no universal way. See https://github.com/google/grinder.dart/blob/19a6d13866de8f4a3b295074a3487eaa77b7a2f8/lib/src/cli.dart#L17 for how it's done in the Grinder package. There sre plans to improve this. See for example this discussion https://groups.google.com/a/dartlang.org/forum/m/#!topic/core-dev/8WrVpjD6tt8

Upvotes: 2

Related Questions