瀏覽代碼

build_all_examples -c -s, silent mftest

Scott Lahteine 3 年之前
父節點
當前提交
b2bc85f6f6
共有 3 個檔案被更改,包括 32 行新增12 行删除
  1. 28
    8
      buildroot/bin/build_all_examples
  2. 1
    1
      buildroot/bin/build_example
  3. 3
    3
      buildroot/bin/mftest

+ 28
- 8
buildroot/bin/build_all_examples 查看文件

@@ -30,24 +30,37 @@ echo "This script downloads all Configurations and builds Marlin with each one."
30 30
 echo "On failure the last-built configs will be left in your working copy."
31 31
 echo "Restore your configs with 'git checkout -f' or 'git reset --hard HEAD'."
32 32
 
33
+unset BRANCH
34
+unset FIRST_CONF
35
+if [[ -f "$STAT_FILE" ]]; then
36
+  IFS='*' read BRANCH FIRST_CONF <"$STAT_FILE"
37
+fi
38
+
33 39
 # If -c is given start from the last attempted build
34 40
 if [[ $1 == '-c' ]]; then
35
-  if [[ -f "$STAT_FILE" ]]; then
36
-    read BRANCH FIRST_CONF <"$STAT_FILE"
37
-  else
41
+  if [[ -z $BRANCH || -z $FIRST_CONF ]]; then
38 42
     echo "Nothing to continue"
39 43
     exit
40 44
   fi
45
+elif [[ $1 == '-s' ]]; then
46
+  if [[ -n $BRANCH && -n $FIRST_CONF ]]; then
47
+    SKIP_CONF=1
48
+  else
49
+    echo "Nothing to skip"
50
+    exit
51
+  fi
41 52
 else
42 53
   BRANCH=${1:-"import-2.0.x"}
43 54
   FIRST_CONF=$2
44 55
 fi
45 56
 
46 57
 # Check if the current repository has unmerged changes
47
-if [[ -z "$FIRST_CONF" ]]; then
48
-  git diff --quiet || { echo "The working copy is modified. Commit or stash changes before proceeding."; exit ; }
49
-else
58
+if [[ $SKIP_CONF ]]; then
59
+  echo "Skipping $FIRST_CONF"
60
+elif [[ $FIRST_CONF ]]; then
50 61
   echo "Resuming from $FIRST_CONF"
62
+else
63
+  git diff --quiet || { echo "The working copy is modified. Commit or stash changes before proceeding."; exit ; }
51 64
 fi
52 65
 
53 66
 # Create a temporary folder inside .pio
@@ -67,12 +80,19 @@ shopt -s nullglob
67 80
 IFS='
68 81
 '
69 82
 CONF_TREE=$( ls -d "$TMP"/config/examples/*/ "$TMP"/config/examples/*/*/ "$TMP"/config/examples/*/*/*/ "$TMP"/config/examples/*/*/*/*/ | grep -vE ".+\.(\w+)$" )
83
+DOSKIP=0
70 84
 for CONF in $CONF_TREE ; do
85
+  # Get a config's directory name
71 86
   DIR=$( echo $CONF | sed "s|$TMP/config/examples/||" )
72
-  [[ ! -z $FIRST_CONF ]] && [[ $FIRST_CONF != $DIR && "$FIRST_CONF/" != $DIR ]] && continue
87
+  # If looking for a config, skip others
88
+  [[ $FIRST_CONF ]] && [[ $FIRST_CONF != $DIR && "$FIRST_CONF/" != $DIR ]] && continue
89
+  # Once found, stop looking
73 90
   unset FIRST_CONF
91
+  # If skipping, don't build the found one
92
+  [[ $SKIP_CONF ]] && { unset SKIP_CONF ; continue ; }
93
+  # ...if skipping, don't build this one
74 94
   compgen -G "${CONF}Con*.h" > /dev/null || continue
75
-  echo -e "$BRANCH\n$DIR" >"$STAT_FILE"
95
+  echo "${BRANCH}*${DIR}" >"$STAT_FILE"
76 96
   "$HERE/build_example" "internal" "$TMP" "$DIR" || { echo "Failed to build $DIR"; exit ; }
77 97
 done
78 98
 

+ 1
- 1
buildroot/bin/build_example 查看文件

@@ -24,6 +24,6 @@ cp "$SUB"/_Statusscreen.h     Marlin/ 2>/dev/null
24 24
 
25 25
 echo "Building the firmware now..."
26 26
 HERE=`dirname "$0"`
27
-$HERE/mftest -a || { echo "Failed"; exit 1; }
27
+$HERE/mftest -a -n1 || { echo "Failed"; exit 1; }
28 28
 
29 29
 echo "Success"

+ 3
- 3
buildroot/bin/mftest 查看文件

@@ -105,7 +105,7 @@ if ((REBUILD)); then
105 105
   # Build with the last-built env
106 106
   [[ -f "$STATE_FILE" ]] || { errout "No previous (-r) build state found." ; exit 1 ; }
107 107
   read TESTENV <"$STATE_FILE"
108
-  pio run -d . -e $TESTENV
108
+  pio run -s -d . -e $TESTENV
109 109
   exit
110 110
 fi
111 111
 
@@ -192,7 +192,7 @@ if ((AUTO_BUILD)); then
192 192
     pio run -t upload -e $TARGET
193 193
   else
194 194
     echo "Building environment $TARGET for board $MB ($BNUM)..." ; echo
195
-    pio run -e $TARGET
195
+    pio run -s -e $TARGET
196 196
   fi
197 197
   exit
198 198
 fi
@@ -307,6 +307,6 @@ fi
307 307
 
308 308
 [[ $BUILD_YES == 'Y' || $BUILD_YES == 'Yes' ]] && {
309 309
   ((USE_MAKE)) && make tests-single-local TEST_TARGET=$TESTENV ONLY_TEST=$CHOICE
310
-  ((USE_MAKE)) || pio run -d . -e $TESTENV
310
+  ((USE_MAKE)) || pio run -s -d . -e $TESTENV
311 311
   echo "$TESTENV" >"$STATE_FILE"
312 312
 }

Loading…
取消
儲存