|
9 | 9 |
|
10 | 10 | - **Framework**: 在目录 `src/framework/` 中,包含了核心实现,支持 recipe |
11 | 11 |
|
12 | | - - `chef.c` 里实现了 chef DSL,你可以使用它来确定正确的使用方法 |
13 | 12 | - `struct.h` 里定义了各种数据结构和宏,这是整个 chsrc 的核心,也是 chef DSL 的核心 |
| 13 | + - `chef.c` 里实现了 chef DSL,你可以使用它来确定正确的使用方法 |
14 | 14 |
|
15 | 15 | - **Recipes**: 在目录 `src/recipe/` 中,包含了针对不同目标的具体实现 |
16 | 16 |
|
17 | | - - `lang/` - 编程语言的包管理器 (Python pip, Node.js npm, 等等) |
18 | | - - `os/` - 操作系统的包管理器 (Ubuntu apt, Arch pacman, 等等) |
19 | | - - `ware/` - 软件工具和应用 (Docker, Homebrew, 等等) |
20 | | - |
21 | | - |
22 | | -## 项目当前状态: chef DSL 迁移 |
23 | | - |
24 | | -项目正在进行现代化改造,从旧模式迁移到新的 "chef DSL" 模式。 |
25 | | - |
26 | | -### Recipe 新模式 |
27 | | - |
28 | | -请阅读 `src/recipe/recipe-template.c`, 每一个 recipe 都应该遵循这个模板。每一个文件都应该定义 prelude,在这个函数里 |
29 | | - |
30 | | -`chef.c` 里实现了 chef DSL,你可以使用它来确定正确的使用方法。 |
31 | | - |
32 | | -1. 填充维护者信息 |
33 | | -2. recipe 元数据 |
34 | | -3. recipe 支持的 feature |
35 | | -4. 初始化源信息 (包括 upstream) |
36 | | - |
| 17 | + - `lang/` - 编程语言 (Ruby, JavaScript 等等) |
| 18 | + - `os/` - 操作系统 (Ubuntu, Arch Linux 等等) |
| 19 | + - `ware/` - 软件工具和应用 (Docker, Homebrew 等等) |
37 | 20 |
|
38 | | -### Recipe 旧模式 (To Be Removed): |
39 | | - |
40 | | -- 文件头的注释信息 |
41 | | -- `static Source_t target_sources[]` 数组 |
42 | | -- `def_sources_n(target)` 宏 |
43 | | -- `Feature_t target_feat()` 函数 |
44 | | -- `def_target_gsf()` 宏 |
45 | 21 |
|
46 | 22 | ## Coding Guidelines |
47 | 23 |
|
48 | | -### When Modernizing Files: |
49 | | - |
50 | | -1. **保持重要的技术注释** - 如对 URLs 的注释,实现备注等等 |
51 | | - |
52 | | -2. **正确转换元数据**: |
53 | | - |
54 | | - - 提取旧头文件中的作者/贡献者信息 |
55 | | - - 保留创建日期和重要更新日期 |
56 | | - - 保留技术备注和警告 |
57 | | - - 请注意新的 Target_t 结构体 |
58 | | - |
59 | | -3. **使用 chef DSL**: |
60 | | - |
61 | | - - `def_target()` 在文件最开头 |
62 | | - - `prelude()` 函数包含所有元数据 |
63 | | - - `def_sources_begin/end` 用于源定义 |
64 | | - |
65 | | -4. **Remove completely**: |
66 | | - |
67 | | - - 旧的文件头部包含许可证/作者信息 |
68 | | - - `Feature_t` 函数删除 |
69 | | - - `static Source_t` 数组删除 |
70 | | - - 旧的宏调用在文件末尾删除 |
71 | | - |
72 | 24 | ### C Coding Style: |
73 | 25 |
|
74 | 26 | 请阅读 `doc/03-为什么拒绝使用代码格式化工具.md` |
75 | 27 |
|
76 | 28 | ### Important Project Concepts: |
77 | 29 |
|
78 | | -请阅读 `doc/10-Write-A-Recipe-Even-If-You-Dont-Know-C.md` |
| 30 | +请阅读 `doc/10-如何编写recipe.md` |
79 | 31 |
|
80 | 32 | ## Important: 一定要保持注释,因为它记录了重要的维护信息 |
0 commit comments