diff options
author | jkoan <jkoan@users.noreply.github.com> | 2017-06-25 03:49:45 +0200 |
---|---|---|
committer | Pierre GRANDIN <pgrandin@users.noreply.github.com> | 2017-06-24 18:49:45 -0700 |
commit | 1d82081603d4ea967db0bf2e5e982bdb97ba07ec (patch) | |
tree | 2d4bf5e40644fe654439cfac97f52f7d12b4cb52 | |
parent | 12628850a99b25d0a8a61cde038cca8af4ef1b12 (diff) | |
download | navit-1d82081603d4ea967db0bf2e5e982bdb97ba07ec.tar.gz |
Use datecode insted of Tags as Android id (#274)
* Remove all git repo test and use date to get rid of all tags
* Del rests...
* Dont delete to much? :D
-rw-r--r-- | ci/update_version.sh | 32 | ||||
-rw-r--r-- | circle.yml | 2 | ||||
-rwxr-xr-x | cmake/version.cmake | 40 |
3 files changed, 12 insertions, 62 deletions
diff --git a/ci/update_version.sh b/ci/update_version.sh deleted file mode 100644 index b34b0da73..000000000 --- a/ci/update_version.sh +++ /dev/null @@ -1,32 +0,0 @@ -if [ -z "$CIRCLE_BUILD_NUM" -o "$CIRCLE_PROJECT_USERNAME" != "navit-gps" ] ; then - exit -fi - -if ! git --no-pager log -n 1 ; then - echo "This script should be run from the versioned directory" - exit 1 -fi - -if [ "$CIRCLE_BRANCH" != "trunk" ] ; then - exit -fi - -TAG=R$(( 5658 + $CIRCLE_BUILD_NUM )) - -if [ "$1" == "prepare" ] ; then - git log -1 --format="%H %d" | grep 'tag: R' - if [ $? -eq 0 ] ; then - echo "This commit is already tagged." - exit - fi - git tag $TAG - exit -fi - -if [ "$1" == "push" ] ; then - git log -1 --format="%H %d" | grep "tag: $TAG" - if [ $? -eq 0 ] ; then - echo Pushing tag $TAG to origin... - git push origin $TAG - fi -fi diff --git a/circle.yml b/circle.yml index 9321c75b1..0002cc7f5 100644 --- a/circle.yml +++ b/circle.yml @@ -10,7 +10,6 @@ dependencies: - "[ -d ~/assets ] || mkdir ~/assets" - "[ -d ~/android ] || mkdir ~/android" - sudo apt-get update - - bash ci/update_version.sh prepare # Android build - sudo apt-get install gettext - sudo apt-get install libsaxonb-java @@ -39,7 +38,6 @@ deployment: branch: trunk owner: navit-gps commands: - - bash ci/update_version.sh push - git push origin $CIRCLE_SHA1:refs/heads/master merge_translations: branch: /i18n.*/ diff --git a/cmake/version.cmake b/cmake/version.cmake index eddf0b479..8f82d9f61 100755 --- a/cmake/version.cmake +++ b/cmake/version.cmake @@ -2,34 +2,18 @@ FIND_PROGRAM(GIT_EXECUTABLE NAMES git git.exe DOC "git command line client") get_filename_component(SOURCE_DIR ${SRC} PATH) -if (GIT_EXECUTABLE) - EXECUTE_PROCESS( - COMMAND ${GIT_EXECUTABLE} log "--format=%h %d" - WORKING_DIRECTORY "${SOURCE_DIR}" - OUTPUT_VARIABLE VERSION - ERROR_VARIABLE GIT_ERROR - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_STRIP_TRAILING_WHITESPACE - ) - if(NOT VERSION) - message(STATUS "Cannot determine current git commit - git error: '${GIT_ERROR}'") - set(VERSION "0000") - endif() -else() - message(STATUS "git not found, cannot record git commit") - set(VERSION "0000") -endif(GIT_EXECUTABLE) - -string(REGEX MATCH "R[0-9]+" VERSION_NUM ${VERSION} ) -if(NOT VERSION_NUM) - message(STATUS "I can't find a release tag. This is probably not Navit's official tree") - message(STATUS "It's OK, I will default to 0000") - set(VERSION_NUM "0000") -endif() -string(REPLACE "R" "" VERSION_NUM ${VERSION_NUM} ) -if(NOT VERSION_NUM) - set(VERSION_NUM "0000") -endif() +string(TIMESTAMP VERSION "%y%m%d%H%M") + +string(REGEX MATCH "[0-9]+" VERSION_NUM ${VERSION} ) +if(NOT VERSION_NUM) + message(STATUS "I can't find a release tag. This is probably not Navit's official tree") + message(STATUS "It's OK, I will default to 0000") + set(VERSION_NUM "0000") +endif() +string(REPLACE "R" "" VERSION_NUM ${VERSION_NUM} ) +if(NOT VERSION_NUM) + set(VERSION_NUM "0000") +endif() string(REGEX MATCH "^[a-z0-9]+" VERSION ${VERSION} ) |