yetus-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [18/23] yetus git commit: YETUS-371. build driver: speed up checkstyle
Date Sun, 17 Apr 2016 17:15:06 GMT
YETUS-371. build driver: speed up checkstyle

Signed-off-by: Allen Wittenauer <aw@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/1d628e0a
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/1d628e0a
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/1d628e0a

Branch: refs/heads/YETUS-156
Commit: 1d628e0a3d697cfb031297f1db9166049ce8b950
Parents: 24be6d3
Author: Allen Wittenauer <aw@apache.org>
Authored: Tue Apr 12 08:53:04 2016 -0700
Committer: Allen Wittenauer <aw@apache.org>
Committed: Sun Apr 17 10:14:34 2016 -0700

----------------------------------------------------------------------
 precommit/test-patch.d/checkstyle.sh | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/1d628e0a/precommit/test-patch.d/checkstyle.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.d/checkstyle.sh b/precommit/test-patch.d/checkstyle.sh
index bba3369..f0b3e57 100755
--- a/precommit/test-patch.d/checkstyle.sh
+++ b/precommit/test-patch.d/checkstyle.sh
@@ -341,12 +341,21 @@ function checkstyle_postapply
     module=${MODULE[$i]}
     fn=$(module_file_fragment "${module}")
 
-    # call calcdiffs to allow overrides
-    calcdiffs \
-      "${PATCH_DIR}/branch-checkstyle-${fn}.txt" \
-      "${PATCH_DIR}/patch-checkstyle-${fn}.txt" \
-      checkstyle \
-      > "${PATCH_DIR}/diff-checkstyle-${fn}.txt"
+    # if there is no comparison to be done,
+    # we can speed this up tremendously
+    if [[ "${BUILDMODE}" = full ]]; then
+      touch  "${PATCH_DIR}/branch-checkstyle-${fn}.txt"
+      cp -p "${PATCH_DIR}/patch-checkstyle-${fn}.txt" \
+        "${PATCH_DIR}/diff-checkstyle-${fn}.txt"
+    else
+
+      # call calcdiffs to allow overrides
+      calcdiffs \
+        "${PATCH_DIR}/branch-checkstyle-${fn}.txt" \
+        "${PATCH_DIR}/patch-checkstyle-${fn}.txt" \
+        checkstyle \
+        > "${PATCH_DIR}/diff-checkstyle-${fn}.txt"
+    fi
 
     #shellcheck disable=SC2016
     numbranch=$(wc -l "${PATCH_DIR}/branch-checkstyle-${fn}.txt" | ${AWK} '{print $1}')


Mime
View raw message