Skip to content

Conversation

@starrin
Copy link

@starrin starrin commented Sep 15, 2025

TODO: test and docs

@starrin
Copy link
Author

starrin commented Sep 18, 2025

喷了,还没在linux环境跑过构建
周末改掉这块儿

@wangl-cc
Copy link
Member

wangl-cc commented Sep 18, 2025

可以把整个 extra 相关的东西全都放在 cfg(windows) 里面,毕竟短时间内其他平台大概率不会支持这个东西。

@starrin
Copy link
Author

starrin commented Sep 22, 2025

可以把整个 extra 相关的东西全都放在 cfg(windows) 里面,毕竟短时间内其他平台大概率不会支持这个东西。

目前其实就是这样干的,你的意思是希望把profile设置这部分也加上cfg(windows)吗?

use callback::summary;

mod external;
mod extra;
Copy link
Member

@wangl-cc wangl-cc Sep 22, 2025

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() {
Copy link
Member

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,
Copy link
Member

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()
}

这样更方便一点,而且之后如果要再加东西改起来也比较容易。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants