mirror of
https://github.com/dexoron/dcr.git
synced 2026-10-21 16:59:42 +00:00
New translations workspaces.mdx (Russian)
[ci skip]
This commit is contained in:
@@ -1,67 +1,59 @@
|
|||||||
---
|
---
|
||||||
sidebar_label: Workspaces
|
sidebar_label: Рабочие пространства
|
||||||
---
|
---
|
||||||
|
|
||||||
# Workspaces
|
# Рабочие пространства
|
||||||
|
|
||||||
Workspaces allow managing multiple packages in a single repository.
|
Workspaces позволяют управлять несколькими пакетами в одном репозитории.
|
||||||
|
|
||||||
## Configuration
|
## Конфигурация
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[workspace.lib-core]
|
[workspace]
|
||||||
path = "lib-core"
|
members = [
|
||||||
|
{ path = "pkg-a" },
|
||||||
[workspace.lib-utils]
|
{ path = "pkg-b", deps = ["pkg-a"] },
|
||||||
path = "lib-utils"
|
{ path = "pkg-c", deps = ["pkg-a", "pkg-b"], main = true },
|
||||||
deps = ["lib-core"]
|
]
|
||||||
|
|
||||||
[workspace.app]
|
|
||||||
path = "app"
|
|
||||||
deps = ["lib-core", "lib-utils"]
|
|
||||||
main = true
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Member fields
|
### Поля member
|
||||||
|
|
||||||
| Field | Description |
|
| Поле | Описание |
|
||||||
| ------ | ------------------------------------------------ |
|
| ------ | -------------------------------------------- |
|
||||||
| `path` | Path to the package (relative to workspace root) |
|
| `path` | Путь к пакету (относительно корня workspace) |
|
||||||
| `deps` | Dependencies on other members |
|
| `deps` | Зависимости от других member-ов |
|
||||||
| `main` | Mark as the main package |
|
| `main` | Пометить как главный пакет |
|
||||||
|
|
||||||
## Topological sort
|
## Топологическая сортировка
|
||||||
|
|
||||||
DCR automatically sorts packages by dependencies: package A is built before B if B depends on A.
|
DCR автоматически сортирует пакеты по зависимостям: пакет A собирается раньше B, если B зависит от A.
|
||||||
|
|
||||||
Cyclic dependencies are detected and cause an error.
|
Циклические зависимости обнаруживаются и приводят к ошибке.
|
||||||
|
|
||||||
## Build
|
## Сборка
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
dcr build # build all packages in dependency order
|
dcr build # собрать все пакеты
|
||||||
dcr build --workspace app # build only app (dependencies built automatically)
|
dcr build --workspace pkg-a # собрать только pkg-a
|
||||||
```
|
```
|
||||||
|
|
||||||
When building a workspace, member outputs (libraries) are automatically added to include/lib paths of dependent packages.
|
При сборке workspace выходные файлы member-ов (библиотеки) автоматически добавляются в include/lib пути зависимых пакетов.
|
||||||
|
|
||||||
## Clean
|
## Очистка
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
dcr clean # clean only root target/
|
dcr clean # очистить только корневой target/
|
||||||
dcr clean --all # clean target/ of all packages
|
dcr clean --all # очистить target/ всех пакетов
|
||||||
```
|
```
|
||||||
|
|
||||||
## Inheritance
|
## Наследование
|
||||||
|
|
||||||
If a member has `inherit = true` in its `[build]` section, fields from the root `[build]` are merged into the member:
|
Если у member-а нет своей секции `[build]`, а в корневом `[build]` указано `inherit = true`:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
# root dcr.toml
|
|
||||||
[build]
|
[build]
|
||||||
inherit = true
|
inherit = true
|
||||||
language = "c"
|
language = "c"
|
||||||
standard = "c17"
|
standard = "c17"
|
||||||
|
|
||||||
# member inherits language and standard
|
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user