2
0
Эх сурвалжийг харах

fix: 修正user app config 模版里面的两个默认值 (#85)

LoGin 4 сар өмнө
parent
commit
afbf76c12f

+ 4 - 5
dadk-config/templates/config/userapp_config.toml

@@ -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"

+ 2 - 2
dadk-config/tests/test_user_config.rs

@@ -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,

+ 5 - 2
dadk-user/src/executor/mod.rs

@@ -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)?;
                 last_modified = core::cmp::max(
                     last_modified,
                     last_modified_time(&self.src_work_dir(), build_time)?,
@@ -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()
+        );
         return self.do_install();
     }
 

+ 0 - 1
dadk-user/src/parser/mod.rs

@@ -221,7 +221,6 @@ impl Parser {
         // 从toml文件中解析出DADKTask
         let mut task: DADKTask = Self::parse_toml_file(config_file)?;
 
-
         // 去除字符串中的空白字符
         task.trim();