toxcore/other/version-sync
iphydf b8b9789a69
Rebuild apidsl'd headers in cmake.
- Moved apidsl headers next to their generated versions. In the future,
  perhaps all (or most) headers will be apidsl-generated, so the sources
  should stay together.
- Try to find apidsl/apigen binary and astyle binary and use it for the
  format test. Don't run the format test if these can't be found.
2016-10-02 23:54:03 +01:00

29 lines
625 B
Bash
Executable File

#!/bin/sh
set -eu
SOURCE_DIR=$1
MAJOR=$2
MINOR=$3
PATCH=$4
VER="$MAJOR.$MINOR.$PATCH"
update() {
file="$SOURCE_DIR/$1"
expr="$2"
sed -e "$expr" "$file" > "$file.updated-version"
if diff "$file" "$file.updated-version"; then
rm "$file.updated-version"
else
mv "$file.updated-version" "$file"
fi
}
update 'configure.ac' 's/AC_INIT(\[tox\], \[.*\])/AC_INIT([tox], ['$VER'])/'
update 'toxcore/tox.api.h' 's/\(const VERSION_MAJOR *= \).*;/\1'$MAJOR';/'
update 'toxcore/tox.api.h' 's/\(const VERSION_MINOR *= \).*;/\1'$MINOR';/'
update 'toxcore/tox.api.h' 's/\(const VERSION_PATCH *= \).*;/\1'$PATCH';/'