feat(tests): Write Closure Compiler output directly to dist/

Since they are already UMD-wrapped, have Closure Compiler write
output chunks directly to RELEASE_DIR, i.e. dist/.
This commit is contained in:
Christopher Allen
2022-10-03 17:29:30 +01:00
parent 16c71659f6
commit 4d150ff8d7
4 changed files with 27 additions and 38 deletions

View File

@@ -10,7 +10,7 @@
#
# (TODO(#5007): Should fetch this from scripts/gulpfiles/config.js
# instead of hardcoding it here.
readonly BUILD_DIR='build'
readonly RELEASE_DIR='dist'
# These values should be updated with each release. (Note that the
# historic values are tab-delimited.)
@@ -101,8 +101,8 @@ trap fail ERR
# GZip them for additional size comparisons (keep originals, force
# overwite previously-gzipped copies).
echo "Zipping the compressed files"
gzip -kf "${BUILD_DIR}/blockly_compressed.js"
gzip -kf "${BUILD_DIR}/blocks_compressed.js"
gzip -kf "${RELEASE_DIR}/blockly_compressed.js"
gzip -kf "${RELEASE_DIR}/blocks_compressed.js"
# Check the sizes of the files
@@ -126,9 +126,9 @@ compare_size() {
fi
}
compare_size "${BUILD_DIR}/blockly_compressed.js" $BLOCKLY_SIZE_EXPECTED
compare_size "${BUILD_DIR}/blocks_compressed.js" $BLOCKS_SIZE_EXPECTED
compare_size "${BUILD_DIR}/blockly_compressed.js.gz" $BLOCKLY_GZ_SIZE_EXPECTED
compare_size "${BUILD_DIR}/blocks_compressed.js.gz" $BLOCKS_GZ_SIZE_EXPECTED
compare_size "${RELEASE_DIR}/blockly_compressed.js" $BLOCKLY_SIZE_EXPECTED
compare_size "${RELEASE_DIR}/blocks_compressed.js" $BLOCKS_SIZE_EXPECTED
compare_size "${RELEASE_DIR}/blockly_compressed.js.gz" $BLOCKLY_GZ_SIZE_EXPECTED
compare_size "${RELEASE_DIR}/blocks_compressed.js.gz" $BLOCKS_GZ_SIZE_EXPECTED
exit $has_failed

View File

@@ -7,15 +7,15 @@
#
# (TODO(#5007): Should fetch this from scripts/gulpfiles/config.js
# instead of hardcoding it here.
readonly BUILD_DIR='build'
readonly RELEASE_DIR='dist'
gzip -k "${BUILD_DIR}/blockly_compressed.js"
gzip -k "${BUILD_DIR}/blocks_compressed.js"
gzip -k "${RELEASE_DIR}/blockly_compressed.js"
gzip -k "${RELEASE_DIR}/blocks_compressed.js"
blockly_size=$(wc -c < "${BUILD_DIR}/blockly_compressed.js")
blocks_size=$(wc -c < "${BUILD_DIR}/blocks_compressed.js")
blockly_gz_size=$(wc -c < "${BUILD_DIR}/blockly_compressed.js.gz")
blocks_gz_size=$(wc -c < "${BUILD_DIR}/blocks_compressed.js.gz")
blockly_size=$(wc -c < "${RELEASE_DIR}/blockly_compressed.js")
blocks_size=$(wc -c < "${RELEASE_DIR}/blocks_compressed.js")
blockly_gz_size=$(wc -c < "${RELEASE_DIR}/blockly_compressed.js.gz")
blocks_gz_size=$(wc -c < "${RELEASE_DIR}/blocks_compressed.js.gz")
quarters=(1 1 1 2 2 2 3 3 3 4 4 4)
month=$(date +%-m)
quarter=$(echo Q${quarters[$month - 1]} $(date +%Y))