mirror of
https://github.com/espruino/Espruino.git
synced 2025-12-08 19:06:15 +00:00
Move to a different versioning - major v minor . commits_since_release
This commit is contained in:
parent
9509b06681
commit
10464eabd0
7
Makefile
7
Makefile
@ -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=
|
||||
|
||||
@ -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):
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user