diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-12-26 20:33:00 +0100 |
---|---|---|
committer | Ubuntu <ubuntu@ip-172-31-25-12.us-west-2.compute.internal> | 2015-04-10 07:26:44 +0000 |
commit | 3fe6b42b2192b992083514075f0ab90734b8437c (patch) | |
tree | c871e327b1f19a47515d6cecd034a49c0e34ed62 /nuttx/tools/autobuild.sh | |
parent | e05e2b9be83fc963935bfc23c113c67e7dbcd611 (diff) | |
download | px4-nuttx-3fe6b42b2192b992083514075f0ab90734b8437c.tar.gz px4-nuttx-3fe6b42b2192b992083514075f0ab90734b8437c.tar.bz2 px4-nuttx-3fe6b42b2192b992083514075f0ab90734b8437c.zip |
Add Travis CI supporttravis
Diffstat (limited to 'nuttx/tools/autobuild.sh')
-rwxr-xr-x | nuttx/tools/autobuild.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/nuttx/tools/autobuild.sh b/nuttx/tools/autobuild.sh new file mode 100755 index 000000000..d8ae8c3e2 --- /dev/null +++ b/nuttx/tools/autobuild.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# Build job count +BUILDJOBS=${BUILDJOBS:-2} +BUILDJOBID=${BUILDJOBID:-a} + +# Config count +CONFCOUNT=`find nuttx/configs -name \*defconfig -print | wc -l` +# Number of non-commented (#) and non-empty lines in ignore file +IGNORECOUNT=`cat .travis_ignored_configs.txt | sed '/^\s*#/d;/^\s*$/d' | wc -l` +# Get rid of whitespace +CONFCOUNT=$(echo $CONFCOUNT ) +IGNORECOUNT=$(echo $IGNORECOUNT ) + +echo -e "\n" +echo -e "\0033[34mNuttX Configs: $CONFCOUNT total, $IGNORECOUNT excluded from build\0033[0m" +echo -e "(Add or remove configs to file .travis_ignored_configs to exclude)" +echo -e "----------------------------------------------------------------------------\n" + +CONFIGS=configs.txt + +find nuttx/configs -name \*defconfig -print > $CONFIGS + +# Lines per file +LINES_TOTAL=$(wc -l <${CONFIGS}) +((LINES_PER_FILE = (LINES_TOTAL + BUILDJOBS - 1) / BUILDJOBS)) + +# Perform the split +split -a1 -l${LINES_PER_FILE} ${CONFIGS} configparts. + +echo -e "Operating total $BUILDJOBS build jobs" +echo -e "Running job: configparts.$BUILDJOBID" + +cat "configparts.$BUILDJOBID" | xargs -L1 nuttx/tools/build_config.sh |