Skip to content

Instantly share code, notes, and snippets.

@Satark
Last active January 1, 2016 08:09
Show Gist options
  • Save Satark/8116138 to your computer and use it in GitHub Desktop.
Save Satark/8116138 to your computer and use it in GitHub Desktop.
!define PRODUCT_MAJOR "1"
!define PRODUCT_MINOR "0"
!define /date PRODUCT_TIMESTAMP "%y%j"
!define BUILDFILE "LastBuild.txt"
!include "${BUILDFILE}"
!if ${LAST_TIMESTAMP} != ${PRODUCT_TIMESTAMP}
!define NEW_BUILD_NUMBER 0
!else
!define /math NEW_BUILD_NUMBER ${LAST_BUILD_NUMBER} + 1
!endif
!delfile "${BUILDFILE}"
!appendfile "${BUILDFILE}" "!define LAST_BUILD_NUMBER ${NEW_BUILD_NUMBER}$\n"
!appendfile "${BUILDFILE}" "!define LAST_TIMESTAMP ${PRODUCT_TIMESTAMP}$\n"
!define PRODUCT_BUILD "${NEW_BUILD_NUMBER}"
!undef BUILDFILE
!undef NEW_BUILD_NUMBER
!undef LAST_BUILD_NUMBER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment