Skip to content

Commit

Permalink
docs: update tools/README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
halildurmus committed Jul 27, 2024
1 parent d41a00b commit e6f2ea1
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions tools/README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,42 @@
This folder contains utilities to help with developing the win32 package.
# Tools

# Code-generation tools
This directory contains utilities to help with developing the `package:win32`.

The Win32 and COM APIs available in this package are generated from metadata
supplied by Microsoft. The metadata is in the form of an ECMA-335 specification
file, generated from this repo: <https://github.com/microsoft/win32metadata>
## Code-generation tools

The metadata is extracted and parsed using the separate winmd package:
<https://pub.dev/packages/winmd>
The Win32 and COM APIs available in this package are generated from
[win32metadata]. The metadata is in the form of an ECMA-335 specification
file, and extracted and parsed using the separate [winmd] package.

Not every API is projected.

- For Win32 APIs, the JSON files prefixed with `win32_` in the `generator\data`
directory are used to determine which APIs to project.
- For COM APIs, the `com_types.json` file in the `generator\data` directory
explicitly names the types that should be projected.
- For Win32 APIs, the JSON files prefixed with `win32_` in the
[packages\generator\data] directory are used to determine which APIs to
project.
- For COM APIs, the [com_types.json] file in the [packages\generator\data]
directory explicitly names the types that should be projected.

During the build process, you should call `generate.cmd` from the project root
to instantiate these types and generate the classes from them, for example:

```terminal
C:\src\win32> tools\generate.cmd
tools\generate.cmd
```

This tool will also test both the generation library and the generated output
with unit tests.

# Other utilities
## Other utilities

This folder also includes a few other small utilities of limited usefulness.

- `build.cmd`. Generates EXE files for some of the Dart samples.
- `struct_sizes\struct_sizes.cpp`. Measures the size of structs in
structs.g.dart on 64-bit architectures so the appropriate unit tests can be
generated.
[packages\win32\lib\src\structs.g.dart] on 64-bit architectures so the
appropriate unit tests can be generated.
- `build.cmd`. Generates EXE files for some of the Dart examples.

[com_types.json]: ../packages/generator/data/com_types.json
[packages\generator\data]: ../packages/generator/data
[packages\win32\lib\src\structs.g.dart]: ../packages/win32/lib/src/structs.g.dart
[win32metadata]: https://github.com/microsoft/win32metadata
[winmd]: https://pub.dev/packages/winmd

0 comments on commit e6f2ea1

Please sign in to comment.