Browse Source

Merge pull request #1418 from mcspr/version-suffix

APP_VERSION suffix
refactor-terminal
Xose Pérez 5 years ago
committed by GitHub
parent
commit
9cf2b50f6c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 7 deletions
  1. +17
    -6
      code/build.sh
  2. +1
    -1
      code/espurna/config/version.h

+ 17
- 6
code/build.sh View File

@ -19,14 +19,25 @@ stat_bytes() {
# Script settings
destination=../firmware
version=$(grep APP_VERSION espurna/config/version.h | awk '{print $3}' | sed 's/"//g')
version_file=espurna/config/version.h
version=$(grep -E '^#define APP_VERSION' $version_file | awk '{print $3}' | sed 's/"//g')
if is_git; then
if ${TRAVIS:-false}; then
git_revision=${TRAVIS_COMMIT::7}
git_tag=${TRAVIS_TAG}
elif is_git; then
git_revision=$(git rev-parse --short HEAD)
git_version=${version}-${git_revision}
git_tag=$(git tag --contains HEAD)
else
git_revision=
git_version=$version
git_revision=unknown
git_tag=
fi
if [[ -n $git_tag ]]; then
new_version=${version/-*}
sed -i -e "s@$version@$new_version@" $version_file
version=$new_version
trap "git checkout -- $version_file" EXIT
fi
par_build=false
@ -139,7 +150,7 @@ shift $((OPTIND-1))
# Welcome
echo "--------------------------------------------------------------"
echo "ESPURNA FIRMWARE BUILDER"
echo "Building for version ${git_version}"
echo "Building for version ${version}" ${git_revision:+($git_revision)}
# Environments to build
environments=$@


+ 1
- 1
code/espurna/config/version.h View File

@ -1,5 +1,5 @@
#define APP_NAME "ESPURNA"
#define APP_VERSION "1.13.4"
#define APP_VERSION "1.13.4-dev"
#define APP_AUTHOR "xose.perez@gmail.com"
#define APP_WEBSITE "http://tinkerman.cat"
#define CFG_VERSION 3

Loading…
Cancel
Save