Skip to content

Commit

Permalink
fix: 修正user app config 模版里面的两个默认值
Browse files Browse the repository at this point in the history
降低对用户的误导(本来大部分就是false)

Signed-off-by: longjin <[email protected]>
  • Loading branch information
fslongjin committed Nov 16, 2024
1 parent f60cc4e commit edc0d82
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
9 changes: 4 additions & 5 deletions dadk-config/templates/config/userapp_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ version = "0.2.0"
# 用户程序描述信息
description = ""

# (可选)是否只构建一次,如果为true,DADK会在构建成功后,将构建结果缓存起来,下次构建时,直接使用缓存的构建结果
build-once = true
# (可选)默认: false 是否只构建一次,如果为true,DADK会在构建成功后,将构建结果缓存起来,下次构建时,直接使用缓存的构建结果
build-once = false

# (可选) 是否只安装一次,如果为true,DADK会在安装成功后,不再重复安装

install-once = true
# (可选) 默认: false 是否只安装一次,如果为true,DADK会在安装成功后,不再重复安装
install-once = false

# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
Expand Down
4 changes: 2 additions & 2 deletions dadk-config/tests/test_user_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ fn test_parse_dadk_user_config(ctx: &mut DadkConfigTestContext) {
name: "userapp_config".to_string(),
version: "0.2.0".to_string(),
description: "".to_string(),
build_once: true,
install_once: true,
build_once: false,
install_once: false,
task_source: TaskSource {
source_type: TaskSourceType::BuildFromSource,
source: Source::Git,
Expand Down
7 changes: 5 additions & 2 deletions dadk-user/src/executor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ impl Executor {
fn build(&mut self) -> Result<(), ExecutorError> {
if let Some(status) = self.task_log().build_status() {
if let Some(build_time) = self.task_log().build_time() {
let mut last_modified = last_modified_time(&self.entity.file_path(), build_time)?;
let mut last_modified = last_modified_time(&self.entity.file_path(), build_time)?;

Check warning on line 179 in dadk-user/src/executor/mod.rs

View check run for this annotation

Codecov / codecov/patch

dadk-user/src/executor/mod.rs#L179

Added line #L179 was not covered by tests
last_modified = core::cmp::max(
last_modified,
last_modified_time(&self.src_work_dir(), build_time)?,
Expand Down Expand Up @@ -238,7 +238,10 @@ impl Executor {
}
}
}
log::trace!("dadk-user: to do install {}", self.entity.task().name_version());
log::trace!(
"dadk-user: to do install {}",
self.entity.task().name_version()

Check warning on line 243 in dadk-user/src/executor/mod.rs

View check run for this annotation

Codecov / codecov/patch

dadk-user/src/executor/mod.rs#L241-L243

Added lines #L241 - L243 were not covered by tests
);
return self.do_install();
}

Expand Down
1 change: 0 additions & 1 deletion dadk-user/src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ impl Parser {
// 从toml文件中解析出DADKTask
let mut task: DADKTask = Self::parse_toml_file(config_file)?;


// 去除字符串中的空白字符
task.trim();

Expand Down

0 comments on commit edc0d82

Please sign in to comment.