You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[mono-api-tools] Make the tools work as libraries (#9793)
Right now, the set of mono-api-tools only works as console apps. This PR will make them work as normal dlls so they can be consumed by other apps and libraries. They will still work as .exes, so nothing visibly changes for existing users.
The motivation for this is for some build process or third party tool to take an assembly and generate an .xml doc from it. Since the writer is in-memory, the tool can then parse the .xml and do whatever it needs to. The same goes for the diff tools - if the diff happens in-memory, then the tool can process it without having to save and then load from the file system.
## Libraries
- [x] mono-api-info -> `Mono.ApiTools.ApiInfo`
- [x] mono-api-diff -> `Mono.ApiTools.ApiDiff`
- [x] mono-api-html -> `Mono.ApiTools.ApiDiffFormatted`
## Major changes
- the existing `Driver` classes are now just thin wrappers to parse the args and pass it on to the generators
- the "options" are now abstracted into config classes to avoid methods with numerous parameters
- the APIs have new support for reading assembly and info `Stream`s instead of just file paths
- added compiler flags to control the namespace and type visibility to make the library APIs nicer
- added compiler flag to remove the `Driver` class and `Mono.Options` dependencies
- the mono-api-info tool has some more options to allow it to run on libraries, and ignore dependencies that it cannot find - this makes it easier to use so that the entire dependency chain does not have to be loaded just to output the current assembly API
## Compiler defines
- `EXCLUDE_DRIVER` will remove the console entry point and remove the dependency of Mono.Options
- `USE_MONO_API_TOOLS_NAMESPACE` will switch the namespace to `Mono.ApiTools` so that libraries can have a nice API
- `USE_INTERNAL_VISIBILITY` will make any non-essential, `public` APIs turn `internal`
## Review points
- are there any variables/fields that are still static?
- are there any exposed types/members that need to be hidden?
- are the new names for the APIs and config classes OK?
- are my whitespaces according to the guidelines?
- did I go horribly wrong?
0 commit comments