]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
add an option to clean build after compilation. See http://is149532.intra.cea.fr...
authorSRE <support-salome@cea.fr>
Fri, 7 Apr 2017 14:22:16 +0000 (16:22 +0200)
committerSRE <support-salome@cea.fr>
Fri, 7 Apr 2017 14:22:16 +0000 (16:22 +0200)
commands/compile.py
complete_sat.sh

index c7d0f2d9de38ef8d1e9120517ae69caf8533fe1b..e4a6449ea6f4645a1317841b7f18cca146af28de 100644 (file)
@@ -54,6 +54,9 @@ parser.add_option('', 'stop_first_fail', 'boolean', 'stop_first_fail', _(
 parser.add_option('', 'check', 'boolean', 'check', _(
                   "Optional: execute the unit tests after compilation"), False)
 
+parser.add_option('', 'clean_build_after', 'boolean', 'clean_build_after', 
+                  _('Optional: remove the build directory after successful compilation'), False)
+
 def get_products_list(options, cfg, logger):
     '''method that gives the product list with their informations from 
        configuration regarding the passed options.
@@ -377,7 +380,17 @@ def compile_all_products(sat, config, options, products_infos, logger):
                           batch=True,
                           verbose=0,
                           logger_add_link = logger)
-            
+        else:
+            # Clean the build directory if the compilation and tests succeed
+            if options.clean_build_after:
+                log_step(logger, header, "CLEAN BUILD")
+                sat.clean(config.VARS.application + 
+                          " --products " + p_name + 
+                          " --build",
+                          batch=True,
+                          verbose=0,
+                          logger_add_link = logger)
+
         # Log the result
         if res_prod > 0:
             logger.write("\r%s%s" % (header, " " * len_end_line), 3)
@@ -687,4 +700,4 @@ def run(args, runner, logger):
     code = res
     if code != 0:
         code = 1
-    return code
\ No newline at end of file
+    return code
index 29ae207c7a1cc235e8faf52eb58c94c0f57634e1..c21748b80435024dc2f81128ef2d6639ac831182 100755 (executable)
@@ -204,7 +204,7 @@ _salomeTools_complete()
             return 0
             ;;
         compile)
-            opts="--products --with_fathers --with_children --clean_all --make_flags --show --stop_first_fail --check"
+            opts="--products --with_fathers --with_children --clean_all --make_flags --show --stop_first_fail --check --clean_build_after"
             COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
             return 0
             ;;