mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-03 02:34:30 +08:00
Deal with missing build version number
Makes it a bit more messy and weird, but that's what you get when your script has 16 parameters, I guess. Contributes to issue CURA-9365.
This commit is contained in:
parent
54f9384d27
commit
d91b93b3d7
@ -4,7 +4,7 @@
|
|||||||
!define APP_NAME "{{ app_name }} {{ version_major }}.{{ version_minor }}.{{ version_patch }}"
|
!define APP_NAME "{{ app_name }} {{ version_major }}.{{ version_minor }}.{{ version_patch }}"
|
||||||
!define COMP_NAME "{{ company }}"
|
!define COMP_NAME "{{ company }}"
|
||||||
!define WEB_SITE "{{ web_site }}"
|
!define WEB_SITE "{{ web_site }}"
|
||||||
!define VERSION "{{ version_major }}.{{ version_minor }}.{{ version_patch }}.{{ version_build }}"
|
!define VERSION "{{ version_major }}.{{ version_minor }}.{{ version_patch }}{{ version_build }}"
|
||||||
!define COPYRIGHT "Copyright (c) {{ year }} {{ company }}"
|
!define COPYRIGHT "Copyright (c) {{ year }} {{ company }}"
|
||||||
!define DESCRIPTION "Application"
|
!define DESCRIPTION "Application"
|
||||||
!define LICENSE_TXT "{{ cura_license_file }}"
|
!define LICENSE_TXT "{{ cura_license_file }}"
|
||||||
|
@ -15,7 +15,7 @@ if __name__ == "__main__":
|
|||||||
- version_major: Major version number of Semver (e.g. 5).
|
- version_major: Major version number of Semver (e.g. 5).
|
||||||
- version_minor: Minor version number of Semver (e.g. 0).
|
- version_minor: Minor version number of Semver (e.g. 0).
|
||||||
- version_patch: Patch version number of Semver (e.g. 0).
|
- version_patch: Patch version number of Semver (e.g. 0).
|
||||||
- version_build: A version number that gets manually incremented at each build.
|
- version_build: (optional) A version number that gets manually incremented at each build.
|
||||||
- company: Publisher of the application. Should be "Ultimaker B.V."
|
- company: Publisher of the application. Should be "Ultimaker B.V."
|
||||||
- web_site: Website to find more information. Should be "https://ultimaker.com".
|
- web_site: Website to find more information. Should be "https://ultimaker.com".
|
||||||
- cura_license_file: Path to a license file in Cura. Should point to packaging/cura_license.txt in this repository.
|
- cura_license_file: Path to a license file in Cura. Should point to packaging/cura_license.txt in this repository.
|
||||||
@ -50,23 +50,30 @@ if __name__ == "__main__":
|
|||||||
with open(jinja_template_path, "r") as f:
|
with open(jinja_template_path, "r") as f:
|
||||||
template = Template(f.read())
|
template = Template(f.read())
|
||||||
|
|
||||||
|
if len(sys.argv) == 15: # No version-build
|
||||||
|
version_build = ""
|
||||||
|
use_version_build = 0
|
||||||
|
else:
|
||||||
|
version_build = "." + sys.argv[8]
|
||||||
|
use_version_build = 1
|
||||||
|
|
||||||
nsis_content = template.render(
|
nsis_content = template.render(
|
||||||
app_name = sys.argv[3],
|
app_name = sys.argv[3],
|
||||||
main_app = sys.argv[4],
|
main_app = sys.argv[4],
|
||||||
version_major = sys.argv[5],
|
version_major = sys.argv[5],
|
||||||
version_minor = sys.argv[6],
|
version_minor = sys.argv[6],
|
||||||
version_patch = sys.argv[7],
|
version_patch = sys.argv[7],
|
||||||
version_build = sys.argv[8],
|
version_build = version_build,
|
||||||
company = sys.argv[9],
|
company = sys.argv[8 + use_version_build],
|
||||||
web_site = sys.argv[10],
|
web_site = sys.argv[9 + use_version_build],
|
||||||
year = datetime.now().year,
|
year = datetime.now().year,
|
||||||
cura_license_file = Path(sys.argv[11]),
|
cura_license_file = Path(sys.argv[10 + use_version_build]),
|
||||||
compression_method = sys.argv[12], # ZLIB, BZIP2 or LZMA
|
compression_method = sys.argv[11 + use_version_build], # ZLIB, BZIP2 or LZMA
|
||||||
cura_banner_img = Path(sys.argv[13]),
|
cura_banner_img = Path(sys.argv[12 + use_version_build]),
|
||||||
cura_icon = Path(sys.argv[14]),
|
cura_icon = Path(sys.argv[13 + use_version_build]),
|
||||||
mapped_out_paths = mapped_out_paths,
|
mapped_out_paths = mapped_out_paths,
|
||||||
rmdir_paths = rmdir_paths,
|
rmdir_paths = rmdir_paths,
|
||||||
destination = Path(sys.argv[15])
|
destination = Path(sys.argv[14 + use_version_build])
|
||||||
)
|
)
|
||||||
|
|
||||||
with open(dist_loc.parent.joinpath(jinja_template_path.stem), "w") as f:
|
with open(dist_loc.parent.joinpath(jinja_template_path.stem), "w") as f:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user