配置文件

  • .json/.json5
  • .xml
  • .yaml/yml
  • .toml 规范
  • .lock 一般都是项目依赖详细清单 一般不用修改
  • .properties

json

ArkUI

oh-package.json5 :工程级依赖配置文件,用于记录引入包的配置信息

{
  "license": "",
  "devDependencies": {
    "@ohos/hypium": "1.0.6"
  },
  "author": "cps",
  "name": "healthy_life",
  "description": "Please describe the basic information.",
  "main": "",
  "version": "1.0.0",
  "dependencies": {
//    "@ohos/mmkv": "^2.0.2",// 在x86虚拟机上安装不了
    "@ohos/zxing": "^2.0.0",
    "@ohos/axios": "^2.0.2",
    "@ohos/pulltorefresh": "^2.0.3",
    "@ohos/lottie": "^2.0.1",
    "@ohos/mpchart": "^2.0.0",
    "@ohos/crypto-js": "^2.0.1"
  }
}

yaml

Flutter

pubspec.yaml : Flutter 的配置文件,配置依赖等

name: flutter_entryless
description: A new Flutter project.

version: 1.0.0+1

environment:
  sdk: ">=2.16.1 <3.0.0"

dependencies:
  flutter:
    sdk: flutter 
  # rxdart https://pub.flutter-io.cn/packages/rxdart
  rxdart: ^0.27.1
  #GetX状态管理框架 https://pub.flutter-io.cn/packages/get
  get: 4.3.7
  #toast https://pub.flutter-io.cn/packages/fluttertoast
  fluttertoast: ^8.0.8
  # 网络请求库 https://github.com/flutterchina/dio
  dio: 4.0.0
  # 网络检测 https://pub.flutter-io.cn/packages/connectivity
  connectivity: 3.0.6
  # 加载SVG图片 https://pub.flutter-io.cn/packages/flutter_svg
  flutter_svg: 0.22.0
  # lottie动画 https://pub.flutter-io.cn/packages/flutter_lottie
  lottie: ^1.1.0
  # SP键值对存储 https://pub.flutter-io.cn/packages/shared_preferences
  shared_preferences: ^2.0.6
  # WebView
  webview_flutter: ^2.0.12
  #读取相册
  image_picker: 0.8.3+3
  # https://github.com/flutter/plugins/tree/master/packages/url_launcher
  url_launcher: ^6.0.9
  #文件路径管理工具类
  path_provider: ^2.0.2
  #上拉刷新、下拉加载
  pull_to_refresh: ^2.0.0
  #加载html标签
  flutter_html: ^2.1.2
  #调用分享平台 https://pub.flutter-io.cn/packages/share
  share: ^2.0.4
  #圖片保存到本地 https://pub.flutter-io.cn/packages/image_gallery_saver
  #image_gallery_saver: ^1.7.1
  #权限申请框架 https://pub.flutter-io.cn/packages/permission_handler
  permission_handler: ^8.1.6
  #轮播图插件
  flutter_swiper : 1.1.6
  #日期转换
  date_format: ^1.0.6

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.2

dev_dependencies:
  flutter_test:
    sdk: flutter

  # The "flutter_lints" package below contains a set of recommended lints to
  # encourage good coding practices. The lint set provided by the package is
  # activated in the `analysis_options.yaml` file located at the root of your
  # package. See that file for information about deactivating specific lint
  # rules and activating additional ones.
  flutter_lints: ^1.0.0

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  assets:
    - assets/images/3.0x/
    - assets/images/3.0x/bus_up.png
    - assets/svg/
    - assets/lottie/lottie_common_load.json
    - assets/lottie/page_loading_anim.json
    - assets/lottie/refresh_footer.json
    - assets/lottie/refresh_head_loading.json
    - assets/lottie/refresh_empty_page.json
    - assets/lottie/refresh_error.json
    - assets/lottie/collect_success.json

properties

Android

  • local.properties 本地的配置
  • gradle.properties gradle的配置
sdk.dir=D\:\\Android\\Sdk
ndk.dir=D\:\\Android\\Sdk\\ndk\\25.2.9519653

toml

Android

libs.versions.toml 一般用于配置依赖

# 规范 :首字母不能大写
#       有4个[versions] [libraries] [bundles] [plugins] 可分别在这4个里面写相同的alias
#       compose-compiler 用的时候会变成compose.compiler 或者直接用驼峰式

[versions]
# 基本配置
gradlePlugin = "7.3.0"
compileSdk = "33" #编辑时用最新的API
buildTools = "33.0.0"#与上面的大版本号要一致
minSdk = "21" #可运行sdk的最低版本
targetSdk = "28" # 提供向前兼容的主要依据
versionCode = "7"
versionName = "1.0.0"

[libraries]
## 极光推送
jpush = { module = "cn.jiguang.sdk:jpush", version.ref = "jpush" }
jcore = "cn.jiguang.sdk:jcore:4.1.0"

#节用于声明依赖关系包
[bundles]
#推送
push = ["jpush","jcore"]

[plugins]
android-application = { id = "com.android.application", version.ref = "gradlePlugin" }

Rust

Cargo.toml 是 cargo 特有的项目数据描述文件。它存储了项目的所有元配置信息,如果 Rust 开发者希望 Rust 项目能够按照期望的方式进行构建、测试和运行,那么,必须按照合理的方式构建 Cargo.toml

[package]
name = "hello"
version = "0.1.0"
edition = "2021"

#基于 Rust 官方仓库 crates.io,通过版本说明来描述
#基于项目源代码的 git 仓库地址,通过 URL 来描述
#基于本地项目的绝对路径或者相对路径,通过类 Unix 模式的路径来描述
[dependencies]
rand = "0.3"
hammer = { version = "0.5.0"}
color = { git = "https://github.com/bjz/color-rs" }
geometry = { path = "crates/geometry" }

posted @ 2023-09-21 16:00  cps666  阅读(54)  评论(0编辑  收藏  举报