Move to a different versioning - major v minor . commits_since_release

This commit is contained in:
Gordon Williams 2015-06-03 13:47:12 +01:00
parent 9509b06681
commit 10464eabd0
3 changed files with 19 additions and 2 deletions

View File

@ -90,6 +90,13 @@ ifdef RELEASE
DEFINES += -DNO_ASSERT -DRELEASE
endif
LATEST_RELEASE=$(shell git tag | grep RELEASE_ | sort | tail -1)
COMMITS_SINCE_RELEASE=$(shell git log --oneline $(LATEST_RELEASE)..HEAD | wc -l)
ifneq ($(COMMITS_SINCE_RELEASE),0)
DEFINES += -DBUILDNUMBER=\"$(COMMITS_SINCE_RELEASE)\"
endif
CWD = $(shell pwd)
ROOT = $(CWD)
PRECOMPILED_OBJS=

View File

@ -294,14 +294,19 @@ def get_ifdef_description(d):
def get_script_dir():
return os.path.dirname(os.path.realpath(__file__))
def get_version():
scriptdir = get_script_dir()
jsutils = scriptdir+"/../src/jsutils.h"
version = re.compile("^.*JS_VERSION.*\"(.*)\"");
latest_release = subprocess.check_output('git tag | grep RELEASE_ | sort | tail -1', shell=True).strip()
commits_since_release = subprocess.check_output('git log --oneline '+latest_release+'..HEAD | wc -l', shell=True).strip()
for line in open(jsutils):
match = version.search(line);
if (match != None):
return match.group(1);
v = match.group(1);
if commits_since_release==0: return v
else: return v+"."+commits_since_release
def get_name_or_space(jsondata):

View File

@ -35,7 +35,12 @@ extern int isfinite ( double );
#endif
#define JS_VERSION "1v80"
#ifndef BUILDNUMBER
#define JS_VERSION "1v79"
#else
#define JS_VERSION "1v79." BUILDNUMBER
#endif
/*
In code:
TODO - should be fixed