Open CazYokoyama opened 2 years ago
…363.
You need to run the following commands.
cat <<EOF >make-git-version #!/bin/bash
[ -n "\$1" ] && cd "$1" || exit 1
version=\$(git describe --tags --always --dirty 2> /dev/null)
[ -n "\$version" ] || version=\$(date -I)
echo "#define GIT_VERSION \"\$version\"" > \$2/sketch/git-version.h EOF chmod +x make-git-version sudo mv make-git-version /usr/local/bin/ echo recipe.hooks.sketch.prebuild.1.pattern=make-git-version "{build.source.path}" "{build.path}" >~/.arduino15/packages/esp32/hardware/esp32/1.0.6/platform.local.txt touch software/firmware/source/SoftRF/git-version.h
By above commands, arduino runs /usr/local/bin/make-git-version on compile. It creates /tmp/arduino_build_XXXXXX/sketch/git-version.h which has
define GIT_VERSION "0.1.0-26-1-gd529363"
for example.
…363.
You need to run the following commands.
Go to the source directory.
Build a version string with git.
If this is not a git repository, fallback to the compilation date.
Save this in git-version.h.
By above commands, arduino runs /usr/local/bin/make-git-version on compile. It creates /tmp/arduino_build_XXXXXX/sketch/git-version.h which has
for example.