Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
iblacksun committed Aug 11, 2019
1 parent 18a9e7d commit f27b194
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion Reports/2019/#79-2019.08.12.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,25 @@

## 工具

> 开发过程中常用的工具,及一些新工具的介绍
### [Swift API-Digester](https://github.com/apple/swift-nio/commit/07e7e01c76be20640ddc3770d7b16e87eedf20de)

[@享耳先森](https://github.com/iblacksun):Swift 5.1 里新增了一个 `api-digester` 功能,用来打印和比较编译产物的 API,Swift-NIO 在此基础上搭建了一个 API Diff 功能,可以预见未来开源框架都会使用这个功能来生成 API Diff,帮助检验 Pull Request 对于 API 的影响,ChangeLog 的生成等等。

用类似这样的命令:`swift api-digester -diagnose-sdk --input-paths "dir1" -input-paths "dir2"` 就能比较两个编译产物的 API 区别,生成类似下面的结果:

> Removed Decls
> Constructor WebSocketFrameDecoder.init(maxFrameSize:automaticErrorHandling:) has been removed
> EnumElement WebSocketOpcode.unknownControl has been removed
> EnumElement WebSocketOpcode.unknownNonControl has been removed

> Renamed Decls
> Func WebSocketFrameDecoder.decode(ctx:buffer:) has been renamed to Func WebSocketFrameDecoder.decode(context:buffer:)
> Func WebSocketFrameDecoder.decodeLast(ctx:buffer:) has been renamed to Func WebSocketFrameDecoder.decodeLast(context:buffer:seenEOF:)
> Func WebSocketFrameEncoder.write(ctx:data:promise:) has been renamed to Func WebSocketFrameEncoder.write(context:data:promise:)
> Func WebSocketProtocolErrorHandler.errorCaught(ctx:error:) has been renamed to Func WebSocketProtocolErrorHandler.errorCaught(context:error:)

> Type Changes
> Constructor UInt8.init(webSocketOpcode:) has return type change from UInt8? to UInt8

## 代码

Expand Down

0 comments on commit f27b194

Please sign in to comment.