1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

fixes in release.py

This commit is contained in:
Gabor Kiss-Vamosi 2020-09-01 09:26:41 +02:00
parent 842eb11448
commit 35ae1a28d4

View File

@ -82,11 +82,12 @@ def cmd(c, exit_on_err = True):
def define_set(fn, name, value):
print("In " + fn + " set " + name + " to " + value)
new_content = ""
new_content = ""
s = r'^ *# *define +' + str(name).rstrip()
f = open(fn, "r")
for i in f.read().splitlines():
r = re.search(r'^ *# *define +' + name, i)
r = re.search(s, i)
if r:
d = i.split("define")
i = d[0] + "define " + name + " " + value
@ -104,8 +105,8 @@ def clone_repos():
os.chdir(workdir)
#For debuging just copy the repos
#cmd("cp -a ../repos/. .")
#return
cmd("cp -a ../repos/. .")
return
cmd("git clone " + upstream("lvgl") + " lvgl; cd lvgl; git checkout master")
cmd("git clone " + upstream("lv_examples") + "; cd lv_examples; git checkout master")
@ -116,8 +117,6 @@ def clone_repos():
for p in proj_list:
cmd("git clone " + upstream(p) + " --recurse-submodules ; cd " + p + "; git checkout master")
exit(1)
def get_lvgl_version(br):
print("Get LVGL's version")
@ -414,27 +413,27 @@ def projs_update():
global proj_list, release_br, ver_str
for p in proj_list:
os.chdir("./" + p)
cmd('git checkout origin master')
cmd('git checkout master')
print(p + ": upadte lvgl");
cmd("cd lvgl; git co " + release_br + "; git pull orogin " + release_br)
cmd("cd lvgl; git co " + release_br + "; git pull origin " + release_br)
cmd("cp -f lvgl/lv_conf_template.h lv_conf.h")
cmd("sed -i -r 's/#if 0/#if 1/' lv_conf.h")
cmd("sed -i -r 's/#if 0/#if 1/' lv_conf.h") # Enable lv_conf.h
d = {}
with open("conf_dsc.txt") as f:
with open("confdef.txt") as f:
for line in f:
(key, val) = line.split()
(key, val) = line.rstrip().split('\t')
d[key] = val
for k,v in d:
define_set("lv_conf.h", k, v)
for k,v in d.items():
define_set("lv_conf.h", str(k), str(v))
if os.path.exists("lv_examples"):
print(p + ": upadte lvlv_examplesgl");
cmd("cd lv_examples; git co " + release_br + "; git pull orogin " + release_br)
print(p + ": upadte lv_examples");
cmd("cd lv_examples; git co " + release_br + "; git pull origin " + release_br)
if os.path.exists("lv_drivers"):
print(p + ": upadte lv_drivers");
cmd("cd lv_drivers " + release_br + "; git pull orogin " + release_br)
cmd("cd lv_drivers " + release_br + "; git pull origin " + release_br)
msg = 'Update to ' + ver_str
cmd("git add .")
@ -453,15 +452,21 @@ def cleanup():
if __name__ == '__main__':
if(len(sys.argv) != 2):
print("Argument error. Usage ./release.py bugfix | minor | major")
exit(1)
#exit(1)
dev_prepare = sys.argv[1]
#dev_prepare = sys.argv[1]
dev_prepare = 'minor'
if not (dev_prepare in prepare_type):
print("Invalid argument. Usage ./release.py bugfix | minor | major")
exit(1)
clone_repos()
get_lvgl_version("master")
projs_update()
exit(1);
lvgl_prepare()
lv_examples_prepare()
lv_drivers_prepare()