You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
688 B

5 years ago
# Flutter工程条件编译打包脚本
## 原理
通过将 flutter run/build [--option] 命令替换为 bash flutter.sh run/build [--option] 在原有flutter运行/打包流程前后执行内置及用户自定义脚本,从而实现对打包流程的自定义控制,默认内置功能为根据命令参数中的
--debug/release 以及 --flavor 渠道名,对代码条件编译.
5 years ago
## 用法语法
5 years ago
### 代码:
5 years ago
代码中使用形如以下的注释来进行代码块的条件标记
5 years ago
```dart
void main(List<String> arguments) {
print(1);
// #{{exp}}
5 years ago
// print(2);
// #{{default}}
print(7);
// #{{end}}
5 years ago
}
```
基本注释标记语法为 **// #{{exp | default | end}}**