当前位置: 首页 > news >正文

编译工具与文件学习(一)-YAML、repos、vcstoolcolcon

YAML

YAML(YAML Ain’t Markup Language)是一种人类可读的数据序列化格式,常用于配置文件、数据交换和存储结构化数据。YAML 的设计目标是简洁、易读,并且能够表示复杂的数据结构。

YAML 文件的基本语法

  1. 基本结构

    • YAML 使用缩进来表示层级关系,通常使用空格(而不是制表符)进行缩进。
    • 每个层级的缩进通常为两个空格。
  2. 键值对

    • 使用冒号(:)分隔键和值。
    name: John Doe
    age: 30
    
  3. 列表

    • 使用短横线(-)表示列表项。
    fruits:- apple- banana- orange
    
  4. 字典

    • 字典可以嵌套,表示复杂的数据结构。
    person:name: John Doeage: 30address:street: 123 Main Stcity: Anytown
    
  5. 注释

    • 使用井号(#)表示注释,注释内容会被忽略。
    # 这是一个注释
    name: John Doe  # 这是另一个注释
    
  6. 多行字符串

    • 使用 | 表示保留换行的多行字符串。
    description: |This is a multi-line string.It preserves line breaks.
    
    • 使用 > 表示折叠的多行字符串,换行会被转换为空格。
    description: >This is a folded multi-line string.It will be a single line.
    
  7. 布尔值和空值

    • 布尔值可以用 truefalse 表示。
    • 空值可以用 null~ 表示。
    is_active: true
    middle_name: null
    last_name: ~
    

示例 YAML 文件

以下是一个包含多种数据结构的示例 YAML 文件:

version: 1.0
services:web:image: nginxports:- "80:80"database:image: postgresenvironment:POSTGRES_USER: userPOSTGRES_PASSWORD: password

YAML 文件因其简洁和可读性,广泛应用于配置文件(如 Docker Compose、Kubernetes 配置等)和数据交换场景。\

repos语法

  • repositories:为所有repos文件默认的开头
  • 每个需要下载的仓库的描述:
    target path for local save;
    type:git/Subversion/…
    url:storage pull website
    version:branch/tag/commit id

use vcs to simplify project management pipeline

vcs=封装过的git,简化了拉取和导出的流程

wget https://raw.githubusercontent.com/ros2/ros2/rolling/ros2.repos
mkdir src
vcs import src < ros2.repos
vcs validate --input ros2.repos

Results:

...
Found git repository 'https://github.com/ros2/tinyxml2_vendor.git' with branch 'rolling'
=== ros2/tlsf (git) ===
Found git repository 'https://github.com/ros2/tlsf.git' with branch 'rolling'
=== ros2/unique_identifier_msgs (git) ===
Found git repository 'https://github.com/ros2/unique_identifier_msgs.git' with branch 'rolling'
=== ros2/urdf (git) ===
Found git repository 'https://github.com/ros2/urdf.git' with branch 'rolling'
=== ros2/yaml_cpp_vendor (git) ===
Found git repository 'https://github.com/ros2/yaml_cpp_vendor.git' with branch 'rolling'

查看状态vcs status

.........................................................................................................
=== src/ament/ament_cmake (git) ===
位于分支 rolling
您的分支与上游分支 'origin/rolling' 一致。无文件要提交,干净的工作区
=== src/ament/ament_index (git) ===
位于分支 rolling
您的分支与上游分支 'origin/rolling' 一致。

colcon

查阅

  • 查看软件包的信息
colcon info --base-paths src/ros2/rcl/rcl_lifecycle

在这里插入图片描述

  • 只列举包名
 colcon list -n --base-paths src/ros2/rcl

在这里插入图片描述

colcon list -t --base-paths src/ros2/rcl

在这里插入图片描述

构建

http://www.lryc.cn/news/480580.html

相关文章:

  • 使用 HuggingFace 提供的 Elasticsearch 托管交叉编码器进行重新排名
  • CKA认证 | Day1 k8s核心概念与集群搭建
  • [极客大挑战 2019]PHP 1
  • 【c++丨STL】vector模拟实现
  • SQLAlchemy 介绍与实践
  • docker进行SRS直播服务器搭建
  • windows server2019下载docker拉取redis等镜像并运行项目
  • 数据结构(8.7_2)——败者树
  • 设计模式-七个基本原则之一-里氏替换原则
  • k8s中基于overlay网络和underlay网络的网络插件分别有哪些
  • 一文详解java的数据类型
  • Flink API 的层次结构
  • lua入门教程:math
  • ROS2简介与Ubuntu24.04中安装指南
  • 命令行工具PowerShell使用体验
  • MongoDB 详解:深入理解与探索
  • 使用 Elasticsearch 构建食谱搜索(一)
  • sealos部署K8s,安装docker时master节点突然NotReady
  • 使用vite+react+ts+Ant Design开发后台管理项目(五)
  • Spring Boot实现多数据源连接和切换
  • 发布 VectorTraits v3.0(支持 X86架构的Avx512系列指令集,支持 Wasm架构及PackedSimd指令集等)
  • 详解如何创建SpringBoot项目
  • IT架构管理
  • Feign入门实践
  • Leetcode 买卖股票的最佳时机 Ⅱ
  • 书生大模型实战营-玩转HF/魔搭社区闯关任务
  • 混响(Reverb):原理、应用与发展趋势的深度解析
  • Java学习教程,从入门到精通,Java修饰符语法知识点及案例代码(23)
  • 钉钉小程序使用getApp实现类型provide inject的功能 应用场景:解决页面同步子组件弹窗的滚动问题
  • 标准化 Git 提交信息的约定