Skip to content

Commit 845faea

Browse files
committed
refactor: Provider 拍平到 d2x/buildtools(去掉冗余的 mcpp 目录层)
1 parent 9a74dbd commit 845faea

15 files changed

Lines changed: 27 additions & 27 deletions

File tree

.agents/docs/2026-07-23-exercises-as-tests-reference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
## 1. 布局(第二轮重排后:库入驻 d2x/、课程收进 src/)
1212

1313
```
14-
mcpp.toml workspace = [d2x, src/*, src/en/*, d2x/buildtools/mcpp]
14+
mcpp.toml workspace = [d2x, src/*, src/en/*, d2x/buildtools]
1515
d2x/ d2x 练习库(纯模块 `import d2x;`,零宏)
16-
d2x/buildtools/mcpp/ Provider(C++26)
16+
d2x/buildtools/ Provider(C++26)
1717
src/intro/tests/hello-mcpp.cpp
1818
src/cpp11/tests/<NN-topic>/<K>.cpp 49 题
1919
src/cpp14/tests/00-generic-lambdas/{0,1}.cpp
@@ -79,7 +79,7 @@ Provider 只是把 mcpp 的 JSON 记录 × 侧信道合并成协议 verdict。
7979

8080
|| 结果 |
8181
|---|---|
82-
| e2e(`d2x/buildtools/mcpp/tests/e2e.sh all`| zh 52/52、en 52/52 答案全绿;pristine 双向 0-pass;Provider 冒烟 ✓ |
82+
| e2e(`d2x/buildtools/tests/e2e.sh all`| zh 52/52、en 52/52 答案全绿;pristine 双向 0-pass;Provider 冒烟 ✓ |
8383
| d2x 端到端 | checker 显示 0/52 → 改对自动推进 → state.json 兼容旧 id ✓ |
8484
| d2x 仓库改动 | ****(协议边界承诺兑现) |
8585
| hello-mcpp | 答案已补,进入 e2e,不再 SKIP |

.agents/skills/d2mcpp-authoring/references/anatomy.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Features`).
4747
**Exercises are tests.** Each `<std>/` is a real mcpp project and exercises are
4848
its `tests/`; dropping `<std>/tests/NN-topic/K.cpp` into place is the whole job.
4949
`mcpp test -p src/<std>` runs them natively (the report is the progress table), and
50-
the d2x Provider (`d2x/buildtools/mcpp/`) derives the exercise id, order and
50+
the d2x Provider (`d2x/buildtools/`) derives the exercise id, order and
5151
chapter from the same path — one chain, no generated manifests, nothing under
5252
`.d2x/` but learner progress.
5353

@@ -81,7 +81,7 @@ change compile flags.
8181

8282
Drop the file at `solutions/<std>/NN-topic/K.cpp` (zh/en share one solution).
8383
CI swaps it over the exercise and asserts it passes; see
84-
`d2x/buildtools/mcpp/tests/e2e.sh`.
84+
`d2x/buildtools/tests/e2e.sh`.
8585

8686
## SUMMARY registration
8787

@@ -114,10 +114,10 @@ Run from the project root; report real output, do not assert success blind:
114114
mcpp test -p src/<std> NN-topic
115115

116116
# check it through the Provider path (exactly what `d2x checker` consumes)
117-
mcpp run -q -p d2x/buildtools/mcpp -- check cppNN-NN-topic-0
117+
mcpp run -q -p d2x/buildtools -- check cppNN-NN-topic-0
118118

119119
# or validate every exercise + solution at once (zh + en)
120-
bash d2x/buildtools/mcpp/tests/e2e.sh all
120+
bash d2x/buildtools/tests/e2e.sh all
121121

122122
# drive the auto-checker against the exercise (expects the unsolved exercise to fail,
123123
# the solution to pass) — name omits the NN- prefix

.d2x.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"version": "0.1.1",
3-
"buildtools": "mcpp run -q -p d2x/buildtools/mcpp --",
3+
"buildtools": "mcpp run -q -p d2x/buildtools --",
44
"lang": "zh",
55
"llm": {
66
"api_key": "",

.github/workflows/dslings-ref-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ jobs:
6060
xlings install -y
6161
6262
- name: Build d2x Provider
63-
run: mcpp build -p d2x/buildtools/mcpp
63+
run: mcpp build -p d2x/buildtools
6464

6565
- name: Validate exercises and solutions (zh + en)
66-
run: bash d2x/buildtools/mcpp/tests/e2e.sh all
66+
run: bash d2x/buildtools/tests/e2e.sh all
6767

6868
- name: Verify exercises ↔ solutions filename parity
6969
run: |

book/en/src/base/chapter_1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ Edit the `lang` attribute in the project configuration file `.d2x.json`. `zh` co
163163
```bash
164164
{
165165
"version": "0.1.1",
166-
"buildtools": "mcpp run -q -p d2x/buildtools/mcpp --",
166+
"buildtools": "mcpp run -q -p d2x/buildtools --",
167167
"lang": "en",
168168
...
169169
}
@@ -177,7 +177,7 @@ If you prefer to use Neovim as your editor with LSP (clangd) support, you can co
177177

178178
```json
179179
{
180-
"buildtools": "mcpp run -q -p d2x/buildtools/mcpp --",
180+
"buildtools": "mcpp run -q -p d2x/buildtools --",
181181
"editor": "nvim",
182182
...
183183
}

book/src/base/chapter_1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ Homepage: https://github.com/openxlings/xlings
161161
```bash
162162
{
163163
"version": "0.1.1",
164-
"buildtools": "mcpp run -q -p d2x/buildtools/mcpp --",
164+
"buildtools": "mcpp run -q -p d2x/buildtools --",
165165
"lang": "en", < -- 修改这里
166166
...
167167
}
@@ -175,7 +175,7 @@ Homepage: https://github.com/openxlings/xlings
175175

176176
```json
177177
{
178-
"buildtools": "mcpp run -q -p d2x/buildtools/mcpp --",
178+
"buildtools": "mcpp run -q -p d2x/buildtools --",
179179
"editor": "nvim",
180180
...
181181
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "d2x-buildtools-mcpp"
2+
name = "d2x-buildtools"
33
version = "0.1.0"
44
description = "d2mcpp 的 d2x Provider:枚举练习、生成 mcpp 清单、构建/运行/判定"
55
license = "Apache-2.0"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// 走的是完全相同的链路,不存在平行路径。
1414
//
1515
// 用法(由 .d2x.json 的 buildtools 字段驱动,从仓库根执行,无需 cd):
16-
// mcpp run -q -p d2x/buildtools/mcpp -- check cpp11-00-auto-and-decltype-0
16+
// mcpp run -q -p d2x/buildtools -- check cpp11-00-auto-and-decltype-0
1717

1818
import std;
1919

0 commit comments

Comments
 (0)