Feat: 引入 @Mock 注解支持并重构 KSP 处理器结构#60
Merged
Merged
Conversation
- **新增 Mock 相关支持**:
- 引入 `@Mock` 注解与 `MockClient` 接口,用于配置模拟客户端。
- 实现 `MockProcessor`,自动生成 `MockRegistry` 以管理模拟客户端的映射与创建。
- 将 `NormalMockMiotDeviceClient` 重命名为 `DefaultMockMiotDeviceClient`。
- **重构 KSP 处理器架构**:
- 引入抽象基类 `MiwuProcessor`,统一管理 `isProcessingOver` 状态逻辑,简化子类实现。
- 更新 `DeviceProcessor`、`WidgetProcessor`、`WrapperProcessor` 等处理器继承自 `MiwuProcessor`。
- **规范包名与路径**:
- 将生成的代码包名从 `miwu.widget.generated.*` 统一迁移至 `miwu.support.generated.*`。
- **其他改进**:
- 在 `MockMiotDeviceClient` 中实现 `MockClient` 接口。
- 注册 `MockProcessorProvider` 到 KSP 服务发现列表。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@Mock注解与MockClient接口,用于配置模拟客户端。MockProcessor,自动生成MockRegistry以管理模拟客户端的映射与创建。NormalMockMiotDeviceClient重命名为DefaultMockMiotDeviceClient。MiwuProcessor,统一管理isProcessingOver状态逻辑,简化子类实现。DeviceProcessor、WidgetProcessor、WrapperProcessor等处理器继承自MiwuProcessor。miwu.widget.generated.*统一迁移至miwu.support.generated.*。MockMiotDeviceClient中实现MockClient接口。MockProcessorProvider到 KSP 服务发现列表。