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

73 lines
1.9 KiB
Python
Raw Normal View History

2020-10-21 14:06:48 +02:00
#!/usr/bin/env python
import re
import os, fnmatch
import os.path
from os import path
from datetime import date
import com
2020-11-03 11:02:14 +01:00
def lvgl_update_ver(ver, br):
2020-10-21 14:06:48 +02:00
os.chdir("./lvgl")
com.cmd("git checkout " + br)
com.update_version(ver)
com.cmd("git commit -am 'Update " + br + " version'")
com.push("origin " + br)
com.cmd("git checkout master")
2020-10-21 14:06:48 +02:00
os.chdir("../")
def docs_update_ver(ver, br):
os.chdir("./docs")
com.cmd("git checkout " + br + " --")
com.update_version(ver)
com.cmd("git commit -am 'Update " + br + " version'")
com.push("origin " + br)
com.cmd("git checkout master --")
2020-10-21 14:06:48 +02:00
os.chdir("../")
2020-10-21 14:06:48 +02:00
def merge_dev_to_master():
os.chdir("./lvgl")
com.cmd("git checkout master")
com.cmd("git merge dev")
com.push("origin master")
os.chdir("../")
os.chdir("./docs")
com.cmd("git checkout dev -- ") #'dev' sometimes is not recognized so switch to it first
com.cmd("git checkout latest --")
com.cmd("git merge dev -X theirs --no-edit;")
com.push("origin latest")
os.chdir("../")
2020-10-21 14:06:48 +02:00
def make(mode):
if(mode == "bugfix"):
2020-11-03 11:02:14 +01:00
ver = com.get_lvgl_version("master")
ver[3] = "dev"
ver[2] = str(int(ver[2]) + 1)
lvgl_update_ver(ver, "master")
docs_update_ver(ver, "latest")
2020-10-21 14:06:48 +02:00
else:
2020-11-03 11:02:14 +01:00
ver = com.get_lvgl_version("dev")
ver[3] = "dev"
merge_dev_to_master()
if(mode == "major"):
ver[0] = str(int(ver[0]) + 1)
ver[1] = '0'
ver[2] = '0'
2020-11-03 11:02:14 +01:00
if(mode == "minor"):
ver[1] = str(int(ver[1]) + 1)
ver[2] = '0'
lvgl_update_ver(ver, "dev")
2020-11-03 11:02:14 +01:00
docs_update_ver(ver, "dev")
2020-10-21 14:06:48 +02:00
if __name__ == '__main__':
if(len(sys.argv) != 2):
print("Missing argument. Usage ./dev.py major | minor | bugfix")
print("E.g. ./dev.py minor")
else:
make(sys.argv[1])