Browse Source

Build system: Remove cloc release statistics

Daniel Rudolf 7 years ago
parent
commit
1afc495584
2 changed files with 16 additions and 31 deletions
  1. 2 4
      _build/deploy-release.sh
  2. 14 27
      _build/tools/update-cloc-stats.sh

+ 2 - 4
_build/deploy-release.sh

@@ -106,14 +106,12 @@ if [ "$VERSION_STABILITY" != "stable" ]; then
 
     # update cloc statistics
     if [ "$DEPLOY_CLOC_STATS" == "true" ]; then
-        update-cloc-stats.sh \
-            "$DEPLOYMENT_DIR/_data/clocCore.yml" \
-            "$DEPLOYMENT_DIR/_data/clocRelease.yml"
+        update-cloc-stats.sh "$DEPLOYMENT_DIR/_data/cloc.yml"
 
         # commit cloc statistics
         github-commit.sh \
             "Update cloc statistics for $TRAVIS_TAG" \
-            "$DEPLOYMENT_DIR/_data/clocCore.yml" "$DEPLOYMENT_DIR/_data/clocRelease.yml"
+            "$DEPLOYMENT_DIR/_data/cloc.yml"
     fi
 fi
 

+ 14 - 27
_build/tools/update-cloc-stats.sh

@@ -11,13 +11,11 @@
 set -e
 
 # parameters
-CORE_TARGET_FILE="$1"     # target file path for core statistics
-RELEASE_TARGET_FILE="$2"  # target file path for release package statistics
+TARGET_FILE="$1"     # statistics target file path
 
 # print parameters
 echo "Updating cloc statistics..."
-printf 'CORE_TARGET_FILE="%s"\n' "$CORE_TARGET_FILE"
-printf 'RELEASE_TARGET_FILE="%s"\n' "$RELEASE_TARGET_FILE"
+printf 'TARGET_FILE="%s"\n' "$TARGET_FILE"
 echo
 
 # create cloc statistics
@@ -70,35 +68,24 @@ clean_cloc_stats() {
     done < <(tail -n +3 "$1")
 }
 
-# create temporary files
-printf 'Creating temporary files...\n'
-CORE_TMP_FILE="$(mktemp)"
-RELEASE_TMP_FILE="$(mktemp)"
-[ -n "$CORE_TMP_FILE" ] && [ -n "$RELEASE_TMP_FILE" ] || exit 1
+# create temporary file
+printf 'Creating temporary file...\n'
+TMP_FILE="$(mktemp)"
+[ -n "$TMP_FILE" ] || exit 1
 echo
 
-# create core statistics
-printf 'Creating core statistics...\n'
-create_cloc_stats "$CORE_TMP_FILE" \
+# create statistics
+printf 'Creating statistics...\n'
+create_cloc_stats "$TMP_FILE" \
     lib index.php
 echo
 
-printf 'Creating release package statistics...\n'
-create_cloc_stats "$RELEASE_TMP_FILE" \
-    README.md LICENSE.md CONTRIBUTING.md CHANGELOG.md \
-    assets config content content-sample lib plugins themes \
-    .htaccess index.php.dist composer.json
-echo
-
 # remove headers from cloc statistics
-printf 'Writing core statistics file without header...\n'
-clean_cloc_stats "$CORE_TMP_FILE" > "$CORE_TARGET_FILE"
-
-printf 'Writing release package statistics file without header...\n'
-clean_cloc_stats "$RELEASE_TMP_FILE" > "$RELEASE_TARGET_FILE"
+printf 'Writing statistics file without header...\n'
+clean_cloc_stats "$TMP_FILE" > "$TARGET_FILE"
 echo
 
-# remove temporary files
-printf 'Removing temporary files...\n'
-rm "$CORE_TMP_FILE" "$RELEASE_TMP_FILE"
+# remove temporary file
+printf 'Removing temporary file...\n'
+rm "$TMP_FILE"
 echo