From aa7a65e613e6339b07b29fbd65dec77d31eaf145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Sun, 24 Apr 2016 05:43:29 +0100 Subject: [PATCH] Updated travis config --- .../bin/generate_version_header_for_marlin | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/LinuxAddons/bin/generate_version_header_for_marlin b/LinuxAddons/bin/generate_version_header_for_marlin index 7160b77786..539a3fe5a7 100755 --- a/LinuxAddons/bin/generate_version_header_for_marlin +++ b/LinuxAddons/bin/generate_version_header_for_marlin @@ -3,24 +3,29 @@ DIR="$1" export DIR OUTFILE="$2" export OUTFILE -echo "/* This file is automatically generated by an Arduino hook" >"$OUTFILE" -echo " * Do not manually edit it" >>"$OUTFILE" -echo " * It does not get committed to the repository" >>"$OUTFILE" -echo " */" >>"$OUTFILE" -echo "" >>"$OUTFILE" -echo "#define PROTOCOL_VERSION \"1.0\"" >>"$OUTFILE" -echo "#define DEFAULT_SOURCE_URL \"https://github.com/MarlinFirmware/Marlin\"" >>"$OUTFILE" -echo "#define DEFAULT_MACHINE_NAME \"Travis 3D Printer\"" >>"$OUTFILE" -echo "#define DEFAULT_MACHINE_UUID \"3442baa1-08ee-435b-8a10-99d185bd43b8\"" >>"$OUTFILE" -echo "" >>"$OUTFILE" +BUILDATE=$(date '+"%s"') +DISTDATE=$(date '+"%Y-%m-%d %H:%M"') -echo "#define BUILD_UNIX_DATETIME" `date +%s` >>"$OUTFILE" -echo "#define STRING_DISTRIBUTION_DATE" `date '+"%Y-%m-%d %H:%M"'` >>"$OUTFILE" -echo "" >>"$OUTFILE" + +cat > "$OUTFILE" <>"$OUTFILE" else BRANCH=" $BRANCH" fi + VERSION=`git describe --tags --first-parent 2>/dev/null` if [ "x$VERSION" != "x" ] ; then echo "#define SHORT_BUILD_VERSION \"$VERSION\"" | sed "s/-.*/$BRANCH\"/" >>"$OUTFILE" @@ -38,8 +44,4 @@ echo "" >>"$OUTFILE" echo "#define SHORT_BUILD_VERSION \"$BRANCH\"" >>"$OUTFILE" echo "#define DETAILED_BUILD_VERSION \"${BRANCH}-$VERSION\"" >>"$OUTFILE" fi - URL=`git config --local --get remote.origin.url | sed "sx.*github.com.xhttps://github.com/x" | sed "sx\.gitx/x"` - if [ "x$URL" != "x" ] ; then - echo "#define SOURCE_CODE_URL \""$URL"\"" >>"$OUTFILE" - fi )