2022.6.15 - set-version #81

Merged
edraft merged 19 commits from 2022.6.15 into 2022.6 2022-05-25 19:10:35 +02:00
4 changed files with 19 additions and 5 deletions
Showing only changes of commit ac83555b24 - Show all commits

View File

@ -4,7 +4,7 @@
"Version": {
"Major": "2022",
"Minor": "6",
"Micro": "15.dev2"
"Micro": "15.dev3"
},
"Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de",
@ -16,7 +16,7 @@
"LicenseName": "MIT",
"LicenseDescription": "MIT, see LICENSE for more details.",
"Dependencies": [
"cpl-core>=2022.6.15.dev2"
"cpl-core>=2022.6.15.dev3"
],
"PythonVersion": ">=3.10",
"PythonPath": {},

View File

@ -4,7 +4,7 @@
"Version": {
"Major": "2022",
"Minor": "6",
"Micro": "15.dev2"
"Micro": "15.dev3"
},
"Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de",

View File

@ -4,7 +4,7 @@
"Version": {
"Major": "2022",
"Minor": "6",
"Micro": "15.dev2"
"Micro": "15.dev3"
},
"Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de",
@ -16,7 +16,7 @@
"LicenseName": "MIT",
"LicenseDescription": "MIT, see LICENSE for more details.",
"Dependencies": [
"cpl-core>=2022.6.15.dev2"
"cpl-core>=2022.6.15.dev3"
],
"PythonVersion": ">=3.10",
"PythonPath": {},

View File

@ -1,6 +1,8 @@
import json
import os
from cpl_core.console import Console
from cpl_core.environment import ApplicationEnvironmentABC
@ -17,6 +19,18 @@ class VersionSetterService:
f.close()
project_json['ProjectSettings']['Version'] = version
dependencies = project_json['ProjectSettings']['Dependencies']
new_deps = []
for dependency in dependencies:
if not dependency.startswith('cpl-'):
new_deps.append(dependency)
continue
dep_version = dependency.split('=')[1]
new_deps.append(dependency.replace(dep_version, f'{version["Major"]}.{version["Minor"]}.{version["Micro"]}'))
project_json['ProjectSettings']['Dependencies'] = new_deps
with open(os.path.join(self._env.working_directory, file), 'w', encoding='utf-8') as f:
f.write(json.dumps(project_json, indent=2))
f.close()