|
@ -21,6 +21,8 @@ stat_bytes() { |
|
|
destination=../firmware |
|
|
destination=../firmware |
|
|
version_file=espurna/config/version.h |
|
|
version_file=espurna/config/version.h |
|
|
version=$(grep -E '^#define APP_VERSION' $version_file | awk '{print $3}' | sed 's/"//g') |
|
|
version=$(grep -E '^#define APP_VERSION' $version_file | awk '{print $3}' | sed 's/"//g') |
|
|
|
|
|
script_build_environments=true |
|
|
|
|
|
script_build_webui=true |
|
|
|
|
|
|
|
|
if ${TRAVIS:-false}; then |
|
|
if ${TRAVIS:-false}; then |
|
|
git_revision=${TRAVIS_COMMIT::7} |
|
|
git_revision=${TRAVIS_COMMIT::7} |
|
@ -133,8 +135,36 @@ build_environments() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
# Parameters |
|
|
# Parameters |
|
|
while getopts "lpd:" opt; do |
|
|
|
|
|
|
|
|
print_getopts_help() { |
|
|
|
|
|
cat <<EOF |
|
|
|
|
|
Usage: $(basename "$0") [OPTION] <ENVIRONMENT>... |
|
|
|
|
|
|
|
|
|
|
|
Where ENVIRONMENT is environment name(s) from platformio.ini |
|
|
|
|
|
|
|
|
|
|
|
Options: |
|
|
|
|
|
|
|
|
|
|
|
-f VALUE Filter build stage by name to skip it |
|
|
|
|
|
Supported VALUEs are "environments" and "webui" |
|
|
|
|
|
Can be specified multiple times |
|
|
|
|
|
-l Print available environments |
|
|
|
|
|
-d VALUE Destination to move .bin files after building environments |
|
|
|
|
|
-p Enable parallel build |
|
|
|
|
|
Depends on following exported variables: |
|
|
|
|
|
BUILDER_THREAD=<number> (default 0...4) |
|
|
|
|
|
BUILDER_TOTAL_THREADS=<number> (default 4) |
|
|
|
|
|
When building platformio environments, will only pick every <BUILDER_THREAD>th |
|
|
|
|
|
-h Display this message |
|
|
|
|
|
EOF |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
while getopts "f:lpd:h" opt; do |
|
|
case $opt in |
|
|
case $opt in |
|
|
|
|
|
f) |
|
|
|
|
|
case "$OPTARG" in |
|
|
|
|
|
webui) script_build_webui=false ;; |
|
|
|
|
|
environments) script_build_environments=false ;; |
|
|
|
|
|
esac |
|
|
|
|
|
;; |
|
|
l) |
|
|
l) |
|
|
print_available |
|
|
print_available |
|
|
exit |
|
|
exit |
|
@ -145,6 +175,9 @@ while getopts "lpd:" opt; do |
|
|
d) |
|
|
d) |
|
|
destination=$OPTARG |
|
|
destination=$OPTARG |
|
|
;; |
|
|
;; |
|
|
|
|
|
h) |
|
|
|
|
|
print_getopts_help |
|
|
|
|
|
exit |
|
|
esac |
|
|
esac |
|
|
done |
|
|
done |
|
|
|
|
|
|
|
@ -158,13 +191,18 @@ echo "Building for version ${version}" ${git_revision:+($git_revision)} |
|
|
# Environments to build |
|
|
# Environments to build |
|
|
environments=$@ |
|
|
environments=$@ |
|
|
|
|
|
|
|
|
if [ $# -eq 0 ]; then |
|
|
|
|
|
set_default_environments |
|
|
|
|
|
|
|
|
if $script_build_webui ; then |
|
|
|
|
|
build_webui |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
if ${CI:-false}; then |
|
|
|
|
|
print_environments |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
if $script_build_environments ; then |
|
|
|
|
|
if [ $# -eq 0 ]; then |
|
|
|
|
|
set_default_environments |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
if ${CI:-false}; then |
|
|
|
|
|
print_environments |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
build_webui |
|
|
|
|
|
build_environments |
|
|
|
|
|
|
|
|
build_environments |
|
|
|
|
|
fi |