Added notes about maintainability.
This commit is contained in:
Родитель
d80feccc5f
Коммит
d1c49de738
|
@ -58,6 +58,8 @@ You can test localized changes to a partition by running `./scripts/GenerateMeta
|
|||
|
||||
If a header file doesn't cleanly map to one namespace, it should be associated with a partition and namespace that makes sense for the majority of its APIs (using the steps above for a single namespace), and then the rest of the APIs should be manually remapped using [requiredNamespacesForNames.rsp](generation/emitter/requiredNamespacesForNames.rsp). This file contains one line per API and follows the format `<API>=<NAMESPACE>`. It is a single file that is shared across all partitions.
|
||||
|
||||
For maintainability, it is important to keep [requiredNamespacesForNames.rsp](generation/emitter/requiredNamespacesForNames.rsp) organized with APIs grouped by header files. APIs should be added within `#region <HEADER>` sections based on the header files where they are defined. APIs within a `#region` should be sorted alphabetically. You can select the APIs of a `#region` and use Visual Studio Code's `Sort Lines Ascending` command to sort them.
|
||||
|
||||
### Refactoring namespaces
|
||||
|
||||
Note that when refactoring namespaces, [requiredNamespacesForNames.rsp](generation/emitter/requiredNamespacesForNames.rsp) will take precedence over any namespaces declared in the partitions, so make sure it doesn't contain remappings that will conflict with the expected factoring from the partitions. For example, if you create a new Registry partition to assign everything in winreg.h to Windows.Win32.System.Registry, but [requiredNamespacesForNames.rsp](generation/emitter/requiredNamespacesForNames.rsp) was previously updated to map Reg* APIs to a different namespace, you won't achieve the desired result unless you remove the Reg* entries from [requiredNamespacesForNames.rsp](generation/emitter/requiredNamespacesForNames.rsp).
|
||||
|
|
Загрузка…
Ссылка в новой задаче