-
Notifications
You must be signed in to change notification settings - Fork 10.5k
swift-api-extract to generate JSON API information #35690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
swift-api-extract to generate JSON API information #35690
Conversation
@swift-ci Please smoke test |
7f952d7
to
6749518
Compare
ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM,
I know theres some functionality/API's being used that already exist in tapi
, do you see in the future us refactoring this out once tapi
is fully merged into llvm?
Regardless of the case, I'm wondering if theres value in documenting what details aren't currently applicable in a swift context, e.g. Project level APIAccess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
6749518
to
a94f18c
Compare
Rebase the change and run tests. @nkcsgexi @DougGregor is this good enough to merge? |
@swift-ci Please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Add a new swift-frontend driver option that extract APIs in the swift module and print in JSON format. This is to allow tooling to understand and process swift APIs without the need to be a swift compiler or understand swift module/AST.
a94f18c
to
02c4165
Compare
@swift-ci Please smoke test |
Hi, sorry for the late question but have you considered using the JSON output of I'd like to see if it's possible to converge on a single tool for producing JSON output of Swift module APIs, instead of maintaining multiple incompatible tools. |
Yes, we have considered that. Our original methods includes writing a tool that converts symbolgraph JSON to API JSON and we eventually decide to do it this way. Symbolgraph does missing some information to compute all the information we need but we also want to push a bit further with api-extract tool to detach that from swift AST so it can be language agnostics to add stuffs that is more than swift. In the future, we might converge those two because we are going to add more fields to API JSON to include all the information needed by documentation from symbolgraph. |
I found a crash when using the tool, filed it here: https://bugs.swift.org/browse/SR-14311?jql=text%20~%20%22swift-api-extract%22 |
Thanks for the report. I comment on the issue. |
Add a new swift-frontend driver option that extract APIs in the swift
module and print in JSON format. This is to allow tooling to understand
and process swift APIs without the need to be a swift compiler or
understand swift module/AST.
Create a swift driver option that based on TBDGen but provide more information about swift APIs in both swift/objc/etc. in JSON format. The output can be easily consumed by other tools and scripts to reason about APIs in the swift module.
rdar://69600000