-
Notifications
You must be signed in to change notification settings - Fork 21
feat: support connection extra config #423
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
base: main
Are you sure you want to change the base?
Conversation
|
喷了,还没在linux环境跑过构建 |
|
可以把整个 extra 相关的东西全都放在 cfg(windows) 里面,毕竟短时间内其他平台大概率不会支持这个东西。 |
目前其实就是这样干的,你的意思是希望把profile设置这部分也加上cfg(windows)吗? |
| use callback::summary; | ||
|
|
||
| mod external; | ||
| mod extra; |
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.
可以直接在这里 cfg(windows),里面就不用每一个子模块都标注了。
| _ => None, | ||
| }; | ||
|
|
||
| match asst_config.connection.preset() { |
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.
这整个 match 都可以用 cfg(windows) 来括起来。不过我个人更喜欢是把这个 match 当成 preset 的一个方法,接受 connection 作为参数,尽量不要这个函数在这里包含太多逻辑。
| adb_path: Some(String::from("/path/to/adb")), | ||
| address: Some(String::from("127.0.0.1:5555")), | ||
| config: Some(String::from("SomeConfig")), | ||
| emulator_path: None, |
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.
其实可以改成
ConnectionConfig {
preset: Preset::Adb,
adb_path: Some(String::from("/path/to/adb")),
address: Some(String::from("127.0.0.1:5555")),
config: Some(String::from("SomeConfig")),
..Default::default()
}
这样更方便一点,而且之后如果要再加东西改起来也比较容易。
TODO: test and docs