#run-command #run #command #build

构建 compile-time-run

在编译时运行命令并捕获输出

13 个版本

0.2.12 2021 年 7 月 7 日
0.2.11 2020 年 7 月 16 日
0.2.8 2019 年 10 月 17 日
0.2.6 2019 年 4 月 15 日
0.1.0 2019 年 3 月 24 日

#602构建工具

Download history 4186/week @ 2024-01-05 3713/week @ 2024-01-12 3983/week @ 2024-01-19 4153/week @ 2024-01-26 3985/week @ 2024-02-02 4664/week @ 2024-02-09 3770/week @ 2024-02-16 4270/week @ 2024-02-23 4602/week @ 2024-03-01 2937/week @ 2024-03-08 2962/week @ 2024-03-15 2989/week @ 2024-03-22 3632/week @ 2024-03-29 3681/week @ 2024-04-05 3046/week @ 2024-04-12 1857/week @ 2024-04-19

12,901 每月下载量
2 crates 中使用

BSD-2-Clause

11KB
92

Documentation crates.io Build Status

compile-time-run

这个 crate 包含在编译时在主机系统上运行命令的宏。在某些情况下,它可以用来替代需要通过构建脚本完成的某些功能。

示例

use compile_time_run::{run_command, run_command_str};
const VALUE_STR   : &'static str  = run_command_str!("echo", "Hello World!");
const VALUE_BYTES : &'static [u8] = run_command!("echo", "Hello World!");

请注意,在构建阶段运行任意命令可能会严重影响可移植性。


lib.rs:

这个 crate 包含在编译时在主机系统上运行命令的宏。在某些情况下,它可以用来替代需要通过构建脚本完成的某些功能。

示例

use compile_time_run::{run_command, run_command_str};
const VALUE_STR   : &'static str  = run_command_str!("echo", "Hello World!");
const VALUE_BYTES : &'static [u8] = run_command!("echo", "Hello World!");

请注意,在构建阶段运行任意命令可能会严重影响可移植性。

依赖项

~1.5MB
~34K SLoC