2022.6.15 - set-version #81
@ -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": {},
|
||||
|
@ -4,7 +4,7 @@
|
||||
"Version": {
|
||||
"Major": "2022",
|
||||
"Minor": "6",
|
||||
"Micro": "15.dev2"
|
||||
"Micro": "15.dev3"
|
||||
},
|
||||
"Author": "Sven Heidemann",
|
||||
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
||||
|
@ -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": {},
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user