diff --git a/.vscode/launch.json b/.vscode/launch.json index 64905a19..36735b91 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,6 +4,7 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { "name": "Python TASK generate-nullable", @@ -26,7 +27,7 @@ "console": "integratedTerminal" }, { - "name": "Python TASK build-samples", + "name": "build-samples", "type": "python", "request": "launch", "module": "invoke", @@ -34,6 +35,18 @@ "build-samples" ], "console": "integratedTerminal" + }, + { + "name": "release", + "type": "python", + "request": "launch", + "module": "invoke", + "args": [ + "release", + "--skip-build", + "--skip-tests" + ], + "console": "integratedTerminal" } ] } \ No newline at end of file diff --git a/README.md b/README.md index d948bb0e..4bf05924 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # DelphiMVCFramework ![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg) ![GitHub All Releases](https://img.shields.io/github/downloads/danieleteti/delphimvcframework/total?label=Downloads) ![](https://img.shields.io/badge/stable-dmvcframework--3.4.1--sodium-blue) -![](https://img.shields.io/badge/beta-dmvcframework--3.5.0--magnesium--beta-red) +![](https://img.shields.io/badge/beta-dmvcframework--3.4.2--magnesium--beta-red) diff --git a/sources/dmvcframeworkbuildconsts.inc b/sources/dmvcframeworkbuildconsts.inc index 04a3c1d7..f7950b35 100644 --- a/sources/dmvcframeworkbuildconsts.inc +++ b/sources/dmvcframeworkbuildconsts.inc @@ -1,2 +1,2 @@ const - DMVCFRAMEWORK_VERSION = '3.4.1-sodium'; \ No newline at end of file + DMVCFRAMEWORK_VERSION = '3.4.2-magnesium-beta'; \ No newline at end of file diff --git a/tasks.py b/tasks.py index a59383a3..e8f3de19 100644 --- a/tasks.py +++ b/tasks.py @@ -393,15 +393,36 @@ def tests64(ctx): def tests(ctx): pass +def get_version_from_file(): + with open(r".\sources\dmvcframeworkbuildconsts.inc") as f: + lines = f.readlines() + res = [x for x in lines if "DMVCFRAMEWORK_VERSION" in x] + if len(res) != 1: + raise Exception("Cannot find DMVCFRAMEWORK_VERSION in dmvcframeworkbuildconsts.inc file") + version_line: str = res[0] + version_line = version_line.strip(" ;\t") + pieces = version_line.split("=") + if len(pieces) != 2: + raise Exception("Version line in wrong format in dmvcframeworkbuildconsts.inc file: " + version_line) + version = pieces[1].strip("' ") + if not 'framework' in version: + version = "dmvcframework-" + version + if "beta" in version.lower(): + print(Fore.RESET + Fore.RED + "WARNING - BETA VERSION: " + version + Fore.RESET) + else: + print(Fore.RESET + Fore.GREEN + "BUILDING VERSION: " + version + Fore.RESET) + return version @task() def release( ctx, - version="DEBUG", skip_build=False, skip_tests=False, ): """Builds all the projects, executes integration tests and prepare the release""" + + version = get_version_from_file() + init_build(version) if not skip_tests: