|
6 | 6 | [path_to_dml, header, outfile] = sys.argv[1:] |
7 | 7 | sys.path.append(path_to_dml) |
8 | 8 |
|
9 | | -from dml import breaking_changes as compat |
| 9 | +from dml import breaking_changes |
10 | 10 | from dml.env import api_versions, default_api_version |
11 | 11 |
|
12 | 12 | by_version = {} |
13 | | -for feature in compat.features.values(): |
14 | | - if (feature.last_api_version.str in api_versions() |
15 | | - # don't document features that are unconditionally disabled in |
| 13 | +for bc in breaking_changes.changes.values(): |
| 14 | + if (bc.required_after.str in api_versions() |
| 15 | + # don't document breaking changes that are unconditionally disabled in |
16 | 16 | # this Simics version |
17 | | - or feature.last_api_version > compat.apis[default_api_version()]): |
18 | | - by_version.setdefault(feature.last_api_version, []).append(feature) |
| 17 | + or bc.required_after > breaking_changes.apis[default_api_version()]): |
| 18 | + by_version.setdefault(bc.required_after, []).append(bc) |
19 | 19 |
|
20 | 20 | with open(outfile, 'w') as f: |
21 | 21 | f.write(Path(header).read_text()) |
22 | | - for (ver, features) in sorted(by_version.items()): |
| 22 | + for (ver, bcs) in sorted(by_version.items()): |
23 | 23 | f.write(fr""" |
24 | | -### Features available up to and including -\-simics-api={ver.str} |
25 | | -These features correspond to functionality removed when compiling using |
| 24 | +### Changes for migrating from -\-simics-api={ver.str} |
| 25 | +These changes are enabled automatically when compiling using |
26 | 26 | Simics API {ver.ordinal + 1} or newer. With older Simics API versions, these |
27 | | -features can be disabled individually by passing <tt>-\-no-compat=<em>TAG</em></tt> |
| 27 | +features can be disabled individually by passing |
| 28 | +<code>-\-breaking-change=<em>TAG</em></code> |
28 | 29 | to the `dmlc` compiler. |
29 | 30 | """) |
30 | 31 | f.write("<dl>\n") |
31 | | - for feature in sorted(features, key=lambda f: f.tag()): |
32 | | - assert feature.__doc__ |
33 | | - f.write(f" <dt>{feature.tag()}</dt>\n") |
| 32 | + for bc in sorted(bcs, key=lambda f: f.tag()): |
| 33 | + assert bc.__doc__ |
| 34 | + f.write(f" <dt>{bc.tag()}</dt>\n") |
34 | 35 | doc = '\n'.join(line[4:] if line.startswith(' ') else line |
35 | | - for line in feature.__doc__.strip().splitlines()) |
| 36 | + for line in bc.__doc__.strip().splitlines()) |
36 | 37 | f.write(f" <dd>\n\n{doc}\n</dd>\n") |
37 | 38 | f.write("</dl>\n") |
0 commit comments