This repository was archived by the owner on Feb 22, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -7,21 +7,26 @@ echo '==========='
7
7
echo ' == BUILD =='
8
8
echo ' ==========='
9
9
10
- SIZE_TOO_BIG_COUNT =0
10
+ SIZE_UNEXPECTED_COUNT =0
11
11
12
12
export SAUCE_ACCESS_KEY=` echo $SAUCE_ACCESS_KEY | rev`
13
13
14
14
function checkSize() {
15
15
file=$1
16
16
if [[ ! -e $file ]]; then
17
17
echo Could not find file: $file
18
- SIZE_TOO_BIG_COUNT =$(( SIZE_TOO_BIG_COUNT + 1 )) ;
18
+ SIZE_UNEXPECTED_COUNT =$(( SIZE_UNEXPECTED_COUNT + 1 )) ;
19
19
else
20
20
expected=$2
21
21
actual=` cat $file | gzip | wc -c`
22
22
if (( 100 * $actual >= 105 * $expected )) ; then
23
23
echo ${file} is too large expecting ${expected} was ${actual} .
24
- SIZE_TOO_BIG_COUNT=$(( SIZE_TOO_BIG_COUNT + 1 )) ;
24
+ SIZE_UNEXPECTED_COUNT=$(( SIZE_UNEXPECTED_COUNT + 1 )) ;
25
+ fi
26
+ if (( 100 * $actual <= 95 * $expected )) ; then
27
+ echo ${file} is too small expecting ${expected} was ${actual} .
28
+ echo Please update scripts/travis/build.sh with the correct value.
29
+ SIZE_UNEXPECTED_COUNT=$(( SIZE_UNEXPECTED_COUNT + 1 )) ;
25
30
fi
26
31
fi
27
32
}
@@ -35,7 +40,7 @@ function checkAllSizes() {(
35
40
checkSize build/web/bouncing_balls.dart.js 223927
36
41
checkSize build/web/hello_world.dart.js 221838
37
42
checkSize build/web/todo.dart.js 224414
38
- if (( SIZE_TOO_BIG_COUNT > 0 )) ; then
43
+ if (( SIZE_UNEXPECTED_COUNT > 0 )) ; then
39
44
exit 1
40
45
else
41
46
echo Generated JavaScript file size check OK.
You can’t perform that action at this time.
0 commit comments