Code Space

Blue sky

 

Dart package pubspec.yaml文件格式介绍

    每一个dart package均需要有一个描述文件,在dart中,该文件默认为 pubspec.yaml. 该文件描述package name、dependencies等等信息。一般来说,常见的pubspec文件格式及内容如下:

name: newtify
version: 1.2.3
description: >-
  Have you been turned into a newt?  Would you like to be?
  This package can help. It has all of the
  newt-transmogrification functionality you have been looking
  for.
homepage: https://example-pet-store.com/newtify
documentation: https://example-pet-store.com/newtify/docs
environment:
  sdk: '>=2.10.0 <3.0.0'
dependencies:
  efts: ^2.0.4
  transmogrify: ^0.4.0
dev_dependencies:
  test: '>=1.15.0 <2.0.0'

 

pubspec支持的配置字段及详细信息,可以直接参考官网文档,这里就不做搬运工了:

https://dart.cn/tools/pub/pubspec

 

posted on 2021-02-05 22:34  一抹青阳  阅读(269)  评论(0编辑  收藏  举报

导航