diff --git a/.gitignore b/.gitignore index 8f23425a3..def49a797 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ internal/config.txt internal/help internal/config(2).txt internal/config(1).txt +internal/version.txt diff --git a/.travis/appveyor.bat b/.travis/appveyor.bat index 83f908330..3f4cc5c26 100644 --- a/.travis/appveyor.bat +++ b/.travis/appveyor.bat @@ -42,7 +42,7 @@ IF ERRORLEVEL 1 exit /b 1 cd ..\.. echo Compiling new QB64 -echo AutoBuildMsg$ = CHR$(10) + "From git %APPVEYOR_REPO_COMMIT:~0,7%" >> source\global\version.bas +echo From git %APPVEYOR_REPO_COMMIT:~0,7% > internal\version.txt qb64_bootstrap.exe -x source\qb64.bas -o qb64.exe IF ERRORLEVEL 1 exit /b 1 diff --git a/.travis/build-osx.sh b/.travis/build-osx.sh index ae212ff47..e28257d7f 100755 --- a/.travis/build-osx.sh +++ b/.travis/build-osx.sh @@ -38,7 +38,7 @@ cd - > /dev/null ###### Part 2: Build new QB64 from .bas sources ###### echo "Translating .bas source..." -echo AutoBuildMsg\$ = CHR\$\(10\) + \"From git `echo $TRAVIS_COMMIT | sed 's/\(.......\).*$/\1/'`\" >> source/global/version.bas +echo From git `echo $TRAVIS_COMMIT | sed 's/\(.......\).*$/\1/'` > internal/version.txt ./qb64_bootstrap -x -z source/qb64.bas > /tmp/qb64-output rm qb64_bootstrap if [ `wc -l /tmp/qb64-output |awk '{print $1}'` -gt 2 ]; then diff --git a/.travis/build.sh b/.travis/build.sh index 205762c0b..d312a0554 100755 --- a/.travis/build.sh +++ b/.travis/build.sh @@ -38,7 +38,7 @@ cd - > /dev/null ###### Part 2: Build new QB64 from .bas sources ###### echo -n "Translating .bas source..." -echo AutoBuildMsg\$ = CHR\$\(10\) + \"From git `echo $TRAVIS_COMMIT | sed 's/\(.......\).*$/\1/'`\" >> source/global/version.bas +echo From git `echo $TRAVIS_COMMIT | sed 's/\(.......\).*$/\1/'` > internal/version.txt ./qb64_bootstrap -x -z source/qb64.bas > /tmp/qb64-output rm qb64_bootstrap if [ `wc -l /tmp/qb64-output |awk '{print $1}'` -gt 2 ]; then diff --git a/source/global/version.bas b/source/global/version.bas index efecac822..af8cffacb 100644 --- a/source/global/version.bas +++ b/source/global/version.bas @@ -1,7 +1,13 @@ DIM SHARED Version AS STRING DIM SHARED BuildNum AS STRING DIM SHARED AutoBuildMsg AS STRING + Version$ = "1.2" -'BuildNum format is YYYYMMDD/id, where id is a ever-increasing -'integer. If you make a change, update the date and increase the id! BuildNum$ = "[dev build]" +IF _FILEEXISTS("internal/version.txt") THEN + versionfile = FREEFILE + OPEN "internal/version.txt" FOR INPUT AS #versionfile + LINE INPUT #versionfile, AutoBuildMsg + CLOSE #versionfile +END IF + diff --git a/source/ide/ide_methods.bas b/source/ide/ide_methods.bas index 8a79a399e..6fe6ddec5 100644 --- a/source/ide/ide_methods.bas +++ b/source/ide/ide_methods.bas @@ -4734,7 +4734,7 @@ FUNCTION ide2 (ignore) IF menu$(m, s) = "#About..." THEN PCOPY 2, 0 - idemessagebox "About", "QB64 Version " + Version$ + CHR$(10) + "Revision " + BuildNum$ + AutoBuildMsg$ + idemessagebox "About", "QB64 Version " + Version$ + CHR$(10) + "Revision " + BuildNum$ + CHR$(10) + AutoBuildMsg$ PCOPY 3, 0: SCREEN , , 3, 0: idewait4mous: idewait4alt GOTO ideloop END IF