yetus-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [13/20] yetus git commit: YETUS-371. build driver: speed up checkstyle
Date Thu, 14 Apr 2016 07:25:08 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/9a543cff
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/9a543cff
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/9a543cff

Branch: refs/heads/YETUS-156
Commit: 9a543cff423cc4817e5612798291eaeb44010991
Parents: b7e4854
Author: Allen Wittenauer <aw@apache.org>
Authored: Tue Apr 12 08:53:04 2016 -0700
Committer: Allen Wittenauer <aw@apache.org>
Committed: Thu Apr 14 00:24:45 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/9a543cff/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