Build system: Remove cloc release statistics

pico-3.0-alpha
Daniel Rudolf 8 years ago
parent da0d4c3054
commit 1afc495584
No known key found for this signature in database
GPG Key ID: A061F02CD8DE4538
  1. 6
      _build/deploy-release.sh
  2. 41
      _build/tools/update-cloc-stats.sh

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

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

Loading…
Cancel
Save