-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.bzl
37 lines (30 loc) · 1.51 KB
/
config.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
author = 'djungelorm'
version = '0.4.7'
ksp_version_max = '1.4.4.2215'
ksp_version_min = '1.2.2.1622'
ksp_version_max_parts = ksp_version_max.split('.')
ksp_version_min_parts = ksp_version_min.split('.')
def get_version_parts(version):
version_parts = version.partition('-')[0].split('.')
if '-' in version:
version_parts.extend(version.partition('-')[2].split('-'))
return version_parts
version_parts = get_version_parts(version)
# Python version x.y.z[+w.w]
python_version = \
'.'.join(version_parts) if len(version_parts) == 3 \
else '.'.join(version_parts[:3])+'+'+'.'.join(version_parts[3:])
# C# assembly version: x.y.z[.w]
assembly_version = '.'.join(version_parts[:4])
# Nuget package version: x.y.z[-buildw]
nuget_version = \
'.'.join(version_parts[:3]) if len(version_parts) == 3 \
else '.'.join(version_parts[:3])+'-build'+version_parts[3]
# Lua rock version: x.y.z[.w]
lua_version = '.'.join(version_parts[:4])
# KSP-AVC versions
avc_version = \
'"MAJOR": %s, "MINOR": %s, "PATCH": %s' % (version_parts[0],version_parts[1],version_parts[2]) if len(version_parts) == 3 \
else '"MAJOR": %s, "MINOR": %s, "PATCH": %s, "BUILD": %s' % (version_parts[0],version_parts[1],version_parts[2],version_parts[3])
ksp_avc_version_max = '"MAJOR": %s, "MINOR": %s, "PATCH": %s' % (ksp_version_max_parts[0],ksp_version_max_parts[1],ksp_version_max_parts[2])
ksp_avc_version_min = '"MAJOR": %s, "MINOR": %s, "PATCH": %s' % (ksp_version_min_parts[0],ksp_version_min_parts[1],ksp_version_min_parts[2])