2016-02-19 08:00:59 +00:00
#!/usr/bin/env bash
CI_DIR = " $( cd " $( dirname " ${ BASH_SOURCE [0] } " ) " && pwd ) "
2017-04-09 08:42:16 +00:00
# shellcheck source=/dev/null
2016-02-19 08:00:59 +00:00
source " ${ CI_DIR } /common.sh "
2017-09-11 08:32:39 +00:00
echo -e " \\n ${ ANSI_GREEN } make fetchthirdparty "
2016-02-19 08:00:59 +00:00
travis_retry make fetchthirdparty
2017-04-11 09:23:42 +00:00
" ${ CI_DIR } /helper_shellchecks.sh "
2017-09-11 08:32:39 +00:00
echo -e " \\n ${ ANSI_GREEN } Checking for unscaled sizes "
# stick `|| true` at the end to prevent Travis exit on failed command
unscaled_size_check = $( grep -nr --include= *.lua --exclude= koptoptions.lua --exclude-dir= base --exclude-dir= install --exclude-dir= keyboardlayouts --exclude-dir= *arm* "\\(padding\\|margin\\|bordersize\\|width\\|height\\|radius\\|linesize\\) = [0-9]\\{1,2\\}" | grep -v '= 0' | grep -v '= [0-9]/[0-9]' | grep -Ev '(default_option_height|default_option_padding)' | grep -v scaleBySize || true )
# Also check Geom objects; for legibility two regular expressions rather than
# one enormous indecipharable blob.
unscaled_size_check_geom = $( grep -E -nr --include= *.lua --exclude= gesturerange_spec.lua --exclude-dir= base --exclude-dir= *arm* 'Geom:new{.+ [wh] = [0-9]{1,4}' | grep -Ev '[wh] = 0' | grep -v '= [0-9]/[0-9]' | grep -v scaleBySize || true )
if [ " ${ unscaled_size_check } " ] || [ " ${ unscaled_size_check_geom } " ] ; then
2017-09-13 14:56:20 +00:00
echo -e " \\n ${ ANSI_RED } Warning: it looks like you might be using unscaled sizes.\\nIt is almost always preferable to defer to one of the predefined sizes in ui.size in the following files: "
2017-09-11 08:32:39 +00:00
echo " ${ unscaled_size_check } "
echo " ${ unscaled_size_check_geom } "
exit 1
fi
echo -e " \\n ${ ANSI_GREEN } Luacheck results "
2017-08-08 20:35:40 +00:00
luajit " $( which luacheck) " --no-color -q { reader,setupkoenv,datastorage} .lua frontend plugins spec
2017-04-11 09:23:42 +00:00
2017-09-11 08:32:39 +00:00
echo -e " \\n ${ ANSI_GREEN } make all "
2016-02-19 08:00:59 +00:00
make all
2017-09-11 08:32:39 +00:00
echo -e " \\n ${ ANSI_GREEN } make testfront "
2016-08-12 06:05:18 +00:00
make testfront